Skip to content

Commit d580712

Browse files
committed
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: Bob Peterson <[email protected]>
1 parent 969183b commit d580712

File tree

8 files changed

+17
-27
lines changed

8 files changed

+17
-27
lines changed

fs/gfs2/acl.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "glock.h"
2222
#include "inode.h"
2323
#include "meta_io.h"
24+
#include "quota.h"
2425
#include "rgrp.h"
2526
#include "trans.h"
2627
#include "util.h"
@@ -116,7 +117,7 @@ int gfs2_set_acl(struct inode *inode, struct posix_acl *acl, int type)
116117
if (acl && acl->a_count > GFS2_ACL_MAX_ENTRIES(GFS2_SB(inode)))
117118
return -E2BIG;
118119

119-
ret = gfs2_rsqa_alloc(ip);
120+
ret = gfs2_qa_alloc(ip);
120121
if (ret)
121122
return ret;
122123

fs/gfs2/bmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2183,7 +2183,7 @@ int gfs2_setattr_size(struct inode *inode, u64 newsize)
21832183

21842184
inode_dio_wait(inode);
21852185

2186-
ret = gfs2_rsqa_alloc(ip);
2186+
ret = gfs2_qa_alloc(ip);
21872187
if (ret)
21882188
goto out;
21892189

fs/gfs2/file.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ static vm_fault_t gfs2_page_mkwrite(struct vm_fault *vmf)
458458

459459
sb_start_pagefault(inode->i_sb);
460460

461-
ret = gfs2_rsqa_alloc(ip);
461+
ret = gfs2_qa_alloc(ip);
462462
if (ret)
463463
goto out;
464464

@@ -849,7 +849,7 @@ static ssize_t gfs2_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
849849
struct gfs2_inode *ip = GFS2_I(inode);
850850
ssize_t ret;
851851

852-
ret = gfs2_rsqa_alloc(ip);
852+
ret = gfs2_qa_alloc(ip);
853853
if (ret)
854854
return ret;
855855

@@ -1149,7 +1149,7 @@ static long gfs2_fallocate(struct file *file, int mode, loff_t offset, loff_t le
11491149
if (mode & FALLOC_FL_PUNCH_HOLE) {
11501150
ret = __gfs2_punch_hole(file, offset, len);
11511151
} else {
1152-
ret = gfs2_rsqa_alloc(ip);
1152+
ret = gfs2_qa_alloc(ip);
11531153
if (ret)
11541154
goto out_putw;
11551155

@@ -1176,7 +1176,7 @@ static ssize_t gfs2_file_splice_write(struct pipe_inode_info *pipe,
11761176
int error;
11771177
struct gfs2_inode *ip = GFS2_I(out->f_mapping->host);
11781178

1179-
error = gfs2_rsqa_alloc(ip);
1179+
error = gfs2_qa_alloc(ip);
11801180
if (error)
11811181
return (ssize_t)error;
11821182

fs/gfs2/inode.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
588588
if (!name->len || name->len > GFS2_FNAMESIZE)
589589
return -ENAMETOOLONG;
590590

591-
error = gfs2_rsqa_alloc(dip);
591+
error = gfs2_qa_alloc(dip);
592592
if (error)
593593
return error;
594594

@@ -641,7 +641,7 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
641641
goto fail_gunlock;
642642

643643
ip = GFS2_I(inode);
644-
error = gfs2_rsqa_alloc(ip);
644+
error = gfs2_qa_alloc(ip);
645645
if (error)
646646
goto fail_free_acls;
647647

@@ -899,7 +899,7 @@ static int gfs2_link(struct dentry *old_dentry, struct inode *dir,
899899
if (S_ISDIR(inode->i_mode))
900900
return -EPERM;
901901

902-
error = gfs2_rsqa_alloc(dip);
902+
error = gfs2_qa_alloc(dip);
903903
if (error)
904904
return error;
905905

@@ -1362,7 +1362,7 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry,
13621362
if (error)
13631363
return error;
13641364

1365-
error = gfs2_rsqa_alloc(ndip);
1365+
error = gfs2_qa_alloc(ndip);
13661366
if (error)
13671367
return error;
13681368

@@ -1874,7 +1874,7 @@ static int setattr_chown(struct inode *inode, struct iattr *attr)
18741874
if (!(attr->ia_valid & ATTR_GID) || gid_eq(ogid, ngid))
18751875
ogid = ngid = NO_GID_QUOTA_CHANGE;
18761876

1877-
error = gfs2_rsqa_alloc(ip);
1877+
error = gfs2_qa_alloc(ip);
18781878
if (error)
18791879
goto out;
18801880

@@ -1935,7 +1935,7 @@ static int gfs2_setattr(struct dentry *dentry, struct iattr *attr)
19351935
struct gfs2_holder i_gh;
19361936
int error;
19371937

1938-
error = gfs2_rsqa_alloc(ip);
1938+
error = gfs2_qa_alloc(ip);
19391939
if (error)
19401940
return error;
19411941

fs/gfs2/quota.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ int gfs2_quota_hold(struct gfs2_inode *ip, kuid_t uid, kgid_t gid)
567567
return 0;
568568

569569
if (ip->i_qadata == NULL) {
570-
error = gfs2_rsqa_alloc(ip);
570+
error = gfs2_qa_alloc(ip);
571571
if (error)
572572
return error;
573573
}
@@ -876,7 +876,7 @@ static int do_sync(unsigned int num_qd, struct gfs2_quota_data **qda)
876876
unsigned int nalloc = 0, blocks;
877877
int error;
878878

879-
error = gfs2_rsqa_alloc(ip);
879+
error = gfs2_qa_alloc(ip);
880880
if (error)
881881
return error;
882882

@@ -1677,7 +1677,7 @@ static int gfs2_set_dqblk(struct super_block *sb, struct kqid qid,
16771677
if (error)
16781678
return error;
16791679

1680-
error = gfs2_rsqa_alloc(ip);
1680+
error = gfs2_qa_alloc(ip);
16811681
if (error)
16821682
goto out_put;
16831683

fs/gfs2/rgrp.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -590,16 +590,6 @@ void gfs2_free_clones(struct gfs2_rgrpd *rgd)
590590
}
591591
}
592592

593-
/**
594-
* gfs2_rsqa_alloc - make sure we have a reservation assigned to the inode
595-
* plus a quota allocations data structure, if necessary
596-
* @ip: the inode for this reservation
597-
*/
598-
int gfs2_rsqa_alloc(struct gfs2_inode *ip)
599-
{
600-
return gfs2_qa_alloc(ip);
601-
}
602-
603593
static void dump_rs(struct seq_file *seq, const struct gfs2_blkreserv *rs,
604594
const char *fs_id_buf)
605595
{

fs/gfs2/rgrp.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ extern void gfs2_inplace_release(struct gfs2_inode *ip);
4444
extern int gfs2_alloc_blocks(struct gfs2_inode *ip, u64 *bn, unsigned int *n,
4545
bool dinode, u64 *generation);
4646

47-
extern int gfs2_rsqa_alloc(struct gfs2_inode *ip);
4847
extern void gfs2_rs_deltree(struct gfs2_blkreserv *rs);
4948
extern void gfs2_rsqa_delete(struct gfs2_inode *ip, atomic_t *wcount);
5049
extern void __gfs2_free_blocks(struct gfs2_inode *ip, struct gfs2_rgrpd *rgd,

fs/gfs2/xattr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1222,7 +1222,7 @@ static int gfs2_xattr_set(const struct xattr_handler *handler,
12221222
struct gfs2_holder gh;
12231223
int ret;
12241224

1225-
ret = gfs2_rsqa_alloc(ip);
1225+
ret = gfs2_qa_alloc(ip);
12261226
if (ret)
12271227
return ret;
12281228

0 commit comments

Comments
 (0)