1 /* Copyright (c) 2016, The Linux Foundation. All rights reserved.
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
16 #include <linux/types.h>
18 #include <linux/bio.h>
22 /* dm-req-crypt API */
23 int pft_get_key_index(struct bio *bio, u32 *key_index,
24 bool *is_encrypted, bool *is_inplace);
27 bool pft_allow_merge_bio(struct bio *bio1, struct bio *bio2);
29 /* --- security hooks , called from selinux --- */
30 int pft_inode_create(struct inode *dir, struct dentry *dentry, umode_t mode);
32 int pft_inode_post_create(struct inode *dir, struct dentry *dentry,
35 int pft_file_open(struct file *filp, const struct cred *cred);
37 int pft_file_permission(struct file *file, int mask);
39 int pft_file_close(struct file *filp);
41 int pft_inode_unlink(struct inode *dir, struct dentry *dentry);
43 int pft_inode_mknod(struct inode *dir, struct dentry *dentry, umode_t mode,
46 int pft_inode_rename(struct inode *inode, struct dentry *dentry,
47 struct inode *new_inode, struct dentry *new_dentry);
49 int pft_inode_set_xattr(struct dentry *dentry, const char *name,
50 const void *value, size_t size, int flags);
54 static inline int pft_get_key_index(struct bio *bio, u32 *key_index,
55 bool *is_encrypted, bool *is_inplace)
58 static inline bool pft_allow_merge_bio(const struct bio *bio1,
59 const struct bio *bio2)
62 static inline int pft_file_permission(struct file *file, int mask)
65 static inline int pft_inode_create(
66 struct inode *dir, struct dentry *dentry, umode_t mode)
69 static inline int pft_inode_post_create(
70 struct inode *dir, struct dentry *dentry, umode_t mode)
73 static inline int pft_file_open(struct file *filp, const struct cred *cred)
76 static inline int pft_file_close(struct file *filp)
79 static inline int pft_inode_unlink(struct inode *dir, struct dentry *dentry)
82 static inline int pft_inode_mknod(struct inode *dir, struct dentry *dentry,
83 umode_t mode, dev_t dev)
86 static inline int pft_inode_rename(struct inode *inode, struct dentry *dentry,
87 struct inode *new_inode, struct dentry *new_dentry)
90 static inline int pft_inode_set_xattr(struct dentry *dentry, const char *name,
91 const void *value, size_t size,
95 #endif /* CONFIG_PFT */