aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/glock.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-08-30 09:30:00 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2006-08-30 09:30:00 -0400
commit8fb4b536e7b9dbaf7a6b8204e887b92a14e4352c (patch)
treef74f905188ca9df0fc6f5fda3c6ee25ede02ee2f /fs/gfs2/glock.c
parent83b7a664a0c7c39ccfa4c72535dc1c001d4e7a18 (diff)
[GFS2] Make glock operations const
For all the usual reasons of enforcing correctness and potentially reducing code size, this patch makes the glock operations const. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/glock.c')
-rw-r--r--fs/gfs2/glock.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index ef713dbff601..709e6e0914fd 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -253,7 +253,7 @@ static struct gfs2_glock *gfs2_glock_find(struct gfs2_sbd *sdp,
253 */ 253 */
254 254
255int gfs2_glock_get(struct gfs2_sbd *sdp, uint64_t number, 255int gfs2_glock_get(struct gfs2_sbd *sdp, uint64_t number,
256 struct gfs2_glock_operations *glops, int create, 256 const struct gfs2_glock_operations *glops, int create,
257 struct gfs2_glock **glp) 257 struct gfs2_glock **glp)
258{ 258{
259 struct lm_lockname name; 259 struct lm_lockname name;
@@ -480,7 +480,7 @@ static int rq_promote(struct gfs2_holder *gh)
480{ 480{
481 struct gfs2_glock *gl = gh->gh_gl; 481 struct gfs2_glock *gl = gh->gh_gl;
482 struct gfs2_sbd *sdp = gl->gl_sbd; 482 struct gfs2_sbd *sdp = gl->gl_sbd;
483 struct gfs2_glock_operations *glops = gl->gl_ops; 483 const struct gfs2_glock_operations *glops = gl->gl_ops;
484 484
485 if (!relaxed_state_ok(gl->gl_state, gh->gh_state, gh->gh_flags)) { 485 if (!relaxed_state_ok(gl->gl_state, gh->gh_state, gh->gh_flags)) {
486 if (list_empty(&gl->gl_holders)) { 486 if (list_empty(&gl->gl_holders)) {
@@ -535,7 +535,7 @@ static int rq_promote(struct gfs2_holder *gh)
535static int rq_demote(struct gfs2_holder *gh) 535static int rq_demote(struct gfs2_holder *gh)
536{ 536{
537 struct gfs2_glock *gl = gh->gh_gl; 537 struct gfs2_glock *gl = gh->gh_gl;
538 struct gfs2_glock_operations *glops = gl->gl_ops; 538 const struct gfs2_glock_operations *glops = gl->gl_ops;
539 539
540 if (!list_empty(&gl->gl_holders)) 540 if (!list_empty(&gl->gl_holders))
541 return 1; 541 return 1;
@@ -805,7 +805,7 @@ static void state_change(struct gfs2_glock *gl, unsigned int new_state)
805static void xmote_bh(struct gfs2_glock *gl, unsigned int ret) 805static void xmote_bh(struct gfs2_glock *gl, unsigned int ret)
806{ 806{
807 struct gfs2_sbd *sdp = gl->gl_sbd; 807 struct gfs2_sbd *sdp = gl->gl_sbd;
808 struct gfs2_glock_operations *glops = gl->gl_ops; 808 const struct gfs2_glock_operations *glops = gl->gl_ops;
809 struct gfs2_holder *gh = gl->gl_req_gh; 809 struct gfs2_holder *gh = gl->gl_req_gh;
810 int prev_state = gl->gl_state; 810 int prev_state = gl->gl_state;
811 int op_done = 1; 811 int op_done = 1;
@@ -915,7 +915,7 @@ static void xmote_bh(struct gfs2_glock *gl, unsigned int ret)
915void gfs2_glock_xmote_th(struct gfs2_glock *gl, unsigned int state, int flags) 915void gfs2_glock_xmote_th(struct gfs2_glock *gl, unsigned int state, int flags)
916{ 916{
917 struct gfs2_sbd *sdp = gl->gl_sbd; 917 struct gfs2_sbd *sdp = gl->gl_sbd;
918 struct gfs2_glock_operations *glops = gl->gl_ops; 918 const struct gfs2_glock_operations *glops = gl->gl_ops;
919 int lck_flags = flags & (LM_FLAG_TRY | LM_FLAG_TRY_1CB | 919 int lck_flags = flags & (LM_FLAG_TRY | LM_FLAG_TRY_1CB |
920 LM_FLAG_NOEXP | LM_FLAG_ANY | 920 LM_FLAG_NOEXP | LM_FLAG_ANY |
921 LM_FLAG_PRIORITY); 921 LM_FLAG_PRIORITY);
@@ -960,7 +960,7 @@ void gfs2_glock_xmote_th(struct gfs2_glock *gl, unsigned int state, int flags)
960static void drop_bh(struct gfs2_glock *gl, unsigned int ret) 960static void drop_bh(struct gfs2_glock *gl, unsigned int ret)
961{ 961{
962 struct gfs2_sbd *sdp = gl->gl_sbd; 962 struct gfs2_sbd *sdp = gl->gl_sbd;
963 struct gfs2_glock_operations *glops = gl->gl_ops; 963 const struct gfs2_glock_operations *glops = gl->gl_ops;
964 struct gfs2_holder *gh = gl->gl_req_gh; 964 struct gfs2_holder *gh = gl->gl_req_gh;
965 965
966 clear_bit(GLF_PREFETCH, &gl->gl_flags); 966 clear_bit(GLF_PREFETCH, &gl->gl_flags);
@@ -1010,7 +1010,7 @@ static void drop_bh(struct gfs2_glock *gl, unsigned int ret)
1010void gfs2_glock_drop_th(struct gfs2_glock *gl) 1010void gfs2_glock_drop_th(struct gfs2_glock *gl)
1011{ 1011{
1012 struct gfs2_sbd *sdp = gl->gl_sbd; 1012 struct gfs2_sbd *sdp = gl->gl_sbd;
1013 struct gfs2_glock_operations *glops = gl->gl_ops; 1013 const struct gfs2_glock_operations *glops = gl->gl_ops;
1014 unsigned int ret; 1014 unsigned int ret;
1015 1015
1016 gfs2_assert_warn(sdp, test_bit(GLF_LOCK, &gl->gl_flags)); 1016 gfs2_assert_warn(sdp, test_bit(GLF_LOCK, &gl->gl_flags));
@@ -1081,7 +1081,7 @@ static int glock_wait_internal(struct gfs2_holder *gh)
1081{ 1081{
1082 struct gfs2_glock *gl = gh->gh_gl; 1082 struct gfs2_glock *gl = gh->gh_gl;
1083 struct gfs2_sbd *sdp = gl->gl_sbd; 1083 struct gfs2_sbd *sdp = gl->gl_sbd;
1084 struct gfs2_glock_operations *glops = gl->gl_ops; 1084 const struct gfs2_glock_operations *glops = gl->gl_ops;
1085 1085
1086 if (test_bit(HIF_ABORTED, &gh->gh_iflags)) 1086 if (test_bit(HIF_ABORTED, &gh->gh_iflags))
1087 return -EIO; 1087 return -EIO;
@@ -1294,7 +1294,7 @@ int gfs2_glock_wait(struct gfs2_holder *gh)
1294void gfs2_glock_dq(struct gfs2_holder *gh) 1294void gfs2_glock_dq(struct gfs2_holder *gh)
1295{ 1295{
1296 struct gfs2_glock *gl = gh->gh_gl; 1296 struct gfs2_glock *gl = gh->gh_gl;
1297 struct gfs2_glock_operations *glops = gl->gl_ops; 1297 const struct gfs2_glock_operations *glops = gl->gl_ops;
1298 1298
1299 if (gh->gh_flags & GL_SYNC) 1299 if (gh->gh_flags & GL_SYNC)
1300 set_bit(GLF_SYNC, &gl->gl_flags); 1300 set_bit(GLF_SYNC, &gl->gl_flags);
@@ -1339,7 +1339,7 @@ void gfs2_glock_dq(struct gfs2_holder *gh)
1339static void gfs2_glock_prefetch(struct gfs2_glock *gl, unsigned int state, 1339static void gfs2_glock_prefetch(struct gfs2_glock *gl, unsigned int state,
1340 int flags) 1340 int flags)
1341{ 1341{
1342 struct gfs2_glock_operations *glops = gl->gl_ops; 1342 const struct gfs2_glock_operations *glops = gl->gl_ops;
1343 1343
1344 spin_lock(&gl->gl_spin); 1344 spin_lock(&gl->gl_spin);
1345 1345
@@ -1365,7 +1365,7 @@ static void greedy_work(void *data)
1365 struct greedy *gr = data; 1365 struct greedy *gr = data;
1366 struct gfs2_holder *gh = &gr->gr_gh; 1366 struct gfs2_holder *gh = &gr->gr_gh;
1367 struct gfs2_glock *gl = gh->gh_gl; 1367 struct gfs2_glock *gl = gh->gh_gl;
1368 struct gfs2_glock_operations *glops = gl->gl_ops; 1368 const struct gfs2_glock_operations *glops = gl->gl_ops;
1369 1369
1370 clear_bit(GLF_SKIP_WAITERS2, &gl->gl_flags); 1370 clear_bit(GLF_SKIP_WAITERS2, &gl->gl_flags);
1371 1371
@@ -1447,8 +1447,8 @@ void gfs2_glock_dq_uninit(struct gfs2_holder *gh)
1447 */ 1447 */
1448 1448
1449int gfs2_glock_nq_num(struct gfs2_sbd *sdp, uint64_t number, 1449int gfs2_glock_nq_num(struct gfs2_sbd *sdp, uint64_t number,
1450 struct gfs2_glock_operations *glops, unsigned int state, 1450 const struct gfs2_glock_operations *glops,
1451 int flags, struct gfs2_holder *gh) 1451 unsigned int state, int flags, struct gfs2_holder *gh)
1452{ 1452{
1453 struct gfs2_glock *gl; 1453 struct gfs2_glock *gl;
1454 int error; 1454 int error;
@@ -1645,7 +1645,7 @@ void gfs2_glock_dq_uninit_m(unsigned int num_gh, struct gfs2_holder *ghs)
1645 */ 1645 */
1646 1646
1647void gfs2_glock_prefetch_num(struct gfs2_sbd *sdp, uint64_t number, 1647void gfs2_glock_prefetch_num(struct gfs2_sbd *sdp, uint64_t number,
1648 struct gfs2_glock_operations *glops, 1648 const struct gfs2_glock_operations *glops,
1649 unsigned int state, int flags) 1649 unsigned int state, int flags)
1650{ 1650{
1651 struct gfs2_glock *gl; 1651 struct gfs2_glock *gl;
@@ -1827,7 +1827,7 @@ void gfs2_iopen_go_callback(struct gfs2_glock *io_gl, unsigned int state)
1827static int demote_ok(struct gfs2_glock *gl) 1827static int demote_ok(struct gfs2_glock *gl)
1828{ 1828{
1829 struct gfs2_sbd *sdp = gl->gl_sbd; 1829 struct gfs2_sbd *sdp = gl->gl_sbd;
1830 struct gfs2_glock_operations *glops = gl->gl_ops; 1830 const struct gfs2_glock_operations *glops = gl->gl_ops;
1831 int demote = 1; 1831 int demote = 1;
1832 1832
1833 if (test_bit(GLF_STICKY, &gl->gl_flags)) 1833 if (test_bit(GLF_STICKY, &gl->gl_flags))