Whamcloud - gitweb
LU-14286 osd-ldiskfs: fallocate with unwritten extents
[fs/lustre-release.git] / lustre / osd-ldiskfs / osd_internal.h
index 2ff5711..fba02d0 100644 (file)
@@ -91,6 +91,9 @@ extern struct kmem_cache *dynlock_cachep;
 #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
@@ -270,8 +273,11 @@ struct osd_device {
                                  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;
@@ -280,6 +286,7 @@ struct osd_device {
 
        spinlock_t                od_osfs_lock;
 
+       int                       od_fallocate_zero_blocks;
        int                       od_connects;
        struct lu_site            od_site;
 
@@ -298,9 +305,6 @@ struct osd_device {
         * 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;
@@ -343,6 +347,9 @@ struct osd_device {
        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)
@@ -411,6 +418,7 @@ struct osd_thandle {
        /* 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;
@@ -1029,14 +1037,22 @@ static inline struct super_block *osd_sb(const struct osd_device *dev)
        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);
 }
 
 /**