summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Viro <viro@www.linux.org.uk>2003-09-04 20:54:18 -0700
committerLinus Torvalds <torvalds@home.osdl.org>2003-09-04 20:54:18 -0700
commit5900b09861dd856ca475dd444793ff6c671acc84 (patch)
treec3e0880c7da7dca73414684d06df87eeef1cf2c4
parentad1da81a8a2acf7ceda4e8aa67e159ff223dc337 (diff)
[PATCH] large dev_t - second series (8/15)
kdev_t, to_kdev_t(), etc. are gone - there is no more objects of that type and no remaining callers of these functions.
-rw-r--r--drivers/s390/char/tape_core.c2
-rw-r--r--drivers/s390/char/tape_proc.c2
-rw-r--r--drivers/scsi/sg.c2
-rw-r--r--drivers/scsi/sr.c2
-rw-r--r--include/linux/kdev_t.h99
-rw-r--r--net/unix/af_unix.c2
6 files changed, 5 insertions, 104 deletions
diff --git a/drivers/s390/char/tape_core.c b/drivers/s390/char/tape_core.c
index 7656f1eddc6e..48fb7e002944 100644
--- a/drivers/s390/char/tape_core.c
+++ b/drivers/s390/char/tape_core.c
@@ -178,7 +178,7 @@ tape_assign_minor(struct tape_device *device)
break;
minor += TAPE_MINORS_PER_DEV;
}
- if (minor >= (1 << KDEV_MINOR_BITS)) {
+ if (minor >= 256) {
write_unlock(&tape_device_lock);
return -ENODEV;
}
diff --git a/drivers/s390/char/tape_proc.c b/drivers/s390/char/tape_proc.c
index da3a4d3ed310..5857f846101f 100644
--- a/drivers/s390/char/tape_proc.c
+++ b/drivers/s390/char/tape_proc.c
@@ -80,7 +80,7 @@ static int tape_proc_show(struct seq_file *m, void *v)
static void *tape_proc_start(struct seq_file *m, loff_t *pos)
{
- if (*pos >= (1 << KDEV_MINOR_BITS) / TAPE_MINORS_PER_DEV)
+ if (*pos >= 256 / TAPE_MINORS_PER_DEV)
return NULL;
return (void *)((unsigned long) *pos + 1);
}
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 0a5497ea2389..facb6f9fee35 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -83,7 +83,7 @@ static void sg_proc_cleanup(void);
#define SG_ALLOW_DIO_DEF 0
#define SG_ALLOW_DIO_CODE /* compile out by commenting this define */
-#define SG_MAX_DEVS_MASK ((1U << KDEV_MINOR_BITS) - 1)
+#define SG_MAX_DEVS_MASK (256 - 1)
/*
* Suppose you want to calculate the formula muldiv(x,m,d)=int(x * m / d)
diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
index 089510b7a819..d3a646260380 100644
--- a/drivers/scsi/sr.c
+++ b/drivers/scsi/sr.c
@@ -59,7 +59,7 @@
MODULE_PARM(xa_test, "i"); /* see sr_ioctl.c */
-#define SR_DISKS (1 << KDEV_MINOR_BITS)
+#define SR_DISKS 256
#define MAX_RETRIES 3
#define SR_TIMEOUT (30 * HZ)
diff --git a/include/linux/kdev_t.h b/include/linux/kdev_t.h
index 64a88b3b194a..f60508da024d 100644
--- a/include/linux/kdev_t.h
+++ b/include/linux/kdev_t.h
@@ -1,91 +1,6 @@
#ifndef _LINUX_KDEV_T_H
#define _LINUX_KDEV_T_H
#ifdef __KERNEL__
-/*
-As a preparation for the introduction of larger device numbers,
-we introduce a type kdev_t to hold them. No information about
-this type is known outside of this include file.
-
-Objects of type kdev_t designate a device. Outside of the kernel
-the corresponding things are objects of type dev_t - usually an
-integral type with the device major and minor in the high and low
-bits, respectively. Conversion is done by
-
-extern kdev_t to_kdev_t(int);
-
-It is up to the various file systems to decide how objects of type
-dev_t are stored on disk.
-The only other point of contact between kernel and outside world
-are the system calls stat and mknod, new versions of which will
-eventually have to be used in libc.
-
-[Unfortunately, the floppy control ioctls fail to hide the internal
-kernel structures, and the fd_device field of a struct floppy_drive_struct
-is user-visible. So, it remains a dev_t for the moment, with some ugly
-conversions in floppy.c.]
-
-Inside the kernel, we aim for a kdev_t type that is a pointer
-to a structure with information about the device (like major,
-minor, size, blocksize, sectorsize, name, read-only flag,
-struct file_operations etc.).
-
-However, for the time being we let kdev_t be almost the same as dev_t:
-
-typedef struct { unsigned short major, minor; } kdev_t;
-
-Admissible operations on an object of type kdev_t:
-- passing it along
-- comparing it for equality with another such object
-- storing it in inode->i_rdev or tty->device
-- using its bit pattern as argument in a hash function
-- finding its major and minor
-- complaining about it
-
-An object of type kdev_t is created only by the function MKDEV(),
-with the single exception of the constant 0 (no device).
-
-Right now the other information mentioned above is usually found
-in static arrays indexed by major or major,minor.
-
-An obstacle to immediately using
- typedef struct { ... (* lots of information *) } *kdev_t
-is the case of mknod used to create a block device that the
-kernel doesn't know about at present (but first learns about
-when some module is inserted).
-
-aeb - 950811
-*/
-
-
-/*
- * NOTE NOTE NOTE!
- *
- * The kernel-internal "kdev_t" will eventually have
- * 20 bits for minor numbers, and 12 bits for majors.
- *
- * HOWEVER, the external representation is still 8+8
- * bits, and there is no way to generate the extended
- * "kdev_t" format yet. Which is just as well, since
- * we still use "minor" as an index into various
- * static arrays, and they are sized for a 8-bit index.
- */
-typedef struct {
- unsigned short value;
-} kdev_t;
-
-#define KDEV_MINOR_BITS 8
-#define KDEV_MAJOR_BITS 8
-
-#define __mkdev(major,minor) (((major) << KDEV_MINOR_BITS) + (minor))
-
-#define mk_kdev(major, minor) ((kdev_t) { __mkdev(major,minor) } )
-
-#define NODEV (mk_kdev(0,0))
-
-/* Mask off the high bits for now.. */
-#define minor(dev) ((dev).value & 0xff)
-#define major(dev) (((dev).value >> KDEV_MINOR_BITS) & 0xff)
-
/* These are for user-level "dev_t" */
#define MINORBITS 8
#define MINORMASK ((1U << MINORBITS) - 1)
@@ -94,20 +9,6 @@ typedef struct {
#define MINOR(dev) ((unsigned int) ((dev) & MINORMASK))
#define MKDEV(ma,mi) (((ma) << MINORBITS) | (mi))
-/*
- * Conversion functions
- */
-
-static inline int kdev_t_to_nr(kdev_t dev)
-{
- return MKDEV(major(dev), minor(dev));
-}
-
-static inline kdev_t to_kdev_t(int dev)
-{
- return mk_kdev(MAJOR(dev),MINOR(dev));
-}
-
#define print_dev_t(buffer, dev) \
sprintf((buffer), "%u:%u\n", MAJOR(dev), MINOR(dev))
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 549c7e303144..61ea1a9f2a2b 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -57,7 +57,7 @@
* [TO FIX]
* ECONNREFUSED is not returned from one end of a connected() socket to the
* other the moment one end closes.
- * fstat() doesn't return st_dev=NODEV, and give the blksize as high water mark
+ * fstat() doesn't return st_dev=0, and give the blksize as high water mark
* and a fake inode identifier (nor the BSD first socket fstat twice bug).
* [NOT TO FIX]
* accept() returns a path name even if the connecting socket has closed