Tabify, and fix some comment alignment problems.
This commit is contained in:
parent
ff58e08182
commit
fdf4bfe002
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: lfs.h,v 1.48 2003/02/19 12:49:10 yamt Exp $ */
|
||||
/* $NetBSD: lfs.h,v 1.49 2003/02/20 04:27:23 perseant Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
|
||||
@ -17,8 +17,8 @@
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
@ -77,13 +77,13 @@
|
||||
* Compile-time options for LFS.
|
||||
*/
|
||||
#define LFS_IFIND_RETRIES 16
|
||||
#define LFS_EAGAIN_FAIL /* markv fail with EAGAIN if ino is locked */
|
||||
#define LFS_DEBUG_RFW /* print roll-forward debugging info */
|
||||
#define LFS_NO_PAGEMOVE /* Use malloc/copy to write clusters */
|
||||
#define LFS_EAGAIN_FAIL /* markv fail with EAGAIN if ino is locked */
|
||||
#define LFS_DEBUG_RFW /* print roll-forward debugging info */
|
||||
#define LFS_NO_PAGEMOVE /* Use malloc/copy to write clusters */
|
||||
#define LFS_AGGRESSIVE_SEGLOCK
|
||||
#define LFS_LOGLENGTH 1024
|
||||
|
||||
/* #define DEBUG_LFS */ /* Intensive debugging of LFS subsystem */
|
||||
/* #define DEBUG_LFS */ /* Intensive debugging of LFS subsystem */
|
||||
|
||||
#ifdef LFS_NO_PAGEMOVE
|
||||
# define LFS_MALLOC_SUMMARY
|
||||
@ -113,17 +113,17 @@
|
||||
|
||||
/* Number of reserved memory blocks of each type */
|
||||
#define LFS_N_SUMMARIES 2
|
||||
#define LFS_N_SBLOCKS 1 /* Always 1, to throttle superblock writes */
|
||||
#define LFS_N_IBLOCKS 16 /* In theory ssize/bsize; in practice around 2 */
|
||||
#define LFS_N_CLUSTERS 16 /* In theory ssize/MAXPHYS */
|
||||
#define LFS_N_CLEAN 0
|
||||
#define LFS_N_SBLOCKS 1 /* Always 1, to throttle superblock writes */
|
||||
#define LFS_N_IBLOCKS 16 /* In theory ssize/bsize; in practice around 2 */
|
||||
#define LFS_N_CLUSTERS 16 /* In theory ssize/MAXPHYS */
|
||||
#define LFS_N_CLEAN 0
|
||||
|
||||
/* Total count of "large" (non-pool) types */
|
||||
#define LFS_N_TOTAL (LFS_N_SUMMARIES + LFS_N_SBLOCKS + LFS_N_IBLOCKS + LFS_N_CLUSTERS + LFS_N_CLEAN)
|
||||
|
||||
/* Counts for pool types */
|
||||
#define LFS_N_CL LFS_N_CLUSTERS
|
||||
#define LFS_N_BPP 2
|
||||
#define LFS_N_CL LFS_N_CLUSTERS
|
||||
#define LFS_N_BPP 2
|
||||
#define LFS_N_SEG 2
|
||||
|
||||
/* Structure to keep reserved blocks */
|
||||
@ -137,25 +137,25 @@ typedef struct lfs_res_blk {
|
||||
* #define WRITE_THRESHHOLD ((nbuf >> 1) - 10)
|
||||
* #define WAIT_THRESHHOLD (nbuf - (nbuf >> 2) - 10)
|
||||
*/
|
||||
#define LFS_MAX_BUFS ((nbuf >> 2) - 10)
|
||||
#define LFS_WAIT_BUFS ((nbuf >> 1) - (nbuf >> 3) - 10)
|
||||
#define LFS_MAX_BUFS ((nbuf >> 2) - 10)
|
||||
#define LFS_WAIT_BUFS ((nbuf >> 1) - (nbuf >> 3) - 10)
|
||||
/* These are new ... is LFS taking up too much memory in its buffers? */
|
||||
#define LFS_MAX_BYTES (((bufpages >> 2) - 10) * NBPG)
|
||||
#define LFS_WAIT_BYTES (((bufpages >> 1) - (bufpages >> 3) - 10) * NBPG)
|
||||
#define LFS_MAX_BYTES (((bufpages >> 2) - 10) * NBPG)
|
||||
#define LFS_WAIT_BYTES (((bufpages >> 1) - (bufpages >> 3) - 10) * NBPG)
|
||||
#define LFS_MAX_DIROP ((desiredvnodes >> 2) + (desiredvnodes >> 3))
|
||||
#define LFS_BUFWAIT 2
|
||||
#define LFS_BUFWAIT 2
|
||||
|
||||
#define LFS_MAX_PAGES \
|
||||
(((uvmexp.active + uvmexp.inactive + uvmexp.free) * uvmexp.filemin) >> 8)
|
||||
#define LFS_WAIT_PAGES \
|
||||
(((uvmexp.active + uvmexp.inactive + uvmexp.free) * uvmexp.filemax) >> 8)
|
||||
|
||||
#define LFS_IS_MALLOC_BUF(bp) (((bp)->b_flags & B_CALL) && \
|
||||
#define LFS_IS_MALLOC_BUF(bp) (((bp)->b_flags & B_CALL) && \
|
||||
((bp)->b_iodone == lfs_callback || (bp)->b_iodone == lfs_fakebuf_iodone))
|
||||
|
||||
#define LFS_LOCK_BUF(bp) do { \
|
||||
if (((bp)->b_flags & (B_LOCKED | B_CALL)) == 0) { \
|
||||
++locked_queue_count; \
|
||||
++locked_queue_count; \
|
||||
locked_queue_bytes += bp->b_bufsize; \
|
||||
} \
|
||||
(bp)->b_flags |= B_LOCKED; \
|
||||
@ -163,7 +163,7 @@ typedef struct lfs_res_blk {
|
||||
|
||||
#define LFS_UNLOCK_BUF(bp) do { \
|
||||
if (((bp)->b_flags & (B_LOCKED | B_CALL)) == B_LOCKED) { \
|
||||
--locked_queue_count; \
|
||||
--locked_queue_count; \
|
||||
locked_queue_bytes -= bp->b_bufsize; \
|
||||
if (locked_queue_count < LFS_WAIT_BUFS && \
|
||||
locked_queue_bytes < LFS_WAIT_BYTES) \
|
||||
@ -173,14 +173,14 @@ typedef struct lfs_res_blk {
|
||||
} while (0)
|
||||
|
||||
#ifdef DEBUG_LOCKED_LIST
|
||||
# define LFS_DEBUG_COUNTLOCKED(m) do { \
|
||||
int _s; \
|
||||
# define LFS_DEBUG_COUNTLOCKED(m) do { \
|
||||
int _s; \
|
||||
extern int locked_queue_count; \
|
||||
extern long locked_queue_bytes; \
|
||||
_s = splbio(); \
|
||||
lfs_countlocked(&locked_queue_count, &locked_queue_bytes, (m)); \
|
||||
splx(_s); \
|
||||
wakeup(&locked_queue_count); \
|
||||
_s = splbio(); \
|
||||
lfs_countlocked(&locked_queue_count, &locked_queue_bytes, (m)); \
|
||||
splx(_s); \
|
||||
wakeup(&locked_queue_count); \
|
||||
} while (0)
|
||||
#else
|
||||
# define LFS_DEBUG_COUNTLOCKED(m)
|
||||
@ -189,27 +189,27 @@ typedef struct lfs_res_blk {
|
||||
/* For convenience */
|
||||
#define IN_ALLMOD (IN_MODIFIED|IN_ACCESS|IN_CHANGE|IN_UPDATE|IN_ACCESSED|IN_CLEANING)
|
||||
|
||||
#define LFS_SET_UINO(ip, flags) do { \
|
||||
if (((flags) & IN_ACCESSED) && !((ip)->i_flag & IN_ACCESSED)) \
|
||||
++(ip)->i_lfs->lfs_uinodes; \
|
||||
if (((flags) & IN_CLEANING) && !((ip)->i_flag & IN_CLEANING)) \
|
||||
++(ip)->i_lfs->lfs_uinodes; \
|
||||
if (((flags) & IN_MODIFIED) && !((ip)->i_flag & IN_MODIFIED)) \
|
||||
++(ip)->i_lfs->lfs_uinodes; \
|
||||
(ip)->i_flag |= (flags); \
|
||||
#define LFS_SET_UINO(ip, flags) do { \
|
||||
if (((flags) & IN_ACCESSED) && !((ip)->i_flag & IN_ACCESSED)) \
|
||||
++(ip)->i_lfs->lfs_uinodes; \
|
||||
if (((flags) & IN_CLEANING) && !((ip)->i_flag & IN_CLEANING)) \
|
||||
++(ip)->i_lfs->lfs_uinodes; \
|
||||
if (((flags) & IN_MODIFIED) && !((ip)->i_flag & IN_MODIFIED)) \
|
||||
++(ip)->i_lfs->lfs_uinodes; \
|
||||
(ip)->i_flag |= (flags); \
|
||||
} while (0)
|
||||
|
||||
#define LFS_CLR_UINO(ip, flags) do { \
|
||||
if (((flags) & IN_ACCESSED) && ((ip)->i_flag & IN_ACCESSED)) \
|
||||
--(ip)->i_lfs->lfs_uinodes; \
|
||||
if (((flags) & IN_CLEANING) && ((ip)->i_flag & IN_CLEANING)) \
|
||||
--(ip)->i_lfs->lfs_uinodes; \
|
||||
if (((flags) & IN_MODIFIED) && ((ip)->i_flag & IN_MODIFIED)) \
|
||||
--(ip)->i_lfs->lfs_uinodes; \
|
||||
(ip)->i_flag &= ~(flags); \
|
||||
if ((ip)->i_lfs->lfs_uinodes < 0) { \
|
||||
panic("lfs_uinodes < 0"); \
|
||||
} \
|
||||
#define LFS_CLR_UINO(ip, flags) do { \
|
||||
if (((flags) & IN_ACCESSED) && ((ip)->i_flag & IN_ACCESSED)) \
|
||||
--(ip)->i_lfs->lfs_uinodes; \
|
||||
if (((flags) & IN_CLEANING) && ((ip)->i_flag & IN_CLEANING)) \
|
||||
--(ip)->i_lfs->lfs_uinodes; \
|
||||
if (((flags) & IN_MODIFIED) && ((ip)->i_flag & IN_MODIFIED)) \
|
||||
--(ip)->i_lfs->lfs_uinodes; \
|
||||
(ip)->i_flag &= ~(flags); \
|
||||
if ((ip)->i_lfs->lfs_uinodes < 0) { \
|
||||
panic("lfs_uinodes < 0"); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#ifdef DEBUG
|
||||
@ -248,7 +248,7 @@ extern struct lfs_log_entry lfs_log[LFS_LOGLENGTH];
|
||||
#define LFS_ITIMES(ip, acc, mod, cre) do { \
|
||||
struct lfs *_fs = (ip)->i_lfs; \
|
||||
\
|
||||
if ((ip)->i_flag & IN_ACCESS) { \
|
||||
if ((ip)->i_flag & IN_ACCESS) { \
|
||||
(ip)->i_ffs_atime = (acc)->tv_sec; \
|
||||
(ip)->i_ffs_atimensec = (acc)->tv_nsec; \
|
||||
if ((ip)->i_lfs->lfs_version > 1) { \
|
||||
@ -262,7 +262,7 @@ extern struct lfs_log_entry lfs_log[LFS_LOGLENGTH];
|
||||
_fs->lfs_flags |= LFS_IFDIRTY; \
|
||||
} else { \
|
||||
LFS_SET_UINO(ip, IN_ACCESSED); \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
if ((ip)->i_flag & (IN_CHANGE | IN_UPDATE)) { \
|
||||
if ((ip)->i_flag & IN_UPDATE) { \
|
||||
@ -285,9 +285,9 @@ extern struct lfs_log_entry lfs_log[LFS_LOGLENGTH];
|
||||
*/
|
||||
#ifdef LFS_UBC
|
||||
int lfs_checkifempty(struct vnode *);
|
||||
# define VPISEMPTY(vp) lfs_checkifempty(vp)
|
||||
# define VPISEMPTY(vp) lfs_checkifempty(vp)
|
||||
#else
|
||||
# define VPISEMPTY(vp) ((vp)->v_dirtyblkhd.lh_first == NULL)
|
||||
# define VPISEMPTY(vp) ((vp)->v_dirtyblkhd.lh_first == NULL)
|
||||
#endif
|
||||
/*
|
||||
* WRITEINPROG does not use VPISEMPTY because any dirty pages will
|
||||
@ -312,8 +312,8 @@ struct segusage {
|
||||
#define SEGUSE_ACTIVE 0x01 /* segment currently being written */
|
||||
#define SEGUSE_DIRTY 0x02 /* segment has data in it */
|
||||
#define SEGUSE_SUPERBLOCK 0x04 /* segment contains a superblock */
|
||||
#define SEGUSE_ERROR 0x08 /* cleaner: do not clean segment */
|
||||
#define SEGUSE_EMPTY 0x10 /* segment is empty */
|
||||
#define SEGUSE_ERROR 0x08 /* cleaner: do not clean segment */
|
||||
#define SEGUSE_EMPTY 0x10 /* segment is empty */
|
||||
u_int32_t su_flags; /* 12: segment flags */
|
||||
u_int64_t su_lastmod; /* 16: last modified timestamp */
|
||||
};
|
||||
@ -324,7 +324,7 @@ struct segusage_v1 {
|
||||
u_int32_t su_lastmod; /* 4: SEGUSE last modified timestamp */
|
||||
u_int16_t su_nsums; /* 8: number of summaries in segment */
|
||||
u_int16_t su_ninos; /* 10: number of inode blocks in seg */
|
||||
u_int32_t su_flags; /* 12: segment flags */
|
||||
u_int32_t su_flags; /* 12: segment flags */
|
||||
};
|
||||
|
||||
#define SEGUPB(fs) (fs->lfs_sepb)
|
||||
@ -338,7 +338,7 @@ struct finfo {
|
||||
u_int32_t fi_version; /* version number */
|
||||
u_int32_t fi_ino; /* inode number */
|
||||
u_int32_t fi_lastlength; /* length of last block in array */
|
||||
int32_t fi_blocks[1]; /* array of logical block numbers */
|
||||
int32_t fi_blocks[1]; /* array of logical block numbers */
|
||||
};
|
||||
|
||||
/* sizeof FINFO except fi_blocks */
|
||||
@ -346,91 +346,91 @@ struct finfo {
|
||||
|
||||
/* On-disk super block. */
|
||||
struct dlfs {
|
||||
#define LFS_MAGIC 0x070162
|
||||
u_int32_t dlfs_magic; /* 0: magic number */
|
||||
#define LFS_VERSION 2
|
||||
u_int32_t dlfs_version; /* 4: version number */
|
||||
#define LFS_MAGIC 0x070162
|
||||
u_int32_t dlfs_magic; /* 0: magic number */
|
||||
#define LFS_VERSION 2
|
||||
u_int32_t dlfs_version; /* 4: version number */
|
||||
|
||||
u_int32_t dlfs_size; /* 8: number of blocks in fs (v1) */
|
||||
/* number of frags in fs (v2) */
|
||||
u_int32_t dlfs_ssize; /* 12: number of blocks per segment (v1) */
|
||||
/* number of bytes per segment (v2) */
|
||||
u_int32_t dlfs_dsize; /* 16: number of disk blocks in fs */
|
||||
u_int32_t dlfs_bsize; /* 20: file system block size */
|
||||
u_int32_t dlfs_fsize; /* 24: size of frag blocks in fs */
|
||||
u_int32_t dlfs_frag; /* 28: number of frags in a block in fs */
|
||||
u_int32_t dlfs_size; /* 8: number of blocks in fs (v1) */
|
||||
/* number of frags in fs (v2) */
|
||||
u_int32_t dlfs_ssize; /* 12: number of blocks per segment (v1) */
|
||||
/* number of bytes per segment (v2) */
|
||||
u_int32_t dlfs_dsize; /* 16: number of disk blocks in fs */
|
||||
u_int32_t dlfs_bsize; /* 20: file system block size */
|
||||
u_int32_t dlfs_fsize; /* 24: size of frag blocks in fs */
|
||||
u_int32_t dlfs_frag; /* 28: number of frags in a block in fs */
|
||||
|
||||
/* Checkpoint region. */
|
||||
u_int32_t dlfs_freehd; /* 32: start of the free list */
|
||||
u_int32_t dlfs_bfree; /* 36: number of free disk blocks */
|
||||
u_int32_t dlfs_nfiles; /* 40: number of allocated inodes */
|
||||
int32_t dlfs_avail; /* 44: blocks available for writing */
|
||||
int32_t dlfs_uinodes; /* 48: inodes in cache not yet on disk */
|
||||
int32_t dlfs_idaddr; /* 52: inode file disk address */
|
||||
u_int32_t dlfs_ifile; /* 56: inode file inode number */
|
||||
int32_t dlfs_lastseg; /* 60: address of last segment written */
|
||||
int32_t dlfs_nextseg; /* 64: address of next segment to write */
|
||||
int32_t dlfs_curseg; /* 68: current segment being written */
|
||||
int32_t dlfs_offset; /* 72: offset in curseg for next partial */
|
||||
int32_t dlfs_lastpseg; /* 76: address of last partial written */
|
||||
u_int32_t dlfs_inopf; /* 80: v1: time stamp; v2: inodes per frag */
|
||||
u_int32_t dlfs_freehd; /* 32: start of the free list */
|
||||
u_int32_t dlfs_bfree; /* 36: number of free disk blocks */
|
||||
u_int32_t dlfs_nfiles; /* 40: number of allocated inodes */
|
||||
int32_t dlfs_avail; /* 44: blocks available for writing */
|
||||
int32_t dlfs_uinodes; /* 48: inodes in cache not yet on disk */
|
||||
int32_t dlfs_idaddr; /* 52: inode file disk address */
|
||||
u_int32_t dlfs_ifile; /* 56: inode file inode number */
|
||||
int32_t dlfs_lastseg; /* 60: address of last segment written */
|
||||
int32_t dlfs_nextseg; /* 64: address of next segment to write */
|
||||
int32_t dlfs_curseg; /* 68: current segment being written */
|
||||
int32_t dlfs_offset; /* 72: offset in curseg for next partial */
|
||||
int32_t dlfs_lastpseg; /* 76: address of last partial written */
|
||||
u_int32_t dlfs_inopf; /* 80: v1: time stamp; v2: inodes per frag */
|
||||
#define dlfs_otstamp dlfs_inopf
|
||||
|
||||
/* These are configuration parameters. */
|
||||
u_int32_t dlfs_minfree; /* 84: minimum percentage of free blocks */
|
||||
u_int32_t dlfs_minfree; /* 84: minimum percentage of free blocks */
|
||||
|
||||
/* These fields can be computed from the others. */
|
||||
u_int64_t dlfs_maxfilesize; /* 88: maximum representable file size */
|
||||
u_int32_t dlfs_fsbpseg; /* 96: fsb per segment */
|
||||
u_int32_t dlfs_inopb; /* 100: inodes per block */
|
||||
u_int32_t dlfs_ifpb; /* 104: IFILE entries per block */
|
||||
u_int32_t dlfs_sepb; /* 108: SEGUSE entries per block */
|
||||
u_int32_t dlfs_nindir; /* 112: indirect pointers per block */
|
||||
u_int32_t dlfs_nseg; /* 116: number of segments */
|
||||
u_int32_t dlfs_nspf; /* 120: number of sectors per fragment */
|
||||
u_int32_t dlfs_cleansz; /* 124: cleaner info size in blocks */
|
||||
u_int32_t dlfs_segtabsz; /* 128: segment table size in blocks */
|
||||
u_int32_t dlfs_segmask; /* 132: calculate offset within a segment */
|
||||
u_int32_t dlfs_segshift; /* 136: fast mult/div for segments */
|
||||
u_int32_t dlfs_bshift; /* 140: calc block number from file offset */
|
||||
u_int32_t dlfs_ffshift; /* 144: fast mult/div for frag from file */
|
||||
u_int32_t dlfs_fbshift; /* 148: fast mult/div for frag from block */
|
||||
u_int64_t dlfs_bmask; /* 152: calc block offset from file offset */
|
||||
u_int64_t dlfs_ffmask; /* 160: calc frag offset from file offset */
|
||||
u_int64_t dlfs_fbmask; /* 168: calc frag offset from block offset */
|
||||
u_int32_t dlfs_blktodb; /* 176: blktodb and dbtoblk shift constant */
|
||||
u_int32_t dlfs_sushift; /* 180: fast mult/div for segusage table */
|
||||
u_int64_t dlfs_maxfilesize; /* 88: maximum representable file size */
|
||||
u_int32_t dlfs_fsbpseg; /* 96: fsb per segment */
|
||||
u_int32_t dlfs_inopb; /* 100: inodes per block */
|
||||
u_int32_t dlfs_ifpb; /* 104: IFILE entries per block */
|
||||
u_int32_t dlfs_sepb; /* 108: SEGUSE entries per block */
|
||||
u_int32_t dlfs_nindir; /* 112: indirect pointers per block */
|
||||
u_int32_t dlfs_nseg; /* 116: number of segments */
|
||||
u_int32_t dlfs_nspf; /* 120: number of sectors per fragment */
|
||||
u_int32_t dlfs_cleansz; /* 124: cleaner info size in blocks */
|
||||
u_int32_t dlfs_segtabsz; /* 128: segment table size in blocks */
|
||||
u_int32_t dlfs_segmask; /* 132: calculate offset within a segment */
|
||||
u_int32_t dlfs_segshift; /* 136: fast mult/div for segments */
|
||||
u_int32_t dlfs_bshift; /* 140: calc block number from file offset */
|
||||
u_int32_t dlfs_ffshift; /* 144: fast mult/div for frag from file */
|
||||
u_int32_t dlfs_fbshift; /* 148: fast mult/div for frag from block */
|
||||
u_int64_t dlfs_bmask; /* 152: calc block offset from file offset */
|
||||
u_int64_t dlfs_ffmask; /* 160: calc frag offset from file offset */
|
||||
u_int64_t dlfs_fbmask; /* 168: calc frag offset from block offset */
|
||||
u_int32_t dlfs_blktodb; /* 176: blktodb and dbtoblk shift constant */
|
||||
u_int32_t dlfs_sushift; /* 180: fast mult/div for segusage table */
|
||||
|
||||
int32_t dlfs_maxsymlinklen; /* 184: max length of an internal symlink */
|
||||
#define LFS_MIN_SBINTERVAL 5 /* minimum superblock segment spacing */
|
||||
#define LFS_MAXNUMSB 10 /* 188: superblock disk offsets */
|
||||
int32_t dlfs_sboffs[LFS_MAXNUMSB];
|
||||
int32_t dlfs_maxsymlinklen; /* 184: max length of an internal symlink */
|
||||
#define LFS_MIN_SBINTERVAL 5 /* minimum superblock segment spacing */
|
||||
#define LFS_MAXNUMSB 10 /* 188: superblock disk offsets */
|
||||
int32_t dlfs_sboffs[LFS_MAXNUMSB];
|
||||
|
||||
u_int32_t dlfs_nclean; /* 228: Number of clean segments */
|
||||
u_int32_t dlfs_nclean; /* 228: Number of clean segments */
|
||||
u_char dlfs_fsmnt[MNAMELEN]; /* 232: name mounted on */
|
||||
#define LFS_PF_CLEAN 0x1
|
||||
u_int16_t dlfs_pflags; /* 322: file system persistent flags */
|
||||
int32_t dlfs_dmeta; /* 324: total number of dirty summaries */
|
||||
u_int16_t dlfs_pflags; /* 322: file system persistent flags */
|
||||
int32_t dlfs_dmeta; /* 324: total number of dirty summaries */
|
||||
u_int32_t dlfs_minfreeseg; /* 328: segs reserved for cleaner */
|
||||
u_int32_t dlfs_sumsize; /* 332: size of summary blocks */
|
||||
u_int64_t dlfs_serial; /* 336: serial number */
|
||||
u_int32_t dlfs_ibsize; /* 344: size of inode blocks */
|
||||
int32_t dlfs_start; /* 348: start of segment 0 */
|
||||
u_int64_t dlfs_tstamp; /* 352: time stamp */
|
||||
u_int32_t dlfs_sumsize; /* 332: size of summary blocks */
|
||||
u_int64_t dlfs_serial; /* 336: serial number */
|
||||
u_int32_t dlfs_ibsize; /* 344: size of inode blocks */
|
||||
int32_t dlfs_start; /* 348: start of segment 0 */
|
||||
u_int64_t dlfs_tstamp; /* 352: time stamp */
|
||||
#define LFS_44INODEFMT 0
|
||||
#define LFS_MAXINODEFMT 0
|
||||
u_int32_t dlfs_inodefmt; /* 360: inode format version */
|
||||
u_int32_t dlfs_interleave; /* 364: segment interleave */
|
||||
u_int32_t dlfs_ident; /* 368: per-fs identifier */
|
||||
u_int32_t dlfs_fsbtodb; /* 372: fsbtodb abd dbtodsb shift constant */
|
||||
int8_t dlfs_pad[132]; /* 376: round to 512 bytes */
|
||||
u_int32_t dlfs_ident; /* 368: per-fs identifier */
|
||||
u_int32_t dlfs_fsbtodb; /* 372: fsbtodb abd dbtodsb shift constant */
|
||||
int8_t dlfs_pad[132]; /* 376: round to 512 bytes */
|
||||
/* Checksum -- last valid disk field. */
|
||||
u_int32_t dlfs_cksum; /* 508: checksum for superblock checking */
|
||||
u_int32_t dlfs_cksum; /* 508: checksum for superblock checking */
|
||||
};
|
||||
|
||||
/* In-memory super block. */
|
||||
struct lfs {
|
||||
struct dlfs lfs_dlfs; /* on-disk parameters */
|
||||
struct dlfs lfs_dlfs; /* on-disk parameters */
|
||||
#define lfs_magic lfs_dlfs.dlfs_magic
|
||||
#define lfs_version lfs_dlfs.dlfs_version
|
||||
#define lfs_size lfs_dlfs.dlfs_size
|
||||
@ -508,23 +508,23 @@ struct lfs {
|
||||
#define LFS_IFDIRTY 0x02
|
||||
#define LFS_WARNED 0x04
|
||||
int8_t lfs_flags; /* currently unused flag */
|
||||
u_int16_t lfs_activesb; /* toggle between superblocks */
|
||||
daddr_t lfs_sbactive; /* disk address of in-progress sb write */
|
||||
struct vnode *lfs_flushvp; /* vnode being flushed */
|
||||
struct vnode *lfs_unlockvp; /* being inactivated in lfs_segunlock */
|
||||
u_int16_t lfs_activesb; /* toggle between superblocks */
|
||||
daddr_t lfs_sbactive; /* disk address of in-progress sb write */
|
||||
struct vnode *lfs_flushvp; /* vnode being flushed */
|
||||
struct vnode *lfs_unlockvp; /* being inactivated in lfs_segunlock */
|
||||
u_int32_t lfs_diropwait; /* # procs waiting on dirop flush */
|
||||
size_t lfs_devbsize; /* Device block size */
|
||||
size_t lfs_devbshift; /* Device block shift */
|
||||
struct lock lfs_fraglock;
|
||||
pid_t lfs_rfpid; /* Process ID of roll-forward agent */
|
||||
int lfs_nadirop; /* number of active dirop nodes */
|
||||
long lfs_ravail; /* blocks pre-reserved for writing */
|
||||
int lfs_nadirop; /* number of active dirop nodes */
|
||||
long lfs_ravail; /* blocks pre-reserved for writing */
|
||||
res_t *lfs_resblk; /* Reserved memory for pageout */
|
||||
TAILQ_HEAD(, inode) lfs_dchainhd; /* dirop vnodes */
|
||||
TAILQ_HEAD(, inode) lfs_pchainhd; /* paging vnodes */
|
||||
#define LFS_RESHASH_WIDTH 17
|
||||
LIST_HEAD(, lfs_res_blk) lfs_reshash[LFS_RESHASH_WIDTH];
|
||||
int lfs_pdflush; /* pagedaemon wants us to flush */
|
||||
int lfs_pdflush; /* pagedaemon wants us to flush */
|
||||
u_int32_t **lfs_suflags; /* Segment use flags */
|
||||
#ifdef _KERNEL
|
||||
struct pool lfs_clpool; /* Pool for struct lfs_cluster */
|
||||
@ -551,7 +551,7 @@ struct lfs {
|
||||
|
||||
/* Unassigned disk addresses. */
|
||||
#define UNASSIGNED -1
|
||||
#define UNWRITTEN -2
|
||||
#define UNWRITTEN -2
|
||||
|
||||
/* Unused logical block number */
|
||||
#define LFS_UNUSED_LBN -1
|
||||
@ -560,7 +560,7 @@ typedef struct ifile IFILE;
|
||||
struct ifile {
|
||||
u_int32_t if_version; /* inode version number */
|
||||
#define LFS_UNUSED_DADDR 0 /* out-of-band daddr */
|
||||
int32_t if_daddr; /* inode disk address */
|
||||
int32_t if_daddr; /* inode disk address */
|
||||
ino_t if_nextfree; /* next-unallocated inode */
|
||||
/* XXX - when inode format changes, this changes too */
|
||||
u_int32_t if_atime_sec; /* Last access time, seconds */
|
||||
@ -570,7 +570,7 @@ struct ifile {
|
||||
typedef struct ifile_v1 IFILE_V1;
|
||||
struct ifile_v1 {
|
||||
u_int32_t if_version; /* inode version number */
|
||||
int32_t if_daddr; /* inode disk address */
|
||||
int32_t if_daddr; /* inode disk address */
|
||||
ino_t if_nextfree; /* next-unallocated inode */
|
||||
#if LFS_ATIME_IFILE
|
||||
struct timespec if_atime; /* Last access time */
|
||||
@ -585,9 +585,9 @@ typedef struct _cleanerinfo {
|
||||
u_int32_t clean; /* number of clean segments */
|
||||
u_int32_t dirty; /* number of dirty segments */
|
||||
u_int32_t bfree; /* disk blocks free */
|
||||
int32_t avail; /* disk blocks available */
|
||||
u_int32_t free_head; /* head of the inode free list */
|
||||
u_int32_t free_tail; /* tail of the inode free list */
|
||||
int32_t avail; /* disk blocks available */
|
||||
u_int32_t free_head; /* head of the inode free list */
|
||||
u_int32_t free_tail; /* tail of the inode free list */
|
||||
} CLEANERINFO;
|
||||
|
||||
#define CLEANSIZE_SU(fs) \
|
||||
@ -607,7 +607,7 @@ struct segsum_v1 {
|
||||
u_int32_t ss_datasum; /* 4: check sum of data */
|
||||
u_int32_t ss_magic; /* 8: segment summary magic number */
|
||||
#define SS_MAGIC 0x061561
|
||||
int32_t ss_next; /* 12: next segment */
|
||||
int32_t ss_next; /* 12: next segment */
|
||||
u_int32_t ss_create; /* 16: creation time stamp */
|
||||
u_int16_t ss_nfinfo; /* 20: number of file info structures */
|
||||
u_int16_t ss_ninos; /* 22: number of inodes in summary */
|
||||
@ -624,7 +624,7 @@ struct segsum {
|
||||
u_int32_t ss_sumsum; /* 0: check sum of summary block */
|
||||
u_int32_t ss_datasum; /* 4: check sum of data */
|
||||
u_int32_t ss_magic; /* 8: segment summary magic number */
|
||||
int32_t ss_next; /* 12: next segment */
|
||||
int32_t ss_next; /* 12: next segment */
|
||||
u_int32_t ss_ident; /* 16: roll-forward fsid */
|
||||
#define ss_ocreate ss_ident /* ident is where create was in v1 */
|
||||
u_int16_t ss_nfinfo; /* 20: number of file info structures */
|
||||
@ -644,7 +644,7 @@ struct segsum {
|
||||
/* INOPB is the number of inodes in a secondary storage block. */
|
||||
#define INOPB(fs) ((fs)->lfs_inopb)
|
||||
/* INOPF is the number of inodes in a fragment. */
|
||||
#define INOPF(fs) ((fs)->lfs_inopf)
|
||||
#define INOPF(fs) ((fs)->lfs_inopf)
|
||||
|
||||
#define blksize(fs, ip, lbn) \
|
||||
(((lbn) >= NDADDR || (ip)->i_ffs_size >= ((lbn) + 1) << (fs)->lfs_bshift) \
|
||||
@ -688,12 +688,12 @@ struct segsum {
|
||||
? (fs)->lfs_bsize \
|
||||
: (fragroundup(fs, blkoff(fs, (dip)->di_size))))
|
||||
|
||||
#define segtod(fs, seg) (((fs)->lfs_version == 1 ? \
|
||||
(fs)->lfs_ssize << (fs)->lfs_blktodb : \
|
||||
#define segtod(fs, seg) (((fs)->lfs_version == 1 ? \
|
||||
(fs)->lfs_ssize << (fs)->lfs_blktodb : \
|
||||
btofsb((fs), (fs)->lfs_ssize)) * (seg))
|
||||
#define dtosn(fs, daddr) /* block address to segment number */ \
|
||||
((uint32_t)(((daddr) - (fs)->lfs_start) / segtod((fs), 1)))
|
||||
#define sntod(fs, sn) /* segment number to disk address */ \
|
||||
#define sntod(fs, sn) /* segment number to disk address */ \
|
||||
((daddr_t)(segtod((fs), (sn)) + (fs)->lfs_start))
|
||||
|
||||
/* Read in the block with the cleaner info from the ifile. */
|
||||
@ -706,48 +706,48 @@ struct segsum {
|
||||
} while(0)
|
||||
|
||||
/* Synchronize the Ifile cleaner info with current avail and bfree */
|
||||
#define LFS_SYNC_CLEANERINFO(cip, fs, bp, w) do { \
|
||||
if ((w) || (cip)->bfree != (fs)->lfs_bfree || \
|
||||
(cip)->avail != (fs)->lfs_avail - (fs)->lfs_ravail) { \
|
||||
(cip)->bfree = (fs)->lfs_bfree; \
|
||||
(cip)->avail = (fs)->lfs_avail - (fs)->lfs_ravail; \
|
||||
if (((bp)->b_flags & B_GATHERED) == 0) \
|
||||
(fs)->lfs_flags |= LFS_IFDIRTY; \
|
||||
(void) LFS_BWRITE_LOG(bp); /* Ifile */ \
|
||||
} else \
|
||||
brelse(bp); \
|
||||
#define LFS_SYNC_CLEANERINFO(cip, fs, bp, w) do { \
|
||||
if ((w) || (cip)->bfree != (fs)->lfs_bfree || \
|
||||
(cip)->avail != (fs)->lfs_avail - (fs)->lfs_ravail) { \
|
||||
(cip)->bfree = (fs)->lfs_bfree; \
|
||||
(cip)->avail = (fs)->lfs_avail - (fs)->lfs_ravail; \
|
||||
if (((bp)->b_flags & B_GATHERED) == 0) \
|
||||
(fs)->lfs_flags |= LFS_IFDIRTY; \
|
||||
(void) LFS_BWRITE_LOG(bp); /* Ifile */ \
|
||||
} else \
|
||||
brelse(bp); \
|
||||
} while (0)
|
||||
|
||||
#define LFS_GET_HEADFREE(FS, CIP, BP, FREEP) do { \
|
||||
if ((FS)->lfs_version > 1) { \
|
||||
LFS_CLEANERINFO((CIP), (FS), (BP)); \
|
||||
#define LFS_GET_HEADFREE(FS, CIP, BP, FREEP) do { \
|
||||
if ((FS)->lfs_version > 1) { \
|
||||
LFS_CLEANERINFO((CIP), (FS), (BP)); \
|
||||
(FS)->lfs_freehd = (CIP)->free_head; \
|
||||
brelse(BP); \
|
||||
brelse(BP); \
|
||||
} \
|
||||
*(FREEP) = (FS)->lfs_freehd; \
|
||||
} while (0)
|
||||
|
||||
#define LFS_PUT_HEADFREE(FS, CIP, BP, VAL) do { \
|
||||
#define LFS_PUT_HEADFREE(FS, CIP, BP, VAL) do { \
|
||||
(FS)->lfs_freehd = (VAL); \
|
||||
if ((FS)->lfs_version > 1) { \
|
||||
LFS_CLEANERINFO((CIP), (FS), (BP)); \
|
||||
(CIP)->free_head = (VAL); \
|
||||
LFS_BWRITE_LOG(BP); \
|
||||
(FS)->lfs_flags |= LFS_IFDIRTY; \
|
||||
} \
|
||||
if ((FS)->lfs_version > 1) { \
|
||||
LFS_CLEANERINFO((CIP), (FS), (BP)); \
|
||||
(CIP)->free_head = (VAL); \
|
||||
LFS_BWRITE_LOG(BP); \
|
||||
(FS)->lfs_flags |= LFS_IFDIRTY; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define LFS_GET_TAILFREE(FS, CIP, BP, FREEP) do { \
|
||||
LFS_CLEANERINFO((CIP), (FS), (BP)); \
|
||||
#define LFS_GET_TAILFREE(FS, CIP, BP, FREEP) do { \
|
||||
LFS_CLEANERINFO((CIP), (FS), (BP)); \
|
||||
*(FREEP) = (CIP)->free_tail; \
|
||||
brelse(BP); \
|
||||
brelse(BP); \
|
||||
} while (0)
|
||||
|
||||
#define LFS_PUT_TAILFREE(FS, CIP, BP, VAL) do { \
|
||||
LFS_CLEANERINFO((CIP), (FS), (BP)); \
|
||||
(CIP)->free_tail = (VAL); \
|
||||
LFS_BWRITE_LOG(BP); \
|
||||
(FS)->lfs_flags |= LFS_IFDIRTY; \
|
||||
#define LFS_PUT_TAILFREE(FS, CIP, BP, VAL) do { \
|
||||
LFS_CLEANERINFO((CIP), (FS), (BP)); \
|
||||
(CIP)->free_tail = (VAL); \
|
||||
LFS_BWRITE_LOG(BP); \
|
||||
(FS)->lfs_flags |= LFS_IFDIRTY; \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
@ -759,8 +759,8 @@ struct segsum {
|
||||
int _e; \
|
||||
VTOI((F)->lfs_ivnode)->i_flag |= IN_ACCESS; \
|
||||
if ((_e = bread((F)->lfs_ivnode, \
|
||||
(IN) / (F)->lfs_ifpb + (F)->lfs_cleansz + (F)->lfs_segtabsz, \
|
||||
(F)->lfs_bsize, NOCRED, &(BP))) != 0) \
|
||||
(IN) / (F)->lfs_ifpb + (F)->lfs_cleansz + (F)->lfs_segtabsz, \
|
||||
(F)->lfs_bsize, NOCRED, &(BP))) != 0) \
|
||||
panic("lfs: ifile read %d", _e); \
|
||||
if ((F)->lfs_version == 1) \
|
||||
(IP) = (IFILE *)((IFILE_V1 *)(BP)->b_data + (IN) % (F)->lfs_ifpb); \
|
||||
@ -802,24 +802,24 @@ struct segsum {
|
||||
typedef struct block_info {
|
||||
ino_t bi_inode; /* inode # */
|
||||
/* XXX ondisk32 */
|
||||
int32_t bi_lbn; /* logical block w/in file */
|
||||
int32_t bi_lbn; /* logical block w/in file */
|
||||
int32_t bi_daddr; /* disk address of block */
|
||||
u_int64_t bi_segcreate; /* origin segment create time */
|
||||
int bi_version; /* file version number */
|
||||
void *bi_bp; /* data buffer */
|
||||
int bi_size; /* size of the block (if fragment) */
|
||||
int bi_size; /* size of the block (if fragment) */
|
||||
} BLOCK_INFO;
|
||||
|
||||
/* Compatibility for 1.5 binaries */
|
||||
typedef struct block_info_15 {
|
||||
ino_t bi_inode; /* inode # */
|
||||
/* XXX ondisk32 */
|
||||
int32_t bi_lbn; /* logical block w/in file */
|
||||
int32_t bi_lbn; /* logical block w/in file */
|
||||
int32_t bi_daddr; /* disk address of block */
|
||||
u_int32_t bi_segcreate; /* origin segment create time */
|
||||
int bi_version; /* file version number */
|
||||
void *bi_bp; /* data buffer */
|
||||
int bi_size; /* size of the block (if fragment) */
|
||||
int bi_size; /* size of the block (if fragment) */
|
||||
} BLOCK_INFO_15;
|
||||
|
||||
/* In-memory description of a segment about to be written. */
|
||||
@ -829,7 +829,7 @@ struct segment {
|
||||
struct buf **cbpp; /* pointer to next available bp */
|
||||
struct buf **start_bpp; /* pointer to first bp in this set */
|
||||
struct buf *ibp; /* buffer pointer to inode page */
|
||||
struct dinode *idp; /* pointer to ifile dinode */
|
||||
struct dinode *idp; /* pointer to ifile dinode */
|
||||
struct finfo *fip; /* current fileinfo pointer */
|
||||
struct vnode *vp; /* vnode being gathered */
|
||||
void *segsum; /* segment summary info */
|
||||
@ -848,20 +848,20 @@ struct segment {
|
||||
#define SEGM_WRITERD 0x20 /* LFS writed called us */
|
||||
u_int16_t seg_flags; /* run-time flags for this segment */
|
||||
u_int32_t seg_iocount; /* number of ios pending */
|
||||
int ndupino; /* number of duplicate inodes */
|
||||
int ndupino; /* number of duplicate inodes */
|
||||
};
|
||||
|
||||
struct lfs_cluster {
|
||||
size_t bufsize; /* Size of kept data */
|
||||
size_t bufsize; /* Size of kept data */
|
||||
struct buf **bpp; /* Array of kept buffers */
|
||||
int bufcount; /* Number of kept buffers */
|
||||
int bufcount; /* Number of kept buffers */
|
||||
#define LFS_CL_MALLOC 0x00000001
|
||||
#define LFS_CL_SHIFT 0x00000002
|
||||
#define LFS_CL_SYNC 0x00000004
|
||||
u_int32_t flags; /* Flags */
|
||||
struct lfs *fs; /* LFS that this belongs to */
|
||||
struct lfs *fs; /* LFS that this belongs to */
|
||||
struct segment *seg; /* Segment structure, for LFS_CL_SYNC */
|
||||
void *saveaddr; /* Original contents of saveaddr */
|
||||
void *saveaddr; /* Original contents of saveaddr */
|
||||
char *olddata; /* Original b_data, if LFS_CL_MALLOC */
|
||||
};
|
||||
|
||||
@ -872,7 +872,7 @@ struct lfs_cluster {
|
||||
struct lfs_inode_ext {
|
||||
off_t lfs_osize; /* size of file on disk */
|
||||
u_int32_t lfs_effnblocks; /* number of blocks when i/o completes */
|
||||
size_t lfs_fragsize[NDADDR]; /* size of on-disk direct blocks */
|
||||
size_t lfs_fragsize[NDADDR]; /* size of on-disk direct blocks */
|
||||
TAILQ_ENTRY(inode) lfs_dchain; /* Dirop chain. */
|
||||
TAILQ_ENTRY(inode) lfs_pchain; /* Paging chain. */
|
||||
};
|
||||
@ -886,8 +886,8 @@ struct lfs_inode_ext {
|
||||
* of segment summaries and inode blocks taken into account.
|
||||
*/
|
||||
/* Estimate number of clean blocks not available for writing */
|
||||
#define LFS_EST_CMETA(F) (int32_t)((((F)->lfs_dmeta * \
|
||||
(int64_t)(F)->lfs_nclean) / \
|
||||
#define LFS_EST_CMETA(F) (int32_t)((((F)->lfs_dmeta * \
|
||||
(int64_t)(F)->lfs_nclean) / \
|
||||
((F)->lfs_nseg - (F)->lfs_nclean)))
|
||||
|
||||
/* Estimate total size of the disk not including metadata */
|
||||
@ -897,19 +897,19 @@ struct lfs_inode_ext {
|
||||
#define LFS_EST_BFREE(F) ((F)->lfs_bfree - LFS_EST_CMETA(F) - (F)->lfs_dmeta)
|
||||
|
||||
/* Amount of non-meta space not available to mortal man */
|
||||
#define LFS_EST_RSVD(F) (int32_t)((LFS_EST_NONMETA(F) * \
|
||||
(u_int64_t)(F)->lfs_minfree) / \
|
||||
100)
|
||||
#define LFS_EST_RSVD(F) (int32_t)((LFS_EST_NONMETA(F) * \
|
||||
(u_int64_t)(F)->lfs_minfree) / \
|
||||
100)
|
||||
|
||||
/* Can credential C write BB blocks */
|
||||
#define ISSPACE(F, BB, C) \
|
||||
((((C) == NOCRED || (C)->cr_uid == 0) && \
|
||||
LFS_EST_BFREE(F) >= (BB)) || \
|
||||
LFS_EST_BFREE(F) >= (BB)) || \
|
||||
((C)->cr_uid != 0 && IS_FREESPACE(F, BB)))
|
||||
|
||||
/* Can an ordinary user write BB blocks */
|
||||
#define IS_FREESPACE(F, BB) \
|
||||
(LFS_EST_BFREE(F) >= (BB) + LFS_EST_RSVD(F))
|
||||
(LFS_EST_BFREE(F) >= (BB) + LFS_EST_RSVD(F))
|
||||
|
||||
/* Statistics Counters */
|
||||
struct lfs_stats {
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: lfs_alloc.c,v 1.63 2003/02/17 23:48:16 perseant Exp $ */
|
||||
/* $NetBSD: lfs_alloc.c,v 1.64 2003/02/20 04:27:23 perseant Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
|
||||
@ -17,8 +17,8 @@
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
@ -71,7 +71,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: lfs_alloc.c,v 1.63 2003/02/17 23:48:16 perseant Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: lfs_alloc.c,v 1.64 2003/02/20 04:27:23 perseant Exp $");
|
||||
|
||||
#if defined(_KERNEL_OPT)
|
||||
#include "opt_quota.h"
|
||||
@ -99,7 +99,7 @@ __KERNEL_RCSID(0, "$NetBSD: lfs_alloc.c,v 1.63 2003/02/17 23:48:16 perseant Exp
|
||||
extern int lfs_dirvcount;
|
||||
extern struct lock ufs_hashlock;
|
||||
extern struct simplelock lfs_subsys_lock;
|
||||
extern int lfs_subsys_pages;
|
||||
extern int lfs_subsys_pages;
|
||||
|
||||
static int extend_ifile(struct lfs *, struct ucred *);
|
||||
static int lfs_ialloc(struct lfs *, struct vnode *, ino_t, int, struct vnode **);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: lfs_balloc.c,v 1.36 2003/02/17 23:48:16 perseant Exp $ */
|
||||
/* $NetBSD: lfs_balloc.c,v 1.37 2003/02/20 04:27:23 perseant Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
|
||||
@ -17,8 +17,8 @@
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
@ -71,7 +71,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: lfs_balloc.c,v 1.36 2003/02/17 23:48:16 perseant Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: lfs_balloc.c,v 1.37 2003/02/20 04:27:23 perseant Exp $");
|
||||
|
||||
#if defined(_KERNEL_OPT)
|
||||
#include "opt_quota.h"
|
||||
@ -154,7 +154,7 @@ lfs_balloc(void *v)
|
||||
* we're writing an entire block.
|
||||
*
|
||||
* Note, if the daddr is UNWRITTEN, the block already exists in
|
||||
* the cache (it was read or written earlier). If so, make sure
|
||||
* the cache (it was read or written earlier). If so, make sure
|
||||
* we don't count it as a new block or zero out its contents. If
|
||||
* it did not, make sure we allocate any necessary indirect
|
||||
* blocks.
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: lfs_bio.c,v 1.60 2003/02/19 12:49:10 yamt Exp $ */
|
||||
/* $NetBSD: lfs_bio.c,v 1.61 2003/02/20 04:27:23 perseant Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
|
||||
@ -17,8 +17,8 @@
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
@ -71,7 +71,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: lfs_bio.c,v 1.60 2003/02/19 12:49:10 yamt Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: lfs_bio.c,v 1.61 2003/02/20 04:27:23 perseant Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -105,8 +105,8 @@ __KERNEL_RCSID(0, "$NetBSD: lfs_bio.c,v 1.60 2003/02/19 12:49:10 yamt Exp $");
|
||||
*/
|
||||
int locked_queue_count = 0; /* Count of locked-down buffers. */
|
||||
long locked_queue_bytes = 0L; /* Total size of locked buffers. */
|
||||
int lfs_subsys_pages = 0L; /* Total number LFS-written pages */
|
||||
int lfs_writing = 0; /* Set if already kicked off a writer
|
||||
int lfs_subsys_pages = 0L; /* Total number LFS-written pages */
|
||||
int lfs_writing = 0; /* Set if already kicked off a writer
|
||||
because of buffer space */
|
||||
struct simplelock lfs_subsys_lock; /* Lock on subsys_pages */
|
||||
extern int lfs_dostats;
|
||||
@ -332,7 +332,7 @@ lfs_bwrite(void *v)
|
||||
struct buf *bp = ap->a_bp;
|
||||
|
||||
#ifdef DIAGNOSTIC
|
||||
if (VTOI(bp->b_vp)->i_lfs->lfs_ronly == 0 && (bp->b_flags & B_ASYNC)) {
|
||||
if (VTOI(bp->b_vp)->i_lfs->lfs_ronly == 0 && (bp->b_flags & B_ASYNC)) {
|
||||
panic("bawrite LFS buffer");
|
||||
}
|
||||
#endif /* DIAGNOSTIC */
|
||||
@ -412,7 +412,7 @@ lfs_bwrite_ext(struct buf *bp, int flags)
|
||||
* Don't write *any* blocks if we're mounted read-only.
|
||||
* In particular the cleaner can't write blocks either.
|
||||
*/
|
||||
if (VTOI(bp->b_vp)->i_lfs->lfs_ronly) {
|
||||
if (VTOI(bp->b_vp)->i_lfs->lfs_ronly) {
|
||||
bp->b_flags &= ~(B_DELWRI | B_READ | B_ERROR);
|
||||
LFS_UNLOCK_BUF(bp);
|
||||
if (LFS_IS_MALLOC_BUF(bp))
|
||||
@ -569,9 +569,9 @@ lfs_check(struct vnode *vp, daddr_t blkno, int flags)
|
||||
*/
|
||||
while (fs->lfs_dirops > 0 &&
|
||||
(locked_queue_count + INOCOUNT(fs) > LFS_MAX_BUFS ||
|
||||
locked_queue_bytes + INOBYTES(fs) > LFS_MAX_BYTES ||
|
||||
locked_queue_bytes + INOBYTES(fs) > LFS_MAX_BYTES ||
|
||||
lfs_subsys_pages > LFS_MAX_PAGES ||
|
||||
lfs_dirvcount > LFS_MAX_DIROP || fs->lfs_diropwait > 0))
|
||||
lfs_dirvcount > LFS_MAX_DIROP || fs->lfs_diropwait > 0))
|
||||
{
|
||||
++fs->lfs_diropwait;
|
||||
tsleep(&fs->lfs_writer, PRIBIO+1, "bufdirop", 0);
|
||||
@ -618,7 +618,7 @@ lfs_check(struct vnode *vp, daddr_t blkno, int flags)
|
||||
/*
|
||||
* lfs_flush might not flush all the buffers, if some of the
|
||||
* inodes were locked or if most of them were Ifile blocks
|
||||
* and we weren't asked to checkpoint. Try flushing again
|
||||
* and we weren't asked to checkpoint. Try flushing again
|
||||
* to keep us from blocking indefinitely.
|
||||
*/
|
||||
if (locked_queue_count + INOCOUNT(fs) > LFS_MAX_BUFS ||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: lfs_cksum.c,v 1.21 2003/02/17 23:48:18 perseant Exp $ */
|
||||
/* $NetBSD: lfs_cksum.c,v 1.22 2003/02/20 04:27:24 perseant Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999, 2000, 2001, 2002 The NetBSD Foundation, Inc.
|
||||
@ -17,8 +17,8 @@
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
@ -71,7 +71,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: lfs_cksum.c,v 1.21 2003/02/17 23:48:18 perseant Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: lfs_cksum.c,v 1.22 2003/02/20 04:27:24 perseant Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#ifdef _KERNEL
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: lfs_debug.c,v 1.20 2003/02/17 23:48:18 perseant Exp $ */
|
||||
/* $NetBSD: lfs_debug.c,v 1.21 2003/02/20 04:27:24 perseant Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
|
||||
@ -17,8 +17,8 @@
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
@ -73,7 +73,7 @@
|
||||
#ifdef DEBUG
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: lfs_debug.c,v 1.20 2003/02/17 23:48:18 perseant Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: lfs_debug.c,v 1.21 2003/02/20 04:27:24 perseant Exp $");
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/namei.h>
|
||||
@ -90,13 +90,13 @@ struct lfs_log_entry lfs_log[LFS_LOGLENGTH];
|
||||
|
||||
int lfs_bwrite_log(struct buf *bp, char *file, int line)
|
||||
{
|
||||
struct vop_bwrite_args a;
|
||||
a.a_desc = VDESC(vop_bwrite);
|
||||
a.a_bp = bp;
|
||||
struct vop_bwrite_args a;
|
||||
a.a_desc = VDESC(vop_bwrite);
|
||||
a.a_bp = bp;
|
||||
|
||||
if (!(bp->b_flags & (B_DELWRI | B_GATHERED)))
|
||||
LFS_ENTER_LOG("write", file, line, bp->b_lblkno, bp->b_flags);
|
||||
return (VCALL(bp->b_vp, VOFFSET(vop_bwrite), &a));
|
||||
return (VCALL(bp->b_vp, VOFFSET(vop_bwrite), &a));
|
||||
}
|
||||
|
||||
void lfs_dumplog(void)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: lfs_extern.h,v 1.40 2003/02/18 02:00:08 perseant Exp $ */
|
||||
/* $NetBSD: lfs_extern.h,v 1.41 2003/02/20 04:27:24 perseant Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
|
||||
@ -17,8 +17,8 @@
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
@ -87,7 +87,7 @@ MALLOC_DECLARE(M_SEGMENT);
|
||||
*/
|
||||
#define LFS_WRITEINDIR 1 /* flush indirect blocks on non-checkpoint writes */
|
||||
#define LFS_CLEAN_VNHEAD 2 /* put prev unrefed cleaned vnodes on head of free list */
|
||||
#define LFS_DOSTATS 3
|
||||
#define LFS_DOSTATS 3
|
||||
#define LFS_MAXPAGES 4
|
||||
#define LFS_MAXID 5
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: lfs_inode.c,v 1.64 2003/02/17 23:48:18 perseant Exp $ */
|
||||
/* $NetBSD: lfs_inode.c,v 1.65 2003/02/20 04:27:24 perseant Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
|
||||
@ -17,8 +17,8 @@
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
@ -71,7 +71,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: lfs_inode.c,v 1.64 2003/02/17 23:48:18 perseant Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: lfs_inode.c,v 1.65 2003/02/20 04:27:24 perseant Exp $");
|
||||
|
||||
#if defined(_KERNEL_OPT)
|
||||
#include "opt_quota.h"
|
||||
@ -165,7 +165,7 @@ lfs_update(void *v)
|
||||
* If we are called from vinvalbuf, and the file's blocks have
|
||||
* already been scheduled for writing, but the writes have not
|
||||
* yet completed, lfs_vflush will not be called, and vinvalbuf
|
||||
* will cause a panic. So, we must wait until any pending write
|
||||
* will cause a panic. So, we must wait until any pending write
|
||||
* for our inode completes, if we are called with UPDATE_WAIT set.
|
||||
*/
|
||||
s = splbio();
|
||||
@ -207,7 +207,7 @@ lfs_update(void *v)
|
||||
}
|
||||
--fs->lfs_diropwait;
|
||||
return lfs_vflush(vp);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -368,39 +368,39 @@ lfs_truncate(void *v)
|
||||
lockmgr(&fs->lfs_fraglock, LK_RELEASE, 0);
|
||||
}
|
||||
#ifdef LFS_UBC
|
||||
/*
|
||||
* When truncating a regular file down to a non-block-aligned size,
|
||||
* we must zero the part of last block which is past the new EOF.
|
||||
* We must synchronously flush the zeroed pages to disk
|
||||
* since the new pages will be invalidated as soon as we
|
||||
* inform the VM system of the new, smaller size.
|
||||
* We must do this before acquiring the GLOCK, since fetching
|
||||
* the pages will acquire the GLOCK internally.
|
||||
* So there is a window where another thread could see a whole
|
||||
* zeroed page past EOF, but that's life.
|
||||
*/
|
||||
/*
|
||||
* When truncating a regular file down to a non-block-aligned size,
|
||||
* we must zero the part of last block which is past the new EOF.
|
||||
* We must synchronously flush the zeroed pages to disk
|
||||
* since the new pages will be invalidated as soon as we
|
||||
* inform the VM system of the new, smaller size.
|
||||
* We must do this before acquiring the GLOCK, since fetching
|
||||
* the pages will acquire the GLOCK internally.
|
||||
* So there is a window where another thread could see a whole
|
||||
* zeroed page past EOF, but that's life.
|
||||
*/
|
||||
|
||||
else { /* vp->v_type == VREG && length < osize && offset != 0 */
|
||||
voff_t eoz;
|
||||
else { /* vp->v_type == VREG && length < osize && offset != 0 */
|
||||
voff_t eoz;
|
||||
|
||||
aflags = ap->a_flags & IO_SYNC ? B_SYNC : 0;
|
||||
error = ufs_balloc_range(ovp, length - 1, 1, ap->a_cred,
|
||||
error = ufs_balloc_range(ovp, length - 1, 1, ap->a_cred,
|
||||
aflags);
|
||||
if (error) {
|
||||
return error;
|
||||
}
|
||||
size = blksize(fs, oip, lblkno(fs, length));
|
||||
eoz = MIN(lblktosize(fs, lblkno(fs, length)) + size, osize);
|
||||
uvm_vnp_zerorange(ovp, length, eoz - length);
|
||||
simple_lock(&ovp->v_interlock);
|
||||
error = VOP_PUTPAGES(ovp, trunc_page(length), round_page(eoz),
|
||||
PGO_CLEANIT | PGO_DEACTIVATE | PGO_SYNCIO);
|
||||
if (error) {
|
||||
return error;
|
||||
}
|
||||
}
|
||||
if (error) {
|
||||
return error;
|
||||
}
|
||||
size = blksize(fs, oip, lblkno(fs, length));
|
||||
eoz = MIN(lblktosize(fs, lblkno(fs, length)) + size, osize);
|
||||
uvm_vnp_zerorange(ovp, length, eoz - length);
|
||||
simple_lock(&ovp->v_interlock);
|
||||
error = VOP_PUTPAGES(ovp, trunc_page(length), round_page(eoz),
|
||||
PGO_CLEANIT | PGO_DEACTIVATE | PGO_SYNCIO);
|
||||
if (error) {
|
||||
return error;
|
||||
}
|
||||
}
|
||||
|
||||
lockmgr(&gp->g_glock, LK_EXCLUSIVE, NULL);
|
||||
lockmgr(&gp->g_glock, LK_EXCLUSIVE, NULL);
|
||||
#endif
|
||||
|
||||
oip->i_ffs_size = length;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: lfs_segment.c,v 1.102 2003/02/19 12:02:38 yamt Exp $ */
|
||||
/* $NetBSD: lfs_segment.c,v 1.103 2003/02/20 04:27:24 perseant Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
|
||||
@ -17,8 +17,8 @@
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
@ -71,7 +71,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: lfs_segment.c,v 1.102 2003/02/19 12:02:38 yamt Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: lfs_segment.c,v 1.103 2003/02/20 04:27:24 perseant Exp $");
|
||||
|
||||
#define ivndebug(vp,str) printf("ino %d: %s\n",VTOI(vp)->i_number,(str))
|
||||
|
||||
@ -150,7 +150,7 @@ int lfs_writevnodes(struct lfs *fs, struct mount *mp,
|
||||
struct segment *sp, int dirops);
|
||||
|
||||
int lfs_allclean_wakeup; /* Cleaner wakeup address. */
|
||||
int lfs_writeindir = 1; /* whether to flush indir on non-ckp */
|
||||
int lfs_writeindir = 1; /* whether to flush indir on non-ckp */
|
||||
int lfs_clean_vnhead = 0; /* Allow freeing to head of vn list */
|
||||
int lfs_dirvcount = 0; /* # active dirops */
|
||||
|
||||
@ -162,12 +162,12 @@ extern int locked_queue_count;
|
||||
extern long locked_queue_bytes;
|
||||
|
||||
/* op values to lfs_writevnodes */
|
||||
#define VN_REG 0
|
||||
#define VN_REG 0
|
||||
#define VN_DIROP 1
|
||||
#define VN_EMPTY 2
|
||||
#define VN_CLEAN 3
|
||||
#define VN_CLEAN 3
|
||||
|
||||
#define LFS_MAX_ACTIVE 10
|
||||
#define LFS_MAX_ACTIVE 10
|
||||
|
||||
/*
|
||||
* XXX KS - Set modification time on the Ifile, so the cleaner can
|
||||
@ -310,7 +310,7 @@ lfs_vflush(struct vnode *vp)
|
||||
bremfree(bp);
|
||||
LFS_UNLOCK_BUF(bp);
|
||||
bp->b_flags &= ~(B_ERROR | B_READ | B_DELWRI |
|
||||
B_GATHERED);
|
||||
B_GATHERED);
|
||||
bp->b_flags |= B_DONE;
|
||||
reassignbuf(bp, vp);
|
||||
brelse(bp);
|
||||
@ -780,7 +780,7 @@ lfs_writefile(struct lfs *fs, struct segment *sp, struct vnode *vp)
|
||||
* The same is true of the Ifile since checkpoints assume
|
||||
* that all valid Ifile blocks are written.
|
||||
*/
|
||||
if (IS_FLUSHING(fs,vp) || vp == fs->lfs_ivnode) {
|
||||
if (IS_FLUSHING(fs,vp) || vp == fs->lfs_ivnode) {
|
||||
lfs_gather(fs, sp, vp, lfs_match_data);
|
||||
/*
|
||||
* Don't call VOP_PUTPAGES: if we're flushing,
|
||||
@ -928,7 +928,7 @@ lfs_writeinode(struct lfs *fs, struct segment *sp, struct inode *ip)
|
||||
* If we are cleaning, ensure that we don't write UNWRITTEN disk
|
||||
* addresses to disk; possibly revert the inode size.
|
||||
* XXX By not writing these blocks, we are making the lfs_avail
|
||||
* XXX count on disk wrong by the same amount. We should be
|
||||
* XXX count on disk wrong by the same amount. We should be
|
||||
* XXX able to "borrow" from lfs_avail and return it after the
|
||||
* XXX Ifile is written. See also in lfs_writeseg.
|
||||
*/
|
||||
@ -1009,9 +1009,9 @@ lfs_writeinode(struct lfs *fs, struct segment *sp, struct inode *ip)
|
||||
* The inode's last address should not be in the current partial
|
||||
* segment, except under exceptional circumstances (lfs_writevnodes
|
||||
* had to start over, and in the meantime more blocks were written
|
||||
* to a vnode). Both inodes will be accounted to this segment
|
||||
* to a vnode). Both inodes will be accounted to this segment
|
||||
* in lfs_writeseg so we need to subtract the earlier version
|
||||
* here anyway. The segment count can temporarily dip below
|
||||
* here anyway. The segment count can temporarily dip below
|
||||
* zero here; keep track of how many duplicates we have in
|
||||
* "dupino" so we don't panic below.
|
||||
*/
|
||||
@ -1365,7 +1365,7 @@ lfs_updatemeta(struct segment *sp)
|
||||
* that you cannot have fragments.
|
||||
*
|
||||
* XXX This last is a lie. A cleaned fragment can coexist with
|
||||
* XXX a later indirect block. This will continue to be
|
||||
* XXX a later indirect block. This will continue to be
|
||||
* XXX true until lfs_markv is fixed to do everything with
|
||||
* XXX fake blocks (including fake inodes and fake indirect blocks).
|
||||
*/
|
||||
@ -1385,7 +1385,7 @@ lfs_updatemeta(struct segment *sp)
|
||||
/*
|
||||
* If we write a frag in the wrong place, the cleaner won't
|
||||
* be able to correctly identify its size later, and the
|
||||
* segment will be uncleanable. (Even worse, it will assume
|
||||
* segment will be uncleanable. (Even worse, it will assume
|
||||
* that the indirect block that actually ends the list
|
||||
* is of a smaller size!)
|
||||
*/
|
||||
@ -1474,7 +1474,7 @@ lfs_initseg(struct lfs *fs)
|
||||
#ifdef LFS_MALLOC_SUMMARY
|
||||
sbp = *sp->cbpp = lfs_newbuf(fs, VTOI(fs->lfs_ivnode)->i_devvp,
|
||||
fsbtodb(fs, fs->lfs_offset), fs->lfs_sumsize, LFS_NB_SUMMARY);
|
||||
sp->segsum = (*sp->cbpp)->b_data;
|
||||
sp->segsum = (*sp->cbpp)->b_data;
|
||||
#else
|
||||
sbp = *sp->cbpp = getblk(VTOI(fs->lfs_ivnode)->i_devvp,
|
||||
fsbtodb(fs, fs->lfs_offset), NBPG, 0, 0);
|
||||
@ -1520,7 +1520,7 @@ lfs_newseg(struct lfs *fs)
|
||||
|
||||
LFS_SEGENTRY(sup, fs, dtosn(fs, fs->lfs_nextseg), bp);
|
||||
#ifdef DEBUG_SU_NBYTES
|
||||
printf("lfs_newseg: seg %d := 0 in newseg\n", /* XXXDEBUG */
|
||||
printf("lfs_newseg: seg %d := 0 in newseg\n", /* XXXDEBUG */
|
||||
dtosn(fs, fs->lfs_nextseg)); /* XXXDEBUG */
|
||||
#endif
|
||||
sup->su_flags |= SEGUSE_DIRTY | SEGUSE_ACTIVE;
|
||||
@ -1676,7 +1676,7 @@ lfs_writeseg(struct lfs *fs, struct segment *sp)
|
||||
int i, s;
|
||||
int do_again, nblocks, byteoffset;
|
||||
size_t el_size;
|
||||
struct lfs_cluster *cl;
|
||||
struct lfs_cluster *cl;
|
||||
int (*strategy)(void *);
|
||||
struct vop_strategy_args vop_strategy_a;
|
||||
u_short ninos;
|
||||
@ -1733,7 +1733,7 @@ lfs_writeseg(struct lfs *fs, struct segment *sp)
|
||||
|
||||
ninos = (ssp->ss_ninos + INOPB(fs) - 1) / INOPB(fs);
|
||||
#ifdef DEBUG_SU_NBYTES
|
||||
printf("seg %d += %d for %d inodes\n", /* XXXDEBUG */
|
||||
printf("seg %d += %d for %d inodes\n", /* XXXDEBUG */
|
||||
sp->seg_number, ssp->ss_ninos * DINODE_SIZE,
|
||||
ssp->ss_ninos);
|
||||
#endif
|
||||
@ -1861,7 +1861,7 @@ lfs_writeseg(struct lfs *fs, struct segment *sp)
|
||||
bp->b_flags &= ~B_BUSY;
|
||||
if (bp->b_flags & B_WANTED)
|
||||
wakeup(bp);
|
||||
splx(s);
|
||||
splx(s);
|
||||
/*
|
||||
* We have to re-decrement lfs_avail
|
||||
* since this block is going to come
|
||||
@ -1935,11 +1935,11 @@ lfs_writeseg(struct lfs *fs, struct segment *sp)
|
||||
strategy = devvp->v_op[VOFFSET(vop_strategy)];
|
||||
|
||||
/*
|
||||
* When we simply write the blocks we lose a rotation for every block
|
||||
* When we simply write the blocks we lose a rotation for every block
|
||||
* written. To avoid this problem, we use pagemove to cluster
|
||||
* the buffers into a chunk and write the chunk. CHUNKSIZE is the
|
||||
* largest size I/O devices can handle.
|
||||
*
|
||||
* largest size I/O devices can handle.
|
||||
*
|
||||
* XXX - right now MAXPHYS is only 64k; could it be larger?
|
||||
*/
|
||||
|
||||
@ -2038,10 +2038,10 @@ lfs_writeseg(struct lfs *fs, struct segment *sp)
|
||||
pagemove(bp->b_data, p, bp->b_bcount);
|
||||
cbp->b_bufsize += bp->b_bcount;
|
||||
bp->b_bufsize -= bp->b_bcount;
|
||||
} else {
|
||||
} else {
|
||||
bcopy(bp->b_data, p, bp->b_bcount);
|
||||
/* printf("copy in %p\n", bp->b_data); */
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* XXX If we are *not* shifting, the summary
|
||||
@ -2068,7 +2068,7 @@ lfs_writeseg(struct lfs *fs, struct segment *sp)
|
||||
* Although it cannot be freed for reuse before the
|
||||
* cluster is written to disk, this buffer does not
|
||||
* need to be held busy. Therefore we unbusy it,
|
||||
* while leaving it on the locked list. It will
|
||||
* while leaving it on the locked list. It will
|
||||
* be freed or requeued by the callback depending
|
||||
* on whether it has had B_DELWRI set again in the
|
||||
* meantime.
|
||||
@ -2101,7 +2101,7 @@ lfs_writeseg(struct lfs *fs, struct segment *sp)
|
||||
(i > 1 && vp && *bpp && (*bpp)->b_vp != vp)) &&
|
||||
(bp = LIST_FIRST(&vp->v_dirtyblkhd)) != NULL &&
|
||||
vp->v_mount == fs->lfs_ivnode->v_mount)
|
||||
{
|
||||
{
|
||||
ip = VTOI(vp);
|
||||
#ifdef DEBUG_LFS
|
||||
printf("lfs_writeseg: marking ino %d\n",
|
||||
@ -2320,7 +2320,7 @@ lfs_cluster_aiodone(struct buf *bp)
|
||||
}
|
||||
|
||||
/*
|
||||
* We're done with tbp. If it has not been re-dirtied since
|
||||
* We're done with tbp. If it has not been re-dirtied since
|
||||
* the cluster was written, free it. Otherwise, keep it on
|
||||
* the locked list to be written again.
|
||||
*/
|
||||
@ -2426,7 +2426,7 @@ lfs_generic_callback(struct buf *bp, void (*aiodone)(struct buf *))
|
||||
/* reset b_iodone for when this is a single-buf i/o. */
|
||||
bp->b_iodone = aiodone;
|
||||
|
||||
simple_lock(&uvm.aiodoned_lock); /* locks uvm.aio_done */
|
||||
simple_lock(&uvm.aiodoned_lock); /* locks uvm.aio_done */
|
||||
TAILQ_INSERT_TAIL(&uvm.aio_done, bp, b_freelist);
|
||||
wakeup(&uvm.aiodoned);
|
||||
simple_unlock(&uvm.aiodoned_lock);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: lfs_subr.c,v 1.32 2003/02/19 12:58:53 yamt Exp $ */
|
||||
/* $NetBSD: lfs_subr.c,v 1.33 2003/02/20 04:27:24 perseant Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
|
||||
@ -17,8 +17,8 @@
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
@ -71,7 +71,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: lfs_subr.c,v 1.32 2003/02/19 12:58:53 yamt Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: lfs_subr.c,v 1.33 2003/02/20 04:27:24 perseant Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -149,7 +149,7 @@ lfs_setup_resblks(struct lfs *fs)
|
||||
int maxbpp;
|
||||
|
||||
fs->lfs_resblk = (res_t *)malloc(LFS_N_TOTAL * sizeof(res_t), M_SEGMENT,
|
||||
M_WAITOK);
|
||||
M_WAITOK);
|
||||
for (i = 0; i < LFS_N_TOTAL; i++) {
|
||||
fs->lfs_resblk[i].inuse = 0;
|
||||
fs->lfs_resblk[i].p = NULL;
|
||||
@ -178,9 +178,9 @@ lfs_setup_resblks(struct lfs *fs)
|
||||
*/
|
||||
maxbpp = ((fs->lfs_sumsize - SEGSUM_SIZE(fs)) / sizeof(int32_t) + 2);
|
||||
maxbpp = MIN(maxbpp, fs->lfs_ssize / fs->lfs_fsize + 2);
|
||||
pool_init(&fs->lfs_bpppool, maxbpp * sizeof(struct buf *), 0, 0,
|
||||
pool_init(&fs->lfs_bpppool, maxbpp * sizeof(struct buf *), 0, 0,
|
||||
LFS_N_BPP, "lfsbpppl", &pool_allocator_nointr);
|
||||
pool_init(&fs->lfs_clpool, sizeof(struct lfs_cluster), 0, 0,
|
||||
pool_init(&fs->lfs_clpool, sizeof(struct lfs_cluster), 0, 0,
|
||||
LFS_N_CL, "lfsclpl", &pool_allocator_nointr);
|
||||
pool_init(&fs->lfs_segpool, sizeof(struct segment), 0, 0,
|
||||
LFS_N_SEG, "lfssegpool", &pool_allocator_nointr);
|
||||
@ -358,7 +358,7 @@ lfs_unmark_dirop(struct lfs *fs)
|
||||
vp = ITOV(ip);
|
||||
|
||||
if (VOP_ISLOCKED(vp) &&
|
||||
vp->v_lock.lk_lockholder != curproc->p_pid) {
|
||||
vp->v_lock.lk_lockholder != curproc->p_pid) {
|
||||
continue;
|
||||
}
|
||||
if ((VTOI(vp)->i_flag & IN_ADIROP) == 0) {
|
||||
@ -493,7 +493,7 @@ lfs_segunlock(struct lfs *fs)
|
||||
if (ckp) {
|
||||
fs->lfs_nactive = 0;
|
||||
/* If we *know* everything's on disk, write both sbs */
|
||||
/* XXX should wait for this one */
|
||||
/* XXX should wait for this one */
|
||||
if (sync)
|
||||
lfs_writesuper(fs, fs->lfs_sboffs[fs->lfs_activesb]);
|
||||
lfs_writesuper(fs, fs->lfs_sboffs[1 - fs->lfs_activesb]);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: lfs_syscalls.c,v 1.81 2003/02/18 02:00:08 perseant Exp $ */
|
||||
/* $NetBSD: lfs_syscalls.c,v 1.82 2003/02/20 04:27:25 perseant Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
|
||||
@ -17,8 +17,8 @@
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
@ -71,7 +71,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: lfs_syscalls.c,v 1.81 2003/02/18 02:00:08 perseant Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: lfs_syscalls.c,v 1.82 2003/02/20 04:27:25 perseant Exp $");
|
||||
|
||||
#define LFS /* for prototypes in syscallargs.h */
|
||||
|
||||
@ -213,19 +213,19 @@ sys_lfs_markv(struct lwp *l, void *v, register_t *retval)
|
||||
blkiov[i].bi_daddr = blkiov15[i].bi_daddr;
|
||||
blkiov[i].bi_segcreate = blkiov15[i].bi_segcreate;
|
||||
blkiov[i].bi_version = blkiov15[i].bi_version;
|
||||
blkiov[i].bi_bp = blkiov15[i].bi_bp;
|
||||
blkiov[i].bi_bp = blkiov15[i].bi_bp;
|
||||
blkiov[i].bi_size = blkiov15[i].bi_size;
|
||||
}
|
||||
|
||||
if ((error = lfs_markv(l->l_proc, &fsid, blkiov, blkcnt)) == 0) {
|
||||
for (i = 0; i < blkcnt; i++) {
|
||||
blkiov15[i].bi_inode = blkiov[i].bi_inode;
|
||||
blkiov15[i].bi_lbn = blkiov[i].bi_lbn;
|
||||
blkiov15[i].bi_daddr = blkiov[i].bi_daddr;
|
||||
blkiov15[i].bi_inode = blkiov[i].bi_inode;
|
||||
blkiov15[i].bi_lbn = blkiov[i].bi_lbn;
|
||||
blkiov15[i].bi_daddr = blkiov[i].bi_daddr;
|
||||
blkiov15[i].bi_segcreate = blkiov[i].bi_segcreate;
|
||||
blkiov15[i].bi_version = blkiov[i].bi_version;
|
||||
blkiov15[i].bi_bp = blkiov[i].bi_bp;
|
||||
blkiov15[i].bi_size = blkiov[i].bi_size;
|
||||
blkiov15[i].bi_version = blkiov[i].bi_version;
|
||||
blkiov15[i].bi_bp = blkiov[i].bi_bp;
|
||||
blkiov15[i].bi_size = blkiov[i].bi_size;
|
||||
}
|
||||
copyout(blkiov15, SCARG(uap, blkiov),
|
||||
blkcnt * sizeof(BLOCK_INFO_15));
|
||||
@ -384,7 +384,7 @@ lfs_markv(struct proc *p, fsid_t *fsidp, BLOCK_INFO *blkiov, int blkcnt)
|
||||
* Inode was locked. This is
|
||||
* recoverable: just clean the rest of
|
||||
* this segment, and let the cleaner try
|
||||
* again with another. (When the
|
||||
* again with another. (When the
|
||||
* cleaner runs again, this segment will
|
||||
* sort high on the list, since it is
|
||||
* now almost entirely empty.) But, we
|
||||
@ -476,7 +476,7 @@ lfs_markv(struct proc *p, fsid_t *fsidp, BLOCK_INFO *blkiov, int blkcnt)
|
||||
* If we get to here, then we are keeping the block. If
|
||||
* it is an indirect block, we want to actually put it
|
||||
* in the buffer cache so that it can be updated in the
|
||||
* finish_meta section. If it's not, we need to
|
||||
* finish_meta section. If it's not, we need to
|
||||
* allocate a fake buffer so that writeseg can perform
|
||||
* the copyin and write the buffer.
|
||||
*/
|
||||
@ -497,7 +497,7 @@ lfs_markv(struct proc *p, fsid_t *fsidp, BLOCK_INFO *blkiov, int blkcnt)
|
||||
/*
|
||||
* The block in question was not found
|
||||
* in the cache; i.e., the block that
|
||||
* getblk() returned is empty. So, we
|
||||
* getblk() returned is empty. So, we
|
||||
* can (and should) copy in the
|
||||
* contents, because we've already
|
||||
* determined that this was the right
|
||||
@ -685,19 +685,19 @@ sys_lfs_bmapv(struct lwp *l, void *v, register_t *retval)
|
||||
blkiov[i].bi_daddr = blkiov15[i].bi_daddr;
|
||||
blkiov[i].bi_segcreate = blkiov15[i].bi_segcreate;
|
||||
blkiov[i].bi_version = blkiov15[i].bi_version;
|
||||
blkiov[i].bi_bp = blkiov15[i].bi_bp;
|
||||
blkiov[i].bi_bp = blkiov15[i].bi_bp;
|
||||
blkiov[i].bi_size = blkiov15[i].bi_size;
|
||||
}
|
||||
|
||||
if ((error = lfs_bmapv(p, &fsid, blkiov, blkcnt)) == 0) {
|
||||
for (i = 0; i < blkcnt; i++) {
|
||||
blkiov15[i].bi_inode = blkiov[i].bi_inode;
|
||||
blkiov15[i].bi_lbn = blkiov[i].bi_lbn;
|
||||
blkiov15[i].bi_daddr = blkiov[i].bi_daddr;
|
||||
blkiov15[i].bi_inode = blkiov[i].bi_inode;
|
||||
blkiov15[i].bi_lbn = blkiov[i].bi_lbn;
|
||||
blkiov15[i].bi_daddr = blkiov[i].bi_daddr;
|
||||
blkiov15[i].bi_segcreate = blkiov[i].bi_segcreate;
|
||||
blkiov15[i].bi_version = blkiov[i].bi_version;
|
||||
blkiov15[i].bi_bp = blkiov[i].bi_bp;
|
||||
blkiov15[i].bi_size = blkiov[i].bi_size;
|
||||
blkiov15[i].bi_version = blkiov[i].bi_version;
|
||||
blkiov15[i].bi_bp = blkiov[i].bi_bp;
|
||||
blkiov15[i].bi_size = blkiov[i].bi_size;
|
||||
}
|
||||
copyout(blkiov15, SCARG(uap, blkiov),
|
||||
blkcnt * sizeof(BLOCK_INFO_15));
|
||||
@ -805,7 +805,7 @@ lfs_bmapv(struct proc *p, fsid_t *fsidp, BLOCK_INFO *blkiov, int blkcnt)
|
||||
} else if (v_daddr == LFS_UNUSED_DADDR) {
|
||||
/*
|
||||
* This can only happen if the vnode is dead.
|
||||
* Keep going. Note that we DO NOT set the
|
||||
* Keep going. Note that we DO NOT set the
|
||||
* bi_addr to anything -- if we failed to get
|
||||
* the vnode, for example, we want to assume
|
||||
* conservatively that all of its blocks *are*
|
||||
@ -1082,7 +1082,7 @@ lfs_fastvget(struct mount *mp, ino_t ino, daddr_t daddr, struct vnode **vpp, str
|
||||
|
||||
/*
|
||||
* Wait until the filesystem is fully mounted before allowing vget
|
||||
* to complete. This prevents possible problems with roll-forward.
|
||||
* to complete. This prevents possible problems with roll-forward.
|
||||
*/
|
||||
while (fs->lfs_flags & LFS_NOTYET) {
|
||||
tsleep(&fs->lfs_flags, PRIBIO+1, "lfs_fnotyet", 0);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: lfs_vfsops.c,v 1.95 2003/02/19 12:49:10 yamt Exp $ */
|
||||
/* $NetBSD: lfs_vfsops.c,v 1.96 2003/02/20 04:27:25 perseant Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
|
||||
@ -17,8 +17,8 @@
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
@ -71,7 +71,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.95 2003/02/19 12:49:10 yamt Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.96 2003/02/20 04:27:25 perseant Exp $");
|
||||
|
||||
#if defined(_KERNEL_OPT)
|
||||
#include "opt_quota.h"
|
||||
@ -125,7 +125,7 @@ static int lfs_mountfs(struct vnode *, struct mount *, struct proc *);
|
||||
extern const struct vnodeopv_desc lfs_vnodeop_opv_desc;
|
||||
extern const struct vnodeopv_desc lfs_specop_opv_desc;
|
||||
extern const struct vnodeopv_desc lfs_fifoop_opv_desc;
|
||||
extern int lfs_subsys_pages;
|
||||
extern int lfs_subsys_pages;
|
||||
extern int locked_queue_count;
|
||||
extern long locked_queue_bytes;
|
||||
extern struct simplelock lfs_subsys_lock;
|
||||
@ -301,7 +301,7 @@ lfs_mountroot()
|
||||
return (ENODEV);
|
||||
|
||||
if (rootdev == NODEV)
|
||||
return (ENODEV);
|
||||
return (ENODEV);
|
||||
/*
|
||||
* Get vnodes for swapdev and rootdev.
|
||||
*/
|
||||
@ -654,7 +654,7 @@ update_inoblk(struct lfs *fs, daddr_t offset, struct ucred *cred,
|
||||
ibp);
|
||||
sup->su_nbytes += DINODE_SIZE;
|
||||
LFS_WRITESEGENTRY(sup, fs,
|
||||
dtosn(fs, dbtofsb(fs, dbp->b_blkno)),
|
||||
dtosn(fs, dbtofsb(fs, dbp->b_blkno)),
|
||||
ibp);
|
||||
}
|
||||
}
|
||||
@ -690,10 +690,10 @@ check_segsum(struct lfs *fs, daddr_t offset,
|
||||
* of the segment, skip the superblock.
|
||||
*/
|
||||
if (sntod(fs, dtosn(fs, offset)) == offset) {
|
||||
LFS_SEGENTRY(sup, fs, dtosn(fs, offset), bp);
|
||||
if (sup->su_flags & SEGUSE_SUPERBLOCK)
|
||||
LFS_SEGENTRY(sup, fs, dtosn(fs, offset), bp);
|
||||
if (sup->su_flags & SEGUSE_SUPERBLOCK)
|
||||
offset += btofsb(fs, LFS_SBPAD);
|
||||
brelse(bp);
|
||||
brelse(bp);
|
||||
}
|
||||
|
||||
/* Read in the segment summary */
|
||||
@ -902,7 +902,7 @@ lfs_mountfs(struct vnode *devvp, struct mount *mp, struct proc *p)
|
||||
int error, i, ronly, secsize, fsbsize;
|
||||
struct ucred *cred;
|
||||
CLEANERINFO *cip;
|
||||
SEGUSE *sup;
|
||||
SEGUSE *sup;
|
||||
int flags, dirty, do_rollforward;
|
||||
daddr_t offset, oldoffset, lastgoodpseg, sb_addr;
|
||||
int sn, curseg;
|
||||
@ -968,7 +968,7 @@ lfs_mountfs(struct vnode *devvp, struct mount *mp, struct proc *p)
|
||||
* the case, get the real one, and try again.
|
||||
*/
|
||||
if (sb_addr != dfs->dlfs_sboffs[0] <<
|
||||
dfs->dlfs_fsbtodb) {
|
||||
dfs->dlfs_fsbtodb) {
|
||||
/* #ifdef DEBUG_LFS */
|
||||
printf("lfs_mountfs: sb daddr 0x%llx is not right, trying 0x%llx\n",
|
||||
(long long)sb_addr, (long long)(dfs->dlfs_sboffs[0] <<
|
||||
@ -985,7 +985,7 @@ lfs_mountfs(struct vnode *devvp, struct mount *mp, struct proc *p)
|
||||
|
||||
/*
|
||||
* Check the second superblock to see which is newer; then mount
|
||||
* using the older of the two. This is necessary to ensure that
|
||||
* using the older of the two. This is necessary to ensure that
|
||||
* the filesystem is valid if it was not unmounted cleanly.
|
||||
*/
|
||||
|
||||
@ -1015,8 +1015,8 @@ lfs_mountfs(struct vnode *devvp, struct mount *mp, struct proc *p)
|
||||
/* Check the basics. */
|
||||
if (tdfs->dlfs_magic != LFS_MAGIC ||
|
||||
tdfs->dlfs_bsize > MAXBSIZE ||
|
||||
tdfs->dlfs_version > LFS_VERSION ||
|
||||
tdfs->dlfs_bsize < sizeof(struct dlfs)) {
|
||||
tdfs->dlfs_version > LFS_VERSION ||
|
||||
tdfs->dlfs_bsize < sizeof(struct dlfs)) {
|
||||
#ifdef DEBUG_LFS
|
||||
printf("lfs_mountfs: alt superblock sanity failed\n");
|
||||
#endif
|
||||
@ -1291,9 +1291,9 @@ lfs_mountfs(struct vnode *devvp, struct mount *mp, struct proc *p)
|
||||
* Mark the current segment as ACTIVE, since we're going to
|
||||
* be writing to it.
|
||||
*/
|
||||
LFS_SEGENTRY(sup, fs, dtosn(fs, fs->lfs_offset), bp);
|
||||
sup->su_flags |= SEGUSE_DIRTY | SEGUSE_ACTIVE;
|
||||
LFS_WRITESEGENTRY(sup, fs, dtosn(fs, fs->lfs_offset), bp); /* Ifile */
|
||||
LFS_SEGENTRY(sup, fs, dtosn(fs, fs->lfs_offset), bp);
|
||||
sup->su_flags |= SEGUSE_DIRTY | SEGUSE_ACTIVE;
|
||||
LFS_WRITESEGENTRY(sup, fs, dtosn(fs, fs->lfs_offset), bp); /* Ifile */
|
||||
|
||||
/* Now that roll-forward is done, unlock the Ifile */
|
||||
vput(vp);
|
||||
@ -1326,9 +1326,9 @@ out:
|
||||
}
|
||||
|
||||
/* Start the pagedaemon-anticipating daemon */
|
||||
if (lfs_writer_daemon == 0 &&
|
||||
if (lfs_writer_daemon == 0 &&
|
||||
kthread_create1(lfs_writerd, NULL, NULL, "lfs_writer") != 0)
|
||||
panic("fork lfs_writer");
|
||||
panic("fork lfs_writer");
|
||||
|
||||
return (error);
|
||||
}
|
||||
@ -1645,10 +1645,10 @@ lfs_vget(struct mount *mp, ino_t ino, struct vnode **vpp)
|
||||
}
|
||||
brelse(bp);
|
||||
|
||||
memset(ip->i_lfs_fragsize, 0, NDADDR * sizeof(*ip->i_lfs_fragsize));
|
||||
for (i = 0; i < NDADDR; i++)
|
||||
if (ip->i_ffs_db[i] != 0)
|
||||
ip->i_lfs_fragsize[i] = blksize(fs, ip, i);
|
||||
memset(ip->i_lfs_fragsize, 0, NDADDR * sizeof(*ip->i_lfs_fragsize));
|
||||
for (i = 0; i < NDADDR; i++)
|
||||
if (ip->i_ffs_db[i] != 0)
|
||||
ip->i_lfs_fragsize[i] = blksize(fs, ip, i);
|
||||
|
||||
/*
|
||||
* Initialize the vnode from the inode, check for aliases. In all
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: lfs_vnops.c,v 1.85 2003/02/19 12:22:51 yamt Exp $ */
|
||||
/* $NetBSD: lfs_vnops.c,v 1.86 2003/02/20 04:27:25 perseant Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
|
||||
@ -17,8 +17,8 @@
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
@ -71,7 +71,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: lfs_vnops.c,v 1.85 2003/02/19 12:22:51 yamt Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: lfs_vnops.c,v 1.86 2003/02/20 04:27:25 perseant Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -276,7 +276,7 @@ const struct vnodeopv_entry_desc lfs_fifoop_entries[] = {
|
||||
{ &vop_truncate_desc, fifo_truncate }, /* truncate */
|
||||
{ &vop_update_desc, lfs_update }, /* update */
|
||||
{ &vop_bwrite_desc, lfs_bwrite }, /* bwrite */
|
||||
{ &vop_putpages_desc, fifo_putpages }, /* putpages */
|
||||
{ &vop_putpages_desc, fifo_putpages }, /* putpages */
|
||||
{ NULL, NULL }
|
||||
};
|
||||
const struct vnodeopv_desc lfs_fifoop_opv_desc =
|
||||
@ -313,10 +313,10 @@ lfs_fsync(void *v)
|
||||
struct vnode *vp = ap->a_vp;
|
||||
int error, wait;
|
||||
|
||||
/*
|
||||
/*
|
||||
* Trickle sync checks for need to do a checkpoint after possible
|
||||
* activity from the pagedaemon.
|
||||
*/
|
||||
*/
|
||||
if (ap->a_flags & FSYNC_LAZY) {
|
||||
wakeup(&lfs_writer_daemon);
|
||||
return 0;
|
||||
@ -325,13 +325,13 @@ lfs_fsync(void *v)
|
||||
wait = (ap->a_flags & FSYNC_WAIT);
|
||||
do {
|
||||
#ifdef DEBUG
|
||||
struct buf *bp;
|
||||
struct buf *bp;
|
||||
#endif
|
||||
|
||||
simple_lock(&vp->v_interlock);
|
||||
error = VOP_PUTPAGES(vp, trunc_page(ap->a_offlo),
|
||||
round_page(ap->a_offhi),
|
||||
PGO_CLEANIT | (wait ? PGO_SYNCIO : 0));
|
||||
round_page(ap->a_offhi),
|
||||
PGO_CLEANIT | (wait ? PGO_SYNCIO : 0));
|
||||
if (error)
|
||||
return error;
|
||||
error = VOP_UPDATE(vp, NULL, NULL, wait ? UPDATE_WAIT : 0);
|
||||
@ -463,16 +463,16 @@ unreserve:
|
||||
vrele(vp2); \
|
||||
}
|
||||
|
||||
#define MARK_VNODE(dvp) do { \
|
||||
#define MARK_VNODE(dvp) do { \
|
||||
struct inode *_ip = VTOI(dvp); \
|
||||
struct lfs *_fs = _ip->i_lfs; \
|
||||
\
|
||||
if (!((dvp)->v_flag & VDIROP)) { \
|
||||
(void)lfs_vref(dvp); \
|
||||
if (!((dvp)->v_flag & VDIROP)) { \
|
||||
(void)lfs_vref(dvp); \
|
||||
++lfs_dirvcount; \
|
||||
TAILQ_INSERT_TAIL(&_fs->lfs_dchainhd, _ip, i_lfs_dchain); \
|
||||
} \
|
||||
(dvp)->v_flag |= VDIROP; \
|
||||
(dvp)->v_flag |= VDIROP; \
|
||||
if (!(_ip->i_flag & IN_ADIROP)) { \
|
||||
++_fs->lfs_nadirop; \
|
||||
} \
|
||||
@ -526,10 +526,10 @@ lfs_mknod(void *v)
|
||||
struct componentname *a_cnp;
|
||||
struct vattr *a_vap;
|
||||
} */ *ap = v;
|
||||
struct vattr *vap = ap->a_vap;
|
||||
struct vnode **vpp = ap->a_vpp;
|
||||
struct inode *ip;
|
||||
int error;
|
||||
struct vattr *vap = ap->a_vap;
|
||||
struct vnode **vpp = ap->a_vpp;
|
||||
struct inode *ip;
|
||||
int error;
|
||||
struct mount *mp;
|
||||
ino_t ino;
|
||||
|
||||
@ -539,33 +539,33 @@ lfs_mknod(void *v)
|
||||
}
|
||||
MARK_VNODE(ap->a_dvp);
|
||||
error = ufs_makeinode(MAKEIMODE(vap->va_type, vap->va_mode),
|
||||
ap->a_dvp, vpp, ap->a_cnp);
|
||||
ap->a_dvp, vpp, ap->a_cnp);
|
||||
UNMARK_VNODE(ap->a_dvp);
|
||||
if (*(ap->a_vpp))
|
||||
UNMARK_VNODE(*(ap->a_vpp));
|
||||
if (*(ap->a_vpp))
|
||||
UNMARK_VNODE(*(ap->a_vpp));
|
||||
|
||||
/* Either way we're done with the dirop at this point */
|
||||
SET_ENDOP(VTOI(ap->a_dvp)->i_lfs,ap->a_dvp,"mknod");
|
||||
|
||||
if (error)
|
||||
if (error)
|
||||
return (error);
|
||||
|
||||
ip = VTOI(*vpp);
|
||||
ip = VTOI(*vpp);
|
||||
mp = (*vpp)->v_mount;
|
||||
ino = ip->i_number;
|
||||
ip->i_flag |= IN_ACCESS | IN_CHANGE | IN_UPDATE;
|
||||
if (vap->va_rdev != VNOVAL) {
|
||||
/*
|
||||
* Want to be able to use this to make badblock
|
||||
* inodes, so don't truncate the dev number.
|
||||
*/
|
||||
ip->i_flag |= IN_ACCESS | IN_CHANGE | IN_UPDATE;
|
||||
if (vap->va_rdev != VNOVAL) {
|
||||
/*
|
||||
* Want to be able to use this to make badblock
|
||||
* inodes, so don't truncate the dev number.
|
||||
*/
|
||||
#if 0
|
||||
ip->i_ffs_rdev = ufs_rw32(vap->va_rdev,
|
||||
UFS_MPNEEDSWAP((*vpp)->v_mount));
|
||||
ip->i_ffs_rdev = ufs_rw32(vap->va_rdev,
|
||||
UFS_MPNEEDSWAP((*vpp)->v_mount));
|
||||
#else
|
||||
ip->i_ffs_rdev = vap->va_rdev;
|
||||
ip->i_ffs_rdev = vap->va_rdev;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Call fsync to write the vnode so that we don't have to deal with
|
||||
* flushing it when it's marked VDIROP|VXLOCK.
|
||||
@ -580,22 +580,22 @@ lfs_mknod(void *v)
|
||||
VTOI(*vpp)->i_number);
|
||||
return (error);
|
||||
}
|
||||
/*
|
||||
* Remove vnode so that it will be reloaded by VFS_VGET and
|
||||
* checked to see if it is an alias of an existing entry in
|
||||
* the inode cache.
|
||||
*/
|
||||
/*
|
||||
* Remove vnode so that it will be reloaded by VFS_VGET and
|
||||
* checked to see if it is an alias of an existing entry in
|
||||
* the inode cache.
|
||||
*/
|
||||
/* Used to be vput, but that causes us to call VOP_INACTIVE twice. */
|
||||
VOP_UNLOCK(*vpp, 0);
|
||||
lfs_vunref(*vpp);
|
||||
(*vpp)->v_type = VNON;
|
||||
vgone(*vpp);
|
||||
(*vpp)->v_type = VNON;
|
||||
vgone(*vpp);
|
||||
error = VFS_VGET(mp, ino, vpp);
|
||||
if (error != 0) {
|
||||
*vpp = NULL;
|
||||
return (error);
|
||||
}
|
||||
return (0);
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
@ -616,8 +616,8 @@ lfs_create(void *v)
|
||||
MARK_VNODE(ap->a_dvp);
|
||||
error = ufs_create(ap);
|
||||
UNMARK_VNODE(ap->a_dvp);
|
||||
if (*(ap->a_vpp))
|
||||
UNMARK_VNODE(*(ap->a_vpp));
|
||||
if (*(ap->a_vpp))
|
||||
UNMARK_VNODE(*(ap->a_vpp));
|
||||
SET_ENDOP(VTOI(ap->a_dvp)->i_lfs,ap->a_dvp,"create");
|
||||
return (error);
|
||||
}
|
||||
@ -640,8 +640,8 @@ lfs_mkdir(void *v)
|
||||
MARK_VNODE(ap->a_dvp);
|
||||
error = ufs_mkdir(ap);
|
||||
UNMARK_VNODE(ap->a_dvp);
|
||||
if (*(ap->a_vpp))
|
||||
UNMARK_VNODE(*(ap->a_vpp));
|
||||
if (*(ap->a_vpp))
|
||||
UNMARK_VNODE(*(ap->a_vpp));
|
||||
SET_ENDOP(VTOI(ap->a_dvp)->i_lfs,ap->a_dvp,"mkdir");
|
||||
return (error);
|
||||
}
|
||||
@ -780,28 +780,28 @@ lfs_rename(void *v)
|
||||
error = EPERM;
|
||||
goto errout;
|
||||
}
|
||||
if (fvp == tvp) {
|
||||
if (fvp->v_type == VDIR) {
|
||||
error = EINVAL;
|
||||
goto errout;
|
||||
}
|
||||
if (fvp == tvp) {
|
||||
if (fvp->v_type == VDIR) {
|
||||
error = EINVAL;
|
||||
goto errout;
|
||||
}
|
||||
|
||||
/* Release destination completely. */
|
||||
VOP_ABORTOP(tdvp, tcnp);
|
||||
vput(tdvp);
|
||||
vput(tvp);
|
||||
/* Release destination completely. */
|
||||
VOP_ABORTOP(tdvp, tcnp);
|
||||
vput(tdvp);
|
||||
vput(tvp);
|
||||
|
||||
/* Delete source. */
|
||||
vrele(fvp);
|
||||
fcnp->cn_flags &= ~(MODMASK | SAVESTART);
|
||||
fcnp->cn_flags |= LOCKPARENT | LOCKLEAF;
|
||||
fcnp->cn_nameiop = DELETE;
|
||||
if ((error = relookup(fdvp, &fvp, fcnp))){
|
||||
/* relookup blew away fdvp */
|
||||
return (error);
|
||||
}
|
||||
return (VOP_REMOVE(fdvp, fvp, fcnp));
|
||||
}
|
||||
/* Delete source. */
|
||||
vrele(fvp);
|
||||
fcnp->cn_flags &= ~(MODMASK | SAVESTART);
|
||||
fcnp->cn_flags |= LOCKPARENT | LOCKLEAF;
|
||||
fcnp->cn_nameiop = DELETE;
|
||||
if ((error = relookup(fdvp, &fvp, fcnp))){
|
||||
/* relookup blew away fdvp */
|
||||
return (error);
|
||||
}
|
||||
return (VOP_REMOVE(fdvp, fvp, fcnp));
|
||||
}
|
||||
|
||||
if ((error = SET_DIROP2(tdvp, tvp)) != 0)
|
||||
goto errout;
|
||||
@ -1054,7 +1054,7 @@ check_dirty(struct lfs *fs, struct vnode *vp,
|
||||
off_t startoffset, off_t endoffset, off_t blkeof,
|
||||
int flags)
|
||||
{
|
||||
int by_list;
|
||||
int by_list;
|
||||
struct vm_page *curpg, *pgs[MAXBSIZE / PAGE_SIZE], *pg;
|
||||
struct lwp *l = curlwp ? curlwp : &lwp0;
|
||||
off_t soff;
|
||||
@ -1290,16 +1290,16 @@ lfs_putpages(void *v)
|
||||
* (For the purposes of VOP_PUTPAGES, fragments don't exist.)
|
||||
*/
|
||||
pages_per_block = fs->lfs_bsize >> PAGE_SHIFT;
|
||||
origoffset = ap->a_offlo;
|
||||
origoffset = ap->a_offlo;
|
||||
origendoffset = ap->a_offhi;
|
||||
startoffset = origoffset & ~(fs->lfs_bmask);
|
||||
startoffset = origoffset & ~(fs->lfs_bmask);
|
||||
max_endoffset = (trunc_page(LLONG_MAX) >> fs->lfs_bshift)
|
||||
<< fs->lfs_bshift;
|
||||
|
||||
if (origendoffset == 0 || ap->a_flags & PGO_ALLPAGES) {
|
||||
endoffset = max_endoffset;
|
||||
endoffset = max_endoffset;
|
||||
origendoffset = endoffset;
|
||||
} else {
|
||||
} else {
|
||||
origendoffset = round_page(ap->a_offhi);
|
||||
endoffset = round_page(blkroundup(fs, origendoffset));
|
||||
}
|
||||
@ -1382,7 +1382,7 @@ lfs_putpages(void *v)
|
||||
|
||||
|
||||
/*
|
||||
* This is it. We are going to write some pages. From here on
|
||||
* This is it. We are going to write some pages. From here on
|
||||
* down it's all just mechanics.
|
||||
*
|
||||
* If there are more than one page per block, we don't want to get
|
||||
@ -1420,17 +1420,17 @@ lfs_putpages(void *v)
|
||||
dtosn(fs, fs->lfs_offset));
|
||||
#endif
|
||||
/* Write gathered pages */
|
||||
lfs_updatemeta(sp);
|
||||
(void) lfs_writeseg(fs, sp);
|
||||
lfs_updatemeta(sp);
|
||||
(void) lfs_writeseg(fs, sp);
|
||||
|
||||
/* Reinitialize brand new FIP and add us to it */
|
||||
sp->vp = vp;
|
||||
sp->fip->fi_version = ip->i_ffs_gen;
|
||||
sp->fip->fi_ino = ip->i_number;
|
||||
/* Add us to the new segment summary. */
|
||||
++((SEGSUM *)(sp->segsum))->ss_nfinfo;
|
||||
sp->sum_bytes_left -=
|
||||
sizeof(struct finfo) - sizeof(int32_t);
|
||||
sp->fip->fi_version = ip->i_ffs_gen;
|
||||
sp->fip->fi_ino = ip->i_number;
|
||||
/* Add us to the new segment summary. */
|
||||
++((SEGSUM *)(sp->segsum))->ss_nfinfo;
|
||||
sp->sum_bytes_left -=
|
||||
sizeof(struct finfo) - sizeof(int32_t);
|
||||
|
||||
/* Give the write a chance to complete */
|
||||
simple_unlock(&vp->v_interlock);
|
||||
@ -1458,19 +1458,19 @@ lfs_putpages(void *v)
|
||||
* (This should duplicate the setup at the top of lfs_writefile().)
|
||||
*/
|
||||
sp = fs->lfs_sp;
|
||||
if (sp->seg_bytes_left < fs->lfs_bsize ||
|
||||
sp->sum_bytes_left < sizeof(struct finfo))
|
||||
(void) lfs_writeseg(fs, fs->lfs_sp);
|
||||
if (sp->seg_bytes_left < fs->lfs_bsize ||
|
||||
sp->sum_bytes_left < sizeof(struct finfo))
|
||||
(void) lfs_writeseg(fs, fs->lfs_sp);
|
||||
|
||||
sp->sum_bytes_left -= sizeof(struct finfo) - sizeof(int32_t);
|
||||
++((SEGSUM *)(sp->segsum))->ss_nfinfo;
|
||||
sp->sum_bytes_left -= sizeof(struct finfo) - sizeof(int32_t);
|
||||
++((SEGSUM *)(sp->segsum))->ss_nfinfo;
|
||||
sp->vp = vp;
|
||||
|
||||
if (vp->v_flag & VDIROP)
|
||||
((SEGSUM *)(sp->segsum))->ss_flags |= (SS_DIROP|SS_CONT);
|
||||
if (vp->v_flag & VDIROP)
|
||||
((SEGSUM *)(sp->segsum))->ss_flags |= (SS_DIROP|SS_CONT);
|
||||
|
||||
sp->fip->fi_nblocks = 0;
|
||||
sp->fip->fi_ino = ip->i_number;
|
||||
sp->fip->fi_nblocks = 0;
|
||||
sp->fip->fi_ino = ip->i_number;
|
||||
sp->fip->fi_version = ip->i_ffs_gen;
|
||||
|
||||
/*
|
||||
@ -1494,20 +1494,20 @@ lfs_putpages(void *v)
|
||||
dtosn(fs, fs->lfs_offset));
|
||||
#endif
|
||||
/* Write gathered pages */
|
||||
lfs_updatemeta(sp);
|
||||
(void) lfs_writeseg(fs, sp);
|
||||
lfs_updatemeta(sp);
|
||||
(void) lfs_writeseg(fs, sp);
|
||||
|
||||
/*
|
||||
* Reinitialize brand new FIP and add us to it.
|
||||
* (This should duplicate the fixup in lfs_gatherpages().)
|
||||
*/
|
||||
sp->vp = vp;
|
||||
sp->fip->fi_version = ip->i_ffs_gen;
|
||||
sp->fip->fi_ino = ip->i_number;
|
||||
/* Add us to the new segment summary. */
|
||||
++((SEGSUM *)(sp->segsum))->ss_nfinfo;
|
||||
sp->sum_bytes_left -=
|
||||
sizeof(struct finfo) - sizeof(int32_t);
|
||||
sp->fip->fi_version = ip->i_ffs_gen;
|
||||
sp->fip->fi_ino = ip->i_number;
|
||||
/* Add us to the new segment summary. */
|
||||
++((SEGSUM *)(sp->segsum))->ss_nfinfo;
|
||||
sp->sum_bytes_left -=
|
||||
sizeof(struct finfo) - sizeof(int32_t);
|
||||
|
||||
/* Give the write a chance to complete */
|
||||
simple_unlock(&vp->v_interlock);
|
||||
@ -1527,14 +1527,14 @@ lfs_putpages(void *v)
|
||||
* Clean up FIP.
|
||||
* (This should duplicate cleanup at the end of lfs_writefile().)
|
||||
*/
|
||||
if (sp->fip->fi_nblocks != 0) {
|
||||
sp->fip = (FINFO*)((caddr_t)sp->fip + sizeof(struct finfo) +
|
||||
if (sp->fip->fi_nblocks != 0) {
|
||||
sp->fip = (FINFO*)((caddr_t)sp->fip + sizeof(struct finfo) +
|
||||
sizeof(int32_t) * (sp->fip->fi_nblocks - 1));
|
||||
sp->start_lbp = &sp->fip->fi_blocks[0];
|
||||
} else {
|
||||
sp->sum_bytes_left += sizeof(FINFO) - sizeof(int32_t);
|
||||
--((SEGSUM *)(sp->segsum))->ss_nfinfo;
|
||||
}
|
||||
sp->start_lbp = &sp->fip->fi_blocks[0];
|
||||
} else {
|
||||
sp->sum_bytes_left += sizeof(FINFO) - sizeof(int32_t);
|
||||
--((SEGSUM *)(sp->segsum))->ss_nfinfo;
|
||||
}
|
||||
/*
|
||||
* XXX - with the malloc/copy writeseg, the pages are freed by now
|
||||
* even if we don't wait (e.g. if we hold a nested lock). This
|
||||
@ -1625,7 +1625,7 @@ lfs_checkifempty(struct vnode *vp)
|
||||
|
||||
/*
|
||||
* Return the last logical file offset that should be written for this file
|
||||
* if we're doing a write that ends at "size". If writing, we need to know
|
||||
* if we're doing a write that ends at "size". If writing, we need to know
|
||||
* about sizes on disk, i.e. fragments if there are any; if reading, we need
|
||||
* to know about entire blocks.
|
||||
*/
|
||||
@ -1642,11 +1642,11 @@ lfs_gop_size(struct vnode *vp, off_t size, off_t *eobp, int flags)
|
||||
|
||||
olbn = lblkno(fs, ip->i_ffs_size);
|
||||
nlbn = lblkno(fs, size);
|
||||
if ((flags & GOP_SIZE_WRITE) && nlbn < NDADDR && olbn <= nlbn) {
|
||||
*eobp = fragroundup(fs, size);
|
||||
} else {
|
||||
*eobp = blkroundup(fs, size);
|
||||
}
|
||||
if ((flags & GOP_SIZE_WRITE) && nlbn < NDADDR && olbn <= nlbn) {
|
||||
*eobp = fragroundup(fs, size);
|
||||
} else {
|
||||
*eobp = blkroundup(fs, size);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
@ -1655,12 +1655,12 @@ void lfs_dump_vop(void *);
|
||||
void
|
||||
lfs_dump_vop(void *v)
|
||||
{
|
||||
struct vop_putpages_args /* {
|
||||
struct vnode *a_vp;
|
||||
voff_t a_offlo;
|
||||
voff_t a_offhi;
|
||||
int a_flags;
|
||||
} */ *ap = v;
|
||||
struct vop_putpages_args /* {
|
||||
struct vnode *a_vp;
|
||||
voff_t a_offlo;
|
||||
voff_t a_offhi;
|
||||
int a_flags;
|
||||
} */ *ap = v;
|
||||
|
||||
vfs_vnode_print(ap->a_vp, 0, printf);
|
||||
lfs_dump_dinode(&VTOI(ap->a_vp)->i_din.ffs_din);
|
||||
@ -1671,11 +1671,11 @@ int
|
||||
lfs_mmap(void *v)
|
||||
{
|
||||
struct vop_mmap_args /* {
|
||||
const struct vnodeop_desc *a_desc;
|
||||
struct vnode *a_vp;
|
||||
int a_fflags;
|
||||
struct ucred *a_cred;
|
||||
struct proc *a_p;
|
||||
const struct vnodeop_desc *a_desc;
|
||||
struct vnode *a_vp;
|
||||
int a_fflags;
|
||||
struct ucred *a_cred;
|
||||
struct proc *a_p;
|
||||
} */ *ap = v;
|
||||
|
||||
if (VTOI(ap->a_vp)->i_number == LFS_IFILE_INUM)
|
||||
|
Loading…
Reference in New Issue
Block a user