Merge branch 'master' into for-next
[firefly-linux-kernel-4.4.55.git] / include / linux / device-mapper.h
index 531a6f2635ae5450cc441daa9d34060b7f8df96c..2970022faa632715461ab11ea8955cf3aa0fb1c0 100644 (file)
@@ -180,6 +180,12 @@ struct dm_target {
         */
        unsigned num_flush_requests;
 
+       /*
+        * The number of discard requests that will be submitted to the
+        * target.  map_info->request_nr is used just like num_flush_requests.
+        */
+       unsigned num_discard_requests;
+
        /* target specific data */
        void *private;
 
@@ -392,6 +398,12 @@ void *dm_vcalloc(unsigned long nmemb, unsigned long elem_size);
 #define dm_array_too_big(fixed, obj, num) \
        ((num) > (UINT_MAX - (fixed)) / (obj))
 
+/*
+ * Sector offset taken relative to the start of the target instead of
+ * relative to the start of the device.
+ */
+#define dm_target_offset(ti, sector) ((sector) - (ti)->begin)
+
 static inline sector_t to_sector(unsigned long n)
 {
        return (n >> SECTOR_SHIFT);