diff options
Diffstat (limited to 'fs/ext4/ext4.h')
-rw-r--r-- | fs/ext4/ext4.h | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index c04743519865..349afebe21ee 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h | |||
@@ -912,6 +912,29 @@ do { \ | |||
912 | #include "extents_status.h" | 912 | #include "extents_status.h" |
913 | 913 | ||
914 | /* | 914 | /* |
915 | * Lock subclasses for i_data_sem in the ext4_inode_info structure. | ||
916 | * | ||
917 | * These are needed to avoid lockdep false positives when we need to | ||
918 | * allocate blocks to the quota inode during ext4_map_blocks(), while | ||
919 | * holding i_data_sem for a normal (non-quota) inode. Since we don't | ||
920 | * do quota tracking for the quota inode, this avoids deadlock (as | ||
921 | * well as infinite recursion, since it isn't turtles all the way | ||
922 | * down...) | ||
923 | * | ||
924 | * I_DATA_SEM_NORMAL - Used for most inodes | ||
925 | * I_DATA_SEM_OTHER - Used by move_inode.c for the second normal inode | ||
926 | * where the second inode has larger inode number | ||
927 | * than the first | ||
928 | * I_DATA_SEM_QUOTA - Used for quota inodes only | ||
929 | */ | ||
930 | enum { | ||
931 | I_DATA_SEM_NORMAL = 0, | ||
932 | I_DATA_SEM_OTHER, | ||
933 | I_DATA_SEM_QUOTA, | ||
934 | }; | ||
935 | |||
936 | |||
937 | /* | ||
915 | * fourth extended file system inode data in memory | 938 | * fourth extended file system inode data in memory |
916 | */ | 939 | */ |
917 | struct ext4_inode_info { | 940 | struct ext4_inode_info { |
@@ -1961,7 +1984,7 @@ ext4_rec_len_from_disk(__le16 dlen, unsigned blocksize) | |||
1961 | { | 1984 | { |
1962 | unsigned len = le16_to_cpu(dlen); | 1985 | unsigned len = le16_to_cpu(dlen); |
1963 | 1986 | ||
1964 | #if (PAGE_CACHE_SIZE >= 65536) | 1987 | #if (PAGE_SIZE >= 65536) |
1965 | if (len == EXT4_MAX_REC_LEN || len == 0) | 1988 | if (len == EXT4_MAX_REC_LEN || len == 0) |
1966 | return blocksize; | 1989 | return blocksize; |
1967 | return (len & 65532) | ((len & 3) << 16); | 1990 | return (len & 65532) | ((len & 3) << 16); |
@@ -1974,7 +1997,7 @@ static inline __le16 ext4_rec_len_to_disk(unsigned len, unsigned blocksize) | |||
1974 | { | 1997 | { |
1975 | if ((len > blocksize) || (blocksize > (1 << 18)) || (len & 3)) | 1998 | if ((len > blocksize) || (blocksize > (1 << 18)) || (len & 3)) |
1976 | BUG(); | 1999 | BUG(); |
1977 | #if (PAGE_CACHE_SIZE >= 65536) | 2000 | #if (PAGE_SIZE >= 65536) |
1978 | if (len < 65536) | 2001 | if (len < 65536) |
1979 | return cpu_to_le16(len); | 2002 | return cpu_to_le16(len); |
1980 | if (len == blocksize) { | 2003 | if (len == blocksize) { |
@@ -2282,11 +2305,13 @@ extern struct kmem_cache *ext4_crypt_info_cachep; | |||
2282 | bool ext4_valid_contents_enc_mode(uint32_t mode); | 2305 | bool ext4_valid_contents_enc_mode(uint32_t mode); |
2283 | uint32_t ext4_validate_encryption_key_size(uint32_t mode, uint32_t size); | 2306 | uint32_t ext4_validate_encryption_key_size(uint32_t mode, uint32_t size); |
2284 | extern struct workqueue_struct *ext4_read_workqueue; | 2307 | extern struct workqueue_struct *ext4_read_workqueue; |
2285 | struct ext4_crypto_ctx *ext4_get_crypto_ctx(struct inode *inode); | 2308 | struct ext4_crypto_ctx *ext4_get_crypto_ctx(struct inode *inode, |
2309 | gfp_t gfp_flags); | ||
2286 | void ext4_release_crypto_ctx(struct ext4_crypto_ctx *ctx); | 2310 | void ext4_release_crypto_ctx(struct ext4_crypto_ctx *ctx); |
2287 | void ext4_restore_control_page(struct page *data_page); | 2311 | void ext4_restore_control_page(struct page *data_page); |
2288 | struct page *ext4_encrypt(struct inode *inode, | 2312 | struct page *ext4_encrypt(struct inode *inode, |
2289 | struct page *plaintext_page); | 2313 | struct page *plaintext_page, |
2314 | gfp_t gfp_flags); | ||
2290 | int ext4_decrypt(struct page *page); | 2315 | int ext4_decrypt(struct page *page); |
2291 | int ext4_encrypted_zeroout(struct inode *inode, ext4_lblk_t lblk, | 2316 | int ext4_encrypted_zeroout(struct inode *inode, ext4_lblk_t lblk, |
2292 | ext4_fsblk_t pblk, ext4_lblk_t len); | 2317 | ext4_fsblk_t pblk, ext4_lblk_t len); |