Resource manager, multiple devices

This is my first resource manager, so bare with me.

I’m writing a resource manager that will have multiple devices,
/dev/foo[012]. When I get the io_read() callback, how do I know which file
is being accessed? Preferably I’d like a simple int referring to which node
(0, 1, or 2).

I have an array of iofunc_attr_t. I suppose I could do (ocb->attr - attrs)
to get which device is being accessed. Later this might be allocated
dynamically though, and this trick will fail. What’s the clean method?

Is there a document similar to the “Network DDK API” to describe the
resource manager API? In particular I’d like a description of all the
structures, members, and functions.

Thanks,
Shaun

Shaun Jackman <sjackman@nospam.vortek.com> wrote:

This is my first resource manager, so bare with me.

I’m writing a resource manager that will have multiple devices,
/dev/foo[012]. When I get the io_read() callback, how do I know which file
is being accessed? Preferably I’d like a simple int referring to which node
(0, 1, or 2).

I have an array of iofunc_attr_t. I suppose I could do (ocb->attr - attrs)
to get which device is being accessed. Later this might be allocated
dynamically though, and this trick will fail. What’s the clean method?

There’s an inode number that you can put in your attribute structure.
In fact, the inode number must be unique and non-zero for each device.
This is a “clean” way of finding out which device you’re talking with
in your I/O callbacks.

Is there a document similar to the “Network DDK API” to describe the
resource manager API? In particular I’d like a description of all the
structures, members, and functions.

Well, there’s a book :slight_smile: www.parse.com

Cheers,
-RK

Robert Krten, PARSE Software Devices +1 613 599 8316.
Realtime Systems Architecture, Books, Video-based and Instructor-led
Training and Consulting at www.parse.com.
Email my initials at parse dot com.

Oddly enough, I already have the book. Don’t know why I didn’t look there
first!

Cheers,
Shaun

Well, there’s a book > :slight_smile: > > www.parse.com

Cheers,
-RK

Shaun Jackman <sjackman@nospam.vortek.com> wrote:

Oddly enough, I already have the book. Don’t know why I didn’t look there
first!

Excellent. Then you’ll want to look at the “atoz” resource manager :slight_smile:

Cheers,
-RK

Cheers,
Shaun

Well, there’s a book > :slight_smile: > > www.parse.com

Cheers,
-RK


Robert Krten, PARSE Software Devices +1 613 599 8316.
Realtime Systems Architecture, Books, Video-based and Instructor-led
Training and Consulting at www.parse.com.
Email my initials at parse dot com.