Lines Matching refs:dir
70 adfs_dir_checkbyte(const struct adfs_dir *dir) in adfs_dir_checkbyte() argument
72 struct buffer_head * const *bh = dir->bh; in adfs_dir_checkbyte()
73 const int blocksize_bits = dir->sb->s_blocksize_bits; in adfs_dir_checkbyte()
124 static int adfs_f_validate(struct adfs_dir *dir) in adfs_f_validate() argument
126 struct adfs_dirheader *head = dir->dirhead; in adfs_f_validate()
127 struct adfs_newdirtail *tail = dir->newtail; in adfs_f_validate()
134 adfs_dir_checkbyte(dir) != tail->dircheckbyte) in adfs_f_validate()
142 struct adfs_dir *dir) in adfs_f_read() argument
150 ret = adfs_dir_read_buffers(sb, indaddr, ADFS_NEWDIR_SIZE, dir); in adfs_f_read()
154 dir->dirhead = bufoff(dir->bh, 0); in adfs_f_read()
155 dir->newtail = bufoff(dir->bh, 2007); in adfs_f_read()
157 if (adfs_f_validate(dir)) in adfs_f_read()
160 dir->parent_id = adfs_readval(dir->newtail->dirparent, 3); in adfs_f_read()
166 adfs_dir_relse(dir); in adfs_f_read()
175 adfs_dir2obj(struct adfs_dir *dir, struct object_info *obj, in adfs_dir2obj() argument
194 adfs_object_fixup(dir, obj); in adfs_dir2obj()
215 __adfs_dir_get(struct adfs_dir *dir, int pos, struct object_info *obj) in __adfs_dir_get() argument
220 ret = adfs_dir_copyfrom(&de, dir, pos, 26); in __adfs_dir_get()
227 adfs_dir2obj(dir, obj, &de); in __adfs_dir_get()
233 adfs_f_setpos(struct adfs_dir *dir, unsigned int fpos) in adfs_f_setpos() argument
238 dir->pos = 5 + fpos * 26; in adfs_f_setpos()
243 adfs_f_getnext(struct adfs_dir *dir, struct object_info *obj) in adfs_f_getnext() argument
247 ret = __adfs_dir_get(dir, dir->pos, obj); in adfs_f_getnext()
249 dir->pos += 26; in adfs_f_getnext()
254 static int adfs_f_iterate(struct adfs_dir *dir, struct dir_context *ctx) in adfs_f_iterate() argument
260 if (__adfs_dir_get(dir, pos, &obj)) in adfs_f_iterate()
271 static int adfs_f_update(struct adfs_dir *dir, struct object_info *obj) in adfs_f_update() argument
280 ret = adfs_dir_copyfrom(&de, dir, offset, sizeof(de)); in adfs_f_update()
282 adfs_error(dir->sb, "error reading directory entry"); in adfs_f_update()
286 adfs_error(dir->sb, "unable to locate entry to update"); in adfs_f_update()
295 return adfs_dir_copyto(dir, offset, &de, 26); in adfs_f_update()
298 static int adfs_f_commit(struct adfs_dir *dir) in adfs_f_commit() argument
303 dir->dirhead->startmasseq += 1; in adfs_f_commit()
304 dir->newtail->endmasseq += 1; in adfs_f_commit()
307 dir->newtail->dircheckbyte = adfs_dir_checkbyte(dir); in adfs_f_commit()
310 ret = adfs_f_validate(dir); in adfs_f_commit()
312 adfs_msg(dir->sb, KERN_ERR, "error: update broke directory"); in adfs_f_commit()