Commit 7c712458 authored by David Howells's avatar David Howells

afs: Don't save callback version and type fields

Don't save callback version and type fields as the version is about the
format of the callback information and the type is relative to the
particular RPC call.
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
parent a58823ac
...@@ -72,8 +72,8 @@ typedef enum { ...@@ -72,8 +72,8 @@ typedef enum {
struct afs_callback { struct afs_callback {
time64_t expires_at; /* Time at which expires */ time64_t expires_at; /* Time at which expires */
unsigned version; /* Callback version */ //unsigned version; /* Callback version */
afs_callback_type_t type; /* Type of callback */ //afs_callback_type_t type; /* Type of callback */
}; };
struct afs_callback_break { struct afs_callback_break {
......
...@@ -148,9 +148,9 @@ static void xdr_decode_AFSCallBack(const __be32 **_bp, ...@@ -148,9 +148,9 @@ static void xdr_decode_AFSCallBack(const __be32 **_bp,
struct afs_callback *cb = &scb->callback; struct afs_callback *cb = &scb->callback;
const __be32 *bp = *_bp; const __be32 *bp = *_bp;
cb->version = ntohl(*bp++); bp++; /* version */
cb->expires_at = xdr_decode_expiry(call, ntohl(*bp++)); cb->expires_at = xdr_decode_expiry(call, ntohl(*bp++));
cb->type = ntohl(*bp++); bp++; /* type */
scb->have_cb = true; scb->have_cb = true;
*_bp = bp; *_bp = bp;
} }
......
...@@ -136,12 +136,8 @@ static int afs_inode_init_from_status(struct afs_vnode *vnode, struct key *key, ...@@ -136,12 +136,8 @@ static int afs_inode_init_from_status(struct afs_vnode *vnode, struct key *key,
if (!scb->have_cb) { if (!scb->have_cb) {
/* it's a symlink we just created (the fileserver /* it's a symlink we just created (the fileserver
* didn't give us a callback) */ * didn't give us a callback) */
vnode->cb_version = 0;
vnode->cb_type = 0;
vnode->cb_expires_at = ktime_get_real_seconds(); vnode->cb_expires_at = ktime_get_real_seconds();
} else { } else {
vnode->cb_version = scb->callback.version;
vnode->cb_type = scb->callback.type;
vnode->cb_expires_at = scb->callback.expires_at; vnode->cb_expires_at = scb->callback.expires_at;
old_cbi = vnode->cb_interest; old_cbi = vnode->cb_interest;
if (cbi != old_cbi) if (cbi != old_cbi)
...@@ -248,8 +244,6 @@ static void afs_apply_callback(struct afs_fs_cursor *fc, ...@@ -248,8 +244,6 @@ static void afs_apply_callback(struct afs_fs_cursor *fc,
struct afs_callback *cb = &scb->callback; struct afs_callback *cb = &scb->callback;
if (!afs_cb_is_broken(cb_break, vnode, fc->cbi)) { if (!afs_cb_is_broken(cb_break, vnode, fc->cbi)) {
vnode->cb_version = cb->version;
vnode->cb_type = cb->type;
vnode->cb_expires_at = cb->expires_at; vnode->cb_expires_at = cb->expires_at;
old = vnode->cb_interest; old = vnode->cb_interest;
if (old != fc->cbi) { if (old != fc->cbi) {
...@@ -535,7 +529,7 @@ struct inode *afs_iget(struct super_block *sb, struct key *key, ...@@ -535,7 +529,7 @@ struct inode *afs_iget(struct super_block *sb, struct key *key,
clear_bit(AFS_VNODE_UNSET, &vnode->flags); clear_bit(AFS_VNODE_UNSET, &vnode->flags);
inode->i_flags |= S_NOATIME; inode->i_flags |= S_NOATIME;
unlock_new_inode(inode); unlock_new_inode(inode);
_leave(" = %p [CB { v=%u t=%u }]", inode, vnode->cb_version, vnode->cb_type); _leave(" = %p", inode);
return inode; return inode;
/* failure */ /* failure */
......
...@@ -683,8 +683,6 @@ struct afs_vnode { ...@@ -683,8 +683,6 @@ struct afs_vnode {
seqlock_t cb_lock; /* Lock for ->cb_interest, ->status, ->cb_*break */ seqlock_t cb_lock; /* Lock for ->cb_interest, ->status, ->cb_*break */
time64_t cb_expires_at; /* time at which callback expires */ time64_t cb_expires_at; /* time at which callback expires */
unsigned cb_version; /* callback version */
afs_callback_type_t cb_type; /* type of callback */
}; };
static inline struct fscache_cookie *afs_vnode_cache(struct afs_vnode *vnode) static inline struct fscache_cookie *afs_vnode_cache(struct afs_vnode *vnode)
......
...@@ -683,7 +683,6 @@ static struct inode *afs_alloc_inode(struct super_block *sb) ...@@ -683,7 +683,6 @@ static struct inode *afs_alloc_inode(struct super_block *sb)
#endif #endif
vnode->flags = 1 << AFS_VNODE_UNSET; vnode->flags = 1 << AFS_VNODE_UNSET;
vnode->cb_type = 0;
vnode->lock_state = AFS_VNODE_LOCK_NONE; vnode->lock_state = AFS_VNODE_LOCK_NONE;
init_rwsem(&vnode->rmdir_lock); init_rwsem(&vnode->rmdir_lock);
......
...@@ -245,8 +245,6 @@ static void xdr_decode_YFSCallBack(const __be32 **_bp, ...@@ -245,8 +245,6 @@ static void xdr_decode_YFSCallBack(const __be32 **_bp,
cb_expiry = call->reply_time; cb_expiry = call->reply_time;
cb_expiry = ktime_add(cb_expiry, xdr_to_u64(x->expiration_time) * 100); cb_expiry = ktime_add(cb_expiry, xdr_to_u64(x->expiration_time) * 100);
cb->expires_at = ktime_divns(cb_expiry, NSEC_PER_SEC); cb->expires_at = ktime_divns(cb_expiry, NSEC_PER_SEC);
cb->version = ntohl(x->version);
cb->type = ntohl(x->type);
scb->have_cb = true; scb->have_cb = true;
*_bp += xdr_size(x); *_bp += xdr_size(x);
} }
......
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