From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Xin Zhao" Subject: How Linux /proc filesystem convert a fd to the actual pathname? Date: Mon, 20 Aug 2007 22:58:26 -0400 Message-ID: <4ae3c140708201958x3c88b317o2ba9be64177978f5@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit To: linux-kernel , linux-fsdevel Return-path: Received: from wa-out-1112.google.com ([209.85.146.182]:49226 "EHLO wa-out-1112.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751583AbXHUC62 (ORCPT ); Mon, 20 Aug 2007 22:58:28 -0400 Received: by wa-out-1112.google.com with SMTP id j4so970502wah for ; Mon, 20 Aug 2007 19:58:27 -0700 (PDT) Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Hi, In the Linux proc filesystem, /proc/[pid]/fd is a link to the actually the actual pathname of the opened file. I am curious how Linux convert an fd to the pathname? Does it recursively walk back from current dentry to the root? Can someone point me to the right place in the kernel where this functionality is implemented? Many thanks in advance! -x