From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from bedivere.hansenpartnership.com ([66.63.167.143]:57812 "EHLO bedivere.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752384AbcEVQjk (ORCPT ); Sun, 22 May 2016 12:39:40 -0400 Message-ID: <1463935173.2257.6.camel@HansenPartnership.com> Subject: Re: [PATCH 1/3] vfs: merge .d_select_inode() into .d_real() From: James Bottomley To: Miklos Szeredi , Al Viro Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, David Howells Date: Sun, 22 May 2016 09:39:33 -0700 In-Reply-To: <20160517215326.GA1589@veci.piliscsaba.szeredi.hu> References: <20160517215326.GA1589@veci.piliscsaba.szeredi.hu> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue, 2016-05-17 at 23:53 +0200, Miklos Szeredi wrote: > The two methods essentially do the same: find the real dentry/inode > belonging to an overlay dentry. The difference is in the usage: > > vfs_open() uses ->d_select_inode() and expects the function to > perform copy-up if necessary based on the open flags argument. > > file_dentry() uses ->d_real() passing in the overlay dentry as well > as the underlying inode. > > vfs_rename() uses ->d_select_inode() but passes zero flags. > ->d_real() with a zero inode would have worked just as well here. > > This patch merges the functionality of ->d_select_inode() into > ->d_real() by adding an 'open_flags' argument to the latter. Actually, before you do this, I have a use case for keeping them separate: The shiftfs prototype I've posted cannot use d_select_inode because it's shifting the uid/gids, so the inode permissions have to be done on the upper inode. However, several filesystems make use of file_dentry() and for them, I need to supply the lower dentry, so I end up setting d_real but not d_select_inode. for me, then vfs_open and vfs_rename have to operate on the upper inode but all uses of file_dentry should return the lower dentry. James