From patchwork Thu Dec 1 22:02:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Weinberger X-Patchwork-Id: 9457093 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DAD6F60515 for ; Thu, 1 Dec 2016 22:03:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CCE6D2852E for ; Thu, 1 Dec 2016 22:03:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C19FE28540; Thu, 1 Dec 2016 22:03:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5DC3F28534 for ; Thu, 1 Dec 2016 22:03:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760990AbcLAWCl (ORCPT ); Thu, 1 Dec 2016 17:02:41 -0500 Received: from mail.sigma-star.at ([95.130.255.111]:46002 "EHLO mail.sigma-star.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760774AbcLAWCk (ORCPT ); Thu, 1 Dec 2016 17:02:40 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.sigma-star.at (Postfix) with ESMTP id 2EE2F24E0003; Thu, 1 Dec 2016 23:02:37 +0100 (CET) Received: from linux.site (richard.vpn.sigmapriv.at [10.3.0.5]) by mail.sigma-star.at (Postfix) with ESMTPSA id 53F2A24E0006; Thu, 1 Dec 2016 23:02:36 +0100 (CET) From: Richard Weinberger To: linux-mtd@lists.infradead.org Cc: david@sigma-star.at, tytso@mit.edu, dedekind1@gmail.com, adrian.hunter@intel.com, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, adilger.kernel@dilger.ca, akpm@linux-foundation.org, linux-ext4@vger.kernel.org, Richard Weinberger Subject: [PATCH 6/6] ubifs: Wire up NFS support Date: Thu, 1 Dec 2016 23:02:21 +0100 Message-Id: <1480629741-18375-7-git-send-email-richard@nod.at> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1480629741-18375-1-git-send-email-richard@nod.at> References: <1480629741-18375-1-git-send-email-richard@nod.at> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since we have 64bit readdir cookies and export operations we can finally enable NFS export support for UBIFS. Signed-off-by: Richard Weinberger --- fs/ubifs/dir.c | 9 ++------- fs/ubifs/super.c | 3 +++ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c index 5485d836af21..13d13afd2976 100644 --- a/fs/ubifs/dir.c +++ b/fs/ubifs/dir.c @@ -289,11 +289,8 @@ static struct dentry *ubifs_lookup(struct inode *dir, struct dentry *dentry, done: kfree(dent); fscrypt_free_filename(&nm); - /* - * Note, d_splice_alias() would be required instead if we supported - * NFS. - */ - d_add(dentry, inode); + + d_splice_alias(inode, dentry); return NULL; out_dent: @@ -524,8 +521,6 @@ static unsigned int vfs_dent_type(uint8_t type) * properly by means of saving full directory entry name in the private field * of the file description object. * - * This means that UBIFS cannot support NFS which requires full - * 'seekdir()'/'telldir()' support. */ static int ubifs_readdir(struct file *file, struct dir_context *ctx) { diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index be5b697d8214..4cb7f641f35c 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c @@ -2092,6 +2092,9 @@ static int ubifs_fill_super(struct super_block *sb, void *data, int silent) goto out_unlock; } + if (c->parent_pointer && c->double_hash) + sb->s_export_op = &ubifs_export_ops; + /* Read the root inode */ root = ubifs_iget(sb, UBIFS_ROOT_INO); if (IS_ERR(root)) {