summaryrefslogtreecommitdiffstats
path: root/fs/isofs/rock.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1995-11-14 08:00:00 +0000
committer <ralf@linux-mips.org>1995-11-14 08:00:00 +0000
commite7c2a72e2680827d6a733931273a93461c0d8d1b (patch)
treec9abeda78ef7504062bb2e816bcf3e3c9d680112 /fs/isofs/rock.c
parentec6044459060a8c9ce7f64405c465d141898548c (diff)
Import of Linux/MIPS 1.3.0
Diffstat (limited to 'fs/isofs/rock.c')
-rw-r--r--fs/isofs/rock.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/fs/isofs/rock.c b/fs/isofs/rock.c
index 686c1d910..b902d8f24 100644
--- a/fs/isofs/rock.c
+++ b/fs/isofs/rock.c
@@ -5,7 +5,10 @@
*
* Rock Ridge Extensions to iso9660
*/
-#include <linux/config.h>
+#ifdef MODULE
+#include <linux/module.h>
+#endif
+
#include <linux/stat.h>
#include <linux/sched.h>
#include <linux/iso_fs.h>
@@ -302,7 +305,18 @@ int parse_rock_ridge_inode(struct iso_directory_record * de,
{ int high, low;
high = isonum_733(rr->u.PN.dev_high);
low = isonum_733(rr->u.PN.dev_low);
- inode->i_rdev = ((high << 8) | (low & 0xff)) & 0xffff;
+ /*
+ * The Rock Ridge standard specifies that if sizeof(dev_t) <=4,
+ * then the high field is unused, and the device number is completely
+ * stored in the low field. Some writers may ignore this subtlety,
+ * and as a result we test to see if the entire device number is
+ * stored in the low field, and use that.
+ */
+ if(MINOR(low) != low && high == 0) {
+ inode->i_rdev = low;
+ } else {
+ inode->i_rdev = MKDEV(high, low);
+ }
};
break;
case SIG('T','F'):