Skip to contentSkip to conversation

fs: fsstress: fix compile when -DNO_XFS disabled

PATCH Superseded [email protected] 2 participants 2 messages Mar 16, 2011

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 fs: fsstress: fix compile when -DNO_XFS disabled

From: Caspar Zhang <[email protected]>

When -DNO_XFS disabled in Makefile, the compilation couldn't pass and many errors and warnings outputed. This patch fixes this issue.

---
 testcases/kernel/fs/fsstress/Makefile   |    3 +++
 testcases/kernel/fs/fsstress/fsstress.c |   16 ++++++++--------
 testcases/kernel/fs/fsstress/global.h   |    4 ++--
 3 files changed, 13 insertions(+), 10 deletions(-)
testcases/kernel/fs/fsstress/Makefile +3 -0
index 0a53891..f6527ed 100644
@@ -27,6 +27,9 @@ include $(top_srcdir)/include/mk/env_pre.mk
 CPPFLAGS			+= -DNO_XFS -I$(abs_srcdir) \
 				   -D_LARGEFILE64_SOURCE -D_GNU_SOURCE
 
+# if removed -DNO_XFS, you should unmask the following line
+#CPPFLAGS			+= -lattr
+
 # XXX (garrcoop): not -Wuninitialized clean.
 CPPFLAGS			+= -Wno-error
 
testcases/kernel/fs/fsstress/fsstress.c +8 -8
index 37956f3..e774d22 100644
@@ -1436,7 +1436,7 @@ allocsp_f(int opno, long r)
 	e = ioctl(fd, XFS_IOC_ALLOCSP64, &fl) < 0 ? errno : 0;
 	if (v)
 		printf("%d/%d: ioctl(XFS_IOC_ALLOCSP64) %s %lld 0 %d\n",
-			procid, opno, f.path, off, e);
+			procid, opno, f.path, (long long)off, e);
 	free_pathname(&f);
 	close(fd);
 }
@@ -1571,7 +1571,7 @@ bulkstat_f(int opno, long r)
 	free(t);
 	if (verbose)
 		printf("%d/%d: bulkstat nent %d total %lld\n",
-			procid, opno, nent, total);
+			procid, opno, nent, (long long)total);
 	close(fd);
 }
 
@@ -1704,7 +1704,7 @@ creat_f(int opno, long r)
 				geom.rtextsize * geom.blocksize * extsize;
 			if (ioctl(fd, XFS_IOC_FSSETXATTR, &a) < 0)
 				e1 = errno;
-			esz = a.fsx_estsize;
+			esz = a.fsx_extsize;
 
 		}
 #endif
@@ -2014,7 +2014,7 @@ freesp_f(int opno, long r)
 	e = ioctl(fd, XFS_IOC_FREESP64, &fl) < 0 ? errno : 0;
 	if (v)
 		printf("%d/%d: ioctl(XFS_IOC_FREESP64) %s %lld 0 %d\n",
-			procid, opno, f.path, off, e);
+			procid, opno, f.path, (long long)off, e);
 	free_pathname(&f);
 	close(fd);
 }
@@ -2386,8 +2386,8 @@ resvsp_f(int opno, long r)
 	fl.l_len = (off64_t)(random() % (1024 * 1024));
 	e = ioctl(fd, XFS_IOC_RESVSP64, &fl) < 0 ? errno : 0;
 	if (v)
-		printf("%d/%d: ioctl(XFS_IOC_RESVSP64) %s %lld %lld %d\n",
-			procid, opno, f.path, off, fl.l_len, e);
+		printf("%d/%d: ioctl(XFS_IOC_RESVSP64) %s %lld %ld %d\n",
+			procid, opno, f.path, (long long)off, fl.l_len, e);
 	free_pathname(&f);
 	close(fd);
 }
@@ -2603,8 +2603,8 @@ unresvsp_f(int opno, long r)
 	fl.l_len = (off64_t)(random() % (1 << 20));
 	e = ioctl(fd, XFS_IOC_UNRESVSP64, &fl) < 0 ? errno : 0;
 	if (v)
-		printf("%d/%d: ioctl(XFS_IOC_UNRESVSP64) %s %lld %lld %d\n",
-			procid, opno, f.path, off, fl.l_len, e);
+		printf("%d/%d: ioctl(XFS_IOC_UNRESVSP64) %s %lld %ld %d\n",
+			procid, opno, f.path, (long long)off, fl.l_len, e);
 	free_pathname(&f);
 	close(fd);
 }
testcases/kernel/fs/fsstress/global.h +2 -2
index f788395..9644666 100644
@@ -38,8 +38,8 @@
 #if defined(NO_XFS)
 # include "xfscompat.h"
 #else
-# include <libxfs.h>
-# include <attributes.h>
+# include <xfs/libxfs.h>
+# include <attr/attributes.h>
 #endif
 
 /* libc includes */
Signature · 12 lines
1.7.4.1


------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#1 lore raw
Quoted 12 lines
---
 testcases/kernel/fs/fsstress/Makefile   |    3 +++
 testcases/kernel/fs/fsstress/fsstress.c |   16 ++++++++--------
 testcases/kernel/fs/fsstress/global.h   |    4 ++--
 3 files changed, 13 insertions(+), 10 deletions(-)
testcases/kernel/fs/fsstress/Makefile +0 -0
index 0a53891..f6527ed 100644

testcases/kernel/fs/fsstress/Makefile include $(top_srcdir)/include/mk/env_pre.mk · line 31

Quoted 5 lines
testcases/kernel/fs/fsstress/Makefile +2 -0
@@ -27,6 +27,9 @@ include $(top_srcdir)/include/mk/env_pre.mk
 CPPFLAGS			+= -DNO_XFS -I$(abs_srcdir) \
 				   -D_LARGEFILE64_SOURCE -D_GNU_SOURCE
 
+# if removed -DNO_XFS, you should unmask the following line
+#CPPFLAGS			+= -lattr

Dynamic libraries should be added to LDLIBS variable see doc/README.mk-devel.

Signature · 12 lines
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list