aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs2/dir.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/jffs2/dir.c')
-rw-r--r--fs/jffs2/dir.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/fs/jffs2/dir.c b/fs/jffs2/dir.c
index 1c8e8c0f6cea..a6c11cef1b73 100644
--- a/fs/jffs2/dir.c
+++ b/fs/jffs2/dir.c
@@ -591,12 +591,12 @@ static int jffs2_mknod (struct inode *dir_i, struct dentry *dentry, int mode, de
591 struct jffs2_full_dnode *fn; 591 struct jffs2_full_dnode *fn;
592 struct jffs2_full_dirent *fd; 592 struct jffs2_full_dirent *fd;
593 int namelen; 593 int namelen;
594 jint16_t dev; 594 union jffs2_device_node dev;
595 int devlen = 0; 595 int devlen = 0;
596 uint32_t alloclen, phys_ofs; 596 uint32_t alloclen, phys_ofs;
597 int ret; 597 int ret;
598 598
599 if (!old_valid_dev(rdev)) 599 if (!new_valid_dev(rdev))
600 return -EINVAL; 600 return -EINVAL;
601 601
602 ri = jffs2_alloc_raw_inode(); 602 ri = jffs2_alloc_raw_inode();
@@ -605,17 +605,15 @@ static int jffs2_mknod (struct inode *dir_i, struct dentry *dentry, int mode, de
605 605
606 c = JFFS2_SB_INFO(dir_i->i_sb); 606 c = JFFS2_SB_INFO(dir_i->i_sb);
607 607
608 if (S_ISBLK(mode) || S_ISCHR(mode)) { 608 if (S_ISBLK(mode) || S_ISCHR(mode))
609 dev = cpu_to_je16(old_encode_dev(rdev)); 609 devlen = jffs2_encode_dev(&dev, rdev);
610 devlen = sizeof(dev);
611 }
612 610
613 /* Try to reserve enough space for both node and dirent. 611 /* Try to reserve enough space for both node and dirent.
614 * Just the node will do for now, though 612 * Just the node will do for now, though
615 */ 613 */
616 namelen = dentry->d_name.len; 614 namelen = dentry->d_name.len;
617 ret = jffs2_reserve_space(c, sizeof(*ri) + devlen, &phys_ofs, &alloclen, 615 ret = jffs2_reserve_space(c, sizeof(*ri) + devlen, &phys_ofs, &alloclen,
618 ALLOC_NORMAL, JFFS2_SUMMARY_INODE_SIZE); 616 ALLOC_NORMAL, JFFS2_SUMMARY_INODE_SIZE);
619 617
620 if (ret) { 618 if (ret) {
621 jffs2_free_raw_inode(ri); 619 jffs2_free_raw_inode(ri);