@@ -1885,7 +1885,7 @@ int lprocfs_wr_nosquash_nids(const char __user *buffer, unsigned long count,
struct root_squash_info *squash, char *name)
{
char *kernbuf = NULL, *errmsg;
- struct list_head tmp;
+ LIST_HEAD(tmp);
int len = count;
int rc;
@@ -1924,7 +1924,6 @@ int lprocfs_wr_nosquash_nids(const char __user *buffer, unsigned long count,
return count;
}
- INIT_LIST_HEAD(&tmp);
if (cfs_parse_nidlist(kernbuf, count, &tmp) <= 0) {
errmsg = "can't parse";
rc = -EINVAL;
@@ -361,7 +361,7 @@ static void lu_object_free(const struct lu_env *env, struct lu_object *o)
struct lu_site *site;
struct lu_object *scan;
struct list_head *layers;
- struct list_head splice;
+ LIST_HEAD(splice);
site = o->lo_dev->ld_site;
layers = &o->lo_header->loh_layers;
@@ -380,7 +380,6 @@ static void lu_object_free(const struct lu_env *env, struct lu_object *o)
* necessary, because lu_object_header is freed together with the
* top-level slice.
*/
- INIT_LIST_HEAD(&splice);
list_splice_init(layers, &splice);
while (!list_empty(&splice)) {
/*
@@ -408,7 +407,7 @@ int lu_site_purge_objects(const struct lu_env *env, struct lu_site *s,
struct lu_object_header *h;
struct lu_object_header *temp;
struct lu_site_bkt_data *bkt;
- struct list_head dispose;
+ LIST_HEAD(dispose);
int did_sth;
unsigned int start = 0;
int count;
@@ -418,7 +417,6 @@ int lu_site_purge_objects(const struct lu_env *env, struct lu_site *s,
if (OBD_FAIL_CHECK(OBD_FAIL_OBD_NO_LRU))
return 0;
- INIT_LIST_HEAD(&dispose);
/*
* Under LRU list lock, scan LRU list and move unreferenced objects to
* the dispose list, removing them from LRU and hash table.
@@ -982,7 +982,7 @@ static bool lmd_find_delimiter(char *buf, char **endh)
*/
static int lmd_parse_nidlist(char *buf, char **endh)
{
- struct list_head nidlist;
+ LIST_HEAD(nidlist);
char *endp = buf;
int rc = 0;
char tmp;
@@ -1000,7 +1000,6 @@ static int lmd_parse_nidlist(char *buf, char **endh)
tmp = *endp;
*endp = '\0';
- INIT_LIST_HEAD(&nidlist);
if (cfs_parse_nidlist(buf, strlen(buf), &nidlist) <= 0)
rc = 1;
cfs_free_nidlist(&nidlist);
@@ -1715,13 +1715,12 @@ static inline int ptlrpc_set_producer(struct ptlrpc_request_set *set)
int ptlrpc_check_set(const struct lu_env *env, struct ptlrpc_request_set *set)
{
struct ptlrpc_request *req, *next;
- struct list_head comp_reqs;
+ LIST_HEAD(comp_reqs);
int force_timer_recalc = 0;
if (atomic_read(&set->set_remaining) == 0)
return 1;
- INIT_LIST_HEAD(&comp_reqs);
list_for_each_entry_safe(req, next, &set->set_requests, rq_set_chain) {
struct obd_import *imp = req->rq_import;
int unregistered = 0;
@@ -1211,7 +1211,7 @@ static void ptlrpc_at_check_timed(struct ptlrpc_service_part *svcpt)
{
struct ptlrpc_at_array *array = &svcpt->scp_at_array;
struct ptlrpc_request *rq, *n;
- struct list_head work_list;
+ LIST_HEAD(work_list);
u32 index, count;
time64_t deadline;
time64_t now = ktime_get_real_seconds();
@@ -1244,7 +1244,6 @@ static void ptlrpc_at_check_timed(struct ptlrpc_service_part *svcpt)
* We're close to a timeout, and we don't know how much longer the
* server will take. Send early replies to everyone expiring soon.
*/
- INIT_LIST_HEAD(&work_list);
deadline = -1;
div_u64_rem(array->paa_deadline, array->paa_size, &index);
count = array->paa_count;