-
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
Conversation
I exposed only @Nikratio I don't know what you meant in this comment SupraSummus@2e128ca#r59074244. How can I merge getter and setter into one func? |
Thanks for the patch! I think just exposing I think your current patch overcomplicates things a bit though (wasn't it much simpler in the beginning)? I think all you need is a new (pure-Python) ConnInfo class with a single |
src/_pyfuse3.py
Outdated
@@ -65,7 +65,7 @@ class Operations: | |||
enable_writeback_cache: bool = False | |||
enable_acl: bool = False | |||
|
|||
def init(self) -> None: | |||
def init(self, conn_info) -> None: |
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
src/pyfuse3.pyx
Outdated
@@ -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 comment
The 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
src/pyfuse3.pyi
Outdated
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
Why both this and the cdef
clas in pyfuse3.pyx
? Isn't one sufficient?
src/pyfuse3.pyx
Outdated
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 comment
The 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 max_read
parameter?
src/handlers.pxi
Outdated
# Blocking rather than async, in case we decide to let the | ||
# init hander modify `conn` in the future. | ||
operations.init() | ||
cdef object conn_obj = ConnInfo(max_read=conn.max_read) |
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.
cdef object
does nothing, please omit.
src/handlers.pxi
Outdated
# init hander modify `conn` in the future. | ||
operations.init() | ||
cdef object conn_obj = ConnInfo(max_read=conn.max_read) | ||
# Blocking rather than async, to let the init hander modify `conn_obj`. |
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.
This comment doesn't make sense. async functions can modify their parameters too. Just omit it entirely, having it sync is fine.
Are you still interested in working on this? |
It's finished except unit tests. I tried to write one and got stuck, but someday I'll get it done. If you don't want hanging PR in the repo feel free to close it and I'll reopen it when the test is ready. |
Related to issue #49