diff options
author | David Woodhouse <dwmw2@infradead.org> | 2007-07-23 05:20:10 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2007-07-23 05:20:10 -0400 |
commit | 39fe5434cb9de5da40510028b17b96bc4eb312b3 (patch) | |
tree | 7a02a317b9ad57da51ca99887c119e779ccf3f13 /fs/ecryptfs | |
parent | 0fc72b81d3111d114ab378935b1cf07680ca1289 (diff) | |
parent | f695baf2df9e0413d3521661070103711545207a (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'fs/ecryptfs')
-rw-r--r-- | fs/ecryptfs/inode.c | 9 | ||||
-rw-r--r-- | fs/ecryptfs/main.c | 4 | ||||
-rw-r--r-- | fs/ecryptfs/mmap.c | 5 |
3 files changed, 8 insertions, 10 deletions
diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c index 83e94fedd4e9..0a50942b4378 100644 --- a/fs/ecryptfs/inode.c +++ b/fs/ecryptfs/inode.c | |||
@@ -282,7 +282,7 @@ static struct dentry *ecryptfs_lookup(struct inode *dir, struct dentry *dentry, | |||
282 | struct dentry *lower_dentry; | 282 | struct dentry *lower_dentry; |
283 | struct vfsmount *lower_mnt; | 283 | struct vfsmount *lower_mnt; |
284 | char *encoded_name; | 284 | char *encoded_name; |
285 | unsigned int encoded_namelen; | 285 | int encoded_namelen; |
286 | struct ecryptfs_crypt_stat *crypt_stat = NULL; | 286 | struct ecryptfs_crypt_stat *crypt_stat = NULL; |
287 | struct ecryptfs_mount_crypt_stat *mount_crypt_stat; | 287 | struct ecryptfs_mount_crypt_stat *mount_crypt_stat; |
288 | char *page_virt = NULL; | 288 | char *page_virt = NULL; |
@@ -473,7 +473,7 @@ static int ecryptfs_symlink(struct inode *dir, struct dentry *dentry, | |||
473 | struct dentry *lower_dir_dentry; | 473 | struct dentry *lower_dir_dentry; |
474 | umode_t mode; | 474 | umode_t mode; |
475 | char *encoded_symname; | 475 | char *encoded_symname; |
476 | unsigned int encoded_symlen; | 476 | int encoded_symlen; |
477 | struct ecryptfs_crypt_stat *crypt_stat = NULL; | 477 | struct ecryptfs_crypt_stat *crypt_stat = NULL; |
478 | 478 | ||
479 | lower_dentry = ecryptfs_dentry_to_lower(dentry); | 479 | lower_dentry = ecryptfs_dentry_to_lower(dentry); |
@@ -902,8 +902,9 @@ static int ecryptfs_setattr(struct dentry *dentry, struct iattr *ia) | |||
902 | mutex_lock(&crypt_stat->cs_mutex); | 902 | mutex_lock(&crypt_stat->cs_mutex); |
903 | if (S_ISDIR(dentry->d_inode->i_mode)) | 903 | if (S_ISDIR(dentry->d_inode->i_mode)) |
904 | crypt_stat->flags &= ~(ECRYPTFS_ENCRYPTED); | 904 | crypt_stat->flags &= ~(ECRYPTFS_ENCRYPTED); |
905 | else if (!(crypt_stat->flags & ECRYPTFS_POLICY_APPLIED) | 905 | else if (S_ISREG(dentry->d_inode->i_mode) |
906 | || !(crypt_stat->flags & ECRYPTFS_KEY_VALID)) { | 906 | && (!(crypt_stat->flags & ECRYPTFS_POLICY_APPLIED) |
907 | || !(crypt_stat->flags & ECRYPTFS_KEY_VALID))) { | ||
907 | struct vfsmount *lower_mnt; | 908 | struct vfsmount *lower_mnt; |
908 | struct file *lower_file = NULL; | 909 | struct file *lower_file = NULL; |
909 | struct ecryptfs_mount_crypt_stat *mount_crypt_stat; | 910 | struct ecryptfs_mount_crypt_stat *mount_crypt_stat; |
diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c index 606128f5c927..e557a6766927 100644 --- a/fs/ecryptfs/main.c +++ b/fs/ecryptfs/main.c | |||
@@ -677,7 +677,7 @@ static int ecryptfs_init_kmem_caches(void) | |||
677 | 677 | ||
678 | info = &ecryptfs_cache_infos[i]; | 678 | info = &ecryptfs_cache_infos[i]; |
679 | *(info->cache) = kmem_cache_create(info->name, info->size, | 679 | *(info->cache) = kmem_cache_create(info->name, info->size, |
680 | 0, SLAB_HWCACHE_ALIGN, info->ctor, NULL); | 680 | 0, SLAB_HWCACHE_ALIGN, info->ctor); |
681 | if (!*(info->cache)) { | 681 | if (!*(info->cache)) { |
682 | ecryptfs_free_kmem_caches(); | 682 | ecryptfs_free_kmem_caches(); |
683 | ecryptfs_printk(KERN_WARNING, "%s: " | 683 | ecryptfs_printk(KERN_WARNING, "%s: " |
@@ -840,8 +840,6 @@ static int __init ecryptfs_init(void) | |||
840 | goto out; | 840 | goto out; |
841 | } | 841 | } |
842 | kobj_set_kset_s(&ecryptfs_subsys, fs_subsys); | 842 | kobj_set_kset_s(&ecryptfs_subsys, fs_subsys); |
843 | sysfs_attr_version.attr.owner = THIS_MODULE; | ||
844 | sysfs_attr_version_str.attr.owner = THIS_MODULE; | ||
845 | rc = do_sysfs_registration(); | 843 | rc = do_sysfs_registration(); |
846 | if (rc) { | 844 | if (rc) { |
847 | printk(KERN_ERR "sysfs registration failed\n"); | 845 | printk(KERN_ERR "sysfs registration failed\n"); |
diff --git a/fs/ecryptfs/mmap.c b/fs/ecryptfs/mmap.c index 7d5a43cb0d5c..e4ab7bc14efe 100644 --- a/fs/ecryptfs/mmap.c +++ b/fs/ecryptfs/mmap.c | |||
@@ -409,8 +409,7 @@ static int ecryptfs_prepare_write(struct file *file, struct page *page, | |||
409 | if (!PageUptodate(page)) | 409 | if (!PageUptodate(page)) |
410 | rc = ecryptfs_do_readpage(file, page, page->index); | 410 | rc = ecryptfs_do_readpage(file, page, page->index); |
411 | if (page->index != 0) { | 411 | if (page->index != 0) { |
412 | loff_t end_of_prev_pg_pos = | 412 | loff_t end_of_prev_pg_pos = page_offset(page) - 1; |
413 | (((loff_t)page->index << PAGE_CACHE_SHIFT) - 1); | ||
414 | 413 | ||
415 | if (end_of_prev_pg_pos > i_size_read(page->mapping->host)) { | 414 | if (end_of_prev_pg_pos > i_size_read(page->mapping->host)) { |
416 | rc = ecryptfs_truncate(file->f_path.dentry, | 415 | rc = ecryptfs_truncate(file->f_path.dentry, |
@@ -736,7 +735,7 @@ static int ecryptfs_commit_write(struct file *file, struct page *page, | |||
736 | goto out; | 735 | goto out; |
737 | } | 736 | } |
738 | inode->i_blocks = lower_inode->i_blocks; | 737 | inode->i_blocks = lower_inode->i_blocks; |
739 | pos = (page->index << PAGE_CACHE_SHIFT) + to; | 738 | pos = page_offset(page) + to; |
740 | if (pos > i_size_read(inode)) { | 739 | if (pos > i_size_read(inode)) { |
741 | i_size_write(inode, pos); | 740 | i_size_write(inode, pos); |
742 | ecryptfs_printk(KERN_DEBUG, "Expanded file size to " | 741 | ecryptfs_printk(KERN_DEBUG, "Expanded file size to " |