diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2008-02-12 09:17:27 -0500 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2008-03-31 05:40:55 -0400 |
commit | 77658aad226866fb94097236d14d41a88aaab2ec (patch) | |
tree | 2849313fccb193bd3c4f93f241fd5fb98ad871ca /fs/gfs2 | |
parent | 30cbf189cd2a1ba13ff3c8c8ee2103dbdb18578a (diff) |
[GFS2] Eliminate (almost) duplicate field from gfs2_inode
The blocks counter is almost a duplicate of the i_blocks
field in the VFS inode. The only difference is that i_blocks
can be only 32bits long for 32bit arch without large single file
support. Since GFS2 doesn't handle the non-large single file
case (for 32 bit anyway) this adds a new config dependency on
64BIT || LSF. This has always been the case, however we've never
explicitly said so before.
Even if we do add support for the non-LSF case, we will still
not require this field to be duplicated since we will not be
able to access oversized files anyway.
So the net result of all this is that we shave 8 bytes from a gfs2_inode
and get our config deps correct.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2')
-rw-r--r-- | fs/gfs2/Kconfig | 2 | ||||
-rw-r--r-- | fs/gfs2/bmap.c | 18 | ||||
-rw-r--r-- | fs/gfs2/dir.c | 15 | ||||
-rw-r--r-- | fs/gfs2/eattr.c | 24 | ||||
-rw-r--r-- | fs/gfs2/incore.h | 1 | ||||
-rw-r--r-- | fs/gfs2/inode.c | 11 | ||||
-rw-r--r-- | fs/gfs2/inode.h | 20 | ||||
-rw-r--r-- | fs/gfs2/ops_inode.c | 5 |
8 files changed, 42 insertions, 54 deletions
diff --git a/fs/gfs2/Kconfig b/fs/gfs2/Kconfig index de8e64c03f73..d147b53ef527 100644 --- a/fs/gfs2/Kconfig +++ b/fs/gfs2/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | config GFS2_FS | 1 | config GFS2_FS |
2 | tristate "GFS2 file system support" | 2 | tristate "GFS2 file system support" |
3 | depends on EXPERIMENTAL | 3 | depends on EXPERIMENTAL && (64BIT || LSF) |
4 | select FS_POSIX_ACL | 4 | select FS_POSIX_ACL |
5 | select CRC32 | 5 | select CRC32 |
6 | help | 6 | help |
diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c index 6780aa5841b2..e27e66046f0a 100644 --- a/fs/gfs2/bmap.c +++ b/fs/gfs2/bmap.c | |||
@@ -161,9 +161,8 @@ int gfs2_unstuff_dinode(struct gfs2_inode *ip, struct page *page) | |||
161 | 161 | ||
162 | if (ip->i_di.di_size) { | 162 | if (ip->i_di.di_size) { |
163 | *(__be64 *)(di + 1) = cpu_to_be64(block); | 163 | *(__be64 *)(di + 1) = cpu_to_be64(block); |
164 | ip->i_di.di_blocks++; | 164 | gfs2_add_inode_blocks(&ip->i_inode, 1); |
165 | gfs2_set_inode_blocks(&ip->i_inode); | 165 | di->di_blocks = cpu_to_be64(gfs2_get_inode_blocks(&ip->i_inode)); |
166 | di->di_blocks = cpu_to_be64(ip->i_di.di_blocks); | ||
167 | } | 166 | } |
168 | 167 | ||
169 | ip->i_height = 1; | 168 | ip->i_height = 1; |
@@ -238,10 +237,9 @@ static int build_height(struct inode *inode, struct metapath *mp, unsigned heigh | |||
238 | gfs2_buffer_clear_tail(dibh, sizeof(struct gfs2_dinode)); | 237 | gfs2_buffer_clear_tail(dibh, sizeof(struct gfs2_dinode)); |
239 | *(__be64 *)(di + 1) = cpu_to_be64(bn); | 238 | *(__be64 *)(di + 1) = cpu_to_be64(bn); |
240 | ip->i_height += new_height; | 239 | ip->i_height += new_height; |
241 | ip->i_di.di_blocks += new_height; | 240 | gfs2_add_inode_blocks(&ip->i_inode, new_height); |
242 | gfs2_set_inode_blocks(&ip->i_inode); | ||
243 | di->di_height = cpu_to_be16(ip->i_height); | 241 | di->di_height = cpu_to_be16(ip->i_height); |
244 | di->di_blocks = cpu_to_be64(ip->i_di.di_blocks); | 242 | di->di_blocks = cpu_to_be64(gfs2_get_inode_blocks(&ip->i_inode)); |
245 | brelse(dibh); | 243 | brelse(dibh); |
246 | return error; | 244 | return error; |
247 | } | 245 | } |
@@ -380,8 +378,7 @@ static int lookup_block(struct gfs2_inode *ip, unsigned int height, | |||
380 | gfs2_trans_add_bh(ip->i_gl, mp->mp_bh[height], 1); | 378 | gfs2_trans_add_bh(ip->i_gl, mp->mp_bh[height], 1); |
381 | 379 | ||
382 | *ptr = cpu_to_be64(*block); | 380 | *ptr = cpu_to_be64(*block); |
383 | ip->i_di.di_blocks++; | 381 | gfs2_add_inode_blocks(&ip->i_inode, 1); |
384 | gfs2_set_inode_blocks(&ip->i_inode); | ||
385 | 382 | ||
386 | *new = 1; | 383 | *new = 1; |
387 | return 0; | 384 | return 0; |
@@ -779,10 +776,7 @@ static int do_strip(struct gfs2_inode *ip, struct buffer_head *dibh, | |||
779 | } | 776 | } |
780 | 777 | ||
781 | *p = 0; | 778 | *p = 0; |
782 | if (!ip->i_di.di_blocks) | 779 | gfs2_add_inode_blocks(&ip->i_inode, -1); |
783 | gfs2_consist_inode(ip); | ||
784 | ip->i_di.di_blocks--; | ||
785 | gfs2_set_inode_blocks(&ip->i_inode); | ||
786 | } | 780 | } |
787 | if (bstart) { | 781 | if (bstart) { |
788 | if (metadata) | 782 | if (metadata) |
diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c index 93a2e6afbd81..862aa3228f7a 100644 --- a/fs/gfs2/dir.c +++ b/fs/gfs2/dir.c | |||
@@ -906,8 +906,7 @@ static int dir_make_exhash(struct inode *inode) | |||
906 | *lp = cpu_to_be64(bn); | 906 | *lp = cpu_to_be64(bn); |
907 | 907 | ||
908 | dip->i_di.di_size = sdp->sd_sb.sb_bsize / 2; | 908 | dip->i_di.di_size = sdp->sd_sb.sb_bsize / 2; |
909 | dip->i_di.di_blocks++; | 909 | gfs2_add_inode_blocks(&dip->i_inode, 1); |
910 | gfs2_set_inode_blocks(&dip->i_inode); | ||
911 | dip->i_di.di_flags |= GFS2_DIF_EXHASH; | 910 | dip->i_di.di_flags |= GFS2_DIF_EXHASH; |
912 | 911 | ||
913 | for (x = sdp->sd_hash_ptrs, y = -1; x; x >>= 1, y++) ; | 912 | for (x = sdp->sd_hash_ptrs, y = -1; x; x >>= 1, y++) ; |
@@ -1045,8 +1044,7 @@ static int dir_split_leaf(struct inode *inode, const struct qstr *name) | |||
1045 | error = gfs2_meta_inode_buffer(dip, &dibh); | 1044 | error = gfs2_meta_inode_buffer(dip, &dibh); |
1046 | if (!gfs2_assert_withdraw(GFS2_SB(&dip->i_inode), !error)) { | 1045 | if (!gfs2_assert_withdraw(GFS2_SB(&dip->i_inode), !error)) { |
1047 | gfs2_trans_add_bh(dip->i_gl, dibh, 1); | 1046 | gfs2_trans_add_bh(dip->i_gl, dibh, 1); |
1048 | dip->i_di.di_blocks++; | 1047 | gfs2_add_inode_blocks(&dip->i_inode, 1); |
1049 | gfs2_set_inode_blocks(&dip->i_inode); | ||
1050 | gfs2_dinode_out(dip, dibh->b_data); | 1048 | gfs2_dinode_out(dip, dibh->b_data); |
1051 | brelse(dibh); | 1049 | brelse(dibh); |
1052 | } | 1050 | } |
@@ -1580,8 +1578,7 @@ static int dir_new_leaf(struct inode *inode, const struct qstr *name) | |||
1580 | if (error) | 1578 | if (error) |
1581 | return error; | 1579 | return error; |
1582 | gfs2_trans_add_bh(ip->i_gl, bh, 1); | 1580 | gfs2_trans_add_bh(ip->i_gl, bh, 1); |
1583 | ip->i_di.di_blocks++; | 1581 | gfs2_add_inode_blocks(&ip->i_inode, 1); |
1584 | gfs2_set_inode_blocks(&ip->i_inode); | ||
1585 | gfs2_dinode_out(ip, bh->b_data); | 1582 | gfs2_dinode_out(ip, bh->b_data); |
1586 | brelse(bh); | 1583 | brelse(bh); |
1587 | return 0; | 1584 | return 0; |
@@ -1922,11 +1919,7 @@ static int leaf_dealloc(struct gfs2_inode *dip, u32 index, u32 len, | |||
1922 | brelse(bh); | 1919 | brelse(bh); |
1923 | 1920 | ||
1924 | gfs2_free_meta(dip, blk, 1); | 1921 | gfs2_free_meta(dip, blk, 1); |
1925 | 1922 | gfs2_add_inode_blocks(&dip->i_inode, -1); | |
1926 | if (!dip->i_di.di_blocks) | ||
1927 | gfs2_consist_inode(dip); | ||
1928 | dip->i_di.di_blocks--; | ||
1929 | gfs2_set_inode_blocks(&dip->i_inode); | ||
1930 | } | 1923 | } |
1931 | 1924 | ||
1932 | error = gfs2_dir_write_data(dip, ht, index * sizeof(u64), size); | 1925 | error = gfs2_dir_write_data(dip, ht, index * sizeof(u64), size); |
diff --git a/fs/gfs2/eattr.c b/fs/gfs2/eattr.c index 0e79cd543496..76ead1acfcc7 100644 --- a/fs/gfs2/eattr.c +++ b/fs/gfs2/eattr.c | |||
@@ -277,10 +277,7 @@ static int ea_dealloc_unstuffed(struct gfs2_inode *ip, struct buffer_head *bh, | |||
277 | } | 277 | } |
278 | 278 | ||
279 | *dataptrs = 0; | 279 | *dataptrs = 0; |
280 | if (!ip->i_di.di_blocks) | 280 | gfs2_add_inode_blocks(&ip->i_inode, -1); |
281 | gfs2_consist_inode(ip); | ||
282 | ip->i_di.di_blocks--; | ||
283 | gfs2_set_inode_blocks(&ip->i_inode); | ||
284 | } | 281 | } |
285 | if (bstart) | 282 | if (bstart) |
286 | gfs2_free_meta(ip, bstart, blen); | 283 | gfs2_free_meta(ip, bstart, blen); |
@@ -598,8 +595,7 @@ static int ea_alloc_blk(struct gfs2_inode *ip, struct buffer_head **bhp) | |||
598 | ea->ea_flags = GFS2_EAFLAG_LAST; | 595 | ea->ea_flags = GFS2_EAFLAG_LAST; |
599 | ea->ea_num_ptrs = 0; | 596 | ea->ea_num_ptrs = 0; |
600 | 597 | ||
601 | ip->i_di.di_blocks++; | 598 | gfs2_add_inode_blocks(&ip->i_inode, 1); |
602 | gfs2_set_inode_blocks(&ip->i_inode); | ||
603 | 599 | ||
604 | return 0; | 600 | return 0; |
605 | } | 601 | } |
@@ -651,8 +647,7 @@ static int ea_write(struct gfs2_inode *ip, struct gfs2_ea_header *ea, | |||
651 | gfs2_trans_add_bh(ip->i_gl, bh, 1); | 647 | gfs2_trans_add_bh(ip->i_gl, bh, 1); |
652 | gfs2_metatype_set(bh, GFS2_METATYPE_ED, GFS2_FORMAT_ED); | 648 | gfs2_metatype_set(bh, GFS2_METATYPE_ED, GFS2_FORMAT_ED); |
653 | 649 | ||
654 | ip->i_di.di_blocks++; | 650 | gfs2_add_inode_blocks(&ip->i_inode, 1); |
655 | gfs2_set_inode_blocks(&ip->i_inode); | ||
656 | 651 | ||
657 | copy = data_len > sdp->sd_jbsize ? sdp->sd_jbsize : | 652 | copy = data_len > sdp->sd_jbsize ? sdp->sd_jbsize : |
658 | data_len; | 653 | data_len; |
@@ -980,8 +975,7 @@ static int ea_set_block(struct gfs2_inode *ip, struct gfs2_ea_request *er, | |||
980 | *eablk = cpu_to_be64(ip->i_di.di_eattr); | 975 | *eablk = cpu_to_be64(ip->i_di.di_eattr); |
981 | ip->i_di.di_eattr = blk; | 976 | ip->i_di.di_eattr = blk; |
982 | ip->i_di.di_flags |= GFS2_DIF_EA_INDIRECT; | 977 | ip->i_di.di_flags |= GFS2_DIF_EA_INDIRECT; |
983 | ip->i_di.di_blocks++; | 978 | gfs2_add_inode_blocks(&ip->i_inode, 1); |
984 | gfs2_set_inode_blocks(&ip->i_inode); | ||
985 | 979 | ||
986 | eablk++; | 980 | eablk++; |
987 | } | 981 | } |
@@ -1389,10 +1383,7 @@ static int ea_dealloc_indirect(struct gfs2_inode *ip) | |||
1389 | } | 1383 | } |
1390 | 1384 | ||
1391 | *eablk = 0; | 1385 | *eablk = 0; |
1392 | if (!ip->i_di.di_blocks) | 1386 | gfs2_add_inode_blocks(&ip->i_inode, -1); |
1393 | gfs2_consist_inode(ip); | ||
1394 | ip->i_di.di_blocks--; | ||
1395 | gfs2_set_inode_blocks(&ip->i_inode); | ||
1396 | } | 1387 | } |
1397 | if (bstart) | 1388 | if (bstart) |
1398 | gfs2_free_meta(ip, bstart, blen); | 1389 | gfs2_free_meta(ip, bstart, blen); |
@@ -1444,10 +1435,7 @@ static int ea_dealloc_block(struct gfs2_inode *ip) | |||
1444 | gfs2_free_meta(ip, ip->i_di.di_eattr, 1); | 1435 | gfs2_free_meta(ip, ip->i_di.di_eattr, 1); |
1445 | 1436 | ||
1446 | ip->i_di.di_eattr = 0; | 1437 | ip->i_di.di_eattr = 0; |
1447 | if (!ip->i_di.di_blocks) | 1438 | gfs2_add_inode_blocks(&ip->i_inode, -1); |
1448 | gfs2_consist_inode(ip); | ||
1449 | ip->i_di.di_blocks--; | ||
1450 | gfs2_set_inode_blocks(&ip->i_inode); | ||
1451 | 1439 | ||
1452 | error = gfs2_meta_inode_buffer(ip, &dibh); | 1440 | error = gfs2_meta_inode_buffer(ip, &dibh); |
1453 | if (!error) { | 1441 | if (!error) { |
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h index 898b456b386f..4ba2ea63119d 100644 --- a/fs/gfs2/incore.h +++ b/fs/gfs2/incore.h | |||
@@ -239,7 +239,6 @@ enum { | |||
239 | 239 | ||
240 | struct gfs2_dinode_host { | 240 | struct gfs2_dinode_host { |
241 | u64 di_size; /* number of bytes in file */ | 241 | u64 di_size; /* number of bytes in file */ |
242 | u64 di_blocks; /* number of blocks in file */ | ||
243 | u64 di_generation; /* generation number for NFS */ | 242 | u64 di_generation; /* generation number for NFS */ |
244 | u32 di_flags; /* GFS2_DIF_... */ | 243 | u32 di_flags; /* GFS2_DIF_... */ |
245 | /* These only apply to directories */ | 244 | /* These only apply to directories */ |
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index c3fe8aa03c4e..5f50dd53bf63 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c | |||
@@ -273,8 +273,7 @@ static int gfs2_dinode_in(struct gfs2_inode *ip, const void *buf) | |||
273 | ip->i_inode.i_nlink = be32_to_cpu(str->di_nlink); | 273 | ip->i_inode.i_nlink = be32_to_cpu(str->di_nlink); |
274 | di->di_size = be64_to_cpu(str->di_size); | 274 | di->di_size = be64_to_cpu(str->di_size); |
275 | i_size_write(&ip->i_inode, di->di_size); | 275 | i_size_write(&ip->i_inode, di->di_size); |
276 | di->di_blocks = be64_to_cpu(str->di_blocks); | 276 | gfs2_set_inode_blocks(&ip->i_inode, be64_to_cpu(str->di_blocks)); |
277 | gfs2_set_inode_blocks(&ip->i_inode); | ||
278 | ip->i_inode.i_atime.tv_sec = be64_to_cpu(str->di_atime); | 277 | ip->i_inode.i_atime.tv_sec = be64_to_cpu(str->di_atime); |
279 | ip->i_inode.i_atime.tv_nsec = be32_to_cpu(str->di_atime_nsec); | 278 | ip->i_inode.i_atime.tv_nsec = be32_to_cpu(str->di_atime_nsec); |
280 | ip->i_inode.i_mtime.tv_sec = be64_to_cpu(str->di_mtime); | 279 | ip->i_inode.i_mtime.tv_sec = be64_to_cpu(str->di_mtime); |
@@ -344,7 +343,7 @@ int gfs2_dinode_dealloc(struct gfs2_inode *ip) | |||
344 | struct gfs2_rgrpd *rgd; | 343 | struct gfs2_rgrpd *rgd; |
345 | int error; | 344 | int error; |
346 | 345 | ||
347 | if (ip->i_di.di_blocks != 1) { | 346 | if (gfs2_get_inode_blocks(&ip->i_inode) != 1) { |
348 | if (gfs2_consist_inode(ip)) | 347 | if (gfs2_consist_inode(ip)) |
349 | gfs2_dinode_print(ip); | 348 | gfs2_dinode_print(ip); |
350 | return -EIO; | 349 | return -EIO; |
@@ -1398,7 +1397,7 @@ void gfs2_dinode_out(const struct gfs2_inode *ip, void *buf) | |||
1398 | str->di_gid = cpu_to_be32(ip->i_inode.i_gid); | 1397 | str->di_gid = cpu_to_be32(ip->i_inode.i_gid); |
1399 | str->di_nlink = cpu_to_be32(ip->i_inode.i_nlink); | 1398 | str->di_nlink = cpu_to_be32(ip->i_inode.i_nlink); |
1400 | str->di_size = cpu_to_be64(di->di_size); | 1399 | str->di_size = cpu_to_be64(di->di_size); |
1401 | str->di_blocks = cpu_to_be64(di->di_blocks); | 1400 | str->di_blocks = cpu_to_be64(gfs2_get_inode_blocks(&ip->i_inode)); |
1402 | str->di_atime = cpu_to_be64(ip->i_inode.i_atime.tv_sec); | 1401 | str->di_atime = cpu_to_be64(ip->i_inode.i_atime.tv_sec); |
1403 | str->di_mtime = cpu_to_be64(ip->i_inode.i_mtime.tv_sec); | 1402 | str->di_mtime = cpu_to_be64(ip->i_inode.i_mtime.tv_sec); |
1404 | str->di_ctime = cpu_to_be64(ip->i_inode.i_ctime.tv_sec); | 1403 | str->di_ctime = cpu_to_be64(ip->i_inode.i_ctime.tv_sec); |
@@ -1430,8 +1429,8 @@ void gfs2_dinode_print(const struct gfs2_inode *ip) | |||
1430 | printk(KERN_INFO " no_addr = %llu\n", | 1429 | printk(KERN_INFO " no_addr = %llu\n", |
1431 | (unsigned long long)ip->i_no_addr); | 1430 | (unsigned long long)ip->i_no_addr); |
1432 | printk(KERN_INFO " di_size = %llu\n", (unsigned long long)di->di_size); | 1431 | printk(KERN_INFO " di_size = %llu\n", (unsigned long long)di->di_size); |
1433 | printk(KERN_INFO " di_blocks = %llu\n", | 1432 | printk(KERN_INFO " blocks = %llu\n", |
1434 | (unsigned long long)di->di_blocks); | 1433 | (unsigned long long)gfs2_get_inode_blocks(&ip->i_inode)); |
1435 | printk(KERN_INFO " i_goal = %llu\n", | 1434 | printk(KERN_INFO " i_goal = %llu\n", |
1436 | (unsigned long long)ip->i_goal); | 1435 | (unsigned long long)ip->i_goal); |
1437 | printk(KERN_INFO " di_flags = 0x%.8X\n", di->di_flags); | 1436 | printk(KERN_INFO " di_flags = 0x%.8X\n", di->di_flags); |
diff --git a/fs/gfs2/inode.h b/fs/gfs2/inode.h index db738686ca1d..580da454b38f 100644 --- a/fs/gfs2/inode.h +++ b/fs/gfs2/inode.h | |||
@@ -10,6 +10,8 @@ | |||
10 | #ifndef __INODE_DOT_H__ | 10 | #ifndef __INODE_DOT_H__ |
11 | #define __INODE_DOT_H__ | 11 | #define __INODE_DOT_H__ |
12 | 12 | ||
13 | #include "util.h" | ||
14 | |||
13 | static inline int gfs2_is_stuffed(const struct gfs2_inode *ip) | 15 | static inline int gfs2_is_stuffed(const struct gfs2_inode *ip) |
14 | { | 16 | { |
15 | return !ip->i_height; | 17 | return !ip->i_height; |
@@ -37,13 +39,25 @@ static inline int gfs2_is_dir(const struct gfs2_inode *ip) | |||
37 | return S_ISDIR(ip->i_inode.i_mode); | 39 | return S_ISDIR(ip->i_inode.i_mode); |
38 | } | 40 | } |
39 | 41 | ||
40 | static inline void gfs2_set_inode_blocks(struct inode *inode) | 42 | static inline void gfs2_set_inode_blocks(struct inode *inode, u64 blocks) |
43 | { | ||
44 | inode->i_blocks = blocks << | ||
45 | (GFS2_SB(inode)->sd_sb.sb_bsize_shift - GFS2_BASIC_BLOCK_SHIFT); | ||
46 | } | ||
47 | |||
48 | static inline u64 gfs2_get_inode_blocks(const struct inode *inode) | ||
41 | { | 49 | { |
42 | struct gfs2_inode *ip = GFS2_I(inode); | 50 | return inode->i_blocks >> |
43 | inode->i_blocks = ip->i_di.di_blocks << | ||
44 | (GFS2_SB(inode)->sd_sb.sb_bsize_shift - GFS2_BASIC_BLOCK_SHIFT); | 51 | (GFS2_SB(inode)->sd_sb.sb_bsize_shift - GFS2_BASIC_BLOCK_SHIFT); |
45 | } | 52 | } |
46 | 53 | ||
54 | static inline void gfs2_add_inode_blocks(struct inode *inode, s64 change) | ||
55 | { | ||
56 | gfs2_assert(GFS2_SB(inode), (change >= 0 || inode->i_blocks > -change)); | ||
57 | change *= (GFS2_SB(inode)->sd_sb.sb_bsize/GFS2_BASIC_BLOCK); | ||
58 | inode->i_blocks += change; | ||
59 | } | ||
60 | |||
47 | static inline int gfs2_check_inum(const struct gfs2_inode *ip, u64 no_addr, | 61 | static inline int gfs2_check_inum(const struct gfs2_inode *ip, u64 no_addr, |
48 | u64 no_formal_ino) | 62 | u64 no_formal_ino) |
49 | { | 63 | { |
diff --git a/fs/gfs2/ops_inode.c b/fs/gfs2/ops_inode.c index e87412902bed..301c94596678 100644 --- a/fs/gfs2/ops_inode.c +++ b/fs/gfs2/ops_inode.c | |||
@@ -981,8 +981,9 @@ static int setattr_chown(struct inode *inode, struct iattr *attr) | |||
981 | brelse(dibh); | 981 | brelse(dibh); |
982 | 982 | ||
983 | if (ouid != NO_QUOTA_CHANGE || ogid != NO_QUOTA_CHANGE) { | 983 | if (ouid != NO_QUOTA_CHANGE || ogid != NO_QUOTA_CHANGE) { |
984 | gfs2_quota_change(ip, -ip->i_di.di_blocks, ouid, ogid); | 984 | u64 blocks = gfs2_get_inode_blocks(&ip->i_inode); |
985 | gfs2_quota_change(ip, ip->i_di.di_blocks, nuid, ngid); | 985 | gfs2_quota_change(ip, -blocks, ouid, ogid); |
986 | gfs2_quota_change(ip, blocks, nuid, ngid); | ||
986 | } | 987 | } |
987 | 988 | ||
988 | out_end_trans: | 989 | out_end_trans: |