ia64/xen-unstable

view tools/libaio/harness/cases/8.t @ 10736:2937703f0ed0

Added blktap support. Includes kernel driver (enabled as CONFIG_XEN_BLKDEV_TAP=y) and userspace tools. The userspace deamon (blktapctrl) is enabled by default when xend is activated. For further information on using and configuring blktap see tools/blktap/README.
author jchesterfield@dhcp92.uk.xensource.com
date Thu Jul 13 10:13:26 2006 +0100 (2006-07-13)
parents
children
line source
1 /* 8.t
2 - Ditto for the above three tests at the offset maximum (largest
3 possible ext2/3 file size.) (8.t)
4 */
5 #include <sys/vfs.h>
7 #define EXT2_OLD_SUPER_MAGIC 0xEF51
8 #define EXT2_SUPER_MAGIC 0xEF53
10 long long get_fs_limit(int fd)
11 {
12 struct statfs s;
13 int res;
14 long long lim = 0;
16 res = fstatfs(fd, &s); assert(res == 0);
18 switch(s.f_type) {
19 case EXT2_OLD_SUPER_MAGIC:
20 case EXT2_SUPER_MAGIC:
21 #if 0
22 {
23 long long tmp;
24 tmp = s.f_bsize / 4;
25 /* 12 direct + indirect block + dind + tind */
26 lim = 12 + tmp + tmp * tmp + tmp * tmp * tmp;
27 lim *= s.f_bsize;
28 printf("limit(%ld) = %Ld\n", (long)s.f_bsize, lim);
29 }
30 #endif
31 switch(s.f_bsize) {
32 case 4096: lim = 2199023251456; break;
33 default:
34 printf("unknown ext2 blocksize %ld\n", (long)s.f_bsize);
35 exit(3);
36 }
37 break;
38 default:
39 printf("unknown filesystem 0x%08lx\n", (long)s.f_type);
40 exit(3);
41 }
42 return lim;
43 }
45 #define SET_RLIMIT(x) do ; while (0)
46 #define LIMIT get_fs_limit(rwfd)
47 #define FILENAME "testdir.ext2/rwfile"
49 #include "common-7-8.h"