diff options
author | Bob Peterson <rpeterso@redhat.com> | 2015-03-16 12:52:05 -0400 |
---|---|---|
committer | Bob Peterson <rpeterso@redhat.com> | 2015-09-03 14:33:09 -0400 |
commit | 15562c439d0a1850b71aa1c0d92d1f4fb9503c8d (patch) | |
tree | 172b76ac4411cc2f1e740dc054cf15954f5e6084 | |
parent | 81648d043191e5f8f5870c5af6060b56383b139d (diff) |
GFS2: Move glock superblock pointer to field gl_name
What uniquely identifies a glock in the glock hash table is not
gl_name, but gl_name and its superblock pointer. This patch makes
the gl_name field correspond to a unique glock identifier. That will
allow us to simplify hashing with a future patch, since the hash
algorithm can then take the gl_name and hash its components in one
operation.
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Acked-by: Steven Whitehouse <swhiteho@redhat.com>
-rw-r--r-- | fs/gfs2/glock.c | 32 | ||||
-rw-r--r-- | fs/gfs2/glops.c | 38 | ||||
-rw-r--r-- | fs/gfs2/incore.h | 9 | ||||
-rw-r--r-- | fs/gfs2/lock_dlm.c | 10 | ||||
-rw-r--r-- | fs/gfs2/lops.c | 6 | ||||
-rw-r--r-- | fs/gfs2/meta_io.c | 6 | ||||
-rw-r--r-- | fs/gfs2/meta_io.h | 2 | ||||
-rw-r--r-- | fs/gfs2/quota.c | 22 | ||||
-rw-r--r-- | fs/gfs2/rgrp.c | 2 | ||||
-rw-r--r-- | fs/gfs2/trace_gfs2.h | 18 | ||||
-rw-r--r-- | fs/gfs2/trans.c | 4 |
11 files changed, 75 insertions, 74 deletions
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index a694413a6e32..13cba6e3ef6a 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c | |||
@@ -119,7 +119,7 @@ static void gfs2_glock_dealloc(struct rcu_head *rcu) | |||
119 | 119 | ||
120 | void gfs2_glock_free(struct gfs2_glock *gl) | 120 | void gfs2_glock_free(struct gfs2_glock *gl) |
121 | { | 121 | { |
122 | struct gfs2_sbd *sdp = gl->gl_sbd; | 122 | struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; |
123 | 123 | ||
124 | call_rcu(&gl->gl_rcu, gfs2_glock_dealloc); | 124 | call_rcu(&gl->gl_rcu, gfs2_glock_dealloc); |
125 | if (atomic_dec_and_test(&sdp->sd_glock_disposal)) | 125 | if (atomic_dec_and_test(&sdp->sd_glock_disposal)) |
@@ -192,7 +192,7 @@ static void gfs2_glock_remove_from_lru(struct gfs2_glock *gl) | |||
192 | 192 | ||
193 | void gfs2_glock_put(struct gfs2_glock *gl) | 193 | void gfs2_glock_put(struct gfs2_glock *gl) |
194 | { | 194 | { |
195 | struct gfs2_sbd *sdp = gl->gl_sbd; | 195 | struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; |
196 | struct address_space *mapping = gfs2_glock2aspace(gl); | 196 | struct address_space *mapping = gfs2_glock2aspace(gl); |
197 | 197 | ||
198 | if (lockref_put_or_lock(&gl->gl_lockref)) | 198 | if (lockref_put_or_lock(&gl->gl_lockref)) |
@@ -220,7 +220,6 @@ void gfs2_glock_put(struct gfs2_glock *gl) | |||
220 | */ | 220 | */ |
221 | 221 | ||
222 | static struct gfs2_glock *search_bucket(unsigned int hash, | 222 | static struct gfs2_glock *search_bucket(unsigned int hash, |
223 | const struct gfs2_sbd *sdp, | ||
224 | const struct lm_lockname *name) | 223 | const struct lm_lockname *name) |
225 | { | 224 | { |
226 | struct gfs2_glock *gl; | 225 | struct gfs2_glock *gl; |
@@ -229,8 +228,6 @@ static struct gfs2_glock *search_bucket(unsigned int hash, | |||
229 | hlist_bl_for_each_entry_rcu(gl, h, &gl_hash_table[hash], gl_list) { | 228 | hlist_bl_for_each_entry_rcu(gl, h, &gl_hash_table[hash], gl_list) { |
230 | if (!lm_name_equal(&gl->gl_name, name)) | 229 | if (!lm_name_equal(&gl->gl_name, name)) |
231 | continue; | 230 | continue; |
232 | if (gl->gl_sbd != sdp) | ||
233 | continue; | ||
234 | if (lockref_get_not_dead(&gl->gl_lockref)) | 231 | if (lockref_get_not_dead(&gl->gl_lockref)) |
235 | return gl; | 232 | return gl; |
236 | } | 233 | } |
@@ -506,7 +503,7 @@ __releases(&gl->gl_spin) | |||
506 | __acquires(&gl->gl_spin) | 503 | __acquires(&gl->gl_spin) |
507 | { | 504 | { |
508 | const struct gfs2_glock_operations *glops = gl->gl_ops; | 505 | const struct gfs2_glock_operations *glops = gl->gl_ops; |
509 | struct gfs2_sbd *sdp = gl->gl_sbd; | 506 | struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; |
510 | unsigned int lck_flags = gh ? gh->gh_flags : 0; | 507 | unsigned int lck_flags = gh ? gh->gh_flags : 0; |
511 | int ret; | 508 | int ret; |
512 | 509 | ||
@@ -628,7 +625,7 @@ out_unlock: | |||
628 | static void delete_work_func(struct work_struct *work) | 625 | static void delete_work_func(struct work_struct *work) |
629 | { | 626 | { |
630 | struct gfs2_glock *gl = container_of(work, struct gfs2_glock, gl_delete); | 627 | struct gfs2_glock *gl = container_of(work, struct gfs2_glock, gl_delete); |
631 | struct gfs2_sbd *sdp = gl->gl_sbd; | 628 | struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; |
632 | struct gfs2_inode *ip; | 629 | struct gfs2_inode *ip; |
633 | struct inode *inode; | 630 | struct inode *inode; |
634 | u64 no_addr = gl->gl_name.ln_number; | 631 | u64 no_addr = gl->gl_name.ln_number; |
@@ -704,14 +701,16 @@ int gfs2_glock_get(struct gfs2_sbd *sdp, u64 number, | |||
704 | struct gfs2_glock **glp) | 701 | struct gfs2_glock **glp) |
705 | { | 702 | { |
706 | struct super_block *s = sdp->sd_vfs; | 703 | struct super_block *s = sdp->sd_vfs; |
707 | struct lm_lockname name = { .ln_number = number, .ln_type = glops->go_type }; | 704 | struct lm_lockname name = { .ln_number = number, |
705 | .ln_type = glops->go_type, | ||
706 | .ln_sbd = sdp }; | ||
708 | struct gfs2_glock *gl, *tmp; | 707 | struct gfs2_glock *gl, *tmp; |
709 | unsigned int hash = gl_hash(sdp, &name); | 708 | unsigned int hash = gl_hash(sdp, &name); |
710 | struct address_space *mapping; | 709 | struct address_space *mapping; |
711 | struct kmem_cache *cachep; | 710 | struct kmem_cache *cachep; |
712 | 711 | ||
713 | rcu_read_lock(); | 712 | rcu_read_lock(); |
714 | gl = search_bucket(hash, sdp, &name); | 713 | gl = search_bucket(hash, &name); |
715 | rcu_read_unlock(); | 714 | rcu_read_unlock(); |
716 | 715 | ||
717 | *glp = gl; | 716 | *glp = gl; |
@@ -739,7 +738,6 @@ int gfs2_glock_get(struct gfs2_sbd *sdp, u64 number, | |||
739 | } | 738 | } |
740 | 739 | ||
741 | atomic_inc(&sdp->sd_glock_disposal); | 740 | atomic_inc(&sdp->sd_glock_disposal); |
742 | gl->gl_sbd = sdp; | ||
743 | gl->gl_flags = 0; | 741 | gl->gl_flags = 0; |
744 | gl->gl_name = name; | 742 | gl->gl_name = name; |
745 | gl->gl_lockref.count = 1; | 743 | gl->gl_lockref.count = 1; |
@@ -772,7 +770,7 @@ int gfs2_glock_get(struct gfs2_sbd *sdp, u64 number, | |||
772 | } | 770 | } |
773 | 771 | ||
774 | spin_lock_bucket(hash); | 772 | spin_lock_bucket(hash); |
775 | tmp = search_bucket(hash, sdp, &name); | 773 | tmp = search_bucket(hash, &name); |
776 | if (tmp) { | 774 | if (tmp) { |
777 | spin_unlock_bucket(hash); | 775 | spin_unlock_bucket(hash); |
778 | kfree(gl->gl_lksb.sb_lvbptr); | 776 | kfree(gl->gl_lksb.sb_lvbptr); |
@@ -928,7 +926,7 @@ __releases(&gl->gl_spin) | |||
928 | __acquires(&gl->gl_spin) | 926 | __acquires(&gl->gl_spin) |
929 | { | 927 | { |
930 | struct gfs2_glock *gl = gh->gh_gl; | 928 | struct gfs2_glock *gl = gh->gh_gl; |
931 | struct gfs2_sbd *sdp = gl->gl_sbd; | 929 | struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; |
932 | struct list_head *insert_pt = NULL; | 930 | struct list_head *insert_pt = NULL; |
933 | struct gfs2_holder *gh2; | 931 | struct gfs2_holder *gh2; |
934 | int try_futile = 0; | 932 | int try_futile = 0; |
@@ -1006,7 +1004,7 @@ trap_recursive: | |||
1006 | int gfs2_glock_nq(struct gfs2_holder *gh) | 1004 | int gfs2_glock_nq(struct gfs2_holder *gh) |
1007 | { | 1005 | { |
1008 | struct gfs2_glock *gl = gh->gh_gl; | 1006 | struct gfs2_glock *gl = gh->gh_gl; |
1009 | struct gfs2_sbd *sdp = gl->gl_sbd; | 1007 | struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; |
1010 | int error = 0; | 1008 | int error = 0; |
1011 | 1009 | ||
1012 | if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags))) | 1010 | if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags))) |
@@ -1313,7 +1311,7 @@ static int gfs2_should_freeze(const struct gfs2_glock *gl) | |||
1313 | 1311 | ||
1314 | void gfs2_glock_complete(struct gfs2_glock *gl, int ret) | 1312 | void gfs2_glock_complete(struct gfs2_glock *gl, int ret) |
1315 | { | 1313 | { |
1316 | struct lm_lockstruct *ls = &gl->gl_sbd->sd_lockstruct; | 1314 | struct lm_lockstruct *ls = &gl->gl_name.ln_sbd->sd_lockstruct; |
1317 | 1315 | ||
1318 | spin_lock(&gl->gl_spin); | 1316 | spin_lock(&gl->gl_spin); |
1319 | gl->gl_reply = ret; | 1317 | gl->gl_reply = ret; |
@@ -1471,7 +1469,7 @@ static void examine_bucket(glock_examiner examiner, const struct gfs2_sbd *sdp, | |||
1471 | 1469 | ||
1472 | rcu_read_lock(); | 1470 | rcu_read_lock(); |
1473 | hlist_bl_for_each_entry_rcu(gl, pos, head, gl_list) { | 1471 | hlist_bl_for_each_entry_rcu(gl, pos, head, gl_list) { |
1474 | if ((gl->gl_sbd == sdp) && lockref_get_not_dead(&gl->gl_lockref)) | 1472 | if ((gl->gl_name.ln_sbd == sdp) && lockref_get_not_dead(&gl->gl_lockref)) |
1475 | examiner(gl); | 1473 | examiner(gl); |
1476 | } | 1474 | } |
1477 | rcu_read_unlock(); | 1475 | rcu_read_unlock(); |
@@ -1569,7 +1567,7 @@ void gfs2_glock_finish_truncate(struct gfs2_inode *ip) | |||
1569 | int ret; | 1567 | int ret; |
1570 | 1568 | ||
1571 | ret = gfs2_truncatei_resume(ip); | 1569 | ret = gfs2_truncatei_resume(ip); |
1572 | gfs2_assert_withdraw(gl->gl_sbd, ret == 0); | 1570 | gfs2_assert_withdraw(gl->gl_name.ln_sbd, ret == 0); |
1573 | 1571 | ||
1574 | spin_lock(&gl->gl_spin); | 1572 | spin_lock(&gl->gl_spin); |
1575 | clear_bit(GLF_LOCK, &gl->gl_flags); | 1573 | clear_bit(GLF_LOCK, &gl->gl_flags); |
@@ -1872,7 +1870,7 @@ static int gfs2_glock_iter_next(struct gfs2_glock_iter *gi) | |||
1872 | gi->nhash = 0; | 1870 | gi->nhash = 0; |
1873 | } | 1871 | } |
1874 | /* Skip entries for other sb and dead entries */ | 1872 | /* Skip entries for other sb and dead entries */ |
1875 | } while (gi->sdp != gi->gl->gl_sbd || | 1873 | } while (gi->sdp != gi->gl->gl_name.ln_sbd || |
1876 | __lockref_is_dead(&gi->gl->gl_lockref)); | 1874 | __lockref_is_dead(&gi->gl->gl_lockref)); |
1877 | 1875 | ||
1878 | return 0; | 1876 | return 0; |
diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c index fa3fa5e94553..1f6c9c3fe5cb 100644 --- a/fs/gfs2/glops.c +++ b/fs/gfs2/glops.c | |||
@@ -32,13 +32,15 @@ struct workqueue_struct *gfs2_freeze_wq; | |||
32 | 32 | ||
33 | static void gfs2_ail_error(struct gfs2_glock *gl, const struct buffer_head *bh) | 33 | static void gfs2_ail_error(struct gfs2_glock *gl, const struct buffer_head *bh) |
34 | { | 34 | { |
35 | fs_err(gl->gl_sbd, "AIL buffer %p: blocknr %llu state 0x%08lx mapping %p page state 0x%lx\n", | 35 | fs_err(gl->gl_name.ln_sbd, |
36 | "AIL buffer %p: blocknr %llu state 0x%08lx mapping %p page " | ||
37 | "state 0x%lx\n", | ||
36 | bh, (unsigned long long)bh->b_blocknr, bh->b_state, | 38 | bh, (unsigned long long)bh->b_blocknr, bh->b_state, |
37 | bh->b_page->mapping, bh->b_page->flags); | 39 | bh->b_page->mapping, bh->b_page->flags); |
38 | fs_err(gl->gl_sbd, "AIL glock %u:%llu mapping %p\n", | 40 | fs_err(gl->gl_name.ln_sbd, "AIL glock %u:%llu mapping %p\n", |
39 | gl->gl_name.ln_type, gl->gl_name.ln_number, | 41 | gl->gl_name.ln_type, gl->gl_name.ln_number, |
40 | gfs2_glock2aspace(gl)); | 42 | gfs2_glock2aspace(gl)); |
41 | gfs2_lm_withdraw(gl->gl_sbd, "AIL error\n"); | 43 | gfs2_lm_withdraw(gl->gl_name.ln_sbd, "AIL error\n"); |
42 | } | 44 | } |
43 | 45 | ||
44 | /** | 46 | /** |
@@ -52,7 +54,7 @@ static void gfs2_ail_error(struct gfs2_glock *gl, const struct buffer_head *bh) | |||
52 | static void __gfs2_ail_flush(struct gfs2_glock *gl, bool fsync, | 54 | static void __gfs2_ail_flush(struct gfs2_glock *gl, bool fsync, |
53 | unsigned int nr_revokes) | 55 | unsigned int nr_revokes) |
54 | { | 56 | { |
55 | struct gfs2_sbd *sdp = gl->gl_sbd; | 57 | struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; |
56 | struct list_head *head = &gl->gl_ail_list; | 58 | struct list_head *head = &gl->gl_ail_list; |
57 | struct gfs2_bufdata *bd, *tmp; | 59 | struct gfs2_bufdata *bd, *tmp; |
58 | struct buffer_head *bh; | 60 | struct buffer_head *bh; |
@@ -80,7 +82,7 @@ static void __gfs2_ail_flush(struct gfs2_glock *gl, bool fsync, | |||
80 | 82 | ||
81 | static void gfs2_ail_empty_gl(struct gfs2_glock *gl) | 83 | static void gfs2_ail_empty_gl(struct gfs2_glock *gl) |
82 | { | 84 | { |
83 | struct gfs2_sbd *sdp = gl->gl_sbd; | 85 | struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; |
84 | struct gfs2_trans tr; | 86 | struct gfs2_trans tr; |
85 | 87 | ||
86 | memset(&tr, 0, sizeof(tr)); | 88 | memset(&tr, 0, sizeof(tr)); |
@@ -109,7 +111,7 @@ static void gfs2_ail_empty_gl(struct gfs2_glock *gl) | |||
109 | 111 | ||
110 | void gfs2_ail_flush(struct gfs2_glock *gl, bool fsync) | 112 | void gfs2_ail_flush(struct gfs2_glock *gl, bool fsync) |
111 | { | 113 | { |
112 | struct gfs2_sbd *sdp = gl->gl_sbd; | 114 | struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; |
113 | unsigned int revokes = atomic_read(&gl->gl_ail_count); | 115 | unsigned int revokes = atomic_read(&gl->gl_ail_count); |
114 | unsigned int max_revokes = (sdp->sd_sb.sb_bsize - sizeof(struct gfs2_log_descriptor)) / sizeof(u64); | 116 | unsigned int max_revokes = (sdp->sd_sb.sb_bsize - sizeof(struct gfs2_log_descriptor)) / sizeof(u64); |
115 | int ret; | 117 | int ret; |
@@ -139,7 +141,7 @@ void gfs2_ail_flush(struct gfs2_glock *gl, bool fsync) | |||
139 | 141 | ||
140 | static void rgrp_go_sync(struct gfs2_glock *gl) | 142 | static void rgrp_go_sync(struct gfs2_glock *gl) |
141 | { | 143 | { |
142 | struct gfs2_sbd *sdp = gl->gl_sbd; | 144 | struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; |
143 | struct address_space *mapping = &sdp->sd_aspace; | 145 | struct address_space *mapping = &sdp->sd_aspace; |
144 | struct gfs2_rgrpd *rgd; | 146 | struct gfs2_rgrpd *rgd; |
145 | int error; | 147 | int error; |
@@ -179,7 +181,7 @@ static void rgrp_go_sync(struct gfs2_glock *gl) | |||
179 | 181 | ||
180 | static void rgrp_go_inval(struct gfs2_glock *gl, int flags) | 182 | static void rgrp_go_inval(struct gfs2_glock *gl, int flags) |
181 | { | 183 | { |
182 | struct gfs2_sbd *sdp = gl->gl_sbd; | 184 | struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; |
183 | struct address_space *mapping = &sdp->sd_aspace; | 185 | struct address_space *mapping = &sdp->sd_aspace; |
184 | struct gfs2_rgrpd *rgd = gl->gl_object; | 186 | struct gfs2_rgrpd *rgd = gl->gl_object; |
185 | 187 | ||
@@ -218,7 +220,7 @@ static void inode_go_sync(struct gfs2_glock *gl) | |||
218 | 220 | ||
219 | GLOCK_BUG_ON(gl, gl->gl_state != LM_ST_EXCLUSIVE); | 221 | GLOCK_BUG_ON(gl, gl->gl_state != LM_ST_EXCLUSIVE); |
220 | 222 | ||
221 | gfs2_log_flush(gl->gl_sbd, gl, NORMAL_FLUSH); | 223 | gfs2_log_flush(gl->gl_name.ln_sbd, gl, NORMAL_FLUSH); |
222 | filemap_fdatawrite(metamapping); | 224 | filemap_fdatawrite(metamapping); |
223 | if (ip) { | 225 | if (ip) { |
224 | struct address_space *mapping = ip->i_inode.i_mapping; | 226 | struct address_space *mapping = ip->i_inode.i_mapping; |
@@ -252,7 +254,7 @@ static void inode_go_inval(struct gfs2_glock *gl, int flags) | |||
252 | { | 254 | { |
253 | struct gfs2_inode *ip = gl->gl_object; | 255 | struct gfs2_inode *ip = gl->gl_object; |
254 | 256 | ||
255 | gfs2_assert_withdraw(gl->gl_sbd, !atomic_read(&gl->gl_ail_count)); | 257 | gfs2_assert_withdraw(gl->gl_name.ln_sbd, !atomic_read(&gl->gl_ail_count)); |
256 | 258 | ||
257 | if (flags & DIO_METADATA) { | 259 | if (flags & DIO_METADATA) { |
258 | struct address_space *mapping = gfs2_glock2aspace(gl); | 260 | struct address_space *mapping = gfs2_glock2aspace(gl); |
@@ -264,9 +266,9 @@ static void inode_go_inval(struct gfs2_glock *gl, int flags) | |||
264 | } | 266 | } |
265 | } | 267 | } |
266 | 268 | ||
267 | if (ip == GFS2_I(gl->gl_sbd->sd_rindex)) { | 269 | if (ip == GFS2_I(gl->gl_name.ln_sbd->sd_rindex)) { |
268 | gfs2_log_flush(gl->gl_sbd, NULL, NORMAL_FLUSH); | 270 | gfs2_log_flush(gl->gl_name.ln_sbd, NULL, NORMAL_FLUSH); |
269 | gl->gl_sbd->sd_rindex_uptodate = 0; | 271 | gl->gl_name.ln_sbd->sd_rindex_uptodate = 0; |
270 | } | 272 | } |
271 | if (ip && S_ISREG(ip->i_inode.i_mode)) | 273 | if (ip && S_ISREG(ip->i_inode.i_mode)) |
272 | truncate_inode_pages(ip->i_inode.i_mapping, 0); | 274 | truncate_inode_pages(ip->i_inode.i_mapping, 0); |
@@ -281,7 +283,7 @@ static void inode_go_inval(struct gfs2_glock *gl, int flags) | |||
281 | 283 | ||
282 | static int inode_go_demote_ok(const struct gfs2_glock *gl) | 284 | static int inode_go_demote_ok(const struct gfs2_glock *gl) |
283 | { | 285 | { |
284 | struct gfs2_sbd *sdp = gl->gl_sbd; | 286 | struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; |
285 | struct gfs2_holder *gh; | 287 | struct gfs2_holder *gh; |
286 | 288 | ||
287 | if (sdp->sd_jindex == gl->gl_object || sdp->sd_rindex == gl->gl_object) | 289 | if (sdp->sd_jindex == gl->gl_object || sdp->sd_rindex == gl->gl_object) |
@@ -416,7 +418,7 @@ int gfs2_inode_refresh(struct gfs2_inode *ip) | |||
416 | static int inode_go_lock(struct gfs2_holder *gh) | 418 | static int inode_go_lock(struct gfs2_holder *gh) |
417 | { | 419 | { |
418 | struct gfs2_glock *gl = gh->gh_gl; | 420 | struct gfs2_glock *gl = gh->gh_gl; |
419 | struct gfs2_sbd *sdp = gl->gl_sbd; | 421 | struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; |
420 | struct gfs2_inode *ip = gl->gl_object; | 422 | struct gfs2_inode *ip = gl->gl_object; |
421 | int error = 0; | 423 | int error = 0; |
422 | 424 | ||
@@ -477,7 +479,7 @@ static void inode_go_dump(struct seq_file *seq, const struct gfs2_glock *gl) | |||
477 | static void freeze_go_sync(struct gfs2_glock *gl) | 479 | static void freeze_go_sync(struct gfs2_glock *gl) |
478 | { | 480 | { |
479 | int error = 0; | 481 | int error = 0; |
480 | struct gfs2_sbd *sdp = gl->gl_sbd; | 482 | struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; |
481 | 483 | ||
482 | if (gl->gl_state == LM_ST_SHARED && | 484 | if (gl->gl_state == LM_ST_SHARED && |
483 | test_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags)) { | 485 | test_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags)) { |
@@ -500,7 +502,7 @@ static void freeze_go_sync(struct gfs2_glock *gl) | |||
500 | 502 | ||
501 | static int freeze_go_xmote_bh(struct gfs2_glock *gl, struct gfs2_holder *gh) | 503 | static int freeze_go_xmote_bh(struct gfs2_glock *gl, struct gfs2_holder *gh) |
502 | { | 504 | { |
503 | struct gfs2_sbd *sdp = gl->gl_sbd; | 505 | struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; |
504 | struct gfs2_inode *ip = GFS2_I(sdp->sd_jdesc->jd_inode); | 506 | struct gfs2_inode *ip = GFS2_I(sdp->sd_jdesc->jd_inode); |
505 | struct gfs2_glock *j_gl = ip->i_gl; | 507 | struct gfs2_glock *j_gl = ip->i_gl; |
506 | struct gfs2_log_header_host head; | 508 | struct gfs2_log_header_host head; |
@@ -545,7 +547,7 @@ static int freeze_go_demote_ok(const struct gfs2_glock *gl) | |||
545 | static void iopen_go_callback(struct gfs2_glock *gl, bool remote) | 547 | static void iopen_go_callback(struct gfs2_glock *gl, bool remote) |
546 | { | 548 | { |
547 | struct gfs2_inode *ip = (struct gfs2_inode *)gl->gl_object; | 549 | struct gfs2_inode *ip = (struct gfs2_inode *)gl->gl_object; |
548 | struct gfs2_sbd *sdp = gl->gl_sbd; | 550 | struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; |
549 | 551 | ||
550 | if (!remote || (sdp->sd_vfs->s_flags & MS_RDONLY)) | 552 | if (!remote || (sdp->sd_vfs->s_flags & MS_RDONLY)) |
551 | return; | 553 | return; |
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h index a1ec7c20e498..35a55f3d6d3b 100644 --- a/fs/gfs2/incore.h +++ b/fs/gfs2/incore.h | |||
@@ -203,13 +203,15 @@ enum { | |||
203 | }; | 203 | }; |
204 | 204 | ||
205 | struct lm_lockname { | 205 | struct lm_lockname { |
206 | struct gfs2_sbd *ln_sbd; | ||
206 | u64 ln_number; | 207 | u64 ln_number; |
207 | unsigned int ln_type; | 208 | unsigned int ln_type; |
208 | }; | 209 | }; |
209 | 210 | ||
210 | #define lm_name_equal(name1, name2) \ | 211 | #define lm_name_equal(name1, name2) \ |
211 | (((name1)->ln_number == (name2)->ln_number) && \ | 212 | (((name1)->ln_number == (name2)->ln_number) && \ |
212 | ((name1)->ln_type == (name2)->ln_type)) | 213 | ((name1)->ln_type == (name2)->ln_type) && \ |
214 | ((name1)->ln_sbd == (name2)->ln_sbd)) | ||
213 | 215 | ||
214 | 216 | ||
215 | struct gfs2_glock_operations { | 217 | struct gfs2_glock_operations { |
@@ -327,7 +329,6 @@ enum { | |||
327 | 329 | ||
328 | struct gfs2_glock { | 330 | struct gfs2_glock { |
329 | struct hlist_bl_node gl_list; | 331 | struct hlist_bl_node gl_list; |
330 | struct gfs2_sbd *gl_sbd; | ||
331 | unsigned long gl_flags; /* GLF_... */ | 332 | unsigned long gl_flags; /* GLF_... */ |
332 | struct lm_lockname gl_name; | 333 | struct lm_lockname gl_name; |
333 | 334 | ||
@@ -835,7 +836,7 @@ static inline void gfs2_glstats_inc(struct gfs2_glock *gl, int which) | |||
835 | 836 | ||
836 | static inline void gfs2_sbstats_inc(const struct gfs2_glock *gl, int which) | 837 | static inline void gfs2_sbstats_inc(const struct gfs2_glock *gl, int which) |
837 | { | 838 | { |
838 | const struct gfs2_sbd *sdp = gl->gl_sbd; | 839 | const struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; |
839 | preempt_disable(); | 840 | preempt_disable(); |
840 | this_cpu_ptr(sdp->sd_lkstats)->lkstats[gl->gl_name.ln_type].stats[which]++; | 841 | this_cpu_ptr(sdp->sd_lkstats)->lkstats[gl->gl_name.ln_type].stats[which]++; |
841 | preempt_enable(); | 842 | preempt_enable(); |
diff --git a/fs/gfs2/lock_dlm.c b/fs/gfs2/lock_dlm.c index 641383a9c1bb..c962cfcf19b0 100644 --- a/fs/gfs2/lock_dlm.c +++ b/fs/gfs2/lock_dlm.c | |||
@@ -80,7 +80,7 @@ static inline void gfs2_update_reply_times(struct gfs2_glock *gl) | |||
80 | 80 | ||
81 | preempt_disable(); | 81 | preempt_disable(); |
82 | rtt = ktime_to_ns(ktime_sub(ktime_get_real(), gl->gl_dstamp)); | 82 | rtt = ktime_to_ns(ktime_sub(ktime_get_real(), gl->gl_dstamp)); |
83 | lks = this_cpu_ptr(gl->gl_sbd->sd_lkstats); | 83 | lks = this_cpu_ptr(gl->gl_name.ln_sbd->sd_lkstats); |
84 | gfs2_update_stats(&gl->gl_stats, index, rtt); /* Local */ | 84 | gfs2_update_stats(&gl->gl_stats, index, rtt); /* Local */ |
85 | gfs2_update_stats(&lks->lkstats[gltype], index, rtt); /* Global */ | 85 | gfs2_update_stats(&lks->lkstats[gltype], index, rtt); /* Global */ |
86 | preempt_enable(); | 86 | preempt_enable(); |
@@ -108,7 +108,7 @@ static inline void gfs2_update_request_times(struct gfs2_glock *gl) | |||
108 | dstamp = gl->gl_dstamp; | 108 | dstamp = gl->gl_dstamp; |
109 | gl->gl_dstamp = ktime_get_real(); | 109 | gl->gl_dstamp = ktime_get_real(); |
110 | irt = ktime_to_ns(ktime_sub(gl->gl_dstamp, dstamp)); | 110 | irt = ktime_to_ns(ktime_sub(gl->gl_dstamp, dstamp)); |
111 | lks = this_cpu_ptr(gl->gl_sbd->sd_lkstats); | 111 | lks = this_cpu_ptr(gl->gl_name.ln_sbd->sd_lkstats); |
112 | gfs2_update_stats(&gl->gl_stats, GFS2_LKS_SIRT, irt); /* Local */ | 112 | gfs2_update_stats(&gl->gl_stats, GFS2_LKS_SIRT, irt); /* Local */ |
113 | gfs2_update_stats(&lks->lkstats[gltype], GFS2_LKS_SIRT, irt); /* Global */ | 113 | gfs2_update_stats(&lks->lkstats[gltype], GFS2_LKS_SIRT, irt); /* Global */ |
114 | preempt_enable(); | 114 | preempt_enable(); |
@@ -253,7 +253,7 @@ static void gfs2_reverse_hex(char *c, u64 value) | |||
253 | static int gdlm_lock(struct gfs2_glock *gl, unsigned int req_state, | 253 | static int gdlm_lock(struct gfs2_glock *gl, unsigned int req_state, |
254 | unsigned int flags) | 254 | unsigned int flags) |
255 | { | 255 | { |
256 | struct lm_lockstruct *ls = &gl->gl_sbd->sd_lockstruct; | 256 | struct lm_lockstruct *ls = &gl->gl_name.ln_sbd->sd_lockstruct; |
257 | int req; | 257 | int req; |
258 | u32 lkf; | 258 | u32 lkf; |
259 | char strname[GDLM_STRNAME_BYTES] = ""; | 259 | char strname[GDLM_STRNAME_BYTES] = ""; |
@@ -281,7 +281,7 @@ static int gdlm_lock(struct gfs2_glock *gl, unsigned int req_state, | |||
281 | 281 | ||
282 | static void gdlm_put_lock(struct gfs2_glock *gl) | 282 | static void gdlm_put_lock(struct gfs2_glock *gl) |
283 | { | 283 | { |
284 | struct gfs2_sbd *sdp = gl->gl_sbd; | 284 | struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; |
285 | struct lm_lockstruct *ls = &sdp->sd_lockstruct; | 285 | struct lm_lockstruct *ls = &sdp->sd_lockstruct; |
286 | int lvb_needs_unlock = 0; | 286 | int lvb_needs_unlock = 0; |
287 | int error; | 287 | int error; |
@@ -319,7 +319,7 @@ static void gdlm_put_lock(struct gfs2_glock *gl) | |||
319 | 319 | ||
320 | static void gdlm_cancel(struct gfs2_glock *gl) | 320 | static void gdlm_cancel(struct gfs2_glock *gl) |
321 | { | 321 | { |
322 | struct lm_lockstruct *ls = &gl->gl_sbd->sd_lockstruct; | 322 | struct lm_lockstruct *ls = &gl->gl_name.ln_sbd->sd_lockstruct; |
323 | dlm_unlock(ls->ls_dlm, gl->gl_lksb.sb_lkid, DLM_LKF_CANCEL, NULL, gl); | 323 | dlm_unlock(ls->ls_dlm, gl->gl_lksb.sb_lkid, DLM_LKF_CANCEL, NULL, gl); |
324 | } | 324 | } |
325 | 325 | ||
diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c index 2c1ae861dc94..7833394a9a20 100644 --- a/fs/gfs2/lops.c +++ b/fs/gfs2/lops.c | |||
@@ -70,7 +70,7 @@ static bool buffer_is_rgrp(const struct gfs2_bufdata *bd) | |||
70 | static void maybe_release_space(struct gfs2_bufdata *bd) | 70 | static void maybe_release_space(struct gfs2_bufdata *bd) |
71 | { | 71 | { |
72 | struct gfs2_glock *gl = bd->bd_gl; | 72 | struct gfs2_glock *gl = bd->bd_gl; |
73 | struct gfs2_sbd *sdp = gl->gl_sbd; | 73 | struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; |
74 | struct gfs2_rgrpd *rgd = gl->gl_object; | 74 | struct gfs2_rgrpd *rgd = gl->gl_object; |
75 | unsigned int index = bd->bd_bh->b_blocknr - gl->gl_name.ln_number; | 75 | unsigned int index = bd->bd_bh->b_blocknr - gl->gl_name.ln_number; |
76 | struct gfs2_bitmap *bi = rgd->rd_bits + index; | 76 | struct gfs2_bitmap *bi = rgd->rd_bits + index; |
@@ -585,7 +585,7 @@ static int buf_lo_scan_elements(struct gfs2_jdesc *jd, unsigned int start, | |||
585 | static void gfs2_meta_sync(struct gfs2_glock *gl) | 585 | static void gfs2_meta_sync(struct gfs2_glock *gl) |
586 | { | 586 | { |
587 | struct address_space *mapping = gfs2_glock2aspace(gl); | 587 | struct address_space *mapping = gfs2_glock2aspace(gl); |
588 | struct gfs2_sbd *sdp = gl->gl_sbd; | 588 | struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; |
589 | int error; | 589 | int error; |
590 | 590 | ||
591 | if (mapping == NULL) | 591 | if (mapping == NULL) |
@@ -595,7 +595,7 @@ static void gfs2_meta_sync(struct gfs2_glock *gl) | |||
595 | error = filemap_fdatawait(mapping); | 595 | error = filemap_fdatawait(mapping); |
596 | 596 | ||
597 | if (error) | 597 | if (error) |
598 | gfs2_io_error(gl->gl_sbd); | 598 | gfs2_io_error(gl->gl_name.ln_sbd); |
599 | } | 599 | } |
600 | 600 | ||
601 | static void buf_lo_after_scan(struct gfs2_jdesc *jd, int error, int pass) | 601 | static void buf_lo_after_scan(struct gfs2_jdesc *jd, int error, int pass) |
diff --git a/fs/gfs2/meta_io.c b/fs/gfs2/meta_io.c index b984a6e190bc..0e1d4be5865a 100644 --- a/fs/gfs2/meta_io.c +++ b/fs/gfs2/meta_io.c | |||
@@ -114,7 +114,7 @@ const struct address_space_operations gfs2_rgrp_aops = { | |||
114 | struct buffer_head *gfs2_getbuf(struct gfs2_glock *gl, u64 blkno, int create) | 114 | struct buffer_head *gfs2_getbuf(struct gfs2_glock *gl, u64 blkno, int create) |
115 | { | 115 | { |
116 | struct address_space *mapping = gfs2_glock2aspace(gl); | 116 | struct address_space *mapping = gfs2_glock2aspace(gl); |
117 | struct gfs2_sbd *sdp = gl->gl_sbd; | 117 | struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; |
118 | struct page *page; | 118 | struct page *page; |
119 | struct buffer_head *bh; | 119 | struct buffer_head *bh; |
120 | unsigned int shift; | 120 | unsigned int shift; |
@@ -200,7 +200,7 @@ struct buffer_head *gfs2_meta_new(struct gfs2_glock *gl, u64 blkno) | |||
200 | int gfs2_meta_read(struct gfs2_glock *gl, u64 blkno, int flags, | 200 | int gfs2_meta_read(struct gfs2_glock *gl, u64 blkno, int flags, |
201 | struct buffer_head **bhp) | 201 | struct buffer_head **bhp) |
202 | { | 202 | { |
203 | struct gfs2_sbd *sdp = gl->gl_sbd; | 203 | struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; |
204 | struct buffer_head *bh; | 204 | struct buffer_head *bh; |
205 | 205 | ||
206 | if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags))) { | 206 | if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags))) { |
@@ -362,7 +362,7 @@ int gfs2_meta_indirect_buffer(struct gfs2_inode *ip, int height, u64 num, | |||
362 | 362 | ||
363 | struct buffer_head *gfs2_meta_ra(struct gfs2_glock *gl, u64 dblock, u32 extlen) | 363 | struct buffer_head *gfs2_meta_ra(struct gfs2_glock *gl, u64 dblock, u32 extlen) |
364 | { | 364 | { |
365 | struct gfs2_sbd *sdp = gl->gl_sbd; | 365 | struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; |
366 | struct buffer_head *first_bh, *bh; | 366 | struct buffer_head *first_bh, *bh; |
367 | u32 max_ra = gfs2_tune_get(sdp, gt_max_readahead) >> | 367 | u32 max_ra = gfs2_tune_get(sdp, gt_max_readahead) >> |
368 | sdp->sd_sb.sb_bsize_shift; | 368 | sdp->sd_sb.sb_bsize_shift; |
diff --git a/fs/gfs2/meta_io.h b/fs/gfs2/meta_io.h index ac5d8027d335..8ca161567a93 100644 --- a/fs/gfs2/meta_io.h +++ b/fs/gfs2/meta_io.h | |||
@@ -44,7 +44,7 @@ static inline struct gfs2_sbd *gfs2_mapping2sbd(struct address_space *mapping) | |||
44 | { | 44 | { |
45 | struct inode *inode = mapping->host; | 45 | struct inode *inode = mapping->host; |
46 | if (mapping->a_ops == &gfs2_meta_aops) | 46 | if (mapping->a_ops == &gfs2_meta_aops) |
47 | return (((struct gfs2_glock *)mapping) - 1)->gl_sbd; | 47 | return (((struct gfs2_glock *)mapping) - 1)->gl_name.ln_sbd; |
48 | else if (mapping->a_ops == &gfs2_rgrp_aops) | 48 | else if (mapping->a_ops == &gfs2_rgrp_aops) |
49 | return container_of(mapping, struct gfs2_sbd, sd_aspace); | 49 | return container_of(mapping, struct gfs2_sbd, sd_aspace); |
50 | else | 50 | else |
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index 9b61f92fcfdf..3a31226531ea 100644 --- a/fs/gfs2/quota.c +++ b/fs/gfs2/quota.c | |||
@@ -119,7 +119,7 @@ static void gfs2_qd_dispose(struct list_head *list) | |||
119 | 119 | ||
120 | while (!list_empty(list)) { | 120 | while (!list_empty(list)) { |
121 | qd = list_entry(list->next, struct gfs2_quota_data, qd_lru); | 121 | qd = list_entry(list->next, struct gfs2_quota_data, qd_lru); |
122 | sdp = qd->qd_gl->gl_sbd; | 122 | sdp = qd->qd_gl->gl_name.ln_sbd; |
123 | 123 | ||
124 | list_del(&qd->qd_lru); | 124 | list_del(&qd->qd_lru); |
125 | 125 | ||
@@ -302,7 +302,7 @@ static int qd_get(struct gfs2_sbd *sdp, struct kqid qid, | |||
302 | 302 | ||
303 | static void qd_hold(struct gfs2_quota_data *qd) | 303 | static void qd_hold(struct gfs2_quota_data *qd) |
304 | { | 304 | { |
305 | struct gfs2_sbd *sdp = qd->qd_gl->gl_sbd; | 305 | struct gfs2_sbd *sdp = qd->qd_gl->gl_name.ln_sbd; |
306 | gfs2_assert(sdp, !__lockref_is_dead(&qd->qd_lockref)); | 306 | gfs2_assert(sdp, !__lockref_is_dead(&qd->qd_lockref)); |
307 | lockref_get(&qd->qd_lockref); | 307 | lockref_get(&qd->qd_lockref); |
308 | } | 308 | } |
@@ -367,7 +367,7 @@ static void slot_put(struct gfs2_quota_data *qd) | |||
367 | 367 | ||
368 | static int bh_get(struct gfs2_quota_data *qd) | 368 | static int bh_get(struct gfs2_quota_data *qd) |
369 | { | 369 | { |
370 | struct gfs2_sbd *sdp = qd->qd_gl->gl_sbd; | 370 | struct gfs2_sbd *sdp = qd->qd_gl->gl_name.ln_sbd; |
371 | struct gfs2_inode *ip = GFS2_I(sdp->sd_qc_inode); | 371 | struct gfs2_inode *ip = GFS2_I(sdp->sd_qc_inode); |
372 | unsigned int block, offset; | 372 | unsigned int block, offset; |
373 | struct buffer_head *bh; | 373 | struct buffer_head *bh; |
@@ -414,7 +414,7 @@ fail: | |||
414 | 414 | ||
415 | static void bh_put(struct gfs2_quota_data *qd) | 415 | static void bh_put(struct gfs2_quota_data *qd) |
416 | { | 416 | { |
417 | struct gfs2_sbd *sdp = qd->qd_gl->gl_sbd; | 417 | struct gfs2_sbd *sdp = qd->qd_gl->gl_name.ln_sbd; |
418 | 418 | ||
419 | mutex_lock(&sdp->sd_quota_mutex); | 419 | mutex_lock(&sdp->sd_quota_mutex); |
420 | gfs2_assert(sdp, qd->qd_bh_count); | 420 | gfs2_assert(sdp, qd->qd_bh_count); |
@@ -486,7 +486,7 @@ static int qd_fish(struct gfs2_sbd *sdp, struct gfs2_quota_data **qdp) | |||
486 | 486 | ||
487 | static void qd_unlock(struct gfs2_quota_data *qd) | 487 | static void qd_unlock(struct gfs2_quota_data *qd) |
488 | { | 488 | { |
489 | gfs2_assert_warn(qd->qd_gl->gl_sbd, | 489 | gfs2_assert_warn(qd->qd_gl->gl_name.ln_sbd, |
490 | test_bit(QDF_LOCKED, &qd->qd_flags)); | 490 | test_bit(QDF_LOCKED, &qd->qd_flags)); |
491 | clear_bit(QDF_LOCKED, &qd->qd_flags); | 491 | clear_bit(QDF_LOCKED, &qd->qd_flags); |
492 | bh_put(qd); | 492 | bh_put(qd); |
@@ -614,7 +614,7 @@ static int sort_qd(const void *a, const void *b) | |||
614 | 614 | ||
615 | static void do_qc(struct gfs2_quota_data *qd, s64 change) | 615 | static void do_qc(struct gfs2_quota_data *qd, s64 change) |
616 | { | 616 | { |
617 | struct gfs2_sbd *sdp = qd->qd_gl->gl_sbd; | 617 | struct gfs2_sbd *sdp = qd->qd_gl->gl_name.ln_sbd; |
618 | struct gfs2_inode *ip = GFS2_I(sdp->sd_qc_inode); | 618 | struct gfs2_inode *ip = GFS2_I(sdp->sd_qc_inode); |
619 | struct gfs2_quota_change *qc = qd->qd_bh_qc; | 619 | struct gfs2_quota_change *qc = qd->qd_bh_qc; |
620 | s64 x; | 620 | s64 x; |
@@ -831,7 +831,7 @@ static int gfs2_adjust_quota(struct gfs2_inode *ip, loff_t loc, | |||
831 | 831 | ||
832 | static int do_sync(unsigned int num_qd, struct gfs2_quota_data **qda) | 832 | static int do_sync(unsigned int num_qd, struct gfs2_quota_data **qda) |
833 | { | 833 | { |
834 | struct gfs2_sbd *sdp = (*qda)->qd_gl->gl_sbd; | 834 | struct gfs2_sbd *sdp = (*qda)->qd_gl->gl_name.ln_sbd; |
835 | struct gfs2_inode *ip = GFS2_I(sdp->sd_quota_inode); | 835 | struct gfs2_inode *ip = GFS2_I(sdp->sd_quota_inode); |
836 | struct gfs2_alloc_parms ap = { .aflags = 0, }; | 836 | struct gfs2_alloc_parms ap = { .aflags = 0, }; |
837 | unsigned int data_blocks, ind_blocks; | 837 | unsigned int data_blocks, ind_blocks; |
@@ -922,7 +922,7 @@ out: | |||
922 | gfs2_glock_dq_uninit(&ghs[qx]); | 922 | gfs2_glock_dq_uninit(&ghs[qx]); |
923 | mutex_unlock(&ip->i_inode.i_mutex); | 923 | mutex_unlock(&ip->i_inode.i_mutex); |
924 | kfree(ghs); | 924 | kfree(ghs); |
925 | gfs2_log_flush(ip->i_gl->gl_sbd, ip->i_gl, NORMAL_FLUSH); | 925 | gfs2_log_flush(ip->i_gl->gl_name.ln_sbd, ip->i_gl, NORMAL_FLUSH); |
926 | return error; | 926 | return error; |
927 | } | 927 | } |
928 | 928 | ||
@@ -954,7 +954,7 @@ static int update_qd(struct gfs2_sbd *sdp, struct gfs2_quota_data *qd) | |||
954 | static int do_glock(struct gfs2_quota_data *qd, int force_refresh, | 954 | static int do_glock(struct gfs2_quota_data *qd, int force_refresh, |
955 | struct gfs2_holder *q_gh) | 955 | struct gfs2_holder *q_gh) |
956 | { | 956 | { |
957 | struct gfs2_sbd *sdp = qd->qd_gl->gl_sbd; | 957 | struct gfs2_sbd *sdp = qd->qd_gl->gl_name.ln_sbd; |
958 | struct gfs2_inode *ip = GFS2_I(sdp->sd_quota_inode); | 958 | struct gfs2_inode *ip = GFS2_I(sdp->sd_quota_inode); |
959 | struct gfs2_holder i_gh; | 959 | struct gfs2_holder i_gh; |
960 | int error; | 960 | int error; |
@@ -1037,7 +1037,7 @@ int gfs2_quota_lock(struct gfs2_inode *ip, kuid_t uid, kgid_t gid) | |||
1037 | 1037 | ||
1038 | static int need_sync(struct gfs2_quota_data *qd) | 1038 | static int need_sync(struct gfs2_quota_data *qd) |
1039 | { | 1039 | { |
1040 | struct gfs2_sbd *sdp = qd->qd_gl->gl_sbd; | 1040 | struct gfs2_sbd *sdp = qd->qd_gl->gl_name.ln_sbd; |
1041 | struct gfs2_tune *gt = &sdp->sd_tune; | 1041 | struct gfs2_tune *gt = &sdp->sd_tune; |
1042 | s64 value; | 1042 | s64 value; |
1043 | unsigned int num, den; | 1043 | unsigned int num, den; |
@@ -1125,7 +1125,7 @@ out: | |||
1125 | 1125 | ||
1126 | static int print_message(struct gfs2_quota_data *qd, char *type) | 1126 | static int print_message(struct gfs2_quota_data *qd, char *type) |
1127 | { | 1127 | { |
1128 | struct gfs2_sbd *sdp = qd->qd_gl->gl_sbd; | 1128 | struct gfs2_sbd *sdp = qd->qd_gl->gl_name.ln_sbd; |
1129 | 1129 | ||
1130 | fs_info(sdp, "quota %s for %s %u\n", | 1130 | fs_info(sdp, "quota %s for %s %u\n", |
1131 | type, | 1131 | type, |
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c index c6c62321dfd6..c92ae7fd36f3 100644 --- a/fs/gfs2/rgrp.c +++ b/fs/gfs2/rgrp.c | |||
@@ -1860,7 +1860,7 @@ static void try_rgrp_unlink(struct gfs2_rgrpd *rgd, u64 *last_unlinked, u64 skip | |||
1860 | static bool gfs2_rgrp_congested(const struct gfs2_rgrpd *rgd, int loops) | 1860 | static bool gfs2_rgrp_congested(const struct gfs2_rgrpd *rgd, int loops) |
1861 | { | 1861 | { |
1862 | const struct gfs2_glock *gl = rgd->rd_gl; | 1862 | const struct gfs2_glock *gl = rgd->rd_gl; |
1863 | const struct gfs2_sbd *sdp = gl->gl_sbd; | 1863 | const struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; |
1864 | struct gfs2_lkstats *st; | 1864 | struct gfs2_lkstats *st; |
1865 | s64 r_dcount, l_dcount; | 1865 | s64 r_dcount, l_dcount; |
1866 | s64 l_srttb, a_srttb = 0; | 1866 | s64 l_srttb, a_srttb = 0; |
diff --git a/fs/gfs2/trace_gfs2.h b/fs/gfs2/trace_gfs2.h index 20c007d747ab..fff47d0e0ef5 100644 --- a/fs/gfs2/trace_gfs2.h +++ b/fs/gfs2/trace_gfs2.h | |||
@@ -104,7 +104,7 @@ TRACE_EVENT(gfs2_glock_state_change, | |||
104 | ), | 104 | ), |
105 | 105 | ||
106 | TP_fast_assign( | 106 | TP_fast_assign( |
107 | __entry->dev = gl->gl_sbd->sd_vfs->s_dev; | 107 | __entry->dev = gl->gl_name.ln_sbd->sd_vfs->s_dev; |
108 | __entry->glnum = gl->gl_name.ln_number; | 108 | __entry->glnum = gl->gl_name.ln_number; |
109 | __entry->gltype = gl->gl_name.ln_type; | 109 | __entry->gltype = gl->gl_name.ln_type; |
110 | __entry->cur_state = glock_trace_state(gl->gl_state); | 110 | __entry->cur_state = glock_trace_state(gl->gl_state); |
@@ -140,7 +140,7 @@ TRACE_EVENT(gfs2_glock_put, | |||
140 | ), | 140 | ), |
141 | 141 | ||
142 | TP_fast_assign( | 142 | TP_fast_assign( |
143 | __entry->dev = gl->gl_sbd->sd_vfs->s_dev; | 143 | __entry->dev = gl->gl_name.ln_sbd->sd_vfs->s_dev; |
144 | __entry->gltype = gl->gl_name.ln_type; | 144 | __entry->gltype = gl->gl_name.ln_type; |
145 | __entry->glnum = gl->gl_name.ln_number; | 145 | __entry->glnum = gl->gl_name.ln_number; |
146 | __entry->cur_state = glock_trace_state(gl->gl_state); | 146 | __entry->cur_state = glock_trace_state(gl->gl_state); |
@@ -174,7 +174,7 @@ TRACE_EVENT(gfs2_demote_rq, | |||
174 | ), | 174 | ), |
175 | 175 | ||
176 | TP_fast_assign( | 176 | TP_fast_assign( |
177 | __entry->dev = gl->gl_sbd->sd_vfs->s_dev; | 177 | __entry->dev = gl->gl_name.ln_sbd->sd_vfs->s_dev; |
178 | __entry->gltype = gl->gl_name.ln_type; | 178 | __entry->gltype = gl->gl_name.ln_type; |
179 | __entry->glnum = gl->gl_name.ln_number; | 179 | __entry->glnum = gl->gl_name.ln_number; |
180 | __entry->cur_state = glock_trace_state(gl->gl_state); | 180 | __entry->cur_state = glock_trace_state(gl->gl_state); |
@@ -209,7 +209,7 @@ TRACE_EVENT(gfs2_promote, | |||
209 | ), | 209 | ), |
210 | 210 | ||
211 | TP_fast_assign( | 211 | TP_fast_assign( |
212 | __entry->dev = gh->gh_gl->gl_sbd->sd_vfs->s_dev; | 212 | __entry->dev = gh->gh_gl->gl_name.ln_sbd->sd_vfs->s_dev; |
213 | __entry->glnum = gh->gh_gl->gl_name.ln_number; | 213 | __entry->glnum = gh->gh_gl->gl_name.ln_number; |
214 | __entry->gltype = gh->gh_gl->gl_name.ln_type; | 214 | __entry->gltype = gh->gh_gl->gl_name.ln_type; |
215 | __entry->first = first; | 215 | __entry->first = first; |
@@ -239,7 +239,7 @@ TRACE_EVENT(gfs2_glock_queue, | |||
239 | ), | 239 | ), |
240 | 240 | ||
241 | TP_fast_assign( | 241 | TP_fast_assign( |
242 | __entry->dev = gh->gh_gl->gl_sbd->sd_vfs->s_dev; | 242 | __entry->dev = gh->gh_gl->gl_name.ln_sbd->sd_vfs->s_dev; |
243 | __entry->glnum = gh->gh_gl->gl_name.ln_number; | 243 | __entry->glnum = gh->gh_gl->gl_name.ln_number; |
244 | __entry->gltype = gh->gh_gl->gl_name.ln_type; | 244 | __entry->gltype = gh->gh_gl->gl_name.ln_type; |
245 | __entry->queue = queue; | 245 | __entry->queue = queue; |
@@ -278,7 +278,7 @@ TRACE_EVENT(gfs2_glock_lock_time, | |||
278 | ), | 278 | ), |
279 | 279 | ||
280 | TP_fast_assign( | 280 | TP_fast_assign( |
281 | __entry->dev = gl->gl_sbd->sd_vfs->s_dev; | 281 | __entry->dev = gl->gl_name.ln_sbd->sd_vfs->s_dev; |
282 | __entry->glnum = gl->gl_name.ln_number; | 282 | __entry->glnum = gl->gl_name.ln_number; |
283 | __entry->gltype = gl->gl_name.ln_type; | 283 | __entry->gltype = gl->gl_name.ln_type; |
284 | __entry->status = gl->gl_lksb.sb_status; | 284 | __entry->status = gl->gl_lksb.sb_status; |
@@ -333,7 +333,7 @@ TRACE_EVENT(gfs2_pin, | |||
333 | ), | 333 | ), |
334 | 334 | ||
335 | TP_fast_assign( | 335 | TP_fast_assign( |
336 | __entry->dev = bd->bd_gl->gl_sbd->sd_vfs->s_dev; | 336 | __entry->dev = bd->bd_gl->gl_name.ln_sbd->sd_vfs->s_dev; |
337 | __entry->pin = pin; | 337 | __entry->pin = pin; |
338 | __entry->len = bd->bd_bh->b_size; | 338 | __entry->len = bd->bd_bh->b_size; |
339 | __entry->block = bd->bd_bh->b_blocknr; | 339 | __entry->block = bd->bd_bh->b_blocknr; |
@@ -449,7 +449,7 @@ TRACE_EVENT(gfs2_bmap, | |||
449 | ), | 449 | ), |
450 | 450 | ||
451 | TP_fast_assign( | 451 | TP_fast_assign( |
452 | __entry->dev = ip->i_gl->gl_sbd->sd_vfs->s_dev; | 452 | __entry->dev = ip->i_gl->gl_name.ln_sbd->sd_vfs->s_dev; |
453 | __entry->lblock = lblock; | 453 | __entry->lblock = lblock; |
454 | __entry->pblock = buffer_mapped(bh) ? bh->b_blocknr : 0; | 454 | __entry->pblock = buffer_mapped(bh) ? bh->b_blocknr : 0; |
455 | __entry->inum = ip->i_no_addr; | 455 | __entry->inum = ip->i_no_addr; |
@@ -489,7 +489,7 @@ TRACE_EVENT(gfs2_block_alloc, | |||
489 | ), | 489 | ), |
490 | 490 | ||
491 | TP_fast_assign( | 491 | TP_fast_assign( |
492 | __entry->dev = rgd->rd_gl->gl_sbd->sd_vfs->s_dev; | 492 | __entry->dev = rgd->rd_gl->gl_name.ln_sbd->sd_vfs->s_dev; |
493 | __entry->start = block; | 493 | __entry->start = block; |
494 | __entry->inum = ip->i_no_addr; | 494 | __entry->inum = ip->i_no_addr; |
495 | __entry->len = len; | 495 | __entry->len = len; |
diff --git a/fs/gfs2/trans.c b/fs/gfs2/trans.c index 88bff2430669..b95d0d625f32 100644 --- a/fs/gfs2/trans.c +++ b/fs/gfs2/trans.c | |||
@@ -158,7 +158,7 @@ static struct gfs2_bufdata *gfs2_alloc_bufdata(struct gfs2_glock *gl, | |||
158 | void gfs2_trans_add_data(struct gfs2_glock *gl, struct buffer_head *bh) | 158 | void gfs2_trans_add_data(struct gfs2_glock *gl, struct buffer_head *bh) |
159 | { | 159 | { |
160 | struct gfs2_trans *tr = current->journal_info; | 160 | struct gfs2_trans *tr = current->journal_info; |
161 | struct gfs2_sbd *sdp = gl->gl_sbd; | 161 | struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; |
162 | struct address_space *mapping = bh->b_page->mapping; | 162 | struct address_space *mapping = bh->b_page->mapping; |
163 | struct gfs2_inode *ip = GFS2_I(mapping->host); | 163 | struct gfs2_inode *ip = GFS2_I(mapping->host); |
164 | struct gfs2_bufdata *bd; | 164 | struct gfs2_bufdata *bd; |
@@ -224,7 +224,7 @@ static void meta_lo_add(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd) | |||
224 | void gfs2_trans_add_meta(struct gfs2_glock *gl, struct buffer_head *bh) | 224 | void gfs2_trans_add_meta(struct gfs2_glock *gl, struct buffer_head *bh) |
225 | { | 225 | { |
226 | 226 | ||
227 | struct gfs2_sbd *sdp = gl->gl_sbd; | 227 | struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; |
228 | struct gfs2_bufdata *bd; | 228 | struct gfs2_bufdata *bd; |
229 | 229 | ||
230 | lock_buffer(bh); | 230 | lock_buffer(bh); |