Whamcloud - gitweb
LU-4017 ldiskfs: export __ext4_ioctl_setproject for lustre 45/23945/12
authorWang Shilong <wshilong@ddn.com>
Wed, 19 Aug 2015 09:56:09 +0000 (05:56 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 13 Apr 2017 06:22:00 +0000 (06:22 +0000)
Export this helper so that lustre can save project id to
MDS and OST objects

Signed-off-by: Wang Shilong <wshilong@ddn.com>
Change-Id: I5c374e6dc7a509c0cbd46ac383b8d99f7f67d6b6
Reviewed-on: https://review.whamcloud.com/23945
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-by: Li Xi <lixi@ddn.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
ldiskfs/kernel_patches/patches/rhel7/ext4-export-__ext4_ioctl_setproject-for-lustre.patch [new file with mode: 0644]
ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.2.series
ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.3.series

diff --git a/ldiskfs/kernel_patches/patches/rhel7/ext4-export-__ext4_ioctl_setproject-for-lustre.patch b/ldiskfs/kernel_patches/patches/rhel7/ext4-export-__ext4_ioctl_setproject-for-lustre.patch
new file mode 100644 (file)
index 0000000..35a5379
--- /dev/null
@@ -0,0 +1,62 @@
+diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
+index 8fa347b..92b4101 100644
+--- a/fs/ext4/ext4.h
++++ b/fs/ext4/ext4.h
+@@ -2178,6 +2178,7 @@ extern int ext4_ind_remove_space(handle_t *handle, struct inode *inode,
+ /* ioctl.c */
+ extern long ext4_ioctl(struct file *, unsigned int, unsigned long);
+ extern long ext4_compat_ioctl(struct file *, unsigned int, unsigned long);
++extern int __ext4_ioctl_setproject(struct inode *inode, __u32 projid);
+ /* migrate.c */
+ extern int ext4_ext_migrate(struct inode *);
+diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
+index 890f21e..a4443e9 100644
+--- a/fs/ext4/ioctl.c
++++ b/fs/ext4/ioctl.c
+@@ -294,9 +294,8 @@ flags_out:
+ }
+ #ifdef CONFIG_QUOTA
+-static int ext4_ioctl_setproject(struct file *filp, __u32 projid)
++int __ext4_ioctl_setproject(struct inode *inode, __u32 projid)
+ {
+-      struct inode *inode = file_inode(filp);
+       struct super_block *sb = inode->i_sb;
+       struct ext4_inode_info *ei = EXT4_I(inode);
+       int err, rc;
+@@ -324,10 +323,6 @@ static int ext4_ioctl_setproject(struct file *filp, __u32 projid)
+       if (projid_eq(kprojid, EXT4_I(inode)->i_projid))
+               return 0;
+-      err = mnt_want_write_file(filp);
+-      if (err)
+-              return err;
+-
+       err = -EPERM;
+       mutex_lock(&inode->i_mutex);
+       /* Is it quota file? Do not allow user to mess with it */
+@@ -378,6 +373,23 @@ out_stop:
+       ext4_journal_stop(handle);
+ out_unlock:
+       mutex_unlock(&inode->i_mutex);
++      return err;
++
++
++}
++EXPORT_SYMBOL(__ext4_ioctl_setproject);
++
++static int ext4_ioctl_setproject(struct file *filp, __u32 projid)
++{
++      int err;
++      struct inode *inode = file_inode(filp);
++
++      err = mnt_want_write_file(filp);
++      if (err)
++              return err;
++
++      err = __ext4_ioctl_setproject(inode, projid);
++
+       mnt_drop_write_file(filp);
+       return err;
+ }
index 5b728e3..7adfeea 100644 (file)
@@ -28,4 +28,5 @@ rhel7.2/ext4-remove-i_data_sem-from-xattr.patch
 rhel7/ext4-projid-ignore-maxquotas.patch
 rhel7/ext4-projid-feature-support.patch
 rhel7/ext4-projid-quotas.patch
-rhel7ext4-projid-xfs-ioctls.patch
+rhel7/ext4-projid-xfs-ioctls.patch
+rhel7/ext4-export-__ext4_ioctl_setproject-for-lustre.patch
index 3103ded..9c6dd5e 100644 (file)
@@ -27,3 +27,4 @@ rhel7/ext4-projid-ignore-maxquotas.patch
 rhel7/ext4-projid-feature-support.patch
 rhel7/ext4-projid-quotas.patch
 rhel7/ext4-projid-xfs-ioctls.patch
+rhel7/ext4-export-__ext4_ioctl_setproject-for-lustre.patch