From patchwork Thu Feb 27 21:08:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Simmons X-Patchwork-Id: 11409689 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3B5A714BC for ; Thu, 27 Feb 2020 21:19:20 +0000 (UTC) Received: from pdx1-mailman02.dreamhost.com (pdx1-mailman02.dreamhost.com [64.90.62.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2424A246A1 for ; Thu, 27 Feb 2020 21:19:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2424A246A1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lustre-devel-bounces@lists.lustre.org Received: from pdx1-mailman02.dreamhost.com (localhost [IPv6:::1]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 9CD8521FBEC; Thu, 27 Feb 2020 13:19:05 -0800 (PST) X-Original-To: lustre-devel@lists.lustre.org Delivered-To: lustre-devel-lustre.org@pdx1-mailman02.dreamhost.com Received: from smtp3.ccs.ornl.gov (smtp3.ccs.ornl.gov [160.91.203.39]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 120A421FA44 for ; Thu, 27 Feb 2020 13:18:21 -0800 (PST) Received: from star.ccs.ornl.gov (star.ccs.ornl.gov [160.91.202.134]) by smtp3.ccs.ornl.gov (Postfix) with ESMTP id 672C79E0; Thu, 27 Feb 2020 16:18:13 -0500 (EST) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id 65F8C46F; Thu, 27 Feb 2020 16:18:13 -0500 (EST) From: James Simmons To: Andreas Dilger , Oleg Drokin , NeilBrown Date: Thu, 27 Feb 2020 16:08:08 -0500 Message-Id: <1582838290-17243-21-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1582838290-17243-1-git-send-email-jsimmons@infradead.org> References: <1582838290-17243-1-git-send-email-jsimmons@infradead.org> Subject: [lustre-devel] [PATCH 020/622] lnet: libcfs: remove unnecessary set_fs(KERNEL_DS) X-BeenThere: lustre-devel@lists.lustre.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "For discussing Lustre software development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mike Marciniszyn , Lustre Development List MIME-Version: 1.0 Errors-To: lustre-devel-bounces@lists.lustre.org Sender: "lustre-devel" From: Mike Marciniszyn When we converted to using kernel_write(), we left some set_fs() calls that are not unnecessary. Remove them. Original OpenSFS version of this patch, as mentioned below, did the full conversion to kernel_write. WC-bug-id: https://jira.whamcloud.com/browse/LU-10560 lustre-commit: b9a32054600a ("LU-10560 libcfs: Use kernel_write when appropriate") Signed-off-by: Mike Marciniszyn Reviewed-on: https://review.whamcloud.com/31154 Reviewed-by: James Simmons Reviewed-by: Dmitry Eremin Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin igned-off-by: James Simmons --- net/lnet/libcfs/tracefile.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/net/lnet/libcfs/tracefile.c b/net/lnet/libcfs/tracefile.c index 3b29116..6e4cc31 100644 --- a/net/lnet/libcfs/tracefile.c +++ b/net/lnet/libcfs/tracefile.c @@ -807,7 +807,6 @@ int cfs_tracefile_dump_all_pages(char *filename) struct cfs_trace_page *tage; struct cfs_trace_page *tmp; char *buf; - mm_segment_t __oldfs; int rc; down_write(&cfs_tracefile_sem); @@ -828,8 +827,6 @@ int cfs_tracefile_dump_all_pages(char *filename) rc = 0; goto close; } - __oldfs = get_fs(); - set_fs(KERNEL_DS); /* ok, for now, just write the pages. in the future we'll be building * iobufs with the pages and calling generic_direct_IO @@ -851,7 +848,7 @@ int cfs_tracefile_dump_all_pages(char *filename) list_del(&tage->linkage); cfs_tage_free(tage); } - set_fs(__oldfs); + rc = vfs_fsync(filp, 1); if (rc) pr_err("sync returns %d\n", rc);