f2fs.h (381722d2ac0314f65fd98db9a0eb8bdd1d984925) f2fs.h (26bf3dc7e25b813ff5c92234f8165941fdc12a63)
1/*
2 * fs/f2fs/f2fs.h
3 *
4 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 * http://www.samsung.com/
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as

--- 2002 unchanged lines hidden (view full) ---

2011struct f2fs_crypto_ctx *f2fs_get_crypto_ctx(struct inode *);
2012void f2fs_release_crypto_ctx(struct f2fs_crypto_ctx *);
2013struct page *f2fs_encrypt(struct inode *, struct page *);
2014int f2fs_decrypt(struct f2fs_crypto_ctx *, struct page *);
2015int f2fs_decrypt_one(struct inode *, struct page *);
2016void f2fs_end_io_crypto_work(struct f2fs_crypto_ctx *, struct bio *);
2017
2018/* crypto_key.c */
1/*
2 * fs/f2fs/f2fs.h
3 *
4 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 * http://www.samsung.com/
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as

--- 2002 unchanged lines hidden (view full) ---

2011struct f2fs_crypto_ctx *f2fs_get_crypto_ctx(struct inode *);
2012void f2fs_release_crypto_ctx(struct f2fs_crypto_ctx *);
2013struct page *f2fs_encrypt(struct inode *, struct page *);
2014int f2fs_decrypt(struct f2fs_crypto_ctx *, struct page *);
2015int f2fs_decrypt_one(struct inode *, struct page *);
2016void f2fs_end_io_crypto_work(struct f2fs_crypto_ctx *, struct bio *);
2017
2018/* crypto_key.c */
2019void f2fs_free_encryption_info(struct inode *);
2019void f2fs_free_encryption_info(struct inode *, struct f2fs_crypt_info *);
2020int _f2fs_get_encryption_info(struct inode *inode);
2021
2022/* crypto_fname.c */
2023bool f2fs_valid_filenames_enc_mode(uint32_t);
2024u32 f2fs_fname_crypto_round_up(u32, u32);
2025int f2fs_fname_crypto_alloc_buffer(struct inode *, u32, struct f2fs_str *);
2026int f2fs_fname_disk_to_usr(struct inode *, f2fs_hash_t *,
2027 const struct f2fs_str *, struct f2fs_str *);

--- 18 unchanged lines hidden (view full) ---

2046 (ci->ci_keyring_key &&
2047 (ci->ci_keyring_key->flags & ((1 << KEY_FLAG_INVALIDATED) |
2048 (1 << KEY_FLAG_REVOKED) |
2049 (1 << KEY_FLAG_DEAD)))))
2050 return _f2fs_get_encryption_info(inode);
2051 return 0;
2052}
2053
2020int _f2fs_get_encryption_info(struct inode *inode);
2021
2022/* crypto_fname.c */
2023bool f2fs_valid_filenames_enc_mode(uint32_t);
2024u32 f2fs_fname_crypto_round_up(u32, u32);
2025int f2fs_fname_crypto_alloc_buffer(struct inode *, u32, struct f2fs_str *);
2026int f2fs_fname_disk_to_usr(struct inode *, f2fs_hash_t *,
2027 const struct f2fs_str *, struct f2fs_str *);

--- 18 unchanged lines hidden (view full) ---

2046 (ci->ci_keyring_key &&
2047 (ci->ci_keyring_key->flags & ((1 << KEY_FLAG_INVALIDATED) |
2048 (1 << KEY_FLAG_REVOKED) |
2049 (1 << KEY_FLAG_DEAD)))))
2050 return _f2fs_get_encryption_info(inode);
2051 return 0;
2052}
2053
2054int f2fs_setup_fname_crypto(struct inode *);
2055void f2fs_fname_crypto_free_buffer(struct f2fs_str *);
2056int f2fs_fname_setup_filename(struct inode *, const struct qstr *,
2057 int lookup, struct f2fs_filename *);
2058void f2fs_fname_free_filename(struct f2fs_filename *);
2059#else
2060static inline void f2fs_restore_and_release_control_page(struct page **p) { }
2061static inline void f2fs_restore_control_page(struct page *p) { }
2062
2063static inline int __init f2fs_init_crypto(void) { return 0; }
2064static inline void f2fs_exit_crypto(void) { }
2065
2066static inline int f2fs_has_encryption_key(struct inode *i) { return 0; }
2067static inline int f2fs_get_encryption_info(struct inode *i) { return 0; }
2054void f2fs_fname_crypto_free_buffer(struct f2fs_str *);
2055int f2fs_fname_setup_filename(struct inode *, const struct qstr *,
2056 int lookup, struct f2fs_filename *);
2057void f2fs_fname_free_filename(struct f2fs_filename *);
2058#else
2059static inline void f2fs_restore_and_release_control_page(struct page **p) { }
2060static inline void f2fs_restore_control_page(struct page *p) { }
2061
2062static inline int __init f2fs_init_crypto(void) { return 0; }
2063static inline void f2fs_exit_crypto(void) { }
2064
2065static inline int f2fs_has_encryption_key(struct inode *i) { return 0; }
2066static inline int f2fs_get_encryption_info(struct inode *i) { return 0; }
2068
2069static inline int f2fs_setup_fname_crypto(struct inode *i) { return 0; }
2070static inline void f2fs_fname_crypto_free_buffer(struct f2fs_str *p) { }
2071
2072static inline int f2fs_fname_setup_filename(struct inode *dir,
2073 const struct qstr *iname,
2074 int lookup, struct f2fs_filename *fname)
2075{
2076 memset(fname, 0, sizeof(struct f2fs_filename));
2077 fname->usr_fname = iname;
2078 fname->disk_name.name = (unsigned char *)iname->name;
2079 fname->disk_name.len = iname->len;
2080 return 0;
2081}
2082
2083static inline void f2fs_fname_free_filename(struct f2fs_filename *fname) { }
2084#endif
2085#endif
2067static inline void f2fs_fname_crypto_free_buffer(struct f2fs_str *p) { }
2068
2069static inline int f2fs_fname_setup_filename(struct inode *dir,
2070 const struct qstr *iname,
2071 int lookup, struct f2fs_filename *fname)
2072{
2073 memset(fname, 0, sizeof(struct f2fs_filename));
2074 fname->usr_fname = iname;
2075 fname->disk_name.name = (unsigned char *)iname->name;
2076 fname->disk_name.len = iname->len;
2077 return 0;
2078}
2079
2080static inline void f2fs_fname_free_filename(struct f2fs_filename *fname) { }
2081#endif
2082#endif