Thomas Gleixner | d2912cb | 2019-06-04 10:11:33 +0200 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0-only |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | /* |
| 3 | * linux/fs/adfs/dir_f.c |
| 4 | * |
| 5 | * Copyright (C) 1997-1999 Russell King |
| 6 | * |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 7 | * E and F format directory handling |
| 8 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9 | #include "adfs.h" |
| 10 | #include "dir_f.h" |
| 11 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 12 | /* |
| 13 | * Read an (unaligned) value of length 1..4 bytes |
| 14 | */ |
| 15 | static inline unsigned int adfs_readval(unsigned char *p, int len) |
| 16 | { |
| 17 | unsigned int val = 0; |
| 18 | |
| 19 | switch (len) { |
| 20 | case 4: val |= p[3] << 24; |
Gustavo A. R. Silva | 74f7909 | 2019-01-14 14:30:36 -0600 | [diff] [blame] | 21 | /* fall through */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 22 | case 3: val |= p[2] << 16; |
Gustavo A. R. Silva | 74f7909 | 2019-01-14 14:30:36 -0600 | [diff] [blame] | 23 | /* fall through */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | case 2: val |= p[1] << 8; |
Gustavo A. R. Silva | 74f7909 | 2019-01-14 14:30:36 -0600 | [diff] [blame] | 25 | /* fall through */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | default: val |= p[0]; |
| 27 | } |
| 28 | return val; |
| 29 | } |
| 30 | |
| 31 | static inline void adfs_writeval(unsigned char *p, int len, unsigned int val) |
| 32 | { |
| 33 | switch (len) { |
| 34 | case 4: p[3] = val >> 24; |
Gustavo A. R. Silva | 74f7909 | 2019-01-14 14:30:36 -0600 | [diff] [blame] | 35 | /* fall through */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 36 | case 3: p[2] = val >> 16; |
Gustavo A. R. Silva | 74f7909 | 2019-01-14 14:30:36 -0600 | [diff] [blame] | 37 | /* fall through */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 38 | case 2: p[1] = val >> 8; |
Gustavo A. R. Silva | 74f7909 | 2019-01-14 14:30:36 -0600 | [diff] [blame] | 39 | /* fall through */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | default: p[0] = val; |
| 41 | } |
| 42 | } |
| 43 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 44 | #define ror13(v) ((v >> 13) | (v << 19)) |
| 45 | |
| 46 | #define dir_u8(idx) \ |
| 47 | ({ int _buf = idx >> blocksize_bits; \ |
| 48 | int _off = idx - (_buf << blocksize_bits);\ |
| 49 | *(u8 *)(bh[_buf]->b_data + _off); \ |
| 50 | }) |
| 51 | |
| 52 | #define dir_u32(idx) \ |
| 53 | ({ int _buf = idx >> blocksize_bits; \ |
| 54 | int _off = idx - (_buf << blocksize_bits);\ |
| 55 | *(__le32 *)(bh[_buf]->b_data + _off); \ |
| 56 | }) |
| 57 | |
| 58 | #define bufoff(_bh,_idx) \ |
| 59 | ({ int _buf = _idx >> blocksize_bits; \ |
| 60 | int _off = _idx - (_buf << blocksize_bits);\ |
Russell King | 016936b | 2019-12-09 11:10:21 +0000 | [diff] [blame^] | 61 | (void *)(_bh[_buf]->b_data + _off); \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 62 | }) |
| 63 | |
| 64 | /* |
| 65 | * There are some algorithms that are nice in |
| 66 | * assembler, but a bitch in C... This is one |
| 67 | * of them. |
| 68 | */ |
| 69 | static u8 |
| 70 | adfs_dir_checkbyte(const struct adfs_dir *dir) |
| 71 | { |
| 72 | struct buffer_head * const *bh = dir->bh; |
| 73 | const int blocksize_bits = dir->sb->s_blocksize_bits; |
| 74 | union { __le32 *ptr32; u8 *ptr8; } ptr, end; |
| 75 | u32 dircheck = 0; |
| 76 | int last = 5 - 26; |
| 77 | int i = 0; |
| 78 | |
| 79 | /* |
| 80 | * Accumulate each word up to the last whole |
| 81 | * word of the last directory entry. This |
| 82 | * can spread across several buffer heads. |
| 83 | */ |
| 84 | do { |
| 85 | last += 26; |
| 86 | do { |
| 87 | dircheck = le32_to_cpu(dir_u32(i)) ^ ror13(dircheck); |
| 88 | |
| 89 | i += sizeof(u32); |
| 90 | } while (i < (last & ~3)); |
| 91 | } while (dir_u8(last) != 0); |
| 92 | |
| 93 | /* |
| 94 | * Accumulate the last few bytes. These |
| 95 | * bytes will be within the same bh. |
| 96 | */ |
| 97 | if (i != last) { |
| 98 | ptr.ptr8 = bufoff(bh, i); |
| 99 | end.ptr8 = ptr.ptr8 + last - i; |
| 100 | |
Harvey Harrison | e594905 | 2008-04-29 00:58:41 -0700 | [diff] [blame] | 101 | do { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 102 | dircheck = *ptr.ptr8++ ^ ror13(dircheck); |
Harvey Harrison | e594905 | 2008-04-29 00:58:41 -0700 | [diff] [blame] | 103 | } while (ptr.ptr8 < end.ptr8); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 104 | } |
| 105 | |
| 106 | /* |
| 107 | * The directory tail is in the final bh |
| 108 | * Note that contary to the RISC OS PRMs, |
| 109 | * the first few bytes are NOT included |
| 110 | * in the check. All bytes are in the |
| 111 | * same bh. |
| 112 | */ |
| 113 | ptr.ptr8 = bufoff(bh, 2008); |
| 114 | end.ptr8 = ptr.ptr8 + 36; |
| 115 | |
| 116 | do { |
| 117 | __le32 v = *ptr.ptr32++; |
| 118 | dircheck = le32_to_cpu(v) ^ ror13(dircheck); |
| 119 | } while (ptr.ptr32 < end.ptr32); |
| 120 | |
| 121 | return (dircheck ^ (dircheck >> 8) ^ (dircheck >> 16) ^ (dircheck >> 24)) & 0xff; |
| 122 | } |
| 123 | |
Russell King | 5ed70bb | 2019-06-04 14:49:57 +0100 | [diff] [blame] | 124 | /* Read and check that a directory is valid */ |
| 125 | static int adfs_dir_read(struct super_block *sb, u32 indaddr, |
| 126 | unsigned int size, struct adfs_dir *dir) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 127 | { |
| 128 | const unsigned int blocksize_bits = sb->s_blocksize_bits; |
Russell King | 419a6e5 | 2019-12-09 11:09:35 +0000 | [diff] [blame] | 129 | int ret; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 130 | |
| 131 | /* |
| 132 | * Directories which are not a multiple of 2048 bytes |
| 133 | * are considered bad v2 [3.6] |
| 134 | */ |
| 135 | if (size & 2047) |
| 136 | goto bad_dir; |
| 137 | |
Russell King | 419a6e5 | 2019-12-09 11:09:35 +0000 | [diff] [blame] | 138 | ret = adfs_dir_read_buffers(sb, indaddr, size, dir); |
| 139 | if (ret) |
| 140 | return ret; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 141 | |
Russell King | 016936b | 2019-12-09 11:10:21 +0000 | [diff] [blame^] | 142 | dir->dirhead = bufoff(dir->bh, 0); |
| 143 | dir->newtail = bufoff(dir->bh, 2007); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 144 | |
Russell King | 016936b | 2019-12-09 11:10:21 +0000 | [diff] [blame^] | 145 | if (dir->dirhead->startmasseq != dir->newtail->endmasseq || |
| 146 | memcmp(&dir->dirhead->startname, &dir->newtail->endname, 4)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 147 | goto bad_dir; |
| 148 | |
Russell King | 016936b | 2019-12-09 11:10:21 +0000 | [diff] [blame^] | 149 | if (memcmp(&dir->dirhead->startname, "Nick", 4) && |
| 150 | memcmp(&dir->dirhead->startname, "Hugo", 4)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 151 | goto bad_dir; |
| 152 | |
Russell King | 016936b | 2019-12-09 11:10:21 +0000 | [diff] [blame^] | 153 | if (adfs_dir_checkbyte(dir) != dir->newtail->dircheckbyte) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 154 | goto bad_dir; |
| 155 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 156 | return 0; |
| 157 | |
| 158 | bad_dir: |
Russell King | 5ed70bb | 2019-06-04 14:49:57 +0100 | [diff] [blame] | 159 | adfs_error(sb, "dir %06x is corrupted", indaddr); |
Russell King | 1dd9f5b | 2019-12-09 11:09:20 +0000 | [diff] [blame] | 160 | adfs_dir_relse(dir); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 161 | |
| 162 | return -EIO; |
| 163 | } |
| 164 | |
| 165 | /* |
| 166 | * convert a disk-based directory entry to a Linux ADFS directory entry |
| 167 | */ |
| 168 | static inline void |
Stuart Swales | da23ef0 | 2011-03-22 16:35:06 -0700 | [diff] [blame] | 169 | adfs_dir2obj(struct adfs_dir *dir, struct object_info *obj, |
| 170 | struct adfs_direntry *de) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 171 | { |
Russell King | adb514a | 2019-03-24 13:22:28 +0000 | [diff] [blame] | 172 | unsigned int name_len; |
| 173 | |
| 174 | for (name_len = 0; name_len < ADFS_F_NAME_LEN; name_len++) { |
| 175 | if (de->dirobname[name_len] < ' ') |
| 176 | break; |
| 177 | |
| 178 | obj->name[name_len] = de->dirobname[name_len]; |
| 179 | } |
| 180 | |
| 181 | obj->name_len = name_len; |
Russell King | 5ed70bb | 2019-06-04 14:49:57 +0100 | [diff] [blame] | 182 | obj->indaddr = adfs_readval(de->dirinddiscadd, 3); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 183 | obj->loadaddr = adfs_readval(de->dirload, 4); |
| 184 | obj->execaddr = adfs_readval(de->direxec, 4); |
| 185 | obj->size = adfs_readval(de->dirlen, 4); |
| 186 | obj->attr = de->newdiratts; |
Stuart Swales | da23ef0 | 2011-03-22 16:35:06 -0700 | [diff] [blame] | 187 | |
Russell King | 411c49b | 2019-03-24 12:57:32 +0000 | [diff] [blame] | 188 | adfs_object_fixup(dir, obj); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 189 | } |
| 190 | |
| 191 | /* |
| 192 | * convert a Linux ADFS directory entry to a disk-based directory entry |
| 193 | */ |
| 194 | static inline void |
| 195 | adfs_obj2dir(struct adfs_direntry *de, struct object_info *obj) |
| 196 | { |
Russell King | 5ed70bb | 2019-06-04 14:49:57 +0100 | [diff] [blame] | 197 | adfs_writeval(de->dirinddiscadd, 3, obj->indaddr); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 198 | adfs_writeval(de->dirload, 4, obj->loadaddr); |
| 199 | adfs_writeval(de->direxec, 4, obj->execaddr); |
| 200 | adfs_writeval(de->dirlen, 4, obj->size); |
| 201 | de->newdiratts = obj->attr; |
| 202 | } |
| 203 | |
| 204 | /* |
| 205 | * get a directory entry. Note that the caller is responsible |
| 206 | * for holding the relevant locks. |
| 207 | */ |
| 208 | static int |
| 209 | __adfs_dir_get(struct adfs_dir *dir, int pos, struct object_info *obj) |
| 210 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 211 | struct adfs_direntry de; |
Russell King | a317120 | 2019-12-09 11:09:30 +0000 | [diff] [blame] | 212 | int ret; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 213 | |
Russell King | a317120 | 2019-12-09 11:09:30 +0000 | [diff] [blame] | 214 | ret = adfs_dir_copyfrom(&de, dir, pos, 26); |
| 215 | if (ret) |
| 216 | return ret; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 217 | |
| 218 | if (!de.dirobname[0]) |
| 219 | return -ENOENT; |
| 220 | |
Stuart Swales | da23ef0 | 2011-03-22 16:35:06 -0700 | [diff] [blame] | 221 | adfs_dir2obj(dir, obj, &de); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 222 | |
| 223 | return 0; |
| 224 | } |
| 225 | |
| 226 | static int |
| 227 | __adfs_dir_put(struct adfs_dir *dir, int pos, struct object_info *obj) |
| 228 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 229 | struct adfs_direntry de; |
Russell King | a317120 | 2019-12-09 11:09:30 +0000 | [diff] [blame] | 230 | int ret; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 231 | |
Russell King | a317120 | 2019-12-09 11:09:30 +0000 | [diff] [blame] | 232 | ret = adfs_dir_copyfrom(&de, dir, pos, 26); |
| 233 | if (ret) |
| 234 | return ret; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 235 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 236 | adfs_obj2dir(&de, obj); |
| 237 | |
Russell King | a317120 | 2019-12-09 11:09:30 +0000 | [diff] [blame] | 238 | return adfs_dir_copyto(dir, pos, &de, 26); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 239 | } |
| 240 | |
| 241 | /* |
| 242 | * the caller is responsible for holding the necessary |
| 243 | * locks. |
| 244 | */ |
Russell King | 5ed70bb | 2019-06-04 14:49:57 +0100 | [diff] [blame] | 245 | static int adfs_dir_find_entry(struct adfs_dir *dir, u32 indaddr) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 246 | { |
| 247 | int pos, ret; |
| 248 | |
| 249 | ret = -ENOENT; |
| 250 | |
| 251 | for (pos = 5; pos < ADFS_NUM_DIR_ENTRIES * 26 + 5; pos += 26) { |
| 252 | struct object_info obj; |
| 253 | |
| 254 | if (!__adfs_dir_get(dir, pos, &obj)) |
| 255 | break; |
| 256 | |
Russell King | 5ed70bb | 2019-06-04 14:49:57 +0100 | [diff] [blame] | 257 | if (obj.indaddr == indaddr) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 258 | ret = pos; |
| 259 | break; |
| 260 | } |
| 261 | } |
| 262 | |
| 263 | return ret; |
| 264 | } |
| 265 | |
Russell King | 5ed70bb | 2019-06-04 14:49:57 +0100 | [diff] [blame] | 266 | static int adfs_f_read(struct super_block *sb, u32 indaddr, unsigned int size, |
| 267 | struct adfs_dir *dir) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 268 | { |
| 269 | int ret; |
| 270 | |
Russell King | 5ed70bb | 2019-06-04 14:49:57 +0100 | [diff] [blame] | 271 | if (size != ADFS_NEWDIR_SIZE) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 272 | return -EIO; |
| 273 | |
Russell King | 5ed70bb | 2019-06-04 14:49:57 +0100 | [diff] [blame] | 274 | ret = adfs_dir_read(sb, indaddr, size, dir); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 275 | if (ret) |
| 276 | adfs_error(sb, "unable to read directory"); |
| 277 | else |
Russell King | 016936b | 2019-12-09 11:10:21 +0000 | [diff] [blame^] | 278 | dir->parent_id = adfs_readval(dir->newtail->dirparent, 3); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 279 | |
| 280 | return ret; |
| 281 | } |
| 282 | |
| 283 | static int |
| 284 | adfs_f_setpos(struct adfs_dir *dir, unsigned int fpos) |
| 285 | { |
| 286 | if (fpos >= ADFS_NUM_DIR_ENTRIES) |
| 287 | return -ENOENT; |
| 288 | |
| 289 | dir->pos = 5 + fpos * 26; |
| 290 | return 0; |
| 291 | } |
| 292 | |
| 293 | static int |
| 294 | adfs_f_getnext(struct adfs_dir *dir, struct object_info *obj) |
| 295 | { |
| 296 | unsigned int ret; |
| 297 | |
| 298 | ret = __adfs_dir_get(dir, dir->pos, obj); |
| 299 | if (ret == 0) |
| 300 | dir->pos += 26; |
| 301 | |
| 302 | return ret; |
| 303 | } |
| 304 | |
Russell King | 4287e4d | 2019-12-09 11:10:16 +0000 | [diff] [blame] | 305 | static int adfs_f_iterate(struct adfs_dir *dir, struct dir_context *ctx) |
| 306 | { |
| 307 | struct object_info obj; |
| 308 | int pos = 5 + (ctx->pos - 2) * 26; |
| 309 | |
| 310 | while (ctx->pos < 2 + ADFS_NUM_DIR_ENTRIES) { |
| 311 | if (__adfs_dir_get(dir, pos, &obj)) |
| 312 | break; |
| 313 | if (!dir_emit(ctx, obj.name, obj.name_len, |
| 314 | obj.indaddr, DT_UNKNOWN)) |
| 315 | break; |
| 316 | pos += 26; |
| 317 | ctx->pos++; |
| 318 | } |
| 319 | return 0; |
| 320 | } |
| 321 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 322 | static int |
| 323 | adfs_f_update(struct adfs_dir *dir, struct object_info *obj) |
| 324 | { |
Russell King | c3c8149 | 2019-12-09 11:09:45 +0000 | [diff] [blame] | 325 | int ret; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 326 | |
Russell King | 5ed70bb | 2019-06-04 14:49:57 +0100 | [diff] [blame] | 327 | ret = adfs_dir_find_entry(dir, obj->indaddr); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 328 | if (ret < 0) { |
| 329 | adfs_error(dir->sb, "unable to locate entry to update"); |
| 330 | goto out; |
| 331 | } |
| 332 | |
| 333 | __adfs_dir_put(dir, ret, obj); |
| 334 | |
| 335 | /* |
| 336 | * Increment directory sequence number |
| 337 | */ |
Russell King | 016936b | 2019-12-09 11:10:21 +0000 | [diff] [blame^] | 338 | dir->dirhead->startmasseq += 1; |
| 339 | dir->newtail->endmasseq += 1; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 340 | |
| 341 | ret = adfs_dir_checkbyte(dir); |
| 342 | /* |
| 343 | * Update directory check byte |
| 344 | */ |
Russell King | 016936b | 2019-12-09 11:10:21 +0000 | [diff] [blame^] | 345 | dir->newtail->dircheckbyte = ret; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 346 | |
| 347 | #if 1 |
Russell King | 016936b | 2019-12-09 11:10:21 +0000 | [diff] [blame^] | 348 | if (dir->dirhead->startmasseq != dir->newtail->endmasseq || |
| 349 | memcmp(&dir->dirhead->startname, &dir->newtail->endname, 4)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 350 | goto bad_dir; |
| 351 | |
Russell King | 016936b | 2019-12-09 11:10:21 +0000 | [diff] [blame^] | 352 | if (memcmp(&dir->dirhead->startname, "Nick", 4) && |
| 353 | memcmp(&dir->dirhead->startname, "Hugo", 4)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 354 | goto bad_dir; |
| 355 | |
Russell King | 016936b | 2019-12-09 11:10:21 +0000 | [diff] [blame^] | 356 | if (adfs_dir_checkbyte(dir) != dir->newtail->dircheckbyte) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 357 | goto bad_dir; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 358 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 359 | ret = 0; |
| 360 | out: |
| 361 | return ret; |
| 362 | #if 1 |
| 363 | bad_dir: |
| 364 | adfs_error(dir->sb, "whoops! I broke a directory!"); |
| 365 | return -EIO; |
| 366 | #endif |
| 367 | } |
| 368 | |
Julia Lawall | 0125f50 | 2015-11-21 16:15:37 +0100 | [diff] [blame] | 369 | const struct adfs_dir_ops adfs_f_dir_ops = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 370 | .read = adfs_f_read, |
Russell King | 4287e4d | 2019-12-09 11:10:16 +0000 | [diff] [blame] | 371 | .iterate = adfs_f_iterate, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 372 | .setpos = adfs_f_setpos, |
| 373 | .getnext = adfs_f_getnext, |
| 374 | .update = adfs_f_update, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 375 | }; |