From patchwork Thu Aug 3 18:35:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olga Kornievskaia X-Patchwork-Id: 9879725 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 BF8736037D for ; Thu, 3 Aug 2017 18:35:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C523F287B8 for ; Thu, 3 Aug 2017 18:35:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BA0ED28948; Thu, 3 Aug 2017 18:35:23 +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 7CC65287B8 for ; Thu, 3 Aug 2017 18:35:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751900AbdHCSfV (ORCPT ); Thu, 3 Aug 2017 14:35:21 -0400 Received: from mx144.netapp.com ([216.240.21.25]:11792 "EHLO mx144.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751696AbdHCSfU (ORCPT ); Thu, 3 Aug 2017 14:35:20 -0400 X-IronPort-AV: E=Sophos;i="5.41,317,1498546800"; d="scan'208";a="208885332" Received: from vmwexchts01-prd.hq.netapp.com ([10.122.105.12]) by mx144-out.netapp.com with ESMTP; 03 Aug 2017 11:10:59 -0700 Received: from smtp1.corp.netapp.com (10.57.156.124) by VMWEXCHTS01-PRD.hq.netapp.com (10.122.105.12) with Microsoft SMTP Server id 15.0.1263.5; Thu, 3 Aug 2017 11:35:11 -0700 Received: from localhost.localdomain ([10.63.238.77]) by smtp1.corp.netapp.com (8.13.1/8.13.1/NTAP-1.6) with ESMTP id v73IZ91X022909; Thu, 3 Aug 2017 11:35:11 -0700 (PDT) From: Olga Kornievskaia To: , Subject: [RFC 2/3] NFS define vfs destroy_creds functions Date: Thu, 3 Aug 2017 14:35:07 -0400 Message-ID: <20170803183508.24565-3-kolga@netapp.com> X-Mailer: git-send-email 2.10.1 (Apple Git-78) In-Reply-To: <20170803183508.24565-1-kolga@netapp.com> References: <20170803183508.24565-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 2ac00bf..2146aa5 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 = {