mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-06 06:21:31 +00:00
orangefs: user file_inode() where it is due
Replace wrong use of file->f_path.dentry->d_inode with file_inode(file). In case orangefs ever finds itself as an overelayfs layer, it would want to get its own inode and not overlayfs's inode. DISCLAIMER: I did not test this patch because I do not know how to setup an orangefs mount Signed-off-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
This commit is contained in:
parent
1001354ca3
commit
d62a9025ae
1 changed files with 7 additions and 7 deletions
|
@ -621,9 +621,9 @@ static int orangefs_file_release(struct inode *inode, struct file *file)
|
||||||
* readahead cache (if any); this forces an expensive refresh of
|
* readahead cache (if any); this forces an expensive refresh of
|
||||||
* data for the next caller of mmap (or 'get_block' accesses)
|
* data for the next caller of mmap (or 'get_block' accesses)
|
||||||
*/
|
*/
|
||||||
if (file->f_path.dentry->d_inode &&
|
if (file_inode(file) &&
|
||||||
file->f_path.dentry->d_inode->i_mapping &&
|
file_inode(file)->i_mapping &&
|
||||||
mapping_nrpages(&file->f_path.dentry->d_inode->i_data)) {
|
mapping_nrpages(&file_inode(file)->i_data)) {
|
||||||
if (orangefs_features & ORANGEFS_FEATURE_READAHEAD) {
|
if (orangefs_features & ORANGEFS_FEATURE_READAHEAD) {
|
||||||
gossip_debug(GOSSIP_INODE_DEBUG,
|
gossip_debug(GOSSIP_INODE_DEBUG,
|
||||||
"calling flush_racache on %pU\n",
|
"calling flush_racache on %pU\n",
|
||||||
|
@ -632,7 +632,7 @@ static int orangefs_file_release(struct inode *inode, struct file *file)
|
||||||
gossip_debug(GOSSIP_INODE_DEBUG,
|
gossip_debug(GOSSIP_INODE_DEBUG,
|
||||||
"flush_racache finished\n");
|
"flush_racache finished\n");
|
||||||
}
|
}
|
||||||
truncate_inode_pages(file->f_path.dentry->d_inode->i_mapping,
|
truncate_inode_pages(file_inode(file)->i_mapping,
|
||||||
0);
|
0);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -648,7 +648,7 @@ static int orangefs_fsync(struct file *file,
|
||||||
{
|
{
|
||||||
int ret = -EINVAL;
|
int ret = -EINVAL;
|
||||||
struct orangefs_inode_s *orangefs_inode =
|
struct orangefs_inode_s *orangefs_inode =
|
||||||
ORANGEFS_I(file->f_path.dentry->d_inode);
|
ORANGEFS_I(file_inode(file));
|
||||||
struct orangefs_kernel_op_s *new_op = NULL;
|
struct orangefs_kernel_op_s *new_op = NULL;
|
||||||
|
|
||||||
/* required call */
|
/* required call */
|
||||||
|
@ -661,7 +661,7 @@ static int orangefs_fsync(struct file *file,
|
||||||
|
|
||||||
ret = service_operation(new_op,
|
ret = service_operation(new_op,
|
||||||
"orangefs_fsync",
|
"orangefs_fsync",
|
||||||
get_interruptible_flag(file->f_path.dentry->d_inode));
|
get_interruptible_flag(file_inode(file)));
|
||||||
|
|
||||||
gossip_debug(GOSSIP_FILE_DEBUG,
|
gossip_debug(GOSSIP_FILE_DEBUG,
|
||||||
"orangefs_fsync got return value of %d\n",
|
"orangefs_fsync got return value of %d\n",
|
||||||
|
@ -669,7 +669,7 @@ static int orangefs_fsync(struct file *file,
|
||||||
|
|
||||||
op_release(new_op);
|
op_release(new_op);
|
||||||
|
|
||||||
orangefs_flush_inode(file->f_path.dentry->d_inode);
|
orangefs_flush_inode(file_inode(file));
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue