aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Peterson <rpeterso@redhat.com>2015-07-16 09:28:04 -0400
committerBob Peterson <rpeterso@redhat.com>2015-12-14 13:16:38 -0500
commita097dc7e24cba7980bc5e2df461a4ef228e97e59 (patch)
treebfe9075d7d759fe136d540cea595dfbc4c81f361
parentb54e9a0b92d44843f6719ae22b0f6daf5b9b23b4 (diff)
GFS2: Make rgrp reservations part of the gfs2_inode structure
Before this patch, multi-block reservation structures were allocated from a special slab. This patch folds the structure into the gfs2_inode structure. The disadvantage is that the gfs2_inode needs more memory, even when a file is opened read-only. The advantages are: (a) we don't need the special slab and the extra time it takes to allocate and deallocate from it. (b) we no longer need to worry that the structure exists for things like quota management. (c) This also allows us to remove the calls to get_write_access and put_write_access since we know the structure will exist. Signed-off-by: Bob Peterson <rpeterso@redhat.com>
-rw-r--r--fs/gfs2/bmap.c11
-rw-r--r--fs/gfs2/file.c15
-rw-r--r--fs/gfs2/incore.h2
-rw-r--r--fs/gfs2/inode.c5
-rw-r--r--fs/gfs2/main.c13
-rw-r--r--fs/gfs2/quota.c4
-rw-r--r--fs/gfs2/quota.h2
-rw-r--r--fs/gfs2/rgrp.c52
-rw-r--r--fs/gfs2/rgrp.h2
-rw-r--r--fs/gfs2/super.c7
-rw-r--r--fs/gfs2/util.c1
-rw-r--r--fs/gfs2/util.h1
12 files changed, 33 insertions, 82 deletions
diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c
index 8d46ae4fa873..0860f0b5b3f1 100644
--- a/fs/gfs2/bmap.c
+++ b/fs/gfs2/bmap.c
@@ -787,8 +787,8 @@ static int do_strip(struct gfs2_inode *ip, struct buffer_head *dibh,
787 if (error) 787 if (error)
788 goto out_rlist; 788 goto out_rlist;
789 789
790 if (gfs2_rs_active(ip->i_res)) /* needs to be done with the rgrp glock held */ 790 if (gfs2_rs_active(&ip->i_res)) /* needs to be done with the rgrp glock held */
791 gfs2_rs_deltree(ip->i_res); 791 gfs2_rs_deltree(&ip->i_res);
792 792
793 error = gfs2_trans_begin(sdp, rg_blocks + RES_DINODE + 793 error = gfs2_trans_begin(sdp, rg_blocks + RES_DINODE +
794 RES_INDIRECT + RES_STATFS + RES_QUOTA, 794 RES_INDIRECT + RES_STATFS + RES_QUOTA,
@@ -1291,10 +1291,6 @@ int gfs2_setattr_size(struct inode *inode, u64 newsize)
1291 if (ret) 1291 if (ret)
1292 return ret; 1292 return ret;
1293 1293
1294 ret = get_write_access(inode);
1295 if (ret)
1296 return ret;
1297
1298 inode_dio_wait(inode); 1294 inode_dio_wait(inode);
1299 1295
1300 ret = gfs2_rsqa_alloc(ip); 1296 ret = gfs2_rsqa_alloc(ip);
@@ -1307,10 +1303,9 @@ int gfs2_setattr_size(struct inode *inode, u64 newsize)
1307 goto out; 1303 goto out;
1308 } 1304 }
1309 1305
1310 gfs2_rs_deltree(ip->i_res);
1311 ret = do_shrink(inode, oldsize, newsize); 1306 ret = do_shrink(inode, oldsize, newsize);
1312out: 1307out:
1313 put_write_access(inode); 1308 gfs2_rsqa_delete(ip, NULL);
1314 return ret; 1309 return ret;
1315} 1310}
1316 1311
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
index de001eb27bed..3ead27d64bf0 100644
--- a/fs/gfs2/file.c
+++ b/fs/gfs2/file.c
@@ -336,8 +336,8 @@ static void gfs2_size_hint(struct file *filep, loff_t offset, size_t size)
336 size_t blks = (size + sdp->sd_sb.sb_bsize - 1) >> sdp->sd_sb.sb_bsize_shift; 336 size_t blks = (size + sdp->sd_sb.sb_bsize - 1) >> sdp->sd_sb.sb_bsize_shift;
337 int hint = min_t(size_t, INT_MAX, blks); 337 int hint = min_t(size_t, INT_MAX, blks);
338 338
339 if (hint > atomic_read(&ip->i_res->rs_sizehint)) 339 if (hint > atomic_read(&ip->i_res.rs_sizehint))
340 atomic_set(&ip->i_res->rs_sizehint, hint); 340 atomic_set(&ip->i_res.rs_sizehint, hint);
341} 341}
342 342
343/** 343/**
@@ -397,13 +397,9 @@ static int gfs2_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
397 /* Update file times before taking page lock */ 397 /* Update file times before taking page lock */
398 file_update_time(vma->vm_file); 398 file_update_time(vma->vm_file);
399 399
400 ret = get_write_access(inode);
401 if (ret)
402 goto out;
403
404 ret = gfs2_rsqa_alloc(ip); 400 ret = gfs2_rsqa_alloc(ip);
405 if (ret) 401 if (ret)
406 goto out_write_access; 402 goto out;
407 403
408 gfs2_size_hint(vma->vm_file, pos, PAGE_CACHE_SIZE); 404 gfs2_size_hint(vma->vm_file, pos, PAGE_CACHE_SIZE);
409 405
@@ -486,8 +482,6 @@ out_uninit:
486 set_page_dirty(page); 482 set_page_dirty(page);
487 wait_for_stable_page(page); 483 wait_for_stable_page(page);
488 } 484 }
489out_write_access:
490 put_write_access(inode);
491out: 485out:
492 sb_end_pagefault(inode->i_sb); 486 sb_end_pagefault(inode->i_sb);
493 return block_page_mkwrite_return(ret); 487 return block_page_mkwrite_return(ret);
@@ -944,7 +938,8 @@ static long gfs2_fallocate(struct file *file, int mode, loff_t offset, loff_t le
944 938
945 ret = __gfs2_fallocate(file, mode, offset, len); 939 ret = __gfs2_fallocate(file, mode, offset, len);
946 if (ret) 940 if (ret)
947 gfs2_rs_deltree(ip->i_res); 941 gfs2_rs_deltree(&ip->i_res);
942
948out_putw: 943out_putw:
949 put_write_access(inode); 944 put_write_access(inode);
950out_unlock: 945out_unlock:
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h
index 6a22f66f058d..25d0f12aaec5 100644
--- a/fs/gfs2/incore.h
+++ b/fs/gfs2/incore.h
@@ -394,7 +394,7 @@ struct gfs2_inode {
394 struct gfs2_holder i_iopen_gh; 394 struct gfs2_holder i_iopen_gh;
395 struct gfs2_holder i_gh; /* for prepare/commit_write only */ 395 struct gfs2_holder i_gh; /* for prepare/commit_write only */
396 struct gfs2_qadata *i_qadata; /* quota allocation data */ 396 struct gfs2_qadata *i_qadata; /* quota allocation data */
397 struct gfs2_blkreserv *i_res; /* rgrp multi-block reservation */ 397 struct gfs2_blkreserv i_res; /* rgrp multi-block reservation */
398 struct gfs2_rgrpd *i_rgd; 398 struct gfs2_rgrpd *i_rgd;
399 u64 i_goal; /* goal block for allocations */ 399 u64 i_goal; /* goal block for allocations */
400 struct rw_semaphore i_rw_mutex; 400 struct rw_semaphore i_rw_mutex;
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index c37e6bf2958e..a8ce2e99cf5d 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -1859,10 +1859,6 @@ static int setattr_chown(struct inode *inode, struct iattr *attr)
1859 if (!(attr->ia_valid & ATTR_GID) || gid_eq(ogid, ngid)) 1859 if (!(attr->ia_valid & ATTR_GID) || gid_eq(ogid, ngid))
1860 ogid = ngid = NO_GID_QUOTA_CHANGE; 1860 ogid = ngid = NO_GID_QUOTA_CHANGE;
1861 1861
1862 error = get_write_access(inode);
1863 if (error)
1864 return error;
1865
1866 error = gfs2_rsqa_alloc(ip); 1862 error = gfs2_rsqa_alloc(ip);
1867 if (error) 1863 if (error)
1868 goto out; 1864 goto out;
@@ -1903,7 +1899,6 @@ out_end_trans:
1903out_gunlock_q: 1899out_gunlock_q:
1904 gfs2_quota_unlock(ip); 1900 gfs2_quota_unlock(ip);
1905out: 1901out:
1906 put_write_access(inode);
1907 return error; 1902 return error;
1908} 1903}
1909 1904
diff --git a/fs/gfs2/main.c b/fs/gfs2/main.c
index cde5c73c42df..1d709d496364 100644
--- a/fs/gfs2/main.c
+++ b/fs/gfs2/main.c
@@ -42,7 +42,8 @@ static void gfs2_init_inode_once(void *foo)
42 init_rwsem(&ip->i_rw_mutex); 42 init_rwsem(&ip->i_rw_mutex);
43 INIT_LIST_HEAD(&ip->i_trunc_list); 43 INIT_LIST_HEAD(&ip->i_trunc_list);
44 ip->i_qadata = NULL; 44 ip->i_qadata = NULL;
45 ip->i_res = NULL; 45 memset(&ip->i_res, 0, sizeof(ip->i_res));
46 RB_CLEAR_NODE(&ip->i_res.rs_node);
46 ip->i_hash_cache = NULL; 47 ip->i_hash_cache = NULL;
47} 48}
48 49
@@ -142,12 +143,6 @@ static int __init init_gfs2_fs(void)
142 if (!gfs2_qadata_cachep) 143 if (!gfs2_qadata_cachep)
143 goto fail; 144 goto fail;
144 145
145 gfs2_rsrv_cachep = kmem_cache_create("gfs2_mblk",
146 sizeof(struct gfs2_blkreserv),
147 0, 0, NULL);
148 if (!gfs2_rsrv_cachep)
149 goto fail;
150
151 register_shrinker(&gfs2_qd_shrinker); 146 register_shrinker(&gfs2_qd_shrinker);
152 147
153 error = register_filesystem(&gfs2_fs_type); 148 error = register_filesystem(&gfs2_fs_type);
@@ -200,9 +195,6 @@ fail_lru:
200 unregister_shrinker(&gfs2_qd_shrinker); 195 unregister_shrinker(&gfs2_qd_shrinker);
201 gfs2_glock_exit(); 196 gfs2_glock_exit();
202 197
203 if (gfs2_rsrv_cachep)
204 kmem_cache_destroy(gfs2_rsrv_cachep);
205
206 if (gfs2_qadata_cachep) 198 if (gfs2_qadata_cachep)
207 kmem_cache_destroy(gfs2_qadata_cachep); 199 kmem_cache_destroy(gfs2_qadata_cachep);
208 200
@@ -248,7 +240,6 @@ static void __exit exit_gfs2_fs(void)
248 rcu_barrier(); 240 rcu_barrier();
249 241
250 mempool_destroy(gfs2_page_pool); 242 mempool_destroy(gfs2_page_pool);
251 kmem_cache_destroy(gfs2_rsrv_cachep);
252 kmem_cache_destroy(gfs2_qadata_cachep); 243 kmem_cache_destroy(gfs2_qadata_cachep);
253 kmem_cache_destroy(gfs2_quotad_cachep); 244 kmem_cache_destroy(gfs2_quotad_cachep);
254 kmem_cache_destroy(gfs2_rgrpd_cachep); 245 kmem_cache_destroy(gfs2_rgrpd_cachep);
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c
index b845efdb5e3a..63a72109976c 100644
--- a/fs/gfs2/quota.c
+++ b/fs/gfs2/quota.c
@@ -550,10 +550,10 @@ int gfs2_qa_alloc(struct gfs2_inode *ip)
550 return error; 550 return error;
551} 551}
552 552
553void gfs2_qa_delete(struct gfs2_inode *ip) 553void gfs2_qa_delete(struct gfs2_inode *ip, atomic_t *wcount)
554{ 554{
555 down_write(&ip->i_rw_mutex); 555 down_write(&ip->i_rw_mutex);
556 if (ip->i_qadata) { 556 if (ip->i_qadata && ((wcount == NULL) || (atomic_read(wcount) <= 1))) {
557 kmem_cache_free(gfs2_qadata_cachep, ip->i_qadata); 557 kmem_cache_free(gfs2_qadata_cachep, ip->i_qadata);
558 ip->i_qadata = NULL; 558 ip->i_qadata = NULL;
559 } 559 }
diff --git a/fs/gfs2/quota.h b/fs/gfs2/quota.h
index 1940dd9cb1c7..5e47c935a515 100644
--- a/fs/gfs2/quota.h
+++ b/fs/gfs2/quota.h
@@ -19,7 +19,7 @@ struct gfs2_sbd;
19#define NO_GID_QUOTA_CHANGE INVALID_GID 19#define NO_GID_QUOTA_CHANGE INVALID_GID
20 20
21extern int gfs2_qa_alloc(struct gfs2_inode *ip); 21extern int gfs2_qa_alloc(struct gfs2_inode *ip);
22extern void gfs2_qa_delete(struct gfs2_inode *ip); 22extern void gfs2_qa_delete(struct gfs2_inode *ip, atomic_t *wcount);
23extern int gfs2_quota_hold(struct gfs2_inode *ip, kuid_t uid, kgid_t gid); 23extern int gfs2_quota_hold(struct gfs2_inode *ip, kuid_t uid, kgid_t gid);
24extern void gfs2_quota_unhold(struct gfs2_inode *ip); 24extern void gfs2_quota_unhold(struct gfs2_inode *ip);
25 25
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index cb30748e7b19..b879925ce134 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -602,28 +602,7 @@ void gfs2_free_clones(struct gfs2_rgrpd *rgd)
602 */ 602 */
603int gfs2_rsqa_alloc(struct gfs2_inode *ip) 603int gfs2_rsqa_alloc(struct gfs2_inode *ip)
604{ 604{
605 int error = 0; 605 return gfs2_qa_alloc(ip);
606
607 down_write(&ip->i_rw_mutex);
608 if (ip->i_res)
609 goto out;
610
611 ip->i_res = kmem_cache_zalloc(gfs2_rsrv_cachep, GFP_NOFS);
612 if (!ip->i_res) {
613 error = -ENOMEM;
614 goto out;
615 }
616
617 RB_CLEAR_NODE(&ip->i_res->rs_node);
618 error = gfs2_qa_alloc(ip);
619 if (error) {
620 kmem_cache_free(gfs2_rsrv_cachep, ip->i_res);
621 ip->i_res = NULL;
622 }
623
624out:
625 up_write(&ip->i_rw_mutex);
626 return error;
627} 606}
628 607
629static void dump_rs(struct seq_file *seq, const struct gfs2_blkreserv *rs) 608static void dump_rs(struct seq_file *seq, const struct gfs2_blkreserv *rs)
@@ -693,15 +672,12 @@ void gfs2_rs_deltree(struct gfs2_blkreserv *rs)
693void gfs2_rsqa_delete(struct gfs2_inode *ip, atomic_t *wcount) 672void gfs2_rsqa_delete(struct gfs2_inode *ip, atomic_t *wcount)
694{ 673{
695 down_write(&ip->i_rw_mutex); 674 down_write(&ip->i_rw_mutex);
696 if (ip->i_res && ((wcount == NULL) || (atomic_read(wcount) <= 1))) { 675 if ((wcount == NULL) || (atomic_read(wcount) <= 1)) {
697 gfs2_rs_deltree(ip->i_res); 676 gfs2_rs_deltree(&ip->i_res);
698 BUG_ON(ip->i_res->rs_free); 677 BUG_ON(ip->i_res.rs_free);
699 kmem_cache_free(gfs2_rsrv_cachep, ip->i_res);
700 ip->i_res = NULL;
701
702 gfs2_qa_delete(ip);
703 } 678 }
704 up_write(&ip->i_rw_mutex); 679 up_write(&ip->i_rw_mutex);
680 gfs2_qa_delete(ip, wcount);
705} 681}
706 682
707/** 683/**
@@ -1465,7 +1441,7 @@ static void rs_insert(struct gfs2_inode *ip)
1465{ 1441{
1466 struct rb_node **newn, *parent = NULL; 1442 struct rb_node **newn, *parent = NULL;
1467 int rc; 1443 int rc;
1468 struct gfs2_blkreserv *rs = ip->i_res; 1444 struct gfs2_blkreserv *rs = &ip->i_res;
1469 struct gfs2_rgrpd *rgd = rs->rs_rbm.rgd; 1445 struct gfs2_rgrpd *rgd = rs->rs_rbm.rgd;
1470 u64 fsblock = gfs2_rbm_to_block(&rs->rs_rbm); 1446 u64 fsblock = gfs2_rbm_to_block(&rs->rs_rbm);
1471 1447
@@ -1512,7 +1488,7 @@ static void rg_mblk_search(struct gfs2_rgrpd *rgd, struct gfs2_inode *ip,
1512{ 1488{
1513 struct gfs2_rbm rbm = { .rgd = rgd, }; 1489 struct gfs2_rbm rbm = { .rgd = rgd, };
1514 u64 goal; 1490 u64 goal;
1515 struct gfs2_blkreserv *rs = ip->i_res; 1491 struct gfs2_blkreserv *rs = &ip->i_res;
1516 u32 extlen; 1492 u32 extlen;
1517 u32 free_blocks = rgd->rd_free_clone - rgd->rd_reserved; 1493 u32 free_blocks = rgd->rd_free_clone - rgd->rd_reserved;
1518 int ret; 1494 int ret;
@@ -1583,7 +1559,7 @@ static u64 gfs2_next_unreserved_block(struct gfs2_rgrpd *rgd, u64 block,
1583 } 1559 }
1584 1560
1585 if (n) { 1561 if (n) {
1586 while ((rs_cmp(block, length, rs) == 0) && (ip->i_res != rs)) { 1562 while ((rs_cmp(block, length, rs) == 0) && (&ip->i_res != rs)) {
1587 block = gfs2_rbm_to_block(&rs->rs_rbm) + rs->rs_free; 1563 block = gfs2_rbm_to_block(&rs->rs_rbm) + rs->rs_free;
1588 n = n->rb_right; 1564 n = n->rb_right;
1589 if (n == NULL) 1565 if (n == NULL)
@@ -1993,7 +1969,7 @@ int gfs2_inplace_reserve(struct gfs2_inode *ip, struct gfs2_alloc_parms *ap)
1993{ 1969{
1994 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); 1970 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
1995 struct gfs2_rgrpd *begin = NULL; 1971 struct gfs2_rgrpd *begin = NULL;
1996 struct gfs2_blkreserv *rs = ip->i_res; 1972 struct gfs2_blkreserv *rs = &ip->i_res;
1997 int error = 0, rg_locked, flags = 0; 1973 int error = 0, rg_locked, flags = 0;
1998 u64 last_unlinked = NO_BLOCK; 1974 u64 last_unlinked = NO_BLOCK;
1999 int loops = 0; 1975 int loops = 0;
@@ -2122,7 +2098,7 @@ next_rgrp:
2122 2098
2123void gfs2_inplace_release(struct gfs2_inode *ip) 2099void gfs2_inplace_release(struct gfs2_inode *ip)
2124{ 2100{
2125 struct gfs2_blkreserv *rs = ip->i_res; 2101 struct gfs2_blkreserv *rs = &ip->i_res;
2126 2102
2127 if (rs->rs_rgd_gh.gh_gl) 2103 if (rs->rs_rgd_gh.gh_gl)
2128 gfs2_glock_dq_uninit(&rs->rs_rgd_gh); 2104 gfs2_glock_dq_uninit(&rs->rs_rgd_gh);
@@ -2276,7 +2252,7 @@ static void gfs2_rgrp_error(struct gfs2_rgrpd *rgd)
2276static void gfs2_adjust_reservation(struct gfs2_inode *ip, 2252static void gfs2_adjust_reservation(struct gfs2_inode *ip,
2277 const struct gfs2_rbm *rbm, unsigned len) 2253 const struct gfs2_rbm *rbm, unsigned len)
2278{ 2254{
2279 struct gfs2_blkreserv *rs = ip->i_res; 2255 struct gfs2_blkreserv *rs = &ip->i_res;
2280 struct gfs2_rgrpd *rgd = rbm->rgd; 2256 struct gfs2_rgrpd *rgd = rbm->rgd;
2281 unsigned rlen; 2257 unsigned rlen;
2282 u64 block; 2258 u64 block;
@@ -2319,8 +2295,8 @@ static void gfs2_set_alloc_start(struct gfs2_rbm *rbm,
2319{ 2295{
2320 u64 goal; 2296 u64 goal;
2321 2297
2322 if (gfs2_rs_active(ip->i_res)) { 2298 if (gfs2_rs_active(&ip->i_res)) {
2323 *rbm = ip->i_res->rs_rbm; 2299 *rbm = ip->i_res.rs_rbm;
2324 return; 2300 return;
2325 } 2301 }
2326 2302
@@ -2374,7 +2350,7 @@ int gfs2_alloc_blocks(struct gfs2_inode *ip, u64 *bn, unsigned int *nblocks,
2374 gfs2_alloc_extent(&rbm, dinode, nblocks); 2350 gfs2_alloc_extent(&rbm, dinode, nblocks);
2375 block = gfs2_rbm_to_block(&rbm); 2351 block = gfs2_rbm_to_block(&rbm);
2376 rbm.rgd->rd_last_alloc = block - rbm.rgd->rd_data0; 2352 rbm.rgd->rd_last_alloc = block - rbm.rgd->rd_data0;
2377 if (gfs2_rs_active(ip->i_res)) 2353 if (gfs2_rs_active(&ip->i_res))
2378 gfs2_adjust_reservation(ip, &rbm, *nblocks); 2354 gfs2_adjust_reservation(ip, &rbm, *nblocks);
2379 ndata = *nblocks; 2355 ndata = *nblocks;
2380 if (dinode) 2356 if (dinode)
diff --git a/fs/gfs2/rgrp.h b/fs/gfs2/rgrp.h
index 06bbefaabc31..66b51cf66dfa 100644
--- a/fs/gfs2/rgrp.h
+++ b/fs/gfs2/rgrp.h
@@ -78,7 +78,7 @@ extern int gfs2_rgrp_send_discards(struct gfs2_sbd *sdp, u64 offset,
78extern int gfs2_fitrim(struct file *filp, void __user *argp); 78extern int gfs2_fitrim(struct file *filp, void __user *argp);
79 79
80/* This is how to tell if a reservation is in the rgrp tree: */ 80/* This is how to tell if a reservation is in the rgrp tree: */
81static inline bool gfs2_rs_active(struct gfs2_blkreserv *rs) 81static inline bool gfs2_rs_active(const struct gfs2_blkreserv *rs)
82{ 82{
83 return rs && !RB_EMPTY_NODE(&rs->rs_node); 83 return rs && !RB_EMPTY_NODE(&rs->rs_node);
84} 84}
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
index b030ca223067..64f03c821b5d 100644
--- a/fs/gfs2/super.c
+++ b/fs/gfs2/super.c
@@ -1593,8 +1593,8 @@ out_truncate:
1593 1593
1594out_unlock: 1594out_unlock:
1595 /* Error path for case 1 */ 1595 /* Error path for case 1 */
1596 if (gfs2_rs_active(ip->i_res)) 1596 if (gfs2_rs_active(&ip->i_res))
1597 gfs2_rs_deltree(ip->i_res); 1597 gfs2_rs_deltree(&ip->i_res);
1598 1598
1599 if (test_bit(HIF_HOLDER, &ip->i_iopen_gh.gh_iflags)) { 1599 if (test_bit(HIF_HOLDER, &ip->i_iopen_gh.gh_iflags)) {
1600 ip->i_iopen_gh.gh_flags |= GL_NOCACHE; 1600 ip->i_iopen_gh.gh_flags |= GL_NOCACHE;
@@ -1632,7 +1632,8 @@ static struct inode *gfs2_alloc_inode(struct super_block *sb)
1632 ip->i_flags = 0; 1632 ip->i_flags = 0;
1633 ip->i_gl = NULL; 1633 ip->i_gl = NULL;
1634 ip->i_rgd = NULL; 1634 ip->i_rgd = NULL;
1635 ip->i_res = NULL; 1635 memset(&ip->i_res, 0, sizeof(ip->i_res));
1636 RB_CLEAR_NODE(&ip->i_res.rs_node);
1636 ip->i_rahead = 0; 1637 ip->i_rahead = 0;
1637 } 1638 }
1638 return &ip->i_inode; 1639 return &ip->i_inode;
diff --git a/fs/gfs2/util.c b/fs/gfs2/util.c
index 3b4819d8bdd6..cf645835710f 100644
--- a/fs/gfs2/util.c
+++ b/fs/gfs2/util.c
@@ -28,7 +28,6 @@ struct kmem_cache *gfs2_bufdata_cachep __read_mostly;
28struct kmem_cache *gfs2_rgrpd_cachep __read_mostly; 28struct kmem_cache *gfs2_rgrpd_cachep __read_mostly;
29struct kmem_cache *gfs2_quotad_cachep __read_mostly; 29struct kmem_cache *gfs2_quotad_cachep __read_mostly;
30struct kmem_cache *gfs2_qadata_cachep __read_mostly; 30struct kmem_cache *gfs2_qadata_cachep __read_mostly;
31struct kmem_cache *gfs2_rsrv_cachep __read_mostly;
32mempool_t *gfs2_page_pool __read_mostly; 31mempool_t *gfs2_page_pool __read_mostly;
33 32
34void gfs2_assert_i(struct gfs2_sbd *sdp) 33void gfs2_assert_i(struct gfs2_sbd *sdp)
diff --git a/fs/gfs2/util.h b/fs/gfs2/util.h
index 9edbcc94bdf6..c81295f407f6 100644
--- a/fs/gfs2/util.h
+++ b/fs/gfs2/util.h
@@ -150,7 +150,6 @@ extern struct kmem_cache *gfs2_bufdata_cachep;
150extern struct kmem_cache *gfs2_rgrpd_cachep; 150extern struct kmem_cache *gfs2_rgrpd_cachep;
151extern struct kmem_cache *gfs2_quotad_cachep; 151extern struct kmem_cache *gfs2_quotad_cachep;
152extern struct kmem_cache *gfs2_qadata_cachep; 152extern struct kmem_cache *gfs2_qadata_cachep;
153extern struct kmem_cache *gfs2_rsrv_cachep;
154extern mempool_t *gfs2_page_pool; 153extern mempool_t *gfs2_page_pool;
155 154
156static inline unsigned int gfs2_tune_get_i(struct gfs2_tune *gt, 155static inline unsigned int gfs2_tune_get_i(struct gfs2_tune *gt,