aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/unlinked.c
diff options
context:
space:
mode:
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