svn commit: r213664 - in head/sys: fs/cd9660 fs/hpfs fs/msdosfs fs/ntfs gnu/fs/reiserfs kern sys ufs/ffs ufs/ufs

2010-10-10 Thread Konstantin Belousov
Author: kib
Date: Sun Oct 10 07:05:47 2010
New Revision: 213664
URL: http://svn.freebsd.org/changeset/base/213664

Log:
  The r184588 changed the layout of struct export_args, causing an ABI
  breakage for old mount(2) syscall, since most struct filesystem_args
  embed export_args. The mount(2) is supposed to provide ABI
  compatibility for pre-nmount mount(8) binaries, so restore ABI to
  pre-r184588.
  
  Requested and reviewed by:bde
  MFC after:2 weeks

Modified:
  head/sys/fs/cd9660/cd9660_mount.h
  head/sys/fs/cd9660/cd9660_vfsops.c
  head/sys/fs/hpfs/hpfs_vfsops.c
  head/sys/fs/hpfs/hpfsmount.h
  head/sys/fs/msdosfs/msdosfs_vfsops.c
  head/sys/fs/msdosfs/msdosfsmount.h
  head/sys/fs/ntfs/ntfs_vfsops.c
  head/sys/fs/ntfs/ntfsmount.h
  head/sys/gnu/fs/reiserfs/reiserfs_mount.h
  head/sys/gnu/fs/reiserfs/reiserfs_vfsops.c
  head/sys/kern/vfs_mount.c
  head/sys/sys/mount.h
  head/sys/ufs/ffs/ffs_vfsops.c
  head/sys/ufs/ufs/ufsmount.h

Modified: head/sys/fs/cd9660/cd9660_mount.h
==
--- head/sys/fs/cd9660/cd9660_mount.h   Sat Oct  9 20:52:36 2010
(r213663)
+++ head/sys/fs/cd9660/cd9660_mount.h   Sun Oct 10 07:05:47 2010
(r213664)
@@ -40,7 +40,7 @@
  */
 struct iso_args {
char*fspec; /* block special device to mount */
-   struct  export_args export; /* network export info */
+   struct  oexport_args export;/* network export info */
int flags;  /* mounting flags, see below */
int ssector;/* starting sector, 0 for 1st session */
char*cs_disk;   /* disk charset for Joliet cs 
conversion */

Modified: head/sys/fs/cd9660/cd9660_vfsops.c
==
--- head/sys/fs/cd9660/cd9660_vfsops.c  Sat Oct  9 20:52:36 2010
(r213663)
+++ head/sys/fs/cd9660/cd9660_vfsops.c  Sun Oct 10 07:05:47 2010
(r213664)
@@ -98,14 +98,16 @@ static int
 cd9660_cmount(struct mntarg *ma, void *data, int flags)
 {
struct iso_args args;
+   struct export_args exp;
int error;
 
error = copyin(data, args, sizeof args);
if (error)
return (error);
+   vfs_oexport_conv(args.export, exp);
 
ma = mount_argsu(ma, from, args.fspec, MAXPATHLEN);
-   ma = mount_arg(ma, export, args.export, sizeof args.export);
+   ma = mount_arg(ma, export, exp, sizeof(exp));
ma = mount_argsu(ma, cs_disk, args.cs_disk, 64);
ma = mount_argsu(ma, cs_local, args.cs_local, 64);
ma = mount_argf(ma, ssector, %u, args.ssector);

Modified: head/sys/fs/hpfs/hpfs_vfsops.c
==
--- head/sys/fs/hpfs/hpfs_vfsops.c  Sat Oct  9 20:52:36 2010
(r213663)
+++ head/sys/fs/hpfs/hpfs_vfsops.c  Sun Oct 10 07:05:47 2010
(r213664)
@@ -76,14 +76,16 @@ hpfs_cmount ( 
int flags)
 {
struct hpfs_args args;
+   struct export_args exp;
int error;
 
error = copyin(data, (caddr_t)args, sizeof (struct hpfs_args));
if (error)
return (error);
+   vfs_oexport_conv(args.export, exp);
 
ma = mount_argsu(ma, from, args.fspec, MAXPATHLEN);
-   ma = mount_arg(ma, export, args.export, sizeof args.export);
+   ma = mount_arg(ma, export, exp, sizeof(exp));
ma = mount_argf(ma, uid, %d, args.uid);
ma = mount_argf(ma, gid, %d, args.gid);
ma = mount_argf(ma, mode, %d, args.mode);

Modified: head/sys/fs/hpfs/hpfsmount.h
==
--- head/sys/fs/hpfs/hpfsmount.hSat Oct  9 20:52:36 2010
(r213663)
+++ head/sys/fs/hpfs/hpfsmount.hSun Oct 10 07:05:47 2010
(r213664)
@@ -29,7 +29,7 @@
 #define HPFSMNT_TABLES 0x0001
 struct hpfs_args {
char*fspec; /* block special device to mount */
-   struct  export_args export; /* network export information */
+   struct  oexport_args export;/* network export information */
uid_t   uid;/* uid that owns hpfs files */
gid_t   gid;/* gid that owns hpfs files */
mode_t  mode;   /* mask to be applied for hpfs perms */

Modified: head/sys/fs/msdosfs/msdosfs_vfsops.c
==
--- head/sys/fs/msdosfs/msdosfs_vfsops.cSat Oct  9 20:52:36 2010
(r213663)
+++ head/sys/fs/msdosfs/msdosfs_vfsops.cSun Oct 10 07:05:47 2010
(r213664)
@@ -200,6 +200,7 @@ static int
 msdosfs_cmount(struct mntarg *ma, void *data, int flags)
 {
struct msdosfs_args args;
+   struct export_args exp;
int error;
 
if (data == NULL)
@@ -207,9 +208,10 @@ msdosfs_cmount(struct mntarg 

Re: svn commit: r213643 - head/usr.bin/ar

2010-10-10 Thread Erik Cederstrand

Den 10/10/2010 kl. 00.11 skrev Bruce Evans:

 On Sat, 9 Oct 2010, Erik Cederstrand wrote:
 
 Thanks!  Has anyone looked at the feasibility of setting AR?=ar -D in
 sys.mk?  I will probably try this when I get my scratch box up again.
 
 I hope not.  The default behaviour should not be changed by default.

The reason I came up with this patch was that I wanted to do binary diffs on 
FreeBSD distributions to, among other reasons, record witch files are actually 
affected between commits. Except for a few edge-cases like recording a build 
timestamp, it seems wrong in my view for FreeBSD to not produce deterministic 
distributions on identical source code.

 I'm looking into this now, as I needed the patch to do binary diffs on 
 builds. One problem is that ARFLAGS is overridden a lot of places in 
 contrib/ code:
 
 contrib/cvs/lib/Makefile.in:67:ARFLAGS=cru
 contrib/cvs/diff/Makefile.in:45:ARFLAGS=cru
 contrib/ntp/libntp/Makefile.in:55:ARFLAGS=cru
 contrib/ntp/libparse/Makefile.in:55:ARFLAGS=cru
 contrib/ntp/arlib/Makefile.in:54:ARFLAGS=cru
 contrib/ntp/ntpd/Makefile.in:61:ARFLAGS=cru
 contrib/tcp_wrappers/Makefile:95:ARFLAGS=rv
 contrib/tcp_wrappers/Makefile:101:ARFLAGS=rv
 [...]
 contrib/tcp_wrappers/Makefile:404:ARFLAGS=rv
 contrib/bind9/configure.in:73:ARFLAGS=cruv
 contrib/gcclibs/libcpp/Makefile.in:30:ARFLAGS=cru
 contrib/gcclibs/libdecnumber/Makefile.in:30:ARFLAGS=cru
 contrib/dtc/Makefile:49:ARFLAGS=rc
 crypto/heimdal/appl/ftp/common/Makefile.in:93:ARFLAGS=cru
 crypto/heimdal/appl/telnet/libtelnet/Makefile.in:93:ARFLAGS=cru
 crypto/heimdal/lib/45/Makefile.in:101:ARFLAGS=cru
 crypto/openssl/Makefile.org:66:ARFLAGS=
 crypto/openssl/Makefile:68:ARFLAGS=
 
 Something like this seems to be needed, since the default flags in sys.mk
 of:
 
 share/mk/sys.mk:36:ARFLAGS?=-rv
 share/mk/sys.mk:38:ARFLAGS?=rl
 usr.bin/make/PSD.doc/tutorial.ms:2968:ARFLAGS?=crl
 
 are almost as bad as -D there.  -rv is for the %POSIX case.  The -v
 in it makes it wrong for most uses, especially when make output is
 supposed to be quieted by -s.  At least it uses the newfangled option
 syntax (starting with a '-').  rl is for the usual case.  The `l' flag
 is bogus since it was documented as accepted but not used.  Now it
 seems to be undocumented, but still accepted but not used.  The `r'
 flag is normally wanted, but most places also want 'c' and possibly
 'u'.
 
 Having anything in the default ARFLAGS is bad since (except in the
 %POSIX case) its contents is undocumented so it is hard to tell what
 precautions should be taken to avoid bad things in it.  There seems
 to be no way to cancel bad things in it by adding to it, so makefiles
 wanting to use the default would have to use something like
 substitutions in it.  E.g.:
 
 %%%
 ARFLAGS:= ${ARFLAGS:S/l//}# remove nonsense flag 'l'
 ARFLAGS:= ${ARFLAGS:S/D//}# remove unwanted flag 'v'
 foo:
   echo ${ARFLAGS}
 %%%
 
 But it is easier to blow away the garbage using ARFLAGS=cru.  There were
 few or no flags like -D that could reasonably set outside of sys.mk,
 according to user or system preferences, so that no Makefile should touch
 them.  Perhaps -v is another one -- setting this wouldn't change the
 created archives, but might be useful for debugging.
 
 The primary user of ${AR} for FreeBSD builds, namely bsd.lib.mk, doesn't
 even use ${ARFLAGS}, so it is missing from the above list.  It uses the
 literal `cq' whenever it uses the non-literal ${AR}.  Perhaps ar is often
 spelled `ar' too.


I'm a real beginner here. As I read the manuals (GNU ar and BSD ar), the only 
flags that really control archive contents on archive creation is 'q' and 'r'. 
The 'l' is ignored, 'c' and 'v' control verbosity, and 'u' and 's' are for 
performance purposes that are largely irrelevant today (extracting every single 
*.a file and recreating it wit ar -rD takes less than 10 secs on my slow 
machine). Is there any negative impact at runtime from having all archives 
created with either -rD or -qD (ignoring verbosity at build time for now)?

Thanks,
Erik

Re: svn commit: r213662 - in head: sbin/geom/class/concat sbin/geom/class/eli sbin/geom/class/journal sbin/geom/class/mirror sbin/geom/class/part sbin/geom/class/raid3 sbin/geom/class/shsec sbin/geom/

2010-10-10 Thread Ivan Voras
On 9 October 2010 22:20, Andrey V. Elsukov a...@freebsd.org wrote:
 Author: ae
 Date: Sat Oct  9 20:20:27 2010
 New Revision: 213662
 URL: http://svn.freebsd.org/changeset/base/213662

 Log:
  Replace strlen(_PATH_DEV) with sizeof(_PATH_DEV) - 1.

Um, this looks like a pointless change and for the worse; Even at -O1
the compiler will reduce strlen(constant) to just its result and for
code like printf(%d\n, sizeof(1234567)) produce code like:

movl$7, %esi
movl$.LC0, %edi
movl$0, %eax
callprintf

And (though tastes differ) I think the sizeof() variant is less
readable. The strlen(_PATH_something) idiom is common in other parts
of the kernel outside GEOM.

In short - why was this done?
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r213585 - head/tools/build/mk

2010-10-10 Thread Mark Murray
Alexander Leidinger writes:
 Can you please point out where rmail is installed when MK_SENDMAIL=no
 and MK_MAILWRAPPER!=no? I can not find such a place.

src/usr.sbin/mailwrapper/Makefile

M
--
Mark R V Murray
Cert APS(Open) Dip Phys(Open) BSc Open(Open) BSc(Hons)(Open)
Pi: 132511160

___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r213672 - in head/usr.sbin: mfiutil mptutil

2010-10-10 Thread Randi Harper
Author: randi
Date: Sun Oct 10 20:37:38 2010
New Revision: 213672
URL: http://svn.freebsd.org/changeset/base/213672

Log:
  Report subcommand handler errors in mfiutil/mptutil so that tools that
  invoke the utilities can robustly report errors.
  
  Submitted by: gcooper
  Reviewed by:  jhb
  Approved by:  cperciva (mentor)
  MFC after:1 week

Modified:
  head/usr.sbin/mfiutil/mfiutil.c
  head/usr.sbin/mptutil/mptutil.c

Modified: head/usr.sbin/mfiutil/mfiutil.c
==
--- head/usr.sbin/mfiutil/mfiutil.c Sun Oct 10 12:21:35 2010
(r213671)
+++ head/usr.sbin/mfiutil/mfiutil.c Sun Oct 10 20:37:38 2010
(r213672)
@@ -125,10 +125,12 @@ main(int ac, char **av)
 
SET_FOREACH(cmd, MFI_DATASET(top)) {
if (strcmp((*cmd)-name, av[0]) == 0) {
-   (*cmd)-handler(ac, av);
-   return (0);
+   if ((*cmd)-handler(ac, av))
+   return (1);
+   else
+   return (0);
}
}
warnx(Unknown command %s., av[0]);
-   return (0);
+   return (1);
 }

Modified: head/usr.sbin/mptutil/mptutil.c
==
--- head/usr.sbin/mptutil/mptutil.c Sun Oct 10 12:21:35 2010
(r213671)
+++ head/usr.sbin/mptutil/mptutil.c Sun Oct 10 20:37:38 2010
(r213672)
@@ -114,10 +114,12 @@ main(int ac, char **av)
 
SET_FOREACH(cmd, MPT_DATASET(top)) {
if (strcmp((*cmd)-name, av[0]) == 0) {
-   (*cmd)-handler(ac, av);
-   return (0);
+   if ((*cmd)-handler(ac, av))
+   return (1);
+   else
+   return (0);
}
}
warnx(Unknown command %s., av[0]);
-   return (0);
+   return (1);
 }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r213673 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2010-10-10 Thread Pawel Jakub Dawidek
Author: pjd
Date: Sun Oct 10 20:49:33 2010
New Revision: 213673
URL: http://svn.freebsd.org/changeset/base/213673

Log:
  Provide internal ioflags() function that converts ioflag provided by FreeBSD's
  VFS to OpenSolaris-specific ioflag expected by ZFS. Use it for read and write
  operations.
  
  Reviewed by:  mm
  MFC after:1 week

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Oct 
10 20:37:38 2010(r213672)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Oct 
10 20:49:33 2010(r213673)
@@ -705,7 +705,7 @@ zfs_prefault_write(ssize_t n, struct uio
  * IN: vp  - vnode of file to be written to.
  * uio - structure supplying write location, range info,
  *   and data buffer.
- * ioflag  - IO_APPEND flag set if in append mode.
+ * ioflag  - FAPPEND flag set if in append mode.
  * cr  - credentials of caller.
  * ct  - caller context (NFS/CIFS fem monitor only)
  *
@@ -755,7 +755,7 @@ zfs_write(vnode_t *vp, uio_t *uio, int i
 */
pflags = zp-z_phys-zp_flags;
if ((pflags  (ZFS_IMMUTABLE | ZFS_READONLY)) ||
-   ((pflags  ZFS_APPENDONLY)  !(ioflag  IO_APPEND) 
+   ((pflags  ZFS_APPENDONLY)  !(ioflag  FAPPEND) 
(uio-uio_loffset  zp-z_phys-zp_size))) {
ZFS_EXIT(zfsvfs);
return (EPERM);
@@ -772,7 +772,7 @@ zfs_write(vnode_t *vp, uio_t *uio, int i
/*
 * If in append mode, set the io offset pointer to eof.
 */
-   if (ioflag  IO_APPEND) {
+   if (ioflag  FAPPEND) {
/*
 * Range lock for a file append:
 * The value for the start of range will be determined by
@@ -4181,6 +4181,21 @@ zfs_setsecattr(vnode_t *vp, vsecattr_t *
 }
 
 static int
+ioflags(int ioflags)
+{
+   int flags = 0;
+
+   if (ioflags  IO_APPEND)
+   flags |= FAPPEND;
+   if (ioflags  IO_NDELAY)
+   flags |= FNONBLOCK;
+   if (ioflags  IO_SYNC)
+   flags |= (FSYNC | FDSYNC | FRSYNC);
+
+   return (flags);
+}
+
+static int
 zfs_freebsd_open(ap)
struct vop_open_args /* {
struct vnode *a_vp;
@@ -4238,7 +4253,8 @@ zfs_freebsd_read(ap)
} */ *ap;
 {
 
-   return (zfs_read(ap-a_vp, ap-a_uio, ap-a_ioflag, ap-a_cred, NULL));
+   return (zfs_read(ap-a_vp, ap-a_uio, ioflags(ap-a_ioflag),
+   ap-a_cred, NULL));
 }
 
 static int
@@ -4254,7 +4270,8 @@ zfs_freebsd_write(ap)
if (vn_rlimit_fsize(ap-a_vp, ap-a_uio, ap-a_uio-uio_td))
return (EFBIG);
 
-   return (zfs_write(ap-a_vp, ap-a_uio, ap-a_ioflag, ap-a_cred, NULL));
+   return (zfs_write(ap-a_vp, ap-a_uio, ioflags(ap-a_ioflag),
+   ap-a_cred, NULL));
 }
 
 static int
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org