Lines Matching refs:dir

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