From patchwork Fri Nov 29 16:33:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ira Weiny X-Patchwork-Id: 11267361 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 B4A6C930 for ; Fri, 29 Nov 2019 16:33:14 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 82419217AB for ; Fri, 29 Nov 2019 16:33:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 82419217AB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id F34616B05BD; Fri, 29 Nov 2019 11:33:11 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id E1D296B05BC; Fri, 29 Nov 2019 11:33:11 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C25956B05BB; Fri, 29 Nov 2019 11:33:11 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0212.hostedemail.com [216.40.44.212]) by kanga.kvack.org (Postfix) with ESMTP id 988226B05B9 for ; Fri, 29 Nov 2019 11:33:11 -0500 (EST) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id 28878180AD804 for ; Fri, 29 Nov 2019 16:33:11 +0000 (UTC) X-FDA: 76209859782.19.crate12_1bab954fcc04c X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,ira.weiny@intel.com,:akpm@linux-foundation.org:viro@zeniv.linux.org.uk:clm@fb.com:josef@toxicpanda.com:dsterba@suse.com:jaegeuk@kernel.org:chao@kernel.org:linux-xfs@vger.kernel.org:linux-fsdevel@vger.kernel.org:trond.myklebust@hammerspace.com:anna.schumaker@netapp.com:linux-btrfs@vger.kernel.org:linux-kernel@vger.kernel.org:linux-f2fs-devel@lists.sourceforge.net:linux-nfs@vger.kernel.org::ira.weiny@intel.com:darrick.wong@oracle.com,RULES_HIT:30054:30064:30070:30075,0,RBL:192.55.52.88:@intel.com:.lbl8.mailshell.net-62.18.0.100 64.95.201.95,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:ft,MSBL:0,DNSBL:neutral,Custom_rules:0:2:0,LFtime:45,LUA_SUMMARY:none X-HE-Tag: crate12_1bab954fcc04c X-Filterd-Recvd-Size: 4499 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by imf14.hostedemail.com (Postfix) with ESMTP for ; Fri, 29 Nov 2019 16:33:09 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Nov 2019 08:33:09 -0800 X-IronPort-AV: E=Sophos;i="5.69,257,1571727600"; d="scan'208";a="217811674" Received: from iweiny-desk2.sc.intel.com (HELO localhost) ([10.3.52.157]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Nov 2019 08:33:09 -0800 From: ira.weiny@intel.com To: Andrew Morton Cc: Alexander Viro , Chris Mason , Josef Bacik , David Sterba , Jaegeuk Kim , Chao Yu , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, Trond Myklebust , Anna Schumaker , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-nfs@vger.kernel.org, linux-mm@kvack.org, Ira Weiny , "Darrick J . Wong" Subject: [PATCH V3 3/3] Documentation/fs: Move swap_[de]activate() to file_operations Date: Fri, 29 Nov 2019 08:33:00 -0800 Message-Id: <20191129163300.14749-4-ira.weiny@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191129163300.14749-1-ira.weiny@intel.com> References: <20191129163300.14749-1-ira.weiny@intel.com> MIME-Version: 1.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Ira Weiny Update the documentation for the move of the swap_* functions out of address_space_operations and into file_operations. Reviewed-by: Darrick J. Wong Reviewed-by: David Sterba Signed-off-by: Ira Weiny --- Changes from V0: Add to original series (now V3) Add reviews Documentation/filesystems/vfs.rst | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Documentation/filesystems/vfs.rst b/Documentation/filesystems/vfs.rst index 7d4d09dd5e6d..03a740d7faa4 100644 --- a/Documentation/filesystems/vfs.rst +++ b/Documentation/filesystems/vfs.rst @@ -731,8 +731,6 @@ cache in your filesystem. The following members are defined: unsigned long); void (*is_dirty_writeback) (struct page *, bool *, bool *); int (*error_remove_page) (struct mapping *mapping, struct page *page); - int (*swap_activate)(struct file *); - int (*swap_deactivate)(struct file *); }; ``writepage`` @@ -924,16 +922,6 @@ cache in your filesystem. The following members are defined: Setting this implies you deal with pages going away under you, unless you have them locked or reference counts increased. -``swap_activate`` - Called when swapon is used on a file to allocate space if - necessary and pin the block lookup information in memory. A - return value of zero indicates success, in which case this file - can be used to back swapspace. - -``swap_deactivate`` - Called during swapoff on files where swap_activate was - successful. - The File Object =============== @@ -988,6 +976,8 @@ This describes how the VFS can manipulate an open file. As of kernel struct file *file_out, loff_t pos_out, loff_t len, unsigned int remap_flags); int (*fadvise)(struct file *, loff_t, loff_t, int); + int (*swap_activate)(struct file *); + int (*swap_deactivate)(struct file *); }; Again, all methods are called without any locks being held, unless @@ -1108,6 +1098,16 @@ otherwise noted. ``fadvise`` possibly called by the fadvise64() system call. +``swap_activate`` + Called when swapon is used on a file to allocate space if + necessary and pin the block lookup information in memory. A + return value of zero indicates success, in which case this file + can be used to back swapspace. + +``swap_deactivate`` + Called during swapoff on files where swap_activate was + successful. + Note that the file operations are implemented by the specific filesystem in which the inode resides. When opening a device node (character or block special) most filesystems will call special