Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

NFS: fold nfs_abort_delegation_return into nfs_end_delegation_return

This will allow to simplify the error handling flow.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>

authored by

Christoph Hellwig and committed by
Anna Schumaker
f7550318 438c3e47

+14 -19
+14 -19
fs/nfs/delegation.c
··· 350 350 return delegation; 351 351 } 352 352 353 - static void nfs_abort_delegation_return(struct nfs_delegation *delegation, 354 - struct nfs_server *server, int err) 355 - { 356 - spin_lock(&delegation->lock); 357 - clear_bit(NFS_DELEGATION_RETURNING, &delegation->flags); 358 - if (err == -EAGAIN) { 359 - set_bit(NFS_DELEGATION_RETURN_DELAYED, &delegation->flags); 360 - set_bit(NFS4SERV_DELEGRETURN_DELAYED, 361 - &server->delegation_flags); 362 - set_bit(NFS4CLNT_DELEGRETURN_DELAYED, 363 - &server->nfs_client->cl_state); 364 - } 365 - spin_unlock(&delegation->lock); 366 - } 367 - 368 353 static bool 369 354 nfs_detach_delegations_locked(struct nfs_inode *nfsi, 370 355 struct nfs_delegation *delegation, ··· 578 593 err = nfs4_wait_clnt_recover(server->nfs_client); 579 594 } 580 595 581 - if (err) { 582 - nfs_abort_delegation_return(delegation, server, err); 583 - return err; 584 - } 596 + if (err) 597 + goto abort; 585 598 586 599 out_return: 587 600 return nfs_do_return_delegation(inode, delegation, issync); 601 + abort: 602 + spin_lock(&delegation->lock); 603 + clear_bit(NFS_DELEGATION_RETURNING, &delegation->flags); 604 + if (err == -EAGAIN) { 605 + set_bit(NFS_DELEGATION_RETURN_DELAYED, &delegation->flags); 606 + set_bit(NFS4SERV_DELEGRETURN_DELAYED, 607 + &server->delegation_flags); 608 + set_bit(NFS4CLNT_DELEGRETURN_DELAYED, 609 + &server->nfs_client->cl_state); 610 + } 611 + spin_unlock(&delegation->lock); 612 + return err; 588 613 } 589 614 590 615 static int nfs_return_one_delegation(struct nfs_server *server)