Skip to content

Commit

Permalink
ecryptfs: drop direct calls to ->bmap
Browse files Browse the repository at this point in the history
Replace direct ->bmap calls by bmap() method.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Carlos Maiolino authored and Al Viro committed Feb 3, 2020
1 parent 10d83e1 commit 569d205
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions fs/ecryptfs/mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -524,16 +524,12 @@ static int ecryptfs_write_end(struct file *file,

static sector_t ecryptfs_bmap(struct address_space *mapping, sector_t block)
{
int rc = 0;
struct inode *inode;
struct inode *lower_inode;

inode = (struct inode *)mapping->host;
lower_inode = ecryptfs_inode_to_lower(inode);
if (lower_inode->i_mapping->a_ops->bmap)
rc = lower_inode->i_mapping->a_ops->bmap(lower_inode->i_mapping,
block);
return rc;
struct inode *lower_inode = ecryptfs_inode_to_lower(mapping->host);
int ret = bmap(lower_inode, &block);

if (ret)
return 0;
return block;
}

const struct address_space_operations ecryptfs_aops = {
Expand Down

0 comments on commit 569d205

Please sign in to comment.