-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose API for modifying fuse_conn_info.max_read #50
Changes from 3 commits
ce20b49
2e128ca
3a5bfde
1b0dcba
dcdfcdb
dfe3214
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,6 +72,15 @@ class FileInfo: | |
def __cinit__(self, fh: FileHandleT, direct_io: bool, keep_cache: bool, nonseekable: bool) -> None: ... | ||
# def _copy_to_fuse(self, fuse_file_info *out) -> None: ... | ||
|
||
|
||
class ConnInfo: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why both this and the |
||
max_read: int | ||
|
||
def __cinit__(self) -> None: ... | ||
def __getstate__(self) -> StatDict: ... | ||
def __setstate__(self, state: StatDict) -> None: ... | ||
|
||
|
||
class StatvfsData: | ||
f_bsize: int | ||
f_frsize: int | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -393,6 +393,37 @@ cdef class FileInfo: | |
out.nonseekable = 0 | ||
|
||
|
||
@cython.freelist(1) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this is needed for something that's used once |
||
cdef class ConnInfo: | ||
''' | ||
Instances of this class store information about the fuse connection. | ||
The attributes correspond to the elements of the ``fuse_conn_info`` struct. | ||
''' | ||
|
||
cdef fuse_conn_info conn | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the point of keeping a copy of the whole struct around, if all you care about is the |
||
|
||
def __cinit__(self): | ||
string.memset(&self.conn, 0, sizeof(fuse_conn_info)) | ||
|
||
@property | ||
def max_read(self): | ||
return self.conn.max_read | ||
@max_read.setter | ||
def max_read(self, val): | ||
self.conn.max_read = val | ||
|
||
# Pickling and copy support | ||
def __getstate__(self): | ||
state = dict() | ||
for k in ('max_read',): | ||
state[k] = getattr(self, k) | ||
return state | ||
|
||
def __setstate__(self, state): | ||
for (k,v) in state.items(): | ||
setattr(self, k, v) | ||
|
||
|
||
@cython.freelist(1) | ||
cdef class StatvfsData: | ||
''' | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a type annotation for the second argument