#define IOC_MDC_MAX_NR 50
#include <lustre/lustre_idl.h>
-#include <lu_object.h>
+#include <lu_target.h>
#include <lu_ref.h>
#include <lustre_lib.h>
#include <lustre_export.h>
/* 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;
- /* _cli_ is poorly named, it should be _ready_ */
- struct list_head loi_cli_item;
+ struct list_head loi_ready_item;
+ struct list_head loi_hp_ready_item;
struct list_head loi_write_item;
struct list_head loi_read_item;
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_cli_item);
+ 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);
}
/* hold common fields for "target" device */
struct obd_device_target {
struct super_block *obt_sb;
+ /** last_rcvd file */
+ struct file *obt_rcvd_filp;
+ /** server data in last_rcvd file */
+ struct lr_server_data *obt_lsd;
+ /** Lock protecting client bitmap */
+ spinlock_t obt_client_bitmap_lock;
+ /** Bitmap of known clients */
+ unsigned long *obt_client_bitmap;
+ /** Server last transaction number */
+ __u64 obt_last_transno;
+ /** Lock protecting last transaction number */
+ spinlock_t obt_translock;
+ /** Number of mounts */
+ __u64 obt_mount_count;
atomic_t obt_quotachecking;
struct lustre_quota_ctxt obt_qctxt;
lustre_quota_version_t obt_qfmt;
struct filter_obd {
/* NB this field MUST be first */
struct obd_device_target fo_obt;
+ struct lu_target fo_lut;
const char *fo_fstype;
struct vfsmount *fo_vfsmnt;
spinlock_t fo_objidlock; /* protect fo_lastobjid */
- spinlock_t fo_translock; /* protect fsd_last_transno */
- struct file *fo_rcvd_filp;
struct file *fo_health_check_filp;
- struct lr_server_data *fo_fsd;
- unsigned long *fo_last_rcvd_slots;
- __u64 fo_mount_count;
unsigned long fo_destroys_in_progress;
struct semaphore fo_create_locks[FILTER_SUBDIR_COUNT];
int fo_sec_level;
};
+#define fo_translock fo_obt.obt_translock
+#define fo_rcvd_filp fo_obt.obt_rcvd_filp
+#define fo_fsd fo_obt.obt_lsd
+#define fo_last_rcvd_slots fo_obt.obt_client_bitmap
+#define fo_mount_count fo_obt.obt_mount_count
+
struct timeout_item {
enum timeout_event ti_event;
cfs_time_t ti_timeout;
struct list_head ti_obd_list;
struct list_head ti_chain;
};
+
#define OSC_MAX_RIF_DEFAULT 8
#define OSC_MAX_RIF_MAX 256
#define OSC_MAX_DIRTY_DEFAULT (OSC_MAX_RIF_DEFAULT * 4)
cfs_time_t cl_next_shrink_grant; /* jiffies */
struct list_head cl_grant_shrink_list; /* Timeout event list */
struct semaphore cl_grant_sem; /*grant shrink list semaphore*/
+ int cl_grant_shrink_interval; /* seconds */
/* keep track of objects that have lois that contain pages which
* have been queued for async brw. this lock also protects the
*/
client_obd_lock_t cl_loi_list_lock;
struct list_head cl_loi_ready_list;
+ struct list_head cl_loi_hp_ready_list;
struct list_head cl_loi_write_list;
struct list_head cl_loi_read_list;
int cl_r_in_flight;
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;
__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 rw_semaphore mds_notify_lock;
};
+#define mds_transno_lock mds_obt.obt_translock
+#define mds_rcvd_filp mds_obt.obt_rcvd_filp
+#define mds_server_data mds_obt.obt_lsd
+#define mds_client_bitmap mds_obt.obt_client_bitmap
+#define mds_mount_count mds_obt.obt_mount_count
+#define mds_last_transno mds_obt.obt_last_transno
+
/* lov objid */
extern __u32 mds_max_ost_index;
struct lov_tgt_desc {
struct list_head ltd_kill;
struct obd_uuid ltd_uuid;
+ struct obd_device *ltd_obd;
struct obd_export *ltd_exp;
struct ltd_qos ltd_qos; /* qos info per target */
__u32 ltd_gen;
/* initial thread handling transaction */
struct ptlrpc_thread * oti_thread;
__u32 oti_conn_cnt;
+ /** VBR: versions */
+ __u64 oti_pre_version;
struct obd_uuid *oti_ost_uuid;
};
return;
oti->oti_xid = req->rq_xid;
+ /** VBR: take versions from request */
+ if (req->rq_reqmsg != NULL &&
+ lustre_msg_get_flags(req->rq_reqmsg) & MSG_REPLAY) {
+ __u64 *pre_version = lustre_msg_get_versions(req->rq_reqmsg);
+ oti->oti_pre_version = pre_version ? pre_version[0] : 0;
+ oti->oti_transno = lustre_msg_get_transno(req->rq_reqmsg);
+ }
+ /** called from mds_create_objects */
if (req->rq_repmsg != NULL)
oti->oti_transno = lustre_msg_get_transno(req->rq_repmsg);
oti->oti_thread = req->rq_svc_thread;
OBD_NOTIFY_SYNC_NONBLOCK,
OBD_NOTIFY_SYNC,
/* Configuration event */
- OBD_NOTIFY_CONFIG
+ OBD_NOTIFY_CONFIG,
+ /* Trigger quota recovery */
+ OBD_NOTIFY_QUOTA
};
/* bit-mask flags for config events */
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_abort_recovery:1,/* recovery expired */
+ obd_version_recov:1, /* obd uses version checking */
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 */
atomic_t obd_refcount;
cfs_waitq_t obd_refcount_waitq;
struct list_head obd_exports;
+ struct list_head obd_delayed_exports;
int obd_num_exports;
spinlock_t obd_nid_lock;
struct ldlm_namespace *obd_namespace;
int obd_max_recoverable_clients;
int obd_connected_clients;
int obd_recoverable_clients;
+ int obd_stale_clients;
+ int obd_delayed_clients;
spinlock_t obd_processing_task_lock; /* BH lock (timer) */
__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;
time_t obd_recovery_start; /* seconds */
time_t obd_recovery_end; /* seconds, for lprocfs_status */
#define KEY_BLOCKSIZE "blocksize"
#define KEY_CAPA_KEY "capa_key"
#define KEY_CHANGELOG_CLEAR "changelog_clear"
+#define KEY_FID2PATH "fid2path"
#define KEY_CHECKSUM "checksum"
#define KEY_CLEAR_FS "clear_fs"
#define KEY_CONN_DATA "conn_data"
char *ostname);
int (*o_pool_rem)(struct obd_device *obd, char *poolname,
char *ostname);
+ void (*o_getref)(struct obd_device *obd);
+ void (*o_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.
#define OBD_CALC_STRIPE_END 2
static inline void obd_transno_commit_cb(struct obd_device *obd, __u64 transno,
- int error)
+ struct obd_export *exp, int error)
{
if (error) {
CERROR("%s: transno "LPU64" commit error: %d\n",
obd->obd_name, transno, error);
return;
}
- if (transno > obd->obd_last_committed) {
- CDEBUG(D_INFO, "%s: transno "LPD64" committed\n",
+ if (exp && transno > exp->exp_last_committed) {
+ CDEBUG(D_HA, "%s: transno "LPU64" committed\n",
obd->obd_name, transno);
- obd->obd_last_committed = transno;
- ptlrpc_commit_replies (obd);
+ exp->exp_last_committed = transno;
+ ptlrpc_commit_replies(exp);
} else {
- CDEBUG(D_INFO, "%s: transno "LPD64" committed\n",
+ CDEBUG(D_INFO, "%s: transno "LPU64" committed\n",
obd->obd_name, transno);
}
+ if (transno > obd->obd_last_committed)
+ obd->obd_last_committed = transno;
}
static inline void init_obd_quota_ops(quota_interface_t *interface,