si_meminfo(&si);
pages = si.totalram - si.totalhigh;
if (pages >> (20 - CFS_PAGE_SHIFT) < 512) {
-#ifdef HAVE_BGL_SUPPORT
- lru_page_max = pages / 4;
-#else
lru_page_max = pages / 2;
-#endif
} else {
lru_page_max = (pages / 4) * 3;
}
OBD_CONNECT_FULL20 | OBD_CONNECT_64BITHASH|
OBD_CONNECT_EINPROGRESS |
OBD_CONNECT_JOBSTATS | OBD_CONNECT_LVB_TYPE |
- OBD_CONNECT_LAYOUTLOCK;
+ OBD_CONNECT_LAYOUTLOCK | OBD_CONNECT_PINGLESS;
if (sbi->ll_flags & LL_SBI_SOM_PREVIEW)
data->ocd_connect_flags |= OBD_CONNECT_SOM;
if (sbi->ll_flags & LL_SBI_RMT_CLIENT)
data->ocd_connect_flags |= OBD_CONNECT_RMT_CLIENT_FORCE;
- data->ocd_brw_size = PTLRPC_MAX_BRW_SIZE;
+ data->ocd_brw_size = MD_MAX_BRW_SIZE;
err = obd_connect(NULL, &sbi->ll_md_exp, obd, &sbi->ll_sb_uuid, data, NULL);
if (err == -EBUSY) {
GOTO(out, err);
}
+ sbi->ll_md_exp->exp_connect_data = *data;
+
+ /* For mount, we only need fs info from MDT0, and also in DNE, it
+ * can make sure the client can be mounted as long as MDT0 is
+ * avaible */
err = obd_statfs(NULL, sbi->ll_md_exp, osfs,
- cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS), 0);
+ cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS),
+ OBD_STATFS_FOR_MDT0);
if (err)
GOTO(out_md, err);
* be non-zero, but if accessing an upgraded 2.1 server it will
* have the correct flags filled in.
* XXX: fill in the LMV exp_connect_flags from MDC(s). */
- valid = sbi->ll_md_exp->exp_connect_flags & CLIENT_CONNECT_MDT_REQD;
- if (sbi->ll_md_exp->exp_connect_flags != 0 &&
+ valid = exp_connect_flags(sbi->ll_md_exp) & CLIENT_CONNECT_MDT_REQD;
+ if (exp_connect_flags(sbi->ll_md_exp) != 0 &&
valid != CLIENT_CONNECT_MDT_REQD) {
char *buf;
GOTO(out_md, err);
}
- LASSERT(osfs->os_bsize);
+ LASSERT(osfs->os_bsize);
sb->s_blocksize = osfs->os_bsize;
sb->s_blocksize_bits = log2(osfs->os_bsize);
sb->s_magic = LL_SUPER_MAGIC;
if (data->ocd_connect_flags & OBD_CONNECT_64BITHASH)
sbi->ll_flags |= LL_SBI_64BIT_HASH;
- if (data->ocd_connect_flags & OBD_CONNECT_BRW_SIZE)
- sbi->ll_md_brw_size = data->ocd_brw_size;
- else
- sbi->ll_md_brw_size = CFS_PAGE_SIZE;
+ if (data->ocd_connect_flags & OBD_CONNECT_BRW_SIZE)
+ sbi->ll_md_brw_size = data->ocd_brw_size;
+ else
+ sbi->ll_md_brw_size = CFS_PAGE_SIZE;
if (data->ocd_connect_flags & OBD_CONNECT_LAYOUTLOCK) {
LCONSOLE_INFO("Layout lock feature supported.\n");
OBD_CONNECT_MAXBYTES |
OBD_CONNECT_EINPROGRESS |
OBD_CONNECT_JOBSTATS | OBD_CONNECT_LVB_TYPE |
- OBD_CONNECT_LAYOUTLOCK;
+ OBD_CONNECT_LAYOUTLOCK | OBD_CONNECT_PINGLESS;
if (sbi->ll_flags & LL_SBI_SOM_PREVIEW)
data->ocd_connect_flags |= OBD_CONNECT_SOM;
obd->obd_upcall.onu_owner = &sbi->ll_lco;
obd->obd_upcall.onu_upcall = cl_ocd_update;
- data->ocd_brw_size = PTLRPC_MAX_BRW_SIZE;
+ data->ocd_brw_size = DT_MAX_BRW_SIZE;
err = obd_connect(NULL, &sbi->ll_dt_exp, obd, &sbi->ll_sb_uuid, data,
NULL);
GOTO(out_md, err);
}
+ sbi->ll_dt_exp->exp_connect_data = *data;
+
mutex_lock(&sbi->ll_lco.lco_lock);
sbi->ll_lco.lco_flags = data->ocd_connect_flags;
sbi->ll_lco.lco_md_exp = sbi->ll_md_exp;
mutex_init(&lli->lli_och_mutex);
spin_lock_init(&lli->lli_agl_lock);
lli->lli_has_smd = false;
- lli->lli_layout_gen = LL_LAYOUT_GEN_ZERO;
+ lli->lli_layout_gen = LL_LAYOUT_GEN_NONE;
lli->lli_clob = NULL;
LASSERT(lli->lli_vfs_inode.i_mode != 0);
CFS_INIT_LIST_HEAD(&lli->lli_agl_list);
lli->lli_agl_index = 0;
lli->lli_async_rc = 0;
+ lli->lli_volatile = false;
}
mutex_init(&lli->lli_layout_mutex);
}
if (err)
GOTO(out_free, err);
- err = ll_bdi_init(&lsi->lsi_bdi);
- if (err)
- GOTO(out_free, err);
- lsi->lsi_flags |= LSI_BDI_INITIALIZED;
- lsi->lsi_bdi.capabilities = BDI_CAP_MAP_COPY;
- err = ll_bdi_register(&lsi->lsi_bdi);
- if (err)
- GOTO(out_free, err);
+ err = bdi_init(&lsi->lsi_bdi);
+ if (err)
+ GOTO(out_free, err);
+ lsi->lsi_flags |= LSI_BDI_INITIALIZED;
+ lsi->lsi_bdi.capabilities = BDI_CAP_MAP_COPY;
+ err = ll_bdi_register(&lsi->lsi_bdi);
+ if (err)
+ GOTO(out_free, err);
#ifdef HAVE_SB_BDI
sb->s_bdi = &lsi->lsi_bdi;
if (profilenm)
class_del_profile(profilenm);
- if (lsi->lsi_flags & LSI_BDI_INITIALIZED) {
- ll_bdi_destroy(&lsi->lsi_bdi);
- lsi->lsi_flags &= ~LSI_BDI_INITIALIZED;
- }
+ if (lsi->lsi_flags & LSI_BDI_INITIALIZED) {
+ bdi_destroy(&lsi->lsi_bdi);
+ lsi->lsi_flags &= ~LSI_BDI_INITIALIZED;
+ }
ll_free_sbi(sb);
lsi->lsi_llsbi = NULL;
inode_dio_write_done(inode);
mutex_unlock(&inode->i_mutex);
down_write(&lli->lli_trunc_sem);
- mutex_lock(&inode->i_mutex);
- if (ia_valid & ATTR_SIZE)
- inode_dio_wait(inode);
}
/* We need a steady stripe configuration for setattr to avoid
}
ll_finish_md_op_data(op_data);
}
- if (!S_ISDIR(inode->i_mode))
+ if (!S_ISDIR(inode->i_mode)) {
up_write(&lli->lli_trunc_sem);
+ mutex_lock(&inode->i_mutex);
+ if (ia_valid & ATTR_SIZE)
+ inode_dio_wait(inode);
+ }
- ll_stats_ops_tally(ll_i2sbi(inode), (ia_valid & ATTR_SIZE) ?
- LPROC_LL_TRUNC : LPROC_LL_SETATTR, 1);
+ ll_stats_ops_tally(ll_i2sbi(inode), (ia_valid & ATTR_SIZE) ?
+ LPROC_LL_TRUNC : LPROC_LL_SETATTR, 1);
- return rc;
+ return rc;
}
int ll_setattr(struct dentry *de, struct iattr *attr)
LASSERT ((lsm != NULL) == ((body->valid & OBD_MD_FLEASIZE) != 0));
if (lsm != NULL) {
+ if (!lli->lli_has_smd &&
+ !(sbi->ll_flags & LL_SBI_LAYOUT_LOCK))
+ cl_file_inode_init(inode, md);
+
lli->lli_maxbytes = lsm->lsm_maxbytes;
if (lli->lli_maxbytes > MAX_LFS_FILESIZE)
lli->lli_maxbytes = MAX_LFS_FILESIZE;
op_data->op_capa2 = NULL;
}
- op_data->op_name = name;
- op_data->op_namelen = namelen;
- op_data->op_mode = mode;
- op_data->op_mod_time = cfs_time_current_sec();
- op_data->op_fsuid = cfs_curproc_fsuid();
- op_data->op_fsgid = cfs_curproc_fsgid();
- op_data->op_cap = cfs_curproc_cap_pack();
- op_data->op_bias = MDS_CHECK_SPLIT;
- op_data->op_opc = opc;
- op_data->op_mds = 0;
- op_data->op_data = data;
+ op_data->op_name = name;
+ op_data->op_namelen = namelen;
+ op_data->op_mode = mode;
+ op_data->op_mod_time = cfs_time_current_sec();
+ op_data->op_fsuid = cfs_curproc_fsuid();
+ op_data->op_fsgid = cfs_curproc_fsgid();
+ op_data->op_cap = cfs_curproc_cap_pack();
+ op_data->op_bias = 0;
+ op_data->op_cli_flags = 0;
+ if ((opc == LUSTRE_OPC_CREATE) && (name != NULL) &&
+ filename_is_volatile(name, namelen, NULL))
+ op_data->op_bias |= MDS_CREATE_VOLATILE;
+ op_data->op_opc = opc;
+ op_data->op_mds = 0;
+ op_data->op_data = data;
/* If the file is being opened after mknod() (normally due to NFS)
* try to use the default stripe data from parent directory for