Generic implementation of SEEK_HOLE/DATA reports whole file as data chunk with
virtual hole at the end (generic_file_llseek, used by ext2/ext3/reiserfs/nfs).
Currently test prepares file smaller than expected for "huge file" testcases
(testcases 10-12). This patch fixes test file layout, now second data chunk
ends right at the expected end of file.
Plus it fixes type of 'filesz' argument, it should be off_t.
Signed-off-by: Konstantin Khlebnikov <k.khlebnikov@samsung.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
return fd;
}
-static int do_lseek(int testnum, int subtest, int fd, int filsz, int origin,
+static int do_lseek(int testnum, int subtest, int fd, off_t filsz, int origin,
off_t set, off_t exp)
{
off_t pos, exp2;
{
char *buf = NULL;
int bufsz = alloc_size * 16; /* XFS seems to round allocated size */
- off_t off = filsz - 2*bufsz;
+ off_t off = filsz - bufsz;
int ret = -1;
buf = do_malloc(bufsz);
goto out;
memset(buf, 'a', bufsz);
+ /* |- DATA -|- HUGE HOLE -|- DATA -| */
ret = do_pwrite(fd, buf, bufsz, 0);
if (ret)
goto out;