From: Luc Van Oostenryck <luc.vanoostenryck@easynet.be>
To: Linus Torvalds <torvalds@transmeta.com>,
Kernel mailing list <linux-kernel@vger.kernel.org>
Subject: [PATCH] 2.5.2-pre7: fix up devfs
Date: Thu, 03 Jan 2002 23:59:28 +0100 [thread overview]
Message-ID: <3C34E250.FF00856D@easynet.be> (raw)
[-- Attachment #1: Type: text/plain, Size: 62 bytes --]
here's a patch to fix the devfs part:
--
Luc Van Oostenryck
[-- Attachment #2: devfs-2.5.2.6.patch --]
[-- Type: application/octet-stream, Size: 3518 bytes --]
diff -ur linux-2.5.2-pre7/fs/devfs/base.c linux/fs/devfs/base.c
--- linux-2.5.2-pre7/fs/devfs/base.c Thu Jan 3 23:34:49 2002
+++ linux/fs/devfs/base.c Thu Jan 3 23:42:03 2002
@@ -894,7 +894,7 @@
{
devfs_dealloc_devnum ( S_ISCHR (de->mode) ? DEVFS_SPECIAL_CHR :
DEVFS_SPECIAL_BLK,
- MKDEV (de->u.fcb.u.device.major,
+ mk_kdev(de->u.fcb.u.device.major,
de->u.fcb.u.device.minor) );
}
WRITE_ENTRY_MAGIC (de, 0);
@@ -1552,7 +1552,7 @@
if ( ( S_ISCHR (mode) || S_ISBLK (mode) ) &&
(flags & DEVFS_FL_AUTO_DEVNUM) )
{
- if ( ( devnum = devfs_alloc_devnum (devtype) ) == NODEV )
+ if ( kdev_none( devnum = devfs_alloc_devnum (devtype) ) )
{
PRINTK ("(%s): exhausted %s device numbers\n",
name, S_ISCHR (mode) ? "char" : "block");
@@ -1564,14 +1564,14 @@
if ( ( de = _devfs_prepare_leaf (&dir, name, mode) ) == NULL )
{
PRINTK ("(%s): could not prepare leaf\n", name);
- if (devnum != NODEV) devfs_dealloc_devnum (devtype, devnum);
+ if (!kdev_none(devnum)) devfs_dealloc_devnum (devtype, devnum);
return NULL;
}
if ( S_ISCHR (mode) || S_ISBLK (mode) )
{
de->u.fcb.u.device.major = major;
de->u.fcb.u.device.minor = minor;
- de->u.fcb.autogen = (devnum == NODEV) ? FALSE : TRUE;
+ de->u.fcb.autogen = kdev_none(devnum) ? FALSE : TRUE;
}
else if ( !S_ISREG (mode) )
{
@@ -1601,7 +1601,7 @@
{
PRINTK ("(%s): could not append to parent, err: %d\n", name, err);
devfs_put (dir);
- if (devnum != NODEV) devfs_dealloc_devnum (devtype, devnum);
+ if (!kdev_none(devnum)) devfs_dealloc_devnum (devtype, devnum);
return NULL;
}
DPRINTK (DEBUG_REGISTER, "(%s): de: %p dir: %p \"%s\" pp: %p\n",
@@ -2413,7 +2413,7 @@
{
int tmp;
int retval = 0;
- kdev_t dev = MKDEV (de->u.fcb.u.device.major, de->u.fcb.u.device.minor);
+ kdev_t dev = mk_kdev(de->u.fcb.u.device.major, de->u.fcb.u.device.minor);
struct block_device_operations *bdops;
extern int warn_no_part;
@@ -2599,14 +2599,14 @@
inode->i_rdev = NODEV;
if ( S_ISCHR (de->mode) )
{
- inode->i_rdev = MKDEV (de->u.fcb.u.device.major,
+ inode->i_rdev = mk_kdev(de->u.fcb.u.device.major,
de->u.fcb.u.device.minor);
inode->i_cdev = cdget ( kdev_t_to_nr (inode->i_rdev) );
is_fcb = TRUE;
}
else if ( S_ISBLK (de->mode) )
{
- inode->i_rdev = MKDEV (de->u.fcb.u.device.major,
+ inode->i_rdev = mk_kdev(de->u.fcb.u.device.major,
de->u.fcb.u.device.minor);
if (bd_acquire (inode) == 0)
{
diff -ur linux-2.5.2-pre7/fs/devfs/util.c linux/fs/devfs/util.c
--- linux-2.5.2-pre7/fs/devfs/util.c Thu Jan 3 23:34:49 2002
+++ linux/fs/devfs/util.c Thu Jan 3 23:45:14 2002
@@ -267,7 +267,7 @@
if (minor >= 256) continue;
__set_bit (minor, entry->bits);
up (semaphore);
- return MKDEV (entry->major, minor);
+ return mk_kdev(entry->major, minor);
}
/* Need to allocate a new major */
if ( ( entry = kmalloc (sizeof *entry, GFP_KERNEL) ) == NULL )
@@ -289,7 +289,7 @@
else list->last->next = entry;
list->last = entry;
up (semaphore);
- return MKDEV (entry->major, 0);
+ return mk_kdev(entry->major, 0);
} /* End Function devfs_alloc_devnum */
EXPORT_SYMBOL(devfs_alloc_devnum);
@@ -309,7 +309,7 @@
struct device_list *list;
struct minor_list *entry;
- if (devnum == NODEV) return;
+ if (kdev_none(devnum)) return;
if (type == DEVFS_SPECIAL_CHR)
{
semaphore = &char_semaphore;
reply other threads:[~2002-01-03 23:00 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=3C34E250.FF00856D@easynet.be \
--to=luc.vanoostenryck@easynet.be \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.