From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4EE0DC433F5 for ; Mon, 21 Mar 2022 22:42:08 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.94.2) (envelope-from ) id 1nWQj1-0003QZ-Go; Mon, 21 Mar 2022 22:42:06 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nWQj1-0003QS-0v for linux-f2fs-devel@lists.sourceforge.net; Mon, 21 Mar 2022 22:42:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=vvLvw6ht391yjUYTmsiTRWPzb1wMWVVWwatJXs2SWkA=; b=b/IaMHC4bUdCvIuR6fgueMxmi7 jlVFYwp85SgBilHgc396PyPszBBISO/xGR7Wf2FONZjz2nh6Ceo528IXvtUUxEChQMufBK3d1E8/p Igu9jEkcZ3DeZ6PuNK/O2zlaXWtIc1qXQWGYGr1+mmEBFystRHDST+ZPpRsyZfqxq6G0=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To :From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=vvLvw6ht391yjUYTmsiTRWPzb1wMWVVWwatJXs2SWkA=; b=TZUD+pNLu7IRi+TikZhdwrpB6S 0LLrz/SbZZOGQRUdM/7LAEKgdoSAfMm3U7f4IfSuKlu8sAW3T1eVVvBaAUiBH229fR/TmthQb3APF +8TC5TdPdFQNVMho2nKxs0FNqMZ1JVvO5tYfGYn/7ncVFS/L4ziKpNTMjnvw8XeQeje0=; Received: from ams.source.kernel.org ([145.40.68.75]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.94.2) id 1nWQiv-0004UQ-1f for linux-f2fs-devel@lists.sourceforge.net; Mon, 21 Mar 2022 22:42:05 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B7649B819FD for ; Mon, 21 Mar 2022 22:41:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5BBC6C340E8; Mon, 21 Mar 2022 22:41:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647902513; bh=0TiXX+rj7tWcU7Feva2G+b3UK5vwHvZIWYnaJrtBjOg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZTk4kKnqDee3eBR9ryv1O25YiYUr/Xh+rpQWyMEXu59E4FUpgqWPnuXlcrkG0ri+m NuPt/100UNHKeOVata/qcctH1RJWUI0Be8oUJ1mqQafAQ6QwikFSBB973Gsw1mjA6z UCFLQixyrK/kuAfFpU2nbKLO9JRlgl2ZOZqw3CC++jVWToJtFkk7Heq2whigQTolBA 0BGMe5TWkVNw4g0xltJNwkaw5PfkN7ArMMAwHnqA+UEMfQg4WXRRd13g9sFPfm3flZ D+WoE/QHbJmEUe1AfqmmbRTF8cEQvVQ1yVmFxfIcXAh/yL1phG6OeqIarkLkMgfUp7 nK9yE6PtMJnhA== Date: Mon, 21 Mar 2022 22:41:51 +0000 From: Eric Biggers To: Jaegeuk Kim Message-ID: References: <20220321223315.3228326-1-jaegeuk@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220321223315.3228326-1-jaegeuk@kernel.org> X-Headers-End: 1nWQiv-0004UQ-1f Subject: Re: [f2fs-dev] [PATCH] f2fs: introduce data read/write showing path info X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net On Mon, Mar 21, 2022 at 03:33:15PM -0700, Jaegeuk Kim wrote: > This was used in Android for a long time. Let's upstream it. > You still need to explain why this is useful. > +static inline char *f2fs_get_pathname(char *buf, int len, struct inode *inode) > +{ > + char *path; > + struct dentry *d; > + > + /* > + * d_obtain_alias() will either iput() if it locates an existing > + * dentry or transfer the reference to the new dentry created. > + * So get an extra reference here. > + */ > + ihold(inode); > + d = d_obtain_alias(inode); Why does this use d_obtain_alias() to get a dentry instead of just using the dentry of the open file? - Eric _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 587F1C4332F for ; Mon, 21 Mar 2022 22:50:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230108AbiCUWvp (ORCPT ); Mon, 21 Mar 2022 18:51:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230355AbiCUWv2 (ORCPT ); Mon, 21 Mar 2022 18:51:28 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BED6341FA7 for ; Mon, 21 Mar 2022 15:41:54 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 10097611F4 for ; Mon, 21 Mar 2022 22:41:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5BBC6C340E8; Mon, 21 Mar 2022 22:41:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647902513; bh=0TiXX+rj7tWcU7Feva2G+b3UK5vwHvZIWYnaJrtBjOg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZTk4kKnqDee3eBR9ryv1O25YiYUr/Xh+rpQWyMEXu59E4FUpgqWPnuXlcrkG0ri+m NuPt/100UNHKeOVata/qcctH1RJWUI0Be8oUJ1mqQafAQ6QwikFSBB973Gsw1mjA6z UCFLQixyrK/kuAfFpU2nbKLO9JRlgl2ZOZqw3CC++jVWToJtFkk7Heq2whigQTolBA 0BGMe5TWkVNw4g0xltJNwkaw5PfkN7ArMMAwHnqA+UEMfQg4WXRRd13g9sFPfm3flZ D+WoE/QHbJmEUe1AfqmmbRTF8cEQvVQ1yVmFxfIcXAh/yL1phG6OeqIarkLkMgfUp7 nK9yE6PtMJnhA== Date: Mon, 21 Mar 2022 22:41:51 +0000 From: Eric Biggers To: Jaegeuk Kim Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Subject: Re: [f2fs-dev] [PATCH] f2fs: introduce data read/write showing path info Message-ID: References: <20220321223315.3228326-1-jaegeuk@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220321223315.3228326-1-jaegeuk@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 21, 2022 at 03:33:15PM -0700, Jaegeuk Kim wrote: > This was used in Android for a long time. Let's upstream it. > You still need to explain why this is useful. > +static inline char *f2fs_get_pathname(char *buf, int len, struct inode *inode) > +{ > + char *path; > + struct dentry *d; > + > + /* > + * d_obtain_alias() will either iput() if it locates an existing > + * dentry or transfer the reference to the new dentry created. > + * So get an extra reference here. > + */ > + ihold(inode); > + d = d_obtain_alias(inode); Why does this use d_obtain_alias() to get a dentry instead of just using the dentry of the open file? - Eric