diff options
author | Jan Kara <jack@suse.cz> | 2017-02-02 15:56:51 +0100 |
---|---|---|
committer | Ritesh Harjani <riteshh@codeaurora.org> | 2017-10-18 12:05:44 +0530 |
commit | b56ec58cde8aa78d30f0af2f71c5ffcbe5def4ce (patch) | |
tree | ac4c752ab9bc8287aeb0ce8741c06a9f854e44e7 /include/linux/backing-dev-defs.h | |
parent | 1c6dd645345c75a6cafc6fc0ab41c60c7f381e99 (diff) |
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>
Change-Id: Ibcee7b4c014018f9243cd3edbfd9c4a8877c3862
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git
Git-commit: d03f6cdc1fc422accb734c7c07a661a0018d8631
[riteshh@codeaurora.org: resolved merge conflicts]
Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
Diffstat (limited to 'include/linux/backing-dev-defs.h')
-rw-r--r-- | include/linux/backing-dev-defs.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/backing-dev-defs.h b/include/linux/backing-dev-defs.h index 140c29635069..c104d4aed62a 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; @@ -141,6 +142,7 @@ struct backing_dev_info { void *congested_data; /* Pointer to aux data for congested func */ char *name; + struct kref refcnt; /* Reference counter for the structure */ unsigned int min_ratio; unsigned int max_ratio, max_prop_frac; |