cluster/gfs2 tool/misc.c mkfs/gfs2_mkfs.h mkfs ...
CVSROOT: /cvs/cluster
Module name: cluster
Changes by: adas at sourceware.org 2006-10-26 18:42:25
Modified files:
gfs2/tool : misc.c
gfs2/mkfs : gfs2_mkfs.h main_jadd.c
Log message:
bz 211418. Modified gfs2_tool and gfs2_jadd to use the new inode flags in fs.h instead of deprecated iflags.h
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/tool/misc.c.diff?cvsroot=cluster&r1=1.7&r2=1.8
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/mkfs/gfs2_mkfs.h.diff?cvsroot=cluster&r1=1.8&r2=1.9
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/mkfs/main_jadd.c.diff?cvsroot=cluster&r1=1.9&r2=1.10
gfs2/tool/misc.c +10 -11
@@ -28,7 +28,7 @@#define __user#include <linux/gfs2_ondisk.h> -#include <linux/iflags.h> +#include <linux/fs.h> #include "gfs2_tool.h"
@@ -158,7 +158,7 @@ }/* -* Use IFLAG_XXX defined in <linux/iflags.h> which correspond to +* Use FS_XXX_FL flags defined in <linux/fs.h> which correspond to * GFS2_DIF_XXX */ static unsigned int
@@ -167,17 +167,17 @@if (strncmp (name,"system" ,6 ) ==0 )return GFS2_DIF_SYSTEM ;else if (strncmp (name,"jdata" ,5 ) ==0 ) -return IFLAG_JOURNAL_DATA ; +return FS_JOURNAL_DATA_FL ;else if (strncmp (name,"directio" ,8 ) ==0 ) -return IFLAG_DIRECTIO ; +return FS_DIRECTIO_FL ;else if (strncmp (name,"immutable" ,9 ) ==0 ) -return IFLAG_IMMUTABLE ; +return FS_IMMUTABLE_FL ;else if (strncmp (name,"appendonly" ,10 ) ==0 ) -return IFLAG_APPEND ; +return FS_APPEND_FL ;else if (strncmp (name,"noatime" ,7 ) ==0 ) -return IFLAG_NOATIME ; +return FS_NOATIME_FL ;else if (strncmp (name,"sync" ,4 ) ==0 ) -return IFLAG_SYNC ; +return FS_SYNC_FL ;else return 0 ; }
@@ -208,18 +208,17 @@die ("unrecognized flag %s\n" , argv[optind -1 ]);for (; optind < argc; optind++) { -fprintf (stdout,"opening %s\n" , argv[optind]); fd =open (argv[optind],O_RDONLY );if (fd <0 )die ("can't open %s: %s\n" , argv[optind],strerror (errno));/* first get the existing flags on the file */ - error =ioctl (fd,IFLAGS_GET_IOC , &newflags); + error =ioctl (fd,FS_IOC_GETFLAGS , &newflags);if (error)die ("can't get flags on %s: %s\n" , argv[optind],strerror (errno)); newflags = set ? newflags | flag : newflags & ~flag;/* new flags */ - error =ioctl (fd,IFLAGS_SET_IOC , &newflags); + error =ioctl (fd,FS_IOC_SETFLAGS , &newflags);if (error)die ("can't set flags on %s: %s\n" , argv[optind],strerror (errno));
gfs2/mkfs/gfs2_mkfs.h +48 -0
52 lines not on this page · raw message
gfs2/mkfs/main_jadd.c +5 -5
@@ -10,6 +10,7 @@#include <sys/file.h> #include <sys/vfs.h> #include <sys/mount.h> +//#include <linux/fs.h> #include <fcntl.h> #include <unistd.h> #include <time.h>
@@ -17,7 +18,6 @@#include <stdarg.h> #include <linux/types.h> -#include <linux/iflags.h> #include "libgfs2.h" #include "gfs2_mkfs.h"
@@ -38,14 +38,14 @@int err;uint32_t val; - err =ioctl (fd,IFLAGS_GET_IOC , &val); + err =ioctl (fd,FS_IOC_GETFLAGS , &val);if (err)die ("error doing get flags (%d): %s\n" , err,strerror (errno));if (strcmp (value,"set" ) ==0 ) - val |=IFLAG_JOURNAL_DATA ; + val |=FS_JOURNAL_DATA_FL ;if (strcmp (value,"clear" ) ==0 ) - val &= ~IFLAG_JOURNAL_DATA ; - err =ioctl (fd,IFLAGS_SET_IOC , &val); + val &= ~FS_JOURNAL_DATA_FL ; + err =ioctl (fd,FS_IOC_SETFLAGS , &val);if (err)die ("error doing set flags (%d): %s\n" , err,strerror (errno)); }