| @@ -213,6 +213,9 @@ struct blkfront_info · 212 unmodified lines |
| 213 | unsigned int feature_fua:1; | 213 | unsigned int feature_fua:1; |
| 214 | unsigned int feature_discard:1; | 214 | unsigned int feature_discard:1; |
| 215 | unsigned int feature_secdiscard:1; | 215 | unsigned int feature_secdiscard:1; |
| | 216 | /* Connect-time cached feature_persistent parameter */ |
| | 217 | unsigned int feature_persistent_parm:1; |
| | 218 | /* Persistent grants feature negotiation result */ |
| 216 | unsigned int feature_persistent:1; | 219 | unsigned int feature_persistent:1; |
| 217 | unsigned int bounce:1; | 220 | unsigned int bounce:1; |
| 218 | unsigned int discard_granularity; | 221 | unsigned int discard_granularity; |
| @@ -1756,6 +1759,12 @@ abort_transaction: · 1537 unmodified lines |
| 1756 | return err; | 1759 | return err; |
| 1757 | } | 1760 | } |
| 1758 | | 1761 | |
| | 1762 | /* Enable the persistent grants feature. */ |
| | 1763 | static bool feature_persistent = true; |
| | 1764 | module_param(feature_persistent, bool, 0644); |
| | 1765 | MODULE_PARM_DESC(feature_persistent, |
| | 1766 | "Enables the persistent grants feature"); |
| | 1767 | |
| 1759 | /* Common code used when first setting up, and when resuming. */ | 1768 | /* Common code used when first setting up, and when resuming. */ |
| 1760 | static int talk_to_blkback(struct xenbus_device *dev, | 1769 | static int talk_to_blkback(struct xenbus_device *dev, |
| 1761 | struct blkfront_info *info) | 1770 | struct blkfront_info *info) |
| @@ -1847,8 +1856,9 @@ again: · 85 unmodified lines |
| 1847 | message = "writing protocol"; | 1856 | message = "writing protocol"; |
| 1848 | goto abort_transaction; | 1857 | goto abort_transaction; |
| 1849 | } | 1858 | } |
| | 1859 | info->feature_persistent_parm = feature_persistent; |
| 1850 | err = xenbus_printf(xbt, dev->nodename, "feature-persistent", "%u", | 1860 | err = xenbus_printf(xbt, dev->nodename, "feature-persistent", "%u", |
| 1851 | info->feature_persistent); | 1861 | info->feature_persistent_parm); |
| 1852 | if (err) | 1862 | if (err) |
| 1853 | dev_warn(&dev->dev, | 1863 | dev_warn(&dev->dev, |
| 1854 | "writing persistent grants feature to xenbus"); | 1864 | "writing persistent grants feature to xenbus"); |
| @@ -1916,12 +1926,6 @@ static int negotiate_mq(struct blkfront_info *info) · 61 unmodified lines |
| 1916 | return 0; | 1926 | return 0; |
| 1917 | } | 1927 | } |
| 1918 | | 1928 | |
| 1919 | /* Enable the persistent grants feature. */ | | |
| 1920 | static bool feature_persistent = true; | | |
| 1921 | module_param(feature_persistent, bool, 0644); | | |
| 1922 | MODULE_PARM_DESC(feature_persistent, | | |
| 1923 | "Enables the persistent grants feature"); | | |
| 1924 | | | |
| 1925 | /* | 1929 | /* |
| 1926 | * Entry point to this code when a new device is created. Allocate the basic | 1930 | * Entry point to this code when a new device is created. Allocate the basic |
| 1927 | * structures and the ring buffer for communication with the backend, and | 1931 | * structures and the ring buffer for communication with the backend, and |
| @@ -2281,7 +2285,7 @@ static void blkfront_gather_backend_features(struct blkfront_info *info) · 353 unmodified lines |
| 2281 | if (xenbus_read_unsigned(info->xbdev->otherend, "feature-discard", 0)) | 2285 | if (xenbus_read_unsigned(info->xbdev->otherend, "feature-discard", 0)) |
| 2282 | blkfront_setup_discard(info); | 2286 | blkfront_setup_discard(info); |
| 2283 | | 2287 | |
| 2284 | if (feature_persistent) | 2288 | if (info->feature_persistent_parm) |
| 2285 | info->feature_persistent = | 2289 | info->feature_persistent = |
| 2286 | !!xenbus_read_unsigned(info->xbdev->otherend, | 2290 | !!xenbus_read_unsigned(info->xbdev->otherend, |
| 2287 | "feature-persistent", 0); | 2291 | "feature-persistent", 0); |