xfs
[Top] [All Lists]

Re: setting device on RT files

To: Daniel Moore <dxm@xxxxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: setting device on RT files
From: Steve Lord <lord@xxxxxxx>
Date: Wed, 07 Jun 2000 09:20:15 -0500
Cc: linux-xfs@xxxxxxxxxxx
In-reply-to: Message from Daniel Moore <dxm@xxxxxxxxxxxxxxxxxxxxxxxx> of "Wed, 07 Jun 2000 14:38:57 +1000." <200006070438.OAA12521@xxxxxxxxxxxxxxxxxxxxxxxx>
Sender: owner-linux-xfs@xxxxxxxxxxx

> 
> I just realised (!) that RT files are being assigned block numbers on
> the RT device, but since they have the same i_dev field as the other
> files, they're being written to the non-RT device.
> 
> This is my hack in xfs_rdwr that works around the problem, but I can't
> work out where the correct place to set the device number is.
> 
> dxm@snort ~/isms/slinx-xfs/linux/fs/xfs> p_rdiff linux/xfs_lrw.c
> 142a143,149
> >         
> >       if (xip->i_d.di_flags & XFS_DIFLAG_REALTIME) {
> >                 /* XXX - hack */
> >                 filp->f_dentry->d_inode->i_dev=xip->i_mount->m_rtdev;
> >                 /* it's a bad idea to write RT data on the non-RT partition
 
> */
> >                 ASSERT(filp->f_dentry->d_inode->i_dev == xip->i_mount->
> m_rtdev);
> >       }
> 
> Can anyone clue me in on where the appropriate place to set the i_dev
> field of the inode (and xfs_inode, I guess) would be?
> The places I've looked have the xfs_inode but not the inode.
> 
> (while I'm asking - is there a way to get the inode from the xfs_inode?)
> 
> Ta very much
> -----------------------------------------------------
>  Daniel Moore                  dxm@xxxxxxx
>  R&D Software Engineer         Phone: +61-3-98348209
>  SGI Performance Tools Group   Fax:   +61-3-98132378
> -----------------------------------------------------
> 

This one is going to be fun to deal with. Changing the i_dev field in the
inode will break things like link - which check based on device id that a
link is not across filesystems. We could replace checks like this with
ones that compare the superblock pointers instead - this might be worth
investigating.

Linux does not really have the concept of multiple devices within a filesystem,
and XFS does.

On Irix the I/O code in xfs_rw.c creates buffers with the realtime device
set, pagebuf has no equivalent functionality, the dev_t from the inode
found via pb_target is used. As I just explained, changing this is not
going to make the linux VFS happy.

We need to think about this one some, since there is other pending work to
add even more devices to XFS - and this might allow different blocks in a
file to be on different devices.

Steve






<Prev in Thread] Current Thread [Next in Thread>