public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: James Bottomley <James.Bottomley@SteelEye.com>
Cc: linux-scsi@vger.kernel.org
Subject: [PATCH] don's export proc_scsi
Date: Mon, 25 Aug 2003 14:22:20 +0200	[thread overview]
Message-ID: <20030825122220.GC15506@lst.de> (raw)

proc_mkdir can also take absolute pathes, so we can avoid the export.


diff -Nru a/drivers/scsi/scsi_proc.c b/drivers/scsi/scsi_proc.c
--- a/drivers/scsi/scsi_proc.c	Mon Aug 25 13:37:20 2003
+++ b/drivers/scsi/scsi_proc.c	Mon Aug 25 13:37:20 2003
@@ -37,9 +37,7 @@
 /* 4K page size, but our output routines, use some slack for overruns */
 #define PROC_BLOCK_SIZE (3*1024)
 
-/* XXX: this shouldn't really be exposed to drivers. */
-struct proc_dir_entry *proc_scsi;
-EXPORT_SYMBOL(proc_scsi);
+static struct proc_dir_entry *proc_scsi;
 
 /* Protect sht->present and sht->proc_dir */
 static DECLARE_MUTEX(global_host_template_sem);
diff -Nru a/drivers/scsi/sg.c b/drivers/scsi/sg.c
--- a/drivers/scsi/sg.c	Mon Aug 25 13:37:20 2003
+++ b/drivers/scsi/sg.c	Mon Aug 25 13:37:20 2003
@@ -2583,7 +2583,7 @@
 
 static struct proc_dir_entry *sg_proc_sgp = NULL;
 
-static char sg_proc_sg_dirname[] = "sg";
+static char sg_proc_sg_dirname[] = "scsi/sg";
 
 static int sg_proc_adio_read(char *buffer, char **start, off_t offset,
 			     int size, int *eof, void *data);
@@ -2657,10 +2657,6 @@
 				size : begin + len - offset;    \
     } while(0)
 
-/* this should _really_ be private to the scsi midlayer.  But
-   /proc/scsi/sg is an established name, so.. */
-extern struct proc_dir_entry *proc_scsi;
-
 static int
 sg_proc_init(void)
 {
@@ -2670,10 +2666,8 @@
 	struct proc_dir_entry *pdep;
 	struct sg_proc_leaf * leaf;
 
-	if (!proc_scsi)
-		return 1;
 	sg_proc_sgp = create_proc_entry(sg_proc_sg_dirname,
-					S_IFDIR | S_IRUGO | S_IXUGO, proc_scsi);
+					S_IFDIR | S_IRUGO | S_IXUGO, NULL);
 	if (!sg_proc_sgp)
 		return 1;
 	for (k = 0; k < num_leaves; ++k) {
@@ -2696,11 +2690,11 @@
 	int num_leaves =
 	    sizeof (sg_proc_leaf_arr) / sizeof (sg_proc_leaf_arr[0]);
 
-	if ((!proc_scsi) || (!sg_proc_sgp))
+	if (!sg_proc_sgp)
 		return;
 	for (k = 0; k < num_leaves; ++k)
 		remove_proc_entry(sg_proc_leaf_arr[k].name, sg_proc_sgp);
-	remove_proc_entry(sg_proc_sg_dirname, proc_scsi);
+	remove_proc_entry(sg_proc_sg_dirname, NULL);
 }
 
 static int

                 reply	other threads:[~2003-08-25 12:22 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=20030825122220.GC15506@lst.de \
    --to=hch@lst.de \
    --cc=James.Bottomley@SteelEye.com \
    --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