aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/unlinked.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-02-27 17:23:27 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2006-02-27 17:23:27 -0500
commit5c676f6d359b0404d53f542f02e1359583cb2895 (patch)
tree8741011990ec0a3d0d41fee9f0d7abf6a16834cc /fs/gfs2/unlinked.c
parentf3b270a47882b958e9e3c5bd86894e3a7072899a (diff)
[GFS2] Macros removal in gfs2.h
As suggested by Pekka Enberg <penberg@cs.helsinki.fi>. The DIV_RU macro is renamed DIV_ROUND_UP and and moved to kernel.h The other macros are gone from gfs2.h as (although not requested by Pekka Enberg) are a number of included header file which are now included individually. The inode number comparison function is now an inline function. The DT2IF and IF2DT may be addressed in a future patch. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/unlinked.c')
-rw-r--r--fs/gfs2/unlinked.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/fs/gfs2/unlinked.c b/fs/gfs2/unlinked.c
index e92a3a11815b..24b91c23bc2d 100644
--- a/fs/gfs2/unlinked.c
+++ b/fs/gfs2/unlinked.c
@@ -13,19 +13,23 @@
13#include <linux/completion.h> 13#include <linux/completion.h>
14#include <linux/buffer_head.h> 14#include <linux/buffer_head.h>
15#include <linux/kthread.h> 15#include <linux/kthread.h>
16#include <linux/gfs2_ondisk.h>
16#include <asm/semaphore.h> 17#include <asm/semaphore.h>
17 18
18#include "gfs2.h" 19#include "gfs2.h"
20#include "lm_interface.h"
21#include "incore.h"
19#include "bmap.h" 22#include "bmap.h"
20#include "inode.h" 23#include "inode.h"
21#include "meta_io.h" 24#include "meta_io.h"
22#include "trans.h" 25#include "trans.h"
23#include "unlinked.h" 26#include "unlinked.h"
27#include "util.h"
24 28
25static int munge_ondisk(struct gfs2_sbd *sdp, unsigned int slot, 29static int munge_ondisk(struct gfs2_sbd *sdp, unsigned int slot,
26 struct gfs2_unlinked_tag *ut) 30 struct gfs2_unlinked_tag *ut)
27{ 31{
28 struct gfs2_inode *ip = get_v2ip(sdp->sd_ut_inode); 32 struct gfs2_inode *ip = sdp->sd_ut_inode->u.generic_ip;
29 unsigned int block, offset; 33 unsigned int block, offset;
30 uint64_t dblock; 34 uint64_t dblock;
31 int new = 0; 35 int new = 0;
@@ -312,7 +316,7 @@ int gfs2_unlinked_dealloc(struct gfs2_sbd *sdp)
312 316
313int gfs2_unlinked_init(struct gfs2_sbd *sdp) 317int gfs2_unlinked_init(struct gfs2_sbd *sdp)
314{ 318{
315 struct gfs2_inode *ip = get_v2ip(sdp->sd_ut_inode); 319 struct gfs2_inode *ip = sdp->sd_ut_inode->u.generic_ip;
316 unsigned int blocks = ip->i_di.di_size >> sdp->sd_sb.sb_bsize_shift; 320 unsigned int blocks = ip->i_di.di_size >> sdp->sd_sb.sb_bsize_shift;
317 unsigned int x, slot = 0; 321 unsigned int x, slot = 0;
318 unsigned int found = 0; 322 unsigned int found = 0;
@@ -327,7 +331,8 @@ int gfs2_unlinked_init(struct gfs2_sbd *sdp)
327 return -EIO; 331 return -EIO;
328 } 332 }
329 sdp->sd_unlinked_slots = blocks * sdp->sd_ut_per_block; 333 sdp->sd_unlinked_slots = blocks * sdp->sd_ut_per_block;
330 sdp->sd_unlinked_chunks = DIV_RU(sdp->sd_unlinked_slots, 8 * PAGE_SIZE); 334 sdp->sd_unlinked_chunks = DIV_ROUND_UP(sdp->sd_unlinked_slots,
335 8 * PAGE_SIZE);
331 336
332 error = -ENOMEM; 337 error = -ENOMEM;
333 338