]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
xen-blkback: pull out blkif grant features from vbd
authorAnkur Arora <ankur.a.arora@oracle.com>
Wed, 29 Aug 2018 21:17:59 +0000 (14:17 -0700)
committerBrian Maly <brian.maly@oracle.com>
Mon, 8 Oct 2018 15:42:58 +0000 (11:42 -0400)
grant related features don't have anything to do with the vbd.
Move them to the blkif structure.

Orabug: 28651655

Signed-off-by: Ankur Arora <ankur.a.arora@oracle.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Reviewed-by: Bhavesh Davda <bhavesh.davda@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/block/xen-blkback/blkback.c
drivers/block/xen-blkback/common.h
drivers/block/xen-blkback/xenbus.c

index 523769d7e2b9e46b2e50d09fe0f3febf752d9de8..ab4ebac4b709df214804f52f3a76ad4d97068bfc 100644 (file)
@@ -216,8 +216,8 @@ static int add_persistent_gnt(struct xen_blkif_ring *ring,
        struct xen_blkif *blkif = ring->blkif;
 
        if (ring->persistent_gnt_c >= xen_blkif_max_pgrants) {
-               if (!blkif->vbd.overflow_max_grants)
-                       blkif->vbd.overflow_max_grants = 1;
+               if (!blkif->overflow_max_grants)
+                       blkif->overflow_max_grants = 1;
                return -EBUSY;
        }
        /* Figure out where to put new node */
@@ -376,7 +376,7 @@ static void purge_persistent_gnt(struct xen_blkif_ring *ring)
 
        if (ring->persistent_gnt_c < xen_blkif_max_pgrants ||
            (ring->persistent_gnt_c == xen_blkif_max_pgrants &&
-           !ring->blkif->vbd.overflow_max_grants)) {
+           !ring->blkif->overflow_max_grants)) {
                goto out;
        }
 
@@ -447,7 +447,7 @@ finished:
        }
 
        ring->persistent_gnt_c -= (total - num_clean);
-       ring->blkif->vbd.overflow_max_grants = 0;
+       ring->blkif->overflow_max_grants = 0;
 
        /* We can defer this work */
        schedule_work(&ring->persistent_purge_work);
@@ -667,7 +667,7 @@ int xen_blkif_schedule(void *arg)
                                                 kthread_should_stop());
 
 purge_gnt_list:
-               if (blkif->vbd.feature_gnt_persistent &&
+               if (blkif->feature_gnt_persistent &&
                    time_after(jiffies, ring->next_lru)) {
                        purge_persistent_gnt(ring);
                        ring->next_lru = jiffies + msecs_to_jiffies(LRU_INTERVAL);
@@ -833,7 +833,7 @@ static int xen_blkbk_map(struct xen_blkif_ring *ring,
        int use_persistent_gnts;
        struct xen_blkif *blkif = ring->blkif;
 
-       use_persistent_gnts = (blkif->vbd.feature_gnt_persistent);
+       use_persistent_gnts = (blkif->feature_gnt_persistent);
 
        /*
         * Fill out preq.nr_sects with proper amount of sectors, and setup
@@ -931,8 +931,8 @@ again:
                                 xen_blkif_max_pgrants);
                        goto next;
                }
-               if (use_persistent_gnts && !blkif->vbd.overflow_max_grants) {
-                       blkif->vbd.overflow_max_grants = 1;
+               if (use_persistent_gnts && !blkif->overflow_max_grants) {
+                       blkif->overflow_max_grants = 1;
                        pr_debug("domain %u, device %#x is using maximum number of persistent grants\n",
                                 blkif->domid, blkif->vbd.handle);
                }
index 8bb31d26cdf74c0e47e34b1cdef76d5acadede0d..921b084f35d822b0d8b3e12a1b553572e30664bd 100644 (file)
@@ -227,8 +227,6 @@ struct xen_vbd {
        sector_t                size;
        unsigned int            flush_support:1;
        unsigned int            discard_secure:1;
-       unsigned int            feature_gnt_persistent:1;
-       unsigned int            overflow_max_grants:1;
 };
 
 struct backend_info;
@@ -331,6 +329,8 @@ struct xen_blkif {
        /* All rings for this device. */
        struct xen_blkif_ring   *rings;
        unsigned int            nr_rings;
+       unsigned int            feature_gnt_persistent:1;
+       unsigned int            overflow_max_grants:1;
 };
 
 struct seg_buf {
index 59dd6c606f30c5e7cab55ef55680dd5715c67767..27a12f20acb26992e812dacd74ff48fd05bb058e 100644 (file)
@@ -1085,8 +1085,8 @@ static int connect_ring(struct backend_info *be)
        }
        pers_grants = xenbus_read_unsigned(dev->otherend, "feature-persistent",
                                           0);
-       be->blkif->vbd.feature_gnt_persistent = pers_grants;
-       be->blkif->vbd.overflow_max_grants = 0;
+       be->blkif->feature_gnt_persistent = pers_grants;
+       be->blkif->overflow_max_grants = 0;
 
        /*
         * Read the number of hardware queues from frontend.