From owner-p4-projects@FreeBSD.ORG Sun Oct 16 13:18:29 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 13EA816A421; Sun, 16 Oct 2005 13:18:29 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CADD516A41F for ; Sun, 16 Oct 2005 13:18:28 +0000 (GMT) (envelope-from soc-chenk@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id E63E043D5C for ; Sun, 16 Oct 2005 13:18:27 +0000 (GMT) (envelope-from soc-chenk@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j9GDIRkh062338 for ; Sun, 16 Oct 2005 13:18:27 GMT (envelope-from soc-chenk@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j9GDIR6m062335 for perforce@freebsd.org; Sun, 16 Oct 2005 13:18:27 GMT (envelope-from soc-chenk@freebsd.org) Date: Sun, 16 Oct 2005 13:18:27 GMT Message-Id: <200510161318.j9GDIR6m062335@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to soc-chenk@freebsd.org using -f From: soc-chenk To: Perforce Change Reviews Cc: Subject: PERFORCE change 85367 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Oct 2005 13:18:29 -0000 http://perforce.freebsd.org/chv.cgi?CH=85367 Change 85367 by soc-chenk@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);