Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp8314186ybc; Fri, 29 Nov 2019 08:34:58 -0800 (PST) X-Google-Smtp-Source: APXvYqzDEuHXH7ArrN/QHRyKalnWfCBjnoePTkA0Vn3r8DU/TEi1dnUqVN8W+zJ+b3DGv73P6Uo8 X-Received: by 2002:a17:906:13d4:: with SMTP id g20mr4729606ejc.155.1575045298846; Fri, 29 Nov 2019 08:34:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575045298; cv=none; d=google.com; s=arc-20160816; b=HAWP8HDijgtx+Mw5JvR+idwWsKkjWWVlXr3YbTKbzp1F4oJ/QUOXF8dEnSOYUCMo+g i28L8JG7gOUf4B++qhuu5kllVxoCcJx3fFPKUg6yVjNDJn2DypBmd191gdhiT1tfUtFh WQCXWfVXEX8lVwCfM7iQd9M0JqBZtIAeq1IrhW0OhQBpWOWxZ/ZDI/V93R2wyMSawmgI gY10JzM3bH6OVyAASfmXV5ZvFu8s1AsoyebO1gCoKbx3uK+zQiyiHlwfKfQWb5Ao/w+G WKqTxdH0cjpABotF/TIejg4O3oEiVKIE5ub3T39f937iiz0WPzRQEUztzDn7Ir4lZTKX dWeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=FL0wPyiUJXpbbn1pdNoiTVpNgBOcD3WRtoie2iBiHb4=; b=DmwErRQtl8ZeT70i7Mlvifmr5PWMaAF4iEw5g9YjIfmLWtF2DQVHMT7cEREuGSL/ny k4uuvo59AULHox6rgbfQJS349K2mrl/J3Pk7QPwjJaXIGFclp5y8cUVnztniMBzyPrnv v+R6ufkLNyh6U9fecgLaBcZSIXtvje95Qij7oolvuQCZ5m/rolO3QO/l/S2Lbdj5e/i7 rmY3oYGV1sLE3pcOXIbZT06t/i5uWKt6fO4pplJO1hP708Xhu9Kbw52xxv1+xY7ULUnU 9lP0cZa1Ra7O9IaJareaHXbGA8DxTvT4wA0Ca1kx7OyulPIJe3nwWVScIWCc92cqgMO2 ACHA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bs15si15476695edb.408.2019.11.29.08.34.35; Fri, 29 Nov 2019 08:34:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727300AbfK2QdP (ORCPT + 99 others); Fri, 29 Nov 2019 11:33:15 -0500 Received: from mga09.intel.com ([134.134.136.24]:10816 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727235AbfK2QdL (ORCPT ); Fri, 29 Nov 2019 11:33:11 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Nov 2019 08:33:10 -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 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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. 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 -- 2.21.0