Skip to content

Commit 4bd684b

Browse files
Andreas GruenbacherAstralBob
authored andcommitted
gfs2: Remove unnecessary gfs2_qa_{get,put} pairs
We now get the quota data structure when opening a file writable and put it when closing that writable file descriptor, so there no longer is a need for gfs2_qa_{get,put} while we're holding a writable file descriptor. Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Bob Peterson <[email protected]>
1 parent 1595548 commit 4bd684b

File tree

1 file changed

+1
-27
lines changed

1 file changed

+1
-27
lines changed

fs/gfs2/file.c

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -458,10 +458,6 @@ static vm_fault_t gfs2_page_mkwrite(struct vm_fault *vmf)
458458

459459
sb_start_pagefault(inode->i_sb);
460460

461-
ret = gfs2_qa_get(ip);
462-
if (ret)
463-
goto out;
464-
465461
gfs2_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &gh);
466462
ret = gfs2_glock_nq(&gh);
467463
if (ret)
@@ -553,13 +549,11 @@ static vm_fault_t gfs2_page_mkwrite(struct vm_fault *vmf)
553549
out_unlock:
554550
gfs2_glock_dq(&gh);
555551
out_uninit:
556-
gfs2_qa_put(ip);
557552
gfs2_holder_uninit(&gh);
558553
if (ret == 0) {
559554
set_page_dirty(page);
560555
wait_for_stable_page(page);
561556
}
562-
out:
563557
sb_end_pagefault(inode->i_sb);
564558
return block_page_mkwrite_return(ret);
565559
}
@@ -860,18 +854,14 @@ static ssize_t gfs2_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
860854
struct gfs2_inode *ip = GFS2_I(inode);
861855
ssize_t ret;
862856

863-
ret = gfs2_qa_get(ip);
864-
if (ret)
865-
return ret;
866-
867857
gfs2_size_hint(file, iocb->ki_pos, iov_iter_count(from));
868858

869859
if (iocb->ki_flags & IOCB_APPEND) {
870860
struct gfs2_holder gh;
871861

872862
ret = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, 0, &gh);
873863
if (ret)
874-
goto out;
864+
return ret;
875865
gfs2_glock_dq_uninit(&gh);
876866
}
877867

@@ -929,8 +919,6 @@ static ssize_t gfs2_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
929919

930920
out_unlock:
931921
inode_unlock(inode);
932-
out:
933-
gfs2_qa_put(ip);
934922
return ret;
935923
}
936924

@@ -1162,18 +1150,11 @@ static long gfs2_fallocate(struct file *file, int mode, loff_t offset, loff_t le
11621150
if (mode & FALLOC_FL_PUNCH_HOLE) {
11631151
ret = __gfs2_punch_hole(file, offset, len);
11641152
} else {
1165-
ret = gfs2_qa_get(ip);
1166-
if (ret)
1167-
goto out_putw;
1168-
11691153
ret = __gfs2_fallocate(file, mode, offset, len);
1170-
11711154
if (ret)
11721155
gfs2_rs_deltree(&ip->i_res);
1173-
gfs2_qa_put(ip);
11741156
}
11751157

1176-
out_putw:
11771158
put_write_access(inode);
11781159
out_unlock:
11791160
gfs2_glock_dq(&gh);
@@ -1187,18 +1168,11 @@ static ssize_t gfs2_file_splice_write(struct pipe_inode_info *pipe,
11871168
struct file *out, loff_t *ppos,
11881169
size_t len, unsigned int flags)
11891170
{
1190-
int error;
1191-
struct gfs2_inode *ip = GFS2_I(out->f_mapping->host);
11921171
ssize_t ret;
11931172

1194-
error = gfs2_qa_get(ip);
1195-
if (error)
1196-
return (ssize_t)error;
1197-
11981173
gfs2_size_hint(out, *ppos, len);
11991174

12001175
ret = iter_file_splice_write(pipe, out, ppos, len, flags);
1201-
gfs2_qa_put(ip);
12021176
return ret;
12031177
}
12041178

0 commit comments

Comments
 (0)