]> granicus.if.org Git - zfs/commitdiff
Add get/setattr, get/setxattr hooks
authorBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 16 Feb 2011 17:55:53 +0000 (09:55 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 16 Feb 2011 17:55:53 +0000 (09:55 -0800)
While the attr/xattr hooks were already in place for regular
files this hooks can also apply to directories and special files.
While they aren't typically used in this way, it should be
supported.  This patch registers these additional callbacks
for both directory and special inode types.

module/zfs/zpl_inode.c

index e866dcd4d508117010dde8a79d281a0ba5ef7ae9..637a7dc698b898a8e372eda6697a2b89a46e250c 100644 (file)
@@ -288,7 +288,6 @@ out:
 }
 
 const struct inode_operations zpl_inode_operations = {
-       .check_acl      = NULL,
        .create         = zpl_create,
        .link           = zpl_link,
        .unlink         = zpl_unlink,
@@ -306,7 +305,6 @@ const struct inode_operations zpl_inode_operations = {
 };
 
 const struct inode_operations zpl_dir_inode_operations = {
-       .check_acl      = NULL,
        .create         = zpl_create,
        .lookup         = zpl_lookup,
        .link           = zpl_link,
@@ -317,15 +315,24 @@ const struct inode_operations zpl_dir_inode_operations = {
        .mknod          = zpl_mknod,
        .rename         = zpl_rename,
        .setattr        = zpl_setattr,
+       .getattr        = zpl_getattr,
+       .setxattr       = generic_setxattr,
+       .getxattr       = generic_getxattr,
+       .removexattr    = generic_removexattr,
+       .listxattr      = zpl_xattr_list,
 };
 
 const struct inode_operations zpl_symlink_inode_operations = {
-       .check_acl      = NULL,
        .readlink       = generic_readlink,
        .follow_link    = zpl_follow_link,
        .put_link       = zpl_put_link,
 };
 
 const struct inode_operations zpl_special_inode_operations = {
-       .check_acl      = NULL,
+       .setattr        = zpl_setattr,
+       .getattr        = zpl_getattr,
+       .setxattr       = generic_setxattr,
+       .getxattr       = generic_getxattr,
+       .removexattr    = generic_removexattr,
+       .listxattr      = zpl_xattr_list,
 };