Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp3061170rwe; Mon, 29 Aug 2022 05:18:48 -0700 (PDT) X-Google-Smtp-Source: AA6agR7bY4OGd17U9cVnFPNgO+Ez8Oxs5LjQ3bkZqGWRtbshc/AO40zlEJUGiTVGoaMFMC16fVKL X-Received: by 2002:a17:90b:1c8e:b0:1f7:5250:7b44 with SMTP id oo14-20020a17090b1c8e00b001f752507b44mr18229834pjb.212.1661775527939; Mon, 29 Aug 2022 05:18:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661775527; cv=none; d=google.com; s=arc-20160816; b=EPac/rnj9HDuCAuCEU3QSyTL6+i4C03E/WQLi9aEbCndcbYlBcJsX3NQ1I5Y02018R n6NjnY1xnU50+8bQ5EvTqLyE398qDfwNezRMxDwam44S4sEF30YOJhey7Y0vj31Vjtrs STz4uonZhAuBQBYoClaHt9ss2Wmkj4aUDe0u3PfkV+dwWSsGjswxB/HJyaPAmYT+9cC9 L18Oc0A2DrnvXFcQVtlHGcmkCNMt86qFS8MG7N7NbcEWPIpLKtFym9BBGGVVCFJWTK0s 9du6nt1JhQ6oTZBEmLOhHgqsQzMSU5v0dVbx+WpZ9Hx7iaR+ZOIdzIQrHn0cYzvqgawl 1M0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=FSRPLcCIJ4jFJV8IhDe9qbbih8F81brxC4j9ot/Mi5g=; b=FHsNwqebLTIC9Jb9fs2w3zaYKHDrdQO4f8a/AyMmvACZbSF/OnNQk/ZtNJeubnDzUD ifqU5w/tljbNFDYL9qDD8Kx2gc0iL9r/GZhT8l/tJ7dDvMCHsgrBwkvxaxSzuH6vobsi +o7B+fZyEbg8a91NNyh9jhFa69DhGyv1Wxd50jX+Z4HKBfEwRLYTClNhlaNUjmzs0TT2 ZJ2/yvsXeLZ54Vcn8dx4dvsC/a9NCA0Cb3IQx4+yQ7C1EUl+QG2F3lPh4Efcu7w/zUKd JzFtal4eNTF7r0PUSGkFRlia+j9A2Zuf9JDu1K4TVFNypbrlfZTnwoOBAg9d4L+9+UJu VIbg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e20-20020a63d954000000b0042b30fbdd76si9333418pgj.779.2022.08.29.05.18.33; Mon, 29 Aug 2022 05:18:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229535AbiH2MLc (ORCPT + 99 others); Mon, 29 Aug 2022 08:11:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229782AbiH2MLA (ORCPT ); Mon, 29 Aug 2022 08:11:00 -0400 Received: from out199-13.us.a.mail.aliyun.com (out199-13.us.a.mail.aliyun.com [47.90.199.13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F11C780344; Mon, 29 Aug 2022 04:56:12 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R461e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046056;MF=xianting.tian@linux.alibaba.com;NM=1;PH=DS;RN=4;SR=0;TI=SMTPD_---0VNeBTl8_1661773934; Received: from localhost(mailfrom:xianting.tian@linux.alibaba.com fp:SMTPD_---0VNeBTl8_1661773934) by smtp.aliyun-inc.com; Mon, 29 Aug 2022 19:52:15 +0800 From: Xianting Tian To: viro@zeniv.linux.org.uk Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Xianting Tian Subject: [PATCH] seq_file: use iov_iter_ubuf() to simplify the code Date: Mon, 29 Aug 2022 19:52:12 +0800 Message-Id: <20220829115212.4006109-1-xianting.tian@linux.alibaba.com> X-Mailer: git-send-email 2.17.1 X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org use iov_iter_ubuf() instead of iov_iter_init() to simplify the code Signed-off-by: Xianting Tian --- fs/seq_file.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/seq_file.c b/fs/seq_file.c index 9456a2032224..6af66161576a 100644 --- a/fs/seq_file.c +++ b/fs/seq_file.c @@ -150,13 +150,12 @@ static int traverse(struct seq_file *m, loff_t offset) */ ssize_t seq_read(struct file *file, char __user *buf, size_t size, loff_t *ppos) { - struct iovec iov = { .iov_base = buf, .iov_len = size}; struct kiocb kiocb; struct iov_iter iter; ssize_t ret; init_sync_kiocb(&kiocb, file); - iov_iter_init(&iter, READ, &iov, 1, size); + iov_iter_ubuf(&iter, READ, buf, size); kiocb.ki_pos = *ppos; ret = seq_read_iter(&kiocb, &iter); -- 2.17.1