new helper: file_inode(file)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
@@ -140,12 +140,12 @@ int ima_must_measure(struct inode *inode, int mask, int function)
|
||||
int ima_collect_measurement(struct integrity_iint_cache *iint,
|
||||
struct file *file)
|
||||
{
|
||||
struct inode *inode = file->f_dentry->d_inode;
|
||||
struct inode *inode = file_inode(file);
|
||||
const char *filename = file->f_dentry->d_name.name;
|
||||
int result = 0;
|
||||
|
||||
if (!(iint->flags & IMA_COLLECTED)) {
|
||||
u64 i_version = file->f_dentry->d_inode->i_version;
|
||||
u64 i_version = file_inode(file)->i_version;
|
||||
|
||||
iint->ima_xattr.type = IMA_XATTR_DIGEST;
|
||||
result = ima_calc_hash(file, iint->ima_xattr.digest);
|
||||
@@ -182,7 +182,7 @@ void ima_store_measurement(struct integrity_iint_cache *iint,
|
||||
const char *op = "add_template_measure";
|
||||
const char *audit_cause = "ENOMEM";
|
||||
int result = -ENOMEM;
|
||||
struct inode *inode = file->f_dentry->d_inode;
|
||||
struct inode *inode = file_inode(file);
|
||||
struct ima_template_entry *entry;
|
||||
int violation = 0;
|
||||
|
||||
|
@@ -63,7 +63,7 @@ int ima_calc_hash(struct file *file, char *digest)
|
||||
file->f_mode |= FMODE_READ;
|
||||
read = 1;
|
||||
}
|
||||
i_size = i_size_read(file->f_dentry->d_inode);
|
||||
i_size = i_size_read(file_inode(file));
|
||||
while (offset < i_size) {
|
||||
int rbuf_len;
|
||||
|
||||
|
@@ -132,7 +132,7 @@ static void ima_check_last_writer(struct integrity_iint_cache *iint,
|
||||
*/
|
||||
void ima_file_free(struct file *file)
|
||||
{
|
||||
struct inode *inode = file->f_dentry->d_inode;
|
||||
struct inode *inode = file_inode(file);
|
||||
struct integrity_iint_cache *iint;
|
||||
|
||||
if (!iint_initialized || !S_ISREG(inode->i_mode))
|
||||
@@ -148,7 +148,7 @@ void ima_file_free(struct file *file)
|
||||
static int process_measurement(struct file *file, const unsigned char *filename,
|
||||
int mask, int function)
|
||||
{
|
||||
struct inode *inode = file->f_dentry->d_inode;
|
||||
struct inode *inode = file_inode(file);
|
||||
struct integrity_iint_cache *iint;
|
||||
unsigned char *pathname = NULL, *pathbuf = NULL;
|
||||
int rc = -ENOMEM, action, must_appraise;
|
||||
|
Reference in New Issue
Block a user