summaryrefslogtreecommitdiffstats
path: root/fs/gfs2/quota.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2013-10-02 14:47:02 +0100
committerSteven Whitehouse <swhiteho@redhat.com>2013-10-02 14:47:02 +0100
commit26e43a15d44a02e380904ac6113fe0f2f1ddea8a (patch)
tree54c4d8e2138ebc2bf4f96072150090697a26eb5b /fs/gfs2/quota.c
parent9e07f2cb3d7a93f4b1b18fc6e4dd6911dcba2442 (diff)
downloadlinux-26e43a15d44a02e380904ac6113fe0f2f1ddea8a.tar.bz2
GFS2: Move gfs2_icbit_munge into quota.c
This function is only called twice, and both callers are quota related, so lets move this function into quota.c and make it static. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/quota.c')
-rw-r--r--fs/gfs2/quota.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c
index 8fe7a0a87c80..fd1ec5243d2e 100644
--- a/fs/gfs2/quota.c
+++ b/fs/gfs2/quota.c
@@ -289,6 +289,26 @@ static void slot_hold(struct gfs2_quota_data *qd)
spin_unlock(&qd_lru_lock);
}
+static void gfs2_icbit_munge(struct gfs2_sbd *sdp, unsigned char **bitmap,
+ unsigned int bit, int new_value)
+{
+ unsigned int c, o, b = bit;
+ int old_value;
+
+ c = b / (8 * PAGE_SIZE);
+ b %= 8 * PAGE_SIZE;
+ o = b / 8;
+ b %= 8;
+
+ old_value = (bitmap[c][o] & (1 << b));
+ gfs2_assert_withdraw(sdp, !old_value != !new_value);
+
+ if (new_value)
+ bitmap[c][o] |= 1 << b;
+ else
+ bitmap[c][o] &= ~(1 << b);
+}
+
static void slot_put(struct gfs2_quota_data *qd)
{
struct gfs2_sbd *sdp = qd->qd_gl->gl_sbd;