From: Robert Hancock <hancockr@shaw.ca>
To: "hectorlas@yahoo.com" <hectorlas@yahoo.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: Access to struct file in scsi_request_fn()?
Date: Thu, 03 Apr 2008 22:20:34 -0600 [thread overview]
Message-ID: <47F5AC92.2050003@shaw.ca> (raw)
In-Reply-To: <cffffbd9-8d29-4c23-a7f9-315d1d519ed6@d45g2000hsc.googlegroups.com>
hectorlas@yahoo.com wrote:
> Here's the short question: Is there a way to access the struct file
> associated with a write() within the libATA code?
>
> I've been documenting the semi-direct execution path from a file I/O
> open() call down to the ata_scsi_rw_xlat() call in libATA. I'd like
> to modify my local libATA code to do something based on the file being
> operated on using a flag that I still need to store in struct file,
> perhaps through the private_data field (I haven't worked that out
> yet). The scsi_request_fn() gets a struct request_queue argument that
> has a lot of contexts in it. Could anyone help me with information on
> whether the struct file * is in it somewhere? I know there's some
> kind of cohesion between submitting the scsi command and its
> completion function, but I'm not quite seeing it yet.
>
> That was painful to write, I'm sure it was painful to read, sorry
> about that. I'm learning more and more as I go, but the big picture
> is still escaping me.
>
> Thanks.
> Hector
I think that this is likely not a good approach for whatever you're
attempting to do (and you would likely get better responses if you
described what exactly that is). By the time libata or even the SCSI
layer gets a write request, that is pretty well removed from the
original file operation. They may be quite highly separated in time due
to write buffering for one thing.
parent reply other threads:[~2008-04-04 4:23 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <cffffbd9-8d29-4c23-a7f9-315d1d519ed6@d45g2000hsc.googlegroups.com>]
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=47F5AC92.2050003@shaw.ca \
--to=hancockr@shaw.ca \
--cc=hectorlas@yahoo.com \
--cc=linux-kernel@vger.kernel.org \
/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).