From patchwork Thu Sep 26 18:41:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benny Halevy X-Patchwork-Id: 2950371 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 1F8E99F8A1 for ; Thu, 26 Sep 2013 18:42:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EC0A8202E6 for ; Thu, 26 Sep 2013 18:42:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2FA852017B for ; Thu, 26 Sep 2013 18:42:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754061Ab3IZSl5 (ORCPT ); Thu, 26 Sep 2013 14:41:57 -0400 Received: from mail-qc0-f169.google.com ([209.85.216.169]:39888 "EHLO mail-qc0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753553Ab3IZSl4 (ORCPT ); Thu, 26 Sep 2013 14:41:56 -0400 Received: by mail-qc0-f169.google.com with SMTP id c9so1044387qcz.14 for ; Thu, 26 Sep 2013 11:41:56 -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=7aBc2f63hmxjjFa5hwRHrUUM77S82/H5EijP3Yl4r44=; b=Jn6DBjKNOrrUUL50a2eSw4sX2YQZkz+M9BTRlAoHibO5Hjxget/MICKEgyv4Wq1MsN XrhC5cJ7uNw6qcmMkP4r+UyYvmtd06pM0eOUTSrC7FkCxz2olBvmpS9fziauBx7TZlIX 4NeosuY6HN6R8odCr9vCcmwyh2rl+aQZy7jL13VqbWaNEmuGoIlPLPxUExIsXEIv5vlA pmgzHsBBH0g+bvsfMhMabDRlFWv/Y9YzLbHBJl4bLqvyLVi9XCEpUY8l3lknGYJMNYOA hLoeFnxWmAoD1iqWQN1cQU81BmtQJDGFL1/FaJRf1u7iAeQ4Ik8I2zVoxZiPIRYCRPUb /NjQ== X-Received: by 10.49.129.166 with SMTP id nx6mr3505791qeb.75.1380220915956; Thu, 26 Sep 2013 11:41:55 -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 n9sm10259359qag.8.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 26 Sep 2013 11:41:55 -0700 (PDT) From: Benny Halevy To: " J. Bruce Fields" Cc: linux-nfs@vger.kernel.org Subject: [PATCH RFC v0 30/49] pnfsd: make pnfs server return layout_blksize when the client asks for it Date: Thu, 26 Sep 2013 14:41:53 -0400 Message-Id: <1380220913-14054-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: Tao Guo Signed-off-by: Tao Guo [pnfsd: FATTR4_WORD2_LAYOUT_BLKSIZE is supported only under CONFIG_PNFSD] Signed-off-by: Benny Halevy Signed-off-by: Benny Halevy --- fs/nfsd/nfs4xdr.c | 6 ++++++ fs/nfsd/nfsd.h | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index 83f7147..6781a33 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -2583,6 +2583,12 @@ static int get_parent_attributes(struct svc_export *exp, struct kstat *stat) } else WRITE32(0); /* length */ } + + if (bmval2 & FATTR4_WORD2_LAYOUT_BLKSIZE) { + if ((buflen -= 4) < 0) + goto out_resource; + WRITE32(stat.blksize); + } #endif /* CONFIG_PNFSD */ if (bmval2 & FATTR4_WORD2_SECURITY_LABEL) { status = nfsd4_encode_security_label(rqstp, context, diff --git a/fs/nfsd/nfsd.h b/fs/nfsd/nfsd.h index f49fb0b..d81db6e 100644 --- a/fs/nfsd/nfsd.h +++ b/fs/nfsd/nfsd.h @@ -329,8 +329,14 @@ static inline void nfs4_reset_lease(time_t leasetime) { } NFSD4_SUPPORTED_ATTRS_WORD1 #endif /* CONFIG_PNFSD */ +#if defined(CONFIG_PNFSD) +#define NFSD4_1_SUPPORTED_ATTRS_WORD2 \ + (NFSD4_SUPPORTED_ATTRS_WORD2 | FATTR4_WORD2_SUPPATTR_EXCLCREAT | \ + FATTR4_WORD2_LAYOUT_BLKSIZE) +#else /* CONFIG_PNFSD */ #define NFSD4_1_SUPPORTED_ATTRS_WORD2 \ (NFSD4_SUPPORTED_ATTRS_WORD2 | FATTR4_WORD2_SUPPATTR_EXCLCREAT) +#endif /* CONFIG_PNFSD */ #ifdef CONFIG_NFSD_V4_SECURITY_LABEL #define NFSD4_2_SUPPORTED_ATTRS_WORD2 \