*/
int gfs2_glock_get(struct gfs2_sbd *sdp, uint64_t number,
- struct gfs2_glock_operations *glops, int create,
+ const struct gfs2_glock_operations *glops, int create,
struct gfs2_glock **glp)
{
struct lm_lockname name;
{
struct gfs2_glock *gl = gh->gh_gl;
struct gfs2_sbd *sdp = gl->gl_sbd;
- struct gfs2_glock_operations *glops = gl->gl_ops;
+ const struct gfs2_glock_operations *glops = gl->gl_ops;
if (!relaxed_state_ok(gl->gl_state, gh->gh_state, gh->gh_flags)) {
if (list_empty(&gl->gl_holders)) {
static int rq_demote(struct gfs2_holder *gh)
{
struct gfs2_glock *gl = gh->gh_gl;
- struct gfs2_glock_operations *glops = gl->gl_ops;
+ const struct gfs2_glock_operations *glops = gl->gl_ops;
if (!list_empty(&gl->gl_holders))
return 1;
static void xmote_bh(struct gfs2_glock *gl, unsigned int ret)
{
struct gfs2_sbd *sdp = gl->gl_sbd;
- struct gfs2_glock_operations *glops = gl->gl_ops;
+ const struct gfs2_glock_operations *glops = gl->gl_ops;
struct gfs2_holder *gh = gl->gl_req_gh;
int prev_state = gl->gl_state;
int op_done = 1;
void gfs2_glock_xmote_th(struct gfs2_glock *gl, unsigned int state, int flags)
{
struct gfs2_sbd *sdp = gl->gl_sbd;
- struct gfs2_glock_operations *glops = gl->gl_ops;
+ const struct gfs2_glock_operations *glops = gl->gl_ops;
int lck_flags = flags & (LM_FLAG_TRY | LM_FLAG_TRY_1CB |
LM_FLAG_NOEXP | LM_FLAG_ANY |
LM_FLAG_PRIORITY);
static void drop_bh(struct gfs2_glock *gl, unsigned int ret)
{
struct gfs2_sbd *sdp = gl->gl_sbd;
- struct gfs2_glock_operations *glops = gl->gl_ops;
+ const struct gfs2_glock_operations *glops = gl->gl_ops;
struct gfs2_holder *gh = gl->gl_req_gh;
clear_bit(GLF_PREFETCH, &gl->gl_flags);
void gfs2_glock_drop_th(struct gfs2_glock *gl)
{
struct gfs2_sbd *sdp = gl->gl_sbd;
- struct gfs2_glock_operations *glops = gl->gl_ops;
+ const struct gfs2_glock_operations *glops = gl->gl_ops;
unsigned int ret;
gfs2_assert_warn(sdp, test_bit(GLF_LOCK, &gl->gl_flags));
{
struct gfs2_glock *gl = gh->gh_gl;
struct gfs2_sbd *sdp = gl->gl_sbd;
- struct gfs2_glock_operations *glops = gl->gl_ops;
+ const struct gfs2_glock_operations *glops = gl->gl_ops;
if (test_bit(HIF_ABORTED, &gh->gh_iflags))
return -EIO;
void gfs2_glock_dq(struct gfs2_holder *gh)
{
struct gfs2_glock *gl = gh->gh_gl;
- struct gfs2_glock_operations *glops = gl->gl_ops;
+ const struct gfs2_glock_operations *glops = gl->gl_ops;
if (gh->gh_flags & GL_SYNC)
set_bit(GLF_SYNC, &gl->gl_flags);
static void gfs2_glock_prefetch(struct gfs2_glock *gl, unsigned int state,
int flags)
{
- struct gfs2_glock_operations *glops = gl->gl_ops;
+ const struct gfs2_glock_operations *glops = gl->gl_ops;
spin_lock(&gl->gl_spin);
struct greedy *gr = data;
struct gfs2_holder *gh = &gr->gr_gh;
struct gfs2_glock *gl = gh->gh_gl;
- struct gfs2_glock_operations *glops = gl->gl_ops;
+ const struct gfs2_glock_operations *glops = gl->gl_ops;
clear_bit(GLF_SKIP_WAITERS2, &gl->gl_flags);
*/
int gfs2_glock_nq_num(struct gfs2_sbd *sdp, uint64_t number,
- struct gfs2_glock_operations *glops, unsigned int state,
- int flags, struct gfs2_holder *gh)
+ const struct gfs2_glock_operations *glops,
+ unsigned int state, int flags, struct gfs2_holder *gh)
{
struct gfs2_glock *gl;
int error;
*/
void gfs2_glock_prefetch_num(struct gfs2_sbd *sdp, uint64_t number,
- struct gfs2_glock_operations *glops,
+ const struct gfs2_glock_operations *glops,
unsigned int state, int flags)
{
struct gfs2_glock *gl;
static int demote_ok(struct gfs2_glock *gl)
{
struct gfs2_sbd *sdp = gl->gl_sbd;
- struct gfs2_glock_operations *glops = gl->gl_ops;
+ const struct gfs2_glock_operations *glops = gl->gl_ops;
int demote = 1;
if (test_bit(GLF_STICKY, &gl->gl_flags))
}
int gfs2_glock_get(struct gfs2_sbd *sdp,
- uint64_t number, struct gfs2_glock_operations *glops,
+ uint64_t number, const struct gfs2_glock_operations *glops,
int create, struct gfs2_glock **glp);
void gfs2_glock_hold(struct gfs2_glock *gl);
int gfs2_glock_put(struct gfs2_glock *gl);
void gfs2_glock_dq_uninit(struct gfs2_holder *gh);
int gfs2_glock_nq_num(struct gfs2_sbd *sdp,
- uint64_t number, struct gfs2_glock_operations *glops,
+ uint64_t number, const struct gfs2_glock_operations *glops,
unsigned int state, int flags, struct gfs2_holder *gh);
int gfs2_glock_nq_m(unsigned int num_gh, struct gfs2_holder *ghs);
void gfs2_glock_dq_uninit_m(unsigned int num_gh, struct gfs2_holder *ghs);
void gfs2_glock_prefetch_num(struct gfs2_sbd *sdp, uint64_t number,
- struct gfs2_glock_operations *glops,
+ const struct gfs2_glock_operations *glops,
unsigned int state, int flags);
void gfs2_glock_inode_squish(struct inode *inode);
return !atomic_read(&gl->gl_lvb_count);
}
-struct gfs2_glock_operations gfs2_meta_glops = {
+const struct gfs2_glock_operations gfs2_meta_glops = {
.go_xmote_th = gfs2_glock_xmote_th,
.go_drop_th = gfs2_glock_drop_th,
.go_type = LM_TYPE_META
};
-struct gfs2_glock_operations gfs2_inode_glops = {
+const struct gfs2_glock_operations gfs2_inode_glops = {
.go_xmote_th = inode_go_xmote_th,
.go_xmote_bh = inode_go_xmote_bh,
.go_drop_th = inode_go_drop_th,
.go_type = LM_TYPE_INODE
};
-struct gfs2_glock_operations gfs2_rgrp_glops = {
+const struct gfs2_glock_operations gfs2_rgrp_glops = {
.go_xmote_th = gfs2_glock_xmote_th,
.go_drop_th = gfs2_glock_drop_th,
.go_sync = meta_go_sync,
.go_type = LM_TYPE_RGRP
};
-struct gfs2_glock_operations gfs2_trans_glops = {
+const struct gfs2_glock_operations gfs2_trans_glops = {
.go_xmote_th = trans_go_xmote_th,
.go_xmote_bh = trans_go_xmote_bh,
.go_drop_th = trans_go_drop_th,
.go_type = LM_TYPE_NONDISK
};
-struct gfs2_glock_operations gfs2_iopen_glops = {
+const struct gfs2_glock_operations gfs2_iopen_glops = {
.go_xmote_th = gfs2_glock_xmote_th,
.go_drop_th = gfs2_glock_drop_th,
.go_callback = gfs2_iopen_go_callback,
.go_type = LM_TYPE_IOPEN
};
-struct gfs2_glock_operations gfs2_flock_glops = {
+const struct gfs2_glock_operations gfs2_flock_glops = {
.go_xmote_th = gfs2_glock_xmote_th,
.go_drop_th = gfs2_glock_drop_th,
.go_type = LM_TYPE_FLOCK
};
-struct gfs2_glock_operations gfs2_nondisk_glops = {
+const struct gfs2_glock_operations gfs2_nondisk_glops = {
.go_xmote_th = gfs2_glock_xmote_th,
.go_drop_th = gfs2_glock_drop_th,
.go_type = LM_TYPE_NONDISK
};
-struct gfs2_glock_operations gfs2_quota_glops = {
+const struct gfs2_glock_operations gfs2_quota_glops = {
.go_xmote_th = gfs2_glock_xmote_th,
.go_drop_th = gfs2_glock_drop_th,
.go_demote_ok = quota_go_demote_ok,
.go_type = LM_TYPE_QUOTA
};
-struct gfs2_glock_operations gfs2_journal_glops = {
+const struct gfs2_glock_operations gfs2_journal_glops = {
.go_xmote_th = gfs2_glock_xmote_th,
.go_drop_th = gfs2_glock_drop_th,
.go_type = LM_TYPE_JOURNAL
#ifndef __GLOPS_DOT_H__
#define __GLOPS_DOT_H__
-extern struct gfs2_glock_operations gfs2_meta_glops;
-extern struct gfs2_glock_operations gfs2_inode_glops;
-extern struct gfs2_glock_operations gfs2_rgrp_glops;
-extern struct gfs2_glock_operations gfs2_trans_glops;
-extern struct gfs2_glock_operations gfs2_iopen_glops;
-extern struct gfs2_glock_operations gfs2_flock_glops;
-extern struct gfs2_glock_operations gfs2_nondisk_glops;
-extern struct gfs2_glock_operations gfs2_quota_glops;
-extern struct gfs2_glock_operations gfs2_journal_glops;
+extern const struct gfs2_glock_operations gfs2_meta_glops;
+extern const struct gfs2_glock_operations gfs2_inode_glops;
+extern const struct gfs2_glock_operations gfs2_rgrp_glops;
+extern const struct gfs2_glock_operations gfs2_trans_glops;
+extern const struct gfs2_glock_operations gfs2_iopen_glops;
+extern const struct gfs2_glock_operations gfs2_flock_glops;
+extern const struct gfs2_glock_operations gfs2_nondisk_glops;
+extern const struct gfs2_glock_operations gfs2_quota_glops;
+extern const struct gfs2_glock_operations gfs2_journal_glops;
#endif /* __GLOPS_DOT_H__ */
void (*go_unlock) (struct gfs2_holder * gh);
void (*go_callback) (struct gfs2_glock * gl, unsigned int state);
void (*go_greedy) (struct gfs2_glock * gl);
- int go_type;
+ const int go_type;
};
enum {
struct list_head gl_waiters2; /* HIF_DEMOTE, HIF_GREEDY */
struct list_head gl_waiters3; /* HIF_PROMOTE */
- struct gfs2_glock_operations *gl_ops;
+ const struct gfs2_glock_operations *gl_ops;
struct gfs2_holder *gl_req_gh;
gfs2_glop_bh_t gl_req_bh;