#define IOC_OSC_TYPE 'h'
#define IOC_OSC_MIN_NR 20
#define IOC_OSC_SET_ACTIVE _IOWR(IOC_OSC_TYPE, 21, struct obd_device *)
+#define IOC_OSC_CTL_RECOVERY _IOWR(IOC_OSC_TYPE, 22, struct obd_device *)
#define IOC_OSC_MAX_NR 50
#define IOC_MDC_TYPE 'i'
#define IOC_MDC_LOOKUP _IOWR(IOC_MDC_TYPE, 20, struct obd_device *)
/* Moved to lustre_user.h
#define IOC_MDC_GETSTRIPE _IOWR(IOC_MDC_TYPE, 21, struct lov_mds_md *) */
-#define IOC_MDC_FINISH_GNS _IOWR(IOC_MDC_TYPE, 22, struct obd_device *)
#define IOC_MDC_MAX_NR 50
#ifdef __KERNEL__
struct list_head loi_write_item;
struct list_head loi_read_item;
- int loi_kms_valid:1;
+ unsigned loi_kms_valid:1;
__u64 loi_kms; /* known minimum size */
__u64 loi_rss; /* recently seen size */
__u64 loi_mtime; /* recently seen mtime */
};
struct brw_page {
- obd_off off;
+ obd_off disk_offset; /* modulo PAGE_SIZE */
+ obd_off page_offset; /* modulo PAGE_SIZE (obviously) */
struct page *pg;
int count;
- obd_flag flag;
+ obd_flags flag;
};
enum async_flags {
* callees of this method are encouraged to abort their state
* in the oig. This may be called multiple times. */
void (*occ_interrupted)(struct oig_callback_context *occ);
+ int interrupted;
};
/* if we find more consumers this could be generalized */
unsigned long oh_buckets[OBD_HIST_MAX];
};
+/* reports average service time with the help of lprocfs_status.c */
+struct obd_service_time {
+ __u32 st_num;
+ __u64 st_total_us;
+};
+
+
struct ost_server_data;
#define FILTER_SUBDIR_COUNT 32 /* set to zero for no subdirs */
const char *fo_fstype;
struct super_block *fo_sb;
struct vfsmount *fo_vfsmnt;
+ struct lvfs_obd_ctxt *fo_lvfs_ctxt;
int fo_group_count;
struct dentry *fo_dentry_O; /* the "O"bject directory dentry */
struct semaphore fo_init_lock; /* group initialization lock */
int fo_committed_group;
- spinlock_t fo_objidlock; /* protect fo_lastobjid increment */
- spinlock_t fo_translock; /* protect fsd_last_rcvd increment */
+ spinlock_t fo_objidlock; /* protect fo_lastobjid increment */
+ spinlock_t fo_translock; /* protect fsd_last_rcvd increment */
struct file *fo_rcvd_filp;
struct filter_server_data *fo_fsd;
unsigned long *fo_last_rcvd_slots;
struct list_head fo_llog_list;
spinlock_t fo_llog_list_lock;
+
+ /* which secure flavor from remote is denied */
+ spinlock_t fo_denylist_lock;
+ struct list_head fo_denylist;
+
};
struct mds_server_data;
-#define OSC_MAX_RIF_DEFAULT 4
-#define OSC_MAX_RIF_MAX 32
-#define OSC_MAX_DIRTY_DEFAULT 4
-#define OSC_MAX_DIRTY_MB_MAX 256 /* totally arbitrary */
+#define OSC_MAX_RIF_DEFAULT 8
+#define OSC_MAX_RIF_MAX 64
+#define OSC_MAX_DIRTY_DEFAULT (4*OSC_MAX_RIF_DEFAULT*PTLRPC_MAX_BRW_SIZE>>20)
+#define OSC_MAX_DIRTY_MB_MAX 512 /* totally arbitrary */
+
struct mdc_rpc_lock;
struct client_obd {
int cl_max_mds_cookiesize;
kdev_t cl_sandev;
+ /* security flavors */
+ __u32 cl_sec_flavor;
+ __u32 cl_sec_subflavor;
+
//struct llog_canceld_ctxt *cl_llcd; /* it's included by obd_llog_ctxt */
void *cl_llcd_offset;
struct list_head cl_loi_ready_list;
struct list_head cl_loi_write_list;
struct list_head cl_loi_read_list;
- int cl_brw_in_flight;
+ 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;
struct obd_histogram cl_write_rpc_hist;
struct obd_histogram cl_read_page_hist;
struct obd_histogram cl_write_page_hist;
+ struct obd_service_time cl_read_stime;
+ struct obd_service_time cl_write_stime;
+ struct obd_service_time cl_enter_stime;
struct mdc_rpc_lock *cl_rpc_lock;
- struct mdc_rpc_lock *cl_setattr_lock;
+ struct mdc_rpc_lock *cl_setattr_lock;
+ struct mdc_rpc_lock *cl_close_lock;
struct osc_creator cl_oscc;
- void *cl_clone_info;
+ int cl_async:1;
};
/* Like a client, with some hangers-on. Keep mc_client_obd first so that we
struct ptlrpc_service *mds_readpage_service;
struct super_block *mds_sb;
struct vfsmount *mds_vfsmnt;
- struct dentry *mds_fid_de;
+ struct dentry *mds_id_de;
+ struct lvfs_obd_ctxt *mds_lvfs_ctxt;
int mds_max_mdsize;
int mds_max_cookiesize;
struct file *mds_rcvd_filp;
+ struct file *mds_fid_filp;
+ struct file *mds_virtid_filp;
spinlock_t mds_transno_lock;
__u64 mds_last_transno;
__u64 mds_mount_count;
__u64 mds_io_epoch;
+
+ __u64 mds_last_fid;
+ __u64 mds_virtid_fid;
+ spinlock_t mds_last_fid_lock;
+
struct semaphore mds_epoch_sem;
- struct ll_fid mds_rootfid;
+ struct lustre_id mds_rootid;
struct mds_server_data *mds_server_data;
struct dentry *mds_pending_dir;
struct dentry *mds_logs_dir;
struct dentry *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 */
- int mds_has_lov_desc;
- struct lov_desc mds_lov_desc;
- obd_id *mds_lov_objids;
- int mds_lov_objids_valid;
- int mds_lov_nextid_set;
- struct file *mds_lov_objid_filp;
- spinlock_t mds_lov_lock;
+ struct obd_device *mds_dt_obd;
+ struct obd_uuid mds_dt_uuid;
+ struct obd_export *mds_dt_exp;
+ int mds_has_dt_desc;
+ struct lov_desc mds_dt_desc;
+
+ spinlock_t mds_dt_lock;
+ obd_id *mds_dt_objids;
+ struct file *mds_dt_objid_filp;
+ int mds_dt_objids_valid;
+
unsigned long *mds_client_bitmap;
struct semaphore mds_orphan_recovery_sem;
- /*add mds num here for real mds and cache mds create
- FIXME later will be totally fixed by b_cmd*/
+
int mds_num;
- struct lprocfs_stats *mds_counters;
int mds_config_version;
- char *mds_lmv_name;
- struct obd_device *mds_lmv_obd; /* XXX lmv_obd */
- struct obd_export *mds_lmv_exp; /* XXX lov_exp */
+ char *mds_md_name;
+ struct obd_device *mds_md_obd;
+ struct obd_export *mds_md_exp;
+ struct semaphore mds_md_sem;
+ struct obd_uuid mds_md_uuid;
+ int mds_md_connected;
+
struct ptlrpc_service *mds_create_service;
- struct semaphore mds_lmv_sem;
uid_t mds_squash_uid;
gid_t mds_squash_gid;
ptl_nid_t mds_nosquash_nid;
atomic_t mds_real_clients;
- struct obd_uuid mds_lmv_uuid;
- struct dentry *mds_fids_dir;
- int mds_lmv_connected;
+ atomic_t mds_open_count;
+ struct dentry *mds_id_dir;
+ int mds_obd_type;
struct dentry *mds_unnamed_dir; /* for mdt_obd_create only */
+
+ /* security related */
+ char *mds_mds_sec;
+ char *mds_ost_sec;
+ /* which secure flavor from remote to this mds is denied */
+ spinlock_t mds_denylist_lock;
+ struct list_head mds_denylist;
+ struct semaphore mds_create_sem;
};
struct echo_obd {
- struct obdo oa;
- spinlock_t eo_lock;
- __u64 eo_lastino;
- atomic_t eo_getattr;
- atomic_t eo_setattr;
- atomic_t eo_create;
- atomic_t eo_destroy;
- atomic_t eo_prep;
- atomic_t eo_read;
- atomic_t eo_write;
+ struct obdo eo_oa;
+ spinlock_t eo_lock;
+ __u64 eo_lastino;
+ struct lustre_handle eo_nl_lock;
+ atomic_t eo_prep;
};
/*
};
struct ost_obd {
+ spinlock_t ost_lock;
struct ptlrpc_service *ost_service;
struct ptlrpc_service *ost_create_service;
+ struct obd_service_time ost_stimes[6];
};
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 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 cache_obd {
- struct obd_export *cobd_real_exp;/* local connection to target obd */
- struct obd_export *cobd_cache_exp; /* local connection to cache obd */
- char *cobd_real_name;
- char *cobd_cache_name;
- int refcount;
- int cache_on;
+ struct obd_export *master_exp; /* local connection to master obd */
+ struct obd_export *cache_exp; /* local connection to cache obd */
+ struct obd_export *cache_real_exp;
+ struct obd_export *master_real_exp;
+ struct obd_device *master;
+ struct obd_device *cache;
+ char *master_name;
+ char *cache_name;
+ int refcount;
+ int cache_on;
+ struct semaphore sem;
+};
+
+struct cm_obd {
+ struct obd_export *cache_exp; /* local connection to cache obd */
+ struct obd_export *master_exp;
+ struct obd_device *cache_obd;
+ struct obd_device *master_obd;
+ int master_group;
+ struct cmobd_write_service *write_srv;
+};
+
+struct conf_obd {
+ struct super_block *cfobd_sb;
+ struct vfsmount *cfobd_vfsmnt;
+ struct dentry *cfobd_logs_dir;
+ struct dentry *cfobd_objects_dir;
+ struct dentry *cfobd_pending_dir;
+ struct llog_handle *cfobd_cfg_llh;
+ struct lvfs_obd_ctxt *cfobd_lvfs_ctxt;
};
struct lov_tgt_desc {
- struct obd_uuid uuid;
- __u32 ltd_gen;
- struct obd_export *ltd_exp;
- int active; /* is this target up for requests */
+ struct obd_uuid uuid;
+ __u32 ltd_gen;
+ struct obd_export *ltd_exp;
+ int active; /* is this target up for requests */
};
struct lov_obd {
- spinlock_t lov_lock;
- struct lov_desc desc;
- struct semaphore lov_llog_sem;
- int bufsize;
- int refcount;
- int lo_catalog_loaded:1;
- unsigned long lov_connect_flags;
- struct lov_tgt_desc *tgts;
+ spinlock_t lov_lock;
+ struct lov_desc desc;
+ int bufsize;
+ int refcount;
+ int lo_catalog_loaded:1, async:1;
+ struct semaphore lov_llog_sem;
+ unsigned long lov_connect_flags;
+ struct lov_tgt_desc *tgts;
};
struct lmv_tgt_desc {
struct obd_uuid uuid;
- struct obd_export *ltd_exp;
- int active; /* is this target up for requests */
+ struct obd_export *ltd_exp;
+ int active; /* is this target up for requests */
};
struct lmv_obd {
+ int refcount;
spinlock_t lmv_lock;
struct lmv_desc desc;
- int bufsize;
- int refcount;
struct lmv_tgt_desc *tgts;
struct obd_uuid cluuid;
struct obd_export *exp;
+
+ int tgts_size;
int connected;
int max_easize;
int max_cookiesize;
int server_timeout;
int connect_flags;
struct semaphore init_sem;
+ struct obd_connect_data conn_data;
};
struct niobuf_local {
int rc;
};
-struct cache_manager_obd {
- struct obd_device *cm_master_obd; /* master lov */
- struct obd_export *cm_master_exp;
- struct obd_device *cm_cache_obd; /* cache obdfilter */
- struct obd_export *cm_cache_exp;
- int cm_master_group; /* master group*/
- struct cmobd_write_service *cm_write_srv;
-};
-
+#define OBD_MODE_ASYNC (1 << 0)
+#define OBD_MODE_CROW (1 << 1)
/* Don't conflict with on-wire flags OBD_BRW_WRITE, etc */
#define N_LOCAL_TEMP_PAGE 0x10000000
struct obd_trans_info {
__u64 oti_transno;
__u64 *oti_objid;
- /* Only used on the server side for tracking acks. */
+
+ /* only used on the server side for tracking acks. */
struct oti_req_ack_lock {
struct lustre_handle lock;
__u32 mode;
struct llog_cookie oti_onecookie;
struct llog_cookie *oti_logcookies;
int oti_numcookies;
+ int oti_flags;
};
static inline void oti_alloc_cookies(struct obd_trans_info *oti,int num_cookies)
spinlock_t obd_processing_task_lock;
__u64 obd_next_recovery_transno;
int obd_replayed_requests;
+ int obd_replayed_locks;
int obd_requests_queued_for_recovery;
wait_queue_head_t obd_next_transno_waitq;
struct list_head obd_uncommitted_replies;
spinlock_t obd_uncommitted_replies_lock;
struct timer_list obd_recovery_timer;
- struct list_head obd_recovery_queue;
- struct list_head obd_delayed_reply_queue;
+ time_t obd_recovery_start;
+ time_t obd_recovery_end;
+
+ atomic_t obd_req_replay_clients;
+ atomic_t obd_lock_replay_clients;
+
+ struct list_head obd_req_replay_queue;
+ struct list_head obd_lock_replay_queue;
+ struct list_head obd_final_req_queue;
+ int obd_recovery_stage;
union {
- 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 recovd_obd recovd;
- struct lov_obd lov;
- struct cache_obd cobd;
- struct ptlbd_obd ptlbd;
- struct mgmtcli_obd mgmtcli;
- struct lmv_obd lmv;
- struct cache_manager_obd cmobd;
+ struct filter_obd filter;
+ struct mds_obd mds;
+ struct client_obd cli;
+ struct ost_obd ost;
+ struct echo_client_obd echocli;
+ struct echo_obd echo;
+ struct recovd_obd recovd;
+ struct lov_obd lov;
+ struct cache_obd cobd;
+ struct ptlbd_obd ptlbd;
+ struct mgmtcli_obd mgmtcli;
+ struct lmv_obd lmv;
+ struct cm_obd cm;
+ struct conf_obd conf;
} u;
- /* Fields used by LProcFS */
+
+ /* fields used by LProcFS */
unsigned int obd_cntr_base;
struct lprocfs_stats *obd_stats;
+ unsigned int md_cntr_base;
+ struct lprocfs_stats *md_stats;
+
struct proc_dir_entry *obd_svc_procroot;
struct lprocfs_stats *obd_svc_stats;
};
-#define OBD_OPT_FORCE 0x0001
-#define OBD_OPT_FAILOVER 0x0002
-#define OBD_OPT_REAL_CLIENT 0x0004
-#define OBD_OPT_MDS_CONNECTION 0x0008
+#define OBD_OPT_FORCE (1 << 0)
+#define OBD_OPT_FAILOVER (1 << 1)
+#define OBD_OPT_REAL_CLIENT (1 << 2)
+#define OBD_OPT_MDS_CONNECTION (1 << 3)
-#define OBD_LLOG_FL_SENDNOW 0x0001
-#define OBD_LLOG_FL_CREATE 0x0002
+#define OBD_LLOG_FL_SENDNOW (1 << 0)
+#define OBD_LLOG_FL_CREATE (1 << 1)
struct mdc_op_data;
int (*o_process_config)(struct obd_device *dev, obd_count len,
void *data);
int (*o_postrecov)(struct obd_device *dev);
+ int (*o_add_conn)(struct obd_import *imp, struct obd_uuid *uuid,
+ int priority);
+ int (*o_del_conn)(struct obd_import *imp, struct obd_uuid *uuid);
int (*o_connect)(struct lustre_handle *conn, struct obd_device *src,
- struct obd_uuid *cluuid, unsigned long connect_flags);
- int (*o_connect_post)(struct obd_export *exp);
- int (*o_disconnect)(struct obd_export *exp, int flags);
+ struct obd_uuid *cluuid, struct obd_connect_data *data,
+ unsigned long flags);
+ int (*o_connect_post)(struct obd_export *exp, unsigned, unsigned long);
+ int (*o_disconnect)(struct obd_export *exp, unsigned long flags);
int (*o_statfs)(struct obd_device *obd, struct obd_statfs *osfs,
unsigned long max_age);
int (*o_preallocate)(struct lustre_handle *, obd_count *req,
obd_id *ids);
int (*o_create)(struct obd_export *exp, struct obdo *oa,
+ void *acl, int acl_size,
struct lov_stripe_md **ea, struct obd_trans_info *oti);
int (*o_destroy)(struct obd_export *exp, struct obdo *oa,
struct lov_stripe_md *ea, struct obd_trans_info *oti);
struct lov_stripe_md *lsm,
struct lov_oinfo *loi, void *cookie,
int cmd, obd_off off, int count,
- obd_flag brw_flags, obd_flag async_flags);
+ obd_flags brw_flags, obd_flags async_flags);
int (*o_queue_group_io)(struct obd_export *exp,
struct lov_stripe_md *lsm,
struct lov_oinfo *loi,
struct obd_io_group *oig,
void *cookie, int cmd, obd_off off, int count,
- obd_flag brw_flags, obd_flag async_flags);
+ obd_flags brw_flags, obd_flags async_flags);
int (*o_trigger_group_io)(struct obd_export *exp,
struct lov_stripe_md *lsm,
struct lov_oinfo *loi,
int (*o_set_async_flags)(struct obd_export *exp,
struct lov_stripe_md *lsm,
struct lov_oinfo *loi, void *cookie,
- obd_flag async_flags);
+ obd_flags async_flags);
int (*o_teardown_async_page)(struct obd_export *exp,
struct lov_stripe_md *lsm,
struct lov_oinfo *loi, void *cookie);
+ int (*o_adjust_kms)(struct obd_export *exp, struct lov_stripe_md *lsm,
+ obd_off size, int shrink);
int (*o_punch)(struct obd_export *exp, struct obdo *oa,
struct lov_stripe_md *ea, obd_size start,
obd_size end, struct obd_trans_info *oti);
int (*o_notify)(struct obd_device *obd, struct obd_device *watched,
int active, void *data);
+
+ /* this method is needed for cmobd to make say to LMV "get ready" when
+ * master obd is LMV. This is needed, because LMV is initialized in
+ * "defered" manner to let all MDSs to be set up first. */
+ int (*o_getready)(struct obd_export *exp);
int (*o_init_ea_size)(struct obd_export *, int, int);
/*
*/
};
-struct ll_uctxt;
-
struct md_ops {
- int (*m_getstatus)(struct obd_export *, struct ll_fid *);
- int (*m_change_cbdata)(struct obd_export *, struct ll_fid *,
+ int (*m_getstatus)(struct obd_export *, struct lustre_id *);
+ int (*m_change_cbdata)(struct obd_export *, struct lustre_id *,
ldlm_iterator_t, void *);
- int (*m_change_cbdata_name)(struct obd_export *, struct ll_fid *,
- char *, int, struct ll_fid *,
+ int (*m_change_cbdata_name)(struct obd_export *, struct lustre_id *,
+ char *, int, struct lustre_id *,
ldlm_iterator_t, void *);
int (*m_close)(struct obd_export *, struct obdo *,
struct obd_client_handle *,
int, struct mdc_op_data *, struct lustre_handle *,
void *, int, ldlm_completion_callback,
ldlm_blocking_callback, void *);
- int (*m_getattr)(struct obd_export *, struct ll_fid *,
- unsigned long, unsigned int,
- struct ptlrpc_request **);
- int (*m_getattr_name)(struct obd_export *, struct ll_fid *,
- char *, int, unsigned long,
+ int (*m_getattr)(struct obd_export *, struct lustre_id *,
+ __u64, const char *, int,
+ unsigned int, struct ptlrpc_request **);
+ int (*m_getattr_lock)(struct obd_export *, struct lustre_id *,
+ char *, int, __u64,
unsigned int, struct ptlrpc_request **);
- int (*m_intent_lock)(struct obd_export *, struct ll_uctxt *,
- struct ll_fid *, const char *, int,
- void *, int, struct ll_fid *,
+ int (*m_intent_lock)(struct obd_export *,
+ struct lustre_id *, const char *, int,
+ void *, int, struct lustre_id *,
struct lookup_intent *, int,
struct ptlrpc_request **,
ldlm_blocking_callback);
int (*m_setattr)(struct obd_export *, struct mdc_op_data *,
struct iattr *, void *, int , void *, int,
struct ptlrpc_request **);
- int (*m_sync)(struct obd_export *, struct ll_fid *,
+ int (*m_sync)(struct obd_export *, struct lustre_id *,
struct ptlrpc_request **);
- int (*m_readpage)(struct obd_export *, struct ll_fid *,
+ int (*m_readpage)(struct obd_export *, struct lustre_id *,
__u64, struct page *, struct ptlrpc_request **);
int (*m_unlink)(struct obd_export *, struct mdc_op_data *,
struct ptlrpc_request **);
- int (*m_valid_attrs)(struct obd_export *, struct ll_fid *);
- struct obd_device * (*m_get_real_obd)(struct obd_export *,
- char *name, int len);
+ int (*m_valid_attrs)(struct obd_export *, struct lustre_id *);
+
+ struct obd_device *(*m_get_real_obd)(struct obd_export *, struct lustre_id *);
int (*m_req2lustre_md)(struct obd_export *exp,
struct ptlrpc_request *req, unsigned int offset,
int repoff);
int (*m_set_lock_data)(struct obd_export *exp, __u64 *l, void *data);
- int (*m_delete_object)(struct obd_export *, struct ll_fid *);
- /*
- * NOTE: If adding ops, add another LPROCFS_OBD_OP_INIT() line
- * to lprocfs_alloc_obd_stats() in obdclass/lprocfs_status.c.
- * Also, add a wrapper function in include/linux/obd_class.h.
+ int (*m_delete_inode)(struct obd_export *, struct lustre_id *);
+
+ /*
+ * NOTE: If adding ops, add another LPROCFS_MD_OP_INIT() line to
+ * lprocfs_alloc_md_stats() in obdclass/lprocfs_status.c. Also, add a
+ * wrapper function in include/linux/obd_class.h.
*/
};
-static inline void obd_transno_commit_cb(struct obd_device *obd, __u64 transno,
- int error)
+static inline void obd_transno_commit_cb(struct obd_device *obd,
+ __u64 transno, int error)
{
if (error) {
CERROR("%s: transno "LPD64" commit error: %d\n",
obd->obd_name, transno, error);
return;
}
+
CDEBUG(D_HA, "%s: transno "LPD64" committed\n",
obd->obd_name, transno);
+
if (transno > obd->obd_last_committed) {
obd->obd_last_committed = transno;
ptlrpc_commit_replies (obd);