📄 obd_class.h
字号:
rc = OBP(exp->exp_obd, iocontrol)(cmd, exp, len, karg, uarg); RETURN(rc);}static inline int obd_enqueue_rqset(struct obd_export *exp, struct obd_info *oinfo, struct ldlm_enqueue_info *einfo){ struct ptlrpc_request_set *set = NULL; int rc; ENTRY; EXP_CHECK_OP(exp, enqueue); EXP_COUNTER_INCREMENT(exp, enqueue); set = ptlrpc_prep_set(); if (set == NULL) RETURN(-ENOMEM); rc = OBP(exp->exp_obd, enqueue)(exp, oinfo, einfo, set); if (rc == 0) rc = ptlrpc_set_wait(set); ptlrpc_set_destroy(set); RETURN(rc);}static inline int obd_enqueue(struct obd_export *exp, struct obd_info *oinfo, struct ldlm_enqueue_info *einfo, struct ptlrpc_request_set *set){ int rc; ENTRY; EXP_CHECK_OP(exp, enqueue); EXP_COUNTER_INCREMENT(exp, enqueue); rc = OBP(exp->exp_obd, enqueue)(exp, oinfo, einfo, set); RETURN(rc);}static inline int obd_match(struct obd_export *exp, struct lov_stripe_md *ea, __u32 type, ldlm_policy_data_t *policy, __u32 mode, int *flags, void *data, struct lustre_handle *lockh){ int rc; ENTRY; EXP_CHECK_OP(exp, match); EXP_COUNTER_INCREMENT(exp, match); rc = OBP(exp->exp_obd, match)(exp, ea, type, policy, mode, flags, data, lockh); RETURN(rc);}static inline int obd_change_cbdata(struct obd_export *exp, struct lov_stripe_md *lsm, ldlm_iterator_t it, void *data){ int rc; ENTRY; EXP_CHECK_OP(exp, change_cbdata); EXP_COUNTER_INCREMENT(exp, change_cbdata); rc = OBP(exp->exp_obd, change_cbdata)(exp, lsm, it, data); RETURN(rc);}static inline int obd_cancel(struct obd_export *exp, struct lov_stripe_md *ea, __u32 mode, struct lustre_handle *lockh){ int rc; ENTRY; EXP_CHECK_OP(exp, cancel); EXP_COUNTER_INCREMENT(exp, cancel); rc = OBP(exp->exp_obd, cancel)(exp, ea, mode, lockh); RETURN(rc);}static inline int obd_cancel_unused(struct obd_export *exp, struct lov_stripe_md *ea, int flags, void *opaque){ int rc; ENTRY; EXP_CHECK_OP(exp, cancel_unused); EXP_COUNTER_INCREMENT(exp, cancel_unused); rc = OBP(exp->exp_obd, cancel_unused)(exp, ea, flags, opaque); RETURN(rc);}static inline int obd_join_lru(struct obd_export *exp, struct lov_stripe_md *ea, int join){ int rc; ENTRY; EXP_CHECK_OP(exp, join_lru); EXP_COUNTER_INCREMENT(exp, join_lru); rc = OBP(exp->exp_obd, join_lru)(exp, ea, join); RETURN(rc);}static inline int obd_pin(struct obd_export *exp, obd_id ino, __u32 gen, int type, struct obd_client_handle *handle, int flag){ int rc; ENTRY; EXP_CHECK_OP(exp, pin); EXP_COUNTER_INCREMENT(exp, pin); rc = OBP(exp->exp_obd, pin)(exp, ino, gen, type, handle, flag); RETURN(rc);}static inline int obd_unpin(struct obd_export *exp, struct obd_client_handle *handle, int flag){ int rc; ENTRY; EXP_CHECK_OP(exp, unpin); EXP_COUNTER_INCREMENT(exp, unpin); rc = OBP(exp->exp_obd, unpin)(exp, handle, flag); RETURN(rc);}static inline void obd_import_event(struct obd_device *obd, struct obd_import *imp, enum obd_import_event event){ ENTRY; if (!obd) { CERROR("NULL device\n"); EXIT; return; } if (obd->obd_set_up && OBP(obd, import_event)) { OBD_COUNTER_INCREMENT(obd, import_event); OBP(obd, import_event)(obd, imp, event); } EXIT;}static inline int obd_notify(struct obd_device *obd, struct obd_device *watched, enum obd_notify_event ev, void *data){ ENTRY; OBD_CHECK_DEV(obd); /* the check for async_recov is a complete hack - I'm hereby overloading the meaning to also mean "this was called from mds_postsetup". I know that my mds is able to handle notifies by this point, and it needs to get them to execute mds_postrecov. */ if (!obd->obd_set_up && !obd->obd_async_recov) { CDEBUG(D_HA, "obd %s not set up\n", obd->obd_name); RETURN(-EINVAL); } if (!OBP(obd, notify)) RETURN(-ENOSYS); OBD_COUNTER_INCREMENT(obd, notify); RETURN(OBP(obd, notify)(obd, watched, ev, data));}static inline int obd_notify_observer(struct obd_device *observer, struct obd_device *observed, enum obd_notify_event ev, void *data){ int rc1; int rc2; struct obd_notify_upcall *onu; if (observer->obd_observer) rc1 = obd_notify(observer->obd_observer, observed, ev, data); else rc1 = 0; /* * Also, call non-obd listener, if any */ onu = &observer->obd_upcall; if (onu->onu_upcall != NULL) rc2 = onu->onu_upcall(observer, observed, ev, onu->onu_owner); else rc2 = 0; return rc1 ?: rc2; }static inline int obd_quotacheck(struct obd_export *exp, struct obd_quotactl *oqctl){ int rc; ENTRY; EXP_CHECK_OP(exp, quotacheck); EXP_COUNTER_INCREMENT(exp, quotacheck); rc = OBP(exp->exp_obd, quotacheck)(exp, oqctl); RETURN(rc);}static inline int obd_quotactl(struct obd_export *exp, struct obd_quotactl *oqctl){ int rc; ENTRY; EXP_CHECK_OP(exp, quotactl); EXP_COUNTER_INCREMENT(exp, quotactl); rc = OBP(exp->exp_obd, quotactl)(exp, oqctl); RETURN(rc);}static inline int obd_quota_adjust_qunit(struct obd_export *exp, struct quota_adjust_qunit *oqaq){ int rc; ENTRY; EXP_CHECK_OP(exp, quota_adjust_qunit); EXP_COUNTER_INCREMENT(exp, quota_adjust_qunit); rc = OBP(exp->exp_obd, quota_adjust_qunit)(exp, oqaq); RETURN(rc);}static inline int obd_health_check(struct obd_device *obd){ /* returns: 0 on healthy * >0 on unhealthy + reason code/flag * however the only suppored reason == 1 right now * We'll need to define some better reasons * or flags in the future. * <0 on error */ int rc; ENTRY; /* don't use EXP_CHECK_OP, because NULL method is normal here */ if (obd == NULL || !OBT(obd)) { CERROR("cleaned up obd\n"); RETURN(-EOPNOTSUPP); } if (!obd->obd_set_up || obd->obd_stopping) RETURN(0); if (!OBP(obd, health_check)) RETURN(0); rc = OBP(obd, health_check)(obd); RETURN(rc);}static inline int obd_register_observer(struct obd_device *obd, struct obd_device *observer){ ENTRY; OBD_CHECK_DEV(obd); if (obd->obd_observer && observer) RETURN(-EALREADY); obd->obd_observer = observer; RETURN(0);}static inline int obd_register_page_removal_cb(struct obd_export *exp, obd_page_removal_cb_t cb, obd_pin_extent_cb pin_cb){ int rc; ENTRY; OBD_CHECK_OP(exp->exp_obd, register_page_removal_cb, 0); OBD_COUNTER_INCREMENT(exp->exp_obd, register_page_removal_cb); rc = OBP(exp->exp_obd, register_page_removal_cb)(exp, cb, pin_cb); RETURN(rc);}static inline int obd_unregister_page_removal_cb(struct obd_export *exp, obd_page_removal_cb_t cb){ int rc; ENTRY; OBD_CHECK_OP(exp->exp_obd, unregister_page_removal_cb, 0); OBD_COUNTER_INCREMENT(exp->exp_obd, unregister_page_removal_cb); rc = OBP(exp->exp_obd, unregister_page_removal_cb)(exp, cb); RETURN(rc);}static inline int obd_register_lock_cancel_cb(struct obd_export *exp, obd_lock_cancel_cb cb){ int rc; ENTRY; OBD_CHECK_OP(exp->exp_obd, register_lock_cancel_cb, 0); OBD_COUNTER_INCREMENT(exp->exp_obd, register_lock_cancel_cb); rc = OBP(exp->exp_obd, register_lock_cancel_cb)(exp, cb); RETURN(rc);}static inline int obd_unregister_lock_cancel_cb(struct obd_export *exp, obd_lock_cancel_cb cb){ int rc; ENTRY; OBD_CHECK_OP(exp->exp_obd, unregister_lock_cancel_cb, 0); OBD_COUNTER_INCREMENT(exp->exp_obd, unregister_lock_cancel_cb); rc = OBP(exp->exp_obd, unregister_lock_cancel_cb)(exp, cb); RETURN(rc);}/* OBD Metadata Support */extern int obd_init_caches(void);extern void obd_cleanup_caches(void);/* support routines */extern cfs_mem_cache_t *obdo_cachep;#define OBDO_ALLOC(ptr) \do { \ OBD_SLAB_ALLOC_PTR((ptr), obdo_cachep); \} while(0)#define OBDO_FREE(ptr) \do { \ OBD_SLAB_FREE_PTR((ptr), obdo_cachep); \} while(0)/* I'm as embarrassed about this as you are. * * <shaver> // XXX do not look into _superhack with remaining eye * <shaver> // XXX if this were any uglier, I'd get my own show on MTV */extern int (*ptlrpc_put_connection_superhack)(struct ptlrpc_connection *c);/* sysctl.c */extern void obd_sysctl_init (void);extern void obd_sysctl_clean (void);/* uuid.c */typedef __u8 class_uuid_t[16];void class_uuid_unparse(class_uuid_t in, struct obd_uuid *out);/* lustre_peer.c */int lustre_uuid_to_peer(char *uuid, lnet_nid_t *peer_nid, int index);int class_add_uuid(char *uuid, __u64 nid);int class_del_uuid (char *uuid);void class_init_uuidlist(void);void class_exit_uuidlist(void);/* prng.c */void ll_generate_random_uuid(class_uuid_t uuid_out);#endif /* __LINUX_OBD_CLASS_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -