From: "Fawad Lateef" <fawadlateef@gmail.com>
To: "UZAIR LAKHANI" <uzairr_bs1b@yahoo.com>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: getting file pointer from dentry/inode
Date: Thu, 4 May 2006 16:14:49 +0500 [thread overview]
Message-ID: <1e62d1370605040414j4987a5f6x5acd63b6d14d56b3@mail.gmail.com> (raw)
In-Reply-To: <20060504094513.75349.qmail@web37901.mail.mud.yahoo.com>
On 5/4/06, UZAIR LAKHANI <uzairr_bs1b@yahoo.com> wrote:
> Hello All,
>
> I want to find out how the file pointer from
> inode/dentry can be get. For example we can get inode
> pointer by using iget. In the struct file we can get
> inode/dentry (filp->f_dentry->d_inode) but how can we
> reversely get the struct file pointer from
> dentry/inode etc.
>
You can try to get the filp from filp->f_dentry->d_inode using the
same way as list_entry macro in include/linux/list.h do and you have
to do that list_entry kind of stuff two times to get to the filp from
d_inode (as in one pass you can get f_dentry and then from f_dentry
you can get to filp). I hope it will help but can't say that its a
good way !
> Secondly is this logically correct to get the file
> pointer from inode/dentry etc.
>
I can't say doing this is logically correct or not, but I can say if
this really helps and you won't able to get the better way of
accessing filp then you can do so or other people might give you some
better idea but they probably need to know why and where you want to
do this :)
--
Fawad Lateef
prev parent reply other threads:[~2006-05-04 11:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-04 9:45 getting file pointer from dentry/inode UZAIR LAKHANI
2006-05-04 10:02 ` Tomas Hruby
2006-05-04 10:48 ` UZAIR LAKHANI
2006-05-04 11:23 ` Fawad Lateef
2006-05-04 11:14 ` Fawad Lateef [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1e62d1370605040414j4987a5f6x5acd63b6d14d56b3@mail.gmail.com \
--to=fawadlateef@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=uzairr_bs1b@yahoo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).