diff options
Diffstat (limited to 'fs/adfs/adfs.h')
-rw-r--r-- | fs/adfs/adfs.h | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/fs/adfs/adfs.h b/fs/adfs/adfs.h index 58588ddb178c..a8a58d864f96 100644 --- a/fs/adfs/adfs.h +++ b/fs/adfs/adfs.h | |||
@@ -50,6 +50,7 @@ struct adfs_sb_info { | |||
50 | gid_t s_gid; /* owner gid */ | 50 | gid_t s_gid; /* owner gid */ |
51 | umode_t s_owner_mask; /* ADFS owner perm -> unix perm */ | 51 | umode_t s_owner_mask; /* ADFS owner perm -> unix perm */ |
52 | umode_t s_other_mask; /* ADFS other perm -> unix perm */ | 52 | umode_t s_other_mask; /* ADFS other perm -> unix perm */ |
53 | int s_ftsuffix; /* ,xyz hex filetype suffix option */ | ||
53 | 54 | ||
54 | __u32 s_ids_per_zone; /* max. no ids in one zone */ | 55 | __u32 s_ids_per_zone; /* max. no ids in one zone */ |
55 | __u32 s_idlen; /* length of ID in map */ | 56 | __u32 s_idlen; /* length of ID in map */ |
@@ -93,7 +94,7 @@ struct adfs_dir { | |||
93 | /* | 94 | /* |
94 | * This is the overall maximum name length | 95 | * This is the overall maximum name length |
95 | */ | 96 | */ |
96 | #define ADFS_MAX_NAME_LEN 256 | 97 | #define ADFS_MAX_NAME_LEN (256 + 4) /* +4 for ,xyz hex filetype suffix */ |
97 | struct object_info { | 98 | struct object_info { |
98 | __u32 parent_id; /* parent object id */ | 99 | __u32 parent_id; /* parent object id */ |
99 | __u32 file_id; /* object id */ | 100 | __u32 file_id; /* object id */ |
@@ -101,10 +102,26 @@ struct object_info { | |||
101 | __u32 execaddr; /* execution address */ | 102 | __u32 execaddr; /* execution address */ |
102 | __u32 size; /* size */ | 103 | __u32 size; /* size */ |
103 | __u8 attr; /* RISC OS attributes */ | 104 | __u8 attr; /* RISC OS attributes */ |
104 | unsigned char name_len; /* name length */ | 105 | unsigned int name_len; /* name length */ |
105 | char name[ADFS_MAX_NAME_LEN];/* file name */ | 106 | char name[ADFS_MAX_NAME_LEN];/* file name */ |
107 | |||
108 | /* RISC OS file type (12-bit: derived from loadaddr) */ | ||
109 | __u16 filetype; | ||
106 | }; | 110 | }; |
107 | 111 | ||
112 | /* RISC OS 12-bit filetype converts to ,xyz hex filename suffix */ | ||
113 | static inline int append_filetype_suffix(char *buf, __u16 filetype) | ||
114 | { | ||
115 | if (filetype == -1) | ||
116 | return 0; | ||
117 | |||
118 | *buf++ = ','; | ||
119 | *buf++ = hex_asc_lo(filetype >> 8); | ||
120 | *buf++ = hex_asc_lo(filetype >> 4); | ||
121 | *buf++ = hex_asc_lo(filetype >> 0); | ||
122 | return 4; | ||
123 | } | ||
124 | |||
108 | struct adfs_dir_ops { | 125 | struct adfs_dir_ops { |
109 | int (*read)(struct super_block *sb, unsigned int id, unsigned int sz, struct adfs_dir *dir); | 126 | int (*read)(struct super_block *sb, unsigned int id, unsigned int sz, struct adfs_dir *dir); |
110 | int (*setpos)(struct adfs_dir *dir, unsigned int fpos); | 127 | int (*setpos)(struct adfs_dir *dir, unsigned int fpos); |