Whamcloud - gitweb
LU-1337 llite: support SEEK_HOLE and SEEK_DATA
authoryangsheng <ys@whamcloud.com>
Tue, 18 Dec 2012 04:21:36 +0000 (12:21 +0800)
committerOleg Drokin <green@whamcloud.com>
Fri, 21 Dec 2012 16:22:58 +0000 (11:22 -0500)
commit99af76a6aff4dac41ed3cc467cbd8e4bfe1990bc
tree9081381d017569d7e17d7aec66d49b6c2ec2ca57
parent13b269ab77daca78fdfc374986d4cc34c7e66309
LU-1337 llite: support SEEK_HOLE and SEEK_DATA

kernel 3.1 introduced SEEK_HOLE and SEEK_DATA. llite should
handle them as required by vfs. For now, we can just consider
whole file is data.

Also fix race between concurrent SEEK_CURs by taking f_lock
in SEEK_CUR, as implemented since kernel commit ef3d0fd27.
Before that, kernel handled the race by taking i_mutex.

Kernel introduced f_lock to protect f_flags when dropping BKL
in kernel commit db1dd4d3. Later, f_lock is extended to protect
Protects f_ep_links, f_flags, and f_pos vs i_size in lseek
SEEK_CUR.

Signed-off-by: Peng Tao <tao.peng@emc.com>
Signed-off-by: yang sheng <ys@whamcloud.com>
Change-Id: I944102f20ab1ca1083a16d41e95802d6b8bda15d
Reviewed-on: http://review.whamcloud.com/4579
Tested-by: Hudson
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Peng Tao <bergwolf@gmail.com>
Reviewed-by: Lai Siyao <laisiyao@whamcloud.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
lustre/autoconf/lustre-core.m4
lustre/include/linux/lustre_compat25.h
lustre/llite/file.c