11 #include <linux/slab.h>
29 block = __adfs_block_map(sb,
id, 0);
31 adfs_error(sb,
"dir object %X has a hole at offset 0",
id);
35 dir->
bh_fplus[0] = sb_bread(sb, block);
44 " directory header size %X\n"
45 " does not match directory size %X\n",
53 " malformed dir header\n",
id);
58 if (size >
sizeof(dir->
bh)/
sizeof(dir->
bh[0])) {
60 struct buffer_head **bh_fplus =
61 kzalloc(size *
sizeof(
struct buffer_head *),
65 " dir object %X (%d blocks)",
id, size);
73 for (blk = 1; blk <
size; blk++) {
74 block = __adfs_block_map(sb,
id, blk);
76 adfs_error(sb,
"dir object %X has a hole at offset %d",
id, blk);
83 " offset %d, mapped block %X",
98 "malformed dir end\n",
id);
123 adfs_fplus_setpos(
struct adfs_dir *dir,
unsigned int fpos)
138 dir_memcpy(
struct adfs_dir *dir,
unsigned int offset,
void *to,
int len)
141 unsigned int buffer, partial, remainder;
151 char *
c = (
char *)to;
153 remainder = len - partial;
156 dir->
bh_fplus[buffer]->b_data + offset,
197 if (obj->
name[i] ==
'/')
207 (0xfff00000 == (0xfff00000 & obj->
loadaddr))) {
211 if (ADFS_SB(dir->
sb)->s_ftsuffix)
213 append_filetype_suffix(
225 adfs_fplus_sync(
struct adfs_dir *dir)
231 struct buffer_head *bh = dir->
bh_fplus[
i];
233 if (buffer_req(bh) && !buffer_uptodate(bh))
241 adfs_fplus_free(
struct adfs_dir *dir)
260 .read = adfs_fplus_read,
261 .setpos = adfs_fplus_setpos,
262 .getnext = adfs_fplus_getnext,
263 .sync = adfs_fplus_sync,
264 .free = adfs_fplus_free