#define MAX_OBD_DEVICES 8192
-/* this is really local to the OSC */
-struct loi_oap_pages {
- cfs_list_t lop_pending;
- cfs_list_t lop_urgent;
- cfs_list_t lop_pending_group;
- int lop_num_pending;
-};
-
struct osc_async_rc {
int ar_rc;
int ar_force_sync;
int loi_ost_idx; /* OST stripe index in lov_tgt_desc->tgts */
int loi_ost_gen; /* generation of this loi_ost_idx */
- /* used by the osc to keep track of what objects to build into rpcs */
- struct loi_oap_pages loi_read_lop;
- struct loi_oap_pages loi_write_lop;
- cfs_list_t loi_ready_item;
- cfs_list_t loi_hp_ready_item;
- cfs_list_t loi_write_item;
- cfs_list_t loi_read_item;
-
unsigned long loi_kms_valid:1;
__u64 loi_kms; /* known minimum size */
struct ost_lvb loi_lvb;
static inline void loi_init(struct lov_oinfo *loi)
{
- CFS_INIT_LIST_HEAD(&loi->loi_read_lop.lop_pending);
- CFS_INIT_LIST_HEAD(&loi->loi_read_lop.lop_urgent);
- CFS_INIT_LIST_HEAD(&loi->loi_read_lop.lop_pending_group);
- CFS_INIT_LIST_HEAD(&loi->loi_write_lop.lop_pending);
- CFS_INIT_LIST_HEAD(&loi->loi_write_lop.lop_urgent);
- CFS_INIT_LIST_HEAD(&loi->loi_write_lop.lop_pending_group);
- CFS_INIT_LIST_HEAD(&loi->loi_ready_item);
- CFS_INIT_LIST_HEAD(&loi->loi_hp_ready_item);
- CFS_INIT_LIST_HEAD(&loi->loi_write_item);
- CFS_INIT_LIST_HEAD(&loi->loi_read_item);
}
struct lov_stripe_md {
/* oss capability, its type is obd_capa in client to avoid copy.
* in contrary its type is lustre_capa in OSS. */
void *oi_capa;
+ /* transfer jobid from ost_sync() to filter_sync()... */
+ char *oi_jobid;
};
/* compare all relevant fields. */
cfs_rw_semaphore_t obt_rwsem;
struct vfsmount *obt_vfsmnt;
struct file *obt_health_check_filp;
- struct osd_properties obt_osd_properties;
+ struct osd_properties obt_osd_properties;
+ struct obd_job_stats obt_jobstats;
};
/* llog contexts */
long cl_dirty_transit; /* dirty synchronous */
long cl_avail_grant; /* bytes of credit for ost */
long cl_lost_grant; /* lost credits (trunc) */
- cfs_list_t cl_cache_waiters; /* waiting for cache/grant */
- cfs_time_t cl_next_shrink_grant; /* jiffies */
- cfs_list_t cl_grant_shrink_list; /* Timeout event list */
- int cl_grant_shrink_interval; /* seconds */
+
+ /* since we allocate grant by blocks, we don't know how many grant will
+ * be used to add a page into cache. As a solution, we reserve maximum
+ * grant before trying to dirty a page and unreserve the rest.
+ * See osc_{reserve|unreserve}_grant for details. */
+ long cl_reserved_grant;
+ cfs_list_t cl_cache_waiters; /* waiting for cache/grant */
+ cfs_time_t cl_next_shrink_grant; /* jiffies */
+ cfs_list_t cl_grant_shrink_list; /* Timeout event list */
+ int cl_grant_shrink_interval; /* seconds */
+
+ /* A chunk is an optimal size used by osc_extent to determine
+ * the extent size. A chunk is max(CFS_PAGE_SIZE, OST block size) */
+ int cl_chunkbits;
+ int cl_chunk;
+ int cl_extent_tax; /* extent overhead, by bytes */
/* keep track of objects that have lois that contain pages which
* have been queued for async brw. this lock also protects the
* 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.
- */
+ *
+ * NB by Jinshan: though field names are still _loi_, but actually
+ * osc_object{}s are in the list.
+ */
client_obd_lock_t cl_loi_list_lock;
cfs_list_t cl_loi_ready_list;
cfs_list_t cl_loi_hp_ready_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;
+ cfs_atomic_t cl_pending_w_pages;
+ cfs_atomic_t 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 niobuf_local {
+ __u64 lnb_file_offset;
__u64 offset;
__u32 len;
__u32 flags;
#define LUSTRE_CMM_NAME "cmm"
#define LUSTRE_MDD_NAME "mdd"
#define LUSTRE_OSD_NAME "osd-ldiskfs"
+#define LUSTRE_OSD_ZFS_NAME "osd-zfs"
#define LUSTRE_VVP_NAME "vvp"
#define LUSTRE_LMV_NAME "lmv"
#define LUSTRE_CMM_MDC_NAME "cmm-mdc"
struct llog_cookie oti_onecookie;
struct llog_cookie *oti_logcookies;
int oti_numcookies;
+ /** synchronous write is needed */
+ long oti_sync_write:1;
/* initial thread handling transaction */
struct ptlrpc_thread * oti_thread;
__u32 oti_conn_cnt;
/** VBR: versions */
__u64 oti_pre_version;
+ /** JobID */
+ char *oti_jobid;
struct obd_uuid *oti_ost_uuid;
};
};
#define OBD_LLOG_FL_SENDNOW 0x0001
+#define OBD_LLOG_FL_EXIT 0x0002
enum obd_cleanup_stage {
/* Special case hack for MDS LOVs */