Skip to content

Commit c2feb7e

Browse files
Hongbo Lichucklever
authored andcommitted
nfsd: use LIST_HEAD() to simplify code
list_head can be initialized automatically with LIST_HEAD() instead of calling INIT_LIST_HEAD(). Signed-off-by: Hongbo Li <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent 340e61e commit c2feb7e

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

fs/nfsd/nfs4state.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1663,9 +1663,7 @@ static void release_openowner(struct nfs4_openowner *oo)
16631663
{
16641664
struct nfs4_ol_stateid *stp;
16651665
struct nfs4_client *clp = oo->oo_owner.so_client;
1666-
struct list_head reaplist;
1667-
1668-
INIT_LIST_HEAD(&reaplist);
1666+
LIST_HEAD(reaplist);
16691667

16701668
spin_lock(&clp->cl_lock);
16711669
unhash_openowner_locked(oo);
@@ -2369,9 +2367,8 @@ __destroy_client(struct nfs4_client *clp)
23692367
int i;
23702368
struct nfs4_openowner *oo;
23712369
struct nfs4_delegation *dp;
2372-
struct list_head reaplist;
2370+
LIST_HEAD(reaplist);
23732371

2374-
INIT_LIST_HEAD(&reaplist);
23752372
spin_lock(&state_lock);
23762373
while (!list_empty(&clp->cl_delegations)) {
23772374
dp = list_entry(clp->cl_delegations.next, struct nfs4_delegation, dl_perclnt);
@@ -6615,9 +6612,8 @@ deleg_reaper(struct nfsd_net *nn)
66156612
{
66166613
struct list_head *pos, *next;
66176614
struct nfs4_client *clp;
6618-
struct list_head cblist;
6615+
LIST_HEAD(cblist);
66196616

6620-
INIT_LIST_HEAD(&cblist);
66216617
spin_lock(&nn->client_lock);
66226618
list_for_each_safe(pos, next, &nn->client_lru) {
66236619
clp = list_entry(pos, struct nfs4_client, cl_lru);

0 commit comments

Comments
 (0)