-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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: s_op: use .free_inode #16788
base: master
Are you sure you want to change the base?
Linux: s_op: use .free_inode #16788
Changes from all commits
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_FREE], [ | ||
ZFS_LINUX_TEST_SRC([inode_free], [ | ||
#include <linux/fs.h> | ||
|
||
static void inode_free(struct inode *ip) | ||
{ return; } | ||
|
||
static const struct super_operations | ||
iops __attribute__ ((unused)) = { | ||
.free_inode = inode_free, | ||
}; | ||
],[]) | ||
]) | ||
|
||
AC_DEFUN([ZFS_AC_KERNEL_INODE_FREE], [ | ||
AC_MSG_CHECKING([whether inode_free() is available]) | ||
ZFS_LINUX_TEST_RESULT([inode_free], [ | ||
AC_MSG_RESULT(yes) | ||
AC_DEFINE(HAVE_INODE_FREE, 1, | ||
[.inode_free() i_op exists]) | ||
],[ | ||
AC_MSG_RESULT(no) | ||
]) | ||
]) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,7 +43,13 @@ zpl_inode_alloc(struct super_block *sb) | |
return (ip); | ||
} | ||
|
||
static void | ||
static void __maybe_unused | ||
zpl_inode_free(struct inode *ip) | ||
{ | ||
zfs_inode_free(ip); | ||
} | ||
|
||
static void __maybe_unused | ||
zpl_inode_destroy(struct inode *ip) | ||
{ | ||
ASSERT(atomic_read(&ip->i_count) == 0); | ||
|
@@ -89,6 +95,9 @@ zpl_evict_inode(struct inode *ip) | |
truncate_setsize(ip, 0); | ||
clear_inode(ip); | ||
zfs_inactive(ip); | ||
#ifdef HAVE_INODE_FREE | ||
zfs_inode_destroy(ip); | ||
#endif | ||
spl_fstrans_unmark(cookie); | ||
} | ||
|
||
|
@@ -380,7 +389,11 @@ zpl_prune_sb(uint64_t nr_to_scan, void *arg) | |
|
||
const struct super_operations zpl_super_operations = { | ||
.alloc_inode = zpl_inode_alloc, | ||
#ifdef HAVE_INODE_FREE | ||
.free_inode = zpl_inode_free, | ||
#else | ||
.destroy_inode = zpl_inode_destroy, | ||
#endif | ||
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 believe we still want to register 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. Well I tried to adhere to the note in Do you see any consequences of merging 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 mean, if the inode gets as far as 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. @behlendorf ping, what do you think, do we keep it as I propose? I'd like to push this forward but this seems like it needs further input from you :) Thanks! |
||
.dirty_inode = zpl_dirty_inode, | ||
.write_inode = NULL, | ||
.evict_inode = zpl_evict_inode, | ||
|
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.
__maybe_unused
shouldn't be needed here or above. We can use the guard macro's here to build the required functions, or not.