ext4: Put inode_operations in inode.c
PATCH 1/1 ext4: Put inode_operations in inode.c
inode_operations is more suitable to put in inode.c, instead of file.c, so moved to inode.c.
Because struct inode_operations's functions are already included in header file, so no need to change header files.
--- fs/ext4/file.c | 11 ----------- fs/ext4/inode.c | 12 ++++++++++++ 2 files changed, 12 insertions(+), 11 deletions(-)
fs/ext4/file.c +0 -11
@@ -961,14 +961,3 @@ const struct file_operations ext4_file_operations = { .fallocate = ext4_fallocate, }; -const struct inode_operations ext4_file_inode_operations = { - .setattr = ext4_setattr, - .getattr = ext4_file_getattr, - .listxattr = ext4_listxattr, - .get_inode_acl = ext4_get_acl, - .set_acl = ext4_set_acl, - .fiemap = ext4_fiemap, - .fileattr_get = ext4_fileattr_get, - .fileattr_set = ext4_fileattr_set, -}; -
fs/ext4/inode.c +12 -0
@@ -6147,3 +6147,15 @@ vm_fault_t ext4_page_mkwrite(struct vm_fault *vmf)ext4_journal_stop (handle); goto out; } + +const struct inode_operations ext4_file_inode_operations = { + .setattr = ext4_setattr, + .getattr = ext4_file_getattr, + .listxattr = ext4_listxattr, + .get_inode_acl = ext4_get_acl, + .set_acl = ext4_set_acl, + .fiemap = ext4_fiemap, + .fileattr_get = ext4_fileattr_get, + .fileattr_set = ext4_fileattr_set, +}; +
Signature · 1 line
2.34.1
Theodore Ts'o
maintainerQuoted 2 lines · Wu Jianyue
inode_operationsis more suitable to put ininode.c, instead offile.c, so moved toinode.c.
The inode operations structure for directories is in fs/ext4/namei.c; the inode operations for symlinks is in fs/ext4/symlink.c. Exactly where the structure definition is somewhat arbitrary; should it be where the majority of the functions are defined? Should it be associated with the file where operations for that inode type are located? Should it be in the file where the structure is used (which is actually in two files; fs/ext4/namei.c and fs/ext4/inode.c)?
Moving it is just churn and makes things less consistent, so I don't think it's worth it to take this patch, sorry.
- Ted