Lines Matching refs:fs

236 struct  fs {  struct
406 #define fs_postbl(fs, cylno) \ argument
407 (((fs)->fs_postblformat != FS_DYNAMICPOSTBLFMT) \
408 ? ((fs)->fs_opostbl[cylno]) \
409 : ((short *)((char *)(fs) + \
410 (fs)->fs_postbloff) \
411 + (cylno) * (fs)->fs_nrpos))
414 #define fs_rotbl(fs) \ argument
415 (((fs)->fs_postblformat != FS_DYNAMICPOSTBLFMT) \
416 ? ((fs)->fs_space) \
417 : ((uchar_t *)((char *)(fs) + (fs)->fs_rotbloff)))
426 #define fs_cs(fs, indx) fs_u.fs_csp[(indx)] argument
474 #define cg_blks(fs, cgp, cylno) \ argument
478 (cylno) * (fs)->fs_nrpos))
527 #define fsbtodb(fs, b) (((daddr_t)(b)) << (fs)->fs_fsbtodb) argument
529 #define fsbtodb(fs, b) (((diskaddr_t)(b)) << (fs)->fs_fsbtodb) argument
532 #define dbtofsb(fs, b) ((b) >> (fs)->fs_fsbtodb) argument
542 #define logbtodb(fs, b) ((fs)->fs_magic == FS_MAGIC ? \ argument
543 (daddr_t)(b) : ((daddr_t)(b) << (fs)->fs_fsbtodb))
545 #define logbtodb(fs, b) ((fs)->fs_magic == FS_MAGIC ? \ argument
546 (diskaddr_t)(b) : ((diskaddr_t)(b) << (fs)->fs_fsbtodb))
548 #define logbtofrag(fs, b) ((fs)->fs_magic == FS_MAGIC ? \ argument
549 (b) >> (fs)->fs_fsbtodb : (b))
550 #define logbtofsblk(fs, b) ((fs)->fs_magic == FS_MAGIC ? \ argument
551 (b) >> ((fs)->fs_fsbtodb + (fs)->fs_fragshift) : \
552 (b) >> (fs)->fs_fragshift)
558 #define cgbase(fs, c) ((daddr32_t)((fs)->fs_fpg * (c))) argument
560 #define cgstart(fs, c) \ argument
561 (cgbase(fs, c) + (fs)->fs_cgoffset * ((c) & ~((fs)->fs_cgmask)))
563 #define cgsblock(fs, c) (cgstart(fs, c) + (fs)->fs_sblkno) /* super blk */ argument
565 #define cgtod(fs, c) (cgstart(fs, c) + (fs)->fs_cblkno) /* cg block */ argument
567 #define cgimin(fs, c) (cgstart(fs, c) + (fs)->fs_iblkno) /* inode blk */ argument
569 #define cgdmin(fs, c) (cgstart(fs, c) + (fs)->fs_dblkno) /* 1st data */ argument
577 #define itoo(fs, x) ((x) % (uint32_t)INOPB(fs)) argument
579 #define itog(fs, x) ((x) / (uint32_t)(fs)->fs_ipg) argument
581 #define itod(fs, x) \ argument
582 ((daddr32_t)(cgimin(fs, itog(fs, x)) + \
583 (blkstofrags((fs), (((x)%(ulong_t)(fs)->fs_ipg)/(ulong_t)INOPB(fs))))))
589 #define dtog(fs, d) ((d) / (fs)->fs_fpg) argument
590 #define dtogd(fs, d) ((d) % (fs)->fs_fpg) argument
596 #define blkmap(fs, map, loc) \ argument
598 (0xff >> (NBBY - (fs)->fs_frag)))
600 #define cbtocylno(fs, bno) \ argument
601 ((bno) * NSPF(fs) / (fs)->fs_spc)
609 #define cbtorpos(fs, bno) \ argument
610 ((((bno) * NSPF(fs) % (fs)->fs_spc) % \
611 (fs)->fs_nsect) * \
612 (fs)->fs_nrpos) / (fs)->fs_nsect
627 #define blkoff(fs, loc) /* calculates (loc % fs->fs_bsize) */ \ argument
628 ((int)((loc) & ~(fs)->fs_bmask))
634 #define fragoff(fs, loc) /* calculates (loc % fs->fs_fsize) */ \ argument
635 ((int)((loc) & ~(fs)->fs_fmask))
643 #define lblkno(fs, loc) /* calculates (loc / fs->fs_bsize) */ \ argument
644 ((int32_t)((loc) >> (fs)->fs_bshift))
650 #define numfrags(fs, loc) /* calculates (loc / fs->fs_fsize) */ \ argument
651 ((int32_t)((loc) >> (fs)->fs_fshift))
661 #define blkroundup(fs, size) /* calculates roundup(size, fs->fs_bsize) */ \ argument
662 (((size) + (fs)->fs_bsize - 1) & (offset_t)(fs)->fs_bmask)
668 #define fragroundup(fs, size) /* calculates roundup(size, fs->fs_fsize) */ \ argument
669 (((size) + (fs)->fs_fsize - 1) & (offset_t)(fs)->fs_fmask)
675 #define fragstoblks(fs, frags) /* calculates (frags / fs->fs_frag) */ \ argument
676 ((frags) >> (fs)->fs_fragshift)
678 #define blkstofrags(fs, blks) /* calculates (blks * fs->fs_frag) */ \ argument
679 ((blks) << (fs)->fs_fragshift)
681 #define fragnum(fs, fsb) /* calculates (fsb % fs->fs_frag) */ \ argument
682 ((fsb) & ((fs)->fs_frag - 1))
684 #define blknum(fs, fsb) /* calculates rounddown(fsb, fs->fs_frag) */ \ argument
685 ((fsb) &~ ((fs)->fs_frag - 1))
691 #define freespace(fs, ufsvfsp) \ argument
692 ((blkstofrags((fs), (fs)->fs_cstotal.cs_nbfree) + \
693 (fs)->fs_cstotal.cs_nffree) - (ufsvfsp)->vfs_minfrags)
699 #define blksize(fs, ip, lbn) \ argument
701 (ip)->i_size >= (offset_t)((lbn) + 1) << (fs)->fs_bshift) \
702 ? (fs)->fs_bsize \
703 : (fragroundup(fs, blkoff(fs, (ip)->i_size))))
705 #define dblksize(fs, dip, lbn) \ argument
707 (dip)->di_size >= (offset_t)((lbn) + 1) << (fs)->fs_bshift) \
708 ? (fs)->fs_bsize \
709 : (fragroundup(fs, blkoff(fs, (dip)->di_size))))
714 #define NSPB(fs) ((fs)->fs_nspf << (fs)->fs_fragshift) argument
715 #define NSPF(fs) ((fs)->fs_nspf) argument
720 #define INOPB(fs) ((fs)->fs_inopb) argument
721 #define INOPF(fs) ((fs)->fs_inopb >> (fs)->fs_fragshift) argument
726 #define NINDIR(fs) ((fs)->fs_nindir) argument
738 ((struct fs *)((struct ufsvfs *)vfsp->vfs_data)->vfs_bufp->b_un.b_addr)