]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - fs/gfs2/incore.h
GFS2: Improve block reservation tracing
[mirror_ubuntu-zesty-kernel.git] / fs / gfs2 / incore.h
index aaecc8085fc55945009c855eda554079cf100b59..6aaa07c7c7313709aa89c4bc35302b75d3c86136 100644 (file)
@@ -102,6 +102,24 @@ struct gfs2_rgrpd {
        u32 rd_rs_cnt;                  /* count of current reservations */
 };
 
+struct gfs2_rbm {
+       struct gfs2_rgrpd *rgd;
+       struct gfs2_bitmap *bi; /* Bitmap must belong to the rgd */
+       u32 offset;             /* The offset is bitmap relative */
+};
+
+static inline u64 gfs2_rbm_to_block(const struct gfs2_rbm *rbm)
+{
+       return rbm->rgd->rd_data0 + (rbm->bi->bi_start * GFS2_NBBY) + rbm->offset;
+}
+
+static inline bool gfs2_rbm_eq(const struct gfs2_rbm *rbm1,
+                              const struct gfs2_rbm *rbm2)
+{
+       return (rbm1->rgd == rbm2->rgd) && (rbm1->bi == rbm2->bi) && 
+              (rbm1->offset == rbm2->offset);
+}
+
 enum gfs2_state_bits {
        BH_Pinned = BH_PrivateStart,
        BH_Escaped = BH_PrivateStart + 1,
@@ -250,18 +268,11 @@ struct gfs2_blkreserv {
        /* components used during write (step 1): */
        atomic_t rs_sizehint;         /* hint of the write size */
 
-       /* components used during inplace_reserve (step 2): */
-       u32 rs_requested; /* Filled in by caller of gfs2_inplace_reserve() */
-
-       /* components used during get_local_rgrp (step 3): */
-       struct gfs2_rgrpd *rs_rgd;    /* pointer to the gfs2_rgrpd */
        struct gfs2_holder rs_rgd_gh; /* Filled in by get_local_rgrp */
        struct rb_node rs_node;       /* link to other block reservations */
-
-       /* components used during block searches and assignments (step 4): */
-       struct gfs2_bitmap *rs_bi;    /* bitmap for the current allocation */
-       u32 rs_biblk;                 /* start block relative to the bi */
+       struct gfs2_rbm rs_rbm;       /* Start of reservation */
        u32 rs_free;                  /* how many blocks are still free */
+       u64 rs_inum;                  /* Inode number for reservation */
 
        /* ancillary quota stuff */
        struct gfs2_quota_data *rs_qa_qd[2 * MAXQUOTAS];