[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <153365632811.19074.14026254201855676335.stgit@localhost.localdomain>
Date: Tue, 07 Aug 2018 18:38:48 +0300
From: Kirill Tkhai <ktkhai@...tuozzo.com>
To: akpm@...ux-foundation.org, gregkh@...uxfoundation.org,
rafael@...nel.org, viro@...iv.linux.org.uk,
darrick.wong@...cle.com, paulmck@...ux.vnet.ibm.com,
josh@...htriplett.org, rostedt@...dmis.org,
mathieu.desnoyers@...icios.com, jiangshanlai@...il.com,
hughd@...gle.com, shuah@...nel.org, robh@...nel.org,
ulf.hansson@...aro.org, aspriel@...il.com,
vivek.gautam@...eaurora.org, robin.murphy@....com, joe@...ches.com,
heikki.krogerus@...ux.intel.com, ktkhai@...tuozzo.com,
sfr@...b.auug.org.au, vdavydov.dev@...il.com, mhocko@...e.com,
chris@...is-wilson.co.uk, penguin-kernel@...ove.SAKURA.ne.jp,
aryabinin@...tuozzo.com, willy@...radead.org, ying.huang@...el.com,
shakeelb@...gle.com, jbacik@...com, mingo@...nel.org,
mhiramat@...nel.org, linux-kernel@...r.kernel.org,
linux-fsdevel@...r.kernel.org, linux-mm@...ck.org
Subject: [PATCH RFC 07/10] fs: Introduce struct
super_operations::destroy_super() callback.
The patch introduces a new callback, which will be called
asynchronous from delayed work.
This will allows to make ::nr_cached_objects() safe
to be called on destroying superblock in next patches,
and to split unregister_shrinker() into two primitives.
Signed-off-by: Kirill Tkhai <ktkhai@...tuozzo.com>
---
fs/super.c | 3 +++
include/linux/fs.h | 1 +
2 files changed, 4 insertions(+)
diff --git a/fs/super.c b/fs/super.c
index 9222cfc196bf..c60f092538c7 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -170,6 +170,9 @@ static void destroy_super_work(struct work_struct *work)
list_lru_destroy(&s->s_dentry_lru);
list_lru_destroy(&s->s_inode_lru);
+ if (s->s_op->destroy_super)
+ s->s_op->destroy_super(s);
+
for (i = 0; i < SB_FREEZE_LEVELS; i++)
percpu_free_rwsem(&s->s_writers.rw_sem[i]);
kfree(s);
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 842fde0f0981..33dfaed0a01a 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1880,6 +1880,7 @@ struct super_operations {
int (*drop_inode) (struct inode *);
void (*evict_inode) (struct inode *);
void (*put_super) (struct super_block *);
+ void (*destroy_super) (struct super_block *);
int (*sync_fs)(struct super_block *sb, int wait);
int (*freeze_super) (struct super_block *);
int (*freeze_fs) (struct super_block *);
Powered by blists - more mailing lists