Re: [PATCH 10/27] aio: don't zero entire aio_kiocb aio_get_req()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/4/18 7:49 AM, Christoph Hellwig wrote:
>> -	req = kmem_cache_alloc(kiocb_cachep, GFP_KERNEL|__GFP_ZERO);
>> -	if (unlikely(!req))
>> -		return NULL;
>> +	req = kmem_cache_alloc(kiocb_cachep, GFP_KERNEL);
>> +	if (req) {
>> +		percpu_ref_get(&ctx->reqs);
>> +		req->ki_ctx = ctx;
>> +		INIT_LIST_HEAD(&req->ki_list);
>> +		refcount_set(&req->ki_refcnt, 0);
>> +		req->ki_eventfd = NULL;
>> +	}
>>  
>> -	percpu_ref_get(&ctx->reqs);
>> -	INIT_LIST_HEAD(&req->ki_list);
>> -	refcount_set(&req->ki_refcnt, 0);
>> -	req->ki_ctx = ctx;
>>  	return req;
> 
> Why the reformatting?  Otherwise this looks fine to me:
> 
> Reviewed-by: Christoph Hellwig <hch@xxxxxx>

Probably just the (over) abuse of likely/unlikely in aio.c. I can get
rid of it.

-- 
Jens Axboe




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux