struct ptlrpc_service *ost_service;
struct ptlrpc_service *ost_create_service;
struct ptlrpc_service *ost_io_service;
+ struct ptlrpc_service *ost_seq_service;
struct mutex ost_health_mutex;
};
};
struct lmv_tgt_desc {
- struct obd_uuid ltd_uuid;
- struct obd_export *ltd_exp;
- int ltd_active; /* is this target up for requests */
- int ltd_idx;
+ struct obd_uuid ltd_uuid;
+ struct obd_export *ltd_exp;
+ int ltd_idx;
struct mutex ltd_fid_mutex;
+ unsigned long ltd_active:1; /* target up for requests */
};
enum placement_policy {
int refcount;
struct lu_client_fld lmv_fld;
spinlock_t lmv_lock;
- placement_policy_t lmv_placement;
- struct lmv_desc desc;
- struct obd_uuid cluuid;
- struct obd_export *exp;
-
- int connected;
- int max_easize;
- int max_def_easize;
- int max_cookiesize;
- int server_timeout;
- struct mutex init_mutex;
+ placement_policy_t lmv_placement;
+ struct lmv_desc desc;
+ struct obd_uuid cluuid;
+ struct obd_export *exp;
- struct lmv_tgt_desc *tgts;
- int tgts_size;
+ struct mutex init_mutex;
+ int connected;
+ int max_easize;
+ int max_def_easize;
+ int max_cookiesize;
+ int server_timeout;
- struct obd_connect_data *datas;
- int datas_size;
+ int tgts_size; /* size of tgts array */
+ struct lmv_tgt_desc **tgts;
- struct obd_connect_data conn_data;
+ struct obd_connect_data conn_data;
};
struct niobuf_local {
#define LUSTRE_MGS_OBDNAME "MGS"
#define LUSTRE_MGC_OBDNAME "MGC"
+static inline int is_osp_on_mdt(char *name)
+{
+ char *ptr;
+
+ ptr = strrchr(name, '-');
+ if (ptr == NULL) {
+ CERROR("%s is not a obdname\n", name);
+ return 0;
+ }
+
+ /* 1.8 OSC/OSP name on MDT is fsname-OSTxxxx-osc */
+ if (strncmp(ptr + 1, "osc", 3) == 0)
+ return 1;
+
+ if (strncmp(ptr + 1, "MDT", 3) != 0)
+ return 0;
+
+ while (*(--ptr) != '-' && ptr != name);
+
+ if (ptr == name)
+ return 0;
+
+ if (strncmp(ptr + 1, LUSTRE_OSP_NAME, strlen(LUSTRE_OSP_NAME)) != 0 &&
+ strncmp(ptr + 1, LUSTRE_OSC_NAME, strlen(LUSTRE_OSC_NAME)) != 0)
+ return 0;
+
+ return 1;
+}
+
/* Don't conflict with on-wire flags OBD_BRW_WRITE, etc */
#define N_LOCAL_TEMP_PAGE 0x10000000
-static inline int is_osp_on_ost(char *name)
+/* Currently the connection osp is only for connecting MDT0, the
+ * name would either be
+ * fsname-MDT0000-osp-OSTxxxx or fsname-MDT0000-osp-MDT0000 */
+static inline int is_osp_for_connection(char *name)
{
- char *ptr;
+ char *ptr;
+ int osp_on_mdt0 = 0;
+ char *endptr;
ptr = strrchr(name, '-');
if (ptr == NULL) {
if (strncmp(ptr + 1, "OST", 3) != 0 && strncmp(ptr + 1, "MDT", 3) != 0)
return 0;
+ if (strncmp(ptr + 1, "MDT", 3) == 0) {
+ int index;
+
+#ifdef __KERNEL__
+ index = simple_strtoul(ptr + 4, &endptr, 16);
+#else
+ index = strtoul(ptr + 4, &endptr, 16);
+#endif
+ if (index != 0)
+ return 0;
+ osp_on_mdt0 = 1;
+ }
+
/* match the "-osp" */
if (ptr - name < strlen(LUSTRE_OSP_NAME) + 1)
return 0;
if (strncmp(ptr + 1, LUSTRE_OSP_NAME, strlen(LUSTRE_OSP_NAME)) != 0)
return 0;
+ if (osp_on_mdt0) {
+ int index = 0;
+ while (*(--ptr) != '-' && ptr != name);
+
+ if (ptr == name) {
+ CERROR("%s is not a valid osp name\n", name);
+ return 0;
+ }
+
+ if (strncmp(ptr + 1, "MDT", 3) != 0)
+ return 0;
+#ifdef __KERNEL__
+ index = simple_strtoul(ptr + 4, &endptr, 16);
+#else
+ index = strtoul(ptr + 4, &endptr, 16);
+#endif
+ if (index != 0)
+ return 0;
+ }
return 1;
}
struct md_enqueue_info *minfo,
int rc);
+/* seq client type */
+enum lu_cli_type {
+ LUSTRE_SEQ_METADATA = 1,
+ LUSTRE_SEQ_DATA
+};
+
struct md_enqueue_info {
struct md_op_data mi_data;
struct lookup_intent mi_it;
void *localdata);
int (*o_disconnect)(struct obd_export *exp);
- /* Initialize/finalize fids infrastructure. */
- int (*o_fid_init)(struct obd_export *exp);
- int (*o_fid_fini)(struct obd_export *exp);
+ /* Initialize/finalize fids infrastructure. */
+ int (*o_fid_init)(struct obd_device *obd,
+ struct obd_export *exp, enum lu_cli_type type);
+ int (*o_fid_fini)(struct obd_device *obd);
/* Allocate new fid according to passed @hint. */
int (*o_fid_alloc)(struct obd_export *exp, struct lu_fid *fid,
}
}
-int lvfs_check_io_health(struct obd_device *obd, struct file *file);
-
/* Requests for obd_extent_calc() */
#define OBD_CALC_STRIPE_START 1
#define OBD_CALC_STRIPE_END 2