Skip to content

Commit

Permalink
afs: Get rid of afs_call::reply[]
Browse files Browse the repository at this point in the history
Replace the afs_call::reply[] array with a bunch of typed members so that
the compiler can use type-checking on them.  It's also easier for the eye
to see what's going on.

Signed-off-by: David Howells <[email protected]>
  • Loading branch information
dhowells committed May 16, 2019
1 parent fefb248 commit ffba718
Show file tree
Hide file tree
Showing 10 changed files with 293 additions and 303 deletions.
14 changes: 7 additions & 7 deletions fs/afs/cmservice.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ static int afs_find_cm_server_by_peer(struct afs_call *call)
return 0;
}

call->cm_server = server;
call->server = server;
return afs_record_cm_probe(call, server);
}

Expand All @@ -234,7 +234,7 @@ static int afs_find_cm_server_by_uuid(struct afs_call *call,
return 0;
}

call->cm_server = server;
call->server = server;
return afs_record_cm_probe(call, server);
}

Expand All @@ -260,8 +260,8 @@ static void SRXAFSCB_CallBack(struct work_struct *work)
* server holds up change visibility till it receives our reply so as
* to maintain cache coherency.
*/
if (call->cm_server)
afs_break_callbacks(call->cm_server, call->count, call->request);
if (call->server)
afs_break_callbacks(call->server, call->count, call->request);

afs_send_empty_reply(call);
afs_put_call(call);
Expand Down Expand Up @@ -376,10 +376,10 @@ static void SRXAFSCB_InitCallBackState(struct work_struct *work)
{
struct afs_call *call = container_of(work, struct afs_call, work);

_enter("{%p}", call->cm_server);
_enter("{%p}", call->server);

if (call->cm_server)
afs_init_callback_state(call->cm_server);
if (call->server)
afs_init_callback_state(call->server);
afs_send_empty_reply(call);
afs_put_call(call);
_leave("");
Expand Down
2 changes: 1 addition & 1 deletion fs/afs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ static int afs_readpage(struct file *file, struct page *page)
static void afs_readpages_page_done(struct afs_call *call, struct afs_read *req)
{
#ifdef CONFIG_AFS_FSCACHE
struct afs_vnode *vnode = call->reply[0];
struct afs_vnode *vnode = call->xvnode;
#endif
struct page *page = req->pages[req->index];

Expand Down
2 changes: 1 addition & 1 deletion fs/afs/flock.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ static void afs_schedule_lock_extension(struct afs_vnode *vnode)
*/
void afs_lock_op_done(struct afs_call *call)
{
struct afs_vnode *vnode = call->reply[0];
struct afs_vnode *vnode = call->xvnode;

if (call->error == 0) {
spin_lock(&vnode->lock);
Expand Down
4 changes: 2 additions & 2 deletions fs/afs/fs_probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ static bool afs_fs_probe_done(struct afs_server *server)
void afs_fileserver_probe_result(struct afs_call *call)
{
struct afs_addr_list *alist = call->alist;
struct afs_server *server = call->reply[0];
unsigned int server_index = (long)call->reply[1];
struct afs_server *server = call->server;
unsigned int server_index = call->server_index;
unsigned int index = call->addr_ix;
unsigned int rtt = UINT_MAX;
bool have_result = false;
Expand Down
Loading

0 comments on commit ffba718

Please sign in to comment.