summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_fs.h
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@redhat.com>2011-05-20 21:52:17 +0000
committerAlex Elder <aelder@sgi.com>2011-07-08 11:32:51 -0500
commitc0e090ced259b85b854636c99dda95b7070a2785 (patch)
treeb87f23061f2bd75ecbf4a1906c4fb4aad27cd2d1 /fs/xfs/xfs_fs.h
parente163cbde981c5988c3e80ca29589132336f18a72 (diff)
downloadop-kernel-dev-c0e090ced259b85b854636c99dda95b7070a2785.zip
op-kernel-dev-c0e090ced259b85b854636c99dda95b7070a2785.tar.gz
xfs: consolidate & clarify mount sanity checks
Pavol pointed out that there is one silent error case in the mount path, and that others are rather uninformative. I've taken Pavol's suggested patch and extended it a bit to also: * fix a message which says "turned off" but actually errors out * consolidate the vaguely differentiated "SB sanity check [12]" messages, and hexdump the superblock for analysis Original-patch-by: Pavol Gono <Pavol.Gono@siemens.com> Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Alex Elder <aelder@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_fs.h')
-rw-r--r--fs/xfs/xfs_fs.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/xfs/xfs_fs.h b/fs/xfs/xfs_fs.h
index 8f6fc1a..c13fed8 100644
--- a/fs/xfs/xfs_fs.h
+++ b/fs/xfs/xfs_fs.h
@@ -249,6 +249,11 @@ typedef struct xfs_fsop_resblks {
#define XFS_MAX_LOG_BYTES \
((2 * 1024 * 1024 * 1024ULL) - XFS_MIN_LOG_BYTES)
+/* Used for sanity checks on superblock */
+#define XFS_MAX_DBLOCKS(s) ((xfs_drfsbno_t)(s)->sb_agcount * (s)->sb_agblocks)
+#define XFS_MIN_DBLOCKS(s) ((xfs_drfsbno_t)((s)->sb_agcount - 1) * \
+ (s)->sb_agblocks + XFS_MIN_AG_BLOCKS)
+
/*
* Structures for XFS_IOC_FSGROWFSDATA, XFS_IOC_FSGROWFSLOG & XFS_IOC_FSGROWFSRT
*/
OpenPOWER on IntegriCloud