public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] use vfs-defined file attribute flags
@ 2006-12-14 18:04 Eric Sandeen
  2006-12-14 18:15 ` Christoph Hellwig
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Sandeen @ 2006-12-14 18:04 UTC (permalink / raw)
  To: xfs

the vfs finally has common flags defined for this stuff, rather than
forcing filesystems to re-define what ext2 has already done.  Seems
like XFS could use them instead of open-coding them.

Thanks,
-Eric

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>

Index: linux-2.6.19/fs/xfs/linux-2.6/xfs_ioctl.c
===================================================================
--- linux-2.6.19.orig/fs/xfs/linux-2.6/xfs_ioctl.c
+++ linux-2.6.19/fs/xfs/linux-2.6/xfs_ioctl.c
@@ -1095,11 +1095,11 @@ xfs_ioc_fsgeometry(
 /*
  * Linux extended inode flags interface.
  */
-#define LINUX_XFLAG_SYNC	0x00000008 /* Synchronous updates */
-#define LINUX_XFLAG_IMMUTABLE	0x00000010 /* Immutable file */
-#define LINUX_XFLAG_APPEND	0x00000020 /* writes to file may only append */
-#define LINUX_XFLAG_NODUMP	0x00000040 /* do not dump file */
-#define LINUX_XFLAG_NOATIME	0x00000080 /* do not update atime */
+#define LINUX_XFLAG_SYNC	FS_SYNC_FL	/* Synchronous updates */
+#define LINUX_XFLAG_IMMUTABLE	FS_IMMUTABLE_FL	/* Immutable file */
+#define LINUX_XFLAG_APPEND	FS_APPEND_FL	/* writes may only append */
+#define LINUX_XFLAG_NODUMP	FS_NODUMP_FL	/* do not dump file */
+#define LINUX_XFLAG_NOATIME	FS_NOATIME_FL	/* do not update atime */
 
 STATIC unsigned int
 xfs_merge_ioc_xflags(

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] use vfs-defined file attribute flags
  2006-12-14 18:04 [PATCH] use vfs-defined file attribute flags Eric Sandeen
@ 2006-12-14 18:15 ` Christoph Hellwig
  2006-12-14 18:18   ` Eric Sandeen
  2006-12-14 18:21   ` Eric Sandeen
  0 siblings, 2 replies; 5+ messages in thread
From: Christoph Hellwig @ 2006-12-14 18:15 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: xfs

> -#define LINUX_XFLAG_SYNC	0x00000008 /* Synchronous updates */
> -#define LINUX_XFLAG_IMMUTABLE	0x00000010 /* Immutable file */
> -#define LINUX_XFLAG_APPEND	0x00000020 /* writes to file may only append */
> -#define LINUX_XFLAG_NODUMP	0x00000040 /* do not dump file */
> -#define LINUX_XFLAG_NOATIME	0x00000080 /* do not update atime */
> +#define LINUX_XFLAG_SYNC	FS_SYNC_FL	/* Synchronous updates */
> +#define LINUX_XFLAG_IMMUTABLE	FS_IMMUTABLE_FL	/* Immutable file */
> +#define LINUX_XFLAG_APPEND	FS_APPEND_FL	/* writes may only append */
> +#define LINUX_XFLAG_NODUMP	FS_NODUMP_FL	/* do not dump file */
> +#define LINUX_XFLAG_NOATIME	FS_NOATIME_FL	/* do not update atime */

Just kill the defines completly and use the FS_ flags.

>  
>  STATIC unsigned int
>  xfs_merge_ioc_xflags(
> 
> 
> 
> 
---end quoted text---

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] use vfs-defined file attribute flags
  2006-12-14 18:15 ` Christoph Hellwig
@ 2006-12-14 18:18   ` Eric Sandeen
  2006-12-14 18:21   ` Eric Sandeen
  1 sibling, 0 replies; 5+ messages in thread
From: Eric Sandeen @ 2006-12-14 18:18 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs

Christoph Hellwig wrote:
>> -#define LINUX_XFLAG_SYNC	0x00000008 /* Synchronous updates */
>> -#define LINUX_XFLAG_IMMUTABLE	0x00000010 /* Immutable file */
>> -#define LINUX_XFLAG_APPEND	0x00000020 /* writes to file may only append */
>> -#define LINUX_XFLAG_NODUMP	0x00000040 /* do not dump file */
>> -#define LINUX_XFLAG_NOATIME	0x00000080 /* do not update atime */
>> +#define LINUX_XFLAG_SYNC	FS_SYNC_FL	/* Synchronous updates */
>> +#define LINUX_XFLAG_IMMUTABLE	FS_IMMUTABLE_FL	/* Immutable file */
>> +#define LINUX_XFLAG_APPEND	FS_APPEND_FL	/* writes may only append */
>> +#define LINUX_XFLAG_NODUMP	FS_NODUMP_FL	/* do not dump file */
>> +#define LINUX_XFLAG_NOATIME	FS_NOATIME_FL	/* do not update atime */
> 
> Just kill the defines completly and use the FS_ flags.

that probably would be better, I thought of that after I sent it. :)

*shrug* whichever.  It's heresy to suggest less indirection in xfs ;-)

-Eric

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] use vfs-defined file attribute flags
  2006-12-14 18:15 ` Christoph Hellwig
  2006-12-14 18:18   ` Eric Sandeen
@ 2006-12-14 18:21   ` Eric Sandeen
  2006-12-19 16:53     ` Eric Sandeen
  1 sibling, 1 reply; 5+ messages in thread
From: Eric Sandeen @ 2006-12-14 18:21 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs

Christoph Hellwig wrote:

>> -#define LINUX_XFLAG_SYNC	0x00000008 /* Synchronous updates */
>> -#define LINUX_XFLAG_IMMUTABLE	0x00000010 /* Immutable file */
>> -#define LINUX_XFLAG_APPEND	0x00000020 /* writes to file may only append */
>> -#define LINUX_XFLAG_NODUMP	0x00000040 /* do not dump file */
>> -#define LINUX_XFLAG_NOATIME	0x00000080 /* do not update atime */
>> +#define LINUX_XFLAG_SYNC	FS_SYNC_FL	/* Synchronous updates */
>> +#define LINUX_XFLAG_IMMUTABLE	FS_IMMUTABLE_FL	/* Immutable file */
>> +#define LINUX_XFLAG_APPEND	FS_APPEND_FL	/* writes may only append */
>> +#define LINUX_XFLAG_NODUMP	FS_NODUMP_FL	/* do not dump file */
>> +#define LINUX_XFLAG_NOATIME	FS_NOATIME_FL	/* do not update atime */
>>     
>
> Just kill the defines completly and use the FS_ flags
>   
 1 file changed, 5 insertions(+), 10 deletions(-)

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>

Index: linux-2.6.19/fs/xfs/linux-2.6/xfs_ioctl.c
===================================================================
--- linux-2.6.19.orig/fs/xfs/linux-2.6/xfs_ioctl.c
+++ linux-2.6.19/fs/xfs/linux-2.6/xfs_ioctl.c
@@ -1095,11 +1095,6 @@ xfs_ioc_fsgeometry(
 /*
  * Linux extended inode flags interface.
  */
-#define LINUX_XFLAG_SYNC	0x00000008 /* Synchronous updates */
-#define LINUX_XFLAG_IMMUTABLE	0x00000010 /* Immutable file */
-#define LINUX_XFLAG_APPEND	0x00000020 /* writes to file may only append */
-#define LINUX_XFLAG_NODUMP	0x00000040 /* do not dump file */
-#define LINUX_XFLAG_NOATIME	0x00000080 /* do not update atime */
 
 STATIC unsigned int
 xfs_merge_ioc_xflags(
@@ -1108,23 +1103,23 @@ xfs_merge_ioc_xflags(
 {
 	unsigned int	xflags = start;
 
-	if (flags & LINUX_XFLAG_IMMUTABLE)
+	if (flags & FS_IMMUTABLE_FL)
 		xflags |= XFS_XFLAG_IMMUTABLE;
 	else
 		xflags &= ~XFS_XFLAG_IMMUTABLE;
-	if (flags & LINUX_XFLAG_APPEND)
+	if (flags & FS_APPEND_FL)
 		xflags |= XFS_XFLAG_APPEND;
 	else
 		xflags &= ~XFS_XFLAG_APPEND;
-	if (flags & LINUX_XFLAG_SYNC)
+	if (flags & FS_SYNC_FL)
 		xflags |= XFS_XFLAG_SYNC;
 	else
 		xflags &= ~XFS_XFLAG_SYNC;
-	if (flags & LINUX_XFLAG_NOATIME)
+	if (flags & FS_NOATIME_FL)
 		xflags |= XFS_XFLAG_NOATIME;
 	else
 		xflags &= ~XFS_XFLAG_NOATIME;
-	if (flags & LINUX_XFLAG_NODUMP)
+	if (flags & FS_NODUMP_FL)
 		xflags |= XFS_XFLAG_NODUMP;
 	else
 		xflags &= ~XFS_XFLAG_NODUMP;

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] use vfs-defined file attribute flags
  2006-12-14 18:21   ` Eric Sandeen
@ 2006-12-19 16:53     ` Eric Sandeen
  0 siblings, 0 replies; 5+ messages in thread
From: Eric Sandeen @ 2006-12-19 16:53 UTC (permalink / raw)
  To: xfs; +Cc: Christoph Hellwig

Eric Sandeen wrote:

> Christoph Hellwig wrote:
>   
>> Just kill the defines completly and use the FS_ flags
Ugh maybe I should test build when I change stuff eh.

This one builds, even :)

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>

Index: linux-2.6.19/fs/xfs/linux-2.6/xfs_ioctl.c
===================================================================
--- linux-2.6.19.orig/fs/xfs/linux-2.6/xfs_ioctl.c
+++ linux-2.6.19/fs/xfs/linux-2.6/xfs_ioctl.c
@@ -1095,11 +1095,6 @@ xfs_ioc_fsgeometry(
 /*
  * Linux extended inode flags interface.
  */
-#define LINUX_XFLAG_SYNC	0x00000008 /* Synchronous updates */
-#define LINUX_XFLAG_IMMUTABLE	0x00000010 /* Immutable file */
-#define LINUX_XFLAG_APPEND	0x00000020 /* writes to file may only append */
-#define LINUX_XFLAG_NODUMP	0x00000040 /* do not dump file */
-#define LINUX_XFLAG_NOATIME	0x00000080 /* do not update atime */
 
 STATIC unsigned int
 xfs_merge_ioc_xflags(
@@ -1108,23 +1103,23 @@ xfs_merge_ioc_xflags(
 {
 	unsigned int	xflags = start;
 
-	if (flags & LINUX_XFLAG_IMMUTABLE)
+	if (flags & FS_IMMUTABLE_FL)
 		xflags |= XFS_XFLAG_IMMUTABLE;
 	else
 		xflags &= ~XFS_XFLAG_IMMUTABLE;
-	if (flags & LINUX_XFLAG_APPEND)
+	if (flags & FS_APPEND_FL)
 		xflags |= XFS_XFLAG_APPEND;
 	else
 		xflags &= ~XFS_XFLAG_APPEND;
-	if (flags & LINUX_XFLAG_SYNC)
+	if (flags & FS_SYNC_FL)
 		xflags |= XFS_XFLAG_SYNC;
 	else
 		xflags &= ~XFS_XFLAG_SYNC;
-	if (flags & LINUX_XFLAG_NOATIME)
+	if (flags & FS_NOATIME_FL)
 		xflags |= XFS_XFLAG_NOATIME;
 	else
 		xflags &= ~XFS_XFLAG_NOATIME;
-	if (flags & LINUX_XFLAG_NODUMP)
+	if (flags & FS_NODUMP_FL)
 		xflags |= XFS_XFLAG_NODUMP;
 	else
 		xflags &= ~XFS_XFLAG_NODUMP;
@@ -1139,15 +1134,15 @@ xfs_di2lxflags(
 	unsigned int	flags = 0;
 
 	if (di_flags & XFS_DIFLAG_IMMUTABLE)
-		flags |= LINUX_XFLAG_IMMUTABLE;
+		flags |= FS_IMMUTABLE_FL;
 	if (di_flags & XFS_DIFLAG_APPEND)
-		flags |= LINUX_XFLAG_APPEND;
+		flags |= FS_APPEND_FL;
 	if (di_flags & XFS_DIFLAG_SYNC)
-		flags |= LINUX_XFLAG_SYNC;
+		flags |= FS_SYNC_FL;
 	if (di_flags & XFS_DIFLAG_NOATIME)
-		flags |= LINUX_XFLAG_NOATIME;
+		flags |= FS_NOATIME_FL;
 	if (di_flags & XFS_DIFLAG_NODUMP)
-		flags |= LINUX_XFLAG_NODUMP;
+		flags |= FS_NODUMP_FL;
 	return flags;
 }
 
@@ -1247,9 +1242,9 @@ xfs_ioc_xattr(
 			break;
 		}
 
-		if (flags & ~(LINUX_XFLAG_IMMUTABLE | LINUX_XFLAG_APPEND | \
-			      LINUX_XFLAG_NOATIME | LINUX_XFLAG_NODUMP | \
-			      LINUX_XFLAG_SYNC)) {
+		if (flags & ~(FS_IMMUTABLE_FL | FS_APPEND_FL | \
+			      FS_NOATIME_FL | FS_NODUMP_FL | \
+			      FS_SYNC_FL)) {
 			error = -EOPNOTSUPP;
 			break;
 		}

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-12-19 16:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-14 18:04 [PATCH] use vfs-defined file attribute flags Eric Sandeen
2006-12-14 18:15 ` Christoph Hellwig
2006-12-14 18:18   ` Eric Sandeen
2006-12-14 18:21   ` Eric Sandeen
2006-12-19 16:53     ` Eric Sandeen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox