Lines Matching defs:idesc

100 dirscan(struct inodesc *idesc)
108 if (idesc->id_type != DATA)
109 errx(EEXIT, "wrong type to dirscan %d", idesc->id_type);
110 if (idesc->id_entryno == 0 &&
111 (idesc->id_filesize & (DIRBLKSIZ - 1)) != 0)
112 idesc->id_filesize = roundup(idesc->id_filesize, DIRBLKSIZ);
113 blksiz = idesc->id_numfrags * sblock.fs_fsize;
114 if (chkrange(idesc->id_blkno, idesc->id_numfrags)) {
115 idesc->id_filesize -= blksiz;
118 idesc->id_loc = 0;
119 for (dp = fsck_readdir(idesc); dp != NULL; dp = fsck_readdir(idesc)) {
124 idesc->id_dirp = (struct direct *)dbuf;
125 if ((n = (*idesc->id_func)(idesc)) & ALTERED) {
126 bp = getdirblk(idesc->id_blkno, blksiz);
127 memmove(bp->b_un.b_buf + idesc->id_loc - dsize, dbuf,
136 return (idesc->id_filesize > 0 ? KEEPON : STOP);
143 fsck_readdir(struct inodesc *idesc)
149 blksiz = idesc->id_numfrags * sblock.fs_fsize;
150 bp = getdirblk(idesc->id_blkno, blksiz);
151 if (idesc->id_loc % DIRBLKSIZ == 0 && idesc->id_filesize > 0 &&
152 idesc->id_loc < blksiz) {
153 dp = (struct direct *)(bp->b_un.b_buf + idesc->id_loc);
154 if (dircheck(idesc, dp))
156 if (idesc->id_fix == IGNORE)
158 fix = dofix(idesc, "DIRECTORY CORRUPTED");
159 bp = getdirblk(idesc->id_blkno, blksiz);
160 dp = (struct direct *)(bp->b_un.b_buf + idesc->id_loc);
168 idesc->id_loc += DIRBLKSIZ;
169 idesc->id_filesize -= DIRBLKSIZ;
173 if (idesc->id_filesize <= 0 || idesc->id_loc >= blksiz)
175 dploc = idesc->id_loc;
177 idesc->id_loc += dp->d_reclen;
178 idesc->id_filesize -= dp->d_reclen;
179 if ((idesc->id_loc % DIRBLKSIZ) == 0)
181 ndp = (struct direct *)(bp->b_un.b_buf + idesc->id_loc);
182 if (idesc->id_loc < blksiz && idesc->id_filesize > 0 &&
183 dircheck(idesc, ndp) == 0) {
184 size = DIRBLKSIZ - (idesc->id_loc % DIRBLKSIZ);
185 idesc->id_loc += size;
186 idesc->id_filesize -= size;
187 if (idesc->id_fix == IGNORE)
189 fix = dofix(idesc, "DIRECTORY CORRUPTED");
190 bp = getdirblk(idesc->id_blkno, blksiz);
204 dircheck(struct inodesc *idesc, struct direct *dp)
212 spaceleft = DIRBLKSIZ - (idesc->id_loc % DIRBLKSIZ);
223 idesc->id_filesize < size ||
272 adjust(struct inodesc *idesc, int lcnt)
277 dp = ginode(idesc->id_number);
285 clri(idesc, "UNREF", 1);
295 if (linkup(idesc->id_number, (ino_t)0, NULL) == 0) {
297 clri(idesc, "UNREF", 0);
303 dp = ginode(idesc->id_number);
308 pwarn("LINK COUNT %s", (lfdir == idesc->id_number) ? lfname :
310 pinode(idesc->id_number);
326 cmd.value = idesc->id_number;
341 mkentry(struct inodesc *idesc)
343 struct direct *dirp = idesc->id_dirp;
347 newent.d_namlen = strlen(idesc->id_name);
358 dirp->d_ino = idesc->id_parent; /* ino to be entered is in id_parent */
360 dirp->d_type = inoinfo(idesc->id_parent)->ino_type;
362 memmove(dirp->d_name, idesc->id_name, (size_t)newent.d_namlen + 1);
367 chgino(struct inodesc *idesc)
369 struct direct *dirp = idesc->id_dirp;
371 if (memcmp(dirp->d_name, idesc->id_name, (int)dirp->d_namlen + 1))
373 dirp->d_ino = idesc->id_parent;
374 dirp->d_type = inoinfo(idesc->id_parent)->ino_type;
384 struct inodesc idesc;
387 memset(&idesc, 0, sizeof(struct inodesc));
405 idesc.id_name = strdup(lfname);
406 idesc.id_type = DATA;
407 idesc.id_func = findino;
408 idesc.id_number = ROOTINO;
409 if ((ckinode(dp, &idesc) & FOUND) != 0) {
410 lfdir = idesc.id_parent;
450 idesc.id_type = ADDR;
451 idesc.id_func = pass4check;
452 idesc.id_number = oldlfdir;
453 adjust(&idesc, inoinfo(oldlfdir)->ino_linkcnt + 1);
500 struct inodesc idesc;
502 memset(&idesc, 0, sizeof(struct inodesc));
503 idesc.id_type = DATA;
504 idesc.id_func = chgino;
505 idesc.id_number = dir;
506 idesc.id_fix = DONTKNOW;
507 idesc.id_name = strdup(name);
508 idesc.id_parent = newnum; /* new value for name */
509 return (ckinode(ginode(dir), &idesc));
519 struct inodesc idesc;
525 memset(&idesc, 0, sizeof(struct inodesc));
526 idesc.id_type = DATA;
527 idesc.id_func = mkentry;
528 idesc.id_number = parent;
529 idesc.id_parent = ino; /* this is the inode to enter */
530 idesc.id_fix = DONTKNOW;
531 idesc.id_name = strdup(name);
537 if ((ckinode(dp, &idesc) & ALTERED) != 0)
543 return (ckinode(dp, &idesc) & ALTERED);