Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6031646imu; Wed, 30 Jan 2019 07:39:36 -0800 (PST) X-Google-Smtp-Source: ALg8bN5yu2uSJ7B+QvgDfZYniq3NV4RxO7vRk5IzLGeDdZA0eS7ieZXzU52i7BbJsr76kwlm7S/8 X-Received: by 2002:a63:65c7:: with SMTP id z190mr28142978pgb.249.1548862775925; Wed, 30 Jan 2019 07:39:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548862775; cv=none; d=google.com; s=arc-20160816; b=h24SKtCWlY5iC60pmYUVUpyuEXyhMaNMSwbRbYMrtDLdCnkf/QTGWOb9WzoF5LrVGZ h2bZSYcxaFYIYbye8JO57jwXXCtVURlTqYI1hBPWkzQzFnCA4u6UHpuokPtJrgmR3McZ cltXNDqYMOgNLOw13rp/32wAgLgPxMj5KEL7PPKONUOe22FJcWsjVMNTKySaBz2wcop+ yyLaFAetjclsb0X1Dp5vEWs8n2j++3Vhl73ayMWu6UHBBAqb/VWNCBcqFcQvAaO4zzKe V3USlcdOgRkiF9sQQNluhH0kv5zQwxHCUpu2LPPrNOD2z0BbWSJ/w+IUM+gxHc1UJe2I mfqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=xHon2lKnek+1BJiY7RW8bxnCOvdBRRagpO+HQdREhzo=; b=Yl4bX/nBPScmcBqMNGJsPywloEt1uYNZquXwEF7/OSHsE09wQ6ai1kX1300XA0GyR+ bOn2AHb0By6AI4ynXK0rtIP37gPC31HK/GfGZO9E/b4b+PEwp8/Q/t6ANk/R7bfP7dFg ClkmmJCXFhPu1g4N92CuYtevrignpX4oqKAXYXaOoIcRWAe+z19JG73pdrkP7LcDl71B pqejVFgAbSoUDNLA1ERHO2nizTbnZ9jT88wKDvplbuvjqW+TWDkyyS9A2hTRyn39TwCQ d2lnuwmNSXvSWlwaByZvqek9h4RsBfCPy4muA7WvHUfxi1fx/FdI9jBVLvKHeaqV2J4U hCgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QoPUyIkf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y141si1879445pfc.180.2019.01.30.07.39.20; Wed, 30 Jan 2019 07:39:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QoPUyIkf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729865AbfA3PjP (ORCPT + 99 others); Wed, 30 Jan 2019 10:39:15 -0500 Received: from mail-lf1-f45.google.com ([209.85.167.45]:36500 "EHLO mail-lf1-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726230AbfA3PjP (ORCPT ); Wed, 30 Jan 2019 10:39:15 -0500 Received: by mail-lf1-f45.google.com with SMTP id a16so17726250lfg.3 for ; Wed, 30 Jan 2019 07:39:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=xHon2lKnek+1BJiY7RW8bxnCOvdBRRagpO+HQdREhzo=; b=QoPUyIkfh8UoX3h0N4j4dKWlkBD4P6gE/EUKOhUef+Op9wLCsWnUPgdvt/kH1lLAVl 1tOhKc+JFShCKMQvjNtvIo3O0cpW/1Iji2T3LbfYf9YF/00xwJpqVEnTK2HLSAfg4wnb ZnLboFPCtSbLdfTiRaEB4CY7RQfqHyM6sMaqj3y3xn95SBKyDS+FuzLv160gu3VIK2Yl nL+9dQxSBoJTLMfe4V+U9OjvHvID/S4s0nK/8ycIXmGLTsQETv/Grd5RrBLV7xa85065 TDHo/8uGqbQIVW6+h3nS/F9a1OzuA0liJ04AS8HqTrha+X5B2TEgJ9l+HOfIKOhHGqEd FQeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=xHon2lKnek+1BJiY7RW8bxnCOvdBRRagpO+HQdREhzo=; b=fM6ZKtYYdpX2/tn/DKJQji//EESSr2PyXlPZJYjTezaQlS0xsJyakpcqZYUoj08YUe Z80LleAugsEDFD0bilqOSWP60AVgchZjt9/7beRB2MZdJBs4IA/V6vEchpBeKdr5HEVB ZDd68nuq1OMltpH9WqV8Gl4Brqnb1I7+lnzWTrlTFtcz2KJEpW4XbGdDWXG5P1/koSfJ 44EtdpfFaAqdmmqNgQ55B/gWfVQSRRUu6doCkn/FmurmgPWo2c3tbPxImXEyRd8U420h J0GZaZsWZ1/fpyi2eOMZ0Kjo53lGmOJKdyeYjzkyn5lzSpbTu8QQ/Suy4K97bPN9rMro 5Xsw== X-Gm-Message-State: AJcUukecQqGIGY2fWJcgIDOtj3NwMEgSEDoL+CKyGkhNXchV/XH14KvW QS+IkkNkXYd7fZ/Hll8d8MMQIGMx X-Received: by 2002:a19:3809:: with SMTP id f9mr24147815lfa.148.1548862752851; Wed, 30 Jan 2019 07:39:12 -0800 (PST) Received: from uranus.localdomain ([5.18.103.226]) by smtp.gmail.com with ESMTPSA id o17sm342115lff.77.2019.01.30.07.39.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 30 Jan 2019 07:39:12 -0800 (PST) Received: by uranus.localdomain (Postfix, from userid 1000) id A27C246077D; Wed, 30 Jan 2019 18:39:11 +0300 (MSK) Date: Wed, 30 Jan 2019 18:39:11 +0300 From: Cyrill Gorcunov To: LKML Cc: Al Viro Subject: [PATCH next] fs/splice: iter_to_pipe -- Use PIPE_DEF_BUFFERS instead of hardcoded number Message-ID: <20190130153911.GJ2332@uranus.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org And use ARRAY_SIZE for easier code modification if we ever need in future. CC: Al Viro Signed-off-by: Cyrill Gorcunov --- fs/splice.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Index: linux-next.git/fs/splice.c =================================================================== --- linux-next.git.orig/fs/splice.c +++ linux-next.git/fs/splice.c @@ -1203,12 +1203,12 @@ static int iter_to_pipe(struct iov_iter bool failed = false; while (iov_iter_count(from) && !failed) { - struct page *pages[16]; + struct page *pages[PIPE_DEF_BUFFERS]; ssize_t copied; size_t start; int n; - copied = iov_iter_get_pages(from, pages, ~0UL, 16, &start); + copied = iov_iter_get_pages(from, pages, ~0UL, ARRAY_SIZE(pages), &start); if (copied <= 0) { ret = copied; break;