aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/rgrp.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/gfs2/rgrp.c')
-rw-r--r--fs/gfs2/rgrp.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index 87c80bbce1cf..758cc565813a 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -12,19 +12,20 @@
12#include <linux/spinlock.h> 12#include <linux/spinlock.h>
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/fs.h>
15#include <asm/semaphore.h> 16#include <asm/semaphore.h>
16 17
17#include "gfs2.h" 18#include "gfs2.h"
18#include "bits.h" 19#include "bits.h"
19#include "glock.h" 20#include "glock.h"
20#include "glops.h" 21#include "glops.h"
21#include "jdata.h"
22#include "lops.h" 22#include "lops.h"
23#include "meta_io.h" 23#include "meta_io.h"
24#include "quota.h" 24#include "quota.h"
25#include "rgrp.h" 25#include "rgrp.h"
26#include "super.h" 26#include "super.h"
27#include "trans.h" 27#include "trans.h"
28#include "ops_file.h"
28 29
29/** 30/**
30 * gfs2_rgrp_verify - Verify that a resource group is consistent 31 * gfs2_rgrp_verify - Verify that a resource group is consistent
@@ -268,8 +269,10 @@ static int compute_bitstructs(struct gfs2_rgrpd *rgd)
268static int gfs2_ri_update(struct gfs2_inode *ip) 269static int gfs2_ri_update(struct gfs2_inode *ip)
269{ 270{
270 struct gfs2_sbd *sdp = ip->i_sbd; 271 struct gfs2_sbd *sdp = ip->i_sbd;
272 struct inode *inode = ip->i_vnode;
271 struct gfs2_rgrpd *rgd; 273 struct gfs2_rgrpd *rgd;
272 char buf[sizeof(struct gfs2_rindex)]; 274 char buf[sizeof(struct gfs2_rindex)];
275 struct file_ra_state ra_state;
273 uint64_t junk = ip->i_di.di_size; 276 uint64_t junk = ip->i_di.di_size;
274 int error; 277 int error;
275 278
@@ -280,10 +283,10 @@ static int gfs2_ri_update(struct gfs2_inode *ip)
280 283
281 clear_rgrpdi(sdp); 284 clear_rgrpdi(sdp);
282 285
286 file_ra_state_init(&ra_state, inode->i_mapping);
283 for (sdp->sd_rgrps = 0;; sdp->sd_rgrps++) { 287 for (sdp->sd_rgrps = 0;; sdp->sd_rgrps++) {
284 error = gfs2_jdata_read_mem(ip, buf, 288 loff_t pos = sdp->sd_rgrps * sizeof(struct gfs2_rindex);
285 sdp->sd_rgrps * 289 error = gfs2_internal_read(ip, &ra_state, buf, &pos,
286 sizeof(struct gfs2_rindex),
287 sizeof(struct gfs2_rindex)); 290 sizeof(struct gfs2_rindex));
288 if (!error) 291 if (!error)
289 break; 292 break;
@@ -350,7 +353,7 @@ static int gfs2_ri_update(struct gfs2_inode *ip)
350 353
351int gfs2_rindex_hold(struct gfs2_sbd *sdp, struct gfs2_holder *ri_gh) 354int gfs2_rindex_hold(struct gfs2_sbd *sdp, struct gfs2_holder *ri_gh)
352{ 355{
353 struct gfs2_inode *ip = sdp->sd_rindex; 356 struct gfs2_inode *ip = get_v2ip(sdp->sd_rindex);
354 struct gfs2_glock *gl = ip->i_gl; 357 struct gfs2_glock *gl = ip->i_gl;
355 int error; 358 int error;
356 359