Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755331AbdC1SRM (ORCPT ); Tue, 28 Mar 2017 14:17:12 -0400 Received: from mailrelay105.isp.belgacom.be ([195.238.20.132]:54788 "EHLO mailrelay105.isp.belgacom.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753027AbdC1SRK (ORCPT ); Tue, 28 Mar 2017 14:17:10 -0400 X-Belgacom-Dynamic: yes IronPort-PHdr: =?us-ascii?q?9a23=3A608qDhKRT64SaBxgXdmcpTZWNBhigK39O0sv0rFi?= =?us-ascii?q?tYgRLPzxwZ3uMQTl6Ol3ixeRBMOAuq8C27ed7/qocFdDyK7JiGoFfp1IWk1Nou?= =?us-ascii?q?QttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXdrXKo8DEdBAj0OxZr?= =?us-ascii?q?KeTpAI7SiNm82/yv95HJbQhFgDqwbalxIRi2ogncudcaipZ+J6gszRfEvmFGcP?= =?us-ascii?q?lMy2NyIlKTkRf85sOu85Nm7i9dpfEv+dNeXKvjZ6g3QqBWAzogM2Au+c3krgLD?= =?us-ascii?q?QheV5nsdSWoZjBxFCBXY4R7gX5fxtiz6tvdh2CSfIMb7Q6w4VSik4qx2UxLjlj?= =?us-ascii?q?sJOCAl/2HWksxwjbxUoBS9pxxk3oXYZJiZOOdicq/BeN8XQ3dKUMRMWCxbGo6y?= =?us-ascii?q?b5UBAfcPM+hbqIfwvEcCoQekCAWwHu7j1iNEi3nr1qM6yeQhFgTG0RQgEd0Uq3?= =?us-ascii?q?vUrc/6NKEPWu611qnH0yjMYO1M2Tf89IfIcQ0qrPaCXb1qasXRx1IiFxjGjlSQ?= =?us-ascii?q?r4zqIS+V2v4WvGeF9udtU/+khW0/qwxpoTWj290ghpfGi48a0FzI6D91zJg6KN?= =?us-ascii?q?C6TkNwfMSqH4FKty6AMot7WsYiQ2Z1tykk0rAGopu7fDQSyJQg2h7fd+SLc4iW?= =?us-ascii?q?7RLnU+acOTN4hHV5d72lgxay8U+gyvbgVsWu1FZKqTZKncPItn8Q0BzT79KISv?= =?us-ascii?q?p7/ku52DaP0R7c6v1cLE03iKbXMYAtz7E/m5YJrEjPBDH6lUr0gaOOc0Ur4Omo?= =?us-ascii?q?6+DpYrX8oZ+cMpd5ig/kPas1lMyyGv84MgsOXmid5+u8yKfv8lbnT7lSlP05jr?= =?us-ascii?q?HZsIzGJcQcvqO5GBVa0oI55Ba/FTumzM4YnXgELFJEYx+HgI3pNEvPIPD8F/uw?= =?us-ascii?q?n1OskDI4j8zBa5n8A46FInWLurr9fbt74ElB0hZ7mdRC5oleBZkGO/21QUb0r8?= =?us-ascii?q?HeAVkyNAnikMj9D9Ao+IoUWGuJSoGDPa/fq16D5ap7LeCGaqcOuyf7JuRj7fO4?= =?us-ascii?q?3ixxokMUYaT8hchfU3u/BPkzZhzBOXc=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2AJAwBNp9pY//cB9FFdHAwGgmtrJxqBK?= =?us-ascii?q?45kkQYBkxOCD4IOH4YDgyRAGAEBAQEBAQEBAQEBaiiCMyIBgm0vI4EaJBOJehG?= =?us-ascii?q?vDTqEEIZvhk6MXoJKBZxgkkINkTOTah84gQQ6HBiESQFPHYFlPjWJUgEBAQ?= X-IPAS-Result: =?us-ascii?q?A2AJAwBNp9pY//cB9FFdHAwGgmtrJxqBK45kkQYBkxOCD4I?= =?us-ascii?q?OH4YDgyRAGAEBAQEBAQEBAQEBaiiCMyIBgm0vI4EaJBOJehGvDTqEEIZvhk6MX?= =?us-ascii?q?oJKBZxgkkINkTOTah84gQQ6HBiESQFPHYFlPjWJUgEBAQ?= From: Fabian Frederick To: Luis de Bethencourt Cc: Salah Triki , Alexander Viro , linux-kernel@vger.kernel.org, fabf@skynet.be Subject: [PATCH 1/1 linux-next] befs: make export work with cold dcache Date: Tue, 28 Mar 2017 20:16:46 +0200 Message-Id: <20170328181646.5838-1-fabf@skynet.be> X-Mailer: git-send-email 2.9.3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1687 Lines: 53 based on commit b3b42c0deaa1 ("fs/affs: make export work with cold dcache") This adds get_parent function so that nfs client can still work after cache drop (Tested on NFS v4 with echo 3 > /proc/sys/vm/drop_caches) Signed-off-by: Fabian Frederick --- fs/befs/linuxvfs.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c index c500e95..63e7c47 100644 --- a/fs/befs/linuxvfs.c +++ b/fs/befs/linuxvfs.c @@ -58,6 +58,7 @@ static struct dentry *befs_fh_to_dentry(struct super_block *sb, struct fid *fid, int fh_len, int fh_type); static struct dentry *befs_fh_to_parent(struct super_block *sb, struct fid *fid, int fh_len, int fh_type); +static struct dentry *befs_get_parent(struct dentry *child); static const struct super_operations befs_sops = { .alloc_inode = befs_alloc_inode, /* allocate a new inode */ @@ -93,6 +94,7 @@ static const struct address_space_operations befs_symlink_aops = { static const struct export_operations befs_export_operations = { .fh_to_dentry = befs_fh_to_dentry, .fh_to_parent = befs_fh_to_parent, + .get_parent = befs_get_parent, }; /* @@ -667,6 +669,19 @@ static struct dentry *befs_fh_to_parent(struct super_block *sb, befs_nfs_get_inode); } +static struct dentry *befs_get_parent(struct dentry *child) +{ + struct inode *parent; + struct befs_inode_info *befs_ino = BEFS_I(d_inode(child)); + + parent = befs_iget(child->d_sb, + (unsigned long)befs_ino->i_parent.start); + if (IS_ERR(parent)) + return ERR_CAST(parent); + + return d_obtain_alias(parent); +} + enum { Opt_uid, Opt_gid, Opt_charset, Opt_debug, Opt_err, }; -- 2.9.3