📄 obd.h
字号:
};struct lov_obd { struct lov_desc desc; struct lov_tgt_desc **lov_tgts; struct semaphore lov_lock; struct obd_connect_data lov_ocd; struct lov_qos lov_qos; /* qos info per lov */ atomic_t lov_refcount; __u32 lov_tgt_count; /* how many OBD's */ __u32 lov_active_tgt_count; /* how many active */ __u32 lov_death_row;/* tgts scheduled to be deleted */ __u32 lov_tgt_size; /* size of tgts array */ __u32 lov_start_idx; /* start index of new inode */ __u32 lov_offset_idx; /* aliasing for start_idx */ int lov_start_count;/* reseed counter */ int lov_connects; obd_page_removal_cb_t lov_page_removal_cb; obd_pin_extent_cb lov_page_pin_cb; obd_lock_cancel_cb lov_lock_cancel_cb;};struct niobuf_local { __u64 offset; __u32 len; __u32 flags; cfs_page_t *page; cfs_dentry_t *dentry; int lnb_grant_used; int rc;};/* obd device type names */ /* FIXME all the references to LUSTRE_MDS_NAME should be swapped with LUSTRE_MDT_NAME */#define LUSTRE_MDS_NAME "mds"#define LUSTRE_MDT_NAME "mdt"#define LUSTRE_MDC_NAME "mdc"#define LUSTRE_OSS_NAME "ost" /*FIXME change name to oss*/#define LUSTRE_OST_NAME "obdfilter" /* FIXME change name to ost*/#define LUSTRE_OSC_NAME "osc"#define LUSTRE_LOV_NAME "lov"#define LUSTRE_MGS_NAME "mgs"#define LUSTRE_MGC_NAME "mgc"#define LUSTRE_CACHEOBD_NAME "cobd"#define LUSTRE_ECHO_NAME "obdecho"#define LUSTRE_ECHO_CLIENT_NAME "echo_client"/* Constant obd names (post-rename) */#define LUSTRE_MDS_OBDNAME "MDS"#define LUSTRE_OSS_OBDNAME "OSS"#define LUSTRE_MGS_OBDNAME "MGS"#define LUSTRE_MGC_OBDNAME "MGC"/* Don't conflict with on-wire flags OBD_BRW_WRITE, etc */#define N_LOCAL_TEMP_PAGE 0x10000000struct obd_trans_info { __u64 oti_transno; __u64 oti_xid; /* Only used on the server side for tracking acks. */ struct oti_req_ack_lock { struct lustre_handle lock; __u32 mode; } oti_ack_locks[4]; void *oti_handle; struct llog_cookie oti_onecookie; struct llog_cookie *oti_logcookies; int oti_numcookies; /* initial thread handling transaction */ int oti_thread_id; __u32 oti_conn_cnt; struct obd_uuid *oti_ost_uuid;};static inline void oti_init(struct obd_trans_info *oti, struct ptlrpc_request *req){ if (oti == NULL) return; memset(oti, 0, sizeof(*oti)); if (req == NULL) return; oti->oti_xid = req->rq_xid; if (req->rq_repmsg != NULL) oti->oti_transno = lustre_msg_get_transno(req->rq_repmsg); oti->oti_thread_id = req->rq_svc_thread ? req->rq_svc_thread->t_id : -1; if (req->rq_reqmsg != NULL) oti->oti_conn_cnt = lustre_msg_get_conn_cnt(req->rq_reqmsg);}static inline void oti_alloc_cookies(struct obd_trans_info *oti,int num_cookies){ if (!oti) return; if (num_cookies == 1) oti->oti_logcookies = &oti->oti_onecookie; else OBD_ALLOC(oti->oti_logcookies, num_cookies * sizeof(oti->oti_onecookie)); oti->oti_numcookies = num_cookies;}static inline void oti_free_cookies(struct obd_trans_info *oti){ if (!oti || !oti->oti_logcookies) return; if (oti->oti_logcookies == &oti->oti_onecookie) LASSERT(oti->oti_numcookies == 1); else OBD_FREE(oti->oti_logcookies, oti->oti_numcookies * sizeof(oti->oti_onecookie)); oti->oti_logcookies = NULL; oti->oti_numcookies = 0;}/* llog contexts */enum llog_ctxt_id { LLOG_CONFIG_ORIG_CTXT = 0, LLOG_CONFIG_REPL_CTXT = 1, LLOG_MDS_OST_ORIG_CTXT = 2, LLOG_MDS_OST_REPL_CTXT = 3, LLOG_SIZE_ORIG_CTXT = 4, LLOG_SIZE_REPL_CTXT = 5, LLOG_MD_ORIG_CTXT = 6, LLOG_MD_REPL_CTXT = 7, LLOG_RD1_ORIG_CTXT = 8, LLOG_RD1_REPL_CTXT = 9, LLOG_TEST_ORIG_CTXT = 10, LLOG_TEST_REPL_CTXT = 11, LLOG_LOVEA_ORIG_CTXT = 12, LLOG_LOVEA_REPL_CTXT = 13, LLOG_MAX_CTXTS};/* * Events signalled through obd_notify() upcall-chain. */enum obd_notify_event { /* Device activated */ OBD_NOTIFY_ACTIVE, /* Device deactivated */ OBD_NOTIFY_INACTIVE, /* Connect data for import were changed */ OBD_NOTIFY_OCD, /* Sync request */ OBD_NOTIFY_SYNC_NONBLOCK, OBD_NOTIFY_SYNC, /* Configuration event */ OBD_NOTIFY_CONFIG};#define CONFIG_LOG 0x1 /* finished processing config log */#define CONFIG_SYNC 0x2 /* mdt synced 1 ost *//* * Data structure used to pass obd_notify()-event to non-obd listeners (llite * and liblustre being main examples). */struct obd_notify_upcall { int (*onu_upcall)(struct obd_device *host, struct obd_device *watched, enum obd_notify_event ev, void *owner); /* Opaque datum supplied by upper layer listener */ void *onu_owner;};/* corresponds to one of the obd's */#define MAX_OBD_NAME 128#define OBD_DEVICE_MAGIC 0XAB5CD6EFstruct obd_device { struct obd_type *obd_type; __u32 obd_magic; /* common and UUID name of this device */ char obd_name[MAX_OBD_NAME]; struct obd_uuid obd_uuid; int obd_minor; unsigned long obd_attached:1, /* finished attach */ obd_set_up:1, /* finished setup */ obd_recovering:1, /* there are recoverable clients */ obd_abort_recovery:1,/* somebody ioctl'ed us to abort */ obd_replayable:1, /* recovery is enabled; inform clients */ obd_no_transno:1, /* no committed-transno notification */ obd_no_recov:1, /* fail instead of retry messages */ obd_stopping:1, /* started cleanup */ obd_starting:1, /* started setup */ obd_force:1, /* cleanup with > 0 obd refcount */ obd_fail:1, /* cleanup with failover */ obd_async_recov:1, /* allow asyncronous orphan cleanup */ obd_no_conn:1, /* deny new connections */ obd_inactive:1; /* device active/inactive * (for /proc/status only!!) */ /* uuid-export hash body */ struct lustre_class_hash_body *obd_uuid_hash_body; /* nid-export hash body */ struct lustre_class_hash_body *obd_nid_hash_body; /* nid stats body */ struct lustre_class_hash_body *obd_nid_stats_hash_body; struct list_head obd_nid_stats; atomic_t obd_refcount; cfs_waitq_t obd_refcount_waitq; cfs_waitq_t obd_llog_waitq; struct list_head obd_exports; int obd_num_exports; spinlock_t nid_lock; struct ldlm_namespace *obd_namespace; struct ptlrpc_client obd_ldlm_client; /* XXX OST/MDS only */ /* a spinlock is OK for what we do now, may need a semaphore later */ spinlock_t obd_dev_lock; struct semaphore obd_dev_sem; __u64 obd_last_committed; struct fsfilt_operations *obd_fsops; spinlock_t obd_osfs_lock; struct obd_statfs obd_osfs; /* locked by obd_osfs_lock */ __u64 obd_osfs_age; struct lvfs_run_ctxt obd_lvfs_ctxt; struct llog_ctxt *obd_llog_ctxt[LLOG_MAX_CTXTS]; struct obd_device *obd_observer; struct obd_notify_upcall obd_upcall; struct obd_export *obd_self_export; /* list of exports in LRU order, for ping evictor, with obd_dev_lock */ struct list_head obd_exports_timed; time_t obd_eviction_timer; /* for ping evictor */ /* XXX encapsulate all this recovery data into one struct */ svc_handler_t obd_recovery_handler; int obd_max_recoverable_clients; int obd_connected_clients; int obd_recoverable_clients; spinlock_t obd_processing_task_lock; /* BH lock (timer) */ pid_t obd_processing_task; __u64 obd_next_recovery_transno; int obd_replayed_requests; int obd_requests_queued_for_recovery; cfs_waitq_t obd_next_transno_waitq; struct list_head obd_uncommitted_replies; spinlock_t obd_uncommitted_replies_lock; cfs_timer_t obd_recovery_timer; struct list_head obd_recovery_queue; struct list_head obd_delayed_reply_queue; time_t obd_recovery_start; /* seconds */ time_t obd_recovery_end; /* seconds, for lprocfs_status */#ifdef CRAY_XT3 time_t obd_recovery_max_time; /* seconds, bz13079 */#endif int obd_recovery_timeout; union { struct obd_device_target obt; struct filter_obd filter; struct mds_obd mds; struct client_obd cli; struct ost_obd ost; struct echo_client_obd echo_client; struct echo_obd echo; struct lov_obd lov; struct mgs_obd mgs; } u; /* Fields used by LProcFS */ cfs_proc_dir_entry_t *obd_proc_entry; cfs_proc_dir_entry_t *obd_proc_exports_entry; cfs_proc_dir_entry_t *obd_svc_procroot; struct lprocfs_stats *obd_stats; struct lprocfs_stats *obd_svc_stats; unsigned int obd_cntr_base; atomic_t obd_evict_inprogress; cfs_waitq_t obd_evict_inprogress_waitq;};#define OBD_OPT_FORCE 0x0001#define OBD_OPT_FAILOVER 0x0002#define OBD_LLOG_FL_SENDNOW 0x0001enum obd_cleanup_stage {/* Special case hack for MDS LOVs */ OBD_CLEANUP_EARLY,/* Precleanup stage 1, we must make sure all exports (other than the self-export) get destroyed. */ OBD_CLEANUP_EXPORTS,/* Precleanup stage 2, do other type-specific cleanup requiring the self-export. */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -