summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Viro <viro@www.linux.org.uk>2003-08-30 22:50:40 -0700
committerLinus Torvalds <torvalds@home.osdl.org>2003-08-30 22:50:40 -0700
commit4b7ff05c752dc218a1b3cffcea960fe139283a9d (patch)
treec398b92a36cd464486008a032c9b4a88976f3dd1
parent2476962126efb1b717cb71cd4c249171cb4abc25 (diff)
[PATCH] dev_t handling cleanups (4/12)
jffs used to put kdev_t values on disk - blind copy of in-core representation. Switched to explicit use of u16 (which is what kdev_t currently is), with appropriate conversion
-rw-r--r--fs/jffs/inode-v23.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/fs/jffs/inode-v23.c b/fs/jffs/inode-v23.c
index 447ecc14e4e0..81bb564f984f 100644
--- a/fs/jffs/inode-v23.c
+++ b/fs/jffs/inode-v23.c
@@ -1080,9 +1080,11 @@ jffs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t rdev)
struct jffs_control *c;
struct inode *inode;
int result = 0;
- kdev_t dev = to_kdev_t(rdev);
+ u16 data;
int err;
+ data = (MAJOR(rdev) << 8) | MINOR(rdev);
+
D1(printk("***jffs_mknod()\n"));
lock_kernel();
@@ -1114,7 +1116,7 @@ jffs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t rdev)
raw_inode.mtime = raw_inode.atime;
raw_inode.ctime = raw_inode.atime;
raw_inode.offset = 0;
- raw_inode.dsize = sizeof(kdev_t);
+ raw_inode.dsize = 2;
raw_inode.rsize = 0;
raw_inode.nsize = dentry->d_name.len;
raw_inode.nlink = 1;
@@ -1124,7 +1126,7 @@ jffs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t rdev)
/* Write the new node to the flash. */
if ((err = jffs_write_node(c, node, &raw_inode, dentry->d_name.name,
- (unsigned char *)&dev, 0, NULL)) < 0) {
+ (unsigned char *)&data, 0, NULL)) < 0) {
D(printk("jffs_mknod(): jffs_write_node() failed.\n"));
result = err;
goto jffs_mknod_err;
@@ -1732,9 +1734,10 @@ jffs_read_inode(struct inode *inode)
/* If the node is a device of some sort, then the number of
the device should be read from the flash memory and then
added to the inode's i_rdev member. */
- kdev_t rdev;
- jffs_read_data(f, (char *)&rdev, 0, sizeof(kdev_t));
- init_special_inode(inode, inode->i_mode, kdev_t_to_nr(rdev));
+ u16 val;
+ jffs_read_data(f, (char *)val, 0, 2);
+ init_special_inode(inode, inode->i_mode,
+ MKDEV((val >> 8) & 255, val & 255));
}
D3(printk (KERN_NOTICE "read_inode(): up biglock\n"));