]> git.dujemihanovic.xyz Git - linux.git/commitdiff
nfsd: use LIST_HEAD() to simplify code
authorHongbo Li <lihongbo22@huawei.com>
Wed, 21 Aug 2024 06:53:26 +0000 (14:53 +0800)
committerChuck Lever <chuck.lever@oracle.com>
Fri, 20 Sep 2024 23:31:03 +0000 (19:31 -0400)
list_head can be initialized automatically with LIST_HEAD()
instead of calling INIT_LIST_HEAD().

Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfs4state.c

index fa58de23a753e098b1e6797693a916faae35ed40..b743a021b51aa4fd5277bdac2f22f501874f5640 100644 (file)
@@ -1663,9 +1663,7 @@ static void release_openowner(struct nfs4_openowner *oo)
 {
        struct nfs4_ol_stateid *stp;
        struct nfs4_client *clp = oo->oo_owner.so_client;
-       struct list_head reaplist;
-
-       INIT_LIST_HEAD(&reaplist);
+       LIST_HEAD(reaplist);
 
        spin_lock(&clp->cl_lock);
        unhash_openowner_locked(oo);
@@ -2369,9 +2367,8 @@ __destroy_client(struct nfs4_client *clp)
        int i;
        struct nfs4_openowner *oo;
        struct nfs4_delegation *dp;
-       struct list_head reaplist;
+       LIST_HEAD(reaplist);
 
-       INIT_LIST_HEAD(&reaplist);
        spin_lock(&state_lock);
        while (!list_empty(&clp->cl_delegations)) {
                dp = list_entry(clp->cl_delegations.next, struct nfs4_delegation, dl_perclnt);
@@ -6615,9 +6612,8 @@ deleg_reaper(struct nfsd_net *nn)
 {
        struct list_head *pos, *next;
        struct nfs4_client *clp;
-       struct list_head cblist;
+       LIST_HEAD(cblist);
 
-       INIT_LIST_HEAD(&cblist);
        spin_lock(&nn->client_lock);
        list_for_each_safe(pos, next, &nn->client_lru) {
                clp = list_entry(pos, struct nfs4_client, cl_lru);