Skip to contentSkip to conversation

ocfs2: sysfile interfaces for online file check

PATCH New akpm at linux-foundation.org 2 participants 2 messages Aug 26, 2015 – Aug 31, 2015 OCFS2

lore
Share & tools
lore
#0 lore raw

PATCH 21/28 ocfs2: sysfile interfaces for online file check

From: Gang He <[email protected]>
Subject: ocfs2: sysfile interfaces for online file check

Implement online file check sysfile interfaces, e.g. how to create the related sysfile according to device name, how to display/handle file check request from the sysfile.

[akpm at linux-foundation.org: tweak printk text]
[dan.carpenter at oracle.com: scheduling in atomic in ocfs2_filecheck_store()]
Cc Mark Fasheh <[email protected]>
Cc Joel Becker <[email protected]>

---

 fs/ocfs2/Makefile    |    3 
 fs/ocfs2/filecheck.c |  571 +++++++++++++++++++++++++++++++++++++++++
 fs/ocfs2/filecheck.h |   48 +++
 fs/ocfs2/inode.h     |    3 
 4 files changed, 624 insertions(+), 1 deletion(-)
fs/ocfs2/Makefile renamed from fs/ocfs2/Makefile~ocfs2-sysfile-interfaces-for-online-file-check +2 -1
diff -puN fs/ocfs2/Makefile~ocfs2-sysfile-interfaces-for-online-file-check fs/ocfs2/Makefile
@@ -41,7 +41,8 @@ ocfs2-objs := \
 	quota_local.o		\
 	quota_global.o		\
 	xattr.o			\
-	acl.o
+	acl.o	\
+	filecheck.o
 
 ocfs2_stackglue-objs := stackglue.o
 ocfs2_stack_o2cb-objs := stack_o2cb.o
fs/ocfs2/filecheck.c new file +571 -0

571 lines not on this page · raw message

fs/ocfs2/filecheck.h new file +48 -0

48 lines not on this page · raw message

fs/ocfs2/inode.h renamed from fs/ocfs2/inode.h~ocfs2-sysfile-interfaces-for-online-file-check +3 -0
diff -puN fs/ocfs2/inode.h~ocfs2-sysfile-interfaces-for-online-file-check fs/ocfs2/inode.h
@@ -137,6 +137,9 @@ int ocfs2_drop_inode(struct inode *inode
 /* Flags for ocfs2_iget() */
 #define OCFS2_FI_FLAG_SYSFILE		0x1
 #define OCFS2_FI_FLAG_ORPHAN_RECOVERY	0x2
+#define OCFS2_FI_FLAG_FILECHECK_CHK	0x4
+#define OCFS2_FI_FLAG_FILECHECK_FIX	0x8
+
 struct inode *ocfs2_ilookup(struct super_block *sb, u64 feoff);
 struct inode *ocfs2_iget(struct ocfs2_super *osb, u64 feoff, unsigned flags,
 			 int sysfile_type);

_

#1 lore raw

PATCH 21/28 ocfs2: sysfile interfaces for online file check

Quoted 2 lines · Andrew Morton

From: Gang He <[email protected]>
Subject: ocfs2: sysfile interfaces for online file check

...

fs/ocfs2/filecheck.c line 344

Quoted 12 lines
fs/ocfs2/filecheck.c new file +12 -0
+static int
+ocfs2_filecheck_args_parse(const char *buf, size_t count,
+				struct ocfs2_filecheck_args *args)
+{
+	unsigned long val = 0;
+
+	/* too short/long args length */
+	if ((count < 5) || (count > OCFS2_FILECHECK_ARGS_LEN))
+		return 1;
+
+	if ((strncmp(buf, "FIX ", 4) == 0) ||
+		(strncmp(buf, "fix ", 4) == 0)) {

Use strncasecmp for this please.

--
Mark Fasheh