Lines Matching refs:dir

70 static u8 adfs_fplus_checkbyte(struct adfs_dir *dir)  in adfs_fplus_checkbyte()  argument
72 struct adfs_bigdirheader *h = dir->bighead; in adfs_fplus_checkbyte()
73 struct adfs_bigdirtail *t = dir->bigtail; in adfs_fplus_checkbyte()
83 bp = (void *)dir->bhs[bi]->b_data; in adfs_fplus_checkbyte()
84 bs = dir->bhs[bi]->b_size; in adfs_fplus_checkbyte()
104 unsigned int size, struct adfs_dir *dir) in adfs_fplus_read() argument
112 ret = adfs_dir_read_buffers(sb, indaddr, sb->s_blocksize, dir); in adfs_fplus_read()
116 dir->bighead = h = (void *)dir->bhs[0]->b_data; in adfs_fplus_read()
131 ret = adfs_dir_read_buffers(sb, indaddr, dirsize, dir); in adfs_fplus_read()
135 dir->bigtail = t = (struct adfs_bigdirtail *) in adfs_fplus_read()
136 (dir->bhs[dir->nr_buffers - 1]->b_data + (sb->s_blocksize - 8)); in adfs_fplus_read()
144 if (adfs_fplus_checkbyte(dir) != t->bigdircheckbyte) { in adfs_fplus_read()
149 dir->parent_id = le32_to_cpu(h->bigdirparent); in adfs_fplus_read()
153 adfs_dir_relse(dir); in adfs_fplus_read()
159 adfs_fplus_setpos(struct adfs_dir *dir, unsigned int fpos) in adfs_fplus_setpos() argument
163 if (fpos <= le32_to_cpu(dir->bighead->bigdirentries)) { in adfs_fplus_setpos()
164 dir->pos = fpos; in adfs_fplus_setpos()
172 adfs_fplus_getnext(struct adfs_dir *dir, struct object_info *obj) in adfs_fplus_getnext() argument
174 struct adfs_bigdirheader *h = dir->bighead; in adfs_fplus_getnext()
179 if (dir->pos >= le32_to_cpu(h->bigdirentries)) in adfs_fplus_getnext()
182 offset = adfs_fplus_offset(h, dir->pos); in adfs_fplus_getnext()
184 ret = adfs_dir_copyfrom(&bde, dir, offset, in adfs_fplus_getnext()
199 ret = adfs_dir_copyfrom(obj->name, dir, offset, obj->name_len); in adfs_fplus_getnext()
203 adfs_object_fixup(dir, obj); in adfs_fplus_getnext()
205 dir->pos += 1; in adfs_fplus_getnext()
210 static int adfs_fplus_iterate(struct adfs_dir *dir, struct dir_context *ctx) in adfs_fplus_iterate() argument
217 if (adfs_fplus_setpos(dir, ctx->pos - 2)) in adfs_fplus_iterate()
220 while (!adfs_fplus_getnext(dir, &obj)) { in adfs_fplus_iterate()
230 static int adfs_fplus_update(struct adfs_dir *dir, struct object_info *obj) in adfs_fplus_update() argument
232 struct adfs_bigdirheader *h = dir->bighead; in adfs_fplus_update()
242 adfs_error(dir->sb, "unable to locate entry to update"); in adfs_fplus_update()
245 ret = adfs_dir_copyfrom(&bde, dir, offset, sizeof(bde)); in adfs_fplus_update()
247 adfs_error(dir->sb, "error reading directory entry"); in adfs_fplus_update()
258 return adfs_dir_copyto(dir, offset, &bde, sizeof(bde)); in adfs_fplus_update()
261 static int adfs_fplus_commit(struct adfs_dir *dir) in adfs_fplus_commit() argument
266 dir->bighead->startmasseq += 1; in adfs_fplus_commit()
267 dir->bigtail->bigdirendmasseq += 1; in adfs_fplus_commit()
270 dir->bigtail->bigdircheckbyte = adfs_fplus_checkbyte(dir); in adfs_fplus_commit()
273 ret = adfs_fplus_validate_header(dir->bighead); in adfs_fplus_commit()
275 ret = adfs_fplus_validate_tail(dir->bighead, dir->bigtail); in adfs_fplus_commit()