Re: get device from file struct

2006-12-14 Thread Stephen Hemminger
On Thu, 14 Dec 2006 14:03:28 +0100 Silviu Craciunas <[EMAIL PROTECTED]> wrote: > On Wed, 2006-12-13 at 15:53 -0800, Stephen Hemminger wrote: > > The connection between file and network device is through many > > layers and there is no direct binding. It could be 0 to N interfaces > > and even be d

Re: get device from file struct

2006-12-14 Thread Silviu Craciunas
On Wed, 2006-12-13 at 15:53 -0800, Stephen Hemminger wrote: > The connection between file and network device is through many > layers and there is no direct binding. It could be 0 to N interfaces > and even be data dependent. you mean protocol dependent? yes,it goes trough the layer of the vfs bu

Re: get device from file struct

2006-12-13 Thread Stephen Hemminger
On Wed, 13 Dec 2006 20:19:51 +0100 (MET) Jan Engelhardt <[EMAIL PROTECTED]> wrote: > > >in fs/read_write.c, the vfs_read function does: > > > >file->f_op->read(file, buf, count, pos); > > > >after this call is it possible to determine where the > >data is coming from? > >e.g., the first hard disk

Re: get device from file struct

2006-12-13 Thread Jan Engelhardt
>in fs/read_write.c, the vfs_read function does: > >file->f_op->read(file, buf, count, pos); > >after this call is it possible to determine where the >data is coming from? >e.g., the first hard disk, a pipe or from a socket. For hard disks: file->f_dentry->d_inode->d_sb->s_bdev gives you the bl

Re: get device from file struct

2006-12-13 Thread Silviu Craciunas
On Wed, 2006-12-13 at 12:03 +0100, Jan Engelhardt wrote: > >> >thanks for the reply, the block device can be determined with the major > >> >and minor numbers , what I would be more interested in is if one can get > >> >the net_device struct from the file struct > >> > >> Just how are you supposed

Re: get device from file struct

2006-12-13 Thread Jan Engelhardt
>> >thanks for the reply, the block device can be determined with the major >> >and minor numbers , what I would be more interested in is if one can get >> >the net_device struct from the file struct >> >> Just how are you supposed to match files and network devices? >> > >from the struct file y

Re: get device from file struct

2006-12-13 Thread Silviu Craciunas
On Wed, 2006-12-13 at 10:59 +0100, Jan Engelhardt wrote: > >thanks for the reply, the block device can be determined with the major > >and minor numbers , what I would be more interested in is if one can get > >the net_device struct from the file struct > > Just how are you supposed to match files

Re: get device from file struct

2006-12-13 Thread Jan Engelhardt
>thanks for the reply, the block device can be determined with the major >and minor numbers , what I would be more interested in is if one can get >the net_device struct from the file struct Just how are you supposed to match files and network devices? -`J' -- - To unsubscribe from thi

Re: get device from file struct

2006-12-12 Thread Silviu Craciunas
On Mon, 2006-12-11 at 19:34 +0100, Brice Goglin wrote: > Silviu Craciunas wrote: > > quick question for the gurus.. is it possible to determine the hardware > > device from a file struct during read/write system call. For example in > > fs/read_write.c when doing a vfs_read. > > > > file->f_d

Re: get device from file struct

2006-12-11 Thread Brice Goglin
Silviu Craciunas wrote: > quick question for the gurus.. is it possible to determine the hardware > device from a file struct during read/write system call. For example in > fs/read_write.c when doing a vfs_read. > file->f_dentry->d_inode gives you the inode. If the inode is on top of a block