Skip to content

Commit

Permalink
ceph: use i_version to check validity of fscache
Browse files Browse the repository at this point in the history
Signed-off-by: Yan, Zheng <zyan@redhat.com>
  • Loading branch information
Yan, Zheng authored and Ilya Dryomov committed Jun 1, 2016
1 parent f7f7e7a commit f6973c0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fs/ceph/cache.c
Original file line number Diff line number Diff line change
@@ -25,6 +25,7 @@
#include "cache.h"

struct ceph_aux_inode {
u64 version;
struct timespec mtime;
loff_t size;
};
@@ -98,6 +99,7 @@ static uint16_t ceph_fscache_inode_get_aux(const void *cookie_netfs_data,
const struct inode* inode = &ci->vfs_inode;

memset(&aux, 0, sizeof(aux));
aux.version = ci->i_version;
aux.mtime = inode->i_mtime;
aux.size = i_size_read(inode);

@@ -124,6 +126,7 @@ static enum fscache_checkaux ceph_fscache_inode_check_aux(
return FSCACHE_CHECKAUX_OBSOLETE;

memset(&aux, 0, sizeof(aux));
aux.version = ci->i_version;
aux.mtime = inode->i_mtime;
aux.size = i_size_read(inode);

0 comments on commit f6973c0

Please sign in to comment.