Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Write Inode Callback

6 views
Skip to first unread message

uprugist

unread,
May 9, 2005, 12:21:14 AM5/9/05
to
Hello,
I am totally confused about the way system behaves with callbacks.
I'll use writeInodeCallback as an example(the one I am trying to
grasp).
The way I see callbacks is a sort of a state machine, that performs
certain actions at each state.
writeInodeCallback recieves an OSEvent ev, as the only way of
interaction with the outside world. For Writing an Inode I see only
one state ST_INODE_WRITE, so this is my first question - what does it
do: just call a block write on that block and block that process? If
yes, then why do we even need to block that process, we are just
writing to bufferCache, and that shouldn't create a disk access
latency.
Lev.

Eric Tschetter

unread,
May 9, 2005, 1:46:18 AM5/9/05
to

It could create a disk access, not all inodes are in the block that houses
the directory inode.

I don't have my code in front of me, so I don't remember exactly what it was
supposed to do, but if you look at how writeInodeCallback gets called (I
believe it is done through the OS, though I might be wrong), it should
become clear as to what that method has left to do (that is, after
writeInodeReq has already done its thing).

--Eric


Mohnish Rao

unread,
May 9, 2005, 2:44:44 AM5/9/05
to
Yeah I was really confused about the callback mechanism too. Take a look at
the OS "interrupt" method. It helped explain a lot.

"Eric Tschetter" <er...@mail.utexas.edu> wrote in message
news:d5mtfg$cj5$1...@news.cs.utexas.edu...

uprugist

unread,
May 9, 2005, 2:29:21 PM5/9/05
to
Yeah, but who is suppose to generate an interrupt, my understanding is
that it should be BufferCache, because it is the one handling disks. It is
unclear to me as to how we are suppose to use interrupts.
Lev.

Adrian Kubala

unread,
May 9, 2005, 3:04:06 PM5/9/05
to
uprugist <l...@cs.utexas.edu> schrieb:

> Yeah, but who is suppose to generate an interrupt, my understanding is
> that it should be BufferCache, because it is the one handling disks.

You set the values in the interrupt in VFS and pass it to BufferCache,
which passes it to BlockDriver, which passes it to Disk, which schedules
it to get called when the IO is done.

Manu Bangia

unread,
May 9, 2005, 4:03:55 PM5/9/05
to
Might be a really dumb question but what values do you assign the
"interrupt"? When you say interrupt, you mean the calling the callback
methods right using the OSEvent to pass values?

Adrian Kubala

unread,
May 9, 2005, 6:48:14 PM5/9/05
to
Manu Bangia <ma...@mail.utexas.edu> schrieb:

> Adrian Kubala wrote:
>> You set the values in the interrupt in VFS and pass it to BufferCache,
>> which passes it to BlockDriver, which passes it to Disk, which schedules
>> it to get called when the IO is done.
>
> Might be a really dumb question but what values do you assign the
> "interrupt"? When you say interrupt, you mean the calling the callback
> methods right using the OSEvent to pass values?

By "interrupt", I mean the OSEvent itself. Your callback function
handles the interrupt (aka does something with the OSEvent). You put
whatever values into the interrupt (aka OSEvent) that you might need
when it gets handled.

0 new messages