public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: torvalds@transmeta.com
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] remove devfs_register
Date: Thu, 8 May 2003 22:34:49 +0200	[thread overview]
Message-ID: <20030508223449.A29413@lst.de> (raw)

Whee! devfs_register isn't used anymore in the whole tree and with
it some other devfs crap.  Kill it for good.


--- 1.45/include/linux/devfs_fs_kernel.h	Fri May  2 09:55:04 2003
+++ edited/include/linux/devfs_fs_kernel.h	Thu May  8 21:09:11 2003
@@ -11,20 +11,7 @@
 
 #define DEVFS_SUPER_MAGIC                0x1373
 
-#define DEVFS_FL_NONE           0x000 /* This helps to make code more readable
-				         no, it doesn't  --hch */
-#define DEVFS_FL_DEFAULT        DEVFS_FL_NONE
-
-
-typedef struct devfs_entry * devfs_handle_t;
-
-struct gendisk;
-
 #ifdef CONFIG_DEVFS_FS
-extern devfs_handle_t devfs_register (devfs_handle_t dir, const char *name,
-				      unsigned int flags,
-				      unsigned int major, unsigned int minor,
-				      umode_t mode, void *ops, void *info);
 extern int devfs_mk_bdev(dev_t dev, umode_t mode, const char *fmt, ...)
 	__attribute__((format (printf, 3, 4)));
 extern int devfs_mk_cdev(dev_t dev, umode_t mode, const char *fmt, ...)
@@ -36,19 +23,8 @@
 	__attribute__((format (printf, 1, 2)));
 extern int devfs_register_tape(const char *name);
 extern void devfs_unregister_tape(int num);
-extern void devfs_register_partition(struct gendisk *dev, int part);
 extern void mount_devfs_fs(void);
 #else  /*  CONFIG_DEVFS_FS  */
-static inline devfs_handle_t devfs_register (devfs_handle_t dir,
-					     const char *name,
-					     unsigned int flags,
-					     unsigned int major,
-					     unsigned int minor,
-					     umode_t mode,
-					     void *ops, void *info)
-{
-    return NULL;
-}
 static inline int devfs_mk_bdev(dev_t dev, umode_t mode, const char *fmt, ...)
 {
 	return 0;
@@ -73,9 +49,6 @@
     return -1;
 }
 static inline void devfs_unregister_tape(int num)
-{
-}
-static inline void devfs_register_partition(struct gendisk *dev, int part)
 {
 }
 static inline void mount_devfs_fs (void)
--- 1.88/fs/devfs/base.c	Fri May  2 09:55:04 2003
+++ edited/fs/devfs/base.c	Thu May  8 21:09:58 2003
@@ -752,6 +752,7 @@
 #  define DPRINTK(flag, format, args...)
 #endif
 
+typedef struct devfs_entry *devfs_handle_t;
 
 struct directory_type
 {
@@ -1424,98 +1425,6 @@
 			 current->egid, &fs_info);
 } 
 
-
-/**
- *	devfs_register - Register a device entry.
- *	@dir: The handle to the parent devfs directory entry. If this is %NULL the
- *		new name is relative to the root of the devfs.
- *	@name: The name of the entry.
- *	@flags: Must be 0
- *	@major: The major number. Not needed for regular files.
- *	@minor: The minor number. Not needed for regular files.
- *	@mode: The default file mode.
- *	@ops: The &file_operations or &block_device_operations structure.
- *		This must not be externally deallocated.
- *	@info: An arbitrary pointer which will be written to the @private_data
- *		field of the &file structure passed to the device driver. You can set
- *		this to whatever you like, and change it once the file is opened (the next
- *		file opened will not see this change).
- *
- *	On failure %NULL is returned.
- */
-
-devfs_handle_t devfs_register (devfs_handle_t dir, const char *name,
-			       unsigned int flags,
-			       unsigned int major, unsigned int minor,
-			       umode_t mode, void *ops, void *info)
-{
-    int err;
-    dev_t devnum = 0, dev = MKDEV(major, minor);
-    struct devfs_entry *de;
-
-    /* we don't accept any flags anymore.  prototype will change soon. */
-    WARN_ON(flags);
-    WARN_ON(dir);
-    WARN_ON(!S_ISCHR(mode));
-
-    if (name == NULL)
-    {
-	PRINTK ("(): NULL name pointer\n");
-	return NULL;
-    }
-    if (ops == NULL)
-    {
-	PRINTK ("(%s): NULL ops pointer\n", name);
-	return NULL;
-    }
-    if ( S_ISDIR (mode) )
-    {
-	PRINTK ("(%s): creating directories is not allowed\n", name);
-	return NULL;
-    }
-    if ( S_ISLNK (mode) )
-    {
-	PRINTK ("(%s): creating symlinks is not allowed\n", name);
-	return NULL;
-    }
-    if ( ( de = _devfs_prepare_leaf (&dir, name, mode) ) == NULL )
-    {
-	PRINTK ("(%s): could not prepare leaf\n", name);
-	if (devnum) devfs_dealloc_devnum (mode, devnum);
-	return NULL;
-    }
-    if (S_ISCHR (mode)) {
-	de->u.cdev.dev = dev;
-	de->u.cdev.autogen = devnum != 0;
-	de->u.cdev.ops = ops;
-    } else if (S_ISBLK (mode)) {
-	de->u.bdev.dev = dev;
-	de->u.cdev.autogen = devnum != 0;
-    } else {
-	PRINTK ("(%s): illegal mode: %x\n", name, mode);
-	devfs_put (de);
-	devfs_put (dir);
-	return (NULL);
-    }
-    de->info = info;
-    de->inode.uid = 0;
-    de->inode.gid = 0;
-    err = _devfs_append_entry(dir, de, NULL);
-    if (err)
-    {
-	PRINTK ("(%s): could not append to parent, err: %d\n", name, err);
-	devfs_put (dir);
-	if (devnum) devfs_dealloc_devnum (mode, devnum);
-	return NULL;
-    }
-    DPRINTK (DEBUG_REGISTER, "(%s): de: %p dir: %p \"%s\"  pp: %p\n",
-	     name, de, dir, dir->name, dir->parent);
-    devfsd_notify (de, DEVFSD_NOTIFY_REGISTERED);
-    devfs_put (dir);
-    return de;
-}   /*  End Function devfs_register  */
-
-
 int devfs_mk_bdev(dev_t dev, umode_t mode, const char *fmt, ...)
 {
 	struct devfs_entry *dir = NULL, *de;
@@ -1935,7 +1844,6 @@
 __setup("devfs=", devfs_setup);
 
 EXPORT_SYMBOL(devfs_put);
-EXPORT_SYMBOL(devfs_register);
 EXPORT_SYMBOL(devfs_mk_symlink);
 EXPORT_SYMBOL(devfs_mk_dir);
 EXPORT_SYMBOL(devfs_remove);

             reply	other threads:[~2003-05-08 20:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-08 20:34 Christoph Hellwig [this message]
2003-05-08 17:18 ` [PATCH] remove devfs_register Daniele Pala
2003-05-08 21:48 ` Andrew Morton
2003-05-08 23:44   ` Jesse Barnes
2003-05-09  5:37   ` Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2003-05-08 21:43 jordan.breeding

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=20030508223449.A29413@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