struct lustre_sb_info {
int lsi_flags;
//struct lvfs_run_ctxt lsi_ctxt; /* mount context */
- struct obd_device *lsi_mgc; /* mgmt cli obd */
+ struct obd_device *lsi_mgc; /* mgc obd */
struct lustre_mount_data *lsi_lmd; /* mount command info */
struct lustre_disk_data *lsi_ldd; /* mount info on-disk */
//struct fsfilt_operations *lsi_fsops;
int cl_qchk_stat; /* quotacheck stat of the peer */
};
-struct mgs_server_data;
-
/*a light client obd for mount-conf */
struct mgc_obd {
- struct obd_import *cl_import;
- struct semaphore cl_sem;
- int cl_conn_count;
- struct mgc_rpc_lock *cl_rpc_lock;
-}
+ struct obd_import *mgc_import;
+ struct semaphore mgc_sem;
+ int mgc_conn_count;
+ struct mgc_rpc_lock *mgc_rpc_lock;
+ struct vfsmount *mgc_vfsmnt; /* for local config dirs */
+ struct super_block *mgc_sb;
+ struct file *mgc_rcvd_filp;
+ struct dentry *mgc_configs_dir;
+};
struct mgs_obd {
struct ptlrpc_service *mgs_service;
struct vfsmount *mgs_vfsmnt;
struct super_block *mgs_sb;
- spinlock_t mgs_transno_lock;
- __u64 mgs_last_transno;
- struct mgs_server_data *mgs_server_data;
struct dentry *mgs_configs_dir;
struct llog_handle *mgs_cfg_llh;
- char *mgs_profile;
- unsigned long *mgs_client_bitmap;
- struct semaphore mgs_orphan_recovery_sem;
-};
-
-/* Like a client, with some hangers-on. Keep mc_client_obd first so that we
- * can reuse the various client setup/connect functions. */
-struct mgmtcli_obd {
- /* from confobd */
- struct super_block *mc_sb; /* from mount */
- struct vfsmount *mc_vfsmnt; /* local mount */
- struct dentry *mc_configs_dir;
- struct llog_handle *mc_cfg_llh;
- //struct logs_info mc_logs_info;
- struct list_head mc_registered; /* chain of mgc's */
};
-#define mc_import mc_client_obd.cl_import
-
struct mds_obd {
struct ptlrpc_service *mds_service;
struct ptlrpc_service *mds_setattr_service;
struct lov_obd lov;
struct cache_obd cobd;
struct ptlbd_obd ptlbd;
- struct mgmtcli_obd mgmtcli;
struct mgc_obd mgc;
struct mgs_obd mgs;
} u;
LASSERT(offsetof(struct mds_client_data, mcd_padding) +
sizeof(mcd->mcd_padding) == MDS_LR_CLIENT_SIZE);
LASSERT(MDS_LR_CLIENT_SIZE == LR_CLIENT_SIZE);
- LASSERT(MDS_LR_CLIENT_START == LR_CLIENT_SIZE);
+ LASSERT(MDS_LR_CLIENT_START == LR_CLIENT_START);
OBD_ALLOC_WAIT(lsd, sizeof(*lsd));
if (!lsd)
}
if (lsd->lsd_feature_compat & ~cpu_to_le32(LR_COMPAT_COMMON_LR)) {
- struct mds_server_data *msd;
CERROR("old last_rcvd format, updating\n");
- msd = (struct mds_server_data *)lsd;
- /* careful ordering */
- lsd->lsd_mount_count = msd->msd_mount_count;
- lsd->lsd_last_transno = msd->msd_last_transno;
+ lsd->lsd_mount_count = lsd->lsd_last_transno; //msd->msd_mount_count
+ lsd->lsd_last_transno = lsd->lsd_unused; //msd->msd_last_transno;
lsd->lsd_feature_compat |= cpu_to_le32(LR_COMPAT_COMMON_LR);
GOTO(err_msd, rc = -EINVAL);
}
(last_rcvd_size - le32_to_cpu(lsd->lsd_client_start)) /
le16_to_cpu(lsd->lsd_client_size));
+ if (!lsd->lsd_server_size || !lsd->lsd_client_start ||
+ !lsd->lsd_client_size) {
+ CERROR("Bad last_rcvd contents!\n");
+ GOTO(err_msd, rc = -EINVAL);
+ }
+
/* When we do a clean MDS shutdown, we save the last_transno into
* the header. If we find clients with higher last_transno values
* then those clients may need recovery done. */
// FIXME this should be called from lov_add_obd?
#if 0
- if (mcobd->cfobd_logs_info.ost_number > 0) {
+ if (mgcobd->cfobd_logs_info.ost_number > 0) {
struct obd_ioctl_data ioc_data = { 0 };
CERROR("update new logs.\n");
err = obd_iocontrol(OBD_IOC_UPDATE_LOG, obd->obd_self_export,
struct lustre_sb_info *sbi = s2sbi(sb);
struct l_linux_dirent *dirent, *n;
struct obd_device *obd;
- struct mgmtcli_obd *mcobd;
+ struct mgc_obd *mgcobd;
char flags[2] = "";
int err;
obd = sbi->lsi_mgc;
CERROR("server put_super %s\n", obd->obd_name);
- mcobd = &obd->u.mgmtcli;
+ mgcobd = &obd->u.mgc;
lustre_update_llog(obd);
*/
/* Find all the logs in the CONFIGS directory */
- err = dentry_readdir(obd, mcobd->mc_configs_dir,
- mcobd->mc_vfsmnt, &dentry_list);
+ err = dentry_readdir(obd, mgcobd->mgc_configs_dir,
+ mgcobd->mgc_vfsmnt, &dentry_list);
if (err)
CERROR("Can't read LOGS dir, %d\n", err);
struct list_head dentry_list;
struct l_linux_dirent *dirent, *n;
struct obd_device *obd;
- struct mgmtcli_obd *mcobd;
+ struct mgc_obd *mgcobd;
struct lustre_sb_info *sbi = s2sbi(sb);
int is_first_mount = 0;
int err;
obd = sbi->lsi_mgc;
LASSERT(obd);
- mcobd = &obd->u.mgmtcli;
+ mgcobd = &obd->u.mgc;
err = parse_last_rcvd(obd, lr_uuid, &is_first_mount);
if (err) {
CERROR("Can't read %s\n", STRIPE_FILE);
return(err);
}
- mcobd_start_accept(obd, lmd, lr_uuid, stripe_size);
+ mgcobd_start_accept(obd, lmd, lr_uuid, stripe_size);
#endif
}
/* Find all the logs in the CONFIGS directory */
- err = dentry_readdir(obd, mcobd->mc_configs_dir,
- mcobd->mc_vfsmnt, &dentry_list);
+ err = dentry_readdir(obd, mgcobd->mgc_configs_dir,
+ mgcobd->mgc_vfsmnt, &dentry_list);
if (err) {
CERROR("Can't read LOGS dir\n");
return(err);
struct lustre_disk_data *ldd;
struct lustre_mount_data *lmd = sbi->lsi_lmd;
struct obd_device *obd;
- struct mgmtcli_obd *mcobd;
+ struct mgc_obd *mgcobd;
char *options = NULL;
struct vfsmount *mnt;
unsigned long page;
}
obd = sbi->lsi_mgc;
- mcobd = &obd->u.mgmtcli;
- mcobd->mc_vfsmnt = mnt;
- mcobd->mc_sb = mnt->mnt_root->d_inode->i_sb; // is this different than sb? */
- fsfilt_setup(obd, mcobd->mc_sb);
+ mgcobd = &obd->u.mgc;
+ mgcobd->mgc_vfsmnt = mnt;
+ mgcobd->mgc_sb = mnt->mnt_root->d_inode->i_sb; // is this different than sb? */
+ fsfilt_setup(obd, mgcobd->mgc_sb);
OBD_SET_CTXT_MAGIC(&obd->obd_lvfs_ctxt);
obd->obd_lvfs_ctxt.pwdmnt = mnt;
return (err);
}
-/* Set up a mcobd to process startup logs */
+/* Set up a mgcobd to process startup logs */
static int lustre_start_mgc(struct super_block *sb)
{
struct config_llog_instance cfg;
err = do_lcfg(mcname, 0, LCFG_SETUP, 0, 0, 0, 0);
if (err) {
- CERROR("mcobd setup error %d\n", err);
+ CERROR("mgcobd setup error %d\n", err);
do_lcfg(mcname, 0, LCFG_DETACH, 0, 0, 0, 0);
goto out_free;
}
obd = class_name2obd(mcname);
if (!obd) {
- CERROR("Can't find mcobd %s\n", mcname);
+ CERROR("Can't find mgcobd %s\n", mcname);
err = -ENOTCONN;
goto out_free;
}
+ // part of mgc_setup obd->obd_fsops = fsfilt_get_ops(lustre_cfg_string(lcfg, 2));
+
sbi->lsi_mgc = obd;
+
out_free:
OBD_FREE(mcname, sizeof(sb) * 2 + 1);
//client: rc = load_module("lustre");
vprint("Loading modules...");
- if (IS_OST(&mop->mo_ldd)) {
+
+ /* portals, ksocknal, fsfilt, etc. in modules.conf */
+ rc = load_module("_lustre");
+ if (rc) return rc;
+
+ if (IS_OST(&mop->mo_ldd))
rc = load_module("oss");
- if (rc) return rc;
- }
- if (IS_MDT(&mop->mo_ldd)) {
+ if (IS_MDT(&mop->mo_ldd))
rc = load_module("mds");
- if (rc) return rc;
- }
vprint("done\n");
return rc;
}
mop->mo_ldd.ldd_mount_type = LDD_MT_LDISKFS;
strcpy(mop->mo_ldd.ldd_fsname, "lustre");
+ mop->mo_stripe_count = 1;
mop->mo_index = -1;
gethostname(hostname, sizeof(hostname));
echo "Copying mount from local build dir to "$MDIR
cp ../utils/mount.lustre /sbin/.
+MP="/sbin/modprobe"
+MPI="$MP --ignore-install"
+
[ -e $MODFILE ] || touch $MODFILE
if [ `grep -c lustre $MODFILE` -eq 0 ]; then
echo Modifying $MODFILE
echo "# Lustre modules added by $0" >> $MODFILE
if [ $KVER -eq 24 ]; then
- echo alias lustre null >> $MODFILE
- echo above lustre llite osc mdc >> $MODFILE
- echo above mds llite osc $FSFLT >> $MODFILE
- echo alias oss ost >> $MODFILE
- echo above ost llite obdfilter $FSFLT >> $MODFILE
- echo above portals ksocknal >> $MODFILE
+ echo alias _lustre ksocknal portals $FSFLT >> $MODFILE
+ echo below mds _lustre osc >> $MODFILE
+ echo below oss _lustre ost >> $MODFILE
+ echo below ost _lustre >> $MODFILE
+ echo below llite _lustre osc mdc >> $MODFILE
+ echo alias lustre llite >> $MODFILE
else
- MP="/sbin/modprobe"
- MPI="$MP --ignore-install"
echo "install kptlrouter $MP portals && $MPI kptlrouter" >> $MODFILE
echo "install _lustre $MP portals && $MP lvfs && $MP obdclass && $MP ptlrpc" >> $MODFILE
echo "install obdfilter $MP _lustre && $MP ost && $MP ldiskfs && $MP $FSFLT && $MPI obdfilter" >> $MODFILE