GOTO(out_unlock, rc);
/* We need page aligned offset and length */
- start_index = start >> PAGE_CACHE_SHIFT;
- end_index = (end - 1) >> PAGE_CACHE_SHIFT;
+ start_index = start >> PAGE_SHIFT;
+ end_index = (end - 1) >> PAGE_SHIFT;
pages = end_index - start_index + 1;
while (pages > 0) {
nr_local = pages <= PTLRPC_MAX_BRW_PAGES ? pages :
PTLRPC_MAX_BRW_PAGES;
- rnb.rnb_offset = start_index << PAGE_CACHE_SHIFT;
- rnb.rnb_len = nr_local << PAGE_CACHE_SHIFT;
+ rnb.rnb_offset = start_index << PAGE_SHIFT;
+ rnb.rnb_len = nr_local << PAGE_SHIFT;
rc = dt_bufs_get(env, ofd_object_child(fo), &rnb, lnb, 0);
if (unlikely(rc < 0))
break;
struct lustre_handle lockh = { 0 };
__u64 flags = 0;
int i;
+ struct dt_object *dob;
ENTRY;
CFS_FAIL_TIMEOUT(OBD_FAIL_OST_LADVISE_PAUSE, cfs_fail_val);
RETURN(rc);
}
LASSERT(fo != NULL);
+ dob = ofd_object_child(fo);
for (i = 0; i < num_advise; i++, ladvise++) {
if (ladvise->lla_end <= ladvise->lla_start) {
ladvise->lla_end);
tgt_extent_unlock(&lockh, LCK_PR);
break;
+ case LU_LADVISE_DONTNEED:
+ rc = dt_ladvise(env, dob, ladvise->lla_start,
+ ladvise->lla_end, LU_LADVISE_DONTNEED);
+ break;
}
if (rc != 0)
break;
static int ofd_init0(const struct lu_env *env, struct ofd_device *m,
struct lu_device_type *ldt, struct lustre_cfg *cfg)
{
- const char *dev = lustre_cfg_string(cfg, 0);
- struct ofd_thread_info *info = NULL;
- struct obd_device *obd;
- struct obd_statfs *osfs;
- struct lu_fid fid;
- int rc;
+ const char *dev = lustre_cfg_string(cfg, 0);
+ struct ofd_thread_info *info = NULL;
+ struct obd_device *obd;
+ struct obd_statfs *osfs;
+ struct lu_fid fid;
+ struct nm_config_file *nodemap_config;
+ int rc;
ENTRY;
ofd_slc_set(m);
m->ofd_grant_compat_disable = 0;
m->ofd_soft_sync_limit = OFD_SOFT_SYNC_LIMIT_DEFAULT;
- m->ofd_brw_size = ONE_MB_BRW_SIZE;
/* statfs data */
spin_lock_init(&m->ofd_osfs_lock);
}
m->ofd_blockbits = fls(osfs->os_bsize) - 1;
+ if (ONE_MB_BRW_SIZE < (1U << m->ofd_blockbits))
+ m->ofd_brw_size = 1U << m->ofd_blockbits;
+ else
+ m->ofd_brw_size = ONE_MB_BRW_SIZE;
+
m->ofd_precreate_batch = OFD_PRECREATE_BATCH_DEFAULT;
if (osfs->os_bsize * osfs->os_blocks < OFD_PRECREATE_SMALL_FS)
m->ofd_precreate_batch = OFD_PRECREATE_BATCH_SMALL;
if (rc != 0)
GOTO(err_fini_fs, rc);
- rc = nodemap_fs_init(env, m->ofd_osd, obd, m->ofd_los);
- if (rc != 0)
- GOTO(err_fini_los, rc);
+ nodemap_config = nm_config_file_register_tgt(env, m->ofd_osd,
+ m->ofd_los);
+ if (IS_ERR(nodemap_config))
+ GOTO(err_fini_los, rc = PTR_ERR(nodemap_config));
+
+ obd->u.obt.obt_nodemap_config_file = nodemap_config;
rc = ofd_start_inconsistency_verification_thread(m);
if (rc != 0)
RETURN(0);
err_fini_nm:
- nodemap_fs_fini(env, obd);
+ nm_config_file_deregister_tgt(env, obd->u.obt.obt_nodemap_config_file);
+ obd->u.obt.obt_nodemap_config_file = NULL;
err_fini_los:
local_oid_storage_fini(env, m->ofd_los);
m->ofd_los = NULL;
ofd_stop_inconsistency_verification_thread(m);
lfsck_degister(env, m->ofd_osd);
ofd_fs_cleanup(env, m);
- nodemap_fs_fini(env, obd);
+ nm_config_file_deregister_tgt(env, obd->u.obt.obt_nodemap_config_file);
+ obd->u.obt.obt_nodemap_config_file = NULL;
if (m->ofd_los != NULL) {
local_oid_storage_fini(env, m->ofd_los);