Changes by: cha0smaster
Update of /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4173/ntfsprogs
Modified Files:
Makefile.am ntfsmount.c
Log Message:
ntfsmount:
Support FUSE versions from 2.3.0 to 2.5.1 under Linux and 2.5.X under FreeBSD.
Warning tested only under FUSE-2.4.1. Will test under FUSE-2.5.1 at home.
Index: Makefile.am
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs/Makefile.am,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -p -r1.55 -r1.56
--- Makefile.am 21 Oct 2005 18:05:14 -0000 1.55
+++ Makefile.am 1 Feb 2006 17:37:35 -0000 1.56
@@ -92,7 +92,7 @@ if ENABLE_FUSE_MODULE
ntfsmount_SOURCES = ntfsmount.c utils.c utils.h
ntfsmount_LDADD = $(AM_LIBS) $(FUSE_MODULE_LIBS)
ntfsmount_LDFLAGS = $(AM_LFLAGS)
-ntfsmount_CFLAGS = $(FUSE_MODULE_CFLAGS) -DFUSE_USE_VERSION=22
+ntfsmount_CFLAGS = $(FUSE_MODULE_CFLAGS) -DFUSE_USE_VERSION=25
endif
# We don't distribute these
Index: ntfsmount.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs/ntfsmount.c,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -p -r1.74 -r1.75
--- ntfsmount.c 30 Jan 2006 21:53:42 -0000 1.74
+++ ntfsmount.c 1 Feb 2006 17:37:35 -0000 1.75
@@ -207,7 +207,11 @@ static __inline__ void ntfs_fuse_mark_fr
* Return 0 on success or -errno on error.
*/
static int ntfs_fuse_statfs(const char *path __attribute__((unused)),
+#if FUSE_VERSION >= 25
+ struct statvfs *sfs)
+#else
struct statfs *sfs)
+#endif
{
long size;
ntfs_volume *vol;
@@ -219,6 +223,9 @@ static int ntfs_fuse_statfs(const char *
sfs->f_type = NTFS_SB_MAGIC;
/* Optimal transfer block size. */
sfs->f_bsize = vol->cluster_size;
+#if FUSE_VERSION >= 25
+ sfs->f_frsize = vol->cluster_size;
+#endif
/*
* Total data blocks in file system in units of f_bsize and since
* inodes are also stored in data blocs ($MFT is a file) this is just
@@ -239,11 +246,11 @@ static int ntfs_fuse_statfs(const char *
size = 0;
sfs->f_ffree = size;
/* Maximum length of filenames. */
-#ifndef __FreeBSD__
- sfs->f_namelen = NTFS_MAX_NAME_LEN;
-#else
+#if FUSE_VERSION >= 25
sfs->f_namemax = NTFS_MAX_NAME_LEN;
-#endif /* __FreeBSD__ */
+#else
+ sfs->f_namelen = NTFS_MAX_NAME_LEN;
+#endif
return 0;
}
@@ -1741,8 +1748,11 @@ static int parse_options(int argc, char
int main(int argc, char *argv[])
{
char *parsed_options;
+#if FUSE_VERSION >= 25
+ struct fuse_args margs = FUSE_ARGS_INIT(0, NULL);
+#endif
struct fuse *fh;
- int ffd;
+ int ffd = 0;
utils_set_locale();
ntfs_log_set_handler(ntfs_log_handler_stderr);
@@ -1770,7 +1780,17 @@ int main(int argc, char *argv[])
}
free(opts.device);
/* Create filesystem. */
+#if FUSE_VERSION >= 25
+ if ((fuse_opt_add_arg(&margs, "") == -1 ||
+ fuse_opt_add_arg(&margs, "-o") == -1 ||
+ fuse_opt_add_arg(&margs, parsed_options) == -1))
+ ffd = -1;
+ if (ffd != -1)
+ ffd = fuse_mount(opts.mnt_point, &margs);
+ fuse_opt_free_args(&margs);
+#else
ffd = fuse_mount(opts.mnt_point, parsed_options);
+#endif
if (ffd == -1) {
ntfs_log_error("fuse_mount failed.\n");
ntfs_fuse_destroy();
|