OSDN Git Service

gfs2: eliminate gfs2_rsqa_alloc in favor of gfs2_qa_alloc
authorBob Peterson <rpeterso@redhat.com>
Fri, 6 Mar 2020 16:18:44 +0000 (10:18 -0600)
committerBob Peterson <rpeterso@redhat.com>
Fri, 27 Mar 2020 19:08:04 +0000 (14:08 -0500)
Before this patch, multiple callers called gfs2_rsqa_alloc to force
the existence of a reservations structure and a quota data structure
if needed. However, now the reservations are handled separately, so
the quota data is only the quota data. So we eliminate the one in
favor of just calling gfs2_qa_alloc directly.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
fs/gfs2/acl.c
fs/gfs2/bmap.c
fs/gfs2/file.c
fs/gfs2/inode.c
fs/gfs2/quota.c
fs/gfs2/rgrp.c
fs/gfs2/rgrp.h
fs/gfs2/xattr.c

index 09e6be8..cb09b85 100644 (file)
@@ -21,6 +21,7 @@
 #include "glock.h"
 #include "inode.h"
 #include "meta_io.h"
+#include "quota.h"
 #include "rgrp.h"
 #include "trans.h"
 #include "util.h"
@@ -116,7 +117,7 @@ int gfs2_set_acl(struct inode *inode, struct posix_acl *acl, int type)
        if (acl && acl->a_count > GFS2_ACL_MAX_ENTRIES(GFS2_SB(inode)))
                return -E2BIG;
 
-       ret = gfs2_rsqa_alloc(ip);
+       ret = gfs2_qa_alloc(ip);
        if (ret)
                return ret;
 
index 2fe4457..4b9dbab 100644 (file)
@@ -2183,7 +2183,7 @@ int gfs2_setattr_size(struct inode *inode, u64 newsize)
 
        inode_dio_wait(inode);
 
-       ret = gfs2_rsqa_alloc(ip);
+       ret = gfs2_qa_alloc(ip);
        if (ret)
                goto out;
 
index cb26be6..54b0708 100644 (file)
@@ -458,7 +458,7 @@ static vm_fault_t gfs2_page_mkwrite(struct vm_fault *vmf)
 
        sb_start_pagefault(inode->i_sb);
 
-       ret = gfs2_rsqa_alloc(ip);
+       ret = gfs2_qa_alloc(ip);
        if (ret)
                goto out;
 
@@ -849,7 +849,7 @@ static ssize_t gfs2_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
        struct gfs2_inode *ip = GFS2_I(inode);
        ssize_t ret;
 
-       ret = gfs2_rsqa_alloc(ip);
+       ret = gfs2_qa_alloc(ip);
        if (ret)
                return ret;
 
@@ -1149,7 +1149,7 @@ static long gfs2_fallocate(struct file *file, int mode, loff_t offset, loff_t le
        if (mode & FALLOC_FL_PUNCH_HOLE) {
                ret = __gfs2_punch_hole(file, offset, len);
        } else {
-               ret = gfs2_rsqa_alloc(ip);
+               ret = gfs2_qa_alloc(ip);
                if (ret)
                        goto out_putw;
 
@@ -1176,7 +1176,7 @@ static ssize_t gfs2_file_splice_write(struct pipe_inode_info *pipe,
        int error;
        struct gfs2_inode *ip = GFS2_I(out->f_mapping->host);
 
-       error = gfs2_rsqa_alloc(ip);
+       error = gfs2_qa_alloc(ip);
        if (error)
                return (ssize_t)error;
 
index b5d04f3..710f1c6 100644 (file)
@@ -588,7 +588,7 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
        if (!name->len || name->len > GFS2_FNAMESIZE)
                return -ENAMETOOLONG;
 
-       error = gfs2_rsqa_alloc(dip);
+       error = gfs2_qa_alloc(dip);
        if (error)
                return error;
 
@@ -641,7 +641,7 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
                goto fail_gunlock;
 
        ip = GFS2_I(inode);
-       error = gfs2_rsqa_alloc(ip);
+       error = gfs2_qa_alloc(ip);
        if (error)
                goto fail_free_acls;
 
@@ -899,7 +899,7 @@ static int gfs2_link(struct dentry *old_dentry, struct inode *dir,
        if (S_ISDIR(inode->i_mode))
                return -EPERM;
 
-       error = gfs2_rsqa_alloc(dip);
+       error = gfs2_qa_alloc(dip);
        if (error)
                return error;
 
@@ -1362,7 +1362,7 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry,
        if (error)
                return error;
 
-       error = gfs2_rsqa_alloc(ndip);
+       error = gfs2_qa_alloc(ndip);
        if (error)
                return error;
 
@@ -1874,7 +1874,7 @@ static int setattr_chown(struct inode *inode, struct iattr *attr)
        if (!(attr->ia_valid & ATTR_GID) || gid_eq(ogid, ngid))
                ogid = ngid = NO_GID_QUOTA_CHANGE;
 
-       error = gfs2_rsqa_alloc(ip);
+       error = gfs2_qa_alloc(ip);
        if (error)
                goto out;
 
@@ -1935,7 +1935,7 @@ static int gfs2_setattr(struct dentry *dentry, struct iattr *attr)
        struct gfs2_holder i_gh;
        int error;
 
-       error = gfs2_rsqa_alloc(ip);
+       error = gfs2_qa_alloc(ip);
        if (error)
                return error;
 
index 8290f60..cbe45e8 100644 (file)
@@ -567,7 +567,7 @@ int gfs2_quota_hold(struct gfs2_inode *ip, kuid_t uid, kgid_t gid)
                return 0;
 
        if (ip->i_qadata == NULL) {
-               error = gfs2_rsqa_alloc(ip);
+               error = gfs2_qa_alloc(ip);
                if (error)
                        return error;
        }
@@ -876,7 +876,7 @@ static int do_sync(unsigned int num_qd, struct gfs2_quota_data **qda)
        unsigned int nalloc = 0, blocks;
        int error;
 
-       error = gfs2_rsqa_alloc(ip);
+       error = gfs2_qa_alloc(ip);
        if (error)
                return error;
 
@@ -1677,7 +1677,7 @@ static int gfs2_set_dqblk(struct super_block *sb, struct kqid qid,
        if (error)
                return error;
 
-       error = gfs2_rsqa_alloc(ip);
+       error = gfs2_qa_alloc(ip);
        if (error)
                goto out_put;
 
index 2ee2f7d..3e3696d 100644 (file)
@@ -590,16 +590,6 @@ void gfs2_free_clones(struct gfs2_rgrpd *rgd)
        }
 }
 
-/**
- * gfs2_rsqa_alloc - make sure we have a reservation assigned to the inode
- *                 plus a quota allocations data structure, if necessary
- * @ip: the inode for this reservation
- */
-int gfs2_rsqa_alloc(struct gfs2_inode *ip)
-{
-       return gfs2_qa_alloc(ip);
-}
-
 static void dump_rs(struct seq_file *seq, const struct gfs2_blkreserv *rs,
                    const char *fs_id_buf)
 {
index a584f30..92cebb7 100644 (file)
@@ -44,7 +44,6 @@ extern void gfs2_inplace_release(struct gfs2_inode *ip);
 extern int gfs2_alloc_blocks(struct gfs2_inode *ip, u64 *bn, unsigned int *n,
                             bool dinode, u64 *generation);
 
-extern int gfs2_rsqa_alloc(struct gfs2_inode *ip);
 extern void gfs2_rs_deltree(struct gfs2_blkreserv *rs);
 extern void gfs2_rsqa_delete(struct gfs2_inode *ip, atomic_t *wcount);
 extern void __gfs2_free_blocks(struct gfs2_inode *ip, struct gfs2_rgrpd *rgd,
index bbe593d..c4fbb96 100644 (file)
@@ -1222,7 +1222,7 @@ static int gfs2_xattr_set(const struct xattr_handler *handler,
        struct gfs2_holder gh;
        int ret;
 
-       ret = gfs2_rsqa_alloc(ip);
+       ret = gfs2_qa_alloc(ip);
        if (ret)
                return ret;