Skip to content

Commit ee1768e

Browse files
AstralBobAndreas Gruenbacher
authored andcommitted
gfs2: Pass sdp to gfs2_adjust_quota
Before this change function gfs2_adjust_quota's first parameter was an gfs2_inode pointer. But it always pointed to the quota inode. Here we switch that to pass the superblock pointer, sdp, so it is easier to read the code and understand that it's only dealing with the quota inode. Signed-off-by: Bob Peterson <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]>
1 parent 768963a commit ee1768e

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

fs/gfs2/quota.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,7 @@ static int gfs2_write_disk_quota(struct gfs2_inode *ip, struct gfs2_quota *qp,
830830

831831
/**
832832
* gfs2_adjust_quota - adjust record of current block usage
833-
* @ip: The quota inode
833+
* @sdp: The superblock
834834
* @loc: Offset of the entry in the quota file
835835
* @change: The amount of usage change to record
836836
* @qd: The quota data
@@ -842,12 +842,12 @@ static int gfs2_write_disk_quota(struct gfs2_inode *ip, struct gfs2_quota *qp,
842842
* Returns: 0 or -ve on error
843843
*/
844844

845-
static int gfs2_adjust_quota(struct gfs2_inode *ip, loff_t loc,
845+
static int gfs2_adjust_quota(struct gfs2_sbd *sdp, loff_t loc,
846846
s64 change, struct gfs2_quota_data *qd,
847847
struct qc_dqblk *fdq)
848848
{
849+
struct gfs2_inode *ip = GFS2_I(sdp->sd_quota_inode);
849850
struct inode *inode = &ip->i_inode;
850-
struct gfs2_sbd *sdp = GFS2_SB(inode);
851851
struct gfs2_quota q;
852852
int err;
853853
u64 size;
@@ -971,7 +971,8 @@ static int do_sync(unsigned int num_qd, struct gfs2_quota_data **qda)
971971
for (x = 0; x < num_qd; x++) {
972972
qd = qda[x];
973973
offset = qd2offset(qd);
974-
error = gfs2_adjust_quota(ip, offset, qd->qd_change_sync, qd, NULL);
974+
error = gfs2_adjust_quota(sdp, offset, qd->qd_change_sync, qd,
975+
NULL);
975976
if (error)
976977
goto out_end_trans;
977978

@@ -1749,7 +1750,7 @@ static int gfs2_set_dqblk(struct super_block *sb, struct kqid qid,
17491750
goto out_release;
17501751

17511752
/* Apply changes */
1752-
error = gfs2_adjust_quota(ip, offset, 0, qd, fdq);
1753+
error = gfs2_adjust_quota(sdp, offset, 0, qd, fdq);
17531754
if (!error)
17541755
clear_bit(QDF_QMSG_QUIET, &qd->qd_flags);
17551756

0 commit comments

Comments
 (0)