diff options
author | Josef Bacik <josef@redhat.com> | 2011-07-18 13:21:35 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-07-20 20:47:56 -0400 |
commit | 982d816581eeeacfe5b2b7c6d47d13a157616eff (patch) | |
tree | 1f1cb5725646e9de13969c8894b26ab3d5e3102e /fs/9p/cache.c | |
parent | b4d5b10fb2e3a4327838c07d8ebd9e350fcc133d (diff) | |
download | linux-982d816581eeeacfe5b2b7c6d47d13a157616eff.tar.gz linux-982d816581eeeacfe5b2b7c6d47d13a157616eff.tar.bz2 linux-982d816581eeeacfe5b2b7c6d47d13a157616eff.zip |
fs: add SEEK_HOLE and SEEK_DATA flags
This just gets us ready to support the SEEK_HOLE and SEEK_DATA flags. Turns out
using fiemap in things like cp cause more problems than it solves, so lets try
and give userspace an interface that doesn't suck. We need to match solaris
here, and the definitions are
*o* If /whence/ is SEEK_HOLE, the offset of the start of the
next hole greater than or equal to the supplied offset
is returned. The definition of a hole is provided near
the end of the DESCRIPTION.
*o* If /whence/ is SEEK_DATA, the file pointer is set to the
start of the next non-hole file region greater than or
equal to the supplied offset.
So in the generic case the entire file is data and there is a virtual hole at
the end. That means we will just return i_size for SEEK_HOLE and will return
the same offset for SEEK_DATA. This is how Solaris does it so we have to do it
the same way.
Thanks,
Signed-off-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/9p/cache.c')
0 files changed, 0 insertions, 0 deletions