From owner-p4-projects@FreeBSD.ORG Tue Oct 4 22:11:00 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 C4D0D16A421; Tue, 4 Oct 2005 22:10:59 +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 98DA316A41F for ; Tue, 4 Oct 2005 22:10:59 +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 5941F43D45 for ; Tue, 4 Oct 2005 22:10:59 +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 j94MAx1A069881 for ; Tue, 4 Oct 2005 22:10:59 GMT (envelope-from soc-chenk@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j94MAwmr069878 for perforce@freebsd.org; Tue, 4 Oct 2005 22:10:58 GMT (envelope-from soc-chenk@freebsd.org) Date: Tue, 4 Oct 2005 22:10:58 GMT Message-Id: <200510042210.j94MAwmr069878@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 84822 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: Tue, 04 Oct 2005 22:11:00 -0000 http://perforce.freebsd.org/chv.cgi?CH=84822 Change 84822 by soc-chenk@soc-chenk_leavemealone on 2005/10/04 22:10:14 Fixes in library patch Submitted by: soc-chenk Affected files ... .. //depot/projects/soc2005/fuse4bsd2/Changelog#14 edit .. //depot/projects/soc2005/fuse4bsd2/fuselib/fuselib-2.4.0-rc1.diff#2 edit Differences ... ==== //depot/projects/soc2005/fuse4bsd2/Changelog#14 (text+ko) ==== @@ -1,3 +1,8 @@ +Tue Oct 4 23:16:26 CEST 2005 at node: creo.hu, nick: csaba + * Fixes in library patch + - trying again to get mknod right + - let "use_ino" option take effect + Fri Sep 30 16:18:46 CEST 2005 at node: creo.hu, nick: csaba * removed superfluous unlock in fuse_root ==== //depot/projects/soc2005/fuse4bsd2/fuselib/fuselib-2.4.0-rc1.diff#2 (text+ko) ==== @@ -1,6 +1,6 @@ diff -Naur linuxfuse/example/fusexmp.c bsdfuse/example/fusexmp.c --- linuxfuse/example/fusexmp.c Tue Sep 13 21:26:12 2005 -+++ bsdfuse/example/fusexmp.c Fri Sep 30 11:34:16 2005 ++++ bsdfuse/example/fusexmp.c Tue Oct 4 23:02:55 2005 @@ -20,7 +20,12 @@ #include #include @@ -14,7 +14,7 @@ #ifdef HAVE_SETXATTR #include #endif -@@ -79,7 +84,17 @@ +@@ -79,7 +84,20 @@ { int res; @@ -25,8 +25,11 @@ + res = mknod(path, mode, rdev); + else if (mode & S_IFIFO) + res = mkfifo(path, mode); -+ else ++ else { + res = open(path, O_CREAT | O_TRUNC | O_WRONLY, mode); ++ if (res >= 0) ++ res = close(res); ++ } +#endif + if(res == -1) @@ -34,7 +37,7 @@ diff -Naur linuxfuse/example/fusexmp_fh.c bsdfuse/example/fusexmp_fh.c --- linuxfuse/example/fusexmp_fh.c Tue Sep 13 21:26:12 2005 -+++ bsdfuse/example/fusexmp_fh.c Fri Sep 30 11:34:00 2005 ++++ bsdfuse/example/fusexmp_fh.c Tue Oct 4 23:04:44 2005 @@ -17,7 +17,12 @@ #include #include @@ -60,7 +63,7 @@ break; } -@@ -87,7 +96,17 @@ +@@ -87,7 +96,20 @@ { int res; @@ -71,18 +74,23 @@ + res = mknod(path, mode, rdev); + else if (mode & S_IFIFO) + res = mkfifo(path, mode); -+ else ++ else { + res = open(path, O_CREAT | O_TRUNC | O_WRONLY, mode); ++ if (res >= 0) ++ res = close(res); ++ } +#endif + if(res == -1) return -errno; -@@ -268,9 +287,11 @@ +@@ -268,9 +290,13 @@ int res; (void) path; -+#ifndef __FreeBSD__ ++#ifdef __FreeBSD__ ++ (void) isdatasync; ++#else if (isdatasync) res = fdatasync(fi->fh); else @@ -124,7 +132,7 @@ #ifdef __cplusplus diff -Naur linuxfuse/lib/fuse.c bsdfuse/lib/fuse.c --- linuxfuse/lib/fuse.c Thu Sep 8 17:16:49 2005 -+++ bsdfuse/lib/fuse.c Fri Sep 30 11:29:31 2005 ++++ bsdfuse/lib/fuse.c Fri Sep 30 17:59:29 2005 @@ -1414,7 +1414,12 @@ static int default_statfs(struct statfs *buf) @@ -150,20 +158,18 @@ } static void fuse_statfs(fuse_req_t req) -@@ -1759,10 +1768,12 @@ - *d++ = ','; - } else if (strcmp(opt, "hard_remove") == 0) +@@ -1761,8 +1770,10 @@ f->flags |= FUSE_HARD_REMOVE; -+#ifndef FreeBSD else if (strcmp(opt, "use_ino") == 0) f->flags |= FUSE_USE_INO; ++#ifndef FreeBSD else if (strcmp(opt, "readdir_ino") == 0) f->flags |= FUSE_READDIR_INO; +#endif else if (strcmp(opt, "direct_io") == 0) f->flags |= FUSE_DIRECT_IO; else if (strcmp(opt, "kernel_cache") == 0) -@@ -1787,6 +1798,14 @@ +@@ -1787,6 +1798,13 @@ else free(xopts); } @@ -172,7 +178,6 @@ + * In FreeBSD, we always use these settings as inode numbers are needed to + * make getcwd(3) work. + */ -+ f->flags &= ~FUSE_USE_INO; + f->flags |= FUSE_READDIR_INO; +#endif return 0; @@ -207,7 +212,7 @@ in->opcode != FUSE_WRITE && in->opcode != FUSE_FSYNC && diff -Naur linuxfuse/lib/helper.c bsdfuse/lib/helper.c --- linuxfuse/lib/helper.c Mon Aug 15 16:03:59 2005 -+++ bsdfuse/lib/helper.c Fri Sep 30 11:29:31 2005 ++++ bsdfuse/lib/helper.c Fri Sep 30 17:57:56 2005 @@ -22,7 +22,11 @@ { if (progname) @@ -220,12 +225,11 @@ fprintf(stderr, "FUSE options:\n" -@@ -44,12 +48,20 @@ - " hard_remove immediate removal (don't hide files)\n" +@@ -45,11 +49,19 @@ " debug enable debug output\n" " fsname=NAME set filesystem name in mtab\n" + " use_ino let filesystem set inode numbers\n" +#ifndef __FreeBSD__ - " use_ino let filesystem set inode numbers\n" " readdir_ino try to fill in d_ino in readdir\n" +#endif " nonempty allow mounts over non-empty file/dir\n"