From patchwork Thu Jul 10 09:30:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Shilovsky X-Patchwork-Id: 4522421 Return-Path: X-Original-To: patchwork-cifs-client@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CE3B6BEEAA for ; Thu, 10 Jul 2014 09:31:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 17FB92021B for ; Thu, 10 Jul 2014 09:31:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3B48120200 for ; Thu, 10 Jul 2014 09:31:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752241AbaGJJbG (ORCPT ); Thu, 10 Jul 2014 05:31:06 -0400 Received: from mail-lb0-f181.google.com ([209.85.217.181]:50169 "EHLO mail-lb0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752663AbaGJJbF (ORCPT ); Thu, 10 Jul 2014 05:31:05 -0400 Received: by mail-lb0-f181.google.com with SMTP id p9so5767744lbv.26 for ; Thu, 10 Jul 2014 02:31:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=hbrZj0C8OlLd+zC4h9YXxiSa1JFza1ZEKEbykKTdF0k=; b=AwxB6vD5AVPfm8Y6vbb+WRp973cFSb2SMaP3Fm/ENOzZkI4UknY2lhBf7tSh3pvFTM leNdduZsuPBTxkOj4MsmMnNe64/uArIdLg0wwGGVcbFeID/P7TUpI/VwNfo+KqtLI9/O tF7G4NDMrn0uzkn/IPzX1axwwNaO1eQAiLPaSFDRSTpt9psaBy8wiV6oL1gGyX43YEuC +oVkHLlkPpLICk1l3lRGQuZBiKOBoM6oBTC3hQfwj/nF0S7bW7bdTrHc/r00b/YIlSTW vY4BilD9qOfkahzxnkTF5/A+j6iaaV6cob4tPvO1WDRjsBZP5VMciSo0E1lo3yOnO0UP KTnQ== X-Received: by 10.112.97.163 with SMTP id eb3mr1906394lbb.67.1404984664287; Thu, 10 Jul 2014 02:31:04 -0700 (PDT) Received: from localhost.localdomain ([92.43.3.36]) by mx.google.com with ESMTPSA id v6sm23257226lal.35.2014.07.10.02.31.02 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 10 Jul 2014 02:31:03 -0700 (PDT) From: Pavel Shilovsky To: linux-cifs@vger.kernel.org Subject: [PATCH 5/7] CIFS: Improve indentation in cifs_user_read() Date: Thu, 10 Jul 2014 13:30:45 +0400 Message-Id: <1404984647-8710-6-git-send-email-pshilovsky@samba.org> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1404984647-8710-1-git-send-email-pshilovsky@samba.org> References: <1404984647-8710-1-git-send-email-pshilovsky@samba.org> Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, 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 Signed-off-by: Pavel Shilovsky --- fs/cifs/file.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 2927f02..6896cb5 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -3026,28 +3026,27 @@ again: rc = wait_for_completion_killable(&rdata->done); if (rc) rc = -EINTR; - else if (rdata->result) { - rc = rdata->result; + else if (rdata->result == -EAGAIN) { /* resend call if it's a retryable error */ - if (rc == -EAGAIN) { - struct list_head tmp_list; + struct list_head tmp_list; - list_del_init(&rdata->list); - INIT_LIST_HEAD(&tmp_list); + list_del_init(&rdata->list); + INIT_LIST_HEAD(&tmp_list); - rc = cifs_send_async_read(rdata->offset, + rc = cifs_send_async_read(rdata->offset, rdata->bytes, rdata->cfile, cifs_sb, &tmp_list); - list_splice(&tmp_list, &rdata_list); + list_splice(&tmp_list, &rdata_list); - kref_put(&rdata->refcount, - cifs_uncached_readdata_release); - goto again; - } - } else { + kref_put(&rdata->refcount, + cifs_uncached_readdata_release); + goto again; + } else if (rdata->result) + rc = rdata->result; + else rc = cifs_readdata_to_iov(rdata, to); - } + /* if there was a short read -- discard anything left */ if (rdata->got_bytes && rdata->got_bytes < rdata->bytes) rc = -ENODATA;