diff options
Diffstat (limited to 'fs/ecryptfs/ecryptfs_kernel.h')
-rw-r--r-- | fs/ecryptfs/ecryptfs_kernel.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/fs/ecryptfs/ecryptfs_kernel.h b/fs/ecryptfs/ecryptfs_kernel.h index 542f625312f3..bfc2e0f78f00 100644 --- a/fs/ecryptfs/ecryptfs_kernel.h +++ b/fs/ecryptfs/ecryptfs_kernel.h | |||
@@ -35,6 +35,7 @@ | |||
35 | #include <linux/scatterlist.h> | 35 | #include <linux/scatterlist.h> |
36 | #include <linux/hash.h> | 36 | #include <linux/hash.h> |
37 | #include <linux/nsproxy.h> | 37 | #include <linux/nsproxy.h> |
38 | #include <linux/backing-dev.h> | ||
38 | 39 | ||
39 | /* Version verification for shared data structures w/ userspace */ | 40 | /* Version verification for shared data structures w/ userspace */ |
40 | #define ECRYPTFS_VERSION_MAJOR 0x00 | 41 | #define ECRYPTFS_VERSION_MAJOR 0x00 |
@@ -273,7 +274,7 @@ struct ecryptfs_crypt_stat { | |||
273 | u32 flags; | 274 | u32 flags; |
274 | unsigned int file_version; | 275 | unsigned int file_version; |
275 | size_t iv_bytes; | 276 | size_t iv_bytes; |
276 | size_t num_header_bytes_at_front; | 277 | size_t metadata_size; |
277 | size_t extent_size; /* Data extent size; default is 4096 */ | 278 | size_t extent_size; /* Data extent size; default is 4096 */ |
278 | size_t key_size; | 279 | size_t key_size; |
279 | size_t extent_shift; | 280 | size_t extent_shift; |
@@ -393,6 +394,7 @@ struct ecryptfs_mount_crypt_stat { | |||
393 | struct ecryptfs_sb_info { | 394 | struct ecryptfs_sb_info { |
394 | struct super_block *wsi_sb; | 395 | struct super_block *wsi_sb; |
395 | struct ecryptfs_mount_crypt_stat mount_crypt_stat; | 396 | struct ecryptfs_mount_crypt_stat mount_crypt_stat; |
397 | struct backing_dev_info bdi; | ||
396 | }; | 398 | }; |
397 | 399 | ||
398 | /* file private data. */ | 400 | /* file private data. */ |
@@ -464,6 +466,14 @@ struct ecryptfs_daemon { | |||
464 | 466 | ||
465 | extern struct mutex ecryptfs_daemon_hash_mux; | 467 | extern struct mutex ecryptfs_daemon_hash_mux; |
466 | 468 | ||
469 | static inline size_t | ||
470 | ecryptfs_lower_header_size(struct ecryptfs_crypt_stat *crypt_stat) | ||
471 | { | ||
472 | if (crypt_stat->flags & ECRYPTFS_METADATA_IN_XATTR) | ||
473 | return 0; | ||
474 | return crypt_stat->metadata_size; | ||
475 | } | ||
476 | |||
467 | static inline struct ecryptfs_file_info * | 477 | static inline struct ecryptfs_file_info * |
468 | ecryptfs_file_to_private(struct file *file) | 478 | ecryptfs_file_to_private(struct file *file) |
469 | { | 479 | { |
@@ -651,6 +661,9 @@ int ecryptfs_decrypt_page(struct page *page); | |||
651 | int ecryptfs_write_metadata(struct dentry *ecryptfs_dentry); | 661 | int ecryptfs_write_metadata(struct dentry *ecryptfs_dentry); |
652 | int ecryptfs_read_metadata(struct dentry *ecryptfs_dentry); | 662 | int ecryptfs_read_metadata(struct dentry *ecryptfs_dentry); |
653 | int ecryptfs_new_file_context(struct dentry *ecryptfs_dentry); | 663 | int ecryptfs_new_file_context(struct dentry *ecryptfs_dentry); |
664 | void ecryptfs_write_crypt_stat_flags(char *page_virt, | ||
665 | struct ecryptfs_crypt_stat *crypt_stat, | ||
666 | size_t *written); | ||
654 | int ecryptfs_read_and_validate_header_region(char *data, | 667 | int ecryptfs_read_and_validate_header_region(char *data, |
655 | struct inode *ecryptfs_inode); | 668 | struct inode *ecryptfs_inode); |
656 | int ecryptfs_read_and_validate_xattr_region(char *page_virt, | 669 | int ecryptfs_read_and_validate_xattr_region(char *page_virt, |