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:26:49 +0200 Message-ID: <1130405210.2864.25.camel@localhost.localdomain> References: <1130341392.3278.0.camel@localhost.localdomain> <16f1140f0510261934i51c53da1m@mail.gmail.com> <1130397606.2864.4.camel@localhost.localdomain> <16f1140f0510270130t1609905as@mail.gmail.com> <1130403963.2864.19.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: winter Return-path: Received: from duero.optyma.com ([213.254.241.67]:1172 "EHLO duero.optyma.com") by vger.kernel.org with ESMTP id S965004AbVJ0J0z (ORCPT ); Thu, 27 Oct 2005 05:26:55 -0400 To: LINUX-Fs-DEVEL In-Reply-To: <1130403963.2864.19.camel@localhost.localdomain> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org El jue, 27-10-2005 a las 11:06 +0200, Sergio Paracuellos escribi=C3=B3: > 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 cu= rrent file? > > > > > > Sorry, I want the last file I used. For example if I just have do= ne "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]. t= he x=3Dfd. > > 2. read() --> sys_read() // in this phase, read file's data, t= he > > fd is not changed. > > 3. close() --> sys_close() // in this phase, free the filp struct= =2E > > 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? >=20 > 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... >=20 > cat foobar was an example I need to get the path in other operations = too > like "write..." but always in lookup function. >=20 > Any ideas about it? >=20 > Thanks in advance, >=20 > Sergio I solve my problem. I was wrong in my code. I was using like dentry current->fs->pwd but I had to use the dentry in use in lookup function. Thanks to all.=20 Cheers, Sergio > > - > > To unsubscribe from this list: send the line "unsubscribe linux-fsd= evel" in > > the body of a message to majordomo@vger.kernel.org > > More majordomo info at http://vger.kernel.org/majordomo-info.html >=20 > - > 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