Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/ufs/lfs Tabify, and fix some comment alignment problems.
details: https://anonhg.NetBSD.org/src/rev/c902991621bc
branches: trunk
changeset: 543232:c902991621bc
user: perseant <perseant%NetBSD.org@localhost>
date: Thu Feb 20 04:27:23 2003 +0000
description:
Tabify, and fix some comment alignment problems.
diffstat:
sys/ufs/lfs/lfs.h | 370 ++++++++++++++++++++++----------------------
sys/ufs/lfs/lfs_alloc.c | 10 +-
sys/ufs/lfs/lfs_balloc.c | 10 +-
sys/ufs/lfs/lfs_bio.c | 22 +-
sys/ufs/lfs/lfs_cksum.c | 8 +-
sys/ufs/lfs/lfs_debug.c | 16 +-
sys/ufs/lfs/lfs_extern.h | 8 +-
sys/ufs/lfs/lfs_inode.c | 68 ++++----
sys/ufs/lfs/lfs_segment.c | 58 +++---
sys/ufs/lfs/lfs_subr.c | 18 +-
sys/ufs/lfs/lfs_syscalls.c | 46 ++--
sys/ufs/lfs/lfs_vfsops.c | 48 ++--
sys/ufs/lfs/lfs_vnops.c | 240 ++++++++++++++--------------
13 files changed, 461 insertions(+), 461 deletions(-)
diffs (truncated from 2099 to 300 lines):
diff -r e9bda311c4b4 -r c902991621bc sys/ufs/lfs/lfs.h
--- a/sys/ufs/lfs/lfs.h Thu Feb 20 02:49:51 2003 +0000
+++ b/sys/ufs/lfs/lfs.h Thu Feb 20 04:27:23 2003 +0000
@@ -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 @@
* #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 @@
#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 @@
} 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 @@
/* 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 @@
#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 @@
_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 @@
*/
#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 @@
#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 @@
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 @@
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 @@
/* 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 */
Home |
Main Index |
Thread Index |
Old Index