Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LU-9679 modules: convert MIN/MAX to kernel style
[fs/lustre-release.git]
/
lustre
/
mgs
/
mgs_handler.c
diff --git
a/lustre/mgs/mgs_handler.c
b/lustre/mgs/mgs_handler.c
index
21587d2
..
e5603d5
100644
(file)
--- a/
lustre/mgs/mgs_handler.c
+++ b/
lustre/mgs/mgs_handler.c
@@
-270,7
+270,7
@@
void mgs_revoke_lock(struct mgs_device *mgs, struct fs_db *fsdb, int type)
if (!rc) {
LASSERT(cp != NULL);
if (!rc) {
LASSERT(cp != NULL);
- rc = ldlm_cli_enqueue_local(mgs->mgs_obd->obd_namespace,
+ rc = ldlm_cli_enqueue_local(
NULL,
mgs->mgs_obd->obd_namespace,
&res_id, LDLM_PLAIN, NULL, LCK_EX,
&flags, ldlm_blocking_ast, cp,
NULL, fsdb, 0, LVB_T_NONE, NULL,
&res_id, LDLM_PLAIN, NULL, LCK_EX,
&flags, ldlm_blocking_ast, cp,
NULL, fsdb, 0, LVB_T_NONE, NULL,
@@
-328,25
+328,23
@@
static int mgs_check_target(const struct lu_env *env,
/* Ensure this is not a failover node that is connecting first*/
static int mgs_check_failover_reg(struct mgs_target_info *mti)
{
/* Ensure this is not a failover node that is connecting first*/
static int mgs_check_failover_reg(struct mgs_target_info *mti)
{
-
lnet_nid_t nid;
-
char *ptr;
-
int i;
+ lnet_nid_t nid;
+ char *ptr;
+ int i;
-
ptr = mti->mti_params;
-
while (class_find_param(ptr, PARAM_FAILNODE, &ptr) == 0) {
+ ptr = mti->mti_params;
+ while (class_find_param(ptr, PARAM_FAILNODE, &ptr) == 0) {
while (class_parse_nid_quiet(ptr, &nid, &ptr) == 0) {
while (class_parse_nid_quiet(ptr, &nid, &ptr) == 0) {
- for (i = 0; i < mti->mti_nid_count; i++) {
- if (nid == mti->mti_nids[i]) {
- LCONSOLE_WARN("Denying initial registra"
- "tion attempt from nid %s"
- ", specified as failover"
- "\n",libcfs_nid2str(nid));
- return -EADDRNOTAVAIL;
- }
- }
- }
- }
- return 0;
+ for (i = 0; i < mti->mti_nid_count; i++) {
+ if (nid == mti->mti_nids[i]) {
+ LCONSOLE_WARN("Denying initial registration attempt from nid %s, specified as failover\n",
+ libcfs_nid2str(nid));
+ return -EADDRNOTAVAIL;
+ }
+ }
+ }
+ }
+ return 0;
}
/* Called whenever a target starts up. Flags indicate first connect, etc. */
}
/* Called whenever a target starts up. Flags indicate first connect, etc. */
@@
-742,7
+740,7
@@
static int mgs_extract_fs_pool(char *arg, char *fsname, char *poolname)
/* Also make sure poolname is not to long. */
if (strlen(ptr) > LOV_MAXPOOLNAME)
return -ENAMETOOLONG;
/* Also make sure poolname is not to long. */
if (strlen(ptr) > LOV_MAXPOOLNAME)
return -ENAMETOOLONG;
- strncpy(poolname, ptr,
strlen(ptr)
);
+ strncpy(poolname, ptr,
LOV_MAXPOOLNAME
);
/* Test if fsname is empty */
len = strlen(arg) - strlen(ptr) - 1;
/* Test if fsname is empty */
len = strlen(arg) - strlen(ptr) - 1;
@@
-822,7
+820,8
@@
static int mgs_iocontrol_nodemap(const struct lu_env *env,
nid = libcfs_str2nid(nidstr);
nodemap_test_nid(nid, name_buf, sizeof(name_buf));
rc = copy_to_user(data->ioc_pbuf1, name_buf,
nid = libcfs_str2nid(nidstr);
nodemap_test_nid(nid, name_buf, sizeof(name_buf));
rc = copy_to_user(data->ioc_pbuf1, name_buf,
- MIN(data->ioc_plen1, sizeof(name_buf)));
+ min_t(size_t, data->ioc_plen1,
+ sizeof(name_buf)));
if (rc != 0)
GOTO(out_lcfg, rc = -EFAULT);
break;
if (rc != 0)
GOTO(out_lcfg, rc = -EFAULT);
break;
@@
-862,6
+861,7
@@
static int mgs_iocontrol_nodemap(const struct lu_env *env,
case LCFG_NODEMAP_ADD_GIDMAP:
case LCFG_NODEMAP_DEL_GIDMAP:
case LCFG_NODEMAP_SET_FILESET:
case LCFG_NODEMAP_ADD_GIDMAP:
case LCFG_NODEMAP_DEL_GIDMAP:
case LCFG_NODEMAP_SET_FILESET:
+ case LCFG_NODEMAP_SET_SEPOL:
if (lcfg->lcfg_bufcount != 3)
GOTO(out_lcfg, rc = -EINVAL);
nodemap_name = lustre_cfg_string(lcfg, 1);
if (lcfg->lcfg_bufcount != 3)
GOTO(out_lcfg, rc = -EINVAL);
nodemap_name = lustre_cfg_string(lcfg, 1);
@@
-1202,11
+1202,11
@@
TGT_RPC_HANDLER(MGS_FIRST_OPC,
&RQF_MDS_DISCONNECT, LUSTRE_OBD_VERSION),
TGT_MGS_HDL_VAR(0, MGS_EXCEPTION, mgs_exception),
#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 13, 53, 0)
&RQF_MDS_DISCONNECT, LUSTRE_OBD_VERSION),
TGT_MGS_HDL_VAR(0, MGS_EXCEPTION, mgs_exception),
#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 13, 53, 0)
-TGT_MGS_HDL
(HABEO_REFERO | MUTABOR,
MGS_SET_INFO, mgs_set_info),
+TGT_MGS_HDL
(HAS_REPLY | IS_MUTABLE,
MGS_SET_INFO, mgs_set_info),
#endif
#endif
-TGT_MGS_HDL
(HABEO_REFERO | MUTABOR,
MGS_TARGET_REG, mgs_target_reg),
+TGT_MGS_HDL
(HAS_REPLY | IS_MUTABLE,
MGS_TARGET_REG, mgs_target_reg),
TGT_MGS_HDL_VAR(0, MGS_TARGET_DEL, mgs_target_del),
TGT_MGS_HDL_VAR(0, MGS_TARGET_DEL, mgs_target_del),
-TGT_MGS_HDL
(HABEO_REFERO,
MGS_CONFIG_READ, mgs_config_read),
+TGT_MGS_HDL
(HAS_REPLY,
MGS_CONFIG_READ, mgs_config_read),
};
static struct tgt_handler mgs_obd_handlers[] = {
};
static struct tgt_handler mgs_obd_handlers[] = {
@@
-1223,7
+1223,7
@@
static struct tgt_handler mgs_dlm_handlers[] = {
* * instead of common OBD_FAIL_LDLM_ENQUEUE_NET */
.th_fail_id = 0,
.th_opc = LDLM_ENQUEUE,
* * instead of common OBD_FAIL_LDLM_ENQUEUE_NET */
.th_fail_id = 0,
.th_opc = LDLM_ENQUEUE,
- .th_flags = HA
BEO_CLAVIS
,
+ .th_flags = HA
S_KEY
,
.th_act = tgt_enqueue,
.th_fmt = &RQF_LDLM_ENQUEUE,
.th_version = LUSTRE_DLM_VERSION,
.th_act = tgt_enqueue,
.th_fmt = &RQF_LDLM_ENQUEUE,
.th_version = LUSTRE_DLM_VERSION,
@@
-1733,7
+1733,7
@@
static int mgs_health_check(const struct lu_env *env, struct obd_device *obd)
}
/* use obd ops to offer management infrastructure */
}
/* use obd ops to offer management infrastructure */
-static struct obd_ops mgs_obd_device_ops = {
+static
const
struct obd_ops mgs_obd_device_ops = {
.o_owner = THIS_MODULE,
.o_connect = mgs_obd_connect,
.o_reconnect = mgs_obd_reconnect,
.o_owner = THIS_MODULE,
.o_connect = mgs_obd_connect,
.o_reconnect = mgs_obd_reconnect,