Commit a13b1f32 authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman
Browse files

staging: lustre: remove o_ prefix from function pointers



We mostly refer to these function pointers using macros that use macro
magic to add the "o_" prefix to the front.  It means that you can't use
cscope to find the caller.  Heck, you can't even grep for it.

I looked at preserving the "o_" prefix by removing the macro magic and
adding "o_" to all the call sites but then I realized that, really, the
prefix doesn't add any value.  Let's just remove it.

Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ab419903
Loading
Loading
Loading
Loading
+94 −94
Original line number Diff line number Diff line
@@ -963,123 +963,123 @@ struct md_enqueue_info {
};

struct obd_ops {
	struct module *o_owner;
	int (*o_iocontrol)(unsigned int cmd, struct obd_export *exp, int len,
	struct module *owner;
	int (*iocontrol)(unsigned int cmd, struct obd_export *exp, int len,
			 void *karg, void *uarg);
	int (*o_get_info)(const struct lu_env *env, struct obd_export *,
	int (*get_info)(const struct lu_env *env, struct obd_export *,
			__u32 keylen, void *key, __u32 *vallen, void *val,
			struct lov_stripe_md *lsm);
	int (*o_set_info_async)(const struct lu_env *, struct obd_export *,
	int (*set_info_async)(const struct lu_env *, struct obd_export *,
			      __u32 keylen, void *key,
			      __u32 vallen, void *val,
			      struct ptlrpc_request_set *set);
	int (*o_attach)(struct obd_device *dev, u32 len, void *data);
	int (*o_detach)(struct obd_device *dev);
	int (*o_setup)(struct obd_device *dev, struct lustre_cfg *cfg);
	int (*o_precleanup)(struct obd_device *dev,
	int (*attach)(struct obd_device *dev, u32 len, void *data);
	int (*detach)(struct obd_device *dev);
	int (*setup)(struct obd_device *dev, struct lustre_cfg *cfg);
	int (*precleanup)(struct obd_device *dev,
			  enum obd_cleanup_stage cleanup_stage);
	int (*o_cleanup)(struct obd_device *dev);
	int (*o_process_config)(struct obd_device *dev, u32 len, void *data);
	int (*o_postrecov)(struct obd_device *dev);
	int (*o_add_conn)(struct obd_import *imp, struct obd_uuid *uuid,
	int (*cleanup)(struct obd_device *dev);
	int (*process_config)(struct obd_device *dev, u32 len, void *data);
	int (*postrecov)(struct obd_device *dev);
	int (*add_conn)(struct obd_import *imp, struct obd_uuid *uuid,
			int priority);
	int (*o_del_conn)(struct obd_import *imp, struct obd_uuid *uuid);
	int (*del_conn)(struct obd_import *imp, struct obd_uuid *uuid);
	/* connect to the target device with given connection
	 * data. @ocd->ocd_connect_flags is modified to reflect flags actually
	 * granted by the target, which are guaranteed to be a subset of flags
	 * asked for. If @ocd == NULL, use default parameters. */
	int (*o_connect)(const struct lu_env *env,
	int (*connect)(const struct lu_env *env,
		       struct obd_export **exp, struct obd_device *src,
		       struct obd_uuid *cluuid, struct obd_connect_data *ocd,
		       void *localdata);
	int (*o_reconnect)(const struct lu_env *env,
	int (*reconnect)(const struct lu_env *env,
			 struct obd_export *exp, struct obd_device *src,
			 struct obd_uuid *cluuid,
			 struct obd_connect_data *ocd,
			 void *localdata);
	int (*o_disconnect)(struct obd_export *exp);
	int (*disconnect)(struct obd_export *exp);

	/* Initialize/finalize fids infrastructure. */
	int (*o_fid_init)(struct obd_device *obd,
	int (*fid_init)(struct obd_device *obd,
			struct obd_export *exp, enum lu_cli_type type);
	int (*o_fid_fini)(struct obd_device *obd);
	int (*fid_fini)(struct obd_device *obd);

	/* Allocate new fid according to passed @hint. */
	int (*o_fid_alloc)(struct obd_export *exp, struct lu_fid *fid,
	int (*fid_alloc)(struct obd_export *exp, struct lu_fid *fid,
			 struct md_op_data *op_data);

	/*
	 * Object with @fid is getting deleted, we may want to do something
	 * about this.
	 */
	int (*o_statfs)(const struct lu_env *, struct obd_export *exp,
	int (*statfs)(const struct lu_env *, struct obd_export *exp,
		      struct obd_statfs *osfs, __u64 max_age, __u32 flags);
	int (*o_statfs_async)(struct obd_export *exp, struct obd_info *oinfo,
	int (*statfs_async)(struct obd_export *exp, struct obd_info *oinfo,
			    __u64 max_age, struct ptlrpc_request_set *set);
	int (*o_packmd)(struct obd_export *exp, struct lov_mds_md **disk_tgt,
	int (*packmd)(struct obd_export *exp, struct lov_mds_md **disk_tgt,
		      struct lov_stripe_md *mem_src);
	int (*o_unpackmd)(struct obd_export *exp,
	int (*unpackmd)(struct obd_export *exp,
			struct lov_stripe_md **mem_tgt,
			struct lov_mds_md *disk_src, int disk_len);
	int (*o_preallocate)(struct lustre_handle *, u32 *req, u64 *ids);
	int (*o_create)(const struct lu_env *env, struct obd_export *exp,
	int (*preallocate)(struct lustre_handle *, u32 *req, u64 *ids);
	int (*create)(const struct lu_env *env, struct obd_export *exp,
		      struct obdo *oa, struct lov_stripe_md **ea,
		      struct obd_trans_info *oti);
	int (*o_destroy)(const struct lu_env *env, struct obd_export *exp,
	int (*destroy)(const struct lu_env *env, struct obd_export *exp,
		       struct obdo *oa, struct lov_stripe_md *ea,
		       struct obd_trans_info *oti, struct obd_export *md_exp);
	int (*o_setattr)(const struct lu_env *, struct obd_export *exp,
	int (*setattr)(const struct lu_env *, struct obd_export *exp,
		       struct obd_info *oinfo, struct obd_trans_info *oti);
	int (*o_setattr_async)(struct obd_export *exp, struct obd_info *oinfo,
	int (*setattr_async)(struct obd_export *exp, struct obd_info *oinfo,
			     struct obd_trans_info *oti,
			     struct ptlrpc_request_set *rqset);
	int (*o_getattr)(const struct lu_env *env, struct obd_export *exp,
	int (*getattr)(const struct lu_env *env, struct obd_export *exp,
		       struct obd_info *oinfo);
	int (*o_getattr_async)(struct obd_export *exp, struct obd_info *oinfo,
	int (*getattr_async)(struct obd_export *exp, struct obd_info *oinfo,
			     struct ptlrpc_request_set *set);
	int (*o_adjust_kms)(struct obd_export *exp, struct lov_stripe_md *lsm,
	int (*adjust_kms)(struct obd_export *exp, struct lov_stripe_md *lsm,
			  u64 size, int shrink);
	int (*o_preprw)(const struct lu_env *env, int cmd,
	int (*preprw)(const struct lu_env *env, int cmd,
		      struct obd_export *exp, struct obdo *oa, int objcount,
		      struct obd_ioobj *obj, struct niobuf_remote *remote,
		      int *nr_pages, struct niobuf_local *local,
		      struct obd_trans_info *oti);
	int (*o_commitrw)(const struct lu_env *env, int cmd,
	int (*commitrw)(const struct lu_env *env, int cmd,
			struct obd_export *exp, struct obdo *oa,
			int objcount, struct obd_ioobj *obj,
			struct niobuf_remote *remote, int pages,
			struct niobuf_local *local,
			struct obd_trans_info *oti, int rc);
	int (*o_find_cbdata)(struct obd_export *, struct lov_stripe_md *,
	int (*find_cbdata)(struct obd_export *, struct lov_stripe_md *,
			   ldlm_iterator_t it, void *data);
	int (*o_init_export)(struct obd_export *exp);
	int (*o_destroy_export)(struct obd_export *exp);
	int (*init_export)(struct obd_export *exp);
	int (*destroy_export)(struct obd_export *exp);

	/* metadata-only methods */
	int (*o_import_event)(struct obd_device *, struct obd_import *,
	int (*import_event)(struct obd_device *, struct obd_import *,
			    enum obd_import_event);

	int (*o_notify)(struct obd_device *obd, struct obd_device *watched,
	int (*notify)(struct obd_device *obd, struct obd_device *watched,
		      enum obd_notify_event ev, void *data);

	int (*o_health_check)(const struct lu_env *env, struct obd_device *);
	struct obd_uuid *(*o_get_uuid)(struct obd_export *exp);
	int (*health_check)(const struct lu_env *env, struct obd_device *);
	struct obd_uuid *(*get_uuid)(struct obd_export *exp);

	/* quota methods */
	int (*o_quotacheck)(struct obd_device *, struct obd_export *,
	int (*quotacheck)(struct obd_device *, struct obd_export *,
			  struct obd_quotactl *);
	int (*o_quotactl)(struct obd_device *, struct obd_export *,
	int (*quotactl)(struct obd_device *, struct obd_export *,
			struct obd_quotactl *);

	/* pools methods */
	int (*o_pool_new)(struct obd_device *obd, char *poolname);
	int (*o_pool_del)(struct obd_device *obd, char *poolname);
	int (*o_pool_add)(struct obd_device *obd, char *poolname,
	int (*pool_new)(struct obd_device *obd, char *poolname);
	int (*pool_del)(struct obd_device *obd, char *poolname);
	int (*pool_add)(struct obd_device *obd, char *poolname,
			char *ostname);
	int (*o_pool_rem)(struct obd_device *obd, char *poolname,
	int (*pool_rem)(struct obd_device *obd, char *poolname,
			char *ostname);
	void (*o_getref)(struct obd_device *obd);
	void (*o_putref)(struct obd_device *obd);
	void (*getref)(struct obd_device *obd);
	void (*putref)(struct obd_device *obd);
	/*
	 * NOTE: If adding ops, add another LPROCFS_OBD_OP_INIT() line
	 * to lprocfs_alloc_obd_stats() in obdclass/lprocfs_status.c.
+4 −4
Original line number Diff line number Diff line
@@ -270,7 +270,7 @@ void obdo_to_ioobj(struct obdo *oa, struct obd_ioobj *ioobj);
void md_from_obdo(struct md_op_data *op_data, struct obdo *oa, u32 valid);

#define OBT(dev)	(dev)->obd_type
#define OBP(dev, op)    (dev)->obd_type->typ_dt_ops->o_ ## op
#define OBP(dev, op)    (dev)->obd_type->typ_dt_ops->op
#define MDP(dev, op)    (dev)->obd_type->typ_md_ops->m_ ## op
#define CTXTP(ctxt, op) (ctxt)->loc_logops->lop_##op

@@ -301,9 +301,9 @@ static inline int obd_check_dev_active(struct obd_device *obd)
}

#define OBD_COUNTER_OFFSET(op)				  \
	((offsetof(struct obd_ops, o_ ## op) -		  \
	  offsetof(struct obd_ops, o_iocontrol))		\
	 / sizeof(((struct obd_ops *)(0))->o_iocontrol))
	((offsetof(struct obd_ops, op) -		  \
	  offsetof(struct obd_ops, iocontrol))		\
	 / sizeof(((struct obd_ops *)(0))->iocontrol))

#define OBD_COUNTER_INCREMENT(obdx, op)			   \
	if ((obdx)->obd_stats != NULL) {			  \
+17 −17
Original line number Diff line number Diff line
@@ -2744,23 +2744,23 @@ static int lmv_quotacheck(struct obd_device *unused, struct obd_export *exp,
}

static struct obd_ops lmv_obd_ops = {
	.o_owner		= THIS_MODULE,
	.o_setup		= lmv_setup,
	.o_cleanup	      = lmv_cleanup,
	.o_precleanup	   = lmv_precleanup,
	.o_process_config       = lmv_process_config,
	.o_connect	      = lmv_connect,
	.o_disconnect	   = lmv_disconnect,
	.o_statfs	       = lmv_statfs,
	.o_get_info	     = lmv_get_info,
	.o_set_info_async       = lmv_set_info_async,
	.o_packmd	       = lmv_packmd,
	.o_unpackmd	     = lmv_unpackmd,
	.o_notify	       = lmv_notify,
	.o_get_uuid	     = lmv_get_uuid,
	.o_iocontrol	    = lmv_iocontrol,
	.o_quotacheck	   = lmv_quotacheck,
	.o_quotactl	     = lmv_quotactl
	.owner		= THIS_MODULE,
	.setup		= lmv_setup,
	.cleanup	= lmv_cleanup,
	.precleanup	= lmv_precleanup,
	.process_config	= lmv_process_config,
	.connect	= lmv_connect,
	.disconnect	= lmv_disconnect,
	.statfs		= lmv_statfs,
	.get_info	= lmv_get_info,
	.set_info_async	= lmv_set_info_async,
	.packmd		= lmv_packmd,
	.unpackmd	= lmv_unpackmd,
	.notify		= lmv_notify,
	.get_uuid	= lmv_get_uuid,
	.iocontrol	= lmv_iocontrol,
	.quotacheck	= lmv_quotacheck,
	.quotactl	= lmv_quotactl
};

static struct md_ops lmv_md_ops = {
+29 −29
Original line number Diff line number Diff line
@@ -2277,35 +2277,35 @@ static int lov_quotacheck(struct obd_device *obd, struct obd_export *exp,
}

static struct obd_ops lov_obd_ops = {
	.o_owner	       = THIS_MODULE,
	.o_setup	       = lov_setup,
	.o_precleanup	  = lov_precleanup,
	.o_cleanup	     = lov_cleanup,
	/*.o_process_config      = lov_process_config,*/
	.o_connect	     = lov_connect,
	.o_disconnect	  = lov_disconnect,
	.o_statfs	      = lov_statfs,
	.o_statfs_async	= lov_statfs_async,
	.o_packmd	      = lov_packmd,
	.o_unpackmd	    = lov_unpackmd,
	.o_create	      = lov_create,
	.o_destroy	     = lov_destroy,
	.o_getattr_async       = lov_getattr_async,
	.o_setattr_async       = lov_setattr_async,
	.o_adjust_kms	  = lov_adjust_kms,
	.o_find_cbdata	 = lov_find_cbdata,
	.o_iocontrol	   = lov_iocontrol,
	.o_get_info	    = lov_get_info,
	.o_set_info_async      = lov_set_info_async,
	.o_notify	      = lov_notify,
	.o_pool_new	    = lov_pool_new,
	.o_pool_rem	    = lov_pool_remove,
	.o_pool_add	    = lov_pool_add,
	.o_pool_del	    = lov_pool_del,
	.o_getref	      = lov_getref,
	.o_putref	      = lov_putref,
	.o_quotactl	    = lov_quotactl,
	.o_quotacheck	  = lov_quotacheck,
	.owner          = THIS_MODULE,
	.setup          = lov_setup,
	.precleanup     = lov_precleanup,
	.cleanup        = lov_cleanup,
	/*.process_config       = lov_process_config,*/
	.connect        = lov_connect,
	.disconnect     = lov_disconnect,
	.statfs         = lov_statfs,
	.statfs_async   = lov_statfs_async,
	.packmd         = lov_packmd,
	.unpackmd       = lov_unpackmd,
	.create         = lov_create,
	.destroy        = lov_destroy,
	.getattr_async  = lov_getattr_async,
	.setattr_async  = lov_setattr_async,
	.adjust_kms     = lov_adjust_kms,
	.find_cbdata    = lov_find_cbdata,
	.iocontrol      = lov_iocontrol,
	.get_info       = lov_get_info,
	.set_info_async = lov_set_info_async,
	.notify         = lov_notify,
	.pool_new       = lov_pool_new,
	.pool_rem       = lov_pool_remove,
	.pool_add       = lov_pool_add,
	.pool_del       = lov_pool_del,
	.getref         = lov_getref,
	.putref         = lov_putref,
	.quotactl       = lov_quotactl,
	.quotacheck     = lov_quotacheck,
};

struct kmem_cache *lov_oinfo_slab;
+20 −20
Original line number Diff line number Diff line
@@ -2460,26 +2460,26 @@ static int mdc_get_remote_perm(struct obd_export *exp, const struct lu_fid *fid,
}

static struct obd_ops mdc_obd_ops = {
	.o_owner	    = THIS_MODULE,
	.o_setup	    = mdc_setup,
	.o_precleanup       = mdc_precleanup,
	.o_cleanup	  = mdc_cleanup,
	.o_add_conn	 = client_import_add_conn,
	.o_del_conn	 = client_import_del_conn,
	.o_connect          = client_connect_import,
	.o_disconnect       = client_disconnect_export,
	.o_iocontrol	= mdc_iocontrol,
	.o_set_info_async   = mdc_set_info_async,
	.o_statfs	   = mdc_statfs,
	.o_fid_init	    = client_fid_init,
	.o_fid_fini	    = client_fid_fini,
	.o_fid_alloc	= mdc_fid_alloc,
	.o_import_event     = mdc_import_event,
	.o_get_info	 = mdc_get_info,
	.o_process_config   = mdc_process_config,
	.o_get_uuid	 = mdc_get_uuid,
	.o_quotactl	 = mdc_quotactl,
	.o_quotacheck       = mdc_quotacheck
	.owner          = THIS_MODULE,
	.setup          = mdc_setup,
	.precleanup     = mdc_precleanup,
	.cleanup        = mdc_cleanup,
	.add_conn       = client_import_add_conn,
	.del_conn       = client_import_del_conn,
	.connect        = client_connect_import,
	.disconnect     = client_disconnect_export,
	.iocontrol      = mdc_iocontrol,
	.set_info_async = mdc_set_info_async,
	.statfs         = mdc_statfs,
	.fid_init       = client_fid_init,
	.fid_fini       = client_fid_fini,
	.fid_alloc      = mdc_fid_alloc,
	.import_event   = mdc_import_event,
	.get_info       = mdc_get_info,
	.process_config = mdc_process_config,
	.get_uuid       = mdc_get_uuid,
	.quotactl       = mdc_quotactl,
	.quotacheck     = mdc_quotacheck
};

static struct md_ops mdc_md_ops = {
Loading