new helper: file_inode(file)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
@@ -110,7 +110,7 @@ static int ext4_readdir(struct file *filp,
|
||||
int i, stored;
|
||||
struct ext4_dir_entry_2 *de;
|
||||
int err;
|
||||
struct inode *inode = filp->f_path.dentry->d_inode;
|
||||
struct inode *inode = file_inode(filp);
|
||||
struct super_block *sb = inode->i_sb;
|
||||
int ret = 0;
|
||||
int dir_has_error = 0;
|
||||
@@ -133,7 +133,7 @@ static int ext4_readdir(struct file *filp,
|
||||
* We don't set the inode dirty flag since it's not
|
||||
* critical that it get flushed back to the disk.
|
||||
*/
|
||||
ext4_clear_inode_flag(filp->f_path.dentry->d_inode,
|
||||
ext4_clear_inode_flag(file_inode(filp),
|
||||
EXT4_INODE_INDEX);
|
||||
}
|
||||
stored = 0;
|
||||
@@ -494,7 +494,7 @@ static int call_filldir(struct file *filp, void *dirent,
|
||||
{
|
||||
struct dir_private_info *info = filp->private_data;
|
||||
loff_t curr_pos;
|
||||
struct inode *inode = filp->f_path.dentry->d_inode;
|
||||
struct inode *inode = file_inode(filp);
|
||||
struct super_block *sb;
|
||||
int error;
|
||||
|
||||
@@ -526,7 +526,7 @@ static int ext4_dx_readdir(struct file *filp,
|
||||
void *dirent, filldir_t filldir)
|
||||
{
|
||||
struct dir_private_info *info = filp->private_data;
|
||||
struct inode *inode = filp->f_path.dentry->d_inode;
|
||||
struct inode *inode = file_inode(filp);
|
||||
struct fname *fname;
|
||||
int ret;
|
||||
|
||||
|
@@ -4386,7 +4386,7 @@ static void ext4_falloc_update_inode(struct inode *inode,
|
||||
*/
|
||||
long ext4_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
|
||||
{
|
||||
struct inode *inode = file->f_path.dentry->d_inode;
|
||||
struct inode *inode = file_inode(file);
|
||||
handle_t *handle;
|
||||
loff_t new_size;
|
||||
unsigned int max_blocks;
|
||||
@@ -4643,7 +4643,7 @@ static int ext4_xattr_fiemap(struct inode *inode,
|
||||
*/
|
||||
int ext4_ext_punch_hole(struct file *file, loff_t offset, loff_t length)
|
||||
{
|
||||
struct inode *inode = file->f_path.dentry->d_inode;
|
||||
struct inode *inode = file_inode(file);
|
||||
struct super_block *sb = inode->i_sb;
|
||||
ext4_lblk_t first_block, stop_block;
|
||||
struct address_space *mapping = inode->i_mapping;
|
||||
|
@@ -167,7 +167,7 @@ static ssize_t
|
||||
ext4_file_write(struct kiocb *iocb, const struct iovec *iov,
|
||||
unsigned long nr_segs, loff_t pos)
|
||||
{
|
||||
struct inode *inode = iocb->ki_filp->f_path.dentry->d_inode;
|
||||
struct inode *inode = file_inode(iocb->ki_filp);
|
||||
ssize_t ret;
|
||||
|
||||
/*
|
||||
|
@@ -1298,7 +1298,7 @@ int ext4_read_inline_dir(struct file *filp,
|
||||
int i, stored;
|
||||
struct ext4_dir_entry_2 *de;
|
||||
struct super_block *sb;
|
||||
struct inode *inode = filp->f_path.dentry->d_inode;
|
||||
struct inode *inode = file_inode(filp);
|
||||
int ret, inline_size = 0;
|
||||
struct ext4_iloc iloc;
|
||||
void *dir_buf = NULL;
|
||||
|
@@ -2959,7 +2959,7 @@ static void ext4_end_io_dio(struct kiocb *iocb, loff_t offset,
|
||||
ssize_t size, void *private, int ret,
|
||||
bool is_async)
|
||||
{
|
||||
struct inode *inode = iocb->ki_filp->f_path.dentry->d_inode;
|
||||
struct inode *inode = file_inode(iocb->ki_filp);
|
||||
ext4_io_end_t *io_end = iocb->private;
|
||||
|
||||
/* if not async direct IO or dio with 0 bytes write, just return */
|
||||
@@ -3553,7 +3553,7 @@ int ext4_can_truncate(struct inode *inode)
|
||||
|
||||
int ext4_punch_hole(struct file *file, loff_t offset, loff_t length)
|
||||
{
|
||||
struct inode *inode = file->f_path.dentry->d_inode;
|
||||
struct inode *inode = file_inode(file);
|
||||
if (!S_ISREG(inode->i_mode))
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
@@ -4926,7 +4926,7 @@ int ext4_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
|
||||
unsigned long len;
|
||||
int ret;
|
||||
struct file *file = vma->vm_file;
|
||||
struct inode *inode = file->f_path.dentry->d_inode;
|
||||
struct inode *inode = file_inode(file);
|
||||
struct address_space *mapping = inode->i_mapping;
|
||||
handle_t *handle;
|
||||
get_block_t *get_block;
|
||||
|
@@ -22,7 +22,7 @@
|
||||
|
||||
long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
struct inode *inode = filp->f_dentry->d_inode;
|
||||
struct inode *inode = file_inode(filp);
|
||||
struct super_block *sb = inode->i_sb;
|
||||
struct ext4_inode_info *ei = EXT4_I(inode);
|
||||
unsigned int flags;
|
||||
|
@@ -900,7 +900,7 @@ move_extent_per_page(struct file *o_filp, struct inode *donor_inode,
|
||||
pgoff_t orig_page_offset, int data_offset_in_page,
|
||||
int block_len_in_page, int uninit, int *err)
|
||||
{
|
||||
struct inode *orig_inode = o_filp->f_dentry->d_inode;
|
||||
struct inode *orig_inode = file_inode(o_filp);
|
||||
struct page *pagep[2] = {NULL, NULL};
|
||||
handle_t *handle;
|
||||
ext4_lblk_t orig_blk_offset;
|
||||
@@ -1279,8 +1279,8 @@ ext4_move_extents(struct file *o_filp, struct file *d_filp,
|
||||
__u64 orig_start, __u64 donor_start, __u64 len,
|
||||
__u64 *moved_len)
|
||||
{
|
||||
struct inode *orig_inode = o_filp->f_dentry->d_inode;
|
||||
struct inode *donor_inode = d_filp->f_dentry->d_inode;
|
||||
struct inode *orig_inode = file_inode(o_filp);
|
||||
struct inode *donor_inode = file_inode(d_filp);
|
||||
struct ext4_ext_path *orig_path = NULL, *holecheck_path = NULL;
|
||||
struct ext4_extent *ext_prev, *ext_cur, *ext_dummy;
|
||||
ext4_lblk_t block_start = orig_start;
|
||||
|
@@ -937,7 +937,7 @@ int ext4_htree_fill_tree(struct file *dir_file, __u32 start_hash,
|
||||
|
||||
dxtrace(printk(KERN_DEBUG "In htree_fill_tree, start hash: %x:%x\n",
|
||||
start_hash, start_minor_hash));
|
||||
dir = dir_file->f_path.dentry->d_inode;
|
||||
dir = file_inode(dir_file);
|
||||
if (!(ext4_test_inode_flag(dir, EXT4_INODE_INDEX))) {
|
||||
hinfo.hash_version = EXT4_SB(dir->i_sb)->s_def_hash_version;
|
||||
if (hinfo.hash_version <= DX_HASH_TEA)
|
||||
|
@@ -553,7 +553,7 @@ void ext4_error_file(struct file *file, const char *function,
|
||||
va_list args;
|
||||
struct va_format vaf;
|
||||
struct ext4_super_block *es;
|
||||
struct inode *inode = file->f_dentry->d_inode;
|
||||
struct inode *inode = file_inode(file);
|
||||
char pathname[80], *path;
|
||||
|
||||
es = EXT4_SB(inode->i_sb)->s_es;
|
||||
|
Reference in New Issue
Block a user