git: sbin/hammer: Add missing fflush(stdout) in 8b6688a4

2017-04-13 Thread Tomohiro Kusumi

commit 1ee016ee44126c121699ccf4289c1867a5085b69
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Fri Apr 14 00:44:55 2017 +0300

sbin/hammer: Add missing fflush(stdout) in 8b6688a4

Summary of changes:
 sbin/hammer/cmd_strip.c | 1 +
 1 file changed, 1 insertion(+)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/1ee016ee44126c121699ccf4289c1867a5085b69


-- 
DragonFly BSD source repository


git: sbin/hammer: Fix hammer(8)

2017-04-15 Thread Tomohiro Kusumi

commit 9b21f734b3b80e0e81cabcb6ea074ddc8cdfc0e8
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sun Apr 16 00:18:38 2017 +0300

sbin/hammer: Fix hammer(8)

It's no longer HAMMER volume once stripped, so drop "HAMMER".

Summary of changes:
 sbin/hammer/hammer.8 | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/9b21f734b3b80e0e81cabcb6ea074ddc8cdfc0e8


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Use hammer_crc_t

2017-04-15 Thread Tomohiro Kusumi

commit 17b150c600a9d06b2d15292ef4cf2a27ff1d221d
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sun Apr 16 00:04:40 2017 +0300

sys/vfs/hammer: Use hammer_crc_t

Use hammer_crc_t rather than uint32_t which is the same thing.
This commit doesn't (and shouldn't) replace CRC variables that are
not HAMMER's ondisk CRC field or ioctl, but for general purpose.

Summary of changes:
 sbin/hammer/cmd_show.c  | 4 ++--
 sys/vfs/hammer/hammer_ioctl.h   | 2 +-
 sys/vfs/hammer/hammer_mirror.c  | 2 +-
 sys/vfs/hammer/hammer_reblock.c | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/17b150c600a9d06b2d15292ef4cf2a27ff1d221d


-- 
DragonFly BSD source repository


git: usr.sbin/fstyp: Improve formatting. (FreeBSD@GitHub dc9b2340)

2017-04-16 Thread Tomohiro Kusumi

commit cc05af1eafa243a86185f18e3174ea68ca619363
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sun Apr 16 14:03:53 2017 +0300

usr.sbin/fstyp: Improve formatting. (FreeBSD@GitHub dc9b2340)

Summary of changes:
 usr.sbin/fstyp/fstyp.8 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/cc05af1eafa243a86185f18e3174ea68ca619363


-- 
DragonFly BSD source repository


git: usr.sbin/autofs: Use proper argument order for calloc(3). (FreeBSD@GitHub 6add75fe)

2017-04-16 Thread Tomohiro Kusumi

commit 59b0b31639aa2df751c642e44abea14668cff452
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sun Apr 16 03:15:31 2017 +0300

usr.sbin/autofs: Use proper argument order for calloc(3). (FreeBSD@GitHub 
6add75fe)

Summary of changes:
 usr.sbin/autofs/automountd.c   | 2 +-
 usr.sbin/autofs/autounmountd.c | 2 +-
 usr.sbin/autofs/defined.c  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/59b0b31639aa2df751c642e44abea14668cff452


-- 
DragonFly BSD source repository


git: usr.sbin/autofs: Make autounmountd(8) not die when traced with "truss -p". (FreeBSD@GitHub 8381908c)

2017-04-16 Thread Tomohiro Kusumi

commit 8cdc3b5d92f656590ed6d15164eeb214893825cf
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sun Apr 16 03:17:50 2017 +0300

usr.sbin/autofs: Make autounmountd(8) not die when traced with "truss -p". 
(FreeBSD@GitHub 8381908c)

Summary of changes:
 usr.sbin/autofs/autounmountd.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/8cdc3b5d92f656590ed6d15164eeb214893825cf


-- 
DragonFly BSD source repository


git: usr.sbin/fstyp: Use NULL instead of 0 for pointers. (FreeBSD@GitHub 27f4c84a)

2017-04-16 Thread Tomohiro Kusumi

commit b5ba6292892161939e763063ad61854084aa2c1e
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sun Apr 16 14:06:47 2017 +0300

usr.sbin/fstyp: Use NULL instead of 0 for pointers. (FreeBSD@GitHub 
27f4c84a)

Summary of changes:
 usr.sbin/fstyp/fstyp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/b5ba6292892161939e763063ad61854084aa2c1e


-- 
DragonFly BSD source repository


git: sbin/hammer: Have consistent naming for volume variables

2017-03-12 Thread Tomohiro Kusumi

commit 5ebff42a8e921bcf7196389db1a3e5fd76d17a62
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Thu Mar 9 21:32:40 2017 +0200

sbin/hammer: Have consistent naming for volume variables

Use *volume.
Userspace is mix of *vol and *volume for no reason.
sys/vfs/hammer is always *volume.

Summary of changes:
 sbin/hammer/cmd_recover.c|  12 +--
 sbin/hammer/cmd_strip.c  |  24 ++---
 sbin/hammer/cmd_volume.c |  12 +--
 sbin/hammer/hammer.c |  12 +--
 sbin/hammer/hammer_util.h|  12 +--
 sbin/hammer/ondisk.c | 196 +++
 sbin/newfs_hammer/newfs_hammer.c |  78 
 7 files changed, 173 insertions(+), 173 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/5ebff42a8e921bcf7196389db1a3e5fd76d17a62


-- 
DragonFly BSD source repository


git: sbin/hammer: Have consistent naming for buffer variables

2017-03-12 Thread Tomohiro Kusumi

commit 52c15408ad7e64ec2d7df27f82333e5a5dc1d41f
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Thu Mar 9 21:31:51 2017 +0200

sbin/hammer: Have consistent naming for buffer variables

Use *buffer.
Userspace is mix of *buf and *buffer for no reason.
sys/vfs/hammer is always *buffer.

Summary of changes:
 sbin/hammer/hammer_util.h |  2 +-
 sbin/hammer/ondisk.c  | 80 ---
 2 files changed, 42 insertions(+), 40 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/52c15408ad7e64ec2d7df27f82333e5a5dc1d41f


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Cleanup hammer_modify_node()

2017-03-08 Thread Tomohiro Kusumi

commit f8baaab1e883339ede14158e09f71ea7ba3abd53
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Wed Mar 8 21:10:12 2017 +0200

sys/vfs/hammer: Cleanup hammer_modify_node()

The only purpose of crcptr was to avoid split into multiple lines
(according to dillon@), but we could do with the same two lines..

Summary of changes:
 sys/vfs/hammer/hammer.h | 7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/f8baaab1e883339ede14158e09f71ea7ba3abd53


-- 
DragonFly BSD source repository


git: sbin/hammer: Test volume version in __verify_volume()

2017-04-14 Thread Tomohiro Kusumi

commit c967446b57103173bbf944d25a36b8818bad00a1
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Fri Apr 14 15:46:56 2017 +0300

sbin/hammer: Test volume version in __verify_volume()

Since now that HammerVersion is always used by CRC operations, and
blkdevs based hammer commands are likely to either test/set CRC,
the volume version should be checked after volume parameters are
loaded from ondisk volume header.

The reason for using >=WIP instead of >MAX is because that's how
newfs_hammer checks volume version, though it's currently the same
thing.

Summary of changes:
 sbin/hammer/ondisk.c | 6 ++
 sbin/mount_hammer/mount_hammer.c | 6 ++
 2 files changed, 12 insertions(+)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/c967446b57103173bbf944d25a36b8818bad00a1


-- 
DragonFly BSD source repository


git: sbin/hammer: Fix indentation made by 4c09d9c4

2017-04-14 Thread Tomohiro Kusumi

commit 51b976e85e7c01586027ceec552075742571885e
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Fri Apr 14 19:25:48 2017 +0300

sbin/hammer: Fix indentation made by 4c09d9c4

Summary of changes:
 sbin/hammer/cmd_show.c | 24 
 1 file changed, 12 insertions(+), 12 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/51b976e85e7c01586027ceec552075742571885e


-- 
DragonFly BSD source repository


git: sbin/hammer: Fix get_buffer_data()'s wrong xor for undo buffer caching

2017-07-07 Thread Tomohiro Kusumi

commit e179dc662730328d2e2ab43f659c0d2fc9319d98
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sun Jun 25 02:17:09 2017 +0300

sbin/hammer: Fix get_buffer_data()'s wrong xor for undo buffer caching

As mentioned in 830ab40e
"sbin/hammer: Redo e4323571 partly (after reverted by 03d5db37)",
830ab40e (originally by e4323571) fixed a bug for get_buffer_data()
wrongly taking xor of zone-X offset and zone-2 offset, where X is
one of the direct zones other than zone-2.

This commit fixes it for indirect zone which is zone-3 (and only
zone-3 in this case). The reason zone-3 being different is because
zone-3 to zone-2 translation isn't direct mapped, but instead the
volume header has a pointer to big-blocks that belong to zone-3.

Also see 0942cbbc which made this xor bug clear.

Summary of changes:
 sbin/hammer/ondisk.c | 23 ---
 1 file changed, 16 insertions(+), 7 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/e179dc662730328d2e2ab43f659c0d2fc9319d98


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Fix a comment on nresolving PFS

2017-07-07 Thread Tomohiro Kusumi

commit 750a1c766f441b0330f0cf27ee7a45120525c778
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sun Jun 25 00:56:58 2017 +0300

sys/vfs/hammer: Fix a comment on nresolving PFS

On nresolving a PFS, the entry name to be resolved is the PFS itself,
whether it's pointed to by a symlink or not.

Also note that a PFS doesn't necessarily require a symlink to point
to itself. A symlink is used only because the PFS itself isn't visible
to userspace via readdir(2) (i.e can't see with ls without a symlink...).

Summary of changes:
 sys/vfs/hammer/hammer_vnops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/750a1c766f441b0330f0cf27ee7a45120525c778


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Drop wrong info on inode# from hammer(5)

2017-07-07 Thread Tomohiro Kusumi

commit 449a19ac08326740f5a2af0f724d7b4154ef033f
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sat Jun 24 22:38:42 2017 +0300

sys/vfs/hammer: Drop wrong info on inode# from hammer(5)

PFS has nothing to do with namespace of inode#.

The only exception is the root inode# for PFS including PFS#0, which
are all 1. Another exceptional case is a master PFS and its slave PFS,
where corresponding files/dirs have the same inode#.

Summary of changes:
 share/man/man5/hammer.5 | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/449a19ac08326740f5a2af0f724d7b4154ef033f


-- 
DragonFly BSD source repository


git: sbin/hammer: Drop rerundant ()

2017-07-07 Thread Tomohiro Kusumi

commit 035b4e5e515ea9cc3be46d108b95eae2e094223a
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sun Jul 2 23:01:40 2017 +0300

sbin/hammer: Drop rerundant ()

Summary of changes:
 sbin/hammer/ondisk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/035b4e5e515ea9cc3be46d108b95eae2e094223a


-- 
DragonFly BSD source repository


git: sbin/hammer: Move cache to tailq end when get_buffer_data() has a valid cache

2017-07-07 Thread Tomohiro Kusumi

commit 63eacb74267a5a2776a215b529ab1a6f6939b80b
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sun Jul 2 21:30:08 2017 +0300

sbin/hammer: Move cache to tailq end when get_buffer_data() has a valid 
cache

This is the same as what get_buffer() does when new allocation
is not needed. This hasn't been done in get_buffer_data() when
the given non NULL buffer is the one to look for.

This seems to make newfs_hammer a bit faster, as the i/o size is
normally large enough to invoke eviction of HAMMER userspace buffer
cache while running, starting from the head of the tailq.

-- before this commit
 # for x in 1 2 3 4 5; do
 > (time newfs_hammer -L TEST /dev/da1 /dev/da2 /dev/da3 > /dev/null) 2>&1 
| grep real
 > done
 real0m20.291s
 real0m20.574s
 real0m22.347s
 real0m21.562s
 real0m20.991s

-- with this commit
 # for x in 1 2 3 4 5; do
 > (time newfs_hammer -L TEST /dev/da1 /dev/da2 /dev/da3 > /dev/null) 2>&1 
| grep real
 > done
 real0m18.023s
 real0m18.064s
 real0m18.104s
 real0m17.646s
 real0m18.310s

Summary of changes:
 sbin/hammer/ondisk.c | 2 ++
 1 file changed, 2 insertions(+)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/63eacb74267a5a2776a215b529ab1a6f6939b80b


-- 
DragonFly BSD source repository


git: sbin/newfs_hammer2: Fix typo in newfs_hammer2(8)

2017-09-23 Thread Tomohiro Kusumi

commit e5c02cf8b78ad522dd0c924c75646c99fa621a0f
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sat Sep 23 14:27:20 2017 +0300

sbin/newfs_hammer2: Fix typo in newfs_hammer2(8)

of of

Summary of changes:
 sbin/newfs_hammer2/newfs_hammer2.8 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/e5c02cf8b78ad522dd0c924c75646c99fa621a0f


-- 
DragonFly BSD source repository


git: sbin/hammer: Add uuid.c

2017-09-23 Thread Tomohiro Kusumi

commit 3cd578eda6da1a44261fbcd0172ed900599d6d92
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Thu Sep 21 19:06:16 2017 +0300

sbin/hammer: Add uuid.c

Add a simple wrapper over uuid functions for better portability,
similar to sys/vfs/hammer/hammer_crc.h (which helped implement
version 7 CRC).

No functional changes.

Summary of changes:
 sbin/hammer/Makefile   |  2 +-
 sbin/hammer/cmd_cleanup.c  |  4 +-
 sbin/hammer/cmd_info.c |  2 +-
 sbin/hammer/cmd_mirror.c   |  3 +-
 sbin/hammer/cmd_pfs.c  | 29 +-
 sbin/hammer/cmd_show.c |  5 +-
 sbin/hammer/hammer.c   |  4 +-
 sbin/hammer/hammer_util.h  |  6 ++
 .../pc64/x86_64/sysarch.c => sbin/hammer/uuid.c| 67 ++
 sbin/newfs_hammer/Makefile |  2 +-
 sbin/newfs_hammer/newfs_hammer.c   |  9 +--
 11 files changed, 74 insertions(+), 59 deletions(-)
 copy sys/platform/pc64/x86_64/sysarch.c => sbin/hammer/uuid.c (65%)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/3cd578eda6da1a44261fbcd0172ed900599d6d92


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Add typedef hammer_uuid_t

2017-09-23 Thread Tomohiro Kusumi

commit 90da8fc8d95e1895d63ebafb10404337f9f921f4
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Thu Sep 21 19:06:37 2017 +0300

sys/vfs/hammer: Add typedef hammer_uuid_t

Add typedef for uuid_t for better portability,
similar to hammer_crc_t and other hammer_xxx_t.
(Some platforms have char[16] for uuid_t instead of struct value)

No functional changes.

Summary of changes:
 lib/libstand/hammer1.c |  2 +-
 sbin/hammer/cmd_cleanup.c  |  2 +-
 sbin/hammer/cmd_mirror.c   |  2 +-
 sbin/hammer/hammer_util.h  | 14 +++---
 sbin/hammer/ondisk.c   |  4 ++--
 sbin/hammer/uuid.c | 10 +-
 sys/vfs/hammer/hammer.h|  8 
 sys/vfs/hammer/hammer_disk.h   | 13 +++--
 sys/vfs/hammer/hammer_ioctl.h  |  6 +++---
 sys/vfs/hammer/hammer_ondisk.c |  2 +-
 sys/vfs/hammer/hammer_subs.c   |  6 +++---
 sys/vfs/hammer/hammer_vnops.c  |  4 ++--
 usr.sbin/fstyp/hammer.c|  2 +-
 13 files changed, 38 insertions(+), 37 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/90da8fc8d95e1895d63ebafb10404337f9f921f4


-- 
DragonFly BSD source repository


git: usr.sbin/fstyp: Add initial HAMMER2 support

2017-09-23 Thread Tomohiro Kusumi

commit 030fdd8afa5af5b5ad92b091fb9f10f2e276c4dd
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sat Sep 23 01:17:20 2017 +0300

usr.sbin/fstyp: Add initial HAMMER2 support

-l option and multiple/partial volumes are not supported yet.

Summary of changes:
 usr.sbin/fstyp/Makefile|  2 +-
 usr.sbin/fstyp/fstyp.8 |  5 ++-
 usr.sbin/fstyp/fstyp.c |  2 ++
 usr.sbin/fstyp/fstyp.h |  1 +
 usr.sbin/fstyp/{cd9660.c => hammer2.c} | 59 ++
 5 files changed, 46 insertions(+), 23 deletions(-)
 copy usr.sbin/fstyp/{cd9660.c => hammer2.c} (66%)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/030fdd8afa5af5b5ad92b091fb9f10f2e276c4dd


-- 
DragonFly BSD source repository


git: sbin/newfs_hammer: Use hwarnx() instead of hwarn()

2017-09-19 Thread Tomohiro Kusumi

commit 894963997e2f22a396941d81f6d64364e525cb57
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sat Sep 16 15:23:36 2017 +0300

sbin/newfs_hammer: Use hwarnx() instead of hwarn()

This one should be with x.

Summary of changes:
 sbin/newfs_hammer/newfs_hammer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/894963997e2f22a396941d81f6d64364e525cb57


-- 
DragonFly BSD source repository


git: sbin/newfs_hammer: Use uuid_create(3) instead of uuidgen(2)

2017-09-19 Thread Tomohiro Kusumi

commit f5cbe1f7dfd662d261beeb330e9ee77fdc52c78b
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sat Sep 16 19:02:55 2017 +0300

sbin/newfs_hammer: Use uuid_create(3) instead of uuidgen(2)

HAMMER userspace uses uuid_create(3) except for this one.
uuidgen(2) syscall isn't part of the specification.

Summary of changes:
 sbin/newfs_hammer/newfs_hammer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/f5cbe1f7dfd662d261beeb330e9ee77fdc52c78b


-- 
DragonFly BSD source repository


git: sbin/hammer: Use uuid_compare(3) instead of bcmp(3)

2017-09-19 Thread Tomohiro Kusumi

commit 118205ce7371bbc32134ba28dbe204993eb72a71
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sat Sep 16 20:53:35 2017 +0300

sbin/hammer: Use uuid_compare(3) instead of bcmp(3)

Summary of changes:
 sbin/hammer/cmd_cleanup.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/118205ce7371bbc32134ba28dbe204993eb72a71


-- 
DragonFly BSD source repository


git: sbin/hammer: Use uuid_compare(3) instead of bcmp(3)

2017-09-25 Thread Tomohiro Kusumi

commit 16a0098c0741d1d97cb86378b7320d650055ae3b
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Mon Sep 25 23:19:48 2017 +0300

sbin/hammer: Use uuid_compare(3) instead of bcmp(3)

(missed ones from 118205ce)

Summary of changes:
 sbin/hammer/cmd_mirror.c | 3 +--
 sbin/hammer/ondisk.c | 4 ++--
 2 files changed, 3 insertions(+), 4 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/16a0098c0741d1d97cb86378b7320d650055ae3b


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Use kuuid_compare() instead of bcmp()

2017-09-24 Thread Tomohiro Kusumi

commit f29237b008818025720a28de524b713b6786e9fb
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sat Sep 23 23:43:52 2017 +0300

sys/vfs/hammer: Use kuuid_compare() instead of bcmp()

though kuuid_compare() is probably slower than bcmp() in most cases.
It's not performance critical part anyway.

Summary of changes:
 sys/vfs/hammer/hammer_ondisk.c | 2 +-
 sys/vfs/hammer/hammer_vnops.c  | 6 ++
 2 files changed, 3 insertions(+), 5 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/f29237b008818025720a28de524b713b6786e9fb


-- 
DragonFly BSD source repository


git: sbin/hammer: Cleanup header includes

2017-09-24 Thread Tomohiro Kusumi

commit 41ae08629e82bf5408758ede62d84c59649ad7af
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sat Sep 23 23:06:17 2017 +0300

sbin/hammer: Cleanup header includes

Summary of changes:
 sbin/hammer/cmd_blockmap.c   |  2 ++
 sbin/hammer/cmd_cleanup.c|  4 ++--
 sbin/hammer/cmd_dedup.c  |  5 +++--
 sbin/hammer/cmd_info.c   |  4 ++--
 sbin/hammer/cmd_pfs.c|  2 --
 sbin/hammer/cmd_recover.c|  2 ++
 sbin/hammer/cmd_show.c   |  5 +++--
 sbin/hammer/cmd_stats.c  |  4 ++--
 sbin/hammer/hammer.c |  2 ++
 sbin/hammer/hammer.h | 24 
 sbin/hammer/hammer_util.h| 17 +++--
 sbin/hammer/ondisk.c |  4 ++--
 sbin/hammer/uuid.c   |  2 ++
 sbin/newfs_hammer/newfs_hammer.c |  4 ++--
 14 files changed, 35 insertions(+), 46 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/41ae08629e82bf5408758ede62d84c59649ad7af


-- 
DragonFly BSD source repository


git: sbin/mount_hammer: Remove redundant test_volumes() on mount(2) failure

2017-09-30 Thread Tomohiro Kusumi

commit 1767454fc3cdb440b6ee35b74ec70f13687cd169
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sat Sep 30 14:21:25 2017 +0300

sbin/mount_hammer: Remove redundant test_volumes() on mount(2) failure

This code was originally added by 1a607e3e which added signature check
when mount(2) failed, and later modified by several commits including
1e297b34 which copied code from sbin/hammer/ondisk.c. But as mentioned
in 1e297b34, this entire checking wasn't needed (as it's in dmesg),
or it may even show the wrong reason of failure.

The correct way is to just type dmesg, and see what the kernel said,
instead of resorting to wild guess in userspace by reading volume header
*after* mount(2) failure (If you really want this it should be done
*before* mount(2)).

This originally didn't exist till 2009 and that was better.

Summary of changes:
 sbin/mount_hammer/mount_hammer.c | 68 
 1 file changed, 68 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/1767454fc3cdb440b6ee35b74ec70f13687cd169


-- 
DragonFly BSD source repository


git: sbin/hammer: Minor cleanup

2017-09-30 Thread Tomohiro Kusumi

commit bbe85e926256b0a59d152b01e4f2471f9337998d
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sat Sep 30 12:29:07 2017 +0300

sbin/hammer: Minor cleanup

The prototype was originally brought (copied) from uuid(3).

Summary of changes:
 sbin/hammer/hammer_util.h | 2 +-
 sbin/hammer/uuid.c| 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/bbe85e926256b0a59d152b01e4f2471f9337998d


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Check root voume# is 0 on mount(2)

2017-09-30 Thread Tomohiro Kusumi

commit ed84682cd619911937e48277b48ba140efca43ea
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sat Sep 30 14:17:32 2017 +0300

sys/vfs/hammer: Check root voume# is 0 on mount(2)

We could check this in addition to the existing conditional to
know the volume is the root volume. /sbin/hammer and /sbin/mount_hammer
do this, so why not.

If failed here, the volume which has just been inserted to the rbtree
(and other volumes already inserted) are going to be removed by
hammer_free_hmp().

Summary of changes:
 sys/vfs/hammer/hammer_ondisk.c | 6 ++
 1 file changed, 6 insertions(+)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/ed84682cd619911937e48277b48ba140efca43ea


-- 
DragonFly BSD source repository


git: sbin/hammer: Add UUID string on error and blockmap,show

2017-09-30 Thread Tomohiro Kusumi

commit d04bb327d85bc66ac64f2bda8b2eaf482d07beb6
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sat Sep 30 13:12:51 2017 +0300

sbin/hammer: Add UUID string on error and blockmap,show

to make clear whether ondisk vol_fstype UUID is simply wrong or
due to byte order of the first 8 bytes (4-2-2 part).

Summary of changes:
 sbin/hammer/ondisk.c | 25 -
 1 file changed, 20 insertions(+), 5 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/d04bb327d85bc66ac64f2bda8b2eaf482d07beb6


-- 
DragonFly BSD source repository


git: sbin/hammer: Fix compile-time warning by some Linux distros

2017-10-01 Thread Tomohiro Kusumi

commit eccac4ffb5982fd205a1701631a4c37bfa42cc25
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sun Oct 1 15:37:54 2017 +0300

sbin/hammer: Fix compile-time warning by some Linux distros

--
test_dupkey.c: In function 'main':
test_dupkey.c:54:1: warning: control reaches end of non-void function 
[-Wreturn-type]
 }

Summary of changes:
 sbin/hammer/test_dupkey.c | 2 ++
 1 file changed, 2 insertions(+)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/eccac4ffb5982fd205a1701631a4c37bfa42cc25


-- 
DragonFly BSD source repository


git: sbin/newfs_hammer2: Check S_ISREG()

2017-10-12 Thread Tomohiro Kusumi

commit d6cfa63feddb7be6edb1d190c41e1729e54d244e
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Thu Oct 12 22:48:11 2017 +0300

sbin/newfs_hammer2: Check S_ISREG()

The comment says as follows, so check S_ISREG().
/* Allow the formatting of regular files as HAMMER2 volumes */

This is also what the same function in HAMMER1 does.

Summary of changes:
 sbin/newfs_hammer2/newfs_hammer2.c | 2 ++
 1 file changed, 2 insertions(+)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/d6cfa63feddb7be6edb1d190c41e1729e54d244e


-- 
DragonFly BSD source repository


git: sbin/newfs_hammer2: Add missing free() for uuid_to_string'd strings

2017-10-12 Thread Tomohiro Kusumi

commit d374dfe770eabbb49cff27dc61245e450cff5e78
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Thu Oct 12 23:08:52 2017 +0300

sbin/newfs_hammer2: Add missing free() for uuid_to_string'd strings

Summary of changes:
 sbin/newfs_hammer2/newfs_hammer2.c | 6 ++
 1 file changed, 6 insertions(+)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/d374dfe770eabbb49cff27dc61245e450cff5e78


-- 
DragonFly BSD source repository


git: usr.sbin/fstyp: Update fstyp(8) for HAMMER2

2017-10-12 Thread Tomohiro Kusumi

commit 9d3c19a2e9a1211922e122a8108e49acb3625ff7
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Thu Oct 12 23:03:00 2017 +0300

usr.sbin/fstyp: Update fstyp(8) for HAMMER2

Summary of changes:
 usr.sbin/fstyp/fstyp.8 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/9d3c19a2e9a1211922e122a8108e49acb3625ff7


-- 
DragonFly BSD source repository


git: sbin/newfs_hammer2: Fix compile-time warning on Linux distros (gcc6)

2017-10-12 Thread Tomohiro Kusumi

commit c838491916926c7fe3e2a1927f953b794f44fc4f
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Thu Oct 12 22:57:45 2017 +0300

sbin/newfs_hammer2: Fix compile-time warning on Linux distros (gcc6)

--
warning: pointer targets in passing argument 1 of 'snprintf' differ in 
signedness [-Wpointer-sign]
warning: pointer targets in passing argument 1 of 'strlen' differ in 
signedness [-Wpointer-sign]

Summary of changes:
 sbin/newfs_hammer2/newfs_hammer2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/c838491916926c7fe3e2a1927f953b794f44fc4f


-- 
DragonFly BSD source repository


git: autofs: Add etc/autofs/include_nis

2017-11-25 Thread Tomohiro Kusumi

commit d8fd7fcdbf2c025fb3d6779133b768574a0a9f90
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sat Nov 25 19:53:20 2017 +0200

autofs: Add etc/autofs/include_nis

FreeBSD@GitHub e9b93842e9

Summary of changes:
 etc/autofs/Makefile|   6 +-
 etc/autofs/include_nis | 180 +
 2 files changed, 182 insertions(+), 4 deletions(-)
 create mode 100644 etc/autofs/include_nis

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/d8fd7fcdbf2c025fb3d6779133b768574a0a9f90


-- 
DragonFly BSD source repository


git: kqueue: Fix kqueue(2) EVFILT_FS section

2017-11-21 Thread Tomohiro Kusumi

commit d7009a0b5222449be40aaba76ea8a056cee9f3db
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Tue Nov 21 23:28:02 2017 +0200

kqueue: Fix kqueue(2) EVFILT_FS section

Fix 05d3db1bc901548d6335d701c773c537d4ef42fd.

EVFILT_FS filter currently does not use ident. It can be any value
to catch mount/umount.

FreeBSD kqueue(2) man page doesn't have description on EVFILT_FS
by the way, while the code was taken from FreeBSD for mount/umount.

Summary of changes:
 lib/libc/sys/kqueue.2 | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/d7009a0b5222449be40aaba76ea8a056cee9f3db


-- 
DragonFly BSD source repository


git: sys/vfs/autofs: Add VFCF_MPSAFE

2018-06-10 Thread Tomohiro Kusumi


commit 97db17b9ae0f40378f0bad9dc9f38750a8a9bb07
Author: Tomohiro Kusumi 
Date:   Sun Jun 10 11:46:33 2018 -0700

sys/vfs/autofs: Add VFCF_MPSAFE

Summary of changes:
 sys/vfs/autofs/autofs_vfsops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/97db17b9ae0f40378f0bad9dc9f38750a8a9bb07


-- 
DragonFly BSD source repository


git: sys/vfs/autofs: Drop VFCF_NETWORK

2018-06-10 Thread Tomohiro Kusumi


commit 5127b3b0d2ad304e13bc25188102f1deee6ab474
Author: Tomohiro Kusumi 
Date:   Sun Jun 10 11:41:59 2018 -0700

sys/vfs/autofs: Drop VFCF_NETWORK

VFCF_NETWORK came from FreeBSD implementation, but autofs really has
nothing to do with network.

Summary of changes:
 sys/vfs/autofs/autofs_vfsops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/5127b3b0d2ad304e13bc25188102f1deee6ab474


-- 
DragonFly BSD source repository


git: sys/vfs/autofs: Drop unneeded bzero on node/request ctor

2018-06-10 Thread Tomohiro Kusumi


commit a5dfdd2b24c81a8cc6f327c1191e3bfb73e2d1b7
Author: Tomohiro Kusumi 
Date:   Sun Jun 10 09:57:05 2018 -0700

sys/vfs/autofs: Drop unneeded bzero on node/request ctor

Summary of changes:
 sys/vfs/autofs/autofs.c|  3 +++
 sys/vfs/autofs/autofs_vfsops.c | 26 --
 sys/vfs/autofs/autofs_vnops.c  |  3 +++
 3 files changed, 10 insertions(+), 22 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/a5dfdd2b24c81a8cc6f327c1191e3bfb73e2d1b7


-- 
DragonFly BSD source repository


git: sbin/newfs_hammer2: Explicitly include

2018-06-16 Thread Tomohiro Kusumi


commit 351f4ddf663d1f1c56409c6a1d8924d395e6a75d
Author: Tomohiro Kusumi 
Date:   Sat Jun 16 08:40:14 2018 -0700

sbin/newfs_hammer2: Explicitly include 

generally helps become more portable on Linux and other platforms.

Summary of changes:
 sbin/newfs_hammer2/newfs_hammer2.c | 1 +
 1 file changed, 1 insertion(+)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/351f4ddf663d1f1c56409c6a1d8924d395e6a75d


-- 
DragonFly BSD source repository


git: sys/vfs/autofs: Change autofs_softc::sc_lock to use mutex(9)

2018-06-12 Thread Tomohiro Kusumi


commit 2137724ad5a91628e60b420c466d8ddf266266d5
Author: Tomohiro Kusumi 
Date:   Tue Jun 12 05:25:56 2018 -0700

sys/vfs/autofs: Change autofs_softc::sc_lock to use mutex(9)

Summary of changes:
 sys/vfs/autofs/autofs.c| 73 +-
 sys/vfs/autofs/autofs.h|  7 ++--
 sys/vfs/autofs/autofs_vfsops.c | 14 
 sys/vfs/autofs/autofs_vnops.c  |  4 +--
 4 files changed, 65 insertions(+), 33 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/2137724ad5a91628e60b420c466d8ddf266266d5


-- 
DragonFly BSD source repository


git: usr.bin/undo: Explicitly include

2018-06-16 Thread Tomohiro Kusumi


commit dcb5d66bed82234bab2158bf86efad6ef6c4b6ab
Author: Tomohiro Kusumi 
Date:   Sat Jun 16 08:37:26 2018 -0700

usr.bin/undo: Explicitly include 

generally helps become more portable on Linux and other platforms.

Summary of changes:
 usr.bin/undo/undo.c | 1 +
 1 file changed, 1 insertion(+)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/dcb5d66bed82234bab2158bf86efad6ef6c4b6ab


-- 
DragonFly BSD source repository


git: sbin/hammer: Explicitly include

2018-06-16 Thread Tomohiro Kusumi


commit 1ebd8403f3e872874ddfb128deb1dd406be19f17
Author: Tomohiro Kusumi 
Date:   Sat Jun 16 08:39:48 2018 -0700

sbin/hammer: Explicitly include 

generally helps become more portable on Linux and other platforms.

Summary of changes:
 sbin/hammer/hammer_util.h | 1 +
 1 file changed, 1 insertion(+)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/1ebd8403f3e872874ddfb128deb1dd406be19f17


-- 
DragonFly BSD source repository


git: sys/vfs/autofs: Add Copyright

2018-06-11 Thread Tomohiro Kusumi


commit d53d00abbebb746c756238db87b1fb613876e0f8
Author: Tomohiro Kusumi 
Date:   Mon Jun 11 08:47:27 2018 -0700

sys/vfs/autofs: Add Copyright

Summary of changes:
 sys/vfs/autofs/autofs.c| 1 +
 sys/vfs/autofs/autofs.h| 1 +
 sys/vfs/autofs/autofs_ioctl.h  | 1 +
 sys/vfs/autofs/autofs_mount.h  | 1 +
 sys/vfs/autofs/autofs_vfsops.c | 1 +
 sys/vfs/autofs/autofs_vnops.c  | 1 +
 6 files changed, 6 insertions(+)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/d53d00abbebb746c756238db87b1fb613876e0f8


-- 
DragonFly BSD source repository


git: sys/vfs/autofs: #if0 unsupported vfs.autofs.mount_on_stat

2018-06-11 Thread Tomohiro Kusumi


commit 888acc39a1c711adeab821827fcdf56369e0abe9
Author: Tomohiro Kusumi 
Date:   Mon Jun 11 08:47:08 2018 -0700

sys/vfs/autofs: #if0 unsupported vfs.autofs.mount_on_stat

Keep the code since this should be implemented.

Summary of changes:
 sys/vfs/autofs/autofs.c   |  7 ---
 sys/vfs/autofs/autofs.h   |  2 +-
 sys/vfs/autofs/autofs_vnops.c | 10 +++---
 3 files changed, 8 insertions(+), 11 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/888acc39a1c711adeab821827fcdf56369e0abe9


-- 
DragonFly BSD source repository


git: sbin/mount_autofs: Use __DECONST() instead of local __UNCONST()

2018-05-03 Thread Tomohiro Kusumi

commit 7cb51127dd1d8da487c699c94e7216e58e9edd46
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Wed May 2 23:51:02 2018 -0700

sbin/mount_autofs: Use __DECONST() instead of local __UNCONST()

Summary of changes:
 sbin/mount_autofs/mount_autofs.c | 13 -
 1 file changed, 4 insertions(+), 9 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/7cb51127dd1d8da487c699c94e7216e58e9edd46


-- 
DragonFly BSD source repository


git: lib/libdmsg: Fix compile-time warning on Linux

2018-07-03 Thread Tomohiro Kusumi


commit cb4d9e67d8500c4eabf5acd24f0631778ec69f09
Author: Tomohiro Kusumi 
Date:   Tue Jul 3 21:39:34 2018 -0700

lib/libdmsg: Fix compile-time warning on Linux

warning: pointer targets in passing argument 2 of 'crypto_algos[0].init' 
differ in signedness
note: expected 'char *' but argument is of type 'uint8_t *'

Summary of changes:
 lib/libdmsg/crypto.c | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/cb4d9e67d8500c4eabf5acd24f0631778ec69f09


-- 
DragonFly BSD source repository


git: usr.sbin/fstyp: Remove local MIN() definition

2018-01-06 Thread Tomohiro Kusumi

commit eff346a50f2a4926688648c1b1904f9937419958
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sat Jan 6 20:16:46 2018 +0200

usr.sbin/fstyp: Remove local MIN() definition

This isn't needed.
Having local MIN() also broke compilation on NetBSD with ZFS support,
due to ZFS headers already included sys/param.h.

Summary of changes:
 usr.sbin/fstyp/cd9660.c  | 1 +
 usr.sbin/fstyp/fstyp.h   | 2 --
 usr.sbin/fstyp/msdosfs.c | 1 +
 3 files changed, 2 insertions(+), 2 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/eff346a50f2a4926688648c1b1904f9937419958


-- 
DragonFly BSD source repository


git: etc/autofs: Cleanup trailing whitespaces

2018-01-06 Thread Tomohiro Kusumi

commit 8a42714f54b640c1638d71abcf2f4a6db5d36256
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sat Jan 6 20:28:14 2018 +0200

etc/autofs: Cleanup trailing whitespaces

This generates diff between these and FreeBSD scripts.

Summary of changes:
 etc/autofs/include_nis| 2 +-
 etc/autofs/special_media  | 4 ++--
 etc/autofs/special_noauto | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/8a42714f54b640c1638d71abcf2f4a6db5d36256


-- 
DragonFly BSD source repository


git: etc/autofs: Sync with FreeBSD commits

2018-01-06 Thread Tomohiro Kusumi

commit d5b2d2c468ded62d9403bdbdceb1e53ef73f895c
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sat Jan 6 20:37:53 2018 +0200

etc/autofs: Sync with FreeBSD commits

Bring in below from FreeBSD@GitHub in 1 commit.

64382aa4e68 Add /etc/autofs/include_nis, a non-rewriting NIS map.
a5ff2845f3f Rename /etc/autofs/include_nis to 
/etc/autofs/include_nis_nullfs, to indicate that this script provides nullfs 
map rewriting for local mounts.
759e1781cc0 Change formatting; no functional changes.

Summary of changes:
 etc/autofs/Makefile|   8 +-
 etc/autofs/include_nis | 184 ++---
 etc/autofs/{include_nis => include_nis_nullfs} |   6 +-
 3 files changed, 19 insertions(+), 179 deletions(-)
 copy etc/autofs/{include_nis => include_nis_nullfs} (97%)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/d5b2d2c468ded62d9403bdbdceb1e53ef73f895c


-- 
DragonFly BSD source repository


git: sys/vfs/autofs: Cleanups

2018-01-07 Thread Tomohiro Kusumi

commit caaec4e303cff867f420c4e4d2821b7d6ac4638e
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sun Jan 7 18:51:52 2018 +0200

sys/vfs/autofs: Cleanups

Summary of changes:
 sys/vfs/autofs/autofs.h   | 13 +++--
 sys/vfs/autofs/autofs_mount.h |  4 
 sys/vfs/autofs/autofs_vnops.c | 20 +++-
 usr.sbin/autofs/automountd.c  |  1 -
 4 files changed, 22 insertions(+), 16 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/caaec4e303cff867f420c4e4d2821b7d6ac4638e


-- 
DragonFly BSD source repository


git: sbin/mount_autofs: Port mount_autofs(8) from NetBSD

2018-01-15 Thread Tomohiro Kusumi

commit e0c81dfeccab0e0b23107566dabd926fb90eafa9
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Mon Jan 15 17:37:53 2018 +0200

sbin/mount_autofs: Port mount_autofs(8) from NetBSD

Christos added this to NetBSD, so why not for DragonFly.
One will write something simlar to this when porting autofs,
until autofs(5)/automount(8)/automountd(8) become usable enough.

While I try to minimize diff from FreeBSD for autofs userspace
by not making trivial style fixes, new things from NetBSD are
appreciated.

-o getargs support is dropped since unsupported on DragonFly.

Summary of changes:
 sbin/Makefile  |   1 +
 sbin/mount_autofs/Makefile |  10 ++
 .../amdsmb.4 => sbin/mount_autofs/mount_autofs.8   |  50 ---
 sbin/mount_autofs/mount_autofs.c   | 147 +
 .../suspend.c => sbin/mount_autofs/mount_autofs.h  |  26 +---
 5 files changed, 194 insertions(+), 40 deletions(-)
 create mode 100644 sbin/mount_autofs/Makefile
 copy share/man/man4/amdsmb.4 => sbin/mount_autofs/mount_autofs.8 (65%)
 create mode 100644 sbin/mount_autofs/mount_autofs.c
 copy lib/libpuffs/suspend.c => sbin/mount_autofs/mount_autofs.h (77%)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/e0c81dfeccab0e0b23107566dabd926fb90eafa9


-- 
DragonFly BSD source repository


git: sbin/mount_autofs: Change include path from fs/ to vfs/

2018-01-15 Thread Tomohiro Kusumi

commit c4189c6c55c4b22a50229bba5f853f4bd6f9d552
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Mon Jan 15 19:23:55 2018 +0200

sbin/mount_autofs: Change include path from fs/ to vfs/

/usr/include/fs seems to exist as a symlink to vfs/,
but change include path to vfs.

Summary of changes:
 sbin/mount_autofs/mount_autofs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/c4189c6c55c4b22a50229bba5f853f4bd6f9d552


-- 
DragonFly BSD source repository


git: sys/vfs/autofs: prevent assert on unmount.

2018-01-14 Thread Tomohiro Kusumi

commit 1bfb99b1b153fdeeebc2019ea9c3dd8a73450f00
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sun Jan 14 16:14:46 2018 +0200

sys/vfs/autofs: prevent assert on unmount.

Bring in below commit from NetBSD/autofs. This hasn't existed in
FreeBSD and DragonFly. This at least avoids potential panic via
assertion failure on unmount like PR 3062. Note that the assertion
in autofs_node_delete() is good. There might be mkdir related bug.

The GitHub link below may not be a valid URL in the future.


http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/fs/autofs/autofs_vfsops.c.diff?r1=1.2=1.3

(https://github.com/NetBSD/src/commit/59fdd9b6d94c045e89f22f06c9a6f6d6c0fd60f2)

Summary of changes:
 sys/vfs/autofs/autofs_vfsops.c | 5 +
 1 file changed, 5 insertions(+)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/1bfb99b1b153fdeeebc2019ea9c3dd8a73450f00


-- 
DragonFly BSD source repository


git: usr.sbin/autofs: Make automount(8) call chdir("/") before create_directory()

2018-01-12 Thread Tomohiro Kusumi

commit 108ed43a1e5e7ff8f890085e206d970562bf4a7c
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Fri Jan 12 21:46:53 2018 +0200

usr.sbin/autofs: Make automount(8) call chdir("/") before create_directory()

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=224601

Unlike automountd where the daemon is daemonized or lesser-daemonized,
an automount process isn't necessarily at /, and this results in
creating unneeded directories at the current directory.

In the example below, mounting autofs on /mnt/media fails because the
command mkdirs mnt/media instead of /mnt/media. If /mnt/media already
exists the command can mount autofs on /mnt/media, but it still mkdirs
unneeded directories mnt/media.

Calling chdir("/") before creation and restoring the directory after
creation avoids this.

--
[root@]~# automount -L
/mnt/media-nosuid   -media   # 
indirect map referenced at /etc/auto_master:8
[root@]~# ls mnt
ls: mnt: No such file or directory
[root@]~# automount
automount: cannot mount map -media on /mnt/media: No such file or directory
[root@]~# mount | grep autofs
[root@]~# ls mnt
media
[root@]~# tree mnt
mnt
`-- media

Summary of changes:
 usr.sbin/autofs/automount.c | 10 ++
 1 file changed, 10 insertions(+)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/108ed43a1e5e7ff8f890085e206d970562bf4a7c


-- 
DragonFly BSD source repository


git: sys/vfs/autofs: Cleanup autofs_mount()

2018-01-11 Thread Tomohiro Kusumi

commit 52d8539faa68412db6dd25e10af10289a2a58255
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Thu Jan 11 23:19:20 2018 +0200

sys/vfs/autofs: Cleanup autofs_mount()

Drop unneeded local char[MAXPATHLEN] variable.
Bring in comments I've added to NetBSD/autofs for better readability.

Summary of changes:
 sys/vfs/autofs/autofs_vfsops.c | 31 ++-
 1 file changed, 22 insertions(+), 9 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/52d8539faa68412db6dd25e10af10289a2a58255


-- 
DragonFly BSD source repository


git: etc/autofs: Sync special_media with FreeBSD

2018-02-12 Thread Tomohiro Kusumi

commit 180195fd1b680a1c12bd156d8d3b186970b36510
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Mon Feb 12 19:24:24 2018 +0900

etc/autofs: Sync special_media with FreeBSD

Summary of changes:
 etc/autofs/special_media | 25 -
 1 file changed, 20 insertions(+), 5 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/180195fd1b680a1c12bd156d8d3b186970b36510


-- 
DragonFly BSD source repository


git: usr.sbin/fstyp: Bring in exFAT support from FreeBSD

2018-02-12 Thread Tomohiro Kusumi

commit 27ded0ea365b08dd45690c3fcfd37fad3d36976f
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Mon Feb 12 19:22:40 2018 +0900

usr.sbin/fstyp: Bring in exFAT support from FreeBSD

exFAT support was added by below FreeBSD@GitHub commit in 2017.
f72e57262fe11f1cc7ffc3b3000bc5747467b8c3

Summary of changes:
 usr.sbin/fstyp/Makefile|  2 +-
 .../thr1/thr1.c => usr.sbin/fstyp/exfat.c  | 75 +++---
 usr.sbin/fstyp/fstyp.8 |  6 +-
 usr.sbin/fstyp/fstyp.c |  1 +
 usr.sbin/fstyp/fstyp.h |  1 +
 5 files changed, 44 insertions(+), 41 deletions(-)
 copy test/stress/stress2/testcases/thr1/thr1.c => usr.sbin/fstyp/exfat.c (59%)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/27ded0ea365b08dd45690c3fcfd37fad3d36976f


-- 
DragonFly BSD source repository


git: etc/autofs: Cleanup trailing whitespaces

2018-02-12 Thread Tomohiro Kusumi

commit 48a93f514f93ff671b7b6c9bbed54d45b3f65180
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Tue Feb 13 11:28:15 2018 +0900

etc/autofs: Cleanup trailing whitespaces

This generates diff from FreeBSD.

Summary of changes:
 etc/autofs/special_media | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/48a93f514f93ff671b7b6c9bbed54d45b3f65180


-- 
DragonFly BSD source repository


git: sys/vfs/autofs: Remove #if0'd export related code

2018-02-13 Thread Tomohiro Kusumi

commit 5e4f9d103731e81813e634ec6a4ac0e3ae6a0ae4
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Wed Feb 14 03:33:30 2018 +0900

sys/vfs/autofs: Remove #if0'd export related code

Exporting is never going to be implemented.

Summary of changes:
 sys/vfs/autofs/autofs.h|  3 ---
 sys/vfs/autofs/autofs_vfsops.c |  5 -
 sys/vfs/autofs/autofs_vnops.c  | 18 ++
 3 files changed, 2 insertions(+), 24 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/5e4f9d103731e81813e634ec6a4ac0e3ae6a0ae4


-- 
DragonFly BSD source repository


git: sys/vfs/autofs: Cleanups

2018-02-13 Thread Tomohiro Kusumi

commit b112b66964202d7e2d748cc4e4dc25e0fa779f82
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Wed Feb 14 02:10:39 2018 +0900

sys/vfs/autofs: Cleanups

Summary of changes:
 sys/vfs/autofs/autofs.c   | 2 +-
 sys/vfs/autofs/autofs_vnops.c | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/b112b66964202d7e2d748cc4e4dc25e0fa779f82


-- 
DragonFly BSD source repository


git: sbin/hammer: Fix compile error on Linux

2018-02-13 Thread Tomohiro Kusumi

commit cdd92e421a16d2c3e42cb0ca629b3bebcd0cbf9f
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Wed Feb 14 08:48:39 2018 +0900

sbin/hammer: Fix compile error on Linux

Failed with gcc 4.4.7 in CentOS 6.x.
--
cmd_recover.c:78: error: redefinition of typedef 'bigblock_t'
cmd_recover.c:55: note: previous declaration of 'bigblock_t' was here

Summary of changes:
 sbin/hammer/cmd_recover.c | 14 ++
 1 file changed, 6 insertions(+), 8 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/cdd92e421a16d2c3e42cb0ca629b3bebcd0cbf9f


-- 
DragonFly BSD source repository


git: sys/vfs/autofs: Remove AUTOFS_ASSERT_*LOCKED()

2018-02-13 Thread Tomohiro Kusumi

commit 6be174c1f53e8f6b64e57251aa0d6cc70538793e
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Wed Feb 14 08:35:32 2018 +0900

sys/vfs/autofs: Remove AUTOFS_ASSERT_*LOCKED()

These macros came from FreeBSD, but more readable without these.

Summary of changes:
 sys/vfs/autofs/autofs.c   |  2 +-
 sys/vfs/autofs/autofs.h   |  7 ---
 sys/vfs/autofs/autofs_vnops.c | 10 +-
 3 files changed, 6 insertions(+), 13 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/6be174c1f53e8f6b64e57251aa0d6cc70538793e


-- 
DragonFly BSD source repository


git: sys/vfs/autofs: Change autofs_node::an_vnode_lock to use mutex(9)

2018-02-13 Thread Tomohiro Kusumi

commit bfccbb767b7ebbb8fc90ae72d5a21bc7fb719efe
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Wed Feb 14 06:57:32 2018 +0900

sys/vfs/autofs: Change autofs_node::an_vnode_lock to use mutex(9)

Summary of changes:
 sys/vfs/autofs/autofs.h   |  3 ++-
 sys/vfs/autofs/autofs_vnops.c | 14 +++---
 2 files changed, 9 insertions(+), 8 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/bfccbb767b7ebbb8fc90ae72d5a21bc7fb719efe


-- 
DragonFly BSD source repository


git: sys/vfs/autofs: Change autofs_mount::am_lock to use mutex(9)

2018-02-13 Thread Tomohiro Kusumi

commit bc6139d4b8b64078d80eba67b9c9f1f79ab2e12f
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Wed Feb 14 07:13:13 2018 +0900

sys/vfs/autofs: Change autofs_mount::am_lock to use mutex(9)

Summary of changes:
 sys/vfs/autofs/autofs.c| 10 +-
 sys/vfs/autofs/autofs.h|  9 -
 sys/vfs/autofs/autofs_vfsops.c | 14 +++---
 sys/vfs/autofs/autofs_vnops.c  | 16 
 4 files changed, 24 insertions(+), 25 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/bc6139d4b8b64078d80eba67b9c9f1f79ab2e12f


-- 
DragonFly BSD source repository


git: sbin/hammer: Fix compile warning on Linux

2018-02-16 Thread Tomohiro Kusumi

commit 5f87bdedfbeef14602ae9bfff910fb1ca2278b63
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sat Feb 17 10:49:39 2018 +0900

sbin/hammer: Fix compile warning on Linux

Warned by gcc 7.3.1 in Fedora.
Extend the size of destination string.
dirent::d_name[] is 256 bytes in Linux (and *BSD).

--
cmd_abort.c: In function 'hammer_cmd_abort_cleanup':
cmd_abort.c:73:44: warning: '%s' directive output may be truncated writing 
up to 255 bytes into a region of size 55 [-Wformat-truncation=]
snprintf (pidfile, PIDFILE_BUFSIZE, "%s/%s",
^~
cmd_abort.c:73:4: note: 'snprintf' output between 10 and 265 bytes into a 
destination of size 64
snprintf (pidfile, PIDFILE_BUFSIZE, "%s/%s",
^~~~
 pidfile_loc, den->d_name);
 ~

Summary of changes:
 sbin/hammer/hammer.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/5f87bdedfbeef14602ae9bfff910fb1ca2278b63


-- 
DragonFly BSD source repository


git: sys/vfs/autofs: Cleanup

2018-07-27 Thread Tomohiro Kusumi


commit 2f752b64598e15f8647fc8b8481b3b003cd5888e
Author: Tomohiro Kusumi 
Date:   Thu Jul 26 11:14:09 2018 -0700

sys/vfs/autofs: Cleanup

Summary of changes:
 sys/vfs/autofs/autofs.c   | 9 +++--
 sys/vfs/autofs/autofs_vnops.c | 5 +++--
 2 files changed, 6 insertions(+), 8 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/2f752b64598e15f8647fc8b8481b3b003cd5888e


-- 
DragonFly BSD source repository


git: sys/vfs/autofs: Make {test,nlookup}_fs_root() return bool

2018-07-27 Thread Tomohiro Kusumi


commit f568b8a36137fc2eadf260406f622f8d4bfff0a4
Author: Tomohiro Kusumi 
Date:   Thu Jul 26 11:18:25 2018 -0700

sys/vfs/autofs: Make {test,nlookup}_fs_root() return bool

Change return type of DragonFly specific utility functions for
triggering (very different from FreeBSD, NetBSD and OpenBSD).

Summary of changes:
 sys/vfs/autofs/autofs_vnops.c | 23 ---
 1 file changed, 12 insertions(+), 11 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/f568b8a36137fc2eadf260406f622f8d4bfff0a4


-- 
DragonFly BSD source repository


Re: git: fdisk, gpt - Support trim on recent kernels

2018-08-01 Thread Tomohiro Kusumi
Matthew Dillon :
>
>
> commit d9306807fd00040e0598140bd4c634685f805510
> Author: Matthew Dillon 
> Date:   Wed Aug 1 14:38:34 2018 -0700
>
> fdisk, gpt - Support trim on recent kernels
>
> * Recent kernels removed the 'trim' sysctls.  Devices now allow trim by
>   default.
>
> * Fix the fdisk -E option to no longer try to use the sysctls.
>
> * Add trim support to gpt init (-E).
>
> * Fix swapon -e, change option to -E to match gpt and fdisk
>   (-e still supported and does the same thing).

HAMMER1 and UFS also check this sysctl on newfs.

>
> Summary of changes:
>  sbin/fdisk/fdisk.c |  9 ++---
>  sbin/gpt/create.c  | 45 +
>  sbin/gpt/gpt.8 |  9 -
>  sbin/swapon/swapon.8   |  8 +---
>  sbin/swapon/swapon.c   | 31 +--
>  sys/bus/cam/scsi/scsi_da.c |  5 -
>  6 files changed, 65 insertions(+), 42 deletions(-)
>
> http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/d9306807fd00040e0598140bd4c634685f805510
>
>
> --
> DragonFly BSD source repository


git: sys/vfs/autofs: Change u_xxx -> unsigned xxx

2018-08-12 Thread Tomohiro Kusumi


commit 0b1d8a0d5dcb276e6f33a848b8337f8acd0d60f5
Author: Tomohiro Kusumi 
Date:   Sun Aug 12 04:26:59 2018 -0700

sys/vfs/autofs: Change u_xxx -> unsigned xxx

(ap->a_cmd and refcount apis are of u_xxx)

Summary of changes:
 sys/vfs/autofs/autofs.c | 2 +-
 sys/vfs/autofs/autofs.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/0b1d8a0d5dcb276e6f33a848b8337f8acd0d60f5


-- 
DragonFly BSD source repository


git: sys/vfs/autofs: Cleanups

2018-07-24 Thread Tomohiro Kusumi


commit 74565ee06d258f57594797cafc26efc65aa1b4a3
Author: Tomohiro Kusumi 
Date:   Sun Jul 22 09:06:47 2018 -0700

sys/vfs/autofs: Cleanups

Summary of changes:
 sys/vfs/autofs/autofs.c| 44 +-
 sys/vfs/autofs/autofs_vfsops.c | 15 ++
 sys/vfs/autofs/autofs_vnops.c  | 35 +++--
 3 files changed, 40 insertions(+), 54 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/74565ee06d258f57594797cafc26efc65aa1b4a3


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Cleanup CRC functions

2018-07-05 Thread Tomohiro Kusumi


commit 9545e52d6402b584c9013f8d4a5d05f6f43398e8
Author: Tomohiro Kusumi 
Date:   Wed Jul 4 22:44:02 2018 -0700

sys/vfs/hammer: Cleanup CRC functions

The inner cmp in nested `vol_version >= HAMMER_VOL_VERSION_SEVEN`
conditional in hammer_crc_test_xxx() mostly get optimized out by gcc,
so not much reason to have __hammer_crc_get_xxx() in case of retry
using old CRC.

Summary of changes:
 sys/vfs/hammer/hammer_crc.h | 80 -
 1 file changed, 14 insertions(+), 66 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/9545e52d6402b584c9013f8d4a5d05f6f43398e8


-- 
DragonFly BSD source repository


git: sbin/hammer2: Drop unused header includes in icrc.c

2018-07-07 Thread Tomohiro Kusumi


commit 4903227ff44734a5637095b8267daa5cfdc5b67d
Author: Tomohiro Kusumi 
Date:   Sat Jul 7 01:07:21 2018 -0700

sbin/hammer2: Drop unused header includes in icrc.c

libdmsg, UUID, and HAMMER2 ondisk definitions are not needed
for CRC calculation.

Summary of changes:
 sbin/hammer2/icrc.c | 4 
 1 file changed, 4 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/4903227ff44734a5637095b8267daa5cfdc5b67d


-- 
DragonFly BSD source repository


git: sbin/hammer2: Explicitly include for stat(2)

2018-07-07 Thread Tomohiro Kusumi


commit dec3d4eeab4c720eb58eafa0e2ae328b04a69a5b
Author: Tomohiro Kusumi 
Date:   Sat Jul 7 05:28:56 2018 -0700

sbin/hammer2: Explicitly include  for stat(2)

Fix compile error on Linux.

Summary of changes:
 sbin/hammer2/hammer2.h | 1 +
 1 file changed, 1 insertion(+)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/dec3d4eeab4c720eb58eafa0e2ae328b04a69a5b


-- 
DragonFly BSD source repository


git: sbin/mount_autofs: Add description

2018-01-22 Thread Tomohiro Kusumi

commit 192d378b81e754e3e605c81fa7336c668b1f7023
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Mon Jan 22 17:29:46 2018 +0200

sbin/mount_autofs: Add description

TL;DR users won't be running this command to mount autofs.

Having autofs_enable=YES won't run this command either.
There is a high level command automount(8) and that does everything
based on /etc/auto_master contents.

mount_autofs(8) is a low level version where users can manually
specify things automount(8) internally passes to mount(2).
Thus it's not easy or needed to understand what -fOp options exactly
do without having clear understanding of autofs internal.
But I'll write it here in case interested.

 -f is a string which eventually gets copied to statfs::f_mntfromname.
  Unlike most of the filesystems with backing store, this is just
  a label to identify the autofs mount.
 -O is mount options of autofs(5).
 -p is a prefix string to distinct direct and indirect mapping.

Summary of changes:
 sbin/mount_autofs/mount_autofs.8 | 20 
 1 file changed, 16 insertions(+), 4 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/192d378b81e754e3e605c81fa7336c668b1f7023


-- 
DragonFly BSD source repository


git: usr.sbin/autofs: Drop unneeded header include

2018-01-21 Thread Tomohiro Kusumi

commit ee46a5721414c0a073c726bee51b75b8b9f8fc4d
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sun Jan 21 19:49:56 2018 +0200

usr.sbin/autofs: Drop unneeded header include

common.c has no dependency on autofs api itself.

Summary of changes:
 usr.sbin/autofs/common.c | 1 -
 1 file changed, 1 deletion(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/ee46a5721414c0a073c726bee51b75b8b9f8fc4d


-- 
DragonFly BSD source repository


git: sys/vfs/autofs: Cleanups

2018-03-06 Thread Tomohiro Kusumi

commit 662e8088622360d8af1155902a0f8b55a451a63d
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Wed Mar 7 03:27:04 2018 +0900

sys/vfs/autofs: Cleanups

Move local varaibles to inner scopes where possible.
The existing local variable declarations are mostly from FreeBSD,
but I've also changed NetBSD autofs the way this commit does.

(Don't do this for autofs userspace though. Increasing diff from
FreeBSD for non functional thing like this is much less important,
whereas kernel side is basically a rewrite.)

Summary of changes:
 sys/vfs/autofs/autofs.c| 20 +++-
 sys/vfs/autofs/autofs_vfsops.c | 10 ++
 sys/vfs/autofs/autofs_vnops.c  |  5 ++---
 3 files changed, 19 insertions(+), 16 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/662e8088622360d8af1155902a0f8b55a451a63d


-- 
DragonFly BSD source repository


git: sys/vfs/autofs: Use d_xxx_t typedefs for /dev/autofs

2018-04-10 Thread Tomohiro Kusumi

commit 41c4812410c68fe6139f44c5d86d117dad105c09
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Tue Apr 10 17:44:58 2018 +0900

sys/vfs/autofs: Use d_xxx_t typedefs for /dev/autofs

Summary of changes:
 sys/vfs/autofs/autofs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/41c4812410c68fe6139f44c5d86d117dad105c09


-- 
DragonFly BSD source repository


Re: git: Move the IOCTLTRIM ioctl to a better header and rename it to DAIOCTRIM.

2018-04-10 Thread Tomohiro Kusumi
2018-04-10 22:13 GMT+09:00 Sascha Wildner :
>
> commit 32506cfa691f80faa47486d6f94a98ae12387eeb
> Author: Sascha Wildner 
> Date:   Tue Apr 10 15:11:49 2018 +0200
>
> Move the IOCTLTRIM ioctl to a better header and rename it to DAIOCTRIM.
>
>  really is only for old tty related stuff.
>
> Also bump __DragonFly_version, because there is one port which uses
> IOCTLTRIM currently, i.e. benchmarks/fio. We'll send a patch upstream
> that switches it to DAIOCTRIM, and once the updated version has hit
> the /usr/dports tree, I will remove IOCTLTRIM from base.

This change is now in fio upstream.
https://github.com/axboe/fio/commit/4fe721ac83e84df7c6be07394d1963fd1ec5d9a6

>
> Summary of changes:
>  sbin/fdisk/fdisk.c  |  5 +++--
>  sbin/newfs/mkfs.c   |  5 +++--
>  sbin/newfs_hammer/newfs_hammer.c|  5 +++--
>  sbin/swapon/swapon.c|  5 +++--
>  sys/bus/cam/scsi/scsi_da.c  |  2 ++
>  include/bitstring.h => sys/bus/cam/scsi/scsi_daio.h | 12 +++-
>  sys/sys/param.h |  3 ++-
>  7 files changed, 23 insertions(+), 14 deletions(-)
>  copy include/bitstring.h => sys/bus/cam/scsi/scsi_daio.h (86%)
>
> http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/32506cfa691f80faa47486d6f94a98ae12387eeb
>
>
> --
> DragonFly BSD source repository


Re: git: libc: Replace vis(3) and unvis(3) files with NetBSD versions

2018-04-09 Thread Tomohiro Kusumi
nice updates

2018-04-10 5:24 GMT+09:00 Francois Tigeot :
>
> commit 4be4de019fe4a28d5378192245290895096def17
> Author: François Tigeot 
> Date:   Mon Apr 9 21:54:26 2018 +0200
>
> libc: Replace vis(3) and unvis(3) files with NetBSD versions
>
> * Rendering the corresponding APIs compatible with NetBSD and FreeBSD.
>
> * Keep strnvis() as-is, keeping it compatible with previous DragonFly
>   versions, OpenBSD and libbsd
>
> * We already had the original OpenBSD version of strnvis(), which
>   predates the NetBSD one by more than 10 years
>
> * New userland utilities code partially obtained from FreeBSD.
>
> Reviewed-by: swildner
>
> Summary of changes:
>  include/vis.h |  64 +++-
>  lib/libc/gen/Makefile.inc |   6 +-
>  lib/libc/gen/Symbol.map   |  13 +
>  lib/libc/gen/unvis.3  | 178 ++---
>  lib/libc/gen/unvis.c  | 517 --
>  lib/libc/gen/vis.3| 426 -
>  lib/libc/gen/vis.c| 841 
> ++
>  usr.bin/showmount/showmount.c |   4 +-
>  usr.sbin/fstyp/fstyp.c|   5 +-
>  9 files changed, 1606 insertions(+), 448 deletions(-)
>
> http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/4be4de019fe4a28d5378192245290895096def17
>
>
> --
> DragonFly BSD source repository


git: sbin/hammer: Drop _X macro for hammer show

2018-04-21 Thread Tomohiro Kusumi

commit dcf5173ca760ee08d704d08a8b5e30f30b0177ef
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sat Apr 21 14:58:36 2018 -0700

sbin/hammer: Drop _X macro for hammer show

Also reduce supported indent levels from 17 to 10.

17 levels with 62 fanouts for internal nodes seems way more than
needed even considering max capacity of HAMMER1.

Summary of changes:
 sbin/hammer/cmd_show.c | 27 +--
 1 file changed, 9 insertions(+), 18 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/dcf5173ca760ee08d704d08a8b5e30f30b0177ef


-- 
DragonFly BSD source repository


git: sys/vfs/autofs: Use ksnprintf() (sync with NetBSD)

2018-04-20 Thread Tomohiro Kusumi

commit a5d18315b411560ede0833ac792e9c8655e592b0
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Fri Apr 20 08:01:30 2018 -0700

sys/vfs/autofs: Use ksnprintf() (sync with NetBSD)

FreeBSD and DragonFly had strcpy()+strcat().
NetBSD changed it to snprintf().

Summary of changes:
 sys/vfs/autofs/autofs.c | 17 +++--
 1 file changed, 7 insertions(+), 10 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/a5d18315b411560ede0833ac792e9c8655e592b0


-- 
DragonFly BSD source repository


git: sys/vfs/autofs: Fix a comment

2018-04-20 Thread Tomohiro Kusumi

commit d0b59b8a17646d0fd692c020a7d99f1e4dd6ad6f
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Fri Apr 20 08:00:57 2018 -0700

sys/vfs/autofs: Fix a comment

This isn't really a FALLTHROUGH. Not sure why I even originally
added this since this had never existed in FreeBSD too.

Summary of changes:
 sys/vfs/autofs/autofs_vnops.c | 1 -
 1 file changed, 1 deletion(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/d0b59b8a17646d0fd692c020a7d99f1e4dd6ad6f


-- 
DragonFly BSD source repository


git: sys/vfs/autofs: Cleanups (sync with NetBSD and OpenBSD)

2018-03-26 Thread Tomohiro Kusumi

commit add630f0972670974657514385cc9a70e241cdff
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Tue Mar 27 00:12:59 2018 +0900

sys/vfs/autofs: Cleanups (sync with NetBSD and OpenBSD)

FreeBSD has these in autofs.c, but only vfsops needs init/uninit.

Summary of changes:
 sys/vfs/autofs/autofs.c| 91 +-
 sys/vfs/autofs/autofs.h|  4 +-
 sys/vfs/autofs/autofs_vfsops.c | 89 -
 sys/vfs/autofs/autofs_vnops.c  |  2 -
 4 files changed, 91 insertions(+), 95 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/add630f0972670974657514385cc9a70e241cdff


-- 
DragonFly BSD source repository


git: sys/vfs/autofs: Revert 1bfb99b1b1("prevent assert on unmount")

2018-03-24 Thread Tomohiro Kusumi

commit 072355267a78ef9c72e8dccd4b7aaf7321be5ba1
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sat Mar 24 18:18:00 2018 +0900

sys/vfs/autofs: Revert 1bfb99b1b1("prevent assert on unmount")

1bfb99b1b1 originally brought from NetBSD was not correct.
Autofs can't unmount when more than one level of directories
are created via indirect map.

Summary of changes:
 sys/vfs/autofs/autofs_vfsops.c | 12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/072355267a78ef9c72e8dccd4b7aaf7321be5ba1


-- 
DragonFly BSD source repository


git: sys/vfs/autofs: Don't dereference vnode pointer if allocation failed

2018-06-24 Thread Tomohiro Kusumi


commit f94d0241d75657b3d11d9e575e86802d596155d1
Author: Tomohiro Kusumi 
Date:   Sun Jun 24 05:52:26 2018 -0700

sys/vfs/autofs: Don't dereference vnode pointer if allocation failed

Summary of changes:
 sys/vfs/autofs/autofs_vfsops.c | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/f94d0241d75657b3d11d9e575e86802d596155d1


-- 
DragonFly BSD source repository


git: sys/vfs/autofs: Install vnops after root dir is initialized

2018-06-24 Thread Tomohiro Kusumi


commit 636b93583f89810acb765dcd6022ce585f2764f8
Author: Tomohiro Kusumi 
Date:   Sun Jun 24 05:27:01 2018 -0700

sys/vfs/autofs: Install vnops after root dir is initialized

Summary of changes:
 sys/vfs/autofs/autofs_vfsops.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/636b93583f89810acb765dcd6022ce585f2764f8


-- 
DragonFly BSD source repository


git: sys/vfs/autofs: Simplify vfs_root()

2018-06-24 Thread Tomohiro Kusumi


commit d3e56a2a2065057260dc863e26b63dc2a01bd14f
Author: Tomohiro Kusumi 
Date:   Sun Jun 24 05:19:47 2018 -0700

sys/vfs/autofs: Simplify vfs_root()

The root dir is created on mount time, and must exist by the time
vfs_root() is called.

Summary of changes:
 sys/vfs/autofs/autofs.h|  3 ---
 sys/vfs/autofs/autofs_vfsops.c | 15 +--
 2 files changed, 5 insertions(+), 13 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/d3e56a2a2065057260dc863e26b63dc2a01bd14f


-- 
DragonFly BSD source repository


git: sbin/hammer2: Silence -Wformat-truncation= warning on Linux (gcc 7.3)

2019-01-12 Thread Tomohiro Kusumi


commit c5122b6a551adca512e12cc697805fd194e186fa
Author: Tomohiro Kusumi 
Date:   Sun Jan 13 14:40:19 2019 -0800

sbin/hammer2: Silence -Wformat-truncation= warning on Linux (gcc 7.3)

filename[HAMMER2_INODE_MAXNAME] may not be sufficient if
snprintf source pfs.name string is large enough. To silence
the warning, filename[] needs another 16 bytes.

This doesn't make difference on runtime, because bytes beyond
sizeof(pfs.name) won't be used even if strlen(pfs.name) is
large enough that filename[] contents exceeds sizeof(pfs.name).

(i.e. end result of pfs.name may be incomplete with or without
this commit)

--
cmd_snapshot.c: In function 'cmd_pfs_snapshot':
cmd_snapshot.c:84:9: warning: '%04d' directive output may be truncated 
writing between 4 and 11 bytes into a region of size between 0 and 255 
[-Wformat-truncation=]
 "%s.%04d%02d%02d.%02d%02d%02d",
 ^~~~
cmd_snapshot.c:83:3: note: 'snprintf' output between 17 and 324 bytes into 
a destination of size 256
   snprintf(filename, sizeof(filename),
   ^~~~
 "%s.%04d%02d%02d.%02d%02d%02d",
 ~~~
 pfs.name,
 ~
 tp->tm_year + 1900,
 ~~~
 tp->tm_mon + 1,
 ~~~
 tp->tm_mday,
 
 tp->tm_hour,
 
 tp->tm_min,
 ~~~
 tp->tm_sec);
 ~~~

Summary of changes:
 sbin/hammer2/cmd_snapshot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/c5122b6a551adca512e12cc697805fd194e186fa


-- 
DragonFly BSD source repository


git: sys/vfs/fuse: Add fuse_vop_{get,put}pages()

2019-04-02 Thread Tomohiro Kusumi


commit 0660ce6d7a089cd9432236debb3e432b6a8d739b
Author: Tomohiro Kusumi 
Date:   Tue Apr 2 02:31:59 2019 +0900

sys/vfs/fuse: Add fuse_vop_{get,put}pages()

No functional changes (yet).

Summary of changes:
 sys/vfs/fuse/fuse_vnops.c | 26 --
 1 file changed, 24 insertions(+), 2 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/0660ce6d7a089cd9432236debb3e432b6a8d739b


-- 
DragonFly BSD source repository


git: sys/vfs/fuse: Add assertions

2019-04-02 Thread Tomohiro Kusumi


commit 1243142a5b1ce681157b05f10355763acf7048e4
Author: Tomohiro Kusumi 
Date:   Tue Apr 2 02:25:07 2019 +0900

sys/vfs/fuse: Add assertions

Summary of changes:
 sys/vfs/fuse/fuse_node.c | 2 ++
 1 file changed, 2 insertions(+)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/1243142a5b1ce681157b05f10355763acf7048e4


-- 
DragonFly BSD source repository


git: sys/vfs: Remove .vop_mmap implementations

2019-04-02 Thread Tomohiro Kusumi


commit b56a444bd12208907985cf2397fd2a72d7ff2ba3
Author: Tomohiro Kusumi 
Date:   Tue Apr 2 02:40:27 2019 +0900

sys/vfs: Remove .vop_mmap implementations

These either return EINVAL or panic.
VOP_MMAP() is unused in the first place.

(FreeBSD got rid of VOP_MMAP() entirely in 2000.)
--
commit 1afa7eea2714a80f7f460a084f2dd793df48a236
Author: eivind 
Date:   Wed Nov 1 17:57:24 2000 +

Give vop_mmap an untimely death.  The opportunity to give it a timely
death timed out in 1996.

Summary of changes:
 sys/gnu/vfs/ext2fs/ext2_vnops.c | 17 -
 sys/vfs/deadfs/dead_vnops.c |  1 -
 sys/vfs/nfs/nfs_vnops.c | 17 -
 sys/vfs/ufs/ufs_vnops.c | 17 -
 4 files changed, 52 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/b56a444bd12208907985cf2397fd2a72d7ff2ba3


-- 
DragonFly BSD source repository


git: sys/vfs/fuse: Drop PCATCH from tsleep on waiting IPC completion

2019-04-03 Thread Tomohiro Kusumi


commit 419ae2ab33adc334dbd5376707059d86f40b9d5d
Author: Tomohiro Kusumi 
Date:   Wed Apr 3 00:30:11 2019 +0900

sys/vfs/fuse: Drop PCATCH from tsleep on waiting IPC completion

Even with kern_sigprocmask(SIG_BLOCK) called prior to tsleep(9),
tsleep with PCATCH flag can still catch a signal (e.g. SIGINT) and
return 0 (not EINTR).

This is due to tsleep(9) setting "lp->lwp_flags |= LWP_SINTR;" before
going into sleep when PCATCH is specified.

When this happens, KKASSERT() after tsleep(9) can be false, so just
drop PCATCH.

Summary of changes:
 sys/vfs/fuse/fuse_ipc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/419ae2ab33adc334dbd5376707059d86f40b9d5d


-- 
DragonFly BSD source repository


git: sys/vfs/fuse: Mark /dev/autofs with D_MPSAFE

2019-04-05 Thread Tomohiro Kusumi


commit cb953f034079dab1ad277b5f44b8ae5bab2b079a
Author: Tomohiro Kusumi 
Date:   Sat Apr 6 04:15:20 2019 +0900

sys/vfs/fuse: Mark /dev/autofs with D_MPSAFE

/dev/autofs was left without mpsafe flag.

Summary of changes:
 sys/vfs/autofs/autofs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/cb953f034079dab1ad277b5f44b8ae5bab2b079a


-- 
DragonFly BSD source repository


git: sys/vfs/fuse: Fix confusing vop_write_dirent() retval test

2019-04-05 Thread Tomohiro Kusumi


commit 3c817f1ea603d010743de4357f46729ba30d25df
Author: Tomohiro Kusumi 
Date:   Sat Apr 6 05:59:45 2019 +0900

sys/vfs/fuse: Fix confusing vop_write_dirent() retval test

vop_write_dirent() has confusing return value (bug).

When vop_write_dirent() returns non zero, *error is unchanged.
OTOH when vop_write_dirent() returns zero, *error may be non zero.

Summary of changes:
 sys/vfs/fuse/fuse_vnops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/3c817f1ea603d010743de4357f46729ba30d25df


-- 
DragonFly BSD source repository


git: sys/vfs/autofs: Use VFS_STATFS()

2019-04-05 Thread Tomohiro Kusumi


commit aa2533c184e58ade4fa76dbc800a783b0f8c387a
Author: Tomohiro Kusumi 
Date:   Sat Apr 6 05:52:35 2019 +0900

sys/vfs/autofs: Use VFS_STATFS()

Summary of changes:
 sys/vfs/autofs/autofs_vfsops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/aa2533c184e58ade4fa76dbc800a783b0f8c387a


-- 
DragonFly BSD source repository


git: sys/vfs/fuse: Cleanup (use TAILQ_FOREACH())

2019-04-01 Thread Tomohiro Kusumi


commit 0d020c7bb9e95bf83bc9a3cced6cd2899af27a19
Author: Tomohiro Kusumi 
Date:   Tue Apr 2 00:25:36 2019 +0900

sys/vfs/fuse: Cleanup (use TAILQ_FOREACH())

Didn't need to use safe version.

Summary of changes:
 sys/vfs/fuse/fuse_device.c | 8 +++-
 sys/vfs/fuse/fuse_ipc.c| 6 +++---
 2 files changed, 6 insertions(+), 8 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/0d020c7bb9e95bf83bc9a3cced6cd2899af27a19


-- 
DragonFly BSD source repository


git: sys/kern: Add struct file* arg to VOP_{GETATTR, SETATTR, READ, WRITE, FSYNC, READDIR}

2019-03-31 Thread Tomohiro Kusumi


commit 2dfa19fa300df7648d9bf56b69c2cfd345882046
Author: Tomohiro Kusumi 
Date:   Mon Apr 1 01:30:07 2019 +0900

sys/kern: Add struct file* arg to 
VOP_{GETATTR,SETATTR,READ,WRITE,FSYNC,READDIR}

This commit changes VOP interface to support FUSE API/ABI.
It just adds an additional struct file* argument to VOP's, so that
FUSE VOP's can access *fp pointer (currently accessible only from
caller of VOP's if any, with exception of VOP_OPEN(), VOP_CLOSE(),
etc) and make use of its ->private_data pointer.

FUSE API/ABI requires FUSE to maintain a per file (usually per file
descriptor) data called fh. The fh is an opaque data whose purpose
may differ among userspace filesystems, but typically used to store
file descriptor value or arbitrary userspace address used by the
userspace filesystem process.

Below diagram illustrates typical flow of maintaining fh. The
userspace filesystem uses fd obtained from opening backing store
(e.g fd for regular file, socket, etc) for fh, as a consequence of
end user's open(2) syscall, and expects FUSE to maintain that value
for future use as an identifier for userspace.

* Notes on Linux VFS I/F vs BSD VFS I/F:
In Linux, supporting the concept of fh is quite straight forward since
Linux kernel has functions vector built around (opened)file including
things like mmap(2) handler, in addition to a vector built around
inode.

But since DragonFly doesn't have a vector built around file (other
than a simple struct fileops, which doesn't meet requirements of fh),
this change was needed for selected VOP's as minimum requirements
for initial FUSE API/ABI support.

--
FUSE user  FUSE   FUSE userspace fs
|  |  |
|-open(2)->|  |
| * issue VOP_OPEN |-VOP_OPEN>|
|  | * issue FUSE_OPEN| * open something
|  |  | * reply fd as fh
|  |<VOP_OPEN-|
|<open(2)--| * store fh in fp |
| * open success   |  |
|  |  |
|...   |  |
|...   |  |
|  |  |
|-read(2)->|  |
| * issue VOP_READ |-VOP_READ>|
|  | * issue FUSE_READ|
|  |   with fh from fp| * read something
|  |  |   using fh for fd
|  |<VOP_READ-|
|<read(2)--| * return read bytes  |
| * uiomove() success  |  |
|  |  |

Summary of changes:
 sys/kern/kern_fp.c   |  2 +-
 sys/kern/uipc_syscalls.c |  4 ++--
 sys/kern/vfs_syscalls.c  | 12 ++--
 sys/kern/vfs_vnops.c |  6 +++---
 sys/kern/vfs_vopops.c| 21 +++--
 sys/sys/vfsops.h | 44 
 6 files changed, 59 insertions(+), 30 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/2dfa19fa300df7648d9bf56b69c2cfd345882046


-- 
DragonFly BSD source repository


<    5   6   7   8   9   10   11   12   13   14   >