diff options
author | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2012-03-08 21:26:06 +0100 |
---|---|---|
committer | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2012-03-08 21:26:06 +0100 |
commit | 4fdf54d4690fdf33c94b27bcf44094bb933e11fd (patch) | |
tree | a18e4b509f30e95c48df4641a823190cf1210f53 /default.c | |
parent | 792cb8124ebb8f119f678d5d4df1a8d30d568564 (diff) | |
download | fastwriter-4fdf54d4690fdf33c94b27bcf44094bb933e11fd.tar.gz fastwriter-4fdf54d4690fdf33c94b27bcf44094bb933e11fd.tar.bz2 fastwriter-4fdf54d4690fdf33c94b27bcf44094bb933e11fd.tar.xz fastwriter-4fdf54d4690fdf33c94b27bcf44094bb933e11fd.zip |
Support XFS RealTime partition
Diffstat (limited to 'default.c')
-rw-r--r-- | default.c | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -27,6 +27,10 @@ # include <linux/falloc.h> #endif /* HAVE_LINUX_FALLOC_H */ +#ifndef DISABLE_XFS_REALTIME +# include <xfs/xfs.h> +#endif /* !DISABLE_XFS_REALTIME */ + #include "fastwriter.h" #include "private.h" #include "sysinfo.h" @@ -55,6 +59,10 @@ int fastwriter_default_open(fastwriter_t *fw, const char *name, fastwriter_flags int err; char fs[16]; +#ifndef DISABLE_XFS_REALTIME + struct fsxattr attr; +#endif /* !DISABLE_XFS_REALTIME */ + int open_flags = (O_CREAT|O_WRONLY|O_NOATIME|O_LARGEFILE); int open_mode = (S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH); @@ -127,6 +135,17 @@ int fastwriter_default_open(fastwriter_t *fw, const char *name, fastwriter_flags # endif /* SYNC_MODE */ } +#ifndef DISABLE_XFS_REALTIME + if (!strcmp(fs, "xfs")) { + err = xfsctl (name, ctx->fd, XFS_IOC_FSGETXATTR, (void *) &attr); + if (!err) { + attr.fsx_xflags |= XFS_XFLAG_REALTIME; + err = xfsctl (name, ctx->fd, XFS_IOC_FSSETXATTR, (void *) &attr); +// if (!err) puts("Real-time"); + } + } +#endif /* !DISABLE_XFS_REALTIME */ + ctx->preallocated = 0; return 0; |