diff mbox series

[8/9] cifs: pass the dentry instead of the inode down to the revalidation check functions

Message ID 20210308230735.337-9-lsahlber@redhat.com (mailing list archive)
State New, archived
Headers show
Series [1/9] cifs: move the check for nohandlecache into open_shroot | expand

Commit Message

Ronnie Sahlberg March 8, 2021, 11:07 p.m. UTC
Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
---
 fs/cifs/inode.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index 0b0b01ef3ecb..98dc6d70d4fa 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -2184,8 +2184,9 @@  cifs_rename2(struct inode *source_dir, struct dentry *source_dentry,
 }
 
 static bool
-cifs_inode_needs_reval(struct inode *inode)
+cifs_dentry_needs_reval(struct dentry *dentry)
 {
+	struct inode *inode = d_inode(dentry);
 	struct cifsInodeInfo *cifs_i = CIFS_I(inode);
 	struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
 
@@ -2296,10 +2297,10 @@  cifs_zap_mapping(struct inode *inode)
 int cifs_revalidate_file_attr(struct file *filp)
 {
 	int rc = 0;
-	struct inode *inode = file_inode(filp);
+	struct dentry *dentry = file_dentry(filp);
 	struct cifsFileInfo *cfile = (struct cifsFileInfo *) filp->private_data;
 
-	if (!cifs_inode_needs_reval(inode))
+	if (!cifs_dentry_needs_reval(dentry))
 		return rc;
 
 	if (tlink_tcon(cfile->tlink)->unix_ext)
@@ -2322,7 +2323,7 @@  int cifs_revalidate_dentry_attr(struct dentry *dentry)
 	if (inode == NULL)
 		return -ENOENT;
 
-	if (!cifs_inode_needs_reval(inode))
+	if (!cifs_dentry_needs_reval(dentry))
 		return rc;
 
 	xid = get_xid();