From patchwork Thu Nov 14 23:19:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ira Weiny X-Patchwork-Id: 11244579 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 5EC8B14BC for ; Thu, 14 Nov 2019 23:19:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4927B206F0 for ; Thu, 14 Nov 2019 23:19:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727208AbfKNXTs (ORCPT ); Thu, 14 Nov 2019 18:19:48 -0500 Received: from mga18.intel.com ([134.134.136.126]:23503 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726767AbfKNXTs (ORCPT ); Thu, 14 Nov 2019 18:19:48 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Nov 2019 15:19:47 -0800 X-IronPort-AV: E=Sophos;i="5.68,306,1569308400"; d="scan'208";a="199003287" Received: from iweiny-desk2.sc.intel.com (HELO localhost) ([10.3.52.157]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Nov 2019 15:19:46 -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 Subject: [PATCH] Documentation/fs: Move swap_[de]activate() to file_operations Date: Thu, 14 Nov 2019 15:19:43 -0800 Message-Id: <20191114231943.11220-1-ira.weiny@intel.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Ira Weiny Update the documentation for the move of the swap_* functions out of address_space_operations and into file_operations. Signed-off-by: Ira Weiny Reviewed-by: Darrick J. Wong Reviewed-by: David Sterba --- Follow on to the V2 series sent earlier. If I need to spin a V3 I will squash this into patch 2/2 "fs: Move swap_[de]activate to file_operations" 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