From patchwork Thu Sep 26 18:42:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benny Halevy X-Patchwork-Id: 2950421 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 831E9BFF0B for ; Thu, 26 Sep 2013 18:42:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4AD522017B for ; Thu, 26 Sep 2013 18:42:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 40CBE20164 for ; Thu, 26 Sep 2013 18:42:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754063Ab3IZSmQ (ORCPT ); Thu, 26 Sep 2013 14:42:16 -0400 Received: from mail-qa0-f54.google.com ([209.85.216.54]:37708 "EHLO mail-qa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753553Ab3IZSmQ (ORCPT ); Thu, 26 Sep 2013 14:42:16 -0400 Received: by mail-qa0-f54.google.com with SMTP id bv4so1092824qab.6 for ; Thu, 26 Sep 2013 11:42:15 -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=Z7RLWSj/7ue3LWJYAo18b6ylQ9LuA/tuUNTV/i9VOes=; b=xp7aTjEoqkoMItcguVyaARwoZx0Y6O1TwKbPrTqUjDj365TF1GybYrVJD5BQSj5BTl BDfEHN10t6kUYLp9LsfhCdcD/bgli1LRwOK2DLvlUc30BOOSuISL+fcm1Gc3W0oRPOEZ PuhqXTzkmiFolWsluBQtEQiamR0y0AuKcz8Hp0nwV5RitWeNglDgVh5oA1wlhu9/C8wO rvMDDbhoVSNT1DYBOZ+qu8+Ek/N0dccNYPumXqL8BIP052bAZlIm9UHEmymhNi4hT3OE fZLRZ8jHK8kz4zeA4azQVGTomVteu+FYKw1NAMZTxFijLh0Ql7Jesbqw+2F405fnaHUt J7Ig== X-Received: by 10.224.157.14 with SMTP id z14mr8638830qaw.90.1380220935211; Thu, 26 Sep 2013 11:42:15 -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 e7sm10269060qag.7.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 26 Sep 2013 11:42:14 -0700 (PDT) From: Benny Halevy To: " J. Bruce Fields" Cc: linux-nfs@vger.kernel.org Subject: [PATCH RFC v0 35/49] pnfsd: nfsd4_pnfs_dlm_getdeviter Date: Thu, 26 Sep 2013 14:42:12 -0400 Message-Id: <1380220932-14302-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: Andy Adamson Export nfsd4_pnfs_dlm_getdeviter for dlm cluster file system use. [was pnfsd: hardwire DLM cluster file layout get device iterator] Signed-off-by: David M. Richter Signed-off-by: Frank Filz [pnfs-gfs2: return correct error value in GETDEVICEINFO] Signed-off-by: David M. Richter [Use the GFS2 iterator as the default file layout iterator.] Signed-off-by: Andy Adamson [Add the pnfsd default file layout getdevice info] Signed-off-by: David M. Richter Signed-off-by: Frank Filz [pnfs-gfs2: return correct error value in GETDEVICEINFO] Signed-off-by: David M. Richter [pnfsd: move and rename nfsd4_pnfs_fl_getdeviter] Signed-off-by: Andy Adamson Signed-off-by: Benny Halevy Acked-by: Steven Whitehouse [pnfsd: dev_iter: clean up export API] [pnfsd: dlm: fixup LAYOUT_NFSV4_1_FILES] Signed-off-by: Benny Halevy Signed-off-by: Benny Halevy --- fs/nfsd/nfs4pnfsdlm.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/fs/nfsd/nfs4pnfsdlm.c b/fs/nfsd/nfs4pnfsdlm.c index ddc2188..0a14f06 100644 --- a/fs/nfsd/nfs4pnfsdlm.c +++ b/fs/nfsd/nfs4pnfsdlm.c @@ -21,8 +21,11 @@ * ******************************************************************************/ +#include +#include #include #include +#include #include #define NFSDDBG_FACILITY NFSDDBG_FILELAYOUT @@ -180,3 +183,29 @@ void nfsd4_pnfs_dlm_shutdown(void) } spin_unlock(&dlm_device_list_lock); } + +static int nfsd4_pnfs_dlm_getdeviter(struct super_block *sb, + u32 layout_type, + struct nfsd4_pnfs_dev_iter_res *res) +{ + if (layout_type != LAYOUT_NFSV4_1_FILES) { + printk(KERN_ERR "%s: ERROR: layout type isn't 'file' " + "(type: %x)\n", __func__, layout_type); + return -ENOTSUPP; + } + + res->gd_eof = 1; + if (res->gd_cookie) + return -ENOENT; + + res->gd_cookie = 1; + res->gd_verf = 1; + res->gd_devid = 1; + return 0; +} + +/* For use by DLM cluster file systems exported by pNFSD */ +const struct pnfs_export_operations pnfs_dlm_export_ops = { + .get_device_iter = nfsd4_pnfs_dlm_getdeviter, +}; +EXPORT_SYMBOL(pnfs_dlm_export_ops);