Deleted Added
full compact
softdep.h (98542) softdep.h (100344)
1/*
2 * Copyright 1998, 2000 Marshall Kirk McKusick. All Rights Reserved.
3 *
4 * The soft updates code is derived from the appendix of a University
5 * of Michigan technical report (Gregory R. Ganger and Yale N. Patt,
6 * "Soft Updates: A Solution to the Metadata Update Problem in File
7 * Systems", CSE-TR-254-95, August 1995).
8 *

--- 22 unchanged lines hidden (view full) ---

31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * @(#)softdep.h 9.7 (McKusick) 6/21/00
1/*
2 * Copyright 1998, 2000 Marshall Kirk McKusick. All Rights Reserved.
3 *
4 * The soft updates code is derived from the appendix of a University
5 * of Michigan technical report (Gregory R. Ganger and Yale N. Patt,
6 * "Soft Updates: A Solution to the Metadata Update Problem in File
7 * Systems", CSE-TR-254-95, August 1995).
8 *

--- 22 unchanged lines hidden (view full) ---

31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * @(#)softdep.h 9.7 (McKusick) 6/21/00
39 * $FreeBSD: head/sys/ufs/ffs/softdep.h 98542 2002-06-21 06:18:05Z mckusick $
39 * $FreeBSD: head/sys/ufs/ffs/softdep.h 100344 2002-07-19 07:29:39Z mckusick $
40 */
41
42#include <sys/queue.h>
43
44/*
45 * Allocation dependencies are handled with undo/redo on the in-memory
46 * copy of the data. A particular data dependency is eliminated when
47 * it is ALLCOMPLETE: that is ATTACHED, DEPCOMPLETE, and COMPLETE.

--- 36 unchanged lines hidden (view full) ---

84 * discarded. The IOSTARTED flag prevents multiple calls to the I/O
85 * start routine from doing multiple rollbacks. The SPACECOUNTED flag
86 * says that the files space has been accounted to the pending free
87 * space count. The NEWBLOCK flag marks pagedep structures that have
88 * just been allocated, so must be claimed by the inode before all
89 * dependencies are complete. The INPROGRESS flag marks worklist
90 * structures that are still on the worklist, but are being considered
91 * for action by some process. The UFS1FMT flag indicates that the
40 */
41
42#include <sys/queue.h>
43
44/*
45 * Allocation dependencies are handled with undo/redo on the in-memory
46 * copy of the data. A particular data dependency is eliminated when
47 * it is ALLCOMPLETE: that is ATTACHED, DEPCOMPLETE, and COMPLETE.

--- 36 unchanged lines hidden (view full) ---

84 * discarded. The IOSTARTED flag prevents multiple calls to the I/O
85 * start routine from doing multiple rollbacks. The SPACECOUNTED flag
86 * says that the files space has been accounted to the pending free
87 * space count. The NEWBLOCK flag marks pagedep structures that have
88 * just been allocated, so must be claimed by the inode before all
89 * dependencies are complete. The INPROGRESS flag marks worklist
90 * structures that are still on the worklist, but are being considered
91 * for action by some process. The UFS1FMT flag indicates that the
92 * inode being processed is a ufs1 format. The ONWORKLIST flag shows
93 * whether the structure is currently linked onto a worklist.
92 * inode being processed is a ufs1 format. The EXTDATA flag indicates
93 * that the allocdirect describes an extended-attributes dependency.
94 * The ONWORKLIST flag shows whether the structure is currently linked
95 * onto a worklist.
94 */
95#define ATTACHED 0x0001
96#define UNDONE 0x0002
97#define COMPLETE 0x0004
98#define DEPCOMPLETE 0x0008
99#define MKDIR_PARENT 0x0010 /* diradd & mkdir only */
100#define MKDIR_BODY 0x0020 /* diradd & mkdir only */
101#define RMDIR 0x0040 /* dirrem only */
102#define DIRCHG 0x0080 /* diradd & dirrem only */
103#define GOINGAWAY 0x0100 /* indirdep only */
104#define IOSTARTED 0x0200 /* inodedep & pagedep only */
105#define SPACECOUNTED 0x0400 /* inodedep only */
106#define NEWBLOCK 0x0800 /* pagedep only */
107#define INPROGRESS 0x1000 /* dirrem, freeblks, freefrag, freefile only */
108#define UFS1FMT 0x2000 /* indirdep only */
96 */
97#define ATTACHED 0x0001
98#define UNDONE 0x0002
99#define COMPLETE 0x0004
100#define DEPCOMPLETE 0x0008
101#define MKDIR_PARENT 0x0010 /* diradd & mkdir only */
102#define MKDIR_BODY 0x0020 /* diradd & mkdir only */
103#define RMDIR 0x0040 /* dirrem only */
104#define DIRCHG 0x0080 /* diradd & dirrem only */
105#define GOINGAWAY 0x0100 /* indirdep only */
106#define IOSTARTED 0x0200 /* inodedep & pagedep only */
107#define SPACECOUNTED 0x0400 /* inodedep only */
108#define NEWBLOCK 0x0800 /* pagedep only */
109#define INPROGRESS 0x1000 /* dirrem, freeblks, freefrag, freefile only */
110#define UFS1FMT 0x2000 /* indirdep only */
111#define EXTDATA 0x4000 /* allocdirect only */
109#define ONWORKLIST 0x8000
110
111#define ALLCOMPLETE (ATTACHED | COMPLETE | DEPCOMPLETE)
112
113/*
114 * The workitem queue.
115 *
116 * It is sometimes useful and/or necessary to clean up certain dependencies

--- 129 unchanged lines hidden (view full) ---

246 struct worklist id_list; /* buffer holding inode block */
247# define id_state id_list.wk_state /* inode dependency state */
248 LIST_ENTRY(inodedep) id_hash; /* hashed lookup */
249 struct fs *id_fs; /* associated filesystem */
250 ino_t id_ino; /* dependent inode */
251 nlink_t id_nlinkdelta; /* saved effective link count */
252 LIST_ENTRY(inodedep) id_deps; /* bmsafemap's list of inodedep's */
253 struct buf *id_buf; /* related bmsafemap (if pending) */
112#define ONWORKLIST 0x8000
113
114#define ALLCOMPLETE (ATTACHED | COMPLETE | DEPCOMPLETE)
115
116/*
117 * The workitem queue.
118 *
119 * It is sometimes useful and/or necessary to clean up certain dependencies

--- 129 unchanged lines hidden (view full) ---

249 struct worklist id_list; /* buffer holding inode block */
250# define id_state id_list.wk_state /* inode dependency state */
251 LIST_ENTRY(inodedep) id_hash; /* hashed lookup */
252 struct fs *id_fs; /* associated filesystem */
253 ino_t id_ino; /* dependent inode */
254 nlink_t id_nlinkdelta; /* saved effective link count */
255 LIST_ENTRY(inodedep) id_deps; /* bmsafemap's list of inodedep's */
256 struct buf *id_buf; /* related bmsafemap (if pending) */
257 long id_savedextsize; /* ext size saved during rollback */
254 off_t id_savedsize; /* file size saved during rollback */
255 struct workhead id_pendinghd; /* entries awaiting directory write */
256 struct workhead id_bufwait; /* operations after inode written */
257 struct workhead id_inowait; /* operations waiting inode update */
258 struct allocdirectlst id_inoupdt; /* updates before inode written */
259 struct allocdirectlst id_newinoupdt; /* updates when inode written */
258 off_t id_savedsize; /* file size saved during rollback */
259 struct workhead id_pendinghd; /* entries awaiting directory write */
260 struct workhead id_bufwait; /* operations after inode written */
261 struct workhead id_inowait; /* operations waiting inode update */
262 struct allocdirectlst id_inoupdt; /* updates before inode written */
263 struct allocdirectlst id_newinoupdt; /* updates when inode written */
264 struct allocdirectlst id_extupdt; /* extdata updates pre-inode write */
265 struct allocdirectlst id_newextupdt; /* extdata updates at ino write */
260 union {
261 struct ufs1_dinode *idu_savedino1; /* saved ufs1_dinode contents */
262 struct ufs2_dinode *idu_savedino2; /* saved ufs2_dinode contents */
263 } id_un;
264};
265#define id_savedino1 id_un.idu_savedino1
266#define id_savedino2 id_un.idu_savedino2
267

--- 154 unchanged lines hidden (view full) ---

422 * zero'ed inode has been written to disk.
423 */
424struct freeblks {
425 struct worklist fb_list; /* id_inowait or delayed worklist */
426 ino_t fb_previousinum; /* inode of previous owner of blocks */
427 uid_t fb_uid; /* uid of previous owner of blocks */
428 struct vnode *fb_devvp; /* filesystem device vnode */
429 struct mount *fb_mnt; /* associated mount point */
266 union {
267 struct ufs1_dinode *idu_savedino1; /* saved ufs1_dinode contents */
268 struct ufs2_dinode *idu_savedino2; /* saved ufs2_dinode contents */
269 } id_un;
270};
271#define id_savedino1 id_un.idu_savedino1
272#define id_savedino2 id_un.idu_savedino2
273

--- 154 unchanged lines hidden (view full) ---

428 * zero'ed inode has been written to disk.
429 */
430struct freeblks {
431 struct worklist fb_list; /* id_inowait or delayed worklist */
432 ino_t fb_previousinum; /* inode of previous owner of blocks */
433 uid_t fb_uid; /* uid of previous owner of blocks */
434 struct vnode *fb_devvp; /* filesystem device vnode */
435 struct mount *fb_mnt; /* associated mount point */
436 long fb_oldextsize; /* previous ext data size */
430 off_t fb_oldsize; /* previous file size */
437 off_t fb_oldsize; /* previous file size */
431 off_t fb_newsize; /* new file size */
432 ufs2_daddr_t fb_chkcnt; /* used to check cnt of blks released */
433 ufs2_daddr_t fb_dblks[NDADDR]; /* direct blk ptrs to deallocate */
434 ufs2_daddr_t fb_iblks[NIADDR]; /* indirect blk ptrs to deallocate */
438 ufs2_daddr_t fb_chkcnt; /* used to check cnt of blks released */
439 ufs2_daddr_t fb_dblks[NDADDR]; /* direct blk ptrs to deallocate */
440 ufs2_daddr_t fb_iblks[NIADDR]; /* indirect blk ptrs to deallocate */
441 ufs2_daddr_t fb_eblks[NXADDR]; /* indirect blk ptrs to deallocate */
435};
436
437/*
438 * A "freefile" structure is attached to an inode when its
439 * link count is reduced to zero. It marks the inode as free in
440 * the cylinder group map after the zero'ed inode has been written
441 * to disk and any associated blocks and fragments have been freed.
442 */

--- 140 unchanged lines hidden ---
442};
443
444/*
445 * A "freefile" structure is attached to an inode when its
446 * link count is reduced to zero. It marks the inode as free in
447 * the cylinder group map after the zero'ed inode has been written
448 * to disk and any associated blocks and fragments have been freed.
449 */

--- 140 unchanged lines hidden ---