提交 15562c43 编写于 作者: B Bob Peterson

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: NBob Peterson <rpeterso@redhat.com>
Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
Acked-by: NSteven Whitehouse <swhiteho@redhat.com>
上级 81648d04
...@@ -119,7 +119,7 @@ static void gfs2_glock_dealloc(struct rcu_head *rcu) ...@@ -119,7 +119,7 @@ static void gfs2_glock_dealloc(struct rcu_head *rcu)
void gfs2_glock_free(struct gfs2_glock *gl) void gfs2_glock_free(struct gfs2_glock *gl)
{ {
struct gfs2_sbd *sdp = gl->gl_sbd; struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
call_rcu(&gl->gl_rcu, gfs2_glock_dealloc); call_rcu(&gl->gl_rcu, gfs2_glock_dealloc);
if (atomic_dec_and_test(&sdp->sd_glock_disposal)) 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,7 +192,7 @@ static void gfs2_glock_remove_from_lru(struct gfs2_glock *gl)
void gfs2_glock_put(struct gfs2_glock *gl) void gfs2_glock_put(struct gfs2_glock *gl)
{ {
struct gfs2_sbd *sdp = gl->gl_sbd; struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
struct address_space *mapping = gfs2_glock2aspace(gl); struct address_space *mapping = gfs2_glock2aspace(gl);
if (lockref_put_or_lock(&gl->gl_lockref)) if (lockref_put_or_lock(&gl->gl_lockref))
...@@ -220,7 +220,6 @@ void gfs2_glock_put(struct gfs2_glock *gl) ...@@ -220,7 +220,6 @@ void gfs2_glock_put(struct gfs2_glock *gl)
*/ */
static struct gfs2_glock *search_bucket(unsigned int hash, static struct gfs2_glock *search_bucket(unsigned int hash,
const struct gfs2_sbd *sdp,
const struct lm_lockname *name) const struct lm_lockname *name)
{ {
struct gfs2_glock *gl; struct gfs2_glock *gl;
...@@ -229,8 +228,6 @@ static struct gfs2_glock *search_bucket(unsigned int hash, ...@@ -229,8 +228,6 @@ static struct gfs2_glock *search_bucket(unsigned int hash,
hlist_bl_for_each_entry_rcu(gl, h, &gl_hash_table[hash], gl_list) { hlist_bl_for_each_entry_rcu(gl, h, &gl_hash_table[hash], gl_list) {
if (!lm_name_equal(&gl->gl_name, name)) if (!lm_name_equal(&gl->gl_name, name))
continue; continue;
if (gl->gl_sbd != sdp)
continue;
if (lockref_get_not_dead(&gl->gl_lockref)) if (lockref_get_not_dead(&gl->gl_lockref))
return gl; return gl;
} }
...@@ -506,7 +503,7 @@ __releases(&gl->gl_spin) ...@@ -506,7 +503,7 @@ __releases(&gl->gl_spin)
__acquires(&gl->gl_spin) __acquires(&gl->gl_spin)
{ {
const struct gfs2_glock_operations *glops = gl->gl_ops; const struct gfs2_glock_operations *glops = gl->gl_ops;
struct gfs2_sbd *sdp = gl->gl_sbd; struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
unsigned int lck_flags = gh ? gh->gh_flags : 0; unsigned int lck_flags = gh ? gh->gh_flags : 0;
int ret; int ret;
...@@ -628,7 +625,7 @@ __acquires(&gl->gl_spin) ...@@ -628,7 +625,7 @@ __acquires(&gl->gl_spin)
static void delete_work_func(struct work_struct *work) static void delete_work_func(struct work_struct *work)
{ {
struct gfs2_glock *gl = container_of(work, struct gfs2_glock, gl_delete); struct gfs2_glock *gl = container_of(work, struct gfs2_glock, gl_delete);
struct gfs2_sbd *sdp = gl->gl_sbd; struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
struct gfs2_inode *ip; struct gfs2_inode *ip;
struct inode *inode; struct inode *inode;
u64 no_addr = gl->gl_name.ln_number; u64 no_addr = gl->gl_name.ln_number;
...@@ -704,14 +701,16 @@ int gfs2_glock_get(struct gfs2_sbd *sdp, u64 number, ...@@ -704,14 +701,16 @@ int gfs2_glock_get(struct gfs2_sbd *sdp, u64 number,
struct gfs2_glock **glp) struct gfs2_glock **glp)
{ {
struct super_block *s = sdp->sd_vfs; struct super_block *s = sdp->sd_vfs;
struct lm_lockname name = { .ln_number = number, .ln_type = glops->go_type }; struct lm_lockname name = { .ln_number = number,
.ln_type = glops->go_type,
.ln_sbd = sdp };
struct gfs2_glock *gl, *tmp; struct gfs2_glock *gl, *tmp;
unsigned int hash = gl_hash(sdp, &name); unsigned int hash = gl_hash(sdp, &name);
struct address_space *mapping; struct address_space *mapping;
struct kmem_cache *cachep; struct kmem_cache *cachep;
rcu_read_lock(); rcu_read_lock();
gl = search_bucket(hash, sdp, &name); gl = search_bucket(hash, &name);
rcu_read_unlock(); rcu_read_unlock();
*glp = gl; *glp = gl;
...@@ -739,7 +738,6 @@ int gfs2_glock_get(struct gfs2_sbd *sdp, u64 number, ...@@ -739,7 +738,6 @@ int gfs2_glock_get(struct gfs2_sbd *sdp, u64 number,
} }
atomic_inc(&sdp->sd_glock_disposal); atomic_inc(&sdp->sd_glock_disposal);
gl->gl_sbd = sdp;
gl->gl_flags = 0; gl->gl_flags = 0;
gl->gl_name = name; gl->gl_name = name;
gl->gl_lockref.count = 1; gl->gl_lockref.count = 1;
...@@ -772,7 +770,7 @@ int gfs2_glock_get(struct gfs2_sbd *sdp, u64 number, ...@@ -772,7 +770,7 @@ int gfs2_glock_get(struct gfs2_sbd *sdp, u64 number,
} }
spin_lock_bucket(hash); spin_lock_bucket(hash);
tmp = search_bucket(hash, sdp, &name); tmp = search_bucket(hash, &name);
if (tmp) { if (tmp) {
spin_unlock_bucket(hash); spin_unlock_bucket(hash);
kfree(gl->gl_lksb.sb_lvbptr); kfree(gl->gl_lksb.sb_lvbptr);
...@@ -928,7 +926,7 @@ __releases(&gl->gl_spin) ...@@ -928,7 +926,7 @@ __releases(&gl->gl_spin)
__acquires(&gl->gl_spin) __acquires(&gl->gl_spin)
{ {
struct gfs2_glock *gl = gh->gh_gl; struct gfs2_glock *gl = gh->gh_gl;
struct gfs2_sbd *sdp = gl->gl_sbd; struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
struct list_head *insert_pt = NULL; struct list_head *insert_pt = NULL;
struct gfs2_holder *gh2; struct gfs2_holder *gh2;
int try_futile = 0; int try_futile = 0;
...@@ -1006,7 +1004,7 @@ __acquires(&gl->gl_spin) ...@@ -1006,7 +1004,7 @@ __acquires(&gl->gl_spin)
int gfs2_glock_nq(struct gfs2_holder *gh) int gfs2_glock_nq(struct gfs2_holder *gh)
{ {
struct gfs2_glock *gl = gh->gh_gl; struct gfs2_glock *gl = gh->gh_gl;
struct gfs2_sbd *sdp = gl->gl_sbd; struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
int error = 0; int error = 0;
if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags))) if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
...@@ -1313,7 +1311,7 @@ static int gfs2_should_freeze(const struct gfs2_glock *gl) ...@@ -1313,7 +1311,7 @@ static int gfs2_should_freeze(const struct gfs2_glock *gl)
void gfs2_glock_complete(struct gfs2_glock *gl, int ret) void gfs2_glock_complete(struct gfs2_glock *gl, int ret)
{ {
struct lm_lockstruct *ls = &gl->gl_sbd->sd_lockstruct; struct lm_lockstruct *ls = &gl->gl_name.ln_sbd->sd_lockstruct;
spin_lock(&gl->gl_spin); spin_lock(&gl->gl_spin);
gl->gl_reply = ret; gl->gl_reply = ret;
...@@ -1471,7 +1469,7 @@ static void examine_bucket(glock_examiner examiner, const struct gfs2_sbd *sdp, ...@@ -1471,7 +1469,7 @@ static void examine_bucket(glock_examiner examiner, const struct gfs2_sbd *sdp,
rcu_read_lock(); rcu_read_lock();
hlist_bl_for_each_entry_rcu(gl, pos, head, gl_list) { hlist_bl_for_each_entry_rcu(gl, pos, head, gl_list) {
if ((gl->gl_sbd == sdp) && lockref_get_not_dead(&gl->gl_lockref)) if ((gl->gl_name.ln_sbd == sdp) && lockref_get_not_dead(&gl->gl_lockref))
examiner(gl); examiner(gl);
} }
rcu_read_unlock(); rcu_read_unlock();
...@@ -1569,7 +1567,7 @@ void gfs2_glock_finish_truncate(struct gfs2_inode *ip) ...@@ -1569,7 +1567,7 @@ void gfs2_glock_finish_truncate(struct gfs2_inode *ip)
int ret; int ret;
ret = gfs2_truncatei_resume(ip); ret = gfs2_truncatei_resume(ip);
gfs2_assert_withdraw(gl->gl_sbd, ret == 0); gfs2_assert_withdraw(gl->gl_name.ln_sbd, ret == 0);
spin_lock(&gl->gl_spin); spin_lock(&gl->gl_spin);
clear_bit(GLF_LOCK, &gl->gl_flags); clear_bit(GLF_LOCK, &gl->gl_flags);
...@@ -1872,7 +1870,7 @@ static int gfs2_glock_iter_next(struct gfs2_glock_iter *gi) ...@@ -1872,7 +1870,7 @@ static int gfs2_glock_iter_next(struct gfs2_glock_iter *gi)
gi->nhash = 0; gi->nhash = 0;
} }
/* Skip entries for other sb and dead entries */ /* Skip entries for other sb and dead entries */
} while (gi->sdp != gi->gl->gl_sbd || } while (gi->sdp != gi->gl->gl_name.ln_sbd ||
__lockref_is_dead(&gi->gl->gl_lockref)); __lockref_is_dead(&gi->gl->gl_lockref));
return 0; return 0;
......
...@@ -32,13 +32,15 @@ struct workqueue_struct *gfs2_freeze_wq; ...@@ -32,13 +32,15 @@ struct workqueue_struct *gfs2_freeze_wq;
static void gfs2_ail_error(struct gfs2_glock *gl, const struct buffer_head *bh) static void gfs2_ail_error(struct gfs2_glock *gl, const struct buffer_head *bh)
{ {
fs_err(gl->gl_sbd, "AIL buffer %p: blocknr %llu state 0x%08lx mapping %p page state 0x%lx\n", fs_err(gl->gl_name.ln_sbd,
"AIL buffer %p: blocknr %llu state 0x%08lx mapping %p page "
"state 0x%lx\n",
bh, (unsigned long long)bh->b_blocknr, bh->b_state, bh, (unsigned long long)bh->b_blocknr, bh->b_state,
bh->b_page->mapping, bh->b_page->flags); bh->b_page->mapping, bh->b_page->flags);
fs_err(gl->gl_sbd, "AIL glock %u:%llu mapping %p\n", fs_err(gl->gl_name.ln_sbd, "AIL glock %u:%llu mapping %p\n",
gl->gl_name.ln_type, gl->gl_name.ln_number, gl->gl_name.ln_type, gl->gl_name.ln_number,
gfs2_glock2aspace(gl)); gfs2_glock2aspace(gl));
gfs2_lm_withdraw(gl->gl_sbd, "AIL error\n"); gfs2_lm_withdraw(gl->gl_name.ln_sbd, "AIL error\n");
} }
/** /**
...@@ -52,7 +54,7 @@ static void gfs2_ail_error(struct gfs2_glock *gl, const struct buffer_head *bh) ...@@ -52,7 +54,7 @@ static void gfs2_ail_error(struct gfs2_glock *gl, const struct buffer_head *bh)
static void __gfs2_ail_flush(struct gfs2_glock *gl, bool fsync, static void __gfs2_ail_flush(struct gfs2_glock *gl, bool fsync,
unsigned int nr_revokes) unsigned int nr_revokes)
{ {
struct gfs2_sbd *sdp = gl->gl_sbd; struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
struct list_head *head = &gl->gl_ail_list; struct list_head *head = &gl->gl_ail_list;
struct gfs2_bufdata *bd, *tmp; struct gfs2_bufdata *bd, *tmp;
struct buffer_head *bh; struct buffer_head *bh;
...@@ -80,7 +82,7 @@ static void __gfs2_ail_flush(struct gfs2_glock *gl, bool fsync, ...@@ -80,7 +82,7 @@ static void __gfs2_ail_flush(struct gfs2_glock *gl, bool fsync,
static void gfs2_ail_empty_gl(struct gfs2_glock *gl) static void gfs2_ail_empty_gl(struct gfs2_glock *gl)
{ {
struct gfs2_sbd *sdp = gl->gl_sbd; struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
struct gfs2_trans tr; struct gfs2_trans tr;
memset(&tr, 0, sizeof(tr)); memset(&tr, 0, sizeof(tr));
...@@ -109,7 +111,7 @@ static void gfs2_ail_empty_gl(struct gfs2_glock *gl) ...@@ -109,7 +111,7 @@ static void gfs2_ail_empty_gl(struct gfs2_glock *gl)
void gfs2_ail_flush(struct gfs2_glock *gl, bool fsync) void gfs2_ail_flush(struct gfs2_glock *gl, bool fsync)
{ {
struct gfs2_sbd *sdp = gl->gl_sbd; struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
unsigned int revokes = atomic_read(&gl->gl_ail_count); unsigned int revokes = atomic_read(&gl->gl_ail_count);
unsigned int max_revokes = (sdp->sd_sb.sb_bsize - sizeof(struct gfs2_log_descriptor)) / sizeof(u64); unsigned int max_revokes = (sdp->sd_sb.sb_bsize - sizeof(struct gfs2_log_descriptor)) / sizeof(u64);
int ret; int ret;
...@@ -139,7 +141,7 @@ void gfs2_ail_flush(struct gfs2_glock *gl, bool fsync) ...@@ -139,7 +141,7 @@ void gfs2_ail_flush(struct gfs2_glock *gl, bool fsync)
static void rgrp_go_sync(struct gfs2_glock *gl) static void rgrp_go_sync(struct gfs2_glock *gl)
{ {
struct gfs2_sbd *sdp = gl->gl_sbd; struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
struct address_space *mapping = &sdp->sd_aspace; struct address_space *mapping = &sdp->sd_aspace;
struct gfs2_rgrpd *rgd; struct gfs2_rgrpd *rgd;
int error; int error;
...@@ -179,7 +181,7 @@ static void rgrp_go_sync(struct gfs2_glock *gl) ...@@ -179,7 +181,7 @@ static void rgrp_go_sync(struct gfs2_glock *gl)
static void rgrp_go_inval(struct gfs2_glock *gl, int flags) static void rgrp_go_inval(struct gfs2_glock *gl, int flags)
{ {
struct gfs2_sbd *sdp = gl->gl_sbd; struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
struct address_space *mapping = &sdp->sd_aspace; struct address_space *mapping = &sdp->sd_aspace;
struct gfs2_rgrpd *rgd = gl->gl_object; struct gfs2_rgrpd *rgd = gl->gl_object;
...@@ -218,7 +220,7 @@ static void inode_go_sync(struct gfs2_glock *gl) ...@@ -218,7 +220,7 @@ static void inode_go_sync(struct gfs2_glock *gl)
GLOCK_BUG_ON(gl, gl->gl_state != LM_ST_EXCLUSIVE); GLOCK_BUG_ON(gl, gl->gl_state != LM_ST_EXCLUSIVE);
gfs2_log_flush(gl->gl_sbd, gl, NORMAL_FLUSH); gfs2_log_flush(gl->gl_name.ln_sbd, gl, NORMAL_FLUSH);
filemap_fdatawrite(metamapping); filemap_fdatawrite(metamapping);
if (ip) { if (ip) {
struct address_space *mapping = ip->i_inode.i_mapping; 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,7 +254,7 @@ static void inode_go_inval(struct gfs2_glock *gl, int flags)
{ {
struct gfs2_inode *ip = gl->gl_object; struct gfs2_inode *ip = gl->gl_object;
gfs2_assert_withdraw(gl->gl_sbd, !atomic_read(&gl->gl_ail_count)); gfs2_assert_withdraw(gl->gl_name.ln_sbd, !atomic_read(&gl->gl_ail_count));
if (flags & DIO_METADATA) { if (flags & DIO_METADATA) {
struct address_space *mapping = gfs2_glock2aspace(gl); struct address_space *mapping = gfs2_glock2aspace(gl);
...@@ -264,9 +266,9 @@ static void inode_go_inval(struct gfs2_glock *gl, int flags) ...@@ -264,9 +266,9 @@ static void inode_go_inval(struct gfs2_glock *gl, int flags)
} }
} }
if (ip == GFS2_I(gl->gl_sbd->sd_rindex)) { if (ip == GFS2_I(gl->gl_name.ln_sbd->sd_rindex)) {
gfs2_log_flush(gl->gl_sbd, NULL, NORMAL_FLUSH); gfs2_log_flush(gl->gl_name.ln_sbd, NULL, NORMAL_FLUSH);
gl->gl_sbd->sd_rindex_uptodate = 0; gl->gl_name.ln_sbd->sd_rindex_uptodate = 0;
} }
if (ip && S_ISREG(ip->i_inode.i_mode)) if (ip && S_ISREG(ip->i_inode.i_mode))
truncate_inode_pages(ip->i_inode.i_mapping, 0); 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,7 +283,7 @@ static void inode_go_inval(struct gfs2_glock *gl, int flags)
static int inode_go_demote_ok(const struct gfs2_glock *gl) static int inode_go_demote_ok(const struct gfs2_glock *gl)
{ {
struct gfs2_sbd *sdp = gl->gl_sbd; struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
struct gfs2_holder *gh; struct gfs2_holder *gh;
if (sdp->sd_jindex == gl->gl_object || sdp->sd_rindex == gl->gl_object) 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,7 +418,7 @@ int gfs2_inode_refresh(struct gfs2_inode *ip)
static int inode_go_lock(struct gfs2_holder *gh) static int inode_go_lock(struct gfs2_holder *gh)
{ {
struct gfs2_glock *gl = gh->gh_gl; struct gfs2_glock *gl = gh->gh_gl;
struct gfs2_sbd *sdp = gl->gl_sbd; struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
struct gfs2_inode *ip = gl->gl_object; struct gfs2_inode *ip = gl->gl_object;
int error = 0; int error = 0;
...@@ -477,7 +479,7 @@ static void inode_go_dump(struct seq_file *seq, const struct gfs2_glock *gl) ...@@ -477,7 +479,7 @@ static void inode_go_dump(struct seq_file *seq, const struct gfs2_glock *gl)
static void freeze_go_sync(struct gfs2_glock *gl) static void freeze_go_sync(struct gfs2_glock *gl)
{ {
int error = 0; int error = 0;
struct gfs2_sbd *sdp = gl->gl_sbd; struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
if (gl->gl_state == LM_ST_SHARED && if (gl->gl_state == LM_ST_SHARED &&
test_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags)) { test_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags)) {
...@@ -500,7 +502,7 @@ static void freeze_go_sync(struct gfs2_glock *gl) ...@@ -500,7 +502,7 @@ static void freeze_go_sync(struct gfs2_glock *gl)
static int freeze_go_xmote_bh(struct gfs2_glock *gl, struct gfs2_holder *gh) static int freeze_go_xmote_bh(struct gfs2_glock *gl, struct gfs2_holder *gh)
{ {
struct gfs2_sbd *sdp = gl->gl_sbd; struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
struct gfs2_inode *ip = GFS2_I(sdp->sd_jdesc->jd_inode); struct gfs2_inode *ip = GFS2_I(sdp->sd_jdesc->jd_inode);
struct gfs2_glock *j_gl = ip->i_gl; struct gfs2_glock *j_gl = ip->i_gl;
struct gfs2_log_header_host head; struct gfs2_log_header_host head;
...@@ -545,7 +547,7 @@ static int freeze_go_demote_ok(const struct gfs2_glock *gl) ...@@ -545,7 +547,7 @@ static int freeze_go_demote_ok(const struct gfs2_glock *gl)
static void iopen_go_callback(struct gfs2_glock *gl, bool remote) static void iopen_go_callback(struct gfs2_glock *gl, bool remote)
{ {
struct gfs2_inode *ip = (struct gfs2_inode *)gl->gl_object; struct gfs2_inode *ip = (struct gfs2_inode *)gl->gl_object;
struct gfs2_sbd *sdp = gl->gl_sbd; struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
if (!remote || (sdp->sd_vfs->s_flags & MS_RDONLY)) if (!remote || (sdp->sd_vfs->s_flags & MS_RDONLY))
return; return;
......
...@@ -203,13 +203,15 @@ enum { ...@@ -203,13 +203,15 @@ enum {
}; };
struct lm_lockname { struct lm_lockname {
struct gfs2_sbd *ln_sbd;
u64 ln_number; u64 ln_number;
unsigned int ln_type; unsigned int ln_type;
}; };
#define lm_name_equal(name1, name2) \ #define lm_name_equal(name1, name2) \
(((name1)->ln_number == (name2)->ln_number) && \ (((name1)->ln_number == (name2)->ln_number) && \
((name1)->ln_type == (name2)->ln_type)) ((name1)->ln_type == (name2)->ln_type) && \
((name1)->ln_sbd == (name2)->ln_sbd))
struct gfs2_glock_operations { struct gfs2_glock_operations {
...@@ -327,7 +329,6 @@ enum { ...@@ -327,7 +329,6 @@ enum {
struct gfs2_glock { struct gfs2_glock {
struct hlist_bl_node gl_list; struct hlist_bl_node gl_list;
struct gfs2_sbd *gl_sbd;
unsigned long gl_flags; /* GLF_... */ unsigned long gl_flags; /* GLF_... */
struct lm_lockname gl_name; struct lm_lockname gl_name;
...@@ -835,7 +836,7 @@ static inline void gfs2_glstats_inc(struct gfs2_glock *gl, int which) ...@@ -835,7 +836,7 @@ static inline void gfs2_glstats_inc(struct gfs2_glock *gl, int which)
static inline void gfs2_sbstats_inc(const struct gfs2_glock *gl, int which) static inline void gfs2_sbstats_inc(const struct gfs2_glock *gl, int which)
{ {
const struct gfs2_sbd *sdp = gl->gl_sbd; const struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
preempt_disable(); preempt_disable();
this_cpu_ptr(sdp->sd_lkstats)->lkstats[gl->gl_name.ln_type].stats[which]++; this_cpu_ptr(sdp->sd_lkstats)->lkstats[gl->gl_name.ln_type].stats[which]++;
preempt_enable(); preempt_enable();
......
...@@ -80,7 +80,7 @@ static inline void gfs2_update_reply_times(struct gfs2_glock *gl) ...@@ -80,7 +80,7 @@ static inline void gfs2_update_reply_times(struct gfs2_glock *gl)
preempt_disable(); preempt_disable();
rtt = ktime_to_ns(ktime_sub(ktime_get_real(), gl->gl_dstamp)); rtt = ktime_to_ns(ktime_sub(ktime_get_real(), gl->gl_dstamp));
lks = this_cpu_ptr(gl->gl_sbd->sd_lkstats); lks = this_cpu_ptr(gl->gl_name.ln_sbd->sd_lkstats);
gfs2_update_stats(&gl->gl_stats, index, rtt); /* Local */ gfs2_update_stats(&gl->gl_stats, index, rtt); /* Local */
gfs2_update_stats(&lks->lkstats[gltype], index, rtt); /* Global */ gfs2_update_stats(&lks->lkstats[gltype], index, rtt); /* Global */
preempt_enable(); preempt_enable();
...@@ -108,7 +108,7 @@ static inline void gfs2_update_request_times(struct gfs2_glock *gl) ...@@ -108,7 +108,7 @@ static inline void gfs2_update_request_times(struct gfs2_glock *gl)
dstamp = gl->gl_dstamp; dstamp = gl->gl_dstamp;
gl->gl_dstamp = ktime_get_real(); gl->gl_dstamp = ktime_get_real();
irt = ktime_to_ns(ktime_sub(gl->gl_dstamp, dstamp)); irt = ktime_to_ns(ktime_sub(gl->gl_dstamp, dstamp));
lks = this_cpu_ptr(gl->gl_sbd->sd_lkstats); lks = this_cpu_ptr(gl->gl_name.ln_sbd->sd_lkstats);
gfs2_update_stats(&gl->gl_stats, GFS2_LKS_SIRT, irt); /* Local */ gfs2_update_stats(&gl->gl_stats, GFS2_LKS_SIRT, irt); /* Local */
gfs2_update_stats(&lks->lkstats[gltype], GFS2_LKS_SIRT, irt); /* Global */ gfs2_update_stats(&lks->lkstats[gltype], GFS2_LKS_SIRT, irt); /* Global */
preempt_enable(); preempt_enable();
...@@ -253,7 +253,7 @@ static void gfs2_reverse_hex(char *c, u64 value) ...@@ -253,7 +253,7 @@ static void gfs2_reverse_hex(char *c, u64 value)
static int gdlm_lock(struct gfs2_glock *gl, unsigned int req_state, static int gdlm_lock(struct gfs2_glock *gl, unsigned int req_state,
unsigned int flags) unsigned int flags)
{ {
struct lm_lockstruct *ls = &gl->gl_sbd->sd_lockstruct; struct lm_lockstruct *ls = &gl->gl_name.ln_sbd->sd_lockstruct;
int req; int req;
u32 lkf; u32 lkf;
char strname[GDLM_STRNAME_BYTES] = ""; char strname[GDLM_STRNAME_BYTES] = "";
...@@ -281,7 +281,7 @@ static int gdlm_lock(struct gfs2_glock *gl, unsigned int req_state, ...@@ -281,7 +281,7 @@ static int gdlm_lock(struct gfs2_glock *gl, unsigned int req_state,
static void gdlm_put_lock(struct gfs2_glock *gl) static void gdlm_put_lock(struct gfs2_glock *gl)
{ {
struct gfs2_sbd *sdp = gl->gl_sbd; struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
struct lm_lockstruct *ls = &sdp->sd_lockstruct; struct lm_lockstruct *ls = &sdp->sd_lockstruct;
int lvb_needs_unlock = 0; int lvb_needs_unlock = 0;
int error; int error;
...@@ -319,7 +319,7 @@ static void gdlm_put_lock(struct gfs2_glock *gl) ...@@ -319,7 +319,7 @@ static void gdlm_put_lock(struct gfs2_glock *gl)
static void gdlm_cancel(struct gfs2_glock *gl) static void gdlm_cancel(struct gfs2_glock *gl)
{ {
struct lm_lockstruct *ls = &gl->gl_sbd->sd_lockstruct; struct lm_lockstruct *ls = &gl->gl_name.ln_sbd->sd_lockstruct;
dlm_unlock(ls->ls_dlm, gl->gl_lksb.sb_lkid, DLM_LKF_CANCEL, NULL, gl); dlm_unlock(ls->ls_dlm, gl->gl_lksb.sb_lkid, DLM_LKF_CANCEL, NULL, gl);
} }
......
...@@ -70,7 +70,7 @@ static bool buffer_is_rgrp(const struct gfs2_bufdata *bd) ...@@ -70,7 +70,7 @@ static bool buffer_is_rgrp(const struct gfs2_bufdata *bd)
static void maybe_release_space(struct gfs2_bufdata *bd) static void maybe_release_space(struct gfs2_bufdata *bd)
{ {
struct gfs2_glock *gl = bd->bd_gl; struct gfs2_glock *gl = bd->bd_gl;
struct gfs2_sbd *sdp = gl->gl_sbd; struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
struct gfs2_rgrpd *rgd = gl->gl_object; struct gfs2_rgrpd *rgd = gl->gl_object;
unsigned int index = bd->bd_bh->b_blocknr - gl->gl_name.ln_number; unsigned int index = bd->bd_bh->b_blocknr - gl->gl_name.ln_number;
struct gfs2_bitmap *bi = rgd->rd_bits + index; 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,7 +585,7 @@ static int buf_lo_scan_elements(struct gfs2_jdesc *jd, unsigned int start,
static void gfs2_meta_sync(struct gfs2_glock *gl) static void gfs2_meta_sync(struct gfs2_glock *gl)
{ {
struct address_space *mapping = gfs2_glock2aspace(gl); struct address_space *mapping = gfs2_glock2aspace(gl);
struct gfs2_sbd *sdp = gl->gl_sbd; struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
int error; int error;
if (mapping == NULL) if (mapping == NULL)
...@@ -595,7 +595,7 @@ static void gfs2_meta_sync(struct gfs2_glock *gl) ...@@ -595,7 +595,7 @@ static void gfs2_meta_sync(struct gfs2_glock *gl)
error = filemap_fdatawait(mapping); error = filemap_fdatawait(mapping);
if (error) if (error)
gfs2_io_error(gl->gl_sbd); gfs2_io_error(gl->gl_name.ln_sbd);
} }
static void buf_lo_after_scan(struct gfs2_jdesc *jd, int error, int pass) static void buf_lo_after_scan(struct gfs2_jdesc *jd, int error, int pass)
......
...@@ -114,7 +114,7 @@ const struct address_space_operations gfs2_rgrp_aops = { ...@@ -114,7 +114,7 @@ const struct address_space_operations gfs2_rgrp_aops = {
struct buffer_head *gfs2_getbuf(struct gfs2_glock *gl, u64 blkno, int create) struct buffer_head *gfs2_getbuf(struct gfs2_glock *gl, u64 blkno, int create)
{ {
struct address_space *mapping = gfs2_glock2aspace(gl); struct address_space *mapping = gfs2_glock2aspace(gl);
struct gfs2_sbd *sdp = gl->gl_sbd; struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
struct page *page; struct page *page;
struct buffer_head *bh; struct buffer_head *bh;
unsigned int shift; unsigned int shift;
...@@ -200,7 +200,7 @@ struct buffer_head *gfs2_meta_new(struct gfs2_glock *gl, u64 blkno) ...@@ -200,7 +200,7 @@ struct buffer_head *gfs2_meta_new(struct gfs2_glock *gl, u64 blkno)
int gfs2_meta_read(struct gfs2_glock *gl, u64 blkno, int flags, int gfs2_meta_read(struct gfs2_glock *gl, u64 blkno, int flags,
struct buffer_head **bhp) struct buffer_head **bhp)
{ {
struct gfs2_sbd *sdp = gl->gl_sbd; struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
struct buffer_head *bh; struct buffer_head *bh;
if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags))) { 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,7 +362,7 @@ int gfs2_meta_indirect_buffer(struct gfs2_inode *ip, int height, u64 num,
struct buffer_head *gfs2_meta_ra(struct gfs2_glock *gl, u64 dblock, u32 extlen) struct buffer_head *gfs2_meta_ra(struct gfs2_glock *gl, u64 dblock, u32 extlen)
{ {
struct gfs2_sbd *sdp = gl->gl_sbd; struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
struct buffer_head *first_bh, *bh; struct buffer_head *first_bh, *bh;
u32 max_ra = gfs2_tune_get(sdp, gt_max_readahead) >> u32 max_ra = gfs2_tune_get(sdp, gt_max_readahead) >>
sdp->sd_sb.sb_bsize_shift; sdp->sd_sb.sb_bsize_shift;
......
...@@ -44,7 +44,7 @@ static inline struct gfs2_sbd *gfs2_mapping2sbd(struct address_space *mapping) ...@@ -44,7 +44,7 @@ static inline struct gfs2_sbd *gfs2_mapping2sbd(struct address_space *mapping)
{ {
struct inode *inode = mapping->host; struct inode *inode = mapping->host;
if (mapping->a_ops == &gfs2_meta_aops) if (mapping->a_ops == &gfs2_meta_aops)
return (((struct gfs2_glock *)mapping) - 1)->gl_sbd; return (((struct gfs2_glock *)mapping) - 1)->gl_name.ln_sbd;
else if (mapping->a_ops == &gfs2_rgrp_aops) else if (mapping->a_ops == &gfs2_rgrp_aops)
return container_of(mapping, struct gfs2_sbd, sd_aspace); return container_of(mapping, struct gfs2_sbd, sd_aspace);
else else
......
...@@ -119,7 +119,7 @@ static void gfs2_qd_dispose(struct list_head *list) ...@@ -119,7 +119,7 @@ static void gfs2_qd_dispose(struct list_head *list)
while (!list_empty(list)) { while (!list_empty(list)) {
qd = list_entry(list->next, struct gfs2_quota_data, qd_lru); qd = list_entry(list->next, struct gfs2_quota_data, qd_lru);
sdp = qd->qd_gl->gl_sbd; sdp = qd->qd_gl->gl_name.ln_sbd;
list_del(&qd->qd_lru); list_del(&qd->qd_lru);
...@@ -302,7 +302,7 @@ static int qd_get(struct gfs2_sbd *sdp, struct kqid qid, ...@@ -302,7 +302,7 @@ static int qd_get(struct gfs2_sbd *sdp, struct kqid qid,
static void qd_hold(struct gfs2_quota_data *qd) static void qd_hold(struct gfs2_quota_data *qd)
{ {
struct gfs2_sbd *sdp = qd->qd_gl->gl_sbd; struct gfs2_sbd *sdp = qd->qd_gl->gl_name.ln_sbd;
gfs2_assert(sdp, !__lockref_is_dead(&qd->qd_lockref)); gfs2_assert(sdp, !__lockref_is_dead(&qd->qd_lockref));
lockref_get(&qd->qd_lockref); lockref_get(&qd->qd_lockref);
} }
...@@ -367,7 +367,7 @@ static void slot_put(struct gfs2_quota_data *qd) ...@@ -367,7 +367,7 @@ static void slot_put(struct gfs2_quota_data *qd)
static int bh_get(struct gfs2_quota_data *qd) static int bh_get(struct gfs2_quota_data *qd)
{ {
struct gfs2_sbd *sdp = qd->qd_gl->gl_sbd; struct gfs2_sbd *sdp = qd->qd_gl->gl_name.ln_sbd;
struct gfs2_inode *ip = GFS2_I(sdp->sd_qc_inode); struct gfs2_inode *ip = GFS2_I(sdp->sd_qc_inode);
unsigned int block, offset; unsigned int block, offset;
struct buffer_head *bh; struct buffer_head *bh;
...@@ -414,7 +414,7 @@ static int bh_get(struct gfs2_quota_data *qd) ...@@ -414,7 +414,7 @@ static int bh_get(struct gfs2_quota_data *qd)
static void bh_put(struct gfs2_quota_data *qd) static void bh_put(struct gfs2_quota_data *qd)
{ {
struct gfs2_sbd *sdp = qd->qd_gl->gl_sbd; struct gfs2_sbd *sdp = qd->qd_gl->gl_name.ln_sbd;
mutex_lock(&sdp->sd_quota_mutex); mutex_lock(&sdp->sd_quota_mutex);
gfs2_assert(sdp, qd->qd_bh_count); 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,7 +486,7 @@ static int qd_fish(struct gfs2_sbd *sdp, struct gfs2_quota_data **qdp)
static void qd_unlock(struct gfs2_quota_data *qd) static void qd_unlock(struct gfs2_quota_data *qd)
{ {
gfs2_assert_warn(qd->qd_gl->gl_sbd, gfs2_assert_warn(qd->qd_gl->gl_name.ln_sbd,
test_bit(QDF_LOCKED, &qd->qd_flags)); test_bit(QDF_LOCKED, &qd->qd_flags));
clear_bit(QDF_LOCKED, &qd->qd_flags); clear_bit(QDF_LOCKED, &qd->qd_flags);
bh_put(qd); bh_put(qd);
...@@ -614,7 +614,7 @@ static int sort_qd(const void *a, const void *b) ...@@ -614,7 +614,7 @@ static int sort_qd(const void *a, const void *b)
static void do_qc(struct gfs2_quota_data *qd, s64 change) static void do_qc(struct gfs2_quota_data *qd, s64 change)
{ {
struct gfs2_sbd *sdp = qd->qd_gl->gl_sbd; struct gfs2_sbd *sdp = qd->qd_gl->gl_name.ln_sbd;
struct gfs2_inode *ip = GFS2_I(sdp->sd_qc_inode); struct gfs2_inode *ip = GFS2_I(sdp->sd_qc_inode);
struct gfs2_quota_change *qc = qd->qd_bh_qc; struct gfs2_quota_change *qc = qd->qd_bh_qc;
s64 x; s64 x;
...@@ -831,7 +831,7 @@ static int gfs2_adjust_quota(struct gfs2_inode *ip, loff_t loc, ...@@ -831,7 +831,7 @@ static int gfs2_adjust_quota(struct gfs2_inode *ip, loff_t loc,
static int do_sync(unsigned int num_qd, struct gfs2_quota_data **qda) static int do_sync(unsigned int num_qd, struct gfs2_quota_data **qda)
{ {
struct gfs2_sbd *sdp = (*qda)->qd_gl->gl_sbd; struct gfs2_sbd *sdp = (*qda)->qd_gl->gl_name.ln_sbd;
struct gfs2_inode *ip = GFS2_I(sdp->sd_quota_inode); struct gfs2_inode *ip = GFS2_I(sdp->sd_quota_inode);
struct gfs2_alloc_parms ap = { .aflags = 0, }; struct gfs2_alloc_parms ap = { .aflags = 0, };
unsigned int data_blocks, ind_blocks; unsigned int data_blocks, ind_blocks;
...@@ -922,7 +922,7 @@ static int do_sync(unsigned int num_qd, struct gfs2_quota_data **qda) ...@@ -922,7 +922,7 @@ static int do_sync(unsigned int num_qd, struct gfs2_quota_data **qda)
gfs2_glock_dq_uninit(&ghs[qx]); gfs2_glock_dq_uninit(&ghs[qx]);
mutex_unlock(&ip->i_inode.i_mutex); mutex_unlock(&ip->i_inode.i_mutex);
kfree(ghs); kfree(ghs);
gfs2_log_flush(ip->i_gl->gl_sbd, ip->i_gl, NORMAL_FLUSH); gfs2_log_flush(ip->i_gl->gl_name.ln_sbd, ip->i_gl, NORMAL_FLUSH);
return error; return error;
} }
...@@ -954,7 +954,7 @@ static int update_qd(struct gfs2_sbd *sdp, struct gfs2_quota_data *qd) ...@@ -954,7 +954,7 @@ static int update_qd(struct gfs2_sbd *sdp, struct gfs2_quota_data *qd)
static int do_glock(struct gfs2_quota_data *qd, int force_refresh, static int do_glock(struct gfs2_quota_data *qd, int force_refresh,
struct gfs2_holder *q_gh) struct gfs2_holder *q_gh)
{ {
struct gfs2_sbd *sdp = qd->qd_gl->gl_sbd; struct gfs2_sbd *sdp = qd->qd_gl->gl_name.ln_sbd;
struct gfs2_inode *ip = GFS2_I(sdp->sd_quota_inode); struct gfs2_inode *ip = GFS2_I(sdp->sd_quota_inode);
struct gfs2_holder i_gh; struct gfs2_holder i_gh;
int error; int error;
...@@ -1037,7 +1037,7 @@ int gfs2_quota_lock(struct gfs2_inode *ip, kuid_t uid, kgid_t gid) ...@@ -1037,7 +1037,7 @@ int gfs2_quota_lock(struct gfs2_inode *ip, kuid_t uid, kgid_t gid)
static int need_sync(struct gfs2_quota_data *qd) static int need_sync(struct gfs2_quota_data *qd)
{ {
struct gfs2_sbd *sdp = qd->qd_gl->gl_sbd; struct gfs2_sbd *sdp = qd->qd_gl->gl_name.ln_sbd;
struct gfs2_tune *gt = &sdp->sd_tune; struct gfs2_tune *gt = &sdp->sd_tune;
s64 value; s64 value;
unsigned int num, den; unsigned int num, den;
...@@ -1125,7 +1125,7 @@ void gfs2_quota_unlock(struct gfs2_inode *ip) ...@@ -1125,7 +1125,7 @@ void gfs2_quota_unlock(struct gfs2_inode *ip)
static int print_message(struct gfs2_quota_data *qd, char *type) static int print_message(struct gfs2_quota_data *qd, char *type)
{ {
struct gfs2_sbd *sdp = qd->qd_gl->gl_sbd; struct gfs2_sbd *sdp = qd->qd_gl->gl_name.ln_sbd;
fs_info(sdp, "quota %s for %s %u\n", fs_info(sdp, "quota %s for %s %u\n",
type, type,
......
...@@ -1860,7 +1860,7 @@ static void try_rgrp_unlink(struct gfs2_rgrpd *rgd, u64 *last_unlinked, u64 skip ...@@ -1860,7 +1860,7 @@ static void try_rgrp_unlink(struct gfs2_rgrpd *rgd, u64 *last_unlinked, u64 skip
static bool gfs2_rgrp_congested(const struct gfs2_rgrpd *rgd, int loops) static bool gfs2_rgrp_congested(const struct gfs2_rgrpd *rgd, int loops)
{ {
const struct gfs2_glock *gl = rgd->rd_gl; const struct gfs2_glock *gl = rgd->rd_gl;
const struct gfs2_sbd *sdp = gl->gl_sbd; const struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
struct gfs2_lkstats *st; struct gfs2_lkstats *st;
s64 r_dcount, l_dcount; s64 r_dcount, l_dcount;
s64 l_srttb, a_srttb = 0; s64 l_srttb, a_srttb = 0;
......
...@@ -104,7 +104,7 @@ TRACE_EVENT(gfs2_glock_state_change, ...@@ -104,7 +104,7 @@ TRACE_EVENT(gfs2_glock_state_change,
), ),
TP_fast_assign( TP_fast_assign(
__entry->dev = gl->gl_sbd->sd_vfs->s_dev; __entry->dev = gl->gl_name.ln_sbd->sd_vfs->s_dev;
__entry->glnum = gl->gl_name.ln_number; __entry->glnum = gl->gl_name.ln_number;
__entry->gltype = gl->gl_name.ln_type; __entry->gltype = gl->gl_name.ln_type;
__entry->cur_state = glock_trace_state(gl->gl_state); __entry->cur_state = glock_trace_state(gl->gl_state);
...@@ -140,7 +140,7 @@ TRACE_EVENT(gfs2_glock_put, ...@@ -140,7 +140,7 @@ TRACE_EVENT(gfs2_glock_put,
), ),
TP_fast_assign( TP_fast_assign(
__entry->dev = gl->gl_sbd->sd_vfs->s_dev; __entry->dev = gl->gl_name.ln_sbd->sd_vfs->s_dev;
__entry->gltype = gl->gl_name.ln_type; __entry->gltype = gl->gl_name.ln_type;
__entry->glnum = gl->gl_name.ln_number; __entry->glnum = gl->gl_name.ln_number;
__entry->cur_state = glock_trace_state(gl->gl_state); __entry->cur_state = glock_trace_state(gl->gl_state);
...@@ -174,7 +174,7 @@ TRACE_EVENT(gfs2_demote_rq, ...@@ -174,7 +174,7 @@ TRACE_EVENT(gfs2_demote_rq,
), ),
TP_fast_assign( TP_fast_assign(
__entry->dev = gl->gl_sbd->sd_vfs->s_dev; __entry->dev = gl->gl_name.ln_sbd->sd_vfs->s_dev;
__entry->gltype = gl->gl_name.ln_type; __entry->gltype = gl->gl_name.ln_type;
__entry->glnum = gl->gl_name.ln_number; __entry->glnum = gl->gl_name.ln_number;
__entry->cur_state = glock_trace_state(gl->gl_state); __entry->cur_state = glock_trace_state(gl->gl_state);
...@@ -209,7 +209,7 @@ TRACE_EVENT(gfs2_promote, ...@@ -209,7 +209,7 @@ TRACE_EVENT(gfs2_promote,
), ),
TP_fast_assign( TP_fast_assign(
__entry->dev = gh->gh_gl->gl_sbd->sd_vfs->s_dev; __entry->dev = gh->gh_gl->gl_name.ln_sbd->sd_vfs->s_dev;
__entry->glnum = gh->gh_gl->gl_name.ln_number; __entry->glnum = gh->gh_gl->gl_name.ln_number;
__entry->gltype = gh->gh_gl->gl_name.ln_type; __entry->gltype = gh->gh_gl->gl_name.ln_type;
__entry->first = first; __entry->first = first;
...@@ -239,7 +239,7 @@ TRACE_EVENT(gfs2_glock_queue, ...@@ -239,7 +239,7 @@ TRACE_EVENT(gfs2_glock_queue,
), ),
TP_fast_assign( TP_fast_assign(
__entry->dev = gh->gh_gl->gl_sbd->sd_vfs->s_dev; __entry->dev = gh->gh_gl->gl_name.ln_sbd->sd_vfs->s_dev;
__entry->glnum = gh->gh_gl->gl_name.ln_number; __entry->glnum = gh->gh_gl->gl_name.ln_number;
__entry->gltype = gh->gh_gl->gl_name.ln_type; __entry->gltype = gh->gh_gl->gl_name.ln_type;
__entry->queue = queue; __entry->queue = queue;
...@@ -278,7 +278,7 @@ TRACE_EVENT(gfs2_glock_lock_time, ...@@ -278,7 +278,7 @@ TRACE_EVENT(gfs2_glock_lock_time,
), ),
TP_fast_assign( TP_fast_assign(
__entry->dev = gl->gl_sbd->sd_vfs->s_dev; __entry->dev = gl->gl_name.ln_sbd->sd_vfs->s_dev;
__entry->glnum = gl->gl_name.ln_number; __entry->glnum = gl->gl_name.ln_number;
__entry->gltype = gl->gl_name.ln_type; __entry->gltype = gl->gl_name.ln_type;
__entry->status = gl->gl_lksb.sb_status; __entry->status = gl->gl_lksb.sb_status;
...@@ -333,7 +333,7 @@ TRACE_EVENT(gfs2_pin, ...@@ -333,7 +333,7 @@ TRACE_EVENT(gfs2_pin,
), ),
TP_fast_assign( TP_fast_assign(
__entry->dev = bd->bd_gl->gl_sbd->sd_vfs->s_dev; __entry->dev = bd->bd_gl->gl_name.ln_sbd->sd_vfs->s_dev;
__entry->pin = pin; __entry->pin = pin;
__entry->len = bd->bd_bh->b_size; __entry->len = bd->bd_bh->b_size;
__entry->block = bd->bd_bh->b_blocknr; __entry->block = bd->bd_bh->b_blocknr;
...@@ -449,7 +449,7 @@ TRACE_EVENT(gfs2_bmap, ...@@ -449,7 +449,7 @@ TRACE_EVENT(gfs2_bmap,
), ),
TP_fast_assign( TP_fast_assign(
__entry->dev = ip->i_gl->gl_sbd->sd_vfs->s_dev; __entry->dev = ip->i_gl->gl_name.ln_sbd->sd_vfs->s_dev;
__entry->lblock = lblock; __entry->lblock = lblock;
__entry->pblock = buffer_mapped(bh) ? bh->b_blocknr : 0; __entry->pblock = buffer_mapped(bh) ? bh->b_blocknr : 0;
__entry->inum = ip->i_no_addr; __entry->inum = ip->i_no_addr;
...@@ -489,7 +489,7 @@ TRACE_EVENT(gfs2_block_alloc, ...@@ -489,7 +489,7 @@ TRACE_EVENT(gfs2_block_alloc,
), ),
TP_fast_assign( TP_fast_assign(
__entry->dev = rgd->rd_gl->gl_sbd->sd_vfs->s_dev; __entry->dev = rgd->rd_gl->gl_name.ln_sbd->sd_vfs->s_dev;
__entry->start = block; __entry->start = block;
__entry->inum = ip->i_no_addr; __entry->inum = ip->i_no_addr;
__entry->len = len; __entry->len = len;
......
...@@ -158,7 +158,7 @@ static struct gfs2_bufdata *gfs2_alloc_bufdata(struct gfs2_glock *gl, ...@@ -158,7 +158,7 @@ static struct gfs2_bufdata *gfs2_alloc_bufdata(struct gfs2_glock *gl,
void gfs2_trans_add_data(struct gfs2_glock *gl, struct buffer_head *bh) void gfs2_trans_add_data(struct gfs2_glock *gl, struct buffer_head *bh)
{ {
struct gfs2_trans *tr = current->journal_info; struct gfs2_trans *tr = current->journal_info;
struct gfs2_sbd *sdp = gl->gl_sbd; struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
struct address_space *mapping = bh->b_page->mapping; struct address_space *mapping = bh->b_page->mapping;
struct gfs2_inode *ip = GFS2_I(mapping->host); struct gfs2_inode *ip = GFS2_I(mapping->host);
struct gfs2_bufdata *bd; struct gfs2_bufdata *bd;
...@@ -224,7 +224,7 @@ static void meta_lo_add(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd) ...@@ -224,7 +224,7 @@ static void meta_lo_add(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd)
void gfs2_trans_add_meta(struct gfs2_glock *gl, struct buffer_head *bh) void gfs2_trans_add_meta(struct gfs2_glock *gl, struct buffer_head *bh)
{ {
struct gfs2_sbd *sdp = gl->gl_sbd; struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
struct gfs2_bufdata *bd; struct gfs2_bufdata *bd;
lock_buffer(bh); lock_buffer(bh);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册