Whamcloud - gitweb
LU-15969 llite: add support for ->fileattr_get/set
[fs/lustre-release.git] / lustre / llite / file.c
index 6c4073e..e56aa36 100644 (file)
@@ -3770,6 +3770,7 @@ static int ll_lock_noexpand(struct file *file, int flags)
        return 0;
 }
 
+#ifndef HAVE_FILEATTR_GET
 int ll_ioctl_fsgetxattr(struct inode *inode, unsigned int cmd,
                        void __user *uarg)
 {
@@ -3787,6 +3788,7 @@ int ll_ioctl_fsgetxattr(struct inode *inode, unsigned int cmd,
 
        RETURN(0);
 }
+#endif
 
 int ll_ioctl_check_project(struct inode *inode, __u32 xflags,
                           __u32 projid)
@@ -3822,7 +3824,7 @@ int ll_ioctl_check_project(struct inode *inode, __u32 xflags,
        return 0;
 }
 
-static int ll_set_project(struct inode *inode, __u32 xflags, __u32 projid)
+int ll_set_project(struct inode *inode, __u32 xflags, __u32 projid)
 {
        struct ptlrpc_request *req = NULL;
        struct md_op_data *op_data;
@@ -3872,6 +3874,7 @@ out_fsxattr:
        RETURN(rc);
 }
 
+#ifndef HAVE_FILEATTR_GET
 int ll_ioctl_fssetxattr(struct inode *inode, unsigned int cmd,
                        void __user *uarg)
 {
@@ -3885,6 +3888,7 @@ int ll_ioctl_fssetxattr(struct inode *inode, unsigned int cmd,
        RETURN(ll_set_project(inode, fsxattr.fsx_xflags,
                              fsxattr.fsx_projid));
 }
+#endif
 
 int ll_ioctl_project(struct file *file, unsigned int cmd, void __user *uarg)
 {
@@ -4304,8 +4308,10 @@ out:
        case LL_IOC_LOV_GETSTRIPE:
        case LL_IOC_LOV_GETSTRIPE_NEW:
                RETURN(ll_file_getstripe(inode, uarg, 0));
+#ifndef HAVE_FILEATTR_GET
        case LL_IOC_GROUP_LOCK:
                RETURN(ll_get_grouplock(inode, file, arg));
+#endif
        case LL_IOC_GROUP_UNLOCK:
                RETURN(ll_put_grouplock(inode, file, arg));
        case LL_IOC_DATA_VERSION: {
@@ -5953,6 +5959,10 @@ const struct inode_operations ll_file_inode_operations = {
 #ifdef HAVE_IOP_SET_ACL
        .set_acl        = ll_set_acl,
 #endif
+#ifdef HAVE_FILEATTR_GET
+       .fileattr_get   = ll_fileattr_get,
+       .fileattr_set   = ll_fileattr_set,
+#endif
 };
 
 const struct file_operations *ll_select_file_operations(struct ll_sb_info *sbi)