From: Christoph Hellwig <hch@lst.de>
To: torvalds@transmeta.com
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] devfs (5/7) - sanitize devfs_register_tape prototype
Date: Fri, 18 Apr 2003 18:13:04 +0200 [thread overview]
Message-ID: <20030418181304.E363@lst.de> (raw)
Pass in the path directly instead of getting it from a devfs_handle_t.
diff -Nru a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
--- a/drivers/ide/ide-tape.c Fri Apr 18 15:58:31 2003
+++ b/drivers/ide/ide-tape.c Fri Apr 18 15:58:31 2003
@@ -6318,7 +6318,7 @@
S_IFCHR | S_IRUGO | S_IWUGO,
&idetape_fops, NULL);
- drive->disk->number = devfs_register_tape(drive->de);
+ drive->disk->number = devfs_register_tape(drive->devfs_name);
drive->disk->fops = &idetape_block_ops;
return 0;
failed:
diff -Nru a/drivers/scsi/osst.c b/drivers/scsi/osst.c
--- a/drivers/scsi/osst.c Fri Apr 18 15:58:31 2003
+++ b/drivers/scsi/osst.c Fri Apr 18 15:58:31 2003
@@ -5571,7 +5571,7 @@
S_IFCHR | S_IRUGO | S_IWUGO,
&osst_fops, NULL);
}
- drive->number = devfs_register_tape (SDp->de);
+ drive->number = devfs_register_tape(SDp->devfs_name);
printk(KERN_INFO
"osst :I: Attached OnStream %.5s tape at scsi%d, channel %d, id %d, lun %d as %s\n",
diff -Nru a/drivers/scsi/st.c b/drivers/scsi/st.c
--- a/drivers/scsi/st.c Fri Apr 18 15:58:31 2003
+++ b/drivers/scsi/st.c Fri Apr 18 15:58:31 2003
@@ -3909,7 +3909,7 @@
S_IFCHR | S_IRUGO | S_IWUGO,
&st_fops, NULL);
}
- disk->number = devfs_register_tape(SDp->de);
+ disk->number = devfs_register_tape(SDp->devfs_name);
printk(KERN_WARNING
"Attached scsi tape %s at scsi%d, channel %d, id %d, lun %d\n",
diff -Nru a/fs/devfs/util.c b/fs/devfs/util.c
--- a/fs/devfs/util.c Fri Apr 18 15:58:31 2003
+++ b/fs/devfs/util.c Fri Apr 18 15:58:31 2003
@@ -77,28 +77,18 @@
#define PRINTK(format, args...) \
{printk (KERN_ERR "%s" format, __FUNCTION__ , ## args);}
-
-/* Private functions follow */
-
-/**
- * devfs_register_tape - Register a tape device in the "/dev/tapes" hierarchy.
- * @de: Any tape device entry in the device directory.
- */
-
-int devfs_register_tape (devfs_handle_t de)
+int devfs_register_tape(const char *name)
{
- int pos;
- char name[32], dest[64];
- static unsigned int tape_counter;
- int n = tape_counter++;
+ char tname[32], dest[64];
+ static unsigned int tape_counter;
+ unsigned int n = tape_counter++;
+
+ sprintf(dest, "../%s", name);
+ sprintf(tname, "tapes/tape%u", n);
+ devfs_mk_symlink(tname, dest);
- pos = devfs_generate_path (de, dest + 3, sizeof dest - 3);
- if (pos < 0) return -1;
- strncpy (dest + pos, "../", 3);
- sprintf (name, "tapes/tape%u", n);
- devfs_mk_symlink (name, dest + pos);
- return n;
-} /* End Function devfs_register_tape */
+ return n;
+}
EXPORT_SYMBOL(devfs_register_tape);
void devfs_unregister_tape(int num)
diff -Nru a/include/linux/devfs_fs_kernel.h b/include/linux/devfs_fs_kernel.h
--- a/include/linux/devfs_fs_kernel.h Fri Apr 18 15:58:31 2003
+++ b/include/linux/devfs_fs_kernel.h Fri Apr 18 15:58:31 2003
@@ -32,7 +32,7 @@
extern void devfs_remove(const char *fmt, ...)
__attribute__((format (printf, 1, 2)));
extern int devfs_generate_path (devfs_handle_t de, char *path, int buflen);
-extern int devfs_register_tape (devfs_handle_t de);
+extern int devfs_register_tape(const char *name);
extern void devfs_unregister_tape(int num);
extern void devfs_create_partitions(struct gendisk *dev);
extern void devfs_create_cdrom(struct gendisk *dev);
reply other threads:[~2003-04-18 16:05 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=20030418181304.E363@lst.de \
--to=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/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