diff options
author | Jeff Layton <jlayton@poochiereds.net> | 2014-04-30 09:31:46 -0400 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2014-05-21 10:18:05 -0700 |
commit | e284e53fdea1dfd66e73c239fa190685985ae465 (patch) | |
tree | bdfe89d7e8b5ca29bba0abf5f3ec5ba4618df779 /fs/cifs/inode.c | |
parent | aff8d5ca7a3dca0bd6f6e86c9a85bf04941262ce (diff) |
cifs: new helper function: cifs_revalidate_mapping
Consolidate a bit of code. In a later patch we'll expand this to fix
some races.
Signed-off-by: Jeff Layton <jlayton@poochiereds.net>
Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/inode.c')
-rw-r--r-- | fs/cifs/inode.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index fa9ef8d902b5..ff420b275777 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c @@ -1779,6 +1779,14 @@ cifs_invalidate_mapping(struct inode *inode) return rc; } +int +cifs_revalidate_mapping(struct inode *inode) +{ + if (test_bit(CIFS_INO_INVALID_MAPPING, &CIFS_I(inode)->flags)) + return cifs_invalidate_mapping(inode); + return 0; +} + int cifs_revalidate_file_attr(struct file *filp) { int rc = 0; @@ -1845,9 +1853,7 @@ int cifs_revalidate_file(struct file *filp) if (rc) return rc; - if (test_bit(CIFS_INO_INVALID_MAPPING, &CIFS_I(inode)->flags)) - rc = cifs_invalidate_mapping(inode); - return rc; + return cifs_revalidate_mapping(inode); } /* revalidate a dentry's inode attributes */ @@ -1860,9 +1866,7 @@ int cifs_revalidate_dentry(struct dentry *dentry) if (rc) return rc; - if (test_bit(CIFS_INO_INVALID_MAPPING, &CIFS_I(inode)->flags)) - rc = cifs_invalidate_mapping(inode); - return rc; + return cifs_revalidate_mapping(inode); } int cifs_getattr(struct vfsmount *mnt, struct dentry *dentry, |