Skip to content
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

Linux 3.11 compat: fops->iterate() #1653

Closed
wants to merge 1 commit into from

Conversation

behlendorf
Copy link
Contributor

Commit torvalds/linux@2233f31
replaced ->readdir() with ->iterate() in struct file_operations.
All filesystems must now use the new ->iterate method.

To handle this the code was reworked to use the new ->iterate
interface. Care was taken to keep the majority of changes
confined to the ZPL layer which is already Linux specific.
However, minor changes were required to the common zfs_readdir()
function.

Compatibility with older kernels was accomplished by adding
versions of the trivial dir_emit* helper functions. Also the
various *_readdir() functions were reworked in to wrappers
which create a dir_context structure to pass to the new
*_iterate() functions.

This all resulted in a nice simplication of the existing
core, this is particularly true for the control directory
implementation in zpl_ctldir.c.

Signed-off-by: Brian Behlendorf behlendorf1@llnl.gov

@ryao
Copy link
Contributor

ryao commented Aug 15, 2013

This looks good.

Commit torvalds/linux@2233f31
replaced ->readdir() with ->iterate() in struct file_operations.
All filesystems must now use the new ->iterate method.

To handle this the code was reworked to use the new ->iterate
interface.  Care was taken to keep the majority of changes
confined to the ZPL layer which is already Linux specific.
However, minor changes were required to the common zfs_readdir()
function.

Compatibility with older kernels was accomplished by adding
versions of the trivial dir_emit* helper functions.  Also the
various *_readdir() functions were reworked in to wrappers
which create a dir_context structure to pass to the new
*_iterate() functions.

Unfortunately, the new dir_emit* functions prevent us from
passing a private pointer to the filldir function.  The xattr
directory code leveraged this ability through zfs_readdir()
to generate the list of xattr names.  Since we can no longer
use zfs_readdir() a simplified zpl_xattr_readdir() function
was added to perform the same task.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
@behlendorf
Copy link
Contributor Author

@ryao I've refreshed the patch after discovering an issue with the xattr implementation for 3.11 kernels. We can no longer use zfs_readdir() there because we've lost the ability to pass a private data pointer to the filldir handler. I've reworked the code to address this and I like the results, it's simpler and should suffer from breakage if the kernel interfaces change again.

@behlendorf
Copy link
Contributor Author

The refreshed patch now passed automated regression testing on all the builders.

@behlendorf
Copy link
Contributor Author

@ryao Unless you have an outstanding concerns I'm going to merge this. It passed an entire evening of torture testing.

@ryao
Copy link
Contributor

ryao commented Aug 16, 2013

I have no concerns with this patch.

unya pushed a commit to unya/zfs that referenced this pull request Dec 13, 2013
Commit torvalds/linux@2233f31
replaced ->readdir() with ->iterate() in struct file_operations.
All filesystems must now use the new ->iterate method.

To handle this the code was reworked to use the new ->iterate
interface.  Care was taken to keep the majority of changes
confined to the ZPL layer which is already Linux specific.
However, minor changes were required to the common zfs_readdir()
function.

Compatibility with older kernels was accomplished by adding
versions of the trivial dir_emit* helper functions.  Also the
various *_readdir() functions were reworked in to wrappers
which create a dir_context structure to pass to the new
*_iterate() functions.

Unfortunately, the new dir_emit* functions prevent us from
passing a private pointer to the filldir function.  The xattr
directory code leveraged this ability through zfs_readdir()
to generate the list of xattr names.  Since we can no longer
use zfs_readdir() a simplified zpl_xattr_readdir() function
was added to perform the same task.

Signed-off-by: Richard Yao <ryao@cs.stonybrook.edu>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes openzfs#1653
Issue openzfs#1591
@behlendorf behlendorf deleted the linux-3.11 branch February 16, 2017 00:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants