Skip to contentSkip to conversation

change type of dev_t

PATCH In review [email protected] 3 participants 3 messages Mar 18, 2003 – Mar 19, 2003 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 change type of dev_t

Below some random patch, not to be applied, so that people can play with a 32-bit dev_t.

Nothing here is hewn in stone.
By some coincidence the division below is 16+16, but a simple edit turns that into 12+20 or 32+32. Elsewhere there are no (well, there still are a few, but they will be eliminated), there are no assumptions on the sizes involved.

A major and a minor are unsigned ints of unknown size.

Of course not all filesystems can handle all sizes.

Andries

[I still see a B_FREE here - had removed that earlier, but perhaps the patch was not applied. There is another occurrence in video/pm3fb.h that can be removed, and one in video/pm3fb.c that should become NODEV. Will find this patch again.]

----------------------- 19-devt-type -----------------------

fs/libfs.c +1 -1
diff -u --recursive --new-file -X /linux/dontdiff a/fs/libfs.c b/fs/libfs.c
@@ -340,6 +340,6 @@
 const char * kdevname(kdev_t dev)
 {
 	static char buffer[32];
-	sprintf(buffer, "%02x:%02x", major(dev), minor(dev));
+	sprintf(buffer, "%04x:%04x", major(dev), minor(dev));
 	return buffer;
 }
include/asm-i386/posix_types.h +1 -1
diff -u --recursive --new-file -X /linux/dontdiff a/include/asm-i386/posix_types.h b/include/asm-i386/posix_types.h
@@ -7,7 +7,7 @@
  * assume GCC is being used.
  */
 
-typedef unsigned short	__kernel_dev_t;
+typedef unsigned long	__kernel_dev_t;
 typedef unsigned long	__kernel_ino_t;
 typedef unsigned short	__kernel_mode_t;
 typedef unsigned short	__kernel_nlink_t;
include/linux/kdev_t.h +55 -14

104 lines not on this page · raw message

#1 lore raw
Quoted 2 lines · On Tue, 2003-03-18 at 14:13, [email protected] wrote:

Below some random patch, not to be applied, so that people can play with a 32-bit dev_t.

I have dumped this set of patches into OSDL's patch system. The builds are still pending, but it should be possible in awhile to run tests with this patch stack in the automated test environment at OSDL.

The patch stack:

1st patch:
http://www.osdl.org/cgi-bin/plm?module=patch_info&patch_id=1706

2nd patch:
http://www.osdl.org/cgi-bin/plm?module=patch_info&patch_id=1707

3rd patch:
http://www.osdl.org/cgi-bin/plm?module=patch_info&patch_id=1708

4th patch to flip the switch:
http://www.osdl.org/cgi-bin/plm?module=patch_info&patch_id=1709

Regards,
Andy

#2 lore raw
In reply to [email protected]

include/asm-i386/posix_types.h line 10

Quoted 6 lines · [email protected] wrote:

* assume GCC is being used.
*/

include/asm-i386/posix_types.h +1 -1
-typedef unsigned short	__kernel_dev_t;
+typedef unsigned long	__kernel_dev_t;

Shouldn't this be
typedef unsigned int __kernel_dev_t;
according to

include/linux/kdev_t.h line 76

Quoted 9 lines
include/linux/kdev_t.h +1 -1
@@ -70,13 +70,13 @@
 * static arrays, and they are sized for a 8-bit index.
 */
 typedef struct {
-	unsigned short value;
+	unsigned int value;
 } kdev_t;
 
 

Andrey

Signature · 7 lines
-------------------------------------------------------------
Andrey Klochko
System Administrator
Sibley School of Mechanical and Aerospace Engineering
288 Grumman Hall
Cornell University
Ithaca, NY 14853