/alps/fastwriter

To get this branch, use:
bzr branch http://darksoft.org/webbzr/alps/fastwriter

« back to all changes in this revision

Viewing changes to default.c

  • Committer: Suren A. Chilingaryan
  • Date: 2012-03-08 20:26:06 UTC
  • Revision ID: csa@dside.dyndns.org-20120308202606-nug1s7qi6s4df1u7
Support XFS RealTime partition

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
# include <linux/falloc.h>
28
28
#endif /* HAVE_LINUX_FALLOC_H */
29
29
 
 
30
#ifndef DISABLE_XFS_REALTIME
 
31
# include <xfs/xfs.h>
 
32
#endif /* !DISABLE_XFS_REALTIME */
 
33
 
30
34
#include "fastwriter.h"
31
35
#include "private.h"
32
36
#include "sysinfo.h"
55
59
    int err;
56
60
    char fs[16];
57
61
 
 
62
#ifndef DISABLE_XFS_REALTIME
 
63
    struct fsxattr attr;
 
64
#endif /* !DISABLE_XFS_REALTIME */
 
65
 
58
66
    int open_flags = (O_CREAT|O_WRONLY|O_NOATIME|O_LARGEFILE);
59
67
    int open_mode = (S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
60
68
 
127
135
# endif /* SYNC_MODE */
128
136
    }
129
137
 
 
138
#ifndef DISABLE_XFS_REALTIME
 
139
    if (!strcmp(fs, "xfs")) {
 
140
        err = xfsctl (name, ctx->fd, XFS_IOC_FSGETXATTR, (void *) &attr);
 
141
        if (!err) {
 
142
            attr.fsx_xflags |= XFS_XFLAG_REALTIME;
 
143
            err = xfsctl (name, ctx->fd, XFS_IOC_FSSETXATTR, (void *) &attr);
 
144
//          if (!err) puts("Real-time");
 
145
        }
 
146
    }
 
147
#endif /* !DISABLE_XFS_REALTIME */
 
148
 
130
149
    ctx->preallocated = 0;
131
150
 
132
151
    return 0;