PERFORCE change 197034 for review
Ilya Putsikau
ilya at FreeBSD.org
Mon Aug 1 21:32:05 UTC 2011
http://p4web.freebsd.org/@@197034?ac=10
Change 197034 by ilya at ilya_triton2011 on 2011/08/01 21:31:52
Use fuse-freebsd name instead of fuse4bsd.
fuse4bsd is not used anywhere and may be confusing
Clean Makefile, remove disabled definitions.
opt_global.h is included automatically if available.
Remove config.h
Wrap long lines in mount_fusefs
Rename fuse_module directory to fuse
Affected files ...
.. //depot/projects/soc2011/ilya_fuse/Makefile#2 edit
.. //depot/projects/soc2011/ilya_fuse/fuse/Makefile#1 move/add
.. //depot/projects/soc2011/ilya_fuse/fuse/config.h#1 move/add
.. //depot/projects/soc2011/ilya_fuse/fuse/fuse.h#1 move/add
.. //depot/projects/soc2011/ilya_fuse/fuse/fuse_device.c#1 move/add
.. //depot/projects/soc2011/ilya_fuse/fuse/fuse_file.c#1 move/add
.. //depot/projects/soc2011/ilya_fuse/fuse/fuse_file.h#1 move/add
.. //depot/projects/soc2011/ilya_fuse/fuse/fuse_internal.c#1 move/add
.. //depot/projects/soc2011/ilya_fuse/fuse/fuse_internal.h#1 move/add
.. //depot/projects/soc2011/ilya_fuse/fuse/fuse_io.c#1 move/add
.. //depot/projects/soc2011/ilya_fuse/fuse/fuse_io.h#1 move/add
.. //depot/projects/soc2011/ilya_fuse/fuse/fuse_ipc.c#1 move/add
.. //depot/projects/soc2011/ilya_fuse/fuse/fuse_ipc.h#1 move/add
.. //depot/projects/soc2011/ilya_fuse/fuse/fuse_kernel.h#1 move/add
.. //depot/projects/soc2011/ilya_fuse/fuse/fuse_main.c#1 move/add
.. //depot/projects/soc2011/ilya_fuse/fuse/fuse_node.c#1 move/add
.. //depot/projects/soc2011/ilya_fuse/fuse/fuse_node.h#1 move/add
.. //depot/projects/soc2011/ilya_fuse/fuse/fuse_param.h#1 move/add
.. //depot/projects/soc2011/ilya_fuse/fuse/fuse_version.h#1 move/add
.. //depot/projects/soc2011/ilya_fuse/fuse/fuse_vfsops.c#1 move/add
.. //depot/projects/soc2011/ilya_fuse/fuse/fuse_vnops.c#1 move/add
.. //depot/projects/soc2011/ilya_fuse/fuse_module/Makefile#12 move/delete
.. //depot/projects/soc2011/ilya_fuse/fuse_module/config.h#3 move/delete
.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse.h#16 move/delete
.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_device.c#15 move/delete
.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_file.c#14 move/delete
.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_file.h#6 move/delete
.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_internal.c#20 move/delete
.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_internal.h#20 move/delete
.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_io.c#21 move/delete
.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_io.h#12 move/delete
.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_ipc.c#16 move/delete
.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_ipc.h#17 move/delete
.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_kernel.h#3 move/delete
.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_main.c#10 move/delete
.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_node.c#22 move/delete
.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_node.h#21 move/delete
.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_param.h#5 move/delete
.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_vfsops.c#25 move/delete
.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_vnops.c#45 move/delete
.. //depot/projects/soc2011/ilya_fuse/include/fuse4bsd.h#2 move/delete
.. //depot/projects/soc2011/ilya_fuse/mount_fusefs/Makefile#2 edit
.. //depot/projects/soc2011/ilya_fuse/mount_fusefs/mount_fusefs.8#2 edit
.. //depot/projects/soc2011/ilya_fuse/mount_fusefs/mount_fusefs.c#2 edit
Moved files ...
.. //depot/projects/soc2011/ilya_fuse/fuse/Makefile#1 moved from //depot/projects/soc2011/ilya_fuse/fuse_module/Makefile#11
.. //depot/projects/soc2011/ilya_fuse/fuse/config.h#1 moved from //depot/projects/soc2011/ilya_fuse/fuse_module/config.h#2
.. //depot/projects/soc2011/ilya_fuse/fuse/fuse.h#1 moved from //depot/projects/soc2011/ilya_fuse/fuse_module/fuse.h#15
.. //depot/projects/soc2011/ilya_fuse/fuse/fuse_device.c#1 moved from //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_device.c#14
.. //depot/projects/soc2011/ilya_fuse/fuse/fuse_file.c#1 moved from //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_file.c#13
.. //depot/projects/soc2011/ilya_fuse/fuse/fuse_file.h#1 moved from //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_file.h#5
.. //depot/projects/soc2011/ilya_fuse/fuse/fuse_internal.c#1 moved from //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_internal.c#19
.. //depot/projects/soc2011/ilya_fuse/fuse/fuse_internal.h#1 moved from //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_internal.h#19
.. //depot/projects/soc2011/ilya_fuse/fuse/fuse_io.c#1 moved from //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_io.c#20
.. //depot/projects/soc2011/ilya_fuse/fuse/fuse_io.h#1 moved from //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_io.h#11
.. //depot/projects/soc2011/ilya_fuse/fuse/fuse_ipc.c#1 moved from //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_ipc.c#15
.. //depot/projects/soc2011/ilya_fuse/fuse/fuse_ipc.h#1 moved from //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_ipc.h#16
.. //depot/projects/soc2011/ilya_fuse/fuse/fuse_kernel.h#1 moved from //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_kernel.h#2
.. //depot/projects/soc2011/ilya_fuse/fuse/fuse_main.c#1 moved from //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_main.c#9
.. //depot/projects/soc2011/ilya_fuse/fuse/fuse_node.c#1 moved from //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_node.c#21
.. //depot/projects/soc2011/ilya_fuse/fuse/fuse_node.h#1 moved from //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_node.h#20
.. //depot/projects/soc2011/ilya_fuse/fuse/fuse_param.h#1 moved from //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_param.h#4
.. //depot/projects/soc2011/ilya_fuse/fuse/fuse_version.h#1 moved from //depot/projects/soc2011/ilya_fuse/include/fuse4bsd.h#1
.. //depot/projects/soc2011/ilya_fuse/fuse/fuse_vfsops.c#1 moved from //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_vfsops.c#24
.. //depot/projects/soc2011/ilya_fuse/fuse/fuse_vnops.c#1 moved from //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_vnops.c#44
Differences ...
==== //depot/projects/soc2011/ilya_fuse/Makefile#2 (text+ko) ====
@@ -1,4 +1,4 @@
-SUBDIR = fuse_module mount_fusefs
+SUBDIR = fuse mount_fusefs
.include <bsd.subdir.mk>
==== //depot/projects/soc2011/ilya_fuse/fuse/Makefile#1 (text+ko) ====
@@ -1,7 +1,5 @@
-.undef KERNCONF
+KMOD= fuse
-.include "../Makefile.common"
-
SRCS= fuse.h \
fuse_kernel.h \
fuse_device.c \
@@ -20,19 +18,7 @@
fuse_vnops.c \
vnode_if.h
-CFLAGS+= -I../include
-DEBUG_FLAGS+= -g -DFUSE_DEBUG_VNOPS=1
-
-.if defined(KERNCONF)
-KERNCONF1!= echo ${KERNCONF} | sed -e 's/ .*//g'
-KRNLOBJDIR!= make -C /usr/src -f /usr/src/Makefile.inc1 -V KRNLOBJDIR
-KERNCONFDIR= ${KRNLOBJDIR}/${KERNCONF1}
-.endif
-
-.if defined(KERNCONFDIR)
-CFLAGS+= -DKERNCONFDIR="\"${KERNCONFDIR}\"" -I${KERNCONFDIR}
-.endif
-
-KMOD=fuse
+DEBUG_FLAGS+= -g
+# -DFUSE_DEBUG_VNOPS=1 -DFUSE_DEBUG_IPC=1 -DFUSE_DEBUG_VFSOPS=1
.include <bsd.kmod.mk>
==== //depot/projects/soc2011/ilya_fuse/fuse/config.h#1 (text+ko) ====
@@ -1,3 +1,0 @@
-#ifdef KERNCONFDIR
-#include <opt_global.h>
-#endif
==== //depot/projects/soc2011/ilya_fuse/fuse/fuse.h#1 (text+ko) ====
@@ -3,7 +3,7 @@
* and debugging.
*/
-#include "fuse4bsd.h"
+#include "fuse_version.h"
#include "fuse_kernel.h"
#define FUSE_DEFAULT_DAEMON_TIMEOUT 60 /* s */
==== //depot/projects/soc2011/ilya_fuse/fuse/fuse_device.c#1 (text+ko) ====
@@ -2,8 +2,6 @@
* I/O methods for fuse devices.
*/
-#include "config.h"
-
#include <sys/types.h>
#include <sys/module.h>
#include <sys/systm.h>
==== //depot/projects/soc2011/ilya_fuse/fuse/fuse_file.c#1 (text+ko) ====
@@ -3,8 +3,6 @@
* Amit Singh <singh@>
*/
-#include "config.h"
-
#include <sys/types.h>
#include <sys/module.h>
#include <sys/systm.h>
==== //depot/projects/soc2011/ilya_fuse/fuse/fuse_file.h#1 (text+ko) ====
==== //depot/projects/soc2011/ilya_fuse/fuse/fuse_internal.c#1 (text+ko) ====
@@ -3,8 +3,6 @@
* Amit Singh <singh@>
*/
-#include "config.h"
-
#include <sys/types.h>
#include <sys/module.h>
#include <sys/systm.h>
==== //depot/projects/soc2011/ilya_fuse/fuse/fuse_internal.h#1 (text+ko) ====
==== //depot/projects/soc2011/ilya_fuse/fuse/fuse_io.c#1 (text+ko) ====
@@ -1,5 +1,3 @@
-#include "config.h"
-
#include <sys/types.h>
#include <sys/module.h>
#include <sys/systm.h>
==== //depot/projects/soc2011/ilya_fuse/fuse/fuse_io.h#1 (text+ko) ====
==== //depot/projects/soc2011/ilya_fuse/fuse/fuse_ipc.c#1 (text+ko) ====
@@ -3,8 +3,6 @@
* Amit Singh <singh@>
*/
-#include "config.h"
-
#include <sys/types.h>
#include <sys/module.h>
#include <sys/systm.h>
@@ -51,8 +49,8 @@
static fuse_handler_t fuse_standard_handler;
SYSCTL_NODE(_vfs, OID_AUTO, fuse, CTLFLAG_RW, 0, "FUSE tunables");
-SYSCTL_STRING(_vfs_fuse, OID_AUTO, fuse4bsd_version, CTLFLAG_RD,
- FUSE4BSD_VERSION, 0, "fuse4bsd version");
+SYSCTL_STRING(_vfs_fuse, OID_AUTO, version, CTLFLAG_RD,
+ FUSE_FREEBSD_VERSION, 0, "fuse-freebsd version");
static int fuse_ticket_count = 0;
SYSCTL_INT(_vfs_fuse, OID_AUTO, ticket_count, CTLFLAG_RW,
&fuse_ticket_count, 0, "number of allocated tickets");
==== //depot/projects/soc2011/ilya_fuse/fuse/fuse_ipc.h#1 (text+ko) ====
==== //depot/projects/soc2011/ilya_fuse/fuse/fuse_kernel.h#1 (text+ko) ====
==== //depot/projects/soc2011/ilya_fuse/fuse/fuse_main.c#1 (text+ko) ====
@@ -2,8 +2,6 @@
* Module load/unload stuff.
*/
-#include "config.h"
-
#include <sys/types.h>
#include <sys/module.h>
#include <sys/systm.h>
@@ -92,13 +90,9 @@
if ((err = vfs_modevent(NULL, what, &fuse_vfsconf)))
fuse_bringdown(eh_tag);
else
- printf("fuse4bsd: version %s, FUSE ABI %d.%d\n"
-#ifdef KERNCONFDIR
- "fuse4bsd: compiled against kernel config "
- KERNCONFDIR "\n"
-#endif
- , FUSE4BSD_VERSION,
- FUSE_KERNEL_VERSION, FUSE_KERNEL_MINOR_VERSION);
+ printf("fuse-freebsd: version %s, FUSE ABI %d.%d\n",
+ FUSE_FREEBSD_VERSION,
+ FUSE_KERNEL_VERSION, FUSE_KERNEL_MINOR_VERSION);
break;
case MOD_UNLOAD:
==== //depot/projects/soc2011/ilya_fuse/fuse/fuse_node.c#1 (text+ko) ====
@@ -3,8 +3,6 @@
* Amit Singh <singh@>
*/
-#include "config.h"
-
#include <sys/types.h>
#include <sys/module.h>
#include <sys/systm.h>
==== //depot/projects/soc2011/ilya_fuse/fuse/fuse_node.h#1 (text+ko) ====
==== //depot/projects/soc2011/ilya_fuse/fuse/fuse_param.h#1 (text+ko) ====
==== //depot/projects/soc2011/ilya_fuse/fuse/fuse_version.h#1 (text+ko) ====
@@ -1,3 +1,3 @@
-#ifndef FUSE4BSD_VERSION
-#define FUSE4BSD_VERSION "0.3.9-pre1"
+#ifndef FUSE_FREEBSD_VERSION
+#define FUSE_FREEBSD_VERSION "0.4.2"
#endif
==== //depot/projects/soc2011/ilya_fuse/fuse/fuse_vfsops.c#1 (text+ko) ====
@@ -3,8 +3,6 @@
* Amit Singh <singh@>
*/
-#include "config.h"
-
#include <sys/types.h>
#include <sys/module.h>
#include <sys/systm.h>
@@ -209,11 +207,12 @@
if (vfs_scanopt(opts, "max_read=", "%u", &max_read) == 1)
max_read_set = 1;
if (vfs_scanopt(opts, "timeout=", "%u", &daemon_timeout) == 1) {
- if (daemon_timeout < FUSE_MIN_DAEMON_TIMEOUT)
- daemon_timeout = FUSE_MIN_DAEMON_TIMEOUT;
- else if (daemon_timeout > FUSE_MAX_DAEMON_TIMEOUT)
- daemon_timeout = FUSE_MAX_DAEMON_TIMEOUT;
- data->daemon_timeout = daemon_timeout;
+ if (daemon_timeout < FUSE_MIN_DAEMON_TIMEOUT)
+ daemon_timeout = FUSE_MIN_DAEMON_TIMEOUT;
+ else if (daemon_timeout > FUSE_MAX_DAEMON_TIMEOUT)
+ daemon_timeout = FUSE_MAX_DAEMON_TIMEOUT;
+ } else {
+ daemon_timeout = FUSE_DEFAULT_DAEMON_TIMEOUT;
}
subtype = vfs_getopts(opts, "subtype=", &err);
err = 0;
@@ -259,6 +258,7 @@
data->mp = mp;
data->dataflags |= mntopts;
data->max_read = max_read;
+ data->daemon_timeout = daemon_timeout;
#ifdef XXXIP
if (!priv_check(td, PRIV_VFS_FUSE_SYNC_UNMOUNT))
data->dataflags |= FSESS_CAN_SYNC_UNMOUNT;
==== //depot/projects/soc2011/ilya_fuse/fuse/fuse_vnops.c#1 (text+ko) ====
@@ -3,8 +3,6 @@
* Amit Singh <singh@>
*/
-#include "config.h"
-
#include <sys/types.h>
#include <sys/module.h>
#include <sys/systm.h>
==== //depot/projects/soc2011/ilya_fuse/mount_fusefs/Makefile#2 (text+ko) ====
@@ -1,16 +1,13 @@
# $FreeBSD$
-.include "../Makefile.common"
+PROG= mount_fusefs
+SRCS= mount_fusefs.c getmntopts.c
+MAN8= mount_fusefs.8
+NO_MANCOMPRESS?= yes
-PROG = mount_fusefs
-SRCS = mount_fusefs.c getmntopts.c
-MAN8 = mount_fusefs.8
-NO_MANCOMPRESS?= yes
-
# mount_fusefs needs mntopts.h and getmntopts.c from src/sbin/mount/
-MOUNT ?= /usr/src/sbin/mount
-CFLAGS += -I${MOUNT} -I../include
-
+MOUNT?= /usr/src/sbin/mount
+CFLAGS+= -I${MOUNT} -I../fuse
.PATH: ${MOUNT}
.include <bsd.prog.mk>
==== //depot/projects/soc2011/ilya_fuse/mount_fusefs/mount_fusefs.8#2 (text+ko) ====
==== //depot/projects/soc2011/ilya_fuse/mount_fusefs/mount_fusefs.c#2 (text+ko) ====
@@ -1,6 +1,6 @@
/*-
* Copyright (c) 2005 Jean-Sébastien Pédron
- * Copyright (c) 2005 Csaba Henk
+ * Copyright (c) 2005 Csaba Henk
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -46,13 +46,14 @@
#include <limits.h>
#include <paths.h>
-#include "fuse4bsd.h"
+#include "fuse_version.h"
#include "mntopts.h"
-void __usage_short(void);
+void usage_short(void);
void usage(void);
void helpmsg(void);
void showversion(void);
+int init_backgrounded(void);
struct mntopt mopts[] = {
#define ALTF_PRIVATE 0x01
@@ -92,8 +93,6 @@
{ 0, NULL, 0 }
};
-char *progname;
-
#define DEFAULT_MOUNT_FLAGS ALTF_PRIVATE | ALTF_SYNC_UNMOUNT
int
@@ -126,8 +125,6 @@
char *ep;
char *daemon = NULL, *daemon_opts = NULL;
- progname = argv[0];
-
/*
* We want a parsing routine which is not sensitive to
* the position of args/opts; it should extract the
@@ -215,7 +212,7 @@
errx(1, "mount path specified inconsistently");
diro = optarg;
break;
- case 'v':
+ case 'v':
verbose = 1;
break;
case 'h':
@@ -232,7 +229,8 @@
}
if (done)
break;
- } while ((ch = getopt_long(argc, argv, "AvVho:SD:O:s:m:", longopts, NULL)) != -1);
+ } while ((ch = getopt_long(argc, argv, "AvVho:SD:O:s:m:", longopts,
+ NULL)) != -1);
argc -= optind;
argv += optind;
@@ -242,7 +240,8 @@
errx(1, "special specified inconsistently");
dev = devo;
} else if (diro)
- errx(1, "if mountpoint is given via an option, special should also be given via an option");
+ errx(1, "if mountpoint is given via an option, "
+ "special should also be given via an option");
if (diro) {
if (dir)
@@ -275,19 +274,22 @@
* negative of allow_other: if this is set,
* allow_other is blocked, period.
*/
- errx(1, "\"allow_other\" usage is banned by respective option");
+ errx(1, "\"allow_other\" usage is banned by "
+ "respective option");
for (mv = mvals; mv->mv_flag; ++mv) {
if (mo->m_flag != mv->mv_flag)
continue;
if (mv->mv_value) {
- build_iovec(&iov, &iovlen, mo->m_option, mv->mv_value, mv->mv_len);
+ build_iovec(&iov, &iovlen, mo->m_option,
+ mv->mv_value, mv->mv_len);
iov_done = 1;
break;
}
}
if (! iov_done)
- build_iovec(&iov, &iovlen, mo->m_option, "", -1);
+ build_iovec(&iov, &iovlen, mo->m_option,
+ "", -1);
}
if (__altflags & mo->m_flag) {
char *uscore_opt;
@@ -320,7 +322,8 @@
if (strcmp(dev, "/dev/fuse") == 0) {
if (! (argc > 0 || daemon)) {
- fprintf(stderr, "Please also specify the fuse daemon to run when mounting via the multiplexer!\n");
+ fprintf(stderr, "Please also specify the fuse daemon "
+ "to run when mounting via the multiplexer!\n");
usage();
}
if ((fd = open(dev, O_RDWR)) < 0)
@@ -359,7 +362,7 @@
if (fd < 0 && (fd = open(dev, O_RDWR)) < 0)
err(1, "failed to open fuse device");
-
+
if (asprintf(&fds, "%d", fd) == -1)
err(1, "failed to allocate memory");
setenv("FUSE_DEV_FD", fds, 1);
@@ -419,10 +422,11 @@
}
void
-__usage_short(void) {
+usage_short(void) {
fprintf(stderr,
- "usage:\n%s [-A|-S|-v|-V|-h|-D daemon|-O args|-s special|-m node|-o option...] special node [daemon args...]\n\n",
- basename(progname));
+ "usage:\n%s [-A|-S|-v|-V|-h|-D daemon|-O args|-s special|-m node|"
+ "-o option...] special node [daemon args...]\n\n",
+ basename(getprogname()));
}
void
@@ -430,13 +434,13 @@
{
struct mntopt *mo;
- __usage_short();
+ usage_short();
fprintf(stderr, "known options:\n");
for (mo = mopts; mo->m_flag; ++mo)
fprintf(stderr, "\t%s\n", mo->m_option);
- fprintf(stderr, "\n(use -h for a detailed description of these options)\n");
+ fprintf(stderr, "\n(use -h for a detailed description of options)\n");
exit(EX_USAGE);
}
@@ -444,7 +448,7 @@
helpmsg(void)
{
if (! getenv("MOUNT_FUSEFS_CALL_BY_LIB")) {
- __usage_short();
+ usage_short();
fprintf(stderr, "description of options:\n");
}
@@ -465,7 +469,7 @@
" -o max_read=N set maximum size of read requests\n"
" -o noprivate allow secondary mounting of the filesystem\n"
" -o neglect_shares don't report EBUSY when unmount attempted\n"
- " in presence of secondary mounts\n"
+ " in presence of secondary mounts\n"
" -o push_symlinks_in prefix absolute symlinks with mountpoint\n"
" -o sync_unmount do unmount synchronously\n"
);
@@ -475,7 +479,7 @@
void
showversion(void)
{
- puts("mount_fusefs [fuse4bsd] version: " FUSE4BSD_VERSION);
+ puts("mount_fusefs fuse-freebsd version: " FUSE_FREEBSD_VERSION);
exit(EX_USAGE);
}
More information about the p4-projects
mailing list