From 6ab9146e84d53d007ea2c2aeffbac80c3b7b1888 Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Thu, 10 Oct 2002 19:47:44 +0000 Subject: [PATCH] Fix up minor build issues in some xfstests sources. Fix build after recent xfsprogs header changes. --- src/alloc.c | 20 ++++++++++++++++++++ src/mmapcat.c | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/alloc.c b/src/alloc.c index e3f7afa8..07fa68b9 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -32,6 +32,26 @@ #include "global.h" +/* + * Block I/O parameterization. A basic block (BB) is the lowest size of + * filesystem allocation, and must equal 512. Length units given to bio + * routines are in BB's. + */ +#define BBSHIFT 9 +#define BBSIZE (1<> BBSHIFT) +#define BTOBBT(bytes) ((__u64)(bytes) >> BBSHIFT) +#define BBTOB(bbs) ((bbs) << BBSHIFT) +#define OFFTOBB(bytes) (((__u64)(bytes) + BBSIZE - 1) >> BBSHIFT) +#define OFFTOBBT(bytes) ((__u64)(bytes) >> BBSHIFT) +#define BBTOOFF(bbs) ((__u64)(bbs) << BBSHIFT) + +#define SEEKLIMIT32 0x7fffffff +#define BBSEEKLIMIT32 BTOBBT(SEEKLIMIT32) +#define SEEKLIMIT 0x7fffffffffffffffLL +#define BBSEEKLIMIT OFFTOBBT(SEEKLIMIT) + #define FSBTOBB(f) (OFFTOBBT(FSBTOOFF(f))) #define BBTOFSB(b) (OFFTOFSB(BBTOOFF(b))) #define OFFTOFSB(o) ((o) / blocksize) diff --git a/src/mmapcat.c b/src/mmapcat.c index 845916c8..c4242705 100644 --- a/src/mmapcat.c +++ b/src/mmapcat.c @@ -8,7 +8,7 @@ int main(int argc, char **argv) { - int fd,n; + int fd; char *ptr, *ptr2; struct stat st; -- 2.30.2