Since we're not going to worry about supporting FUSE API versions
prior to 2.6 (which is at this point widely supported), remove a
bunch of preprocessor conditionals for things that depended on FUSE
API versions prior to 2.6.
#define MY_CXT_KEY "Fuse::_guts" XS_VERSION
#if FUSE_VERSION >= 28
# define N_CALLBACKS 41
#define MY_CXT_KEY "Fuse::_guts" XS_VERSION
#if FUSE_VERSION >= 28
# define N_CALLBACKS 41
-#elif FUSE_VERSION >= 26
-# define N_CALLBACKS 38
-#elif FUSE_VERSION >= 25
-# define N_CALLBACKS 35
-#elif FUSE_VERSION >= 23
-# define N_CALLBACKS 31
*/
fi->fh = 0; /* Ensure it starts with 0 - important if they don't set it */
fihash = newHV();
*/
fi->fh = 0; /* Ensure it starts with 0 - important if they don't set it */
fihash = newHV();
(void) hv_store(fihash, "direct_io", 9, newSViv(fi->direct_io), 0);
(void) hv_store(fihash, "keep_cache", 10, newSViv(fi->keep_cache), 0);
(void) hv_store(fihash, "direct_io", 9, newSViv(fi->direct_io), 0);
(void) hv_store(fihash, "keep_cache", 10, newSViv(fi->keep_cache), 0);
#if FUSE_VERSION >= 28
(void) hv_store(fihash, "nonseekable", 11, newSViv(fi->nonseekable), 0);
#endif
#if FUSE_VERSION >= 28
(void) hv_store(fihash, "nonseekable", 11, newSViv(fi->nonseekable), 0);
#endif
if (rv == 0)
{
/* Success, so copy the file handle which they returned */
if (rv == 0)
{
/* Success, so copy the file handle which they returned */
SV **svp;
if ((svp = hv_fetch(fihash, "direct_io", 9, 0)) != NULL)
fi->direct_io = SvIV(*svp);
if ((svp = hv_fetch(fihash, "keep_cache", 10, 0)) != NULL)
fi->keep_cache = SvIV(*svp);
SV **svp;
if ((svp = hv_fetch(fihash, "direct_io", 9, 0)) != NULL)
fi->direct_io = SvIV(*svp);
if ((svp = hv_fetch(fihash, "keep_cache", 10, 0)) != NULL)
fi->keep_cache = SvIV(*svp);
#if FUSE_VERSION >= 28
if ((svp = hv_fetch(fihash, "nonseekable", 11, 0)) != NULL)
fi->nonseekable = SvIV(*svp);
#if FUSE_VERSION >= 28
if ((svp = hv_fetch(fihash, "nonseekable", 11, 0)) != NULL)
fi->nonseekable = SvIV(*svp);
int _PLfuse_opendir(const char *file, struct fuse_file_info *fi) {
int rv;
FUSE_CONTEXT_PRE;
int _PLfuse_opendir(const char *file, struct fuse_file_info *fi) {
int rv;
FUSE_CONTEXT_PRE;
void *_PLfuse_init(struct fuse_conn_info *fc)
void *_PLfuse_init(struct fuse_conn_info *fc)
-#else /* FUSE_VERSION < 26 */
-void *_PLfuse_init(void)
-#endif /* FUSE_VERSION >= 26 */
{
void *rv = NULL;
int prv;
{
void *rv = NULL;
int prv;
DEBUGf("init end\n");
FUSE_CONTEXT_POST;
}
DEBUGf("init end\n");
FUSE_CONTEXT_POST;
}
-#endif /* FUSE_VERSION >= 23 */
int _PLfuse_access(const char *file, int mask) {
int rv;
FUSE_CONTEXT_PRE;
int _PLfuse_access(const char *file, int mask) {
int rv;
FUSE_CONTEXT_PRE;
FUSE_CONTEXT_POST;
return rv;
}
FUSE_CONTEXT_POST;
return rv;
}
-#endif /* FUSE_VERSION >= 25 */
int _PLfuse_lock(const char *file, struct fuse_file_info *fi, int cmd,
struct flock *lockinfo) {
int rv;
int _PLfuse_lock(const char *file, struct fuse_file_info *fi, int cmd,
struct flock *lockinfo) {
int rv;
FUSE_CONTEXT_POST;
return rv;
}
FUSE_CONTEXT_POST;
return rv;
}
-#endif /* FUSE_VERSION >= 26 */
#if FUSE_VERSION >= 28
int _PLfuse_ioctl(const char *file, int cmd, void *arg,
#if FUSE_VERSION >= 28
int _PLfuse_ioctl(const char *file, int cmd, void *arg,
getxattr: _PLfuse_getxattr,
listxattr: _PLfuse_listxattr,
removexattr: _PLfuse_removexattr,
getxattr: _PLfuse_getxattr,
listxattr: _PLfuse_listxattr,
removexattr: _PLfuse_removexattr,
opendir: _PLfuse_opendir,
readdir: _PLfuse_readdir,
releasedir: _PLfuse_releasedir,
fsyncdir: _PLfuse_fsyncdir,
init: _PLfuse_init,
destroy: _PLfuse_destroy,
opendir: _PLfuse_opendir,
readdir: _PLfuse_readdir,
releasedir: _PLfuse_releasedir,
fsyncdir: _PLfuse_fsyncdir,
init: _PLfuse_init,
destroy: _PLfuse_destroy,
-#endif /* FUSE_VERSION >= 23 */
-#if FUSE_VERSION >= 25
access: _PLfuse_access,
create: _PLfuse_create,
ftruncate: _PLfuse_ftruncate,
fgetattr: _PLfuse_fgetattr,
access: _PLfuse_access,
create: _PLfuse_create,
ftruncate: _PLfuse_ftruncate,
fgetattr: _PLfuse_fgetattr,
-#endif /* FUSE_VERSION >= 25 */
-#if FUSE_VERSION >= 26
lock: _PLfuse_lock,
utimens: _PLfuse_utimens,
bmap: _PLfuse_bmap,
lock: _PLfuse_lock,
utimens: _PLfuse_utimens,
bmap: _PLfuse_bmap,
-#endif /* FUSE_VERSION >= 26 */
#if FUSE_VERSION >= 28
ioctl: _PLfuse_ioctl,
poll: _PLfuse_poll,
#if FUSE_VERSION >= 28
ioctl: _PLfuse_ioctl,
poll: _PLfuse_poll,