Lines Matching +full:block +full:- +full:number
1 /*-
7 /*-
8 * SPDX-License-Identifier: BSD-3-Clause
42 * Each disk drive contains some number of file systems.
43 * A file system consists of a number of cylinder groups.
46 * A file system is described by its super-block, which in turn
47 * describes the cylinder groups. The super-block is critical
50 * super-block data does not change, so the copies need not be
54 * The byte-offset forms are preferred, as they don't imply a sector size.
64 * the super block for this name.
82 * which tell the system the average file size and the average number
86 * AVFPDIR is the expected number of files per directory. AVGDIRSIZE is
99 * Turn file system block numbers into disk block addresses.
102 #define fsbtodb(fs, b) ((daddr_t)(b) << (fs)->e2fs_fsbtodb)
103 #define dbtofsb(fs, b) ((b) >> (fs)->e2fs_fsbtodb)
106 #define ino_to_cg(fs, x) (((x) - 1) / (fs->e2fs_ipg))
108 /* get block containing inode from its number x */
110 (e2fs_gd_get_i_tables(&(fs)->e2fs_gd[ino_to_cg((fs), (x))]) + \
111 (((x) - 1) % (fs)->e2fs_ipg) / (fs)->e2fs_ipb)
113 /* get offset for inode in block */
114 #define ino_to_fsbo(fs, x) ((x-1) % (fs->e2fs_ipb))
117 * Give cylinder group number for a file system block.
118 * Give cylinder group block number for a file system block.
120 #define dtog(fs, d) (((d) - le32toh(fs->e2fs->e2fs_first_dblock)) / \
122 #define dtogd(fs, d) (((d) - le32toh(fs->e2fs->e2fs_first_dblock)) % \
130 #define blkoff(fs, loc) /* calculates (loc % fs->fs_bsize) */ \
131 ((loc) & (fs)->e2fs_qbmask)
133 #define lblktosize(fs, blk) /* calculates (blk * fs->fs_bsize) */ \
134 ((blk) << (fs->e2fs_bshift))
136 #define lblkno(fs, loc) /* calculates (loc / fs->fs_bsize) */ \
137 ((loc) >> (fs->e2fs_bshift))
139 /* no fragments -> logical block number equal # of frags */
140 #define numfrags(fs, loc) /* calculates (loc / fs->fs_fsize) */ \
141 ((loc) >> (fs->e2fs_bshift))
143 #define fragroundup(fs, size) /* calculates roundup(size, fs->fs_fsize) */ \
144 roundup(size, fs->e2fs_fsize)
145 /* was (((size) + (fs)->fs_qfmask) & (fs)->fs_fmask) */
148 * Determining the size of a file block in the file system.
151 #define blksize(fs, ip, lbn) ((fs)->e2fs_fsize)
154 * INOPB is the number of inodes in a secondary storage block.
156 #define INOPB(fs) (fs->e2fs_ipb)
159 * NINDIR is the number of indirects in a file system block.