ecryptfs: modify write path to encrypt page in writepage
authorThieu Le <thieule@chromium.org>
Wed, 9 Mar 2011 00:26:03 +0000 (16:26 -0800)
committerTyler Hicks <tyhicks@linux.vnet.ibm.com>
Mon, 28 Mar 2011 06:47:45 +0000 (01:47 -0500)
commit57db4e8d73ef2b5e94a3f412108dff2576670a8a
treeab6eae8e879cfa41cdb3309d8e6a52de14746ca4
parentfed8859b3ab94274c986cbdf7d27130e0545f02c
ecryptfs: modify write path to encrypt page in writepage

Change the write path to encrypt the data only when the page is written to
disk in ecryptfs_writepage. Previously, ecryptfs encrypts the page in
ecryptfs_write_end which means that if there are multiple write requests to
the same page, ecryptfs ends up re-encrypting that page over and over again.
This patch minimizes the number of encryptions needed.

Signed-off-by: Thieu Le <thieule@chromium.org>
[tyhicks: Changed NULL .drop_inode sop pointer to generic_drop_inode]
Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
fs/ecryptfs/ecryptfs_kernel.h
fs/ecryptfs/file.c
fs/ecryptfs/main.c
fs/ecryptfs/mmap.c
fs/ecryptfs/read_write.c
fs/ecryptfs/super.c