Commit f6973c09 authored by Yan, Zheng's avatar Yan, Zheng Committed by Ilya Dryomov

ceph: use i_version to check validity of fscache

Signed-off-by: default avatarYan, Zheng <zyan@redhat.com>
parent f7f7e7a0
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include "cache.h" #include "cache.h"
struct ceph_aux_inode { struct ceph_aux_inode {
u64 version;
struct timespec mtime; struct timespec mtime;
loff_t size; loff_t size;
}; };
...@@ -98,6 +99,7 @@ static uint16_t ceph_fscache_inode_get_aux(const void *cookie_netfs_data, ...@@ -98,6 +99,7 @@ static uint16_t ceph_fscache_inode_get_aux(const void *cookie_netfs_data,
const struct inode* inode = &ci->vfs_inode; const struct inode* inode = &ci->vfs_inode;
memset(&aux, 0, sizeof(aux)); memset(&aux, 0, sizeof(aux));
aux.version = ci->i_version;
aux.mtime = inode->i_mtime; aux.mtime = inode->i_mtime;
aux.size = i_size_read(inode); aux.size = i_size_read(inode);
...@@ -124,6 +126,7 @@ static enum fscache_checkaux ceph_fscache_inode_check_aux( ...@@ -124,6 +126,7 @@ static enum fscache_checkaux ceph_fscache_inode_check_aux(
return FSCACHE_CHECKAUX_OBSOLETE; return FSCACHE_CHECKAUX_OBSOLETE;
memset(&aux, 0, sizeof(aux)); memset(&aux, 0, sizeof(aux));
aux.version = ci->i_version;
aux.mtime = inode->i_mtime; aux.mtime = inode->i_mtime;
aux.size = i_size_read(inode); aux.size = i_size_read(inode);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment