From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from zeniv.linux.org.uk ([195.92.253.2]:40962 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750985AbeEMV0N (ORCPT ); Sun, 13 May 2018 17:26:13 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.87 #1 (Red Hat Linux)) id 1fHyVQ-0007tV-53 for linux-fsdevel@vger.kernel.org; Sun, 13 May 2018 21:26:12 +0000 Date: Sun, 13 May 2018 22:26:12 +0100 From: Al Viro To: linux-fsdevel@vger.kernel.org Subject: [RFC][PATCHES] reducing d_add() use, part 1 Message-ID: <20180513212612.GV30522@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-ID: A lot of d_add() uses are in ->lookup() instances; those really should be d_splice_alias() - that's mandatory for anything exported (and we'd seen people not bothering to convert when adding exports/open-by-fhandle support) *and* it's not costlier than d_add() anyway, in all cases when d_add() wouldn't have caused instant breakage. What's more, d_splice_alias() makes for simpler life in callers - it does the right thing when given ERR_PTR(), which simplifies the logics in quite a few ->lookup() instances. There are trickier cases, but a bunch of those call sites are completely straightforward. See followups, or vfs.git#work.lookup