From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sergio Paracuellos Subject: Re: Problems with current file descriptor Date: Thu, 27 Oct 2005 11:06:03 +0200 Message-ID: <1130403963.2864.19.camel@localhost.localdomain> References: <1130341392.3278.0.camel@localhost.localdomain> <16f1140f0510261934i51c53da1m@mail.gmail.com> <1130397606.2864.4.camel@localhost.localdomain> <16f1140f0510270130t1609905as@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from duero.optyma.com ([213.254.241.67]:10895 "EHLO duero.optyma.com") by vger.kernel.org with ESMTP id S965015AbVJ0JGI (ORCPT ); Thu, 27 Oct 2005 05:06:08 -0400 To: LINUX-Fs-DEVEL , winter In-Reply-To: <16f1140f0510270130t1609905as@mail.gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org El jue, 27-10-2005 a las 16:30 +0800, winter escribi=C3=B3: > 2005/10/27, Sergio Paracuellos : > > > current file ?what is meaning? > > > for exmaple ,you opened 3 file, file1,file2, file3. which is curr= ent file? > > > > Sorry, I want the last file I used. For example if I just have done= "cat > > foobar" the file I want is this. > > > if you used the command "cat foobar", the linux kernel's do the > following 3 phase for you: > 1. open() --> sys_open() // in this phase, the filp struct is > create and save at > // current->files->fd[x]. the= x=3Dfd. > 2. read() --> sys_read() // in this phase, read file's data, the > fd is not changed. > 3. close() --> sys_close() // in this phase, free the filp struct. > the result is > // current->files->fd[fd] =3D = 0. > so it is, kernel can not save the last file which you opend. > which phase you want get the path at? The problem is I need to get complete path in lookup(). Lookup is the first thig kernel execute and in lookup I can't get complete path because I have a dentry structure... cat foobar was an example I need to get the path in other operations to= o like "write..." but always in lookup function. Any ideas about it? Thanks in advance, Sergio > - > To unsubscribe from this list: send the line "unsubscribe linux-fsdev= el" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html - To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html