Lines Matching refs:dirrem

621 SOFTDEP_TYPE(DIRREM, dirrem, "Directory entry deleted");
766 static int handle_workitem_remove(struct dirrem *, int);
767 static struct dirrem *newdirrem(struct buf *, struct inode *,
768 struct inode *, int, struct dirrem **);
778 static struct jremref *cancel_diradd_dotdot(struct inode *, struct dirrem *,
780 static struct jremref *cancel_mkdir_dotdot(struct inode *, struct dirrem *,
782 static void cancel_diradd(struct diradd *, struct dirrem *, struct jremref *,
784 static void dirrem_journal(struct dirrem *, struct jremref *, struct jremref *,
805 static void journal_jremref(struct dirrem *, struct jremref *,
894 static struct jremref *newjremref(struct dirrem *, struct inode *,
1772 struct dirrem *dirrem;
1785 LIST_FOREACH(dirrem, &inodedep->id_dirremhd, dm_inonext) {
1791 if (dirrem->dm_state & INPROGRESS) {
1792 wait_worklist(&dirrem->dm_list, "pwrwait");
1795 if ((dirrem->dm_state & (COMPLETE | ONWORKLIST)) ==
1799 if (dirrem == NULL)
1801 remove_from_worklist(&dirrem->dm_list);
1805 handle_workitem_remove(dirrem, 0);
4011 struct dirrem *dirrem;
4023 * Complete the dirrem.
4025 dirrem = jremref->jr_dirrem;
4029 jwork_insert(&dirrem->dm_jwork, jsegdep);
4030 if (LIST_EMPTY(&dirrem->dm_jremrefhd) &&
4031 (dirrem->dm_state & COMPLETE) != 0)
4032 add_to_worklist(&dirrem->dm_list, 0);
4294 newjremref(struct dirrem *dirrem,
4307 jremref->jr_dirrem = dirrem;
7423 struct dirrem *dirrem, *tmp;
7432 LIST_FOREACH_SAFE(dirrem, &pagedep->pd_dirremhd, dm_next, tmp) {
7434 if (dirrem->dm_offset < blkoff)
7441 while ((jremref = LIST_FIRST(&dirrem->dm_jremrefhd)) != NULL) {
7445 LIST_REMOVE(dirrem, dm_next);
7446 dirrem->dm_dirinum = pagedep->pd_ino;
7447 WORKLIST_INSERT(&freeblks->fb_freeworkhd, &dirrem->dm_list);
9006 * Cancel a diradd when a dirrem overlaps with it. We must cancel the journal
9012 struct dirrem *dirrem,
9045 &dirrem->dm_jwork) == 0) {
9066 &dirrem->dm_jwork) == 0) {
9072 &dirrem->dm_jwork) == 0) {
9081 journal_jremref(dirrem, jremref, inodedep);
9083 journal_jremref(dirrem, dotremref, inodedep);
9085 journal_jremref(dirrem, dotdotremref, NULL);
9086 jwork_move(&dirrem->dm_jwork, &dap->da_jwork);
9087 free_diradd(dap, &dirrem->dm_jwork);
9096 struct dirrem *dirrem;
9110 dirrem = dap->da_previous;
9111 pagedep = dirrem->dm_pagedep;
9112 dirrem->dm_dirinum = pagedep->pd_ino;
9113 dirrem->dm_state |= COMPLETE;
9114 if (LIST_EMPTY(&dirrem->dm_jremrefhd))
9115 add_to_worklist(&dirrem->dm_list, 0);
9174 struct dirrem *dirrem, *prevdirrem;
9183 * Allocate a new dirrem if appropriate and ACQUIRE_LOCK. We want
9187 dirrem = newdirrem(bp, dp, ip, isrmdir, &prevdirrem);
9189 * Add the dirrem to the inodedep's pending remove list for quick
9195 dirrem->dm_state |= ONDEPLIST;
9196 LIST_INSERT_HEAD(&inodedep->id_dirremhd, dirrem, dm_inonext);
9209 if ((dirrem->dm_state & COMPLETE) == 0) {
9210 LIST_INSERT_HEAD(&dirrem->dm_pagedep->pd_dirremhd, dirrem,
9215 LIST_INSERT_HEAD(&dirrem->dm_pagedep->pd_dirremhd,
9217 dirrem->dm_dirinum = dirrem->dm_pagedep->pd_ino;
9218 direct = LIST_EMPTY(&dirrem->dm_jremrefhd);
9221 handle_workitem_remove(dirrem, 0);
9251 struct dirrem *dirrem,
9263 cancel_diradd(dap, dirrem, jremref, NULL, NULL);
9268 LIST_FOREACH(wk, &dirrem->dm_jwork, wk_list)
9275 * replace it with a dirrem/diradd pair as a result of re-parenting a
9281 struct dirrem *dirrem,
9309 if (cancel_jaddref(jaddref, inodedep, &dirrem->dm_jwork)) {
9310 journal_jremref(dirrem, jremref, inodedep);
9322 journal_jremref(struct dirrem *dirrem,
9331 LIST_INSERT_HEAD(&dirrem->dm_jremrefhd, jremref, jr_deps);
9338 struct dirrem *dirrem,
9348 journal_jremref(dirrem, jremref, inodedep);
9350 journal_jremref(dirrem, dotremref, inodedep);
9352 journal_jremref(dirrem, dotdotremref, NULL);
9356 * Allocate a new dirrem if appropriate and return it along with
9359 static struct dirrem *
9365 struct dirrem **prevdirremp) /* previously referenced inode, if any */
9370 struct dirrem *dirrem;
9390 * Limiting the number of dirrem structures will also limit
9398 dirrem = malloc(sizeof(struct dirrem), M_DIRREM, M_SOFTDEP_FLAGS |
9400 workitem_alloc(&dirrem->dm_list, D_DIRREM, dvp->v_mount);
9401 LIST_INIT(&dirrem->dm_jremrefhd);
9402 LIST_INIT(&dirrem->dm_jwork);
9403 dirrem->dm_state = isrmdir ? RMDIR : 0;
9404 dirrem->dm_oldinum = ip->i_number;
9416 jremref = newjremref(dirrem, dp, ip, I_OFFSET(dp),
9418 dotremref = newjremref(dirrem, ip, ip, DOT_OFFSET,
9420 dotdotremref = newjremref(dirrem, ip, dp, DOTDOT_OFFSET,
9424 jremref = newjremref(dirrem, dp, ip, I_OFFSET(dp),
9432 dirrem->dm_pagedep = pagedep;
9433 dirrem->dm_offset = offset;
9443 jremref = cancel_mkdir_dotdot(dp, dirrem, jremref);
9447 * cancel it. Any pending journal work will be added to the dirrem
9451 dotdotremref = cancel_diradd_dotdot(ip, dirrem, dotdotremref);
9460 * Link the jremref structures into the dirrem so they are
9464 dirrem_journal(dirrem, jremref, dotremref,
9466 return (dirrem);
9478 * then return the dirrem describing the previous inode (which
9490 dirrem->dm_state |= COMPLETE;
9491 cancel_diradd(dap, dirrem, jremref, dotremref, dotdotremref);
9496 LIST_FOREACH(wk, &dirrem->dm_jwork, wk_list)
9502 return (dirrem);
9532 struct dirrem *dirrem, *prevdirrem;
9559 * Allocate a new dirrem and ACQUIRE_LOCK.
9561 dirrem = newdirrem(bp, dp, ip, isrmdir, &prevdirrem);
9562 pagedep = dirrem->dm_pagedep;
9571 * dirrem which is usually done in handle_workitem_remove. We set
9573 * followup dirrem.
9576 dirrem->dm_state |= DIRCHG;
9580 * so just put the dirrem on the correct list.
9583 if ((dirrem->dm_state & COMPLETE) == 0) {
9584 LIST_INSERT_HEAD(&pagedep->pd_dirremhd, dirrem,
9587 dirrem->dm_dirinum = pagedep->pd_ino;
9588 if (LIST_EMPTY(&dirrem->dm_jremrefhd))
9589 add_to_worklist(&dirrem->dm_list, 0);
9595 * Add the dirrem to the inodedep's pending remove list for quick
9601 dirrem->dm_state |= ONDEPLIST;
9602 LIST_INSERT_HEAD(&inodedep->id_dirremhd, dirrem, dm_inonext);
9617 if ((dirrem->dm_state & COMPLETE) == 0) {
9618 dap->da_previous = dirrem;
9626 dirrem->dm_dirinum = pagedep->pd_ino;
9627 if (LIST_EMPTY(&dirrem->dm_jremrefhd))
9628 add_to_worklist(&dirrem->dm_list, 0);
9999 handle_workitem_remove(struct dirrem *dirrem, int flags)
10010 if (dirrem->dm_state & ONWORKLIST)
10011 panic("handle_workitem_remove: dirrem %p still on worklist",
10012 dirrem);
10013 oldinum = dirrem->dm_oldinum;
10014 mp = dirrem->dm_list.wk_mp;
10025 if (dirrem->dm_state & ONDEPLIST)
10026 LIST_REMOVE(dirrem, dm_inonext);
10027 KASSERT(LIST_EMPTY(&dirrem->dm_jremrefhd),
10032 * from the dirrem to the inode inowait list to be completed
10043 while ((wk = LIST_FIRST(&dirrem->dm_jwork)) != NULL) {
10045 if ((dirrem->dm_state & DIRCHG) == 0 &&
10053 LIST_SWAP(&dirrem->dm_jwork, &dotdotwk, worklist, wk_list);
10057 if ((dirrem->dm_state & RMDIR) == 0) {
10069 KASSERT(LIST_EMPTY(&dirrem->dm_jwork),
10071 TYPENAME(LIST_FIRST(&dirrem->dm_jwork)->wk_type)));
10072 WORKITEM_FREE(dirrem, D_DIRREM);
10095 * directory should not change. Thus we skip the followup dirrem.
10097 if (dirrem->dm_state & DIRCHG) {
10098 KASSERT(LIST_EMPTY(&dirrem->dm_jwork),
10100 WORKITEM_FREE(dirrem, D_DIRREM);
10104 dirrem->dm_state = ONDEPLIST;
10105 dirrem->dm_oldinum = dirrem->dm_dirinum;
10107 * Place the dirrem on the parent's diremhd list.
10109 if (inodedep_lookup(mp, dirrem->dm_oldinum, 0, &inodedep) == 0)
10111 LIST_INSERT_HEAD(&inodedep->id_dirremhd, dirrem, dm_inonext);
10124 return handle_workitem_remove(dirrem, flags);
10126 WORKLIST_INSERT(&inodedep->id_inowait, &dirrem->dm_list);
10343 struct dirrem *dirrem;
10365 LIST_FOREACH(dirrem, &pagedep->pd_dirremhd, dm_next)
10366 while ((jremref = LIST_FIRST(&dirrem->dm_jremrefhd)) != NULL)
12343 struct dirrem *dirrem;
12356 while ((dirrem = LIST_FIRST(&pagedep->pd_dirremhd)) != NULL) {
12357 LIST_REMOVE(dirrem, dm_next);
12358 dirrem->dm_state |= COMPLETE;
12359 dirrem->dm_dirinum = pagedep->pd_ino;
12360 KASSERT(LIST_EMPTY(&dirrem->dm_jremrefhd),
12362 add_to_worklist(&dirrem->dm_list, 0);
14062 * reduce the number of dirrem, freefile, and freeblks dependency structures.
14335 struct dirrem *dirrem;
14396 LIST_FOREACH(dirrem, &pagedep->pd_dirremhd, dm_next) {
14397 if (LIST_FIRST(&dirrem->dm_jremrefhd)) {