Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2978932pxa; Tue, 18 Aug 2020 03:20:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzlOzztwPL/auLQAiIgDCFZOXtKM8jqzsOo/osOnUg2THeB4OXH1qjSy9HSUwRwx8d8ROxl X-Received: by 2002:a50:d791:: with SMTP id w17mr18394189edi.373.1597746031302; Tue, 18 Aug 2020 03:20:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597746031; cv=none; d=google.com; s=arc-20160816; b=EIQmx4hiU6aIFYsqV4Two3kZzpKps/a8Ng7w7OwIDpdt5xCMfJ56I8j18nR2ftpVk1 SYAoygJ3PY6y3Y492ccYL6oz1OfBdsWFIcLn42ZGu4VkTD3fwc2Zchg2X2QgtuT+KkzJ PdIIZcYlPtOfdBDwI2nQB6ZHsaCJJ9HQ2L6OLfAyD0MEK66FcU2zo+c96V5uZuesWT+S 6KCA/NmgyWoEXMpizXcnUJzVSUnTCkmtd+hJ+8dBxilUVuafLfJN2smGEq2FkzKynMl3 BAbS+GR3h0OAv3/tq2FAkTQDmvK4j8dhWWUGtBM7VxlG9NrJgyHW/qSMfKjQvU/DtMZl yEbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=z1g8J7Uh+jmCPDFuYmYsl+5Ag3cp8Jjp0zVp01SyP+Y=; b=XGyT5e6NII7N+DoLsCuIaHuMuU0NJhgVUG/vhwW045wMxObmRfNbFGqVyYC0SxWQa5 US6yQwcQMObUX32Z+9h6lpXKI1Mj62TG3GAIcv2NweUOXtLTwI4cds/0Q1K6dOt001D7 NzDd8I0RSpuYLKOoRk9K3caEOdyeYSPtx3ujZ0tu2LYpb+lv3zHuRr2DlqIJfmovvA+w pvN5o3EM0ut9EU/Adb6yW8HJQNrbln7uNRkXBElw13vrmagCtlVefTqDhVewKXgFCDn3 UBIl5WWy+ZusRL/fZsQKkBs/0d1S1ntKNQArEk54IJQ3+2JeTTSa22WzWet7vqxpRr0k gtsw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cm21si12866478edb.111.2020.08.18.03.20.07; Tue, 18 Aug 2020 03:20:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726639AbgHRKTd (ORCPT + 99 others); Tue, 18 Aug 2020 06:19:33 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:38462 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726424AbgHRKTd (ORCPT ); Tue, 18 Aug 2020 06:19:33 -0400 Received: from ip5f5af70b.dynamic.kabel-deutschland.de ([95.90.247.11] helo=wittgenstein) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1k7yiH-0001XG-U9; Tue, 18 Aug 2020 10:19:30 +0000 Date: Tue, 18 Aug 2020 12:19:28 +0200 From: Christian Brauner To: "Eric W. Biederman" Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, criu@openvz.org, bpf@vger.kernel.org, Linus Torvalds , Alexander Viro , Oleg Nesterov , Cyrill Gorcunov , Jann Horn , Kees Cook , Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= , Jeff Layton , Miklos Szeredi , Matthew Wilcox , "J. Bruce Fields" , Matthew Wilcox , Trond Myklebust , Chris Wright , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , John Fastabend , KP Singh Subject: Re: [PATCH 17/17] file: Rename __close_fd to close_fd and remove the files parameter Message-ID: <20200818101928.6tbaakfpqxtlrf53@wittgenstein> References: <87ft8l6ic3.fsf@x220.int.ebiederm.org> <20200817220425.9389-17-ebiederm@xmission.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200817220425.9389-17-ebiederm@xmission.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 17, 2020 at 05:04:25PM -0500, Eric W. Biederman wrote: > The function __close_fd was added to support binder[1]. Now that > binder has been fixed to no longer need __close_fd[2] and > get_files_struct has been removed it is no longer possible to > correctly call __close_fd with anything current->files pass as it's > files parameter. > > Therefore transform the files parameter into a local variable > initialized to current->files, and rename __close_fd to close_fd to > reflect this change, and keep it in sync with the similar changes to > __alloc_fd, and __fd_install. > > This removes the need for callers to care about the extra care that > needs to be take if anything except current->files is passed, by > limiting the callers to only operation on current->files. > > [1] 483ce1d4b8c3 ("take descriptor-related part of close() to file.c") > [2] 44d8047f1d87 ("binder: use standard functions to allocate fds") > Signed-off-by: "Eric W. Biederman" > --- Acked-by: Christian Brauner