From a580302f6b31e47fcf5620924ce3282cc1d68997 Mon Sep 17 00:00:00 2001 From: Eric Sandeen Date: Wed, 23 Jun 2004 05:10:16 +0000 Subject: [PATCH] Fix check & repair of filesystems w/ realtime vols use of isset macro was incorrectly checking rt bitmap use our xfs_isset macro not system's isset, which assumes a byte-sized bitfield --- db/check.c | 2 +- include/irix.h | 1 - include/libxfs.h | 2 ++ repair/rt.c | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/db/check.c b/db/check.c index ad09eb3e4..90b229123 100644 --- a/db/check.c +++ b/db/check.c @@ -3472,7 +3472,7 @@ process_rtbitmap( for (bit = 0; bit < bitsperblock && extno < mp->m_sb.sb_rextents; bit++, extno++) { - if (isset(words, bit)) { + if (xfs_isset(words, bit)) { rtbno = extno * mp->m_sb.sb_rextsize; set_rdbmap(rtbno, mp->m_sb.sb_rextsize, DBM_RTFREE); diff --git a/include/irix.h b/include/irix.h index 732dadc8d..8d61b3009 100644 --- a/include/irix.h +++ b/include/irix.h @@ -79,7 +79,6 @@ typedef flock64_t xfs_flock64_t; #define UINT_MAX UINT32_MAX #define PATH_MAX MAXPATHLEN #define constpp char * const * -#define isset(a,i) ((a)[(i)/NBBY] & (1<<((i)%NBBY))) static __inline__ int xfsctl(const char *path, int fd, int cmd, void *p) { diff --git a/include/libxfs.h b/include/libxfs.h index 0e5ef4d31..c971a9875 100644 --- a/include/libxfs.h +++ b/include/libxfs.h @@ -79,6 +79,8 @@ #define XFS_SUPER_MAGIC 0x58465342 #endif +#define xfs_isset(a,i) ((a)[(i)/(sizeof((a))*NBBY)] & (1<<((i)%(sizeof((a))*NBBY)))) + /* * Argument structure for libxfs_init(). */ diff --git a/repair/rt.c b/repair/rt.c index 851446232..63e1a4b00 100644 --- a/repair/rt.c +++ b/repair/rt.c @@ -230,7 +230,7 @@ process_rtbitmap(xfs_mount_t *mp, for (bit = 0; bit < bitsperblock && extno < mp->m_sb.sb_rextents; bit++, extno++) { - if (isset(words, bit)) { + if (xfs_isset(words, bit)) { set_rtbno_state(mp, extno, XR_E_FREE); sb_frextents++; if (prevbit == 0) { -- 2.47.2