Commit d580712a authored by Bob Peterson's avatar Bob Peterson
Browse files

gfs2: eliminate gfs2_rsqa_alloc in favor of gfs2_qa_alloc



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: default avatarBob Peterson <rpeterso@redhat.com>
parent 969183bc
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;

+1 −1
Original line number Diff line number Diff line
@@ -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;

+4 −4
Original line number Diff line number Diff line
@@ -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;

+6 −6
Original line number Diff line number Diff line
@@ -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;

+3 −3
Original line number Diff line number Diff line
@@ -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;

Loading