mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
To: "Linux-iSCSI.org Target Dev"  <linux-iscsi-target-dev@googlegroups.com>
Cc: linux-scsi <linux-scsi@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Joel Becker <joel.becker@oracle.com>
Subject: [PATCH] [Target_Core_Mod/ConfigFS 12/12]: Remove do_configfs_mkdir() and do_configfs_rmdir()
Date: Fri, 12 Dec 2008 01:37:02 -0800	[thread overview]
Message-ID: <1229074622.4153.664.camel@haakon2.linux-iscsi.org> (raw)

>From 79f98e53a0b4906cd5b4bfadf2d65345c3dcf8a5 Mon Sep 17 00:00:00 2001
From: Nicholas Bellinger <nab@linux-iscsi.org>
Date: Fri, 12 Dec 2008 01:07:06 -0800
Subject: [PATCH] [Target_Core_Mod/ConfigFS]: Remove do_configfs_mkdir() and do_configfs_rmdir()

This patch removes the temporary debug functions used for Target_Core_Mod and
LIO-Target v3.0 bringup, as required by the ConfigFS maintainer.

Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
---
 drivers/lio-core/target_core_configfs.c |  122 +------------------------------
 1 files changed, 4 insertions(+), 118 deletions(-)

diff --git a/drivers/lio-core/target_core_configfs.c b/drivers/lio-core/target_core_configfs.c
index 77950c1..0fceeab 100644
--- a/drivers/lio-core/target_core_configfs.c
+++ b/drivers/lio-core/target_core_configfs.c
@@ -34,19 +34,11 @@
 #include <linux/syscalls.h>
 #include <linux/configfs.h>
 
-#include <iscsi_debug.h>
-#include <iscsi_lists.h>
-#include <iscsi_protocol.h>
-#include <iscsi_debug_opcodes.h>
-#include <iscsi_target_core.h>
 #include <target_core_base.h>
-#include <iscsi_target_error.h>
 #include <target_core_device.h>
-#include <iscsi_target_device.h>
 #include <target_core_hba.h>
 #include <target_core_plugin.h>
 #include <target_core_transport.h>
-#include <iscsi_target.h>
 
 #ifdef SNMP_SUPPORT
 #include <linux/proc_fs.h>
@@ -325,116 +317,6 @@ extern struct config_item *target_fabric_configfs_find_by_name (
 	return(fabric);
 }
 
-static long do_configfs_mkdir (struct config_item *item, const char *path, int mode)
-{
-//	char *s;
-	struct dentry *dentry;
-	struct nameidata nd;
-	int error = 0;	
-#if 0
-	s = __getname();
-	if (IS_ERR(s)) {
-		printk("__getname() failed\n");
-		return(PTR_ERR(s));
-	}
-#endif
-	if ((error = path_lookup(path, LOOKUP_PARENT, &nd))) {
-		printk("path_lookup() failed for %s, error: %d\n", path, error);
-//		putname(s);
-		return(error);
-	}
-
-	dentry = lookup_create(&nd, 1);
-	error = PTR_ERR(dentry);
-	if (IS_ERR(dentry)) {
-		printk("lookup_create() returned error: %d\n", error);
-		goto out;
-	}
-
-	printk("Calling vfs_mkdir() d_inode: %p dentry: %p\n",
-		item->ci_dentry->d_inode, dentry);
-
-	error = vfs_mkdir(item->ci_dentry->d_inode, dentry, mode);
-	
-	dput(dentry);
-out:
-	mutex_unlock(&nd.path.dentry->d_inode->i_mutex);
-	path_put(&nd.path);
-//	putname(s);
-
-	return(error);
-}
-
-#if 1
-
-/*
- * fs/namei.c:lookup_hash() is not defined as EXPORT_SYMBOL()
- */
-extern struct dentry *lookup_hash(struct nameidata *);
-
-static long do_configfs_rmdir (struct config_item *item, const char *path)
-{
-	struct dentry *dentry;
-	struct nameidata nd;
-	int error = 0;
-	
-	if ((error = path_lookup(path, LOOKUP_PARENT, &nd))) {
-		printk("path_lookup() failed for %s, error: %d\n", path, error);
-		return(error);
-	}
-
-	/*
-	 * lookup_hash() is not exported from fs/namei.c..
-	 */
-	mutex_lock_nested(&nd.path.dentry->d_inode->i_mutex, I_MUTEX_PARENT);
-	dentry = lookup_hash(&nd);
-	error = PTR_ERR(dentry);
-	if (IS_ERR(dentry)) {
-		printk("lookup_hash() returned error: %d\n", error);
-		goto unlock;
-	}
-
-	printk("Calling vfs_rmdir() d_inode: %p dentry: %p\n",
-		item->ci_dentry->d_inode, dentry);
-
-	error = vfs_rmdir(item->ci_dentry->d_inode, dentry);
-
-	dput(dentry);
-unlock:
-	mutex_unlock(&nd.path.dentry->d_inode->i_mutex);
-	path_put(&nd.path);
-
-	return(error);
-}
-
-#else
-
-static long do_configfs_rmdir (struct config_item *item, const char *path)
-{
-	struct dentry *dentry;
-	int error = 0;
-
-	mutex_lock(&item->ci_dentry->d_inode->i_mutex);	
-	dentry = lookup_one_len(path, item->ci_dentry, strlen(path));
-	error = PTR_ERR(dentry);
-	if (IS_ERR(dentry)) {
-		printk("lookup_one_len() returned error: %d\n", error);
-		goto unlock;
-	}
-
-	printk("Calling vfs_rmdir() d_inode: %p dentry: %p\n",
-		item->ci_dentry->d_inode, dentry);
-	error = vfs_rmdir(item->ci_dentry->d_inode, dentry);
-	printk("vfs_rmdir() returned %d\n", error);
-	
-	dput(dentry);
-unlock:
-	mutex_unlock(&item->ci_dentry->d_inode->i_mutex);
-	return(error);
-}
-
-#endif
-
 /*
  * Called 2nd from fabric module with returned parameter of
  * struct target_fabric_configfs * from target_fabric_configfs_init().
@@ -1112,6 +994,10 @@ extern int target_core_init_configfs (void)
 #endif
 	int ret;
 
+	printk("TARGET_CORE[0]: Loading Generic Kernel Storage Engine: %s on %s/%s"
+		" on "UTS_RELEASE"\n", TARGET_CORE_VERSION, utsname()->sysname,
+		utsname()->machine);
+
 	subsys = target_core_subsystem[0];	
 	config_group_init(&subsys->su_group);
 	mutex_init(&subsys->su_mutex);
-- 
1.5.4.1




                 reply	other threads:[~2008-12-12  9:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1229074622.4153.664.camel@haakon2.linux-iscsi.org \
    --to=nab@linux-iscsi.org \
    --cc=joel.becker@oracle.com \
    --cc=linux-iscsi-target-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.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

all inboxes | Powered by JetHome®