int mgs_fs_setup(struct obd_device *obd, struct vfsmount *mnt) { struct mgs_obd *mgs = &obd->u.mgs; struct lvfs_run_ctxt saved; struct dentry *dentry; int rc; ENTRY; /* FIXME what's this? Do I need it? */ rc = cfs_cleanup_group_info(); if (rc) RETURN(rc); mgs->mgs_vfsmnt = mnt; mgs->mgs_sb = mnt->mnt_root->d_inode->i_sb; rc = fsfilt_setup(obd, mgs->mgs_sb); if (rc) RETURN(rc); OBD_SET_CTXT_MAGIC(&obd->obd_lvfs_ctxt); obd->obd_lvfs_ctxt.pwdmnt = mnt; obd->obd_lvfs_ctxt.pwd = mnt->mnt_root; obd->obd_lvfs_ctxt.fs = get_ds(); obd->obd_lvfs_ctxt.cb_ops = mgs_lvfs_ops; push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL); /* Setup the configs dir */ dentry = simple_mkdir(cfs_fs_pwd(current->fs), mnt, MOUNT_CONFIGS_DIR, 0777, 1); if (IS_ERR(dentry)) { rc = PTR_ERR(dentry); CERROR("cannot create %s directory: rc = %d\n", MOUNT_CONFIGS_DIR, rc); GOTO(err_pop, rc); } mgs->mgs_configs_dir = dentry; /* create directory to store nid table versions */ dentry = simple_mkdir(cfs_fs_pwd(current->fs), mnt, MGS_NIDTBL_DIR, 0777, 1); if (IS_ERR(dentry)) { rc = PTR_ERR(dentry); CERROR("cannot create %s directory: rc = %d\n", MOUNT_CONFIGS_DIR, rc); GOTO(err_pop, rc); } else { dput(dentry); } err_pop: pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL); return rc; }
/* Sigh - really, this is an OSS, the _server_, not the _target_ */ static int ost_setup(struct obd_device *obd, struct lustre_cfg* lcfg) { static struct ptlrpc_service_conf svc_conf; struct ost_obd *ost = &obd->u.ost; nodemask_t *mask; int rc; ENTRY; rc = cfs_cleanup_group_info(); if (rc) RETURN(rc); #ifdef LPROCFS obd->obd_vars = lprocfs_ost_obd_vars; lprocfs_seq_obd_setup(obd); #endif mutex_init(&ost->ost_health_mutex); svc_conf = (typeof(svc_conf)) { .psc_name = LUSTRE_OSS_NAME, .psc_watchdog_factor = OSS_SERVICE_WATCHDOG_FACTOR, .psc_buf = { .bc_nbufs = OST_NBUFS, .bc_buf_size = OST_BUFSIZE, .bc_req_max_size = OST_MAXREQSIZE, .bc_rep_max_size = OST_MAXREPSIZE, .bc_req_portal = OST_REQUEST_PORTAL, .bc_rep_portal = OSC_REPLY_PORTAL, }, .psc_thr = { .tc_thr_name = "ll_ost", .tc_thr_factor = OSS_THR_FACTOR, .tc_nthrs_init = OSS_NTHRS_INIT, .tc_nthrs_base = OSS_NTHRS_BASE, .tc_nthrs_max = OSS_NTHRS_MAX, .tc_nthrs_user = oss_num_threads, .tc_cpu_affinity = 1, .tc_ctx_tags = LCT_DT_THREAD, }, .psc_cpt = {