d ? d->id_ops->id_name : "plain");
}
-static void osd_tune_nonrot(struct osd_device *osd, bool nonrotational)
-{
- /* do not use pagecache with flash-backed storage */
- if (!osd->od_read_cache_enable_set)
- osd->od_read_cache_enable = !nonrotational;
- if (!osd->od_writethrough_cache_enable_set)
- osd->od_writethrough_cache_enable = !nonrotational;
-}
-
/*
* Concurrency: shouldn't matter.
*/
struct kstatfs *ksfs;
__u64 reserved;
int result = 0;
- int nonrot;
if (unlikely(osd->od_mnt == NULL))
return -EINPROGRESS;
if (unlikely(sb->s_flags & SB_RDONLY))
sfs->os_state |= OS_STATFS_READONLY;
- /* periodically re-check status from the kernel, if not manually set */
- nonrot = !!blk_queue_nonrot(bdev_get_queue(osd_sb(osd)->s_bdev));
- if (unlikely(nonrot != osd->od_nonrotational &&
- !osd->od_nonrotational_set)) {
- osd->od_nonrotational = nonrot;
- osd_tune_nonrot(osd, nonrot);
- }
sfs->os_state |= osd->od_nonrotational ? OS_STATFS_NONROT : 0;
if (ldiskfs_has_feature_extents(sb))
if (lmd_flags & LMD_FLG_NOSCRUB)
o->od_auto_scrub_interval = AS_NEVER;
- /* Can only check block device after mount */
if (blk_queue_nonrot(bdev_get_queue(osd_sb(o)->s_bdev))) {
- o->od_nonrotational = 1;
- osd_tune_nonrot(o, true);
+ /* do not use pagecache with flash-backed storage */
+ o->od_writethrough_cache = 0;
+ o->od_read_cache = 0;
}
GOTO(out, rc = 0);
o->od_t10_type = 0;
init_waitqueue_head(&o->od_commit_cb_done);
- o->od_read_cache_enable = 1;
- o->od_writethrough_cache_enable = 1;
+ o->od_read_cache = 1;
+ o->od_writethrough_cache = 1;
o->od_readcache_max_filesize = OSD_MAX_CACHE_SIZE;
o->od_readcache_max_iosize = OSD_READCACHE_MAX_IO_MB << 20;
o->od_writethrough_max_iosize = OSD_WRITECACHE_MAX_IO_MB << 20;
if (rc != 0)
GOTO(out, rc);
+ /* Can only check block device after mount */
+ o->od_nonrotational =
+ blk_queue_nonrot(bdev_get_queue(osd_sb(o)->s_bdev));
+
rc = osd_obj_map_init(env, o);
if (rc != 0)
GOTO(out_mnt, rc);
od_in_init:1,
od_index_in_idif:1,
/* Other flags */
- od_read_cache_enable:1,
- od_read_cache_enable_set:1,
- od_writethrough_cache_enable:1,
- od_writethrough_cache_enable_set:1,
- od_nonrotational:1,
- od_nonrotational_set:1;
+ od_read_cache:1,
+ od_writethrough_cache:1,
+ od_nonrotational:1;
+
__s64 od_auto_scrub_interval;
__u32 od_dirent_journal;
static inline bool osd_use_page_cache(struct osd_device *d)
{
/* do not use pagecache if write and read caching are disabled */
- if (d->od_writethrough_cache_enable + d->od_read_cache_enable == 0)
+ if (d->od_writethrough_cache + d->od_read_cache == 0)
return false;
/* use pagecache by default */
return true;
cache = osd_use_page_cache(osd);
while (cache) {
if (write) {
- if (!osd->od_writethrough_cache_enable) {
+ if (!osd->od_writethrough_cache) {
cache = false;
break;
}
break;
}
} else {
- if (!osd->od_read_cache_enable) {
+ if (!osd->od_read_cache) {
cache = false;
break;
}
if (unlikely(!osd->od_mnt))
return -EINPROGRESS;
- return sprintf(buf, "%u\n", osd->od_read_cache_enable);
+ return sprintf(buf, "%u\n", osd->od_read_cache);
}
static ssize_t read_cache_enable_store(struct kobject *kobj,
if (rc)
return rc;
- osd->od_read_cache_enable = !!val;
- osd->od_read_cache_enable_set = 1;
-
+ osd->od_read_cache = !!val;
return count;
}
LUSTRE_RW_ATTR(read_cache_enable);
if (unlikely(!osd->od_mnt))
return -EINPROGRESS;
- return sprintf(buf, "%u\n", osd->od_writethrough_cache_enable);
+ return sprintf(buf, "%u\n", osd->od_writethrough_cache);
}
static ssize_t writethrough_cache_enable_store(struct kobject *kobj,
if (rc)
return rc;
- osd->od_writethrough_cache_enable = !!val;
- osd->od_writethrough_cache_enable = 1;
-
+ osd->od_writethrough_cache = !!val;
return count;
}
LUSTRE_RW_ATTR(writethrough_cache_enable);
if (rc)
return rc;
- osd->od_nonrotational = !!val;
- osd->od_nonrotational_set = 1;
-
+ osd->od_nonrotational = val;
return count;
}
LUSTRE_RW_ATTR(nonrotational);
LDEBUGFS_SEQ_FOPS_RO(ldiskfs_osd_oi_scrub);
-static int ldiskfs_osd_readcache_max_filesize_seq_show(struct seq_file *m,
- void *data)
+static int ldiskfs_osd_readcache_seq_show(struct seq_file *m, void *data)
{
struct osd_device *osd = osd_dt_dev((struct dt_device *)m->private);
}
static ssize_t
-ldiskfs_osd_readcache_max_filesize_seq_write(struct file *file,
- const char __user *buffer,
- size_t count, loff_t *off)
+ldiskfs_osd_readcache_seq_write(struct file *file, const char __user *buffer,
+ size_t count, loff_t *off)
{
struct seq_file *m = file->private_data;
struct dt_device *dt = m->private;
OSD_MAX_CACHE_SIZE : val;
return count;
}
-LDEBUGFS_SEQ_FOPS(ldiskfs_osd_readcache_max_filesize);
+
+LDEBUGFS_SEQ_FOPS(ldiskfs_osd_readcache);
static int ldiskfs_osd_readcache_max_io_seq_show(struct seq_file *m, void *data)
{
{ .name = "oi_scrub",
.fops = &ldiskfs_osd_oi_scrub_fops },
{ .name = "readcache_max_filesize",
- .fops = &ldiskfs_osd_readcache_max_filesize_fops},
+ .fops = &ldiskfs_osd_readcache_fops },
{ .name = "readcache_max_io_mb",
.fops = &ldiskfs_osd_readcache_max_io_fops },
{ .name = "writethrough_max_io_mb",
od_is_ost:1,
od_in_init:1,
od_posix_acl:1,
- od_nonrotational:1,
- od_nonrotational_set:1;
+ od_nonrotational:1;
unsigned int od_dnsize;
int od_index_backup_stop;
if (rc)
return rc;
- osd->od_nonrotational = !!val;
- osd->od_nonrotational_set = 1;
-
+ osd->od_nonrotational = val;
return count;
}
LUSTRE_RW_ATTR(nonrotational);
}
LUSTRE_RW_ATTR(index_backup);
-static int zfs_osd_readcache_max_filesize_seq_show(struct seq_file *m,
- void *data)
+static int zfs_osd_readcache_seq_show(struct seq_file *m, void *data)
{
struct osd_device *osd = osd_dt_dev((struct dt_device *)m->private);
}
static ssize_t
-zfs_osd_readcache_max_filesize_seq_write(struct file *file,
- const char __user *buffer,
- size_t count, loff_t *off)
+zfs_osd_readcache_seq_write(struct file *file, const char __user *buffer,
+ size_t count, loff_t *off)
{
struct seq_file *m = file->private_data;
struct dt_device *dt = m->private;
OSD_MAX_CACHE_SIZE : val;
return count;
}
-LDEBUGFS_SEQ_FOPS(zfs_osd_readcache_max_filesize);
+LDEBUGFS_SEQ_FOPS(zfs_osd_readcache);
static struct attribute *zfs_attrs[] = {
&lustre_attr_fstype.attr,
{ .name = "oi_scrub",
.fops = &zfs_osd_oi_scrub_fops },
{ .name = "readcache_max_filesize",
- .fops = &zfs_osd_readcache_max_filesize_fops },
+ .fops = &zfs_osd_readcache_fops },
{ 0 }
};