]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/reiserfs/super.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
[linux-2.6-omap-h63xx.git] / fs / reiserfs / super.c
index 879e54d35c2d49400a48b3d748a69c92934acb7a..663a91f5dce8a33d4f12c85658122a62da216bc8 100644 (file)
@@ -27,7 +27,6 @@
 #include <linux/mnt_namespace.h>
 #include <linux/mount.h>
 #include <linux/namei.h>
-#include <linux/quotaops.h>
 
 struct file_system_type reiserfs_fs_type;
 
@@ -2059,10 +2058,10 @@ static int reiserfs_quota_on_mount(struct super_block *sb, int type)
  * Standard function to be called on quota_on
  */
 static int reiserfs_quota_on(struct super_block *sb, int type, int format_id,
-                            char *path, int remount)
+                            char *name, int remount)
 {
        int err;
-       struct nameidata nd;
+       struct path path;
        struct inode *inode;
        struct reiserfs_transaction_handle th;
 
@@ -2070,16 +2069,16 @@ static int reiserfs_quota_on(struct super_block *sb, int type, int format_id,
                return -EINVAL;
        /* No more checks needed? Path and format_id are bogus anyway... */
        if (remount)
-               return vfs_quota_on(sb, type, format_id, path, 1);
-       err = path_lookup(path, LOOKUP_FOLLOW, &nd);
+               return vfs_quota_on(sb, type, format_id, name, 1);
+       err = kern_path(name, LOOKUP_FOLLOW, &path);
        if (err)
                return err;
        /* Quotafile not on the same filesystem? */
-       if (nd.path.mnt->mnt_sb != sb) {
-               path_put(&nd.path);
-               return -EXDEV;
+       if (path.mnt->mnt_sb != sb) {
+               err = -EXDEV;
+               goto out;
        }
-       inode = nd.path.dentry->d_inode;
+       inode = path.dentry->d_inode;
        /* We must not pack tails for quota files on reiserfs for quota IO to work */
        if (!(REISERFS_I(inode)->i_flags & i_nopack_mask)) {
                err = reiserfs_unpack(inode, NULL);
@@ -2087,15 +2086,15 @@ static int reiserfs_quota_on(struct super_block *sb, int type, int format_id,
                        reiserfs_warning(sb,
                                "reiserfs: Unpacking tail of quota file failed"
                                " (%d). Cannot turn on quotas.", err);
-                       path_put(&nd.path);
-                       return -EINVAL;
+                       err = -EINVAL;
+                       goto out;
                }
                mark_inode_dirty(inode);
        }
        /* Journaling quota? */
        if (REISERFS_SB(sb)->s_qf_names[type]) {
                /* Quotafile not of fs root? */
-               if (nd.path.dentry->d_parent->d_inode != sb->s_root->d_inode)
+               if (path.dentry->d_parent != sb->s_root)
                        reiserfs_warning(sb,
                                 "reiserfs: Quota file not on filesystem root. "
                                 "Journalled quota will not work.");
@@ -2109,13 +2108,15 @@ static int reiserfs_quota_on(struct super_block *sb, int type, int format_id,
                /* Just start temporary transaction and finish it */
                err = journal_begin(&th, sb, 1);
                if (err)
-                       return err;
+                       goto out;
                err = journal_end_sync(&th, sb, 1);
                if (err)
-                       return err;
+                       goto out;
        }
-       path_put(&nd.path);
-       return vfs_quota_on(sb, type, format_id, path, 0);
+       err = vfs_quota_on_path(sb, type, format_id, &path);
+out:
+       path_put(&path);
+       return err;
 }
 
 /* Read data from quotafile - avoid pagecache and such because we cannot afford