From patchwork Thu Sep 26 18:40:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benny Halevy X-Patchwork-Id: 2950131 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6641E9F288 for ; Thu, 26 Sep 2013 18:40:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 503E9202F8 for ; Thu, 26 Sep 2013 18:40:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 26079202DD for ; Thu, 26 Sep 2013 18:40:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752967Ab3IZSkT (ORCPT ); Thu, 26 Sep 2013 14:40:19 -0400 Received: from mail-qa0-f45.google.com ([209.85.216.45]:50407 "EHLO mail-qa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752447Ab3IZSkS (ORCPT ); Thu, 26 Sep 2013 14:40:18 -0400 Received: by mail-qa0-f45.google.com with SMTP id k4so4622889qaq.18 for ; Thu, 26 Sep 2013 11:40:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=0Wz96N31WSZEmbIeiOmGXqYX+Yb3Uc0EWHCf3SZ+N1Y=; b=Vl2rJhfqxaRzCccT3xQXcHy2uPBVnbD1ytoMsVh0MnYmXZba+V6si1GW+7qVFTsELN MwcGY2bOL80MJPj6EFfy7kqgCNMuz7O7zHVOxJElpVy0Css7wo8NQx3kEXy543lHdNC4 XPgMSH4pFTKLnmBZiPw509ivNF4dzdC9rZK9YwO+F0xK98OvsN2c+BWt3OdMIsmtvwc3 29qT5qRnb9gPNIKzFqL4fs6gIefuBxjNfGicDsCxiJyR1ZBKfRpaCyxUDBN+0FUbvpl5 GvFi4CV7+QUNbRKFgdVfwGq3X8ZtaQMfaElj4j8dld5MCRXqiJko91cVkMjxtzqpGW9s eNxw== X-Received: by 10.224.8.65 with SMTP id g1mr8686581qag.68.1380220817933; Thu, 26 Sep 2013 11:40:17 -0700 (PDT) Received: from bhalevy-lt.il.tonian.com.com (nat-pool-bos-u.redhat.com. [66.187.233.207]) by mx.google.com with ESMTPSA id l2sm10231913qad.10.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 26 Sep 2013 11:40:17 -0700 (PDT) From: Benny Halevy To: " J. Bruce Fields" Cc: linux-nfs@vger.kernel.org Subject: [PATCH RFC v0 06/49] pnfsd: define pnfs_export_operations Date: Thu, 26 Sep 2013 14:40:15 -0400 Message-Id: <1380220815-12955-1-git-send-email-bhalevy@primarydata.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <52447EA0.7070004@primarydata.com> References: <52447EA0.7070004@primarydata.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-9.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Benny Halevy struct pnfs_export_operations defines the VFS level API for pNFS, not including callbacks. A pnfs-exportable filesystem sets a pointer to its pnfs export vector in its struct super_block.s_pnfs_op. The file system provides the per-superblock layout_type method that determines if it supports pnfs for the filesystem identified by the superblock, and if so, with which layout type (only one per-sb is supported). Device ops: get_device_iter is used to fill-in the device list for GETDEVICELIST and get_device_info is used to encode the device info for GETDEVICEINFO. Layout ops: layout_get, layout_commit, and layout_return implement the file system- and layout type- specific parts of their respective protocol operations: LAYOUTGET, LAYOUTCOMMIT, and LAYOUTRETURN. The following methods are mandatory to be implemented: layout_type, get_device_info, and layout_get. Note: define pnfs export operations in a stub form in this patch. Actual operations are defined along with their usage. [pnfsd: provide default no-op operations] Signed-off-by: Benny Halevy [pnfsd: compile fixes for pnfsd branch] Signed-off-by: Fred Isaman [gfs2: set pnfs_dlm_export_ops only for CONFIG_PNFSD] [pnfsd: handle s_pnfs_op==NULL] Signed-off-by: Benny Halevy Signed-off-by: Benny Halevy --- fs/nfsd/export.c | 2 +- include/linux/fs.h | 2 ++ include/linux/nfsd/nfsd4_pnfs.h | 14 ++++++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c index 5f38ea3..f26b0b9 100644 --- a/fs/nfsd/export.c +++ b/fs/nfsd/export.c @@ -16,7 +16,7 @@ #include #include #include - +#include #include #include "nfsd.h" diff --git a/include/linux/fs.h b/include/linux/fs.h index 3f40547..d9186a4 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -34,6 +34,7 @@ #include struct export_operations; +struct pnfs_export_operations; struct hd_geometry; struct iovec; struct nameidata; @@ -1251,6 +1252,7 @@ struct super_block { const struct dquot_operations *dq_op; const struct quotactl_ops *s_qcop; const struct export_operations *s_export_op; + const struct pnfs_export_operations *s_pnfs_op; unsigned long s_flags; unsigned long s_magic; struct dentry *s_root; diff --git a/include/linux/nfsd/nfsd4_pnfs.h b/include/linux/nfsd/nfsd4_pnfs.h index 9e7d95e..ff6613e 100644 --- a/include/linux/nfsd/nfsd4_pnfs.h +++ b/include/linux/nfsd/nfsd4_pnfs.h @@ -34,4 +34,18 @@ #ifndef _LINUX_NFSD_NFSD4_PNFS_H #define _LINUX_NFSD_NFSD4_PNFS_H +/* + * pNFS export operations vector. + * + * The filesystem must implement the following methods: + * layout_type + * get_device_info + * layout_get + * + * All other methods are optional and can be set to NULL if not implemented. + */ +struct pnfs_export_operations { + /* stub */ +}; + #endif /* _LINUX_NFSD_NFSD4_PNFS_H */