From patchwork Thu Nov 12 15:06:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ??? X-Patchwork-Id: 7603081 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 567509F1D3 for ; Thu, 12 Nov 2015 15:07:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D3D6020351 for ; Thu, 12 Nov 2015 15:06:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1E79020595 for ; Thu, 12 Nov 2015 15:06:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754782AbbKLPGl (ORCPT ); Thu, 12 Nov 2015 10:06:41 -0500 Received: from mail-oi0-f48.google.com ([209.85.218.48]:33356 "EHLO mail-oi0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753597AbbKLPGk (ORCPT ); Thu, 12 Nov 2015 10:06:40 -0500 Received: by oixx65 with SMTP id x65so22492077oix.0; Thu, 12 Nov 2015 07:06:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:date:message-id:subject:from:to:content-type; bh=G1MAjrBICAK8eIayvPJe1tWGvOtoU5ybZ3w5QkI7D/Q=; b=m4YnEZYCf8xTiW25SdIkTAMQ6xG0JDcFcfVo6pVbe7gq/0e3G4XYZbmk5TVeZT2dN0 WPubBa6EiMxBzo+7QK58MDBGGuCm9mkHcTQtR6CA3F3JMEsfEu6CuPeBo3n/VmjCzcLK GcZIC0WNMZ124Oaw1mim0Ubqe950OQyXGlRZKPK85x184iHIewPtrdDcIFvP0lR0jHCe 5knEgRsoiTq07WGO6PoPUejskHuU1LSpRG+qeMqyrgvdyWinuSi41ktsmpQPPFCRSskh mOPwxWv7jBn5eh0XsQSXp5hDEDH//AAFmaH//Skl9Io9HBmqy1D0KtZEM3T3hjZbpE4L lSgw== MIME-Version: 1.0 X-Received: by 10.202.86.202 with SMTP id k193mr8684654oib.115.1447340800056; Thu, 12 Nov 2015 07:06:40 -0800 (PST) Received: by 10.182.209.37 with HTTP; Thu, 12 Nov 2015 07:06:40 -0800 (PST) Reply-To: liuchangdong007@163.com Date: Thu, 12 Nov 2015 23:06:40 +0800 Message-ID: Subject: [PATCH] aio: Add few code style fixes From: =?UTF-8?B?5YiY6ZW/5Yas?= To: bcrl@kvack.org, viro@zeniv.linux.org.uk, linux-aio@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From 1609d68dee344925d182631922cd98790109588b Mon Sep 17 00:00:00 2001 From: Liu Changdong Date: Tue, 10 Nov 2015 00:04:18 +0800 Subject: [PATCH] aio: Add few code style fixes Add a blank line after declarations Signed-off-by: Liu Changdong --- fs/aio.c | 5 +++++ 1 file changed, 5 insertions(+) @@ -269,6 +270,7 @@ __initcall(aio_setup); static void put_aio_ring_file(struct kioctx *ctx) { struct file *aio_ring_file = ctx->aio_ring_file; + if (aio_ring_file) { truncate_setsize(aio_ring_file->f_inode, 0); @@ -293,6 +295,7 @@ static void aio_free_ring(struct kioctx *ctx) for (i = 0; i < ctx->nr_pages; i++) { struct page *page; + pr_debug("pid(%d) [%d] page->count=%d\n", current->pid, i, page_count(ctx->ring_pages[i])); page = ctx->ring_pages[i]; @@ -475,6 +478,7 @@ static int aio_setup_ring(struct kioctx *ctx) for (i = 0; i < nr_pages; i++) { struct page *page; + page = find_or_create_page(file->f_inode->i_mapping, i, GFP_HIGHUSER | __GFP_ZERO); if (!page) @@ -1352,6 +1356,7 @@ out: SYSCALL_DEFINE1(io_destroy, aio_context_t, ctx) { struct kioctx *ioctx = lookup_ioctx(ctx); + if (likely(NULL != ioctx)) { struct ctx_rq_wait wait; int ret; diff --git a/fs/aio.c b/fs/aio.c index 155f842..48e4fb0 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -208,6 +208,7 @@ static struct file *aio_private_file(struct kioctx *ctx, loff_t nr_pages) struct file *file; struct path path; struct inode *inode = alloc_anon_inode(aio_mnt->mnt_sb); + if (IS_ERR(inode)) return ERR_CAST(inode);