[lustre-devel] [PATCH 13/15] lustre: llite: Proved an abstraction for AS_EXITING

James Simmons jsimmons at infradead.org
Sun Aug 22 19:27:44 PDT 2021


From: Shaun Tancheff <shaun.tancheff at hpe.com>

Linux kernel v3.14-7405-g91b0abe36a7b added AS_EXITING flag
AS_EXITING flag is set while address_space mapping is exiting.

Provide an abstraction mapping_clear_exiting() to clear
the AS_EXITING flag. This balances the kernel
mapping_set_existing().

HPE-bug-id: LUS-9977
WC-bug-id: https://jira.whamcloud.com/browse/LU-14787
Lustre-commit: e423a0bd7a4a59be ("LU-14787 libcfs: Proved an abstraction for AS_EXITING")
Signed-off-by: Shaun Tancheff <shaun.tancheff at hpe.com>
Reviewed-on: https://review.whamcloud.com/44070
Reviewed-by: Andreas Dilger <adilger at whamcloud.com>
Reviewed-by: Bobi Jam <bobijam at hotmail.com>
Reviewed-by: James Simmons <jsimmons at infradead.org>
Signed-off-by: James Simmons <jsimmons at infradead.org>
---
 fs/lustre/llite/llite_internal.h | 7 +++++++
 fs/lustre/llite/vvp_object.c     | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/fs/lustre/llite/llite_internal.h b/fs/lustre/llite/llite_internal.h
index 95e4f45..6b5e318 100644
--- a/fs/lustre/llite/llite_internal.h
+++ b/fs/lustre/llite/llite_internal.h
@@ -32,6 +32,8 @@
 
 #ifndef LLITE_INTERNAL_H
 #define LLITE_INTERNAL_H
+
+#include <linux/pagemap.h>
 #include <obd.h>
 #include <uapi/linux/lustre/lustre_ver.h>
 #include <lustre_disk.h>	/* for s2sbi */
@@ -1110,6 +1112,11 @@ void ll_cl_add(struct file *file, const struct lu_env *env, struct cl_io *io,
 void ll_cl_remove(struct file *file, const struct lu_env *env);
 struct ll_cl_context *ll_cl_find(struct file *file);
 
+static inline void mapping_clear_exiting(struct address_space *mapping)
+{
+	clear_bit(AS_EXITING, &mapping->flags);
+}
+
 extern const struct address_space_operations ll_aops;
 
 /* llite/file.c */
diff --git a/fs/lustre/llite/vvp_object.c b/fs/lustre/llite/vvp_object.c
index 294df88..8a53458 100644
--- a/fs/lustre/llite/vvp_object.c
+++ b/fs/lustre/llite/vvp_object.c
@@ -164,7 +164,7 @@ static int vvp_prune(const struct lu_env *env, struct cl_object *obj)
 	}
 
 	ll_truncate_inode_pages_final(inode);
-	clear_bit(AS_EXITING, &inode->i_mapping->flags);
+	mapping_clear_exiting(inode->i_mapping);
 
 	return 0;
 }
-- 
1.8.3.1



More information about the lustre-devel mailing list