diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2010-11-30 15:49:31 +0000 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2010-11-30 15:49:31 +0000 |
commit | 47a25380e37f44db7202093ca92e4af569c34f55 (patch) | |
tree | db3e6dba3859c5562b9a86f6d4059519fa7a1c52 /fs/gfs2/incore.h | |
parent | e06dfc492870e1d380f02722cde084b724dc197b (diff) | |
download | op-kernel-dev-47a25380e37f44db7202093ca92e4af569c34f55.zip op-kernel-dev-47a25380e37f44db7202093ca92e4af569c34f55.tar.gz |
GFS2: Merge glock state fields into a bitfield
We can only merge the fields into a bitfield if the locking
rules for them are the same. In this case gl_spin covers all
of the fields (write side) but a couple of them are used
with GLF_LOCK as the read side lock, which should be ok
since we know that the field in question won't be changing
at the time.
The gl_req setting has to be done earlier (in glock.c) in order
to place it under gl_spin. The gl_reply setting also has to be
brought under gl_spin in order to comply with the new rules.
This saves 4*sizeof(unsigned int) per glock.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Cc: Bob Peterson <rpeterso@redhat.com>
Diffstat (limited to 'fs/gfs2/incore.h')
-rw-r--r-- | fs/gfs2/incore.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h index 764fbb4..8d3d2b4 100644 --- a/fs/gfs2/incore.h +++ b/fs/gfs2/incore.h @@ -207,12 +207,14 @@ struct gfs2_glock { spinlock_t gl_spin; - unsigned int gl_state; - unsigned int gl_target; - unsigned int gl_reply; + /* State fields protected by gl_spin */ + unsigned int gl_state:2, /* Current state */ + gl_target:2, /* Target state */ + gl_demote_state:2, /* State requested by remote node */ + gl_req:2, /* State in last dlm request */ + gl_reply:8; /* Last reply from the dlm */ + unsigned int gl_hash; - unsigned int gl_req; - unsigned int gl_demote_state; /* state requested by remote node */ unsigned long gl_demote_time; /* time of first demote request */ struct list_head gl_holders; |