extern struct req_format RQF_OBD_IDX_READ;
/* MGS req_format */
extern struct req_format RQF_MGS_TARGET_REG;
+extern struct req_format RQF_MGS_TARGET_REG_NIDLIST;
extern struct req_format RQF_MGS_SET_INFO;
extern struct req_format RQF_MGS_CONFIG_READ;
/* fid/fld req_format */
extern struct req_msg_field RMF_LLOGD_CONN_BODY;
extern struct req_msg_field RMF_MGS_TARGET_INFO;
+extern struct req_msg_field RMF_MGS_TARGET_NIDLIST;
extern struct req_msg_field RMF_MGS_SEND_PARAM;
extern struct req_msg_field RMF_OST_BODY;
void lustre_swab_ldlm_request(struct ldlm_request *rq);
void lustre_swab_ldlm_reply(struct ldlm_reply *r);
void lustre_swab_mgs_target_info(struct mgs_target_info *oinfo);
+void lustre_swab_mgs_target_nidlist(struct mgs_target_nidlist *mtn);
void lustre_swab_mgs_nidtbl_entry_header(struct mgs_nidtbl_entry *oinfo);
void lustre_swab_mgs_nidtbl_entry_content(struct mgs_nidtbl_entry *oinfo);
void lustre_swab_mgs_config_body(struct mgs_config_body *body);
#define OBD_CONNECT_GRANT 0x8ULL /* fetch grant connect */
#define OBD_CONNECT_SRVLOCK 0x10ULL /* server lock for RPC */
#define OBD_CONNECT_VERSION 0x20ULL /* versions in OCD */
-#define OBD_CONNECT_REQPORTAL 0x40ULL /* non-IO portal */
+#define OBD_CONNECT_MGS_NIDLIST 0x40ULL /* MGS nidlist protocol */
#define OBD_CONNECT_ACL 0x80ULL /* access control list */
#define OBD_CONNECT_XATTR 0x100ULL /* extended attributes */
#define OBD_CONNECT_LARGE_ACL 0x200ULL /* over 32 ACL entries */
OBD_CONNECT2_MIRROR_ID_FIX)
#define OST_CONNECT_SUPPORTED (OBD_CONNECT_SRVLOCK | OBD_CONNECT_GRANT | \
- OBD_CONNECT_REQPORTAL | OBD_CONNECT_VERSION | \
- OBD_CONNECT_INDEX | \
+ OBD_CONNECT_VERSION | OBD_CONNECT_INDEX | \
OBD_CONNECT_BRW_SIZE | OBD_CONNECT_CANCELSET | \
OBD_CONNECT_AT | LRU_RESIZE_CONNECT_FLAG | \
OBD_CONNECT_CKSUM | OBD_CONNECT_VBR | \
char mti_nidlist[][LNET_NIDSTR_SIZE];
} __attribute__((packed));
+enum mgs_nidlist_flags {
+ NIDLIST_APPEND = 0x00000001, /* append NIDs to nidtable */
+ NIDLIST_IN_BULK = 0x00000002, /* nidlist in bulk */
+ NIDLIST_COMPRESSED = 0x00000004, /* nidlist is compressed */
+};
+
+#define MTN_NIDSTR_SIZE LNET_NIDSTR_SIZE
+#define NIDLIST_SIZE(count) (MTN_NIDSTR_SIZE * count)
+
+struct mgs_target_nidlist {
+ __u32 mtn_flags; /* flags from mgs_nids_info_flags */
+ __u32 mtn_nids; /* amount of nids in list */
+ char mtn_inline_list[][MTN_NIDSTR_SIZE];
+} __attribute__((packed));
+
struct mgs_nidtbl_entry {
__u64 mne_version; /* table version of this entry */
__u32 mne_instance; /* target instance # */
/* indicate OST features supported by this client */
data->ocd_connect_flags = OBD_CONNECT_GRANT | OBD_CONNECT_VERSION |
- OBD_CONNECT_REQPORTAL | OBD_CONNECT_BRW_SIZE |
+ OBD_CONNECT_BRW_SIZE |
OBD_CONNECT_CANCELSET | OBD_CONNECT_FID |
OBD_CONNECT_SRVLOCK |
OBD_CONNECT_AT | OBD_CONNECT_OSS_CAPA |
OBD_CONNECT_LRU_RESIZE |
#endif
OBD_CONNECT_MDS |
- OBD_CONNECT_REQPORTAL |
OBD_CONNECT_SKIP_ORPHAN |
OBD_CONNECT_FID |
OBD_CONNECT_LVB_TYPE |
"write_grant", /* 0x04 */
"server_lock", /* 0x10 */
"version", /* 0x20 */
- "request_portal", /* 0x40 */
+ "mgs_nidlist", /* 0x40 */
"acl", /* 0x80 */
"xattr", /* 0x100 */
"create_on_write", /* 0x200 */
return -ENOMEM;
}
- ocd->ocd_connect_flags = OBD_CONNECT_VERSION | OBD_CONNECT_REQPORTAL |
+ ocd->ocd_connect_flags = OBD_CONNECT_VERSION |
OBD_CONNECT_BRW_SIZE |
OBD_CONNECT_GRANT | OBD_CONNECT_FULL20 |
OBD_CONNECT_64BITHASH | OBD_CONNECT_LVB_TYPE |
if (ocd->ocd_connect_flags & OBD_CONNECT_GRANT)
osc_init_grant(&obd->u.cli, ocd);
- /* See bug 7198 */
- if (ocd->ocd_connect_flags & OBD_CONNECT_REQPORTAL)
- imp->imp_client->cli_request_portal =
- OST_REQUEST_PORTAL;
-
rc = obd_notify_observer(obd, obd, OBD_NOTIFY_OCD);
break;
}
&RMF_MGS_TARGET_INFO
};
+static const struct req_msg_field *mgs_target_info_nidlist[] = {
+ &RMF_PTLRPC_BODY,
+ &RMF_MGS_TARGET_INFO,
+ &RMF_MGS_TARGET_NIDLIST,
+};
+
#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 18, 53, 0)
static const struct req_msg_field *mgs_set_info[] = {
&RMF_PTLRPC_BODY,
&RQF_OBD_IDX_READ,
&RQF_SEC_CTX,
&RQF_MGS_TARGET_REG,
+ &RQF_MGS_TARGET_REG_NIDLIST,
#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 18, 53, 0)
&RQF_MGS_SET_INFO,
#endif
lustre_swab_mgs_target_info, NULL);
EXPORT_SYMBOL(RMF_MGS_TARGET_INFO);
+struct req_msg_field RMF_MGS_TARGET_NIDLIST =
+ DEFINE_MSGF("mgs_target_nidlist", 0, sizeof(struct mgs_target_nidlist),
+ lustre_swab_mgs_target_nidlist, NULL);
+EXPORT_SYMBOL(RMF_MGS_TARGET_NIDLIST);
+
#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 18, 53, 0)
struct req_msg_field RMF_MGS_SEND_PARAM =
DEFINE_MSGF("mgs_send_param", 0,
mgs_target_info_only);
EXPORT_SYMBOL(RQF_MGS_TARGET_REG);
+struct req_format RQF_MGS_TARGET_REG_NIDLIST =
+ DEFINE_REQ_FMT0("MGS_TARGET_REG_NIDLIST", mgs_target_info_nidlist,
+ mgs_target_info_only);
+EXPORT_SYMBOL(RQF_MGS_TARGET_REG_NIDLIST);
+
#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 18, 53, 0)
struct req_format RQF_MGS_SET_INFO =
DEFINE_REQ_FMT0("MGS_SET_INFO", mgs_set_info,
__swab64s(&mti->mti_nids[i]);
}
+void lustre_swab_mgs_target_nidlist(struct mgs_target_nidlist *mtn)
+{
+ __swab32s(&mtn->mtn_flags);
+ __swab32s(&mtn->mtn_nids);
+ BUILD_BUG_ON(MTN_NIDSTR_SIZE != 64);
+}
+
void lustre_swab_mgs_nidtbl_entry_header(struct mgs_nidtbl_entry *entry)
{
__swab64s(&entry->mne_version);
OBD_CONNECT_SRVLOCK);
LASSERTF(OBD_CONNECT_VERSION == 0x20ULL, "found 0x%.16llxULL\n",
OBD_CONNECT_VERSION);
- LASSERTF(OBD_CONNECT_REQPORTAL == 0x40ULL, "found 0x%.16llxULL\n",
- OBD_CONNECT_REQPORTAL);
+ LASSERTF(OBD_CONNECT_MGS_NIDLIST == 0x40ULL, "found 0x%.16llxULL\n",
+ OBD_CONNECT_MGS_NIDLIST);
LASSERTF(OBD_CONNECT_ACL == 0x80ULL, "found 0x%.16llxULL\n",
OBD_CONNECT_ACL);
LASSERTF(OBD_CONNECT_XATTR == 0x100ULL, "found 0x%.16llxULL\n",
LASSERTF((int)sizeof(((struct mgs_target_info *)0)->mti_nidlist[0]) == 64, "found %lld\n",
(long long)(int)sizeof(((struct mgs_target_info *)0)->mti_nidlist[0]));
+ /* Checks for struct mgs_target_nidlist */
+ LASSERTF((int)sizeof(struct mgs_target_nidlist) == 8, "found %lld\n",
+ (long long)(int)sizeof(struct mgs_target_nidlist));
+ LASSERTF((int)offsetof(struct mgs_target_nidlist, mtn_flags) == 0, "found %lld\n",
+ (long long)(int)offsetof(struct mgs_target_nidlist, mtn_flags));
+ LASSERTF((int)sizeof(((struct mgs_target_nidlist *)0)->mtn_flags) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct mgs_target_nidlist *)0)->mtn_flags));
+ LASSERTF((int)offsetof(struct mgs_target_nidlist, mtn_nids) == 4, "found %lld\n",
+ (long long)(int)offsetof(struct mgs_target_nidlist, mtn_nids));
+ LASSERTF((int)sizeof(((struct mgs_target_nidlist *)0)->mtn_nids) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct mgs_target_nidlist *)0)->mtn_nids));
+ LASSERTF((int)offsetof(struct mgs_target_nidlist, mtn_inline_list[0]) == 8, "found %lld\n",
+ (long long)(int)offsetof(struct mgs_target_nidlist, mtn_inline_list[0]));
+ LASSERTF((int)sizeof(((struct mgs_target_nidlist *)0)->mtn_inline_list[0]) == 64, "found %lld\n",
+ (long long)(int)sizeof(((struct mgs_target_nidlist *)0)->mtn_inline_list[0]));
+ BUILD_BUG_ON(NIDLIST_APPEND != 0x00000001);
+ BUILD_BUG_ON(NIDLIST_IN_BULK != 0x00000002);
+ BUILD_BUG_ON(NIDLIST_COMPRESSED != 0x00000004);
+
/* Checks for struct mgs_nidtbl_entry */
LASSERTF((int)sizeof(struct mgs_nidtbl_entry) == 24, "found %lld\n",
(long long)(int)sizeof(struct mgs_nidtbl_entry));
CHECK_DEFINE_64X(OBD_CONNECT_GRANT);
CHECK_DEFINE_64X(OBD_CONNECT_SRVLOCK);
CHECK_DEFINE_64X(OBD_CONNECT_VERSION);
- CHECK_DEFINE_64X(OBD_CONNECT_REQPORTAL);
+ CHECK_DEFINE_64X(OBD_CONNECT_MGS_NIDLIST);
CHECK_DEFINE_64X(OBD_CONNECT_ACL);
CHECK_DEFINE_64X(OBD_CONNECT_XATTR);
CHECK_DEFINE_64X(OBD_CONNECT_LARGE_ACL);
}
static void
+check_mgs_target_nidlist(void)
+{
+ BLANK_LINE();
+ CHECK_STRUCT(mgs_target_nidlist);
+ CHECK_MEMBER(mgs_target_nidlist, mtn_flags);
+ CHECK_MEMBER(mgs_target_nidlist, mtn_nids);
+ CHECK_MEMBER(mgs_target_nidlist, mtn_inline_list[0]);
+
+ CHECK_CVALUE_X(NIDLIST_APPEND);
+ CHECK_CVALUE_X(NIDLIST_IN_BULK);
+ CHECK_CVALUE_X(NIDLIST_COMPRESSED);
+}
+
+static void
check_mgs_nidtbl_entry(void)
{
BLANK_LINE();
check_quota_body();
#endif /* !HAVE_NATIVE_LINUX_CLIENT */
check_mgs_target_info();
+ check_mgs_target_nidlist();
check_mgs_nidtbl_entry();
check_mgs_config_body();
check_mgs_config_res();
OBD_CONNECT_SRVLOCK);
LASSERTF(OBD_CONNECT_VERSION == 0x20ULL, "found 0x%.16llxULL\n",
OBD_CONNECT_VERSION);
- LASSERTF(OBD_CONNECT_REQPORTAL == 0x40ULL, "found 0x%.16llxULL\n",
- OBD_CONNECT_REQPORTAL);
+ LASSERTF(OBD_CONNECT_MGS_NIDLIST == 0x40ULL, "found 0x%.16llxULL\n",
+ OBD_CONNECT_MGS_NIDLIST);
LASSERTF(OBD_CONNECT_ACL == 0x80ULL, "found 0x%.16llxULL\n",
OBD_CONNECT_ACL);
LASSERTF(OBD_CONNECT_XATTR == 0x100ULL, "found 0x%.16llxULL\n",
(long long)(int)sizeof(((struct mgs_target_info *)0)->mti_nidlist[0]));
#endif /* HAVE_SERVER_SUPPORT */
+ /* Checks for struct mgs_target_nidlist */
+ LASSERTF((int)sizeof(struct mgs_target_nidlist) == 8, "found %lld\n",
+ (long long)(int)sizeof(struct mgs_target_nidlist));
+ LASSERTF((int)offsetof(struct mgs_target_nidlist, mtn_flags) == 0, "found %lld\n",
+ (long long)(int)offsetof(struct mgs_target_nidlist, mtn_flags));
+ LASSERTF((int)sizeof(((struct mgs_target_nidlist *)0)->mtn_flags) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct mgs_target_nidlist *)0)->mtn_flags));
+ LASSERTF((int)offsetof(struct mgs_target_nidlist, mtn_nids) == 4, "found %lld\n",
+ (long long)(int)offsetof(struct mgs_target_nidlist, mtn_nids));
+ LASSERTF((int)sizeof(((struct mgs_target_nidlist *)0)->mtn_nids) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct mgs_target_nidlist *)0)->mtn_nids));
+ LASSERTF((int)offsetof(struct mgs_target_nidlist, mtn_inline_list[0]) == 8, "found %lld\n",
+ (long long)(int)offsetof(struct mgs_target_nidlist, mtn_inline_list[0]));
+ LASSERTF((int)sizeof(((struct mgs_target_nidlist *)0)->mtn_inline_list[0]) == 64, "found %lld\n",
+ (long long)(int)sizeof(((struct mgs_target_nidlist *)0)->mtn_inline_list[0]));
+ BUILD_BUG_ON(NIDLIST_APPEND != 0x00000001);
+ BUILD_BUG_ON(NIDLIST_IN_BULK != 0x00000002);
+ BUILD_BUG_ON(NIDLIST_COMPRESSED != 0x00000004);
+
/* Checks for struct mgs_nidtbl_entry */
LASSERTF((int)sizeof(struct mgs_nidtbl_entry) == 24, "found %lld\n",
(long long)(int)sizeof(struct mgs_nidtbl_entry));