From: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
To: kexec@lists.infradead.org
Cc: Atsushi Kumagai <ats-kumagai@wm.jp.nec.com>,
Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Subject: [RFC PATCH 3/4] eppic/dir_names: Introduce changes for kernel 3.14
Date: Wed, 21 Dec 2016 15:35:44 +0530 [thread overview]
Message-ID: <1482314745-5827-4-git-send-email-kamalesh@linux.vnet.ibm.com> (raw)
In-Reply-To: <1482314745-5827-1-git-send-email-kamalesh@linux.vnet.ibm.com>
Linux kernel commit 38129a13e6e7 ("switch mnt_hash to hlist"),
moves mnt_hash from list_head to hlist_node. Introduce these
list type changes to iterate over the mounted filesystem and
walk dentries.
These changes are not compatible with previous kernel versions,
so add new dir_names script file for kernel version >= 3.14
to kernel version <= 4.8.
Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Cc: Atsushi Kumagai <ats-kumagai@wm.jp.nec.com>
---
eppic_scripts/dir_names_3_14_to_4_8.c | 82 +++++++++++++++++++++++++++++++++++
1 file changed, 82 insertions(+)
create mode 100644 eppic_scripts/dir_names_3_14_to_4_8.c
diff --git a/eppic_scripts/dir_names_3_14_to_4_8.c b/eppic_scripts/dir_names_3_14_to_4_8.c
new file mode 100644
index 0000000..5bf08fe
--- /dev/null
+++ b/eppic_scripts/dir_names_3_14_to_4_8.c
@@ -0,0 +1,82 @@
+string
+vfs_opt()
+{
+ return "l";
+}
+
+string
+vfs_usage()
+{
+ return "\n";
+}
+
+static void
+vfs_showusage()
+{
+ printf("usage : vfs %s", vfs_usage());
+}
+
+string
+vfs_help()
+{
+ return "Help";
+}
+
+void
+rm_names(struct dentry *dir)
+{
+ struct list_head *next, *head;
+ unsigned int hash_len;
+ int i;
+
+ memset(dir->d_iname, 0, 0x20);
+ hash_len = *((unsigned int *)&dir->d_name);
+ memset(dir->d_name.name, 0, hash_len);
+
+ head = (struct list_head *)&(dir->d_subdirs);
+ next = (struct list_head *)dir->d_subdirs.next;
+
+ while (next != head)
+ {
+ struct dentry *child, *off = 0;
+
+ child = (struct dentry *)((unsigned long)next - (unsigned long)&(off->d_child));
+ rm_names(child);
+ next = child->d_child.next;
+ }
+
+ return;
+}
+
+int
+vfs()
+{
+ int i;
+ struct hlist_bl_head *tab;
+ unsigned int d_hash_size = d_hash_mask;
+
+ tab = (struct hlist_bl_head *)dentry_hashtable;
+
+ for (i = 0; i < d_hash_size; i++)
+ {
+ struct hlist_bl_head *head;
+ struct hlist_bl_node *head_node, *next;
+
+ head = (struct hlist_bl_head *) (tab + i);
+ head_node = head->first;
+ if (!head_node)
+ continue;
+
+ next = head_node;
+
+ while (next)
+ {
+ struct dentry *root, *off = 0;
+
+ root = (struct dentry *)((unsigned long)next - (unsigned long)&(off->d_hash));
+ rm_names(root);
+ next = next->next;
+ }
+ }
+ return 1;
+}
--
2.7.4
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
next prev parent reply other threads:[~2016-12-21 10:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-21 10:05 [RFC PATCH 0/4] eppic: Create kernel version compatible scripts Kamalesh Babulal
2016-12-21 10:05 ` [RFC PATCH 1/4] eppic: Rename scripts to reflect validity of kernel version Kamalesh Babulal
2016-12-21 10:05 ` [RFC PATCH 2/4] eppic/vhost_net_buffers: Introduce changes for kernel 3.19 Kamalesh Babulal
2016-12-21 10:05 ` Kamalesh Babulal [this message]
2016-12-21 10:05 ` [RFC PATCH 4/4] eppic/keyring: Introduce changes for kernel 4.4 Kamalesh Babulal
2016-12-27 5:22 ` [RFC PATCH 0/4] eppic: Create kernel version compatible scripts Atsushi Kumagai
2016-12-27 6:37 ` Kamalesh Babulal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1482314745-5827-4-git-send-email-kamalesh@linux.vnet.ibm.com \
--to=kamalesh@linux.vnet.ibm.com \
--cc=ats-kumagai@wm.jp.nec.com \
--cc=kexec@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox