xfs
[Top] [All Lists]

Re: typo in XFS_IOC_GETXFLAGS?

To: Nathan Scott <nathans@xxxxxxx>
Subject: Re: typo in XFS_IOC_GETXFLAGS?
From: Herbert Poetzl <herbert@xxxxxxxxxxxx>
Date: Tue, 4 May 2004 01:00:42 +0200
Cc: linux-xfs@xxxxxxxxxxx
In-reply-to: <20040504085546.B127559@wobbly.melbourne.sgi.com>
References: <20040503215840.GA26617@MAIL.13thfloor.at> <20040504085546.B127559@wobbly.melbourne.sgi.com>
Sender: linux-xfs-bounce@xxxxxxxxxxx
User-agent: Mutt/1.4.1i
On Tue, May 04, 2004 at 08:55:46AM +1000, Nathan Scott wrote:
> Hi Herbert,
> 
> On Mon, May 03, 2004 at 11:58:41PM +0200, Herbert Poetzl wrote:
> > 
> > Hi Folks!
> > 
> > xfs_ioc_xattr() uses in XFS_IOC_GETXFLAGS the
> > XFS_XFLAG_* defines for di_flags comparison, 
> > shouldn't that be XFS_DIFLAG_IMMUTABLE and 
> > friends instead?
> > 
> >                 if (ip->i_d.di_flags & XFS_XFLAG_IMMUTABLE)
> >                         flags |= LINUX_XFLAG_IMMUTABLE;
> >                 if (ip->i_d.di_flags & XFS_XFLAG_APPEND)
> >                         flags |= LINUX_XFLAG_APPEND;
> 
> Yep, good catch - thanks.

well, stumbled over another one ... this
actually needs a little additional code ...

xfs_ioc_xattr() in XFS_IOC_SETXFLAGS calls
xfs_merge_ioc_xflags() which is supposed to
merge XFS_XFLAG_* values, but it is passed
a di_flags, so you gonna need some conversion 
like ...

                old_flags = 0; 
                if (ip->i_d.di_flags & XFS_DIFLAG_IMMUTABLE)
                        oldflags |= LINUX_XFLAG_IMMUTABLE;
                if (ip->i_d.di_flags & XFS_DIFLAG_APPEND)
                        oldflags |= LINUX_XFLAG_APPEND;
                ...

                va.va_mask = XFS_AT_XFLAGS;
                va.va_xflags = xfs_merge_ioc_xflags(flags, old_flags);


HTH,
Herbert

> cheers.
> 
> -- 
> Nathan


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