summaryrefslogtreecommitdiff
path: root/fs/nfs/blocklayout/blocklayout.h
diff options
context:
space:
mode:
authorPeng Tao <bergwolf@gmail.com>2012-08-24 00:27:51 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-10-21 09:32:37 -0700
commitfda45cc12ebb7060131111442844f977555e3b9b (patch)
treefa7d69db5ff24127bac1db43af18f74e1c131e13 /fs/nfs/blocklayout/blocklayout.h
parente99bc7155de4a2598f853001720228d728d5ad1f (diff)
pnfsblock: fix partial page buffer wirte
commit fe6e1e8d9fad86873eb74a26e80a8f91f9e870b5 upstream. If applications use flock to protect its write range, generic NFS will not do read-modify-write cycle at page cache level. Therefore LD should know how to handle non-sector aligned writes. Otherwise there will be data corruption. Signed-off-by: Peng Tao <tao.peng@emc.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/nfs/blocklayout/blocklayout.h')
-rw-r--r--fs/nfs/blocklayout/blocklayout.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/nfs/blocklayout/blocklayout.h b/fs/nfs/blocklayout/blocklayout.h
index 03350690118..39bb51a8dd1 100644
--- a/fs/nfs/blocklayout/blocklayout.h
+++ b/fs/nfs/blocklayout/blocklayout.h
@@ -41,6 +41,7 @@
#define PAGE_CACHE_SECTORS (PAGE_CACHE_SIZE >> SECTOR_SHIFT)
#define PAGE_CACHE_SECTOR_SHIFT (PAGE_CACHE_SHIFT - SECTOR_SHIFT)
+#define SECTOR_SIZE (1 << SECTOR_SHIFT)
struct block_mount_id {
spinlock_t bm_lock; /* protects list */