• Home
  • Raw
  • Download

Lines Matching refs:dir

24 static void adfs_f_free(struct adfs_dir *dir);
94 adfs_dir_checkbyte(const struct adfs_dir *dir) in adfs_dir_checkbyte() argument
96 struct buffer_head * const *bh = dir->bh; in adfs_dir_checkbyte()
97 const int blocksize_bits = dir->sb->s_blocksize_bits; in adfs_dir_checkbyte()
153 unsigned int size, struct adfs_dir *dir) in adfs_dir_read() argument
167 dir->nr_buffers = 0; in adfs_dir_read()
168 dir->sb = sb; in adfs_dir_read()
180 dir->bh[blk] = sb_bread(sb, phys); in adfs_dir_read()
181 if (!dir->bh[blk]) in adfs_dir_read()
185 memcpy(&dir->dirhead, bufoff(dir->bh, 0), sizeof(dir->dirhead)); in adfs_dir_read()
186 memcpy(&dir->dirtail, bufoff(dir->bh, 2007), sizeof(dir->dirtail)); in adfs_dir_read()
188 if (dir->dirhead.startmasseq != dir->dirtail.new.endmasseq || in adfs_dir_read()
189 memcmp(&dir->dirhead.startname, &dir->dirtail.new.endname, 4)) in adfs_dir_read()
192 if (memcmp(&dir->dirhead.startname, "Nick", 4) && in adfs_dir_read()
193 memcmp(&dir->dirhead.startname, "Hugo", 4)) in adfs_dir_read()
196 if (adfs_dir_checkbyte(dir) != dir->dirtail.new.dircheckbyte) in adfs_dir_read()
199 dir->nr_buffers = blk; in adfs_dir_read()
208 brelse(dir->bh[blk]); in adfs_dir_read()
210 dir->sb = NULL; in adfs_dir_read()
247 __adfs_dir_get(struct adfs_dir *dir, int pos, struct object_info *obj) in __adfs_dir_get() argument
249 struct super_block *sb = dir->sb; in __adfs_dir_get()
255 if (buffer > dir->nr_buffers) in __adfs_dir_get()
263 memcpy(&de, dir->bh[buffer]->b_data + offset, thissize); in __adfs_dir_get()
265 memcpy(((char *)&de) + thissize, dir->bh[buffer + 1]->b_data, in __adfs_dir_get()
277 __adfs_dir_put(struct adfs_dir *dir, int pos, struct object_info *obj) in __adfs_dir_put() argument
279 struct super_block *sb = dir->sb; in __adfs_dir_put()
285 if (buffer > dir->nr_buffers) in __adfs_dir_put()
296 memcpy(&de, dir->bh[buffer]->b_data + offset, thissize); in __adfs_dir_put()
298 memcpy(((char *)&de) + thissize, dir->bh[buffer + 1]->b_data, in __adfs_dir_put()
309 memcpy(dir->bh[buffer]->b_data + offset, &de, thissize); in __adfs_dir_put()
311 memcpy(dir->bh[buffer + 1]->b_data, ((char *)&de) + thissize, in __adfs_dir_put()
322 adfs_dir_find_entry(struct adfs_dir *dir, unsigned long object_id) in adfs_dir_find_entry() argument
331 if (!__adfs_dir_get(dir, pos, &obj)) in adfs_dir_find_entry()
344 adfs_f_read(struct super_block *sb, unsigned int id, unsigned int sz, struct adfs_dir *dir) in adfs_f_read() argument
351 ret = adfs_dir_read(sb, id, sz, dir); in adfs_f_read()
355 dir->parent_id = adfs_readval(dir->dirtail.new.dirparent, 3); in adfs_f_read()
361 adfs_f_setpos(struct adfs_dir *dir, unsigned int fpos) in adfs_f_setpos() argument
366 dir->pos = 5 + fpos * 26; in adfs_f_setpos()
371 adfs_f_getnext(struct adfs_dir *dir, struct object_info *obj) in adfs_f_getnext() argument
375 ret = __adfs_dir_get(dir, dir->pos, obj); in adfs_f_getnext()
377 dir->pos += 26; in adfs_f_getnext()
383 adfs_f_update(struct adfs_dir *dir, struct object_info *obj) in adfs_f_update() argument
385 struct super_block *sb = dir->sb; in adfs_f_update()
388 ret = adfs_dir_find_entry(dir, obj->file_id); in adfs_f_update()
390 adfs_error(dir->sb, "unable to locate entry to update"); in adfs_f_update()
394 __adfs_dir_put(dir, ret, obj); in adfs_f_update()
399 dir->bh[0]->b_data[0] += 1; in adfs_f_update()
400 dir->bh[dir->nr_buffers - 1]->b_data[sb->s_blocksize - 6] += 1; in adfs_f_update()
402 ret = adfs_dir_checkbyte(dir); in adfs_f_update()
406 dir->bh[dir->nr_buffers - 1]->b_data[sb->s_blocksize - 1] = ret; in adfs_f_update()
412 memcpy(&dir->dirhead, bufoff(dir->bh, 0), sizeof(dir->dirhead)); in adfs_f_update()
413 memcpy(&dir->dirtail, bufoff(dir->bh, 2007), sizeof(dir->dirtail)); in adfs_f_update()
415 if (dir->dirhead.startmasseq != dir->dirtail.new.endmasseq || in adfs_f_update()
416 memcmp(&dir->dirhead.startname, &dir->dirtail.new.endname, 4)) in adfs_f_update()
419 if (memcmp(&dir->dirhead.startname, "Nick", 4) && in adfs_f_update()
420 memcmp(&dir->dirhead.startname, "Hugo", 4)) in adfs_f_update()
423 if (adfs_dir_checkbyte(dir) != dir->dirtail.new.dircheckbyte) in adfs_f_update()
427 for (i = dir->nr_buffers - 1; i >= 0; i--) in adfs_f_update()
428 mark_buffer_dirty(dir->bh[i]); in adfs_f_update()
435 adfs_error(dir->sb, "whoops! I broke a directory!"); in adfs_f_update()
441 adfs_f_free(struct adfs_dir *dir) in adfs_f_free() argument
445 for (i = dir->nr_buffers - 1; i >= 0; i--) { in adfs_f_free()
446 brelse(dir->bh[i]); in adfs_f_free()
447 dir->bh[i] = NULL; in adfs_f_free()
450 dir->nr_buffers = 0; in adfs_f_free()
451 dir->sb = NULL; in adfs_f_free()