]) # LIBCFS_LOCKDEP_IS_HELD
#
+# LIBCFS_BITMAP_TO_ARR32
+#
+# Kernel commit v4.15-10794-gc724f19 introduced
+# bitmap_{from,to}_arr32, which are handy functions, to move
+# data back and forth between a bitmap and a u32 array
+#
+AC_DEFUN([LIBCFS_SRC_BITMAP_TO_ARR32], [
+ LB2_LINUX_TEST_SRC([bitmap_to_arr32], [
+ #include <linux/bitmap.h>
+ ],[
+ bitmap_to_arr32(NULL, NULL, 0);
+ ],[-Werror])
+])
+AC_DEFUN([LIBCFS_BITMAP_TO_ARR32], [
+ AC_MSG_CHECKING([if 'bitmap_to_arr32()' exist])
+ LB2_LINUX_TEST_RESULT([bitmap_to_arr32], [
+ AC_DEFINE(HAVE_BITMAP_TO_ARR32, 1,
+ [bitmap_to_arr32() exist])
+ ])
+]) # LIBCFS_BITMAP_TO_ARR32
+
+#
# LIBCFS_TIMER_SETUP
#
# Kernel version 4.15 commit e99e88a9d2b067465adaa9c111ada99a041bef9a
LIBCFS_SRC_NEW_KERNEL_READ
# 4.15
LIBCFS_SRC_LOCKDEP_IS_HELD
+ LIBCFS_SRC_BITMAP_TO_ARR32
LIBCFS_SRC_TIMER_SETUP
# 4.16
LIBCFS_SRC_HAVE_NS_TO_TIMESPEC64
LIBCFS_NEW_KERNEL_READ
# 4.15
LIBCFS_LOCKDEP_IS_HELD
+ LIBCFS_BITMAP_TO_ARR32
LIBCFS_TIMER_SETUP
# 4.16
LIBCFS_HAVE_NS_TO_TIMESPEC64
#define strscpy(s1, s2, sz) strlcpy((s1), (s2), (sz))
#endif
+#ifndef HAVE_BITMAP_TO_ARR32
+void bitmap_to_arr32(u32 *buf, const unsigned long *bitmap, unsigned int nbits);
+#endif
+
#ifndef HAVE_KOBJ_TYPE_DEFAULT_GROUPS
#define default_groups default_attrs
#define KOBJ_ATTR_GROUPS(_name) _name##_attrs
EXPORT_SYMBOL(match_wildcard);
#endif /* !HAVE_MATCH_WILDCARD */
+#ifndef HAVE_BITMAP_TO_ARR32
+/**
+ * bitmap_to_arr32 - copy the contents of bitmap to a u32 array of bits
+ * @buf: array of u32 (in host byte order), the dest bitmap
+ * @bitmap: array of unsigned longs, the source bitmap
+ * @nbits: number of bits in @bitmap
+ */
+void bitmap_to_arr32(u32 *buf, const unsigned long *bitmap, unsigned int nbits)
+{
+ unsigned int i, halfwords;
+
+ halfwords = DIV_ROUND_UP(nbits, 32);
+ for (i = 0; i < halfwords; i++) {
+ buf[i] = (u32) (bitmap[i/2] & UINT_MAX);
+ if (++i < halfwords)
+ buf[i] = (u32) (bitmap[i/2] >> 32);
+ }
+
+ /* Clear tail bits in last element of array beyond nbits. */
+ if (nbits % BITS_PER_LONG)
+ buf[halfwords - 1] &= (u32) (UINT_MAX >> ((-nbits) & 31));
+}
+EXPORT_SYMBOL(bitmap_to_arr32);
+#endif /* !HAVE_BITMAP_TO_ARR32 */
+
#ifndef HAVE_KSTRTOBOOL_FROM_USER
int kstrtobool_from_user(const char __user *s, size_t count, bool *res)
{
#define LMD_MAGIC 0xbdacbd03
#define LMD_PARAMS_MAXLEN 4096
+enum lmd_flags {
+ LMD_FLG_SERVER = 0, /* Mounting a server */
+ LMD_FLG_CLIENT, /* Mounting a client */
+ LMD_FLG_SKIP_LFSCK, /* NOT auto resume LFSCK when mount */
+ LMD_FLG_ABORT_RECOV, /* Abort recovery */
+ LMD_FLG_NOSVC, /* Only start MGS/MGC for servers,
+ * no other services
+ */
+ LMD_FLG_NOMGS, /* Only start target for servers,
+ * reusing existing MGS services
+ */
+ LMD_FLG_WRITECONF, /* Rewrite config log */
+ LMD_FLG_NOIR, /* NO imperative recovery */
+ LMD_FLG_NOSCRUB, /* Do not trigger scrub automatically */
+ LMD_FLG_MGS, /* Also start MGS along with server */
+ LMD_FLG_IAM, /* IAM dir */
+ LMD_FLG_NO_PRIMNODE, /* all nodes are service nodes */
+ LMD_FLG_VIRGIN, /* the service registers first time */
+ LMD_FLG_UPDATE, /* update parameters */
+ LMD_FLG_HSM, /* Start coordinator */
+ LMD_FLG_DEV_RDONLY, /* discard modification quitely */
+ LMD_FLG_NO_PRECREATE, /* do not allow OST object creation */
+ LMD_FLG_LOCAL_RECOV, /* force recovery for local clients */
+ LMD_FLG_ABORT_RECOV_MDT, /* Abort recovery between MDTs */
+ LMD_FLG_NO_LOCAL_LOGS, /* Use config logs from MGS */
+ LMD_FLG_NUM_FLAGS
+};
+
/* gleaned from the mount command - no persistent info here */
struct lustre_mount_data {
u32 lmd_magic;
- u32 lmd_flags; /* lustre mount flags */
+ DECLARE_BITMAP(lmd_flags, LMD_FLG_NUM_FLAGS); /* lustre mount flags */
int lmd_mgs_failnodes; /* mgs failover node count */
int lmd_exclude_count;
int lmd_recovery_time_soft;
char *lmd_nidnet; /* network to restrict this client to */
};
-#define LMD_FLG_SERVER 0x0001 /* Mounting a server */
-#define LMD_FLG_CLIENT 0x0002 /* Mounting a client */
-#define LMD_FLG_SKIP_LFSCK 0x0004 /* NOT auto resume LFSCK when mount */
-#define LMD_FLG_ABORT_RECOV 0x0008 /* Abort recovery */
-#define LMD_FLG_NOSVC 0x0010 /* Only start MGS/MGC for servers,
- no other services */
-#define LMD_FLG_NOMGS 0x0020 /* Only start target for servers, reusing
- existing MGS services */
-#define LMD_FLG_WRITECONF 0x0040 /* Rewrite config log */
-#define LMD_FLG_NOIR 0x0080 /* NO imperative recovery */
-#define LMD_FLG_NOSCRUB 0x0100 /* Do not trigger scrub automatically */
-#define LMD_FLG_MGS 0x0200 /* Also start MGS along with server */
-#define LMD_FLG_IAM 0x0400 /* IAM dir */
-#define LMD_FLG_NO_PRIMNODE 0x0800 /* all nodes are service nodes */
-#define LMD_FLG_VIRGIN 0x1000 /* the service registers first time */
-#define LMD_FLG_UPDATE 0x2000 /* update parameters */
-#define LMD_FLG_HSM 0x4000 /* Start coordinator */
-#define LMD_FLG_DEV_RDONLY 0x8000 /* discard modification quitely */
-#define LMD_FLG_NO_PRECREATE 0x10000 /* do not allow OST object creation */
-#define LMD_FLG_LOCAL_RECOV 0x20000 /* force recovery for local clients */
-#define LMD_FLG_ABORT_RECOV_MDT 0x40000 /* Abort recovery between MDTs */
-#define LMD_FLG_NO_LOCAL_LOGS 0x80000 /* Use config logs from MGS */
-
-#define lmd_is_client(x) ((x)->lmd_flags & LMD_FLG_CLIENT)
+#define lmd_is_client(x) (test_bit(LMD_FLG_CLIENT, (x)->lmd_flags))
/****************** superblock additional info *********************/
struct ll_sb_info;
RETURN(rc);
obd_obt_init(obd);
- if (lsi->lsi_lmd->lmd_flags & LMD_FLG_SKIP_LFSCK)
+ if (test_bit(LMD_FLG_SKIP_LFSCK, lsi->lsi_lmd->lmd_flags))
m->mdt_skip_lfsck = 1;
}
if (ldlm_timeout == LDLM_TIMEOUT_DEFAULT)
ldlm_timeout = MDS_LDLM_TIMEOUT_DEFAULT;
- if ((lsi->lsi_lmd->lmd_flags & LMD_FLG_LOCAL_RECOV))
+ if (test_bit(LMD_FLG_LOCAL_RECOV, lsi->lsi_lmd->lmd_flags))
m->mdt_lut.lut_local_recovery = 1;
rc = mdt_restriper_start(m);
}
LASSERT(lsi->lsi_lmd);
- if (!(lsi->lsi_lmd->lmd_flags & LMD_FLG_NOIR) &&
+ if (!test_bit(LMD_FLG_NOIR, lsi->lsi_lmd->lmd_flags) &&
cfg->cfg_sub_clds & CONFIG_SUB_RECOVER) {
struct config_llog_data *recover_cld;
if (lmd_is_client(lsi->lsi_lmd)) {
int has_ir;
int vallen = sizeof(*data);
- __u32 *flags = &lsi->lsi_lmd->lmd_flags;
rc = obd_get_info(NULL, obd->obd_self_export,
strlen(KEY_CONN_DATA), KEY_CONN_DATA,
&vallen, data);
LASSERT(rc == 0);
has_ir = OCD_HAS_FLAG(data, IMP_RECOV);
- if (has_ir ^ !(*flags & LMD_FLG_NOIR)) {
+ if (has_ir ^ !test_bit(LMD_FLG_NOIR,
+ lsi->lsi_lmd->lmd_flags)) {
/* LMD_FLG_NOIR is for test purpose only */
LCONSOLE_WARN(
"Mounting client with IR setting not compatible with current MGC. Using MGC setting that is IR %s",
has_ir ? "enabled" : "disabled");
- if (has_ir)
- *flags &= ~LMD_FLG_NOIR;
- else
- *flags |= LMD_FLG_NOIR;
+ if (has_ir) {
+ clear_bit(LMD_FLG_NOIR,
+ lsi->lsi_lmd->lmd_flags);
+ } else {
+ set_bit(LMD_FLG_NOIR,
+ lsi->lsi_lmd->lmd_flags);
+ }
}
}
data->ocd_connect_flags2 = OBD_CONNECT2_REP_MBITS;
if (lmd_is_client(lsi->lsi_lmd) &&
- lsi->lsi_lmd->lmd_flags & LMD_FLG_NOIR)
+ test_bit(LMD_FLG_NOIR, lsi->lsi_lmd->lmd_flags))
data->ocd_connect_flags &= ~OBD_CONNECT_IMP_RECOV;
data->ocd_version = LUSTRE_VERSION_CODE;
rc = obd_connect(NULL, &exp, obd, uuid, data, NULL);
if (lmd_is_client(lmd))
PRINT_CMD(D_MOUNT, "profile: %s\n", lmd->lmd_profile);
PRINT_CMD(D_MOUNT, "device: %s\n", lmd->lmd_dev);
- PRINT_CMD(D_MOUNT, "flags: %x\n", lmd->lmd_flags);
if (lmd->lmd_opts)
PRINT_CMD(D_MOUNT, "options: %s\n", lmd->lmd_opts);
*/
if (!strncmp(s1, "abort_recov_mdt", 15) ||
!strncmp(s1, "abort_recovery_mdt", 18)) {
- lmd->lmd_flags |= LMD_FLG_ABORT_RECOV_MDT;
+ set_bit(LMD_FLG_ABORT_RECOV_MDT, lmd->lmd_flags);
clear++;
} else if (strncmp(s1, "abort_recov", 11) == 0) {
- lmd->lmd_flags |= LMD_FLG_ABORT_RECOV;
+ set_bit(LMD_FLG_ABORT_RECOV, lmd->lmd_flags);
clear++;
} else if (strncmp(s1, "recovery_time_soft=", 19) == 0) {
lmd->lmd_recovery_time_soft =
time_min);
clear++;
} else if (strncmp(s1, "no_precreate", 12) == 0) {
- lmd->lmd_flags |= LMD_FLG_NO_PRECREATE;
+ set_bit(LMD_FLG_NO_PRECREATE, lmd->lmd_flags);
clear++;
- } else if (strncmp(s1, "noir", 4) == 0) {
- lmd->lmd_flags |= LMD_FLG_NOIR; /* test purpose only. */
+ } else if (strncmp(s1, "noir", 4) == 0) { /* test case only */
+ set_bit(LMD_FLG_NOIR, lmd->lmd_flags);
clear++;
} else if (strncmp(s1, "nosvc", 5) == 0) {
- lmd->lmd_flags |= LMD_FLG_NOSVC;
+ set_bit(LMD_FLG_NOSVC, lmd->lmd_flags);
clear++;
} else if (strncmp(s1, "nomgs", 5) == 0) {
- lmd->lmd_flags |= LMD_FLG_NOMGS;
+ set_bit(LMD_FLG_NOMGS, lmd->lmd_flags);
clear++;
} else if (strncmp(s1, "noscrub", 7) == 0) {
- lmd->lmd_flags |= LMD_FLG_NOSCRUB;
+ set_bit(LMD_FLG_NOSCRUB, lmd->lmd_flags);
clear++;
} else if (strncmp(s1, "skip_lfsck", 10) == 0) {
- lmd->lmd_flags |= LMD_FLG_SKIP_LFSCK;
+ set_bit(LMD_FLG_SKIP_LFSCK, lmd->lmd_flags);
clear++;
} else if (strncmp(s1, "rdonly_dev", 10) == 0) {
- lmd->lmd_flags |= LMD_FLG_DEV_RDONLY;
+ set_bit(LMD_FLG_DEV_RDONLY, lmd->lmd_flags);
clear++;
} else if (strncmp(s1, PARAM_MGSNODE,
sizeof(PARAM_MGSNODE) - 1) == 0) {
s3 = s2;
clear++;
} else if (strncmp(s1, "writeconf", 9) == 0) {
- lmd->lmd_flags |= LMD_FLG_WRITECONF;
+ set_bit(LMD_FLG_WRITECONF, lmd->lmd_flags);
clear++;
} else if (strncmp(s1, "nolocallogs", 11) == 0) {
- lmd->lmd_flags |= LMD_FLG_NO_LOCAL_LOGS;
+ set_bit(LMD_FLG_NO_LOCAL_LOGS, lmd->lmd_flags);
clear++;
} else if (strncmp(s1, "update", 6) == 0) {
- lmd->lmd_flags |= LMD_FLG_UPDATE;
+ set_bit(LMD_FLG_UPDATE, lmd->lmd_flags);
clear++;
} else if (strncmp(s1, "virgin", 6) == 0) {
- lmd->lmd_flags |= LMD_FLG_VIRGIN;
+ set_bit(LMD_FLG_VIRGIN, lmd->lmd_flags);
clear++;
} else if (strncmp(s1, "noprimnode", 10) == 0) {
- lmd->lmd_flags |= LMD_FLG_NO_PRIMNODE;
+ set_bit(LMD_FLG_NO_PRIMNODE, lmd->lmd_flags);
clear++;
} else if (strncmp(s1, "mgssec=", 7) == 0) {
rc = lmd_parse_mgssec(lmd, s1 + 7);
clear++;
} else if (strncmp(s1, "mgs", 3) == 0) {
/* We are an MGS */
- lmd->lmd_flags |= LMD_FLG_MGS;
+ set_bit(LMD_FLG_MGS, lmd->lmd_flags);
clear++;
} else if (strncmp(s1, "svname=", 7) == 0) {
rc = lmd_parse_string(&lmd->lmd_profile, s1 + 7);
s3 = s1 + 6 + length;
clear++;
} else if (strncmp(s1, "localrecov", 10) == 0) {
- lmd->lmd_flags |= LMD_FLG_LOCAL_RECOV;
+ set_bit(LMD_FLG_LOCAL_RECOV, lmd->lmd_flags);
clear++;
} else if (strncmp(s1, "osd=", 4) == 0) {
rc = lmd_parse_string(&lmd->lmd_osd_type, s1 + 4);
s1 = strstr(devname, ":/");
if (s1) {
++s1;
- lmd->lmd_flags |= LMD_FLG_CLIENT;
+ set_bit(LMD_FLG_CLIENT, lmd->lmd_flags);
/* Remove leading /s from fsname */
while (*++s1 == '/')
;
}
lmd_print(lmd);
- lmd->lmd_magic = LMD_MAGIC;
RETURN(rc);
*/
static int ofd_stack_init(const struct lu_env *env,
struct ofd_device *m, struct lustre_cfg *cfg,
- u32 *lmd_flags)
+ unsigned long *lmd_flags)
{
const char *dev = lustre_cfg_string(cfg, 0);
struct lu_device *d;
lmd = s2lsi(lmi->lmi_sb)->lsi_lmd;
if (lmd) {
- if (lmd->lmd_flags & LMD_FLG_SKIP_LFSCK)
+ if (test_bit(LMD_FLG_SKIP_LFSCK, lmd->lmd_flags))
m->ofd_skip_lfsck = 1;
- if (lmd->lmd_flags & LMD_FLG_NO_PRECREATE)
+ if (test_bit(LMD_FLG_NO_PRECREATE, lmd->lmd_flags))
m->ofd_no_precreate = 1;
- *lmd_flags = lmd->lmd_flags;
+ bitmap_copy(lmd_flags, lmd->lmd_flags, LMD_FLG_NUM_FLAGS);
}
/* find bottom osd */
struct ofd_thread_info *info = NULL;
struct obd_device *obd;
struct tg_grants_data *tgd = &m->ofd_lut.lut_tgd;
+ DECLARE_BITMAP(lmd_flags, LMD_FLG_NUM_FLAGS);
struct lu_fid fid;
struct nm_config_file *nodemap_config;
struct obd_device_target *obt;
- u32 lmd_flags = 0;
int rc;
ENTRY;
if (info == NULL)
RETURN(-EFAULT);
- rc = ofd_stack_init(env, m, cfg, &lmd_flags);
+ rc = ofd_stack_init(env, m, cfg, lmd_flags);
if (rc) {
CERROR("%s: can't init device stack, rc %d\n",
obd->obd_name, rc);
if (rc)
GOTO(err_free_ns, rc);
- if (lmd_flags & LMD_FLG_SKIP_LFSCK)
+ if (test_bit(LMD_FLG_SKIP_LFSCK, lmd_flags))
m->ofd_skip_lfsck = 1;
- if (lmd_flags & LMD_FLG_LOCAL_RECOV)
+ if (test_bit(LMD_FLG_LOCAL_RECOV, lmd_flags))
m->ofd_lut.lut_local_recovery = 1;
rc = ofd_tunables_init(m);
GOTO(out_mnt, rc = -EINVAL);
}
- if (lmd_flags & LMD_FLG_DEV_RDONLY) {
+ if (test_bit(LMD_FLG_DEV_RDONLY, &lmd_flags)) {
LCONSOLE_WARN("%s: not support dev_rdonly on this device\n",
name);
}
}
- if (lmd_flags & LMD_FLG_NOSCRUB)
+ if (test_bit(LMD_FLG_NOSCRUB, &lmd_flags))
o->od_scrub.os_scrub.os_auto_scrub_interval = AS_NEVER;
if (blk_queue_nonrot(bdev_get_queue(osd_sb(o)->s_bdev))) {
if (rc)
RETURN(-EINVAL);
- if (flags & LMD_FLG_DEV_RDONLY) {
+ if (test_bit(LMD_FLG_DEV_RDONLY, &flags)) {
o->od_dt_dev.dd_rdonly = 1;
LCONSOLE_WARN("%s: set dev_rdonly on this device\n",
svname);
}
- if (flags & LMD_FLG_NOSCRUB)
+ if (test_bit(LMD_FLG_NOSCRUB, &flags))
interval = AS_NEVER;
}
/* server use --servicenode param, only allow specified
* nids be registered
*/
- if ((lsi->lsi_lmd->lmd_flags & LMD_FLG_NO_PRIMNODE) != 0 &&
+ if (test_bit(LMD_FLG_NO_PRIMNODE, lsi->lsi_lmd->lmd_flags) &&
class_match_nid(lsi->lsi_lmd->lmd_params,
PARAM_FAILNODE, &id.nid) < 1)
continue;
/* abort recovery only on the complete stack:
* many devices can be involved
*/
- if ((lsi->lsi_lmd->lmd_flags &
- (LMD_FLG_ABORT_RECOV | LMD_FLG_ABORT_RECOV_MDT)) &&
+ if ((test_bit(LMD_FLG_ABORT_RECOV, lsi->lsi_lmd->lmd_flags) ||
+ (test_bit(LMD_FLG_ABORT_RECOV_MDT, lsi->lsi_lmd->lmd_flags))) &&
(OBP(obd, iocontrol))) {
- struct obd_ioctl_data karg = {
- .ioc_type = lsi->lsi_lmd->lmd_flags,
- };
+ struct obd_ioctl_data karg;
+
+ if (test_bit(LMD_FLG_ABORT_RECOV, lsi->lsi_lmd->lmd_flags))
+ karg.ioc_type = OBD_FLG_ABORT_RECOV_OST;
+ else
+ karg.ioc_type = OBD_FLG_ABORT_RECOV_MDT;
obd_iocontrol(OBD_IOC_ABORT_RECOVERY, obd->obd_self_export, 0,
&karg, NULL);
/* Determine server type */
rc = server_name2index(lsi->lsi_svname, &index, NULL);
if (rc < 0) {
- if (lsi->lsi_lmd->lmd_flags & LMD_FLG_MGS) {
+ if (test_bit(LMD_FLG_MGS, lsi->lsi_lmd->lmd_flags)) {
/* Assume we're a bare MGS */
rc = 0;
- lsi->lsi_lmd->lmd_flags |= LMD_FLG_NOSVC;
+ set_bit(LMD_FLG_NOSVC, lsi->lsi_lmd->lmd_flags);
} else {
LCONSOLE_ERROR("Can't determine server type of '%s'\n",
lsi->lsi_svname);
/* Add mount line flags that used to be in ldd:
* writeconf, mgs, anything else?
*/
- lsi->lsi_flags |= (lsi->lsi_lmd->lmd_flags & LMD_FLG_WRITECONF) ?
- LDD_F_WRITECONF : 0;
- lsi->lsi_flags |= (lsi->lsi_lmd->lmd_flags & LMD_FLG_NO_LOCAL_LOGS) ?
- LDD_F_NO_LOCAL_LOGS : 0;
- lsi->lsi_flags |= (lsi->lsi_lmd->lmd_flags & LMD_FLG_VIRGIN) ?
- LDD_F_VIRGIN : 0;
- lsi->lsi_flags |= (lsi->lsi_lmd->lmd_flags & LMD_FLG_UPDATE) ?
- LDD_F_UPDATE : 0;
- lsi->lsi_flags |= (lsi->lsi_lmd->lmd_flags & LMD_FLG_MGS) ?
- LDD_F_SV_TYPE_MGS : 0;
- lsi->lsi_flags |= (lsi->lsi_lmd->lmd_flags & LMD_FLG_NO_PRIMNODE) ?
- LDD_F_NO_PRIMNODE : 0;
+ lsi->lsi_flags |= test_bit(LMD_FLG_WRITECONF, lsi->lsi_lmd->lmd_flags) ?
+ LDD_F_WRITECONF : 0;
+ lsi->lsi_flags |= test_bit(LMD_FLG_NO_LOCAL_LOGS, lsi->lsi_lmd->lmd_flags) ?
+ LDD_F_NO_LOCAL_LOGS : 0;
+ lsi->lsi_flags |= test_bit(LMD_FLG_VIRGIN, lsi->lsi_lmd->lmd_flags) ?
+ LDD_F_VIRGIN : 0;
+ lsi->lsi_flags |= test_bit(LMD_FLG_UPDATE, lsi->lsi_lmd->lmd_flags) ?
+ LDD_F_UPDATE : 0;
+ lsi->lsi_flags |= test_bit(LMD_FLG_MGS, lsi->lsi_lmd->lmd_flags) ?
+ LDD_F_SV_TYPE_MGS : 0;
+ lsi->lsi_flags |= test_bit(LMD_FLG_NO_PRIMNODE, lsi->lsi_lmd->lmd_flags) ?
+ LDD_F_NO_PRIMNODE : 0;
RETURN(0);
}
OBD_ALLOC(tmpname, tmpname_sz);
memcpy(tmpname, lsi->lsi_svname, tmpname_sz);
CDEBUG(D_MOUNT, "server put_super %s\n", tmpname);
- if (IS_MDT(lsi) && (lsi->lsi_lmd->lmd_flags & LMD_FLG_NOSVC))
+ if (IS_MDT(lsi) && test_bit(LMD_FLG_NOSVC, lsi->lsi_lmd->lmd_flags))
snprintf(tmpname, tmpname_sz, "MGS");
/* disconnect the lwp first to drain off the inflight request */
}
/* Stop the target */
- if (!(lsi->lsi_lmd->lmd_flags & LMD_FLG_NOSVC) &&
+ if (!test_bit(LMD_FLG_NOSVC, lsi->lsi_lmd->lmd_flags) &&
(IS_MDT(lsi) || IS_OST(lsi))) {
struct lustre_profile *lprof = NULL;
lustre_stop_mgc(sb);
if (IS_MGS(lsi)) {
/* if MDS start with --nomgs, don't stop MGS then */
- if (!(lsi->lsi_lmd->lmd_flags & LMD_FLG_NOMGS))
+ if (!test_bit(LMD_FLG_NOMGS, lsi->lsi_lmd->lmd_flags))
server_stop_mgs(sb);
}
* Also, if server is mounted with "rdonly_dev"
* (LMD_FLG_DEV_RDONLY) then force flag to be 'ro'
*/
-
- if (!(lmd->lmd_flags & LMD_FLG_DEV_RDONLY) &&
+ if (!test_bit(LMD_FLG_DEV_RDONLY, lmd->lmd_flags) &&
!(osfs.os_state & OS_STATFS_READONLY))
sb->s_flags &= ~SB_RDONLY;
}
seq_printf(seq, ",svname=%s", lmd->lmd_profile);
- if (lmd->lmd_flags & LMD_FLG_ABORT_RECOV)
+ if (test_bit(LMD_FLG_ABORT_RECOV, lmd->lmd_flags))
seq_puts(seq, ",abort_recov");
- if (lmd->lmd_flags & LMD_FLG_NOIR)
+ if (test_bit(LMD_FLG_NOIR, lmd->lmd_flags))
seq_puts(seq, ",noir");
- if (lmd->lmd_flags & LMD_FLG_NOSVC)
+ if (test_bit(LMD_FLG_NOSVC, lmd->lmd_flags))
seq_puts(seq, ",nosvc");
- if (lmd->lmd_flags & LMD_FLG_NOMGS)
+ if (test_bit(LMD_FLG_NOMGS, lmd->lmd_flags))
seq_puts(seq, ",nomgs");
- if (lmd->lmd_flags & LMD_FLG_NOSCRUB)
+ if (test_bit(LMD_FLG_NOSCRUB, lmd->lmd_flags))
seq_puts(seq, ",noscrub");
- if (lmd->lmd_flags & LMD_FLG_SKIP_LFSCK)
+
+ if (test_bit(LMD_FLG_SKIP_LFSCK, lmd->lmd_flags))
seq_puts(seq, ",skip_lfsck");
- if (lmd->lmd_flags & LMD_FLG_DEV_RDONLY)
+ if (test_bit(LMD_FLG_DEV_RDONLY, lmd->lmd_flags))
seq_puts(seq, ",rdonly_dev");
- if (lmd->lmd_flags & LMD_FLG_MGS)
+ if (test_bit(LMD_FLG_MGS, lmd->lmd_flags))
seq_puts(seq, ",mgs");
if (lmd->lmd_mgs)
struct obd_device *obd;
struct dt_device_param p;
char flagstr[20 + 1 + 10 + 1];
+ u32 lmd_flags;
int rc;
ENTRY;
sprintf(lsi->lsi_osd_obdname, "%s-osd", lsi->lsi_svname);
strcpy(lsi->lsi_osd_uuid, lsi->lsi_osd_obdname);
strcat(lsi->lsi_osd_uuid, "_UUID");
- snprintf(flagstr, sizeof(flagstr), "%lu:%u", mflags, lmd->lmd_flags);
+ bitmap_to_arr32(&lmd_flags, lmd->lmd_flags, LMD_FLG_NUM_FLAGS);
+ snprintf(flagstr, sizeof(flagstr), "%lu:%u", mflags, lmd_flags);
obd = class_name2obd(lsi->lsi_osd_obdname);
if (!obd) {
/* but continue setup to allow special case of MDT and internal
* MGT being started separately.
*/
- if (!((IS_MGS(lsi) && (lsi->lsi_lmd->lmd_flags &
- LMD_FLG_NOMGS)) ||
- (IS_MDT(lsi) && (lsi->lsi_lmd->lmd_flags &
- LMD_FLG_NOSVC))))
+ if (!((IS_MGS(lsi) &&
+ test_bit(LMD_FLG_NOMGS, lsi->lsi_lmd->lmd_flags)) ||
+ (IS_MDT(lsi) &&
+ test_bit(LMD_FLG_NOSVC, lsi->lsi_lmd->lmd_flags))))
RETURN(-EALREADY);
}
}
/* Start MGS before MGC */
- if (IS_MGS(lsi) && !(lsi->lsi_lmd->lmd_flags & LMD_FLG_NOMGS)) {
+ if (IS_MGS(lsi) && !test_bit(LMD_FLG_NOMGS, lsi->lsi_lmd->lmd_flags)) {
rc = server_start_mgs(sb);
if (rc < 0)
GOTO(out_mnt, rc);
GOTO(out_mnt, rc);
/* Set up all obd devices for service */
- if (!(lsi->lsi_lmd->lmd_flags & LMD_FLG_NOSVC) &&
+ if (!test_bit(LMD_FLG_NOSVC, lsi->lsi_lmd->lmd_flags) &&
(IS_OST(lsi) || IS_MDT(lsi))) {
rc = server_start_targets(sb);
if (rc < 0) {
if (lmd) {
soft = lmd->lmd_recovery_time_soft;
hard = lmd->lmd_recovery_time_hard;
- has_ir = has_ir && !(lmd->lmd_flags & LMD_FLG_NOIR);
+ has_ir = has_ir && !test_bit(LMD_FLG_NOIR, lmd->lmd_flags);
obd->obd_no_ir = !has_ir;
}