📄 obd.h
字号:
struct lustre_handle fo_mdc_conn; struct file **fo_last_objid_files; __u64 *fo_last_objids; /* last created objid for groups, * protected by fo_objidlock */ struct semaphore fo_alloc_lock; atomic_t fo_r_in_flight; atomic_t fo_w_in_flight; /* * per-filter pool of kiobuf's allocated by filter_common_setup() and * torn down by filter_cleanup(). Contains OST_NUM_THREADS elements of * which ->fo_iobuf_count were allocated. * * This pool contains kiobuf used by * filter_{prep,commit}rw_{read,write}() and is shared by all OST * threads. * * Locking: none, each OST thread uses only one element, determined by * its "ordinal number", ->t_id. */ struct filter_iobuf **fo_iobuf_pool; int fo_iobuf_count; struct brw_stats fo_filter_stats; struct lustre_quota_ctxt fo_quota_ctxt; spinlock_t fo_quotacheck_lock; atomic_t fo_quotachecking; int fo_fmd_max_num; /* per exp filter_mod_data */ int fo_fmd_max_age; /* jiffies to fmd expiry */ void *fo_lcm;};#define OSC_MAX_RIF_DEFAULT 8#define OSC_MAX_RIF_MAX 256#define OSC_MAX_DIRTY_DEFAULT (OSC_MAX_RIF_DEFAULT * 4)#define OSC_MAX_DIRTY_MB_MAX 2048 /* arbitrary, but < MAX_LONG bytes */#define OSC_DEFAULT_RESENDS 10#define MDC_MAX_RIF_DEFAULT 8#define MDC_MAX_RIF_MAX 512struct mdc_rpc_lock;struct obd_import;struct lustre_cache;struct client_obd { struct semaphore cl_sem; struct obd_uuid cl_target_uuid; struct obd_import *cl_import; /* ptlrpc connection state */ int cl_conn_count; /* max_mds_easize is purely a performance thing so we don't have to * call obd_size_diskmd() all the time. */ int cl_default_mds_easize; int cl_max_mds_easize; int cl_max_mds_cookiesize; //struct llog_canceld_ctxt *cl_llcd; /* it's included by obd_llog_ctxt */ void *cl_llcd_offset; /* the grant values are protected by loi_list_lock below */ long cl_dirty; /* all _dirty_ in bytes */ long cl_dirty_max; /* allowed w/o rpc */ long cl_avail_grant; /* bytes of credit for ost */ long cl_lost_grant; /* lost credits (trunc) */ struct list_head cl_cache_waiters; /* waiting for cache/grant */ /* keep track of objects that have lois that contain pages which * have been queued for async brw. this lock also protects the * lists of osc_client_pages that hang off of the loi */ /* * ->cl_loi_list_lock protects consistency of * ->cl_loi_{ready,read,write}_list. ->ap_make_ready() and * ->ap_completion() call-backs are executed under this lock. As we * cannot guarantee that these call-backs never block on all platforms * (as a matter of fact they do block on Mac OS X), type of * ->cl_loi_list_lock is platform dependent: it's a spin-lock on Linux * and blocking mutex on Mac OS X. (Alternative is to make this lock * blocking everywhere, but we don't want to slow down fast-path of * our main platform.) * * Exact type of ->cl_loi_list_lock is defined in arch/obd.h together * with client_obd_list_{un,}lock() and * client_obd_list_lock_{init,done}() functions. */ client_obd_lock_t cl_loi_list_lock; struct list_head cl_loi_ready_list; struct list_head cl_loi_write_list; struct list_head cl_loi_read_list; int cl_r_in_flight; int cl_w_in_flight; /* just a sum of the loi/lop pending numbers to be exported by /proc */ int cl_pending_w_pages; int cl_pending_r_pages; int cl_max_pages_per_rpc; int cl_max_rpcs_in_flight; struct obd_histogram cl_read_rpc_hist; struct obd_histogram cl_write_rpc_hist; struct obd_histogram cl_read_page_hist; struct obd_histogram cl_write_page_hist; struct obd_histogram cl_read_offset_hist; struct obd_histogram cl_write_offset_hist; /* number of in flight destroy rpcs is limited to max_rpcs_in_flight */ atomic_t cl_destroy_in_flight; cfs_waitq_t cl_destroy_waitq; struct mdc_rpc_lock *cl_rpc_lock; struct mdc_rpc_lock *cl_setattr_lock; struct mdc_rpc_lock *cl_close_lock; struct osc_creator cl_oscc; /* mgc datastruct */ struct semaphore cl_mgc_sem; struct vfsmount *cl_mgc_vfsmnt; struct dentry *cl_mgc_configs_dir; atomic_t cl_mgc_refcount; struct obd_export *cl_mgc_mgsexp; /* checksumming for data sent over the network */ unsigned int cl_checksum:1; /* 0 = disabled, 1 = enabled */ /* supported checksum types that are worked out at connect time */ __u32 cl_supp_cksum_types; /* checksum algorithm to be used */ cksum_type_t cl_cksum_type; /* also protected by the poorly named _loi_list_lock lock above */ struct osc_async_rc cl_ar; /* used by quotacheck */ int cl_qchk_stat; /* quotacheck stat of the peer */ atomic_t cl_resends; /* resend count */ /* Cache of triples */ struct lustre_cache *cl_cache; obd_lock_cancel_cb cl_ext_lock_cancel_cb;};#define obd2cli_tgt(obd) ((char *)(obd)->u.cli.cl_target_uuid.uuid)#define CL_NOT_QUOTACHECKED 1 /* client->cl_qchk_stat init value */struct mgs_obd { struct ptlrpc_service *mgs_service; struct vfsmount *mgs_vfsmnt; struct super_block *mgs_sb; struct dentry *mgs_configs_dir; struct dentry *mgs_fid_de; struct list_head mgs_fs_db_list; struct semaphore mgs_sem; cfs_proc_dir_entry_t *mgs_proc_live;};struct mds_obd { /* NB this field MUST be first */ struct obd_device_target mds_obt; struct ptlrpc_service *mds_service; struct ptlrpc_service *mds_setattr_service; struct ptlrpc_service *mds_readpage_service; struct vfsmount *mds_vfsmnt; cfs_dentry_t *mds_fid_de; int mds_max_mdsize; int mds_max_cookiesize; struct file *mds_rcvd_filp; spinlock_t mds_transno_lock; __u64 mds_last_transno; __u64 mds_mount_count; __u64 mds_io_epoch; unsigned long mds_atime_diff; struct semaphore mds_epoch_sem; struct ll_fid mds_rootfid; struct lr_server_data *mds_server_data; cfs_dentry_t *mds_pending_dir; cfs_dentry_t *mds_logs_dir; cfs_dentry_t *mds_objects_dir; struct llog_handle *mds_cfg_llh;// struct llog_handle *mds_catalog; struct obd_device *mds_osc_obd; /* XXX lov_obd */ struct obd_uuid mds_lov_uuid; char *mds_profile; struct obd_export *mds_osc_exp; /* XXX lov_exp */ struct lov_desc mds_lov_desc; /* mark pages dirty for write. */ bitmap_t *mds_lov_page_dirty; /* array for store pages with obd_id */ void **mds_lov_page_array; /* file for store objid */ struct file *mds_lov_objid_filp; __u32 mds_lov_objid_count; __u32 mds_lov_objid_lastpage; __u32 mds_lov_objid_lastidx; struct file *mds_health_check_filp; unsigned long *mds_client_bitmap; struct upcall_cache *mds_group_hash; struct lustre_quota_info mds_quota_info; struct semaphore mds_qonoff_sem; struct semaphore mds_health_sem; unsigned long mds_fl_user_xattr:1, mds_fl_acl:1, mds_fl_cfglog:1, mds_fl_synced:1, mds_evict_ost_nids:1; uid_t mds_squash_uid; gid_t mds_squash_gid; lnet_nid_t mds_nosquash_nid;};/* lov objid */#define mds_max_ost_index (0xFFFF)#define MDS_LOV_ALLOC_SIZE (CFS_PAGE_SIZE)#define OBJID_PER_PAGE() (MDS_LOV_ALLOC_SIZE / sizeof(obd_id))#define MDS_LOV_OBJID_PAGES_COUNT (mds_max_ost_index/OBJID_PER_PAGE())extern int mds_lov_init_objids(struct obd_device *obd);extern void mds_lov_destroy_objids(struct obd_device *obd);struct obd_id_info { __u32 idx; obd_id *data;};/* */struct echo_obd { struct obdo eo_oa; spinlock_t eo_lock; __u64 eo_lastino; struct lustre_handle eo_nl_lock; atomic_t eo_prep;};struct ost_obd { struct ptlrpc_service *ost_service; struct ptlrpc_service *ost_create_service; struct ptlrpc_service *ost_io_service; struct semaphore ost_health_sem;};struct echo_client_obd { struct obd_export *ec_exp; /* the local connection to osc/lov */ spinlock_t ec_lock; struct list_head ec_objects; int ec_nstripes; __u64 ec_unique;};struct lov_qos_oss { struct obd_uuid lqo_uuid; /* ptlrpc's c_remote_uuid */ struct list_head lqo_oss_list; /* link to lov_qos */ __u32 lqo_ost_count; /* number of osts on this oss */ __u64 lqo_bavail; /* total bytes avail on OSS */ __u64 lqo_penalty; /* current penalty */ __u64 lqo_penalty_per_obj; /* penalty decrease every obj*/};struct ltd_qos { struct lov_qos_oss *ltq_oss; /* oss info */ __u64 ltq_penalty; /* current penalty */ __u64 ltq_penalty_per_obj; /* penalty decrease every obj*/ __u64 ltq_weight; /* net weighting */ unsigned int ltq_usable:1; /* usable for striping */};struct lov_qos { struct list_head lq_oss_list; /* list of OSSs that targets use */ struct rw_semaphore lq_rw_sem; __u32 lq_active_oss_count; __u32 *lq_rr_array; /* round-robin optimized list */ unsigned int lq_rr_size; /* rr array size */ unsigned int lq_prio_free; /* priority for free space */ unsigned long lq_dirty:1, /* recalc qos data */ lq_dirty_rr:1, /* recalc round-robin list */ lq_same_space:1,/* the ost's all have approx. the same space avail */ lq_reset:1; /* zero current penalties */};struct lov_tgt_desc { struct obd_uuid ltd_uuid; struct obd_export *ltd_exp; struct ltd_qos ltd_qos; /* qos info per target */ __u32 ltd_gen; __u32 ltd_index; /* index in lov_obd->tgts */ unsigned long ltd_active:1,/* is this target up for requests */ ltd_activate:1,/* should this target be activated */ ltd_reap:1; /* should this target be deleted */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -