summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorMichal Simek <monstr@monstr.eu>2007-08-06 23:35:26 +0200
committerMichal Simek <monstr@monstr.eu>2007-08-06 23:35:26 +0200
commitf500d9fdeb576288656dac427052ad2c5ca0ad1a (patch)
tree0904c3710511e91ea8010ce09466f1bed5a73ccc /fs
parentab4b956d3143f8f8174089053f5dfabbb04762b0 (diff)
[FIX] Fix romfs code
Diffstat (limited to 'fs')
-rw-r--r--fs/romfs/romfs.c40
1 files changed, 5 insertions, 35 deletions
diff --git a/fs/romfs/romfs.c b/fs/romfs/romfs.c
index b7d96964b53..34917bec364 100644
--- a/fs/romfs/romfs.c
+++ b/fs/romfs/romfs.c
@@ -124,7 +124,8 @@ static int romfs_list_inode (struct part_info *info, unsigned long offset)
struct romfs_inode *hardlink = NULL;
char str[3], *data;
-/* mapping spec.info means
+/*
+ * mapping spec.info means
* 0 hard link link destination [file header]
* 1 directory first file's header
* 2 regular file unused, must be zero [MBZ]
@@ -134,40 +135,9 @@ static int romfs_list_inode (struct part_info *info, unsigned long offset)
* 6 socket unused, MBZ
* 7 fifo unused, MBZ
*/
- switch (inode->next & 0x7) {
- case 0:
- str[0] = 'h';
- break;
- case 1:
- str[0] = 'd';
- break;
- case 2:
- str[0] = 'f';
- break;
- case 3:
- str[0] = 'l';
- break;
- case 4:
- str[0] = 'b';
- break;
- case 5:
- str[0] = 'c';
- break;
- case 6:
- str[0] = 's';
- break;
- case 7:
- str[0] = 'p';
- break;
- default:
- str[0] = '?';
- }
-
- if (inode->next & 0x8) {
- str[1] = 'x';
- } else {
- str[1] = '-';
- }
+ char attributes[] = "hdflbcsp";
+ str[0] = attributes[inode->next & 0x7];
+ str[1] = (inode->next & 0x8) ? 'x' : '-';
str[2] = '\0';
if ((str[0] == 'b') || (str[0] == 'c')) {