From patchwork Thu Sep 26 18:41:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benny Halevy X-Patchwork-Id: 2950381 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 0A79B9F288 for ; Thu, 26 Sep 2013 18:42:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DD1DE20164 for ; Thu, 26 Sep 2013 18:42:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EB6FB202E5 for ; Thu, 26 Sep 2013 18:42:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754062Ab3IZSmB (ORCPT ); Thu, 26 Sep 2013 14:42:01 -0400 Received: from mail-qc0-f170.google.com ([209.85.216.170]:48249 "EHLO mail-qc0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753553Ab3IZSmA (ORCPT ); Thu, 26 Sep 2013 14:42:00 -0400 Received: by mail-qc0-f170.google.com with SMTP id m20so1048253qcx.29 for ; Thu, 26 Sep 2013 11:42:00 -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=++oLEvJR3i+PHCQQNaOA69GK33RgKTWjOccmMKoJ0BY=; b=Ze3jFybwvlUHwdIfrqDY9zpt5m/mVNF2xyvP8rQV+qLUojO9pV7pQczvrffb8s9jyJ c+/iBfa11WSyj9jPrz64mPPqLE9m+A8kqBZKEFy6+r2W1JpLiygRbgKnufawqBT3cOUj H7o/9b8mwBM72ZYvnfvpDm420btogxrC7b8ZvUdyas03sSAaEEJnWkOehxYMK3hvJRO9 5qnNVyt8IE9fr0AGEhqpocakn7AiSYe2otk83vYB5qcoGV/hSi0E+1ZL/+ELfzlBwGCP dnt4hfO/7E0oPxIDaI65mBLAZ85BDul3y1FO5OqId4r47R86153Z+ft+Ln9DkWL5gBGO KD9g== X-Received: by 10.224.3.5 with SMTP id 5mr8796627qal.10.1380220920136; Thu, 26 Sep 2013 11:42:00 -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 y9sm10252786qaj.9.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 26 Sep 2013 11:41:59 -0700 (PDT) From: Benny Halevy To: " J. Bruce Fields" Cc: linux-nfs@vger.kernel.org Subject: [PATCH RFC v0 31/49] pnfsd: add support for per-file layout_types attribute Date: Thu, 26 Sep 2013 14:41:57 -0400 Message-Id: <1380220917-14099-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 Currently, just return the same per-fs layout types Signed-off-by: Benny Halevy --- fs/nfsd/nfs4xdr.c | 3 ++- fs/nfsd/nfsd.h | 2 +- include/linux/nfs4.h | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index 6781a33..1a50467 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -2561,7 +2561,8 @@ static int get_parent_attributes(struct svc_export *exp, struct kstat *stat) WRITE64(stat.ino); } #if defined(CONFIG_PNFSD) - if (bmval1 & FATTR4_WORD1_FS_LAYOUT_TYPES) { + if ((bmval1 & FATTR4_WORD1_FS_LAYOUT_TYPES) || + (bmval2 & FATTR4_WORD2_LAYOUT_TYPES)) { struct super_block *sb = dentry->d_inode->i_sb; int type = 0; diff --git a/fs/nfsd/nfsd.h b/fs/nfsd/nfsd.h index d81db6e..87aa3aa 100644 --- a/fs/nfsd/nfsd.h +++ b/fs/nfsd/nfsd.h @@ -332,7 +332,7 @@ static inline void nfs4_reset_lease(time_t leasetime) { } #if defined(CONFIG_PNFSD) #define NFSD4_1_SUPPORTED_ATTRS_WORD2 \ (NFSD4_SUPPORTED_ATTRS_WORD2 | FATTR4_WORD2_SUPPATTR_EXCLCREAT | \ - FATTR4_WORD2_LAYOUT_BLKSIZE) + FATTR4_WORD2_LAYOUT_TYPES | FATTR4_WORD2_LAYOUT_BLKSIZE) #else /* CONFIG_PNFSD */ #define NFSD4_1_SUPPORTED_ATTRS_WORD2 \ (NFSD4_SUPPORTED_ATTRS_WORD2 | FATTR4_WORD2_SUPPATTR_EXCLCREAT) diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index 2c3aa9f..7f6e548 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h @@ -398,6 +398,7 @@ enum lock_type4 { #define FATTR4_WORD1_TIME_MODIFY_SET (1UL << 22) #define FATTR4_WORD1_MOUNTED_ON_FILEID (1UL << 23) #define FATTR4_WORD1_FS_LAYOUT_TYPES (1UL << 30) +#define FATTR4_WORD2_LAYOUT_TYPES (1UL << 0) #define FATTR4_WORD2_LAYOUT_BLKSIZE (1UL << 1) #define FATTR4_WORD2_MDSTHRESHOLD (1UL << 4) #define FATTR4_WORD2_SECURITY_LABEL (1UL << 17)