LU_TYPE_INIT_FINI(lod, &lod_thread_key);
-static struct lu_device_type_operations lod_device_type_ops = {
- .ldto_init = lod_type_init,
- .ldto_fini = lod_type_fini,
+static const struct lu_device_type_operations lod_device_type_ops = {
+ .ldto_init = lod_type_init,
+ .ldto_fini = lod_type_fini,
- .ldto_start = lod_type_start,
- .ldto_stop = lod_type_stop,
+ .ldto_start = lod_type_start,
+ .ldto_stop = lod_type_stop,
- .ldto_device_alloc = lod_device_alloc,
- .ldto_device_free = lod_device_free,
+ .ldto_device_alloc = lod_device_alloc,
+ .ldto_device_free = lod_device_free,
- .ldto_device_fini = lod_device_fini
+ .ldto_device_fini = lod_device_fini
};
static struct lu_device_type lod_device_type = {
void lod_procfs_fini(struct lod_device *lod);
/* lod_object.c */
-extern struct dt_object_operations lod_obj_ops;
-extern struct lu_object_operations lod_lu_obj_ops;
+extern const struct dt_object_operations lod_obj_ops;
+extern const struct lu_object_operations lod_lu_obj_ops;
int lod_load_lmv_shards(const struct lu_env *env, struct lod_object *lo,
struct lu_buf *buf, bool resize);
key_rec);
}
-static struct dt_index_operations lod_index_ops = {
+static const struct dt_index_operations lod_index_ops = {
.dio_lookup = lod_lookup,
.dio_declare_insert = lod_declare_insert,
.dio_insert = lod_insert,
return next->do_index_ops->dio_it.load(env, it->lit_it, hash);
}
-static struct dt_index_operations lod_striped_index_ops = {
+static const struct dt_index_operations lod_striped_index_ops = {
.dio_lookup = lod_striped_lookup,
.dio_declare_insert = lod_declare_insert,
.dio_insert = lod_insert,
RETURN(rc);
}
-struct dt_object_operations lod_obj_ops = {
+const struct dt_object_operations lod_obj_ops = {
.do_read_lock = lod_read_lock,
.do_write_lock = lod_write_lock,
.do_read_unlock = lod_read_unlock,
* body_ops themselves will check file type inside, see lod_read/write/punch for
* details.
*/
-const struct dt_body_operations lod_body_ops = {
+static const struct dt_body_operations lod_body_ops = {
.dbo_read = lod_read,
.dbo_declare_write = lod_declare_write,
.dbo_write = lod_write,
return (*p)(env, cookie, LUSTRE_LOD_NAME"-object@%p", o);
}
-struct lu_object_operations lod_lu_obj_ops = {
+const struct lu_object_operations lod_lu_obj_ops = {
.loo_object_init = lod_object_init,
.loo_object_free = lod_object_free,
.loo_object_release = lod_object_release,
.mdo_dtconf_get = mdd_dtconf_get,
};
-static struct lu_device_type_operations mdd_device_type_ops = {
- .ldto_init = mdd_type_init,
- .ldto_fini = mdd_type_fini,
+static const struct lu_device_type_operations mdd_device_type_ops = {
+ .ldto_init = mdd_type_init,
+ .ldto_fini = mdd_type_fini,
- .ldto_start = mdd_type_start,
- .ldto_stop = mdd_type_stop,
+ .ldto_start = mdd_type_start,
+ .ldto_stop = mdd_type_stop,
- .ldto_device_alloc = mdd_device_alloc,
- .ldto_device_free = mdd_device_free,
+ .ldto_device_alloc = mdd_device_alloc,
+ .ldto_device_free = mdd_device_free,
- .ldto_device_fini = mdd_device_fini
+ .ldto_device_fini = mdd_device_fini
};
static struct lu_device_type mdd_device_type = {
return mdt->mdt_opts.mo_cos != 0;
}
-static struct lu_device_type_operations mdt_device_type_ops = {
- .ldto_device_alloc = mdt_device_alloc,
- .ldto_device_free = mdt_device_free,
- .ldto_device_fini = mdt_device_fini
+static const struct lu_device_type_operations mdt_device_type_ops = {
+ .ldto_device_alloc = mdt_device_alloc,
+ .ldto_device_free = mdt_device_free,
+ .ldto_device_fini = mdt_device_fini
};
static struct lu_device_type mdt_device_type = {
/* type constructor/destructor: mdt_type_init, mdt_type_fini */
LU_TYPE_INIT_FINI(mds, &mdt_thread_key);
-static struct lu_device_type_operations mds_device_type_ops = {
+static const struct lu_device_type_operations mds_device_type_ops = {
.ldto_init = mds_type_init,
.ldto_fini = mds_type_fini,
return (*p)(env, cookie, LUSTRE_MGS_NAME"-object@%p", o);
}
-static struct lu_object_operations mgs_lu_obj_ops = {
+static const struct lu_object_operations mgs_lu_obj_ops = {
.loo_object_init = mgs_object_init,
.loo_object_free = mgs_object_free,
.loo_object_print = mgs_object_print,
LU_CONTEXT_KEY_DEFINE(mgs, LCT_MG_THREAD);
-static struct lu_device_type_operations mgs_device_type_ops = {
+static const struct lu_device_type_operations mgs_device_type_ops = {
.ldto_init = mgs_type_init,
.ldto_fini = mgs_type_fini,
kfree_rcu(obj, ls_header.loh_rcu);
}
-static struct lu_object_operations ls_lu_obj_ops = {
+static const struct lu_object_operations ls_lu_obj_ops = {
.loo_object_init = ls_object_init,
.loo_object_free = ls_object_free,
};
}
}
-static struct lu_device_operations ls_lu_dev_ops = {
+static const struct lu_device_operations ls_lu_dev_ops = {
.ldo_object_alloc = ls_object_alloc
};
return ls;
}
-static struct lu_device_type_operations ls_device_type_ops = {
+static const struct lu_device_type_operations ls_device_type_ops = {
.ldto_start = NULL,
.ldto_stop = NULL,
};
* this device is just serving incoming requests immediately
* without building a stack of lu_devices.
*/
-static struct lu_device_operations echo_srv_lu_ops = { 0 };
+static const struct lu_device_operations echo_srv_lu_ops = { 0 };
/**
* Initialize Echo Server device with parameters in the config log \a cfg.
RETURN(obj);
}
-static struct lu_device_operations echo_device_lu_ops = {
+static const struct lu_device_operations echo_device_lu_ops = {
.ldo_object_alloc = echo_object_alloc,
};
return (*p)(env, cookie, LUSTRE_OST_NAME"-object@%p", o);
}
-static struct lu_object_operations ofd_obj_ops = {
+static const struct lu_object_operations ofd_obj_ops = {
.loo_object_init = ofd_object_init,
.loo_object_free = ofd_object_free,
.loo_object_print = ofd_object_print
/**
* lu_device_operations matrix for OFD device.
*/
-static struct lu_device_operations ofd_lu_ops = {
+static const struct lu_device_operations ofd_lu_ops = {
.ldo_object_alloc = ofd_object_alloc,
.ldo_process_config = ofd_process_config,
.ldo_recovery_complete = ofd_recovery_complete,
/* type constructor/destructor: ofd_type_init(), ofd_type_fini() */
LU_TYPE_INIT_FINI(ofd, &ofd_thread_key);
-static struct lu_device_type_operations ofd_device_type_ops = {
+static const struct lu_device_type_operations ofd_device_type_ops = {
.ldto_init = ofd_type_init,
.ldto_fini = ofd_type_fini,
RETURN(0);
}
-static struct dt_device_operations osd_dt_ops = {
+static const struct dt_device_operations osd_dt_ops = {
.dt_root_get = osd_root_get,
.dt_statfs = osd_statfs,
.dt_trans_create = osd_trans_create,
return seq_client_alloc_fid(env, osd->od_cl_seq, fid);
}
-struct lu_device_operations osd_lu_ops = {
+const struct lu_device_operations osd_lu_ops = {
.ldo_object_alloc = osd_object_alloc,
.ldo_process_config = osd_process_config,
.ldo_recovery_complete = osd_recovery_complete,
{
}
-static struct lu_device_type_operations osd_device_type_ops = {
+static const struct lu_device_type_operations osd_device_type_ops = {
.ldto_init = osd_type_init,
.ldto_fini = osd_type_fini,
RETURN(rc);
}
-struct dt_index_operations osd_dir_ops = {
+const struct dt_index_operations osd_dir_ops = {
.dio_lookup = osd_dir_lookup,
.dio_declare_insert = osd_declare_dir_insert,
.dio_insert = osd_dir_insert,
RETURN(rc);
}
-static struct dt_index_operations osd_index_ops = {
+static const struct dt_index_operations osd_index_ops = {
.dio_lookup = osd_index_lookup,
.dio_declare_insert = osd_declare_index_insert,
.dio_insert = osd_index_insert,
#define zfs_refcount_add refcount_add
#endif
-extern struct dt_body_operations osd_body_scrub_ops;
-extern struct dt_body_operations osd_body_ops;
+extern const struct dt_body_operations osd_body_scrub_ops;
+extern const struct dt_body_operations osd_body_ops;
extern struct kmem_cache *osd_object_kmem;
/**
int osd_statfs(const struct lu_env *, struct dt_device *, struct obd_statfs *,
struct obd_statfs_info *);
extern const struct dt_index_operations osd_acct_index_ops;
-extern struct lu_device_operations osd_lu_ops;
-extern struct dt_index_operations osd_dir_ops;
+extern const struct lu_device_operations osd_lu_ops;
+extern const struct dt_index_operations osd_dir_ops;
int osd_declare_quota(const struct lu_env *env, struct osd_device *osd,
qid_t uid, qid_t gid, qid_t projid, long long space,
struct osd_thandle *oh,
RETURN(result);
}
-struct dt_body_operations osd_body_ops = {
+const struct dt_body_operations osd_body_ops = {
.dbo_read = osd_read,
.dbo_declare_write = osd_declare_write,
.dbo_write = osd_write,
.dbo_lseek = osd_lseek,
};
-struct dt_body_operations osd_body_scrub_ops = {
+const struct dt_body_operations osd_body_scrub_ops = {
.dbo_read = osd_read_no_record,
.dbo_declare_write = osd_declare_write,
.dbo_write = osd_write,
char *osd_obj_tag = "osd_object";
static int osd_object_sync_delay_us = -1;
-static struct dt_object_operations osd_obj_ops;
-static struct lu_object_operations osd_lu_obj_ops;
-static struct dt_object_operations osd_obj_otable_it_ops;
+static const struct dt_object_operations osd_obj_ops;
+static const struct lu_object_operations osd_lu_obj_ops;
+static const struct dt_object_operations osd_obj_otable_it_ops;
static void
osd_object_sa_fini(struct osd_object *obj)
return false;
}
-static struct dt_object_operations osd_obj_ops = {
+static const struct dt_object_operations osd_obj_ops = {
.do_read_lock = osd_read_lock,
.do_write_lock = osd_write_lock,
.do_read_unlock = osd_read_unlock,
.do_check_stale = osd_check_stale,
};
-static struct lu_object_operations osd_lu_obj_ops = {
+static const struct lu_object_operations osd_lu_obj_ops = {
.loo_object_init = osd_object_init,
.loo_object_delete = osd_object_delete,
.loo_object_release = osd_object_release,
return 0;
}
-static struct dt_object_operations osd_obj_otable_it_ops = {
+static const struct dt_object_operations osd_obj_otable_it_ops = {
.do_attr_get = osd_otable_it_attr_get,
.do_index_try = osd_index_try,
};
RETURN(NULL);
}
-static struct lu_device_type_operations lwp_device_type_ops = {
- .ldto_device_alloc = lwp_device_alloc,
- .ldto_device_free = lwp_device_free,
- .ldto_device_fini = lwp_device_fini
+static const struct lu_device_type_operations lwp_device_type_ops = {
+ .ldto_device_alloc = lwp_device_alloc,
+ .ldto_device_free = lwp_device_free,
+ .ldto_device_fini = lwp_device_fini
};
struct lu_device_type lwp_device_type = {
RETURN(rc);
}
-const struct dt_device_operations osp_dt_ops = {
+static const struct dt_device_operations osp_dt_ops = {
.dt_statfs = osp_statfs,
.dt_sync = osp_sync,
.dt_trans_create = osp_trans_create,
};
LU_TYPE_INIT_FINI(osp, &osp_thread_key, &osp_txn_key);
-static struct lu_device_type_operations osp_device_type_ops = {
+static const struct lu_device_type_operations osp_device_type_ops = {
.ldto_init = osp_type_init,
.ldto_fini = osp_type_fini,
struct rw_semaphore opo_invalidate_sem;
};
-extern struct lu_object_operations osp_lu_obj_ops;
-extern const struct dt_device_operations osp_dt_ops;
-extern struct dt_object_operations osp_md_obj_ops;
-extern struct dt_body_operations osp_md_body_ops;
+extern const struct lu_object_operations osp_lu_obj_ops;
+extern const struct dt_object_operations osp_md_obj_ops;
+extern const struct dt_body_operations osp_md_body_ops;
struct osp_thread_info {
struct lu_buf osi_lb;
RETURN(rc);
}
-struct dt_object_operations osp_md_obj_ops = {
+const struct dt_object_operations osp_md_obj_ops = {
.do_read_lock = osp_md_read_lock,
.do_write_lock = osp_md_write_lock,
.do_read_unlock = osp_md_read_unlock,
}
/* These body operation will be used to write symlinks during migration etc */
-struct dt_body_operations osp_md_body_ops = {
+const struct dt_body_operations osp_md_body_ops = {
.dbo_declare_write = osp_md_declare_write,
.dbo_write = osp_md_write,
.dbo_read = osp_md_read,
return 0;
}
-static struct dt_object_operations osp_obj_ops = {
+static const struct dt_object_operations osp_obj_ops = {
.do_declare_attr_get = osp_declare_attr_get,
.do_attr_get = osp_attr_get,
.do_declare_attr_set = osp_declare_attr_set,
LBUG();
}
-struct lu_object_operations osp_lu_obj_ops = {
+const struct lu_object_operations osp_lu_obj_ops = {
.loo_object_init = osp_object_init,
.loo_object_free = osp_object_free,
.loo_object_release = osp_object_release,
/*
* lu device type operations associated with the master target.
*/
-static struct lu_device_type_operations qmt_device_type_ops = {
+static const struct lu_device_type_operations qmt_device_type_ops = {
.ldto_init = qmt_type_init,
.ldto_fini = qmt_type_fini,