aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/backing-dev-defs.h
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2017-02-02 15:56:51 +0100
committerJens Axboe <axboe@fb.com>2017-02-02 08:20:50 -0700
commitd03f6cdc1fc422accb734c7c07a661a0018d8631 (patch)
treefe3500795df51b8ad11a0f76dddfa27d60fecf13 /include/linux/backing-dev-defs.h
parentblock: Use pointer to backing_dev_info from request_queue (diff)
downloadlinux-dev-d03f6cdc1fc422accb734c7c07a661a0018d8631.tar.xz
linux-dev-d03f6cdc1fc422accb734c7c07a661a0018d8631.zip
block: Dynamically allocate and refcount backing_dev_info
Instead of storing backing_dev_info inside struct request_queue, allocate it dynamically, reference count it, and free it when the last reference is dropped. Currently only request_queue holds the reference but in the following patch we add other users referencing backing_dev_info. Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'include/linux/backing-dev-defs.h')
-rw-r--r--include/linux/backing-dev-defs.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/backing-dev-defs.h b/include/linux/backing-dev-defs.h
index e850e76acaaf..ad955817916d 100644
--- a/include/linux/backing-dev-defs.h
+++ b/include/linux/backing-dev-defs.h
@@ -10,6 +10,7 @@
#include <linux/flex_proportions.h>
#include <linux/timer.h>
#include <linux/workqueue.h>
+#include <linux/kref.h>
struct page;
struct device;
@@ -144,6 +145,7 @@ struct backing_dev_info {
char *name;
+ struct kref refcnt; /* Reference counter for the structure */
unsigned int capabilities; /* Device capabilities */
unsigned int min_ratio;
unsigned int max_ratio, max_prop_frac;