Whamcloud - gitweb
b=24037 Changes of 2.6.32 kernel.
[fs/lustre-release.git] / lustre / lvfs / fsfilt_ext3.c
index 49347fa..c89de20 100644 (file)
 #ifdef HAVE_QUOTAIO_V1_H
 # include <linux/quotaio_v1.h>
 # include <linux/quotaio_v2.h>
+#elif defined(HAVE_FS_QUOTA_QUOTAIO_V1_H)
+# include <quota/quotaio_v1.h>
+# include <quota/quotaio_v2.h>
+# include <quota/quota_tree.h>
+# define V2_DQTREEOFF    QT_TREEOFF
 #else
 # include <quotaio_v1.h>
 # include <quotaio_v2.h>
@@ -869,6 +874,14 @@ static int fsfilt_ext3_sync(struct super_block *sb)
                         ext3_ext_walk_space(tree, block, num, cb);
 #endif
 
+#ifdef EXT_INSERT_EXTENT_WITH_5ARGS
+#define fsfilt_ext3_ext_insert_extent(handle, inode, path, newext, flag) \
+               ext3_ext_insert_extent(handle, inode, path, newext, flag)
+#else
+#define fsfilt_ext3_ext_insert_extent(handle, inode, path, newext, flag) \
+               ext3_ext_insert_extent(handle, inode, path, newext)
+#endif
+
 #include <linux/lustre_version.h>
 
 struct bpointers {
@@ -1480,7 +1493,7 @@ static int fsfilt_ext3_quotactl(struct super_block *sb,
                                 struct obd_quotactl *oqc)
 {
         int i, rc = 0, error = 0;
-        struct quotactl_ops *qcop;
+        const struct quotactl_ops *qcop;
         struct if_dqinfo *info;
         struct if_dqblk *dqblk;
         ENTRY;
@@ -1836,7 +1849,7 @@ static int v3_write_dqinfo(struct file *f, int type, struct if_dqinfo *info)
 static int v3_write_dqheader(struct file *f, int type)
 {
         static const __u32 quota_magics[] = V2_INITQMAGICS;
-        static const __u32 quota_versions[] = V2_INITQVERSIONS_R1;
+        static const __u32 quota_versions[] = LUSTRE_INITQVERSIONS_V2;
         struct v2_disk_dqheader dqhead;
         loff_t offset = 0;
 
@@ -1880,7 +1893,7 @@ static int create_new_quota_files(struct qchk_ctxt *qctxt,
                         GOTO(out, rc = -EINVAL);
                 }
 
-                DQUOT_DROP(file->f_dentry->d_inode);
+                ll_vfs_dq_drop(file->f_dentry->d_inode);
 
                 rc = v3_write_dqheader(file, i);
                 if (rc) {
@@ -2021,14 +2034,27 @@ static int fsfilt_ext3_quotacheck(struct super_block *sb,
                         /* we don't really need to take the group lock here,
                          * but it may be useful if one day we support online
                          * quotacheck */
+#ifdef HAVE_EXT4_LDISKFS
+                        ext4_lock_group(sb, group);
+#else
                         spin_lock(sb_bgl_lock(sbi, group));
+#endif
                         if (desc->bg_flags & cpu_to_le16(EXT3_BG_INODE_UNINIT)) {
                                 /* no inode in use in this group, just skip it */
+#ifdef HAVE_EXT4_LDISKFS
+                                ext3_unlock_group(sb, group);
+#else
                                 spin_unlock(sb_bgl_lock(sbi, group));
+#endif
                                 continue;
                         }
+
                         used_count -= ext3_itable_unused_count(sb, desc);
+#ifdef HAVE_EXT4_LDISKFS
+                        ext3_unlock_group(sb, group);
+#else
                         spin_unlock(sb_bgl_lock(sbi, group));
+#endif
                 }
 
                 ino = group * sbi->s_inodes_per_group + 1;