PERFORCE change 85367 for review
soc-chenk
soc-chenk at FreeBSD.org
Sun Oct 16 06:18:29 PDT 2005
http://perforce.freebsd.org/chv.cgi?CH=85367
Change 85367 by soc-chenk at soc-chenk_leavemealone on 2005/10/16 13:17:34
add option for prefixing absolute symlinks with mount path
Submitted by: soc-chenk
Affected files ...
.. //depot/projects/soc2005/fuse4bsd2/fuse_module/fuse.c#20 edit
.. //depot/projects/soc2005/fuse4bsd2/fuse_module/fuse.h#10 edit
.. //depot/projects/soc2005/fuse4bsd2/mount_fusefs/mount_fusefs.8#3 edit
.. //depot/projects/soc2005/fuse4bsd2/mount_fusefs/mount_fusefs.c#6 edit
Differences ...
==== //depot/projects/soc2005/fuse4bsd2/fuse_module/fuse.c#20 (text+ko) ====
@@ -1801,6 +1801,7 @@
vfs_flagopt(opts, "neglect_shares", &fmnt->mntopts,
FUSEFS_NEGLECT_SHARES);
vfs_flagopt(opts, "allow_other", &fmnt->mntopts, FUSEFS_DAEMON_CAN_SPY);
+ vfs_flagopt(opts, "push_symlinks_in", &fmnt->mntopts, FUSEFS_PUSH_SYMLINKS_IN);
if (fdata_kick_get(data))
err = ENOTCONN;
@@ -3855,8 +3856,19 @@
if ((err = fdisp_simple_putget(&fdi, FUSE_READLINK, vp, curthread,
ap->a_cred)))
return (err);
-
- err = uiomove(fdi.answ, fdi.iosize, uio);
+
+ DEBUG("answ %s, push 0x%x, mnton %s\n",
+ (char *)fdi.answ,
+ ((struct fuse_mnt_data *)vp->v_mount->mnt_data)->mntopts & FUSEFS_PUSH_SYMLINKS_IN,
+ vp->v_mount->mnt_stat.f_mntonname);
+
+ if (((char *)fdi.answ)[0] == '/' &&
+ ((struct fuse_mnt_data *)vp->v_mount->mnt_data)->mntopts & FUSEFS_PUSH_SYMLINKS_IN)
+ err = uiomove(vp->v_mount->mnt_stat.f_mntonname,
+ strlen(vp->v_mount->mnt_stat.f_mntonname), uio);
+
+ if (! err)
+ err = uiomove(fdi.answ, fdi.iosize, uio);
ticket_drop(fdi.tick);
sx_sunlock(fdi.slock);
==== //depot/projects/soc2005/fuse4bsd2/fuse_module/fuse.h#10 (text+ko) ====
@@ -142,13 +142,14 @@
/* (taken from Linux Fuse) */
#define FUSE_MAX_PAGES_PER_REQ 32
-#define FUSEFS_UNPRIVPROCDBG 0x01
-#define FUSEFH_DIRECTIO 0x02
-#define FUSEFS_DAEMON_CAN_SPY 0x04
-#define FUSEFS_NEGLECT_SHARES 0x08
-#define FUSEFS_PRIVATE 0x10
-#define FUSEFS_SECONDARY 0x20
-#define FUSEFS_BUSY 0x40
+#define FUSEFS_UNPRIVPROCDBG 0x01
+#define FUSEFH_DIRECTIO 0x02
+#define FUSEFS_DAEMON_CAN_SPY 0x04
+#define FUSEFS_NEGLECT_SHARES 0x08
+#define FUSEFS_PRIVATE 0x10
+#define FUSEFS_SECONDARY 0x20
+#define FUSEFS_BUSY 0x40
+#define FUSEFS_PUSH_SYMLINKS_IN 0x80
struct fuse_mnt_data {
struct cdev *fdev;
==== //depot/projects/soc2005/fuse4bsd2/mount_fusefs/mount_fusefs.8#3 (text+ko) ====
@@ -99,6 +99,8 @@
Refuse shared mounting of the daemon.
.It Cm neglect_shares
Don't refuse unmounting if there are secondary mounts.
+.It Cm push_symlinks_in
+Prefix absolute symlinks with mountpoint.
.El
.Pp
.El
==== //depot/projects/soc2005/fuse4bsd2/mount_fusefs/mount_fusefs.c#6 (text+ko) ====
@@ -75,7 +75,8 @@
strcmp(optarg, "from") &&
strcmp(optarg, "allow_other") &&
strcmp(optarg, "neglect_shares") &&
- strcmp(optarg, "private") /* &&
+ strcmp(optarg, "private") &&
+ strcmp(optarg, "push_symlinks_in") /* &&
strcmp(optarg, "kernel_cache") &&
strcmp(optarg, "direct_io") */)
usage();
@@ -191,7 +192,7 @@
" [fuse_daemon args...]"
#endif
"\n"
- "known options: allow_other private neglect_shares\n"
+ "known options: allow_other private neglect_shares push_symlinks_in\n"
"(multiple options require separate \"-o\"-s)\n",
progname);
More information about the p4-projects
mailing list