diff options
author | Michael Halcrow <mhalcrow@us.ibm.com> | 2007-02-12 03:53:49 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-12 12:48:37 -0500 |
commit | e2bd99ec5c0e20ed6aeb079fa8f975c2dcd78a2c (patch) | |
tree | 78892d49cf55fa4cf22ce9b8b226c63bac8b227c /fs/ecryptfs/mmap.c | |
parent | 9d8b8ce5561890464c54645cdea4d6b157159fec (diff) |
[PATCH] eCryptfs: open-code flag checking and manipulation
Open-code flag checking and manipulation.
Signed-off-by: Michael Halcrow <mhalcrow@us.ibm.com>
Signed-off-by: Trevor Highland <tshighla@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ecryptfs/mmap.c')
-rw-r--r-- | fs/ecryptfs/mmap.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/ecryptfs/mmap.c b/fs/ecryptfs/mmap.c index f5f962d7a123..3014aa719953 100644 --- a/fs/ecryptfs/mmap.c +++ b/fs/ecryptfs/mmap.c | |||
@@ -295,8 +295,8 @@ static int ecryptfs_readpage(struct file *file, struct page *page) | |||
295 | crypt_stat = &ecryptfs_inode_to_private(file->f_path.dentry->d_inode) | 295 | crypt_stat = &ecryptfs_inode_to_private(file->f_path.dentry->d_inode) |
296 | ->crypt_stat; | 296 | ->crypt_stat; |
297 | if (!crypt_stat | 297 | if (!crypt_stat |
298 | || !ECRYPTFS_CHECK_FLAG(crypt_stat->flags, ECRYPTFS_ENCRYPTED) | 298 | || !(crypt_stat->flags & ECRYPTFS_ENCRYPTED) |
299 | || ECRYPTFS_CHECK_FLAG(crypt_stat->flags, ECRYPTFS_NEW_FILE)) { | 299 | || (crypt_stat->flags & ECRYPTFS_NEW_FILE)) { |
300 | ecryptfs_printk(KERN_DEBUG, | 300 | ecryptfs_printk(KERN_DEBUG, |
301 | "Passing through unencrypted page\n"); | 301 | "Passing through unencrypted page\n"); |
302 | rc = ecryptfs_do_readpage(file, page, page->index); | 302 | rc = ecryptfs_do_readpage(file, page, page->index); |
@@ -657,10 +657,10 @@ static int ecryptfs_commit_write(struct file *file, struct page *page, | |||
657 | mutex_lock(&lower_inode->i_mutex); | 657 | mutex_lock(&lower_inode->i_mutex); |
658 | crypt_stat = &ecryptfs_inode_to_private(file->f_path.dentry->d_inode) | 658 | crypt_stat = &ecryptfs_inode_to_private(file->f_path.dentry->d_inode) |
659 | ->crypt_stat; | 659 | ->crypt_stat; |
660 | if (ECRYPTFS_CHECK_FLAG(crypt_stat->flags, ECRYPTFS_NEW_FILE)) { | 660 | if (crypt_stat->flags & ECRYPTFS_NEW_FILE) { |
661 | ecryptfs_printk(KERN_DEBUG, "ECRYPTFS_NEW_FILE flag set in " | 661 | ecryptfs_printk(KERN_DEBUG, "ECRYPTFS_NEW_FILE flag set in " |
662 | "crypt_stat at memory location [%p]\n", crypt_stat); | 662 | "crypt_stat at memory location [%p]\n", crypt_stat); |
663 | ECRYPTFS_CLEAR_FLAG(crypt_stat->flags, ECRYPTFS_NEW_FILE); | 663 | crypt_stat->flags &= ~(ECRYPTFS_NEW_FILE); |
664 | } else | 664 | } else |
665 | ecryptfs_printk(KERN_DEBUG, "Not a new file\n"); | 665 | ecryptfs_printk(KERN_DEBUG, "Not a new file\n"); |
666 | ecryptfs_printk(KERN_DEBUG, "Calling fill_zeros_to_end_of_page" | 666 | ecryptfs_printk(KERN_DEBUG, "Calling fill_zeros_to_end_of_page" |