Consolodate four copies of the STDSB define into a single place.

The STDSB macro is passed to the ffs_sbget() routine to fetch a
UFS/FFS superblock "from the stadard place". It was identically defined
in lib/libufs/libufs.h, stand/libsa/ufs.c, sys/ufs/ffs/ffs_extern.h,
and sys/ufs/ffs/ffs_subr.c. Delete it from these four files and
define it instead in sys/ufs/ffs/fs.h. All existing uses of this macro
already include sys/ufs/ffs/fs.h so no include changes need to be made.

No functional change intended.

Sponsored by: Netflix
This commit is contained in:
Kirk McKusick 2021-11-14 22:09:06 -08:00
parent f7523c8a19
commit b366ee4868
5 changed files with 12 additions and 22 deletions

View File

@ -117,12 +117,6 @@ int ffs_sbput(void *, struct fs *, off_t,
void ffs_update_dinode_ckhash(struct fs *, struct ufs2_dinode *); void ffs_update_dinode_ckhash(struct fs *, struct ufs2_dinode *);
int ffs_verify_dinode_ckhash(struct fs *, struct ufs2_dinode *); int ffs_verify_dinode_ckhash(struct fs *, struct ufs2_dinode *);
/*
* Request standard superblock location in ffs_sbget
*/
#define STDSB -1 /* Fail if check-hash is bad */
#define STDSB_NOHASHFAIL -2 /* Ignore check-hash failure */
/* /*
* block.c * block.c
*/ */

View File

@ -154,11 +154,6 @@ static int ufs_use_sa_read(void *, off_t, void **, int);
/* from ffs_subr.c */ /* from ffs_subr.c */
int ffs_sbget(void *, struct fs **, off_t, char *, int ffs_sbget(void *, struct fs **, off_t, char *,
int (*)(void *, off_t, void **, int)); int (*)(void *, off_t, void **, int));
/*
* Request standard superblock location in ffs_sbget
*/
#define STDSB -1 /* Fail if check-hash is bad */
#define STDSB_NOHASHFAIL -2 /* Ignore check-hash failure */
/* /*
* Read a new inode into a file structure. * Read a new inode into a file structure.

View File

@ -137,12 +137,6 @@ int ffs_breadz(struct ufsmount *, struct vnode *, daddr_t, daddr_t, int,
#define FFSR_FORCE 0x0001 #define FFSR_FORCE 0x0001
#define FFSR_UNSUSPEND 0x0002 #define FFSR_UNSUSPEND 0x0002
/*
* Request standard superblock location in ffs_sbget
*/
#define STDSB -1 /* Fail if check-hash is bad */
#define STDSB_NOHASHFAIL -2 /* Ignore check-hash failure */
/* /*
* Definitions for TRIM interface * Definitions for TRIM interface
* *

View File

@ -50,11 +50,6 @@ uint32_t ffs_calc_sbhash(struct fs *);
struct malloc_type; struct malloc_type;
#define UFS_MALLOC(size, type, flags) malloc(size) #define UFS_MALLOC(size, type, flags) malloc(size)
#define UFS_FREE(ptr, type) free(ptr) #define UFS_FREE(ptr, type) free(ptr)
/*
* Request standard superblock location in ffs_sbget
*/
#define STDSB -1 /* Fail if check-hash is bad */
#define STDSB_NOHASHFAIL -2 /* Ignore check-hash failure */
#else /* _KERNEL */ #else /* _KERNEL */
#include <sys/systm.h> #include <sys/systm.h>

View File

@ -77,6 +77,18 @@
#define SBLOCKSIZE 8192 #define SBLOCKSIZE 8192
#define SBLOCKSEARCH \ #define SBLOCKSEARCH \
{ SBLOCK_UFS2, SBLOCK_UFS1, SBLOCK_FLOPPY, SBLOCK_PIGGY, -1 } { SBLOCK_UFS2, SBLOCK_UFS1, SBLOCK_FLOPPY, SBLOCK_PIGGY, -1 }
/*
* Request standard superblock location in ffs_sbget().
*
* STDSB will fail if the superblock has a check hash and it is wrong.
*
* STDSB_NOHASHFAIL will note that the check hash is wrong but will
* still return the superblock. This is used by the bootstrap code
* to give the system a chance to come up so that fsck can be run
* to correct the problem.
*/
#define STDSB -1 /* Fail if check-hash is bad */
#define STDSB_NOHASHFAIL -2 /* Ignore check-hash failure */
/* /*
* Max number of fragments per block. This value is NOT tweakable. * Max number of fragments per block. This value is NOT tweakable.