Message ID | 20240821065326.2293988-1-lihongbo22@huawei.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [-next] nfsd: use LIST_HEAD() to simplify code | expand |
On Wed, Aug 21, 2024 at 02:53:26PM +0800, Hongbo Li wrote: > list_head can be initialized automatically with LIST_HEAD() > instead of calling INIT_LIST_HEAD(). > > Signed-off-by: Hongbo Li <lihongbo22@huawei.com> > --- > fs/nfsd/nfs4state.c | 10 +++------- > 1 file changed, 3 insertions(+), 7 deletions(-) > > diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c > index a20c2c9d7d45..ee852719d07d 100644 > --- a/fs/nfsd/nfs4state.c > +++ b/fs/nfsd/nfs4state.c > @@ -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); > @@ -6616,9 +6613,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); > -- > 2.34.1 > Applied to nfsd-next for v6.12, thanks! [1/1] nfsd: use LIST_HEAD() to simplify code commit: afec13278f4ed7dad696cfdaddbee978d905b9f2
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index a20c2c9d7d45..ee852719d07d 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -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); @@ -6616,9 +6613,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);
list_head can be initialized automatically with LIST_HEAD() instead of calling INIT_LIST_HEAD(). Signed-off-by: Hongbo Li <lihongbo22@huawei.com> --- fs/nfsd/nfs4state.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)