aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/quota.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-10-21 12:39:53 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2010-10-21 12:39:53 -0700
commitf6f0a6d6a7258eff41fd202fc70df18271a2de79 (patch)
treea32040d8cc6e06e056e184e35ed4729e28a244d8 /fs/gfs2/quota.c
parentMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client (diff)
parentGFS2: fixed typo (diff)
downloadlinux-dev-f6f0a6d6a7258eff41fd202fc70df18271a2de79.tar.xz
linux-dev-f6f0a6d6a7258eff41fd202fc70df18271a2de79.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-nmw
* git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-nmw: (22 commits) GFS2: fixed typo GFS2: Fix type mapping for demote_rq interface GFS2 fatal: filesystem consistency error on rename GFS2: Improve journal allocation via sysfs GFS2: Add "norecovery" mount option as a synonym for "spectator" GFS2: Fix spectator umount issue GFS2: Fix compiler warning from previous patch GFS2: reserve more blocks for transactions GFS2: Fix journal check for spectator mounts GFS2: Remove upgrade mount option GFS2: Remove localcaching mount option GFS2: Remove ignore_local_fs mount argument GFS2: Make . and .. qstrs constant GFS2: Use new workqueue scheme GFS2: Update handling of DLM return codes to match reality GFS2: Don't enforce min hold time when two demotes occur in rapid succession GFS2: Fix whitespace in previous patch GFS2: fallocate support GFS2: Add a bug trap in allocation code GFS2: No longer experimental ...
Diffstat (limited to 'fs/gfs2/quota.c')
-rw-r--r--fs/gfs2/quota.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c
index 1bc6b5695e6d..58a9b9998b42 100644
--- a/fs/gfs2/quota.c
+++ b/fs/gfs2/quota.c
@@ -735,10 +735,8 @@ get_a_page:
goto out;
size = loc + sizeof(struct gfs2_quota);
- if (size > inode->i_size) {
- ip->i_disksize = size;
+ if (size > inode->i_size)
i_size_write(inode, size);
- }
inode->i_mtime = inode->i_atime = CURRENT_TIME;
gfs2_trans_add_bh(ip->i_gl, dibh, 1);
gfs2_dinode_out(ip, dibh->b_data);
@@ -817,7 +815,7 @@ static int do_sync(unsigned int num_qd, struct gfs2_quota_data **qda)
goto out_alloc;
if (nalloc)
- blocks += al->al_rgd->rd_length + nalloc * ind_blocks + RES_STATFS;
+ blocks += gfs2_rg_blocks(al) + nalloc * ind_blocks + RES_STATFS;
error = gfs2_trans_begin(sdp, blocks, 0);
if (error)
@@ -1190,18 +1188,17 @@ static void gfs2_quota_change_in(struct gfs2_quota_change_host *qc, const void *
int gfs2_quota_init(struct gfs2_sbd *sdp)
{
struct gfs2_inode *ip = GFS2_I(sdp->sd_qc_inode);
- unsigned int blocks = ip->i_disksize >> sdp->sd_sb.sb_bsize_shift;
+ u64 size = i_size_read(sdp->sd_qc_inode);
+ unsigned int blocks = size >> sdp->sd_sb.sb_bsize_shift;
unsigned int x, slot = 0;
unsigned int found = 0;
u64 dblock;
u32 extlen = 0;
int error;
- if (!ip->i_disksize || ip->i_disksize > (64 << 20) ||
- ip->i_disksize & (sdp->sd_sb.sb_bsize - 1)) {
- gfs2_consist_inode(ip);
+ if (gfs2_check_internal_file_size(sdp->sd_qc_inode, 1, 64 << 20))
return -EIO;
- }
+
sdp->sd_quota_slots = blocks * sdp->sd_qc_per_block;
sdp->sd_quota_chunks = DIV_ROUND_UP(sdp->sd_quota_slots, 8 * PAGE_SIZE);
@@ -1589,6 +1586,7 @@ static int gfs2_set_dqblk(struct super_block *sb, int type, qid_t id,
error = gfs2_inplace_reserve(ip);
if (error)
goto out_alloc;
+ blocks += gfs2_rg_blocks(al);
}
error = gfs2_trans_begin(sdp, blocks + RES_DINODE + 1, 0);