diff options
author | Nick Piggin <npiggin@suse.de> | 2007-10-16 01:25:26 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-16 09:42:58 -0700 |
commit | 55144768e100b68447f44c5e5c9deb155ad661bd (patch) | |
tree | 9889682ee3b64627ad9eb504f30672fad844752f /fs | |
parent | 03158cd7eb3374843de68421142ca5900df845d9 (diff) | |
download | kernel-crypto-55144768e100b68447f44c5e5c9deb155ad661bd.tar.gz kernel-crypto-55144768e100b68447f44c5e5c9deb155ad661bd.tar.xz kernel-crypto-55144768e100b68447f44c5e5c9deb155ad661bd.zip |
fs: remove some AOP_TRUNCATED_PAGE
prepare/commit_write no longer returns AOP_TRUNCATED_PAGE since OCFS2 and
GFS2 were converted to the new aops, so we can make some simplifications
for that.
[michal.k.k.piotrowski@gmail.com: fix warning]
Signed-off-by: Nick Piggin <npiggin@suse.de>
Cc: Michael Halcrow <mhalcrow@us.ibm.com>
Cc: Mark Fasheh <mark.fasheh@oracle.com>
Cc: Steven Whitehouse <swhiteho@redhat.com>
Signed-off-by: Michal Piotrowski <michal.k.k.piotrowski@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ecryptfs/mmap.c | 40 |
1 files changed, 10 insertions, 30 deletions
diff --git a/fs/ecryptfs/mmap.c b/fs/ecryptfs/mmap.c index fd3f94d4a66..aaea55a61ea 100644 --- a/fs/ecryptfs/mmap.c +++ b/fs/ecryptfs/mmap.c @@ -446,11 +446,9 @@ out: return rc; } -static -void ecryptfs_release_lower_page(struct page *lower_page, int page_locked) +static void ecryptfs_release_lower_page(struct page *lower_page) { - if (page_locked) - unlock_page(lower_page); + unlock_page(lower_page); page_cache_release(lower_page); } @@ -471,7 +469,6 @@ static int ecryptfs_write_inode_size_to_header(struct file *lower_file, const struct address_space_operations *lower_a_ops; u64 file_size; -retry: header_page = grab_cache_page(lower_inode->i_mapping, 0); if (!header_page) { ecryptfs_printk(KERN_ERR, "grab_cache_page for " @@ -482,11 +479,7 @@ retry: lower_a_ops = lower_inode->i_mapping->a_ops; rc = lower_a_ops->prepare_write(lower_file, header_page, 0, 8); if (rc) { - if (rc == AOP_TRUNCATED_PAGE) { - ecryptfs_release_lower_page(header_page, 0); - goto retry; - } else - ecryptfs_release_lower_page(header_page, 1); + ecryptfs_release_lower_page(header_page); goto out; } file_size = (u64)i_size_read(inode); @@ -500,11 +493,7 @@ retry: if (rc < 0) ecryptfs_printk(KERN_ERR, "Error commiting header page " "write\n"); - if (rc == AOP_TRUNCATED_PAGE) { - ecryptfs_release_lower_page(header_page, 0); - goto retry; - } else - ecryptfs_release_lower_page(header_page, 1); + ecryptfs_release_lower_page(header_page); lower_inode->i_mtime = lower_inode->i_ctime = CURRENT_TIME; mark_inode_dirty_sync(inode); out: @@ -593,7 +582,6 @@ int ecryptfs_get_lower_page(struct page **lower_page, struct inode *lower_inode, { int rc = 0; -retry: *lower_page = grab_cache_page(lower_inode->i_mapping, lower_page_index); if (!(*lower_page)) { rc = -EINVAL; @@ -607,16 +595,11 @@ retry: byte_offset, region_bytes); if (rc) { - if (rc == AOP_TRUNCATED_PAGE) { - ecryptfs_release_lower_page(*lower_page, 0); - goto retry; - } else { - ecryptfs_printk(KERN_ERR, "prepare_write for " - "lower_page_index = [0x%.16x] failed; rc = " - "[%d]\n", lower_page_index, rc); - ecryptfs_release_lower_page(*lower_page, 1); - (*lower_page) = NULL; - } + ecryptfs_printk(KERN_ERR, "prepare_write for " + "lower_page_index = [0x%.16x] failed; rc = " + "[%d]\n", lower_page_index, rc); + ecryptfs_release_lower_page(*lower_page); + (*lower_page) = NULL; } out: return rc; @@ -632,19 +615,16 @@ ecryptfs_commit_lower_page(struct page *lower_page, struct inode *lower_inode, struct file *lower_file, int byte_offset, int region_size) { - int page_locked = 1; int rc = 0; rc = lower_inode->i_mapping->a_ops->commit_write( lower_file, lower_page, byte_offset, region_size); - if (rc == AOP_TRUNCATED_PAGE) - page_locked = 0; if (rc < 0) { ecryptfs_printk(KERN_ERR, "Error committing write; rc = [%d]\n", rc); } else rc = 0; - ecryptfs_release_lower_page(lower_page, page_locked); + ecryptfs_release_lower_page(lower_page); return rc; } |