kernfs: s/sysfs/kernfs/ in global variables

kernfs has just been separated out from sysfs and we're already in
full conflict mode.  Nothing can make the situation any worse.  Let's
take the chance to name things properly.

This patch performs the following renames.

* s/sysfs_mutex/kernfs_mutex/
* s/sysfs_dentry_ops/kernfs_dops/
* s/sysfs_dir_operations/kernfs_dir_fops/
* s/sysfs_dir_inode_operations/kernfs_dir_iops/
* s/kernfs_file_operations/kernfs_file_fops/ - renamed for consistency
* s/sysfs_symlink_inode_operations/kernfs_symlink_iops/
* s/sysfs_aops/kernfs_aops/
* s/sysfs_backing_dev_info/kernfs_bdi/
* s/sysfs_inode_operations/kernfs_iops/
* s/sysfs_dir_cachep/kernfs_node_cache/
* s/sysfs_ops/kernfs_sops/

This patch is strictly rename only and doesn't introduce any
functional difference.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
diff --git a/fs/kernfs/dir.c b/fs/kernfs/dir.c
index bc8a3b3..d3c6623 100644
--- a/fs/kernfs/dir.c
+++ b/fs/kernfs/dir.c
@@ -17,7 +17,7 @@
 
 #include "kernfs-internal.h"
 
-DEFINE_MUTEX(sysfs_mutex);
+DEFINE_MUTEX(kernfs_mutex);
 
 #define rb_to_kn(X) rb_entry((X), struct kernfs_node, rb)
 
@@ -68,7 +68,7 @@
  *	@kn->parent->dir.children.
  *
  *	Locking:
- *	mutex_lock(sysfs_mutex)
+ *	mutex_lock(kernfs_mutex)
  *
  *	RETURNS:
  *	0 on susccess -EEXIST on failure.
@@ -109,7 +109,7 @@
  *	kn->parent->dir.children.
  *
  *	Locking:
- *	mutex_lock(sysfs_mutex)
+ *	mutex_lock(kernfs_mutex)
  */
 static void sysfs_unlink_sibling(struct kernfs_node *kn)
 {
@@ -251,7 +251,7 @@
 	}
 	kfree(kn->iattr);
 	ida_simple_remove(&root->ino_ida, kn->ino);
-	kmem_cache_free(sysfs_dir_cachep, kn);
+	kmem_cache_free(kernfs_node_cache, kn);
 
 	kn = parent;
 	if (kn) {
@@ -279,7 +279,7 @@
 		return -ECHILD;
 
 	kn = dentry->d_fsdata;
-	mutex_lock(&sysfs_mutex);
+	mutex_lock(&kernfs_mutex);
 
 	/* The sysfs dirent has been deleted */
 	if (kn->flags & KERNFS_REMOVED)
@@ -298,7 +298,7 @@
 	    kernfs_info(dentry->d_sb)->ns != kn->ns)
 		goto out_bad;
 
-	mutex_unlock(&sysfs_mutex);
+	mutex_unlock(&kernfs_mutex);
 out_valid:
 	return 1;
 out_bad:
@@ -312,7 +312,7 @@
 	 * is performed at its new name the dentry will be readded
 	 * to the dcache hashes.
 	 */
-	mutex_unlock(&sysfs_mutex);
+	mutex_unlock(&kernfs_mutex);
 
 	/* If we have submounts we must allow the vfs caches
 	 * to lie about the state of the filesystem to prevent
@@ -329,7 +329,7 @@
 	kernfs_put(dentry->d_fsdata);
 }
 
-const struct dentry_operations sysfs_dentry_ops = {
+const struct dentry_operations kernfs_dops = {
 	.d_revalidate	= sysfs_dentry_revalidate,
 	.d_delete	= sysfs_dentry_delete,
 	.d_release	= sysfs_dentry_release,
@@ -348,7 +348,7 @@
 			return NULL;
 	}
 
-	kn = kmem_cache_zalloc(sysfs_dir_cachep, GFP_KERNEL);
+	kn = kmem_cache_zalloc(kernfs_node_cache, GFP_KERNEL);
 	if (!kn)
 		goto err_out1;
 
@@ -367,7 +367,7 @@
 	return kn;
 
  err_out2:
-	kmem_cache_free(sysfs_dir_cachep, kn);
+	kmem_cache_free(kernfs_node_cache, kn);
  err_out1:
 	kfree(dup_name);
 	return NULL;
@@ -378,19 +378,19 @@
  *	@acxt: pointer to kernfs_addrm_cxt to be used
  *
  *	This function is called when the caller is about to add or remove
- *	kernfs_node.  This function acquires sysfs_mutex.  @acxt is used to
- *	keep and pass context to other addrm functions.
+ *	kernfs_node.  This function acquires kernfs_mutex.  @acxt is used
+ *	to keep and pass context to other addrm functions.
  *
  *	LOCKING:
- *	Kernel thread context (may sleep).  sysfs_mutex is locked on
+ *	Kernel thread context (may sleep).  kernfs_mutex is locked on
  *	return.
  */
 void sysfs_addrm_start(struct kernfs_addrm_cxt *acxt)
-	__acquires(sysfs_mutex)
+	__acquires(kernfs_mutex)
 {
 	memset(acxt, 0, sizeof(*acxt));
 
-	mutex_lock(&sysfs_mutex);
+	mutex_lock(&kernfs_mutex);
 }
 
 /**
@@ -503,13 +503,13 @@
  *	cleaned up.
  *
  *	LOCKING:
- *	sysfs_mutex is released.
+ *	kernfs_mutex is released.
  */
 void sysfs_addrm_finish(struct kernfs_addrm_cxt *acxt)
-	__releases(sysfs_mutex)
+	__releases(kernfs_mutex)
 {
 	/* release resources acquired by sysfs_addrm_start() */
-	mutex_unlock(&sysfs_mutex);
+	mutex_unlock(&kernfs_mutex);
 
 	/* kill removed kernfs_nodes */
 	while (acxt->removed) {
@@ -540,7 +540,7 @@
 	bool has_ns = kernfs_ns_enabled(parent);
 	unsigned int hash;
 
-	lockdep_assert_held(&sysfs_mutex);
+	lockdep_assert_held(&kernfs_mutex);
 
 	if (has_ns != (bool)ns) {
 		WARN(1, KERN_WARNING "sysfs: ns %s in '%s' for '%s'\n",
@@ -580,10 +580,10 @@
 {
 	struct kernfs_node *kn;
 
-	mutex_lock(&sysfs_mutex);
+	mutex_lock(&kernfs_mutex);
 	kn = kernfs_find_ns(parent, name, ns);
 	kernfs_get(kn);
-	mutex_unlock(&sysfs_mutex);
+	mutex_unlock(&kernfs_mutex);
 
 	return kn;
 }
@@ -683,7 +683,7 @@
 	struct inode *inode;
 	const void *ns = NULL;
 
-	mutex_lock(&sysfs_mutex);
+	mutex_lock(&kernfs_mutex);
 
 	if (kernfs_ns_enabled(parent))
 		ns = kernfs_info(dir->i_sb)->ns;
@@ -708,11 +708,11 @@
 	/* instantiate and hash dentry */
 	ret = d_materialise_unique(dentry, inode);
  out_unlock:
-	mutex_unlock(&sysfs_mutex);
+	mutex_unlock(&kernfs_mutex);
 	return ret;
 }
 
-const struct inode_operations sysfs_dir_inode_operations = {
+const struct inode_operations kernfs_dir_iops = {
 	.lookup		= sysfs_lookup,
 	.permission	= sysfs_permission,
 	.setattr	= sysfs_setattr,
@@ -759,7 +759,7 @@
 {
 	struct rb_node *rbn;
 
-	lockdep_assert_held(&sysfs_mutex);
+	lockdep_assert_held(&kernfs_mutex);
 
 	/* if first iteration, visit leftmost descendant which may be root */
 	if (!pos)
@@ -859,7 +859,7 @@
 {
 	int error;
 
-	mutex_lock(&sysfs_mutex);
+	mutex_lock(&kernfs_mutex);
 
 	error = 0;
 	if ((kn->parent == new_parent) && (kn->ns == new_ns) &&
@@ -894,7 +894,7 @@
 
 	error = 0;
  out:
-	mutex_unlock(&sysfs_mutex);
+	mutex_unlock(&kernfs_mutex);
 	return error;
 }
 
@@ -968,7 +968,7 @@
 
 	if (!dir_emit_dots(file, ctx))
 		return 0;
-	mutex_lock(&sysfs_mutex);
+	mutex_lock(&kernfs_mutex);
 
 	if (kernfs_ns_enabled(parent))
 		ns = kernfs_info(dentry->d_sb)->ns;
@@ -985,12 +985,12 @@
 		file->private_data = pos;
 		kernfs_get(pos);
 
-		mutex_unlock(&sysfs_mutex);
+		mutex_unlock(&kernfs_mutex);
 		if (!dir_emit(ctx, name, len, ino, type))
 			return 0;
-		mutex_lock(&sysfs_mutex);
+		mutex_lock(&kernfs_mutex);
 	}
-	mutex_unlock(&sysfs_mutex);
+	mutex_unlock(&kernfs_mutex);
 	file->private_data = NULL;
 	ctx->pos = INT_MAX;
 	return 0;
@@ -1008,7 +1008,7 @@
 	return ret;
 }
 
-const struct file_operations sysfs_dir_operations = {
+const struct file_operations kernfs_dir_fops = {
 	.read		= generic_read_dir,
 	.iterate	= sysfs_readdir,
 	.release	= sysfs_dir_release,