[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210923130814.140814-4-cgxu519@mykernel.net>
Date: Thu, 23 Sep 2021 21:08:07 +0800
From: Chengguang Xu <cgxu519@...ernel.net>
To: miklos@...redi.hu, jack@...e.cz, amir73il@...il.com
Cc: linux-fsdevel@...r.kernel.org, linux-unionfs@...r.kernel.org,
linux-kernel@...r.kernel.org, Chengguang Xu <cgxu519@...ernel.net>
Subject: [RFC PATCH v5 03/10] ovl: implement overlayfs' ->evict_inode operation
Implement overlayfs' ->evict_inode operation,
so that we can clear dirty flags of overlayfs inode.
Signed-off-by: Chengguang Xu <cgxu519@...ernel.net>
---
fs/overlayfs/super.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
index 51886ba6130a..2ab77adf7256 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -406,11 +406,18 @@ static int ovl_remount(struct super_block *sb, int *flags, char *data)
return ret;
}
+static void ovl_evict_inode(struct inode *inode)
+{
+ inode->i_state &= ~I_DIRTY_ALL;
+ clear_inode(inode);
+}
+
static const struct super_operations ovl_super_operations = {
.alloc_inode = ovl_alloc_inode,
.free_inode = ovl_free_inode,
.destroy_inode = ovl_destroy_inode,
.drop_inode = generic_delete_inode,
+ .evict_inode = ovl_evict_inode,
.put_super = ovl_put_super,
.sync_fs = ovl_sync_fs,
.statfs = ovl_statfs,
--
2.27.0
Powered by blists - more mailing lists