afs: Introduce an afs_get_read() refcount helper
Introduce an afs_get_read() helper to get a reference on an afs_read object. Signed-off-by: David Howells <dhowells@redhat.com>
This commit is contained in:
parent
0b9c0174d6
commit
d4438a2529
@ -490,7 +490,7 @@ static int afs_fs_fetch_data64(struct afs_fs_cursor *fc,
|
|||||||
call->key = fc->key;
|
call->key = fc->key;
|
||||||
call->out_scb = scb;
|
call->out_scb = scb;
|
||||||
call->out_volsync = NULL;
|
call->out_volsync = NULL;
|
||||||
call->read_request = req;
|
call->read_request = afs_get_read(req);
|
||||||
|
|
||||||
/* marshall the parameters */
|
/* marshall the parameters */
|
||||||
bp = call->request;
|
bp = call->request;
|
||||||
@ -503,7 +503,6 @@ static int afs_fs_fetch_data64(struct afs_fs_cursor *fc,
|
|||||||
bp[6] = 0;
|
bp[6] = 0;
|
||||||
bp[7] = htonl(lower_32_bits(req->len));
|
bp[7] = htonl(lower_32_bits(req->len));
|
||||||
|
|
||||||
refcount_inc(&req->usage);
|
|
||||||
afs_use_fs_server(call, fc->cbi);
|
afs_use_fs_server(call, fc->cbi);
|
||||||
trace_afs_make_fs_call(call, &vnode->fid);
|
trace_afs_make_fs_call(call, &vnode->fid);
|
||||||
afs_set_fc_call(call, fc);
|
afs_set_fc_call(call, fc);
|
||||||
@ -540,7 +539,7 @@ int afs_fs_fetch_data(struct afs_fs_cursor *fc,
|
|||||||
call->key = fc->key;
|
call->key = fc->key;
|
||||||
call->out_scb = scb;
|
call->out_scb = scb;
|
||||||
call->out_volsync = NULL;
|
call->out_volsync = NULL;
|
||||||
call->read_request = req;
|
call->read_request = afs_get_read(req);
|
||||||
|
|
||||||
/* marshall the parameters */
|
/* marshall the parameters */
|
||||||
bp = call->request;
|
bp = call->request;
|
||||||
@ -551,7 +550,6 @@ int afs_fs_fetch_data(struct afs_fs_cursor *fc,
|
|||||||
bp[4] = htonl(lower_32_bits(req->pos));
|
bp[4] = htonl(lower_32_bits(req->pos));
|
||||||
bp[5] = htonl(lower_32_bits(req->len));
|
bp[5] = htonl(lower_32_bits(req->len));
|
||||||
|
|
||||||
refcount_inc(&req->usage);
|
|
||||||
afs_use_fs_server(call, fc->cbi);
|
afs_use_fs_server(call, fc->cbi);
|
||||||
trace_afs_make_fs_call(call, &vnode->fid);
|
trace_afs_make_fs_call(call, &vnode->fid);
|
||||||
afs_set_fc_call(call, fc);
|
afs_set_fc_call(call, fc);
|
||||||
|
@ -934,6 +934,12 @@ extern int afs_fetch_data(struct afs_vnode *, struct key *, struct afs_read *);
|
|||||||
extern int afs_page_filler(void *, struct page *);
|
extern int afs_page_filler(void *, struct page *);
|
||||||
extern void afs_put_read(struct afs_read *);
|
extern void afs_put_read(struct afs_read *);
|
||||||
|
|
||||||
|
static inline struct afs_read *afs_get_read(struct afs_read *req)
|
||||||
|
{
|
||||||
|
refcount_inc(&req->usage);
|
||||||
|
return req;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* flock.c
|
* flock.c
|
||||||
*/
|
*/
|
||||||
|
@ -605,7 +605,7 @@ int yfs_fs_fetch_data(struct afs_fs_cursor *fc, struct afs_status_cb *scb,
|
|||||||
call->key = fc->key;
|
call->key = fc->key;
|
||||||
call->out_scb = scb;
|
call->out_scb = scb;
|
||||||
call->out_volsync = NULL;
|
call->out_volsync = NULL;
|
||||||
call->read_request = req;
|
call->read_request = afs_get_read(req);
|
||||||
|
|
||||||
/* marshall the parameters */
|
/* marshall the parameters */
|
||||||
bp = call->request;
|
bp = call->request;
|
||||||
@ -616,7 +616,6 @@ int yfs_fs_fetch_data(struct afs_fs_cursor *fc, struct afs_status_cb *scb,
|
|||||||
bp = xdr_encode_u64(bp, req->len);
|
bp = xdr_encode_u64(bp, req->len);
|
||||||
yfs_check_req(call, bp);
|
yfs_check_req(call, bp);
|
||||||
|
|
||||||
refcount_inc(&req->usage);
|
|
||||||
afs_use_fs_server(call, fc->cbi);
|
afs_use_fs_server(call, fc->cbi);
|
||||||
trace_afs_make_fs_call(call, &vnode->fid);
|
trace_afs_make_fs_call(call, &vnode->fid);
|
||||||
afs_set_fc_call(call, fc);
|
afs_set_fc_call(call, fc);
|
||||||
|
Loading…
Reference in New Issue
Block a user