#define OSD_STATFS_RESERVED (1ULL << 23) /* 8MB */
#define OSD_STATFS_RESERVED_SHIFT (7) /* reserve 0.78% of all space */
+/* Default extent bytes when declaring write commit */
+#define OSD_DEFAULT_EXTENT_BYTES (1U << 20)
+
/* check if ldiskfs support project quota */
#ifndef LDISKFS_IOC_FSSETXATTR
#undef HAVE_PROJECT_QUOTA
od_in_init:1,
od_index_in_idif:1,
/* Other flags */
+ od_read_cache:1,
+ od_writethrough_cache:1,
od_nonrotational:1;
+
__s64 od_auto_scrub_interval;
__u32 od_dirent_journal;
int od_index;
spinlock_t od_osfs_lock;
+ int od_fallocate_zero_blocks;
int od_connects;
struct lu_site od_site;
* served bypassing pagecache unless already cached */
unsigned long od_writethrough_max_iosize;
- int od_read_cache;
- int od_writethrough_cache;
-
struct brw_stats od_brw_stats;
atomic_t od_r_in_flight;
atomic_t od_w_in_flight;
int od_index_backup_stop;
/* T10PI type, zero if not supported */
enum osd_t10_type od_t10_type;
+ atomic_t od_commit_cb_in_flight;
+ wait_queue_head_t od_commit_cb_done;
+ unsigned int __percpu *od_extent_bytes_percpu;
};
static inline struct qsd_instance *osd_def_qsd(struct osd_device *osd)
/* Link to the device, for debugging. */
struct lu_ref_link ot_dev_link;
unsigned int ot_credits;
+ unsigned int oh_declared_ext;
/* quota IDs related to the transaction */
unsigned short ot_id_cnt;
return dev->od_mnt->mnt_sb;
}
+static inline const char *osd_sb2name(const struct super_block *sb)
+{
+ /* this is LDISKFS_SB(sb), but preserves "const" */
+ const struct ldiskfs_sb_info *sbi = sb->s_fs_info;
+
+ return sbi->s_es->s_volume_name;
+}
+
static inline const char *osd_dev2name(const struct osd_device *dev)
{
- return osd_sb(dev)->s_id;
+ return osd_sb2name(osd_sb(dev));
}
static inline const char *osd_ino2name(const struct inode *inode)
{
- return inode->i_sb->s_id;
+ return osd_sb2name(inode->i_sb);
}
/**
return child_dentry;
}
+/* build quasi file structure when it is needed to call an inode i_fop */
+static inline struct file *osd_quasi_file_init(const struct lu_env *env,
+ struct dentry *dentry,
+ struct inode *inode)
+{
+ struct osd_thread_info *info = osd_oti_get(env);
+
+ info->oti_file.f_path.dentry = dentry;
+ info->oti_file.f_mapping = inode->i_mapping;
+ info->oti_file.f_op = inode->i_fop;
+ info->oti_file.f_inode = inode;
+ info->oti_file.f_pos = 0;
+ info->oti_file.private_data = NULL;
+ info->oti_file.f_cred = current_cred();
+ info->oti_file.f_flags = O_NOATIME;
+ info->oti_file.f_mode = FMODE_64BITHASH | FMODE_NONOTIFY;
+
+ return &info->oti_file;
+}
+
+static inline struct file *osd_quasi_file(const struct lu_env *env,
+ struct inode *inode)
+{
+ struct osd_thread_info *info = osd_oti_get(env);
+
+ info->oti_obj_dentry.d_inode = inode;
+ info->oti_obj_dentry.d_sb = inode->i_sb;
+
+ return osd_quasi_file_init(env, &info->oti_obj_dentry, inode);
+}
+
+static inline struct file *osd_quasi_file_by_dentry(const struct lu_env *env,
+ struct dentry *dentry)
+{
+ return osd_quasi_file_init(env, dentry, dentry->d_inode);
+}
+
extern int osd_trans_declare_op2rb[];
extern int ldiskfs_track_declares_assert;
void osd_trans_dump_creds(const struct lu_env *env, struct thandle *th);