aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2013-10-02 09:47:02 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2013-10-02 09:47:02 -0400
commit26e43a15d44a02e380904ac6113fe0f2f1ddea8a (patch)
tree54c4d8e2138ebc2bf4f96072150090697a26eb5b
parent9e07f2cb3d7a93f4b1b18fc6e4dd6911dcba2442 (diff)
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>
-rw-r--r--fs/gfs2/quota.c20
-rw-r--r--fs/gfs2/util.c20
-rw-r--r--fs/gfs2/util.h2
3 files changed, 20 insertions, 22 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)
289 spin_unlock(&qd_lru_lock); 289 spin_unlock(&qd_lru_lock);
290} 290}
291 291
292static void gfs2_icbit_munge(struct gfs2_sbd *sdp, unsigned char **bitmap,
293 unsigned int bit, int new_value)
294{
295 unsigned int c, o, b = bit;
296 int old_value;
297
298 c = b / (8 * PAGE_SIZE);
299 b %= 8 * PAGE_SIZE;
300 o = b / 8;
301 b %= 8;
302
303 old_value = (bitmap[c][o] & (1 << b));
304 gfs2_assert_withdraw(sdp, !old_value != !new_value);
305
306 if (new_value)
307 bitmap[c][o] |= 1 << b;
308 else
309 bitmap[c][o] &= ~(1 << b);
310}
311
292static void slot_put(struct gfs2_quota_data *qd) 312static void slot_put(struct gfs2_quota_data *qd)
293{ 313{
294 struct gfs2_sbd *sdp = qd->qd_gl->gl_sbd; 314 struct gfs2_sbd *sdp = qd->qd_gl->gl_sbd;
diff --git a/fs/gfs2/util.c b/fs/gfs2/util.c
index 6402fb69d71b..f7109f689e61 100644
--- a/fs/gfs2/util.c
+++ b/fs/gfs2/util.c
@@ -268,23 +268,3 @@ int gfs2_io_error_bh_i(struct gfs2_sbd *sdp, struct buffer_head *bh,
268 return rv; 268 return rv;
269} 269}
270 270
271void gfs2_icbit_munge(struct gfs2_sbd *sdp, unsigned char **bitmap,
272 unsigned int bit, int new_value)
273{
274 unsigned int c, o, b = bit;
275 int old_value;
276
277 c = b / (8 * PAGE_SIZE);
278 b %= 8 * PAGE_SIZE;
279 o = b / 8;
280 b %= 8;
281
282 old_value = (bitmap[c][o] & (1 << b));
283 gfs2_assert_withdraw(sdp, !old_value != !new_value);
284
285 if (new_value)
286 bitmap[c][o] |= 1 << b;
287 else
288 bitmap[c][o] &= ~(1 << b);
289}
290
diff --git a/fs/gfs2/util.h b/fs/gfs2/util.h
index 80535739ac7b..b7ffb09b99ea 100644
--- a/fs/gfs2/util.h
+++ b/fs/gfs2/util.h
@@ -164,8 +164,6 @@ static inline unsigned int gfs2_tune_get_i(struct gfs2_tune *gt,
164#define gfs2_tune_get(sdp, field) \ 164#define gfs2_tune_get(sdp, field) \
165gfs2_tune_get_i(&(sdp)->sd_tune, &(sdp)->sd_tune.field) 165gfs2_tune_get_i(&(sdp)->sd_tune, &(sdp)->sd_tune.field)
166 166
167void gfs2_icbit_munge(struct gfs2_sbd *sdp, unsigned char **bitmap,
168 unsigned int bit, int new_value);
169int gfs2_lm_withdraw(struct gfs2_sbd *sdp, char *fmt, ...); 167int gfs2_lm_withdraw(struct gfs2_sbd *sdp, char *fmt, ...);
170 168
171#endif /* __UTIL_DOT_H__ */ 169#endif /* __UTIL_DOT_H__ */