From patchwork Mon Aug 7 21:23:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olga Kornievskaia X-Patchwork-Id: 9886213 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 EAE9660364 for ; Mon, 7 Aug 2017 21:24:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB14C2018E for ; Mon, 7 Aug 2017 21:24:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D01052817F; Mon, 7 Aug 2017 21:24:08 +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 9053E2018E for ; Mon, 7 Aug 2017 21:24:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751962AbdHGVYF (ORCPT ); Mon, 7 Aug 2017 17:24:05 -0400 Received: from mx142.netapp.com ([216.240.21.19]:1517 "EHLO mx142.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751761AbdHGVYD (ORCPT ); Mon, 7 Aug 2017 17:24:03 -0400 X-IronPort-AV: E=Sophos;i="5.41,339,1498546800"; d="scan'208";a="204763574" Received: from vmwexchts03-prd.hq.netapp.com ([10.122.105.31]) by mx142-out.netapp.com with ESMTP; 07 Aug 2017 14:01:26 -0700 Received: from smtp1.corp.netapp.com (10.122.76.128) by VMWEXCHTS03-PRD.hq.netapp.com (10.122.105.31) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Mon, 7 Aug 2017 14:24:01 -0700 Received: from localhost.localdomain ([10.63.226.31]) by smtp1.corp.netapp.com (8.14.9+Sun/8.13.1/NTAP-1.6) with ESMTP id v77LNvnV013190; Mon, 7 Aug 2017 14:24:01 -0700 (PDT) From: Olga Kornievskaia To: , , Subject: [RFC v3 3/3] NFS define vfs destroy_creds functions Date: Mon, 7 Aug 2017 17:23:55 -0400 Message-ID: <20170807212355.29127-5-kolga@netapp.com> X-Mailer: git-send-email 2.10.1 (Apple Git-78) In-Reply-To: <20170807212355.29127-1-kolga@netapp.com> References: <20170807212355.29127-1-kolga@netapp.com> MIME-Version: 1.0 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 Define the destroy_creds function for the NFS directory. Signed-off-by: Olga Kornievskaia --- fs/nfs/dir.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 3522b12..44f1b1e 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -54,6 +54,13 @@ static loff_t nfs_llseek_dir(struct file *, loff_t, int); static void nfs_readdir_clear_array(struct page*); +static int nfs_destroy_creds(struct file *file) +{ + struct rpc_auth *auth = NFS_SERVER(file_inode(file))->client->cl_auth; + + return rpcauth_key_set_destroy(auth, rpc_lookup_cred()); +} + const struct file_operations nfs_dir_operations = { .llseek = nfs_llseek_dir, .read = generic_read_dir, @@ -61,6 +68,7 @@ .open = nfs_opendir, .release = nfs_closedir, .fsync = nfs_fsync_dir, + .destroy_creds = nfs_destroy_creds, }; const struct address_space_operations nfs_dir_aops = {