git: sbin/hammer: Change hammer show's printf format for elm base

2015-09-25 Thread Tomohiro Kusumi

commit d9930283d4e41c9e04dd9389cf84eb0c4d9cbe47
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Wed Sep 23 00:52:56 2015 +0900

sbin/hammer: Change hammer show's printf format for elm base

This commit changes printf format for struct hammer_base_elm
fields. It doesn't change information to be printed, but it
does change the order.

This commit better explains how B-Tree nodes are located in
the B-Tree by having all 5 keys lo:objid:rectype:key:tid in
the same line. Since now that hammer show supports these keys
as search directives, it's better to directly reflect those
of each elm to hammer show's output.

ot (obj_type) isn't one of the 5 keys to compare node elms,
so this could(should) go to the next line.

= (A) before this commit
...
G-- ELM  8 L lo=0001 obj=000101da3ef7 rt=11 
key=4c94cade3f178000 ot=00
 tids=000104018590: suboff=800020c78000 
mirror=000104018590 *
...
G-- ELM  1 R lo=0002 obj=0001 rt=15 
key=0002 ot=01
   d tids=0001007e0ff0:00010403b9b0

= (B) with this commit
...
G-- ELM  8 L lo=0001 obj=000101da3ef7 rt=11 
key=4c94cade3f178000 tid=000104018590
 del= ot=00 suboff=800020c78000 
mirror=000104018590 *
...
G-- ELM  1 R lo=0002 obj=0001 rt=15 
key=0002 tid=0001007e0ff0
   d del=00010403b9b0 ot=01

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

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Remove obsolete macro HAMMER_HEAD|TAIL_ONDISK_SIZE

2015-09-25 Thread Tomohiro Kusumi

commit d4576900f7e6a44c8839bac8b4d6233f889c055a
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sat Sep 12 23:17:07 2015 +0900

sys/vfs/hammer: Remove obsolete macro HAMMER_HEAD|TAIL_ONDISK_SIZE

These macros are no longer used and not necessary.

These are only used in the early stage of hammer devel and
macro values do not reflect hammer implementation today.

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

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Fix wrong comment on ambiguous variable name

2015-09-25 Thread Tomohiro Kusumi

commit 5b5dd5b40a6d2dda14e252ea4f67c5fa86cb95c7
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sat Sep 19 15:28:34 2015 +0900

sys/vfs/hammer: Fix wrong comment on ambiguous variable name

hammer_volume_ondisk::vol_name[] is a filesystem label string
specified by newfs_hammer via -L option (see below), but not
the name of the volume like "/dev/da1".

  # grep "ondisk->vol_name" sbin/newfs_hammer -rI
  sbin/newfs_hammer/newfs_hammer.c:   \
  snprintf(ondisk->vol_name, sizeof(ondisk->vol_name), "%s", label);

Summary of changes:
 sys/vfs/hammer/hammer_disk.h   | 2 +-
 sys/vfs/hammer/hammer_vfsops.c | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

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


-- 
DragonFly BSD source repository


git: sbin/hammer: Sync hammer usage() with hammer(8) manpage

2015-09-25 Thread Tomohiro Kusumi

commit dda14c079a81b731d4d1997ebcce9874aadb7c07
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Tue Sep 15 05:20:03 2015 +0900

sbin/hammer: Sync hammer usage() with hammer(8) manpage

A function usage() in sbin/hammer/hammer.c is missing several
options that exist in hammer(8) manpage. Add missing ones and
sync with manpage.

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

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


-- 
DragonFly BSD source repository


git: sbin/hammer: Refactor get_elm_flags()/print_btree_elm() [2/2]

2015-09-25 Thread Tomohiro Kusumi

commit 400b9ca8e387da27536d11124df3bd011aac75ca
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Tue Sep 22 17:38:50 2015 +0900

sbin/hammer: Refactor get_elm_flags()/print_btree_elm() [2/2]

Call get_elm_flags() from print_btree_elm(). The elm flag
is used and only used when printing elm. This makes things
clear without passing the flag from one function to another.

No functional changes.

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

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/400b9ca8e387da27536d11124df3bd011aac75ca


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Rename HMNT_EXPORTREQ to HMNT_RESERVED

2015-09-25 Thread Tomohiro Kusumi

commit e2a9b402fba6588052ea681c52888d7ba253c97a
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Thu Sep 17 07:04:05 2015 +0900

sys/vfs/hammer: Rename HMNT_EXPORTREQ to HMNT_RESERVED

This was added in 513ca7d7 for NFS support but never used.
Change it (0x0004) to HMNT_RESERVED.

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

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Remove unnecessary header includes

2015-09-25 Thread Tomohiro Kusumi

commit 8fc055b2e80aa7c8dd4806b712fcb44e7e445984
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Mon Sep 7 04:12:53 2015 +0900

sys/vfs/hammer: Remove unnecessary header includes

Summary of changes:
 sys/vfs/hammer/hammer_io.c | 1 -
 sys/vfs/hammer/hammer_vfsops.c | 1 -
 sys/vfs/hammer/hammer_volume.c | 2 --
 3 files changed, 4 deletions(-)

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


-- 
DragonFly BSD source repository


git: sbin/hammer: Add ifndef/define/endif for headers

2015-09-25 Thread Tomohiro Kusumi

commit a74dc2505e953f1ecc2785705ab82cdd8045b81b
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sun Sep 6 03:50:39 2015 +0900

sbin/hammer: Add ifndef/define/endif for headers

Some headers are missing this, so add it to those.

Summary of changes:
 sbin/hammer/hammer.h  | 5 +
 sbin/hammer/hammer_util.h | 5 +
 2 files changed, 10 insertions(+)

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Remove prototype of not existing function

2015-09-25 Thread Tomohiro Kusumi

commit 7ff55be9fc5f3aeb0c701de252efa020f3af854e
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Mon Sep 7 22:21:03 2015 +0900

sys/vfs/hammer: Remove prototype of not existing function

Summary of changes:
 sys/vfs/hammer/hammer.h | 1 -
 1 file changed, 1 deletion(-)

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Fix possible race on volume-del

2015-09-25 Thread Tomohiro Kusumi

commit b6abf391331196a9bc858db937aa8a839ea0fedb
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Mon Sep 7 23:11:29 2015 +0900

sys/vfs/hammer: Fix possible race on volume-del

hmp->volume_to_remove should get reset to -1 only after the
volume is successfully removed. Otherwise there is a possible
race between this and blockmap allocation code who checks if
hmp->volume_to_remove is the volume being removed.

Spotted-by: dillon

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

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


-- 
DragonFly BSD source repository


git: sbin/hammer: Update hammer usage()

2015-09-25 Thread Tomohiro Kusumi

commit 7b431e68ada91d94bb1ad297ddf6405feda27b9e
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Tue Sep 15 00:48:44 2015 +0900

sbin/hammer: Update hammer usage()

Add one line that was missing in 3f760d89.

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

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Change hkprintf() to macro and add variants [2/2]

2015-09-25 Thread Tomohiro Kusumi

commit 11605a5c206b366f3cadbb9cfb43beb1f764b008
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Wed Sep 16 07:11:42 2015 +0900

sys/vfs/hammer: Change hkprintf() to macro and add variants [2/2]

This commit does the following.

1. Add macros hdkprintf() and hdkrateprintf() that embed
   the following prefix.
   "function_name: ..."
2. Replace raw kprintf() calls that have above prefix with
   newly added macros.
3. Fix some wrong function name literals using __func__.

Summary of changes:
 sys/vfs/hammer/hammer.h  |  4 
 sys/vfs/hammer/hammer_blockmap.c |  5 ++---
 sys/vfs/hammer/hammer_btree.c| 12 
 sys/vfs/hammer/hammer_inode.c|  4 ++--
 sys/vfs/hammer/hammer_io.c   | 11 ---
 sys/vfs/hammer/hammer_object.c   |  9 -
 sys/vfs/hammer/hammer_ondisk.c   |  8 
 sys/vfs/hammer/hammer_subs.c |  7 +++
 sys/vfs/hammer/hammer_vfsops.c   | 13 ++---
 sys/vfs/hammer/hammer_vnops.c|  2 +-
 10 files changed, 34 insertions(+), 41 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/11605a5c206b366f3cadbb9cfb43beb1f764b008


-- 
DragonFly BSD source repository


git: sbin/hammer: Make a global variable static

2015-09-25 Thread Tomohiro Kusumi

commit c6a47f25e0a1d9df93787e808c77dfc6cd24e84c
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Mon Sep 14 01:04:08 2015 +0900

sbin/hammer: Make a global variable static

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

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


-- 
DragonFly BSD source repository


git: sbin/newfs_hammer: Remove global variable Eflag

2015-09-25 Thread Tomohiro Kusumi

commit 1a4aebcce9ba17f45b579e0f7aa46415357831b3
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sun Sep 20 13:57:19 2015 +0900

sbin/newfs_hammer: Remove global variable Eflag

Eflag could be a local variable after ff8644cb merged
two check_volume() into one.

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

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Adjust raw kprintfs using hkprintf variants

2015-09-25 Thread Tomohiro Kusumi

commit 33234d1463ac31b11dd8753fedbc82520b905a07
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sun Sep 13 08:35:27 2015 +0900

sys/vfs/hammer: Adjust raw kprintfs using hkprintf variants

This is part3 of hkprintf related after the following two.
sys/vfs/hammer: Change hkprintf() to macro and add variants [2/2]
sys/vfs/hammer: Change hkprintf() to macro and add variants [1/2]

Above two commits have replaced the existing kprintf calls
using "HAMMER:" or "HAMMER(label)" or function name prefix
with hkprintf and newly added variants, which basically didn't
change actual output other than fixing wrong function names
to the right ones, etc.

This commit continues replacing remaining kprintfs to make
output more understandable than raw kprintf calls with no clue
that they're hammer related.

For example, an error message like
"BIGBLOCK UNDERFLOW\n"
or a debug message like
"rt %3u, xt %3u, tt %3u\n"
become more understanbale with "HAMMER:" prefix or the name
of the function.

This commit is based on the followings.
1. Use hdkprintf which is hkprintf variant with __func__ prefix
   if that kprintf call is used when vfs.hammer.debug_xxx is
   enabled. This implies the messages are only for debugging
   and those are usually better and more understandable with
   a function name prefix as mentioned above. Also this is
   what's been done mostly in the existing hammer code.
2. Use hkprintf which has "HAMMER:" prefix if that kprintf
   call is a regular hammer message that appears in regular
   filesystem operations such as
   "Formatting of valid HAMMER volume %s denied. Erase with dd!\n".
3. Use h[vm]kprintf which are hkprintf variants with hammer
   label prefix "HAMMER(label)" if that kprintf can safely
   access the label via vol or hmp pointer. Some kprintfs in
   hammer does this rather than just "HAMMER:" and this seems
   to be better, however this commit doesn't go far as to
   aggressively replace the existing ones with this because
   a caller safely dereferencing hmp or vol is a different
   topic from merely replacing.

Summary of changes:
 sys/vfs/hammer/hammer_blockmap.c|  4 ++--
 sys/vfs/hammer/hammer_btree.c   | 24 
 sys/vfs/hammer/hammer_cursor.c  |  2 +-
 sys/vfs/hammer/hammer_dedup.c   |  4 ++--
 sys/vfs/hammer/hammer_flusher.c |  2 +-
 sys/vfs/hammer/hammer_inode.c   | 26 +++---
 sys/vfs/hammer/hammer_io.c  |  2 +-
 sys/vfs/hammer/hammer_ioctl.c   |  2 +-
 sys/vfs/hammer/hammer_mirror.c  |  2 +-
 sys/vfs/hammer/hammer_object.c  | 12 ++--
 sys/vfs/hammer/hammer_ondisk.c  | 14 +++---
 sys/vfs/hammer/hammer_prune.c   | 10 +-
 sys/vfs/hammer/hammer_rebalance.c   |  7 +++
 sys/vfs/hammer/hammer_reblock.c | 12 +---
 sys/vfs/hammer/hammer_recover.c | 28 ++--
 sys/vfs/hammer/hammer_redo.c|  4 ++--
 sys/vfs/hammer/hammer_transaction.c |  2 +-
 sys/vfs/hammer/hammer_undo.c|  4 ++--
 sys/vfs/hammer/hammer_vnops.c   | 26 +-
 sys/vfs/hammer/hammer_volume.c  | 35 ++-
 20 files changed, 112 insertions(+), 110 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/33234d1463ac31b11dd8753fedbc82520b905a07


-- 
DragonFly BSD source repository


git: sbin/hammer: Cleanup header includes regarding hammer_util.h

2015-09-25 Thread Tomohiro Kusumi

commit 9c8b568e30b6c7192b23864e77db8d3c2a084a58
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Tue Sep 8 00:43:34 2015 +0900

sbin/hammer: Cleanup header includes regarding hammer_util.h

Summary of changes:
 sbin/hammer/cache.c  |  9 -
 sbin/hammer/hammer_util.h| 13 +
 sbin/hammer/ondisk.c | 10 --
 sbin/hammer/test_dupkey.c|  3 ---
 sbin/newfs_hammer/newfs_hammer.h | 12 
 5 files changed, 13 insertions(+), 34 deletions(-)

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Remove HAMMER_BUFFER_BITS

2015-09-25 Thread Tomohiro Kusumi

commit 90d23351f480e74e9fc01ee123fd318b45768d31
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sun Sep 6 20:17:33 2015 +0900

sys/vfs/hammer: Remove HAMMER_BUFFER_BITS

This macro is only used by compile time sanity check,
and the check is way too obvious that it can be get rid of.

Hammer code used to use this macro to right-shift offset
(>>14 had meaning in the early stage of hammer devel),
and it made sense to have the compile time sanity check,
but not really when having a way too obvious check is
the only use case.

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

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


-- 
DragonFly BSD source repository


git: sbin/hammer: Cleanup search directive structure

2015-09-25 Thread Tomohiro Kusumi

commit 47fc33819c3bf4fc72d6d50cdaff5801cdf8735f
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Mon Sep 21 19:26:43 2015 +0900

sbin/hammer: Cleanup search directive structure

Remove btree elm fields from hammer show's search directive
struct btree_search, and embed struct hammer_base_elm.

hammer show originally only had localization:obj_id fields for
search directives, so struct btree_search had these two fields,
but since 913b6663 has added (quite long time ago) all the
remaining fields rec_type:key:create_tid, struct btree_search
could simply embed struct hammer_base_elm instead of having 5
fields separately, which makes code clear.

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

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/47fc33819c3bf4fc72d6d50cdaff5801cdf8735f


-- 
DragonFly BSD source repository


git: sbin/hammer: Add B-Tree helper functions and cleanups

2015-09-25 Thread Tomohiro Kusumi

commit f29b8e39039188cff2bd4e78ac1969c1e33f8d35
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Mon Sep 21 14:28:07 2015 +0900

sbin/hammer: Add B-Tree helper functions and cleanups

and some cleanups that make no functional changes.

This makes B-Tree search/filtering code using optional search
directives much more readable. Also this makes it easier to
do fix in the next commit (fix wrong next elm boundary test).

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

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Remove #if 1 that no longer has any meaning

2015-09-25 Thread Tomohiro Kusumi

commit af508d629df88807ac98683dfbbf934c08eeb80a
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sun Sep 13 08:48:53 2015 +0900

sys/vfs/hammer: Remove #if 1 that no longer has any meaning

Summary of changes:
 sys/vfs/hammer/hammer_inode.c | 2 --
 1 file changed, 2 deletions(-)

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


-- 
DragonFly BSD source repository


git: sbin/hammer: Fix comment on how to compile sbin/hammer/test_dupkey.c

2015-09-25 Thread Tomohiro Kusumi

commit f970d47b54fcbac0b9cbc7b3d212f5c727dc43e2
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Tue Sep 8 01:18:28 2015 +0900

sbin/hammer: Fix comment on how to compile sbin/hammer/test_dupkey.c

This comment was never updated after icrc32.c was added.

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

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Add HAMMER_DIR_INODE_LOCALIZATION()

2015-09-25 Thread Tomohiro Kusumi

commit ed959c01b7b0103165800149372d074b7a38e9c5
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sun Sep 13 00:08:15 2015 +0900

sys/vfs/hammer: Add HAMMER_DIR_INODE_LOCALIZATION()

Move ondisk definition part of hammer_dir_localization()
to sys/vfs/hammer/hammer_disk.h.

It's better to separate kernel fs code from ondisk spec
(and that's what hammer.h and hammer_disk.h are made for).

Summary of changes:
 sys/vfs/hammer/hammer.h  | 5 +
 sys/vfs/hammer/hammer_disk.h | 9 -
 2 files changed, 9 insertions(+), 5 deletions(-)

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Change hkprintf() to macro and add variants [1/2]

2015-09-25 Thread Tomohiro Kusumi

commit d053aa8aea2cf66699944def54faed89c76881b3
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sat Sep 12 03:06:24 2015 +0900

sys/vfs/hammer: Change hkprintf() to macro and add variants [1/2]

This commit does the following.

1. Remove an inline function hkprintf().
2. Add a macro version of hkprintf() and its variants that
   embed the following prefix.
   "HAMMER: ..."
   "HAMMER(label) ..."
3. Replace raw kprintf() calls that have above prefix with
   newly added macros.

hkprintf() macro doesn't use hammer_debug_debug flag that was
used by the inline function version of hkprintf(), but this
doesn't make much difference from the way hkprintf() and
hammer_debug_debug have been used.

Summary of changes:
 sys/vfs/hammer/hammer.h  |  16 +++-
 sys/vfs/hammer/hammer_blockmap.c |   4 +-
 sys/vfs/hammer/hammer_btree.c|   2 +-
 sys/vfs/hammer/hammer_cursor.c   |   2 +-
 sys/vfs/hammer/hammer_dedup.c|   2 +-
 sys/vfs/hammer/hammer_flusher.c  |  10 +--
 sys/vfs/hammer/hammer_inode.c|   6 +-
 sys/vfs/hammer/hammer_ioctl.c|   6 +-
 sys/vfs/hammer/hammer_object.c   |   9 ++-
 sys/vfs/hammer/hammer_ondisk.c   |   8 +-
 sys/vfs/hammer/hammer_reblock.c  |   9 +--
 sys/vfs/hammer/hammer_recover.c  | 168 +--
 sys/vfs/hammer/hammer_subs.c |  12 ---
 sys/vfs/hammer/hammer_vfsops.c   |  25 +++---
 sys/vfs/hammer/hammer_vnops.c|   9 +--
 15 files changed, 128 insertions(+), 160 deletions(-)

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Remove header includes from hammer.h

2015-09-25 Thread Tomohiro Kusumi

commit 97fb61c0f96a20c9cf79f0e5d9b40c181b99e88a
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Mon Sep 7 02:48:34 2015 +0900

sys/vfs/hammer: Remove header includes from hammer.h

Remove
 #include 
 #include 
 #include 
 #include 
from sys/vfs/hammer/hammer.h

Summary of changes:
 sys/vfs/hammer/hammer.h  | 5 -
 sys/vfs/hammer/hammer_blockmap.c | 2 ++
 sys/vfs/hammer/hammer_inode.c| 2 ++
 sys/vfs/hammer/hammer_io.c   | 1 +
 sys/vfs/hammer/hammer_ondisk.c   | 1 +
 sys/vfs/hammer/hammer_vfsops.c   | 1 +
 sys/vfs/hammer/hammer_vnops.c| 2 ++
 7 files changed, 9 insertions(+), 5 deletions(-)

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


-- 
DragonFly BSD source repository


git: sbin/hammer: Remove prototype of not existing function

2015-09-25 Thread Tomohiro Kusumi

commit 0e5cdae2b2672c1967ad4b48c1696d73ef904083
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Tue Sep 15 00:49:31 2015 +0900

sbin/hammer: Remove prototype of not existing function

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

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


-- 
DragonFly BSD source repository


git: sbin/hammer: Fix and adjust hammer show's matched character '*'

2015-09-25 Thread Tomohiro Kusumi

commit dc75e798e8d40c31fb4085cd5a63cb9cf3d42b4d
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Tue Sep 22 00:00:30 2015 +0900

sbin/hammer: Fix and adjust hammer show's matched character '*'

Remove unnecessary space before '*'.
Adjust position of '*' for matched record.

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

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Fix incomplete mountctl(2) vop behavior

2015-09-25 Thread Tomohiro Kusumi

commit 87b8f936e9f58031ae638e720361f548bcb9e121
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Thu Sep 17 19:31:56 2015 +0900

sys/vfs/hammer: Fix incomplete mountctl(2) vop behavior

mount(8) is unable to print nomirror mount option while other
two (nohistory, master=) are properly printed. This is because
hammer's mountctl and mount flags aren't implemented the way
vfs expects them to be. mount(8) generates option strings by
mountctl(2).

= missing nomirror string
  # mount_hammer -o nohistory -o master=5 -o nomirror 
/dev/da1:/dev/da2:/dev/da3 /HAMMER
  # mount | grep /HAMMER
  TEST on /HAMMER (hammer, local, nohistory, master)

= using this commit
  # mount_hammer -o nohistory -o master=5 -o nomirror 
/dev/da1:/dev/da2:/dev/da3 /HAMMER
  # mount | grep /HAMMER
  TEST on /HAMMER (hammer, local, nohistory, master, nomirror)

This commit adds HMNT_NOMIRROR using a reserved HMNT_RESERVED
and assigns HMNT_NOMIRROR to nomirror. This is necessary since
two options (master=, nomirror) using the same HMNT_MASTERID
is the root cause of above behavior.

This change would affect userspace in theory, however the only
userspace that would actually use these mount option flags is
mount command itself (for inbox userspace programs at least).
It's more important that hammer properly handles mount(8).

This commit also adds a missing nomirror mountctl element in
hammer_vop_mountctl() using HMNT_NOMIRROR so mountctl becomes
aware of nomirror option.

The reason nomirror needs to use HMNT_NOMIRROR instead of
HMNT_MASTERID is because vfs_flagstostr() assumes each option
has an unique flag (see vfs_flagstostr() where it does the
following).
  flags &= ~optp->o_opt;

This could have been fixed by changing above vfs code, but
fixing hammer code is probably the right approach. Also note
that master= and nomirror options aren't alias of each other.
These two are similar but they do have different purpose, which
should make sense to have independent flags, and that's what
vfs expects.

Summary of changes:
 sbin/mount_hammer/mount_hammer.c | 4 +++-
 sys/vfs/hammer/hammer_mount.h| 4 ++--
 sys/vfs/hammer/hammer_vfsops.c   | 2 +-
 sys/vfs/hammer/hammer_vnops.c| 1 +
 4 files changed, 7 insertions(+), 4 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/87b8f936e9f58031ae638e720361f548bcb9e121


-- 
DragonFly BSD source repository


git: hammer: Update hammer(5) manpage

2015-09-25 Thread Tomohiro Kusumi

commit 242bc30537713596d9b695845057211b66b183ea
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sat Sep 19 08:41:41 2015 +0900

hammer: Update hammer(5) manpage

Update links to publication by
dillon@ in 2008
mneumann@ in 2010

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

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/242bc30537713596d9b695845057211b66b183ea


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Add hpanic() [1/2]

2015-09-25 Thread Tomohiro Kusumi

commit 903fdd054164f0bbbaa7585799cb5a2fd380159b
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sat Sep 12 07:14:03 2015 +0900

sys/vfs/hammer: Add hpanic() [1/2]

This commit does the following.

1. Add a macro hpanic() which is a wrapper for panic()
   that embed the following prefix.
   "function_name: ..."
2. Replace raw panic() calls that have above prefix with
   hpanic().
3. Fix some wrong function name literals using __func__.

Summary of changes:
 sys/vfs/hammer/hammer.h |  3 +++
 sys/vfs/hammer/hammer_blockmap.c|  3 +--
 sys/vfs/hammer/hammer_btree.c   |  8 
 sys/vfs/hammer/hammer_inode.c   | 10 --
 sys/vfs/hammer/hammer_io.c  | 10 +-
 sys/vfs/hammer/hammer_object.c  | 14 +-
 sys/vfs/hammer/hammer_ondisk.c  |  3 +--
 sys/vfs/hammer/hammer_redo.c|  9 +++--
 sys/vfs/hammer/hammer_subs.c| 15 +++
 sys/vfs/hammer/hammer_transaction.c |  2 +-
 sys/vfs/hammer/hammer_undo.c|  2 +-
 sys/vfs/hammer/hammer_vnops.c   |  2 +-
 12 files changed, 40 insertions(+), 41 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/903fdd054164f0bbbaa7585799cb5a2fd380159b


-- 
DragonFly BSD source repository


git: sbin/mount_hammer: Add CFLAGS+= -I${.CURDIR}/../../sys

2015-09-25 Thread Tomohiro Kusumi

commit c96fef7005d4b8f620b747592ab7c26e7125b8c6
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Fri Sep 18 07:18:14 2015 +0900

sbin/mount_hammer: Add CFLAGS+= -I${.CURDIR}/../../sys

just like sbin/hammer and sbin/newfs_hammer.

Summary of changes:
 sbin/mount_hammer/Makefile | 1 +
 1 file changed, 1 insertion(+)

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


-- 
DragonFly BSD source repository


git: hammer: Cleanup hammer(8) manpage

2015-09-25 Thread Tomohiro Kusumi

commit 8add79747efc09a52a8ce112af942deb7b79d05f
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Mon Sep 21 20:59:29 2015 +0900

hammer: Cleanup hammer(8) manpage

hammer(8) uses "PFS" but not "pfs" unless "pfs" appears in a path.

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

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


-- 
DragonFly BSD source repository


git: sbin/hammer: Cleanups

2015-09-25 Thread Tomohiro Kusumi

commit 6aa149035039753b56e6e1af66a3b26f7d5e3833
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Tue Sep 22 23:04:46 2015 +0900

sbin/hammer: Cleanups

data->inode.obj_type (ot=%02x) should equal that of elm base.

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

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Remove ambiguous comment

2015-09-25 Thread Tomohiro Kusumi

commit 93775b63de3727ae32740549916dd319f8375942
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sat Sep 19 15:47:03 2015 +0900

sys/vfs/hammer: Remove ambiguous comment

Upper 16 bits of val[1] is always 0 (which equals pfs id of pfs0)
regardless of how many pfs there are.

Summary of changes:
 sys/vfs/hammer/hammer_vfsops.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/93775b63de3727ae32740549916dd319f8375942


-- 
DragonFly BSD source repository


git: sbin/hammer: Remove -DALIST_NO_DEBUG

2015-09-25 Thread Tomohiro Kusumi

commit 45032ebd0f566b7c8e28402c3d25e3fd42c48c63
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Fri Sep 18 06:44:53 2015 +0900

sbin/hammer: Remove -DALIST_NO_DEBUG

-DALIST_NO_DEBUG is no longer necessary.

sys/kern/subr_alist.c was only used in the early stage
of hammer devel, and no longer used.

  # grep ALIST_NO_DEBUG . -rI
  ./sbin/newfs_hammer/Makefile:CFLAGS+= -I${.CURDIR}/../../sys 
-I${.CURDIR}/../hammer -DALIST_NO_DEBUG
  ./sbin/hammer/Makefile:CFLAGS+= -I${.CURDIR}/../../sys -DALIST_NO_DEBUG
  ./sys/kern/subr_alist.c:#ifndef ALIST_NO_DEBUG

Summary of changes:
 sbin/hammer/Makefile   | 2 +-
 sbin/newfs_hammer/Makefile | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/45032ebd0f566b7c8e28402c3d25e3fd42c48c63


-- 
DragonFly BSD source repository


git: sbin/hammer: Cleanup header includes regarding hammer.h

2015-09-25 Thread Tomohiro Kusumi

commit e52ee71ecf0ebb43c1b7e7eb5e6aca81297f957a
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Mon Sep 7 23:29:25 2015 +0900

sbin/hammer: Cleanup header includes regarding hammer.h

Summary of changes:
 sbin/hammer/cmd_config.c   | 2 --
 sbin/hammer/cmd_history.c  | 2 --
 sbin/hammer/cmd_snapshot.c | 2 --
 sbin/hammer/hammer.c   | 3 ---
 sbin/hammer/hammer.h   | 5 +++--
 5 files changed, 3 insertions(+), 11 deletions(-)

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


-- 
DragonFly BSD source repository


git: sbin/hammer: Separate read/write inode ops on hammer *stats

2015-09-25 Thread Tomohiro Kusumi

commit 8101aaccc74cb8ef6411c8d102db3f07a79789be
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Mon Sep 14 02:06:37 2015 +0900

sbin/hammer: Separate read/write inode ops on hammer *stats

It should show read and write inode ops separately since
the original hammer sysctl accounts have them separately
(just like all other fields printed by *stats command),
and it's trivial to add these two to get total inode ops.

Summary of changes:
 sbin/hammer/cmd_stats.c | 20 +++-
 1 file changed, 7 insertions(+), 13 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/8101aaccc74cb8ef6411c8d102db3f07a79789be


-- 
DragonFly BSD source repository


git: sbin/hammer: Remove obsolete option -s

2015-09-25 Thread Tomohiro Kusumi

commit fa581c8a84acefe523851b28fa06b7ae72c8f485
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Tue Sep 15 00:52:16 2015 +0900

sbin/hammer: Remove obsolete option -s

-s was added in da804f11 in the early stage of hammer devel
but no longer used. Using -s does nothing after b5aaba7f.

(b5aaba7f did remove -s from hammer(8) manpage)

Summary of changes:
 sbin/hammer/hammer.c | 6 +-
 sbin/hammer/hammer.h | 1 -
 2 files changed, 1 insertion(+), 6 deletions(-)

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Fix error message when volumes are already mounted

2015-09-25 Thread Tomohiro Kusumi

commit 9d756529af421a4da46c2bc1340bde2c1d535602
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Wed Sep 16 07:10:16 2015 +0900

sys/vfs/hammer: Fix error message when volumes are already mounted

It should show volumes are mounted instead of "No root volume"
when the volumes are hammer volumes and failed with EBUSY.

  # mount_hammer /dev/da1:/dev/da2:/dev/da3 /HAMMER
  # mount_hammer /dev/da1:/dev/da2:/dev/da3 /HAMMER
  mount_hammer: Unknown error: Device busy
  # dmesg | tail -1
  hammer_mount: The volumes are probably mounted

Summary of changes:
 sys/vfs/hammer/hammer_vfsops.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Conform to style(9)

2015-09-25 Thread Tomohiro Kusumi

commit c9ee2a06c472e7559aa4280647d975f472f61272
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Thu Sep 17 07:53:46 2015 +0900

sys/vfs/hammer: Conform to style(9)

Remove unnecessary {} for a switch case element.

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

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


-- 
DragonFly BSD source repository


git: sbin/hammer: Fix and change hammer show behavior when only lo is used

2015-09-25 Thread Tomohiro Kusumi

commit 34909d8efe3ec8b36ce26db951ee1812b346476b
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Mon Sep 21 19:34:10 2015 +0900

sbin/hammer: Fix and change hammer show behavior when only lo is used

913b6663 has expanded hammer show's B-Tree directive from
lo:objid
to
lo:objid:rectype:key:tid
which allowed hammer show to filter B-Tree iteration in the
same way that the actual filesystem does on B-Tree lookup.

There was an exception in 913b6663 where one could not just
use lo directive, but was forced to use at least the first
two directives lo:objid. If objid wasn't specified then
HAMMER_MIN_OBJID was used for objid by default.

This was to keep compatibility with old behavior before
913b6663 added the rest of the directives (rectype:key:tid),
but this old behavior wasn't really useful for anything and
rather confusing given that all unspecified fields (after
the last specified field) except for objid were wildcard.
See sbin/hammer/hammer.c and sbin/hammer/cmd_show.c before
913b6663 (or really old one like v4.0 era) for details.

This commit normalizes this exceptional behavior and make
all option directives behave the same way. For example, if
*only* lo field is specified, then the rest of the fields
are wildcard. If the first n fields are specified, then the
remaining (5-n) fields are wildcard.

This does change the behavior when *only* lo is specified,
but the change should make the behavior less confusing.

Also update hammer(8) manpage since it hasn't been updated.

Summary of changes:
 sbin/hammer/cmd_show.c | 15 ++-
 sbin/hammer/hammer.8   | 10 --
 2 files changed, 14 insertions(+), 11 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/34909d8efe3ec8b36ce26db951ee1812b346476b


-- 
DragonFly BSD source repository


git: sbin/hammer: Make B-Tree walk a bit more effective

2015-09-25 Thread Tomohiro Kusumi

commit f1cf4f649f3abb55d93c4badf724ac78b272a3e1
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sun Sep 20 16:53:25 2015 +0900

sbin/hammer: Make B-Tree walk a bit more effective

hammer show recursively calls print_btree_node() when node
type is internal. If the node is not internal (leaf), it just
prints records with no further B-Tree walk.

Having
node->type == HAMMER_BTREE_TYPE_INTERNAL
check outside the
for (i = 0; i < node->count; ++i) {
is more effective since it doesn't go through unnecessary
for loop (with max count=63) if the node isn't internal.

Also note this looks more sane in the sense that node
contains elms[] and node->type determines union type of elms,
instead of node->type depends on each elms[i].

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

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


-- 
DragonFly BSD source repository


git: hammer: Print "B-Tree" (conform to hammer specification)

2015-09-25 Thread Tomohiro Kusumi

commit 78c4be8325e7e06b512f32fb51bcd9339533fcf5
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sat Sep 19 13:35:39 2015 +0900

hammer: Print "B-Tree" (conform to hammer specification)

Hammer specification, manpage, comments, etc mostly use
"B-Tree" instead of "btree" or "b-tree".

This commit replaces "btree" and "b-tree" strings that appear
in printf() and hammer(8) with "B-Tree", assuming no user or
userspace triggers anything by these strings.

Summary of changes:
 sbin/hammer/cmd_dedup.c| 4 ++--
 sbin/hammer/cmd_rebalance.c| 6 +++---
 sbin/hammer/cmd_reblock.c  | 4 ++--
 sbin/hammer/hammer.8   | 4 ++--
 sys/vfs/hammer/hammer_object.c | 4 ++--
 5 files changed, 11 insertions(+), 11 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/78c4be8325e7e06b512f32fb51bcd9339533fcf5


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Fix cppcheck warning

2015-09-25 Thread Tomohiro Kusumi

commit 84365e818711acf89946aa23e2a308548b89da76
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Wed Sep 23 01:25:14 2015 +0900

sys/vfs/hammer: Fix cppcheck warning

Spotted-by: swildner

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

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/84365e818711acf89946aa23e2a308548b89da76


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Adjust and cleanup _KERNEL

2015-09-25 Thread Tomohiro Kusumi

commit cbf26eb24be3dfb91f64ba606722b48db875baf7
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sun Sep 6 04:47:16 2015 +0900

sys/vfs/hammer: Adjust and cleanup _KERNEL

Remove no longer necessary _KERNEL that was originally
added for usr.bin/fstat/hammer.c to include
 by 872a7eee.

 isn't supposed to be necessary by
userspace except for a few (actually only above file)
unusual userspace programs that want to access in-kernel
data structures (like incore inode), so it's better not
to pollute  with bunch of _KERNEL
ifdefs in the first place if possible.

Also see 23e66b3b and 1caa2035.

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

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Erase btype of a new boundary on internal split

2015-09-25 Thread Tomohiro Kusumi

commit b6361ed8756a5631fde2f9e5e719b69343f57759
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sat Sep 5 23:12:18 2015 +0900

sys/vfs/hammer: Erase btype of a new boundary on internal split

It's more sane to erase btype of RBN of the original node
on internal split than only erasing subtree_offset.
(subtree_offset==0 means the elm has no child, but btype
not being 0 means its child is either leaf or internal node
which is insane if not a bug)

This doesn't affect comparison of nodes because btype is
not a part of keys to determine > or = or < of nodes.

This also makes possible to write non-ambiguous test code
in userspace as it eliminates multiple possible ways that
test code needs to deal with and be more explicit, which is
considered a good thing if the kernel change doesn't degrade
performance, etc. Also see 6580f642.

Summary of changes:
 sbin/hammer/cmd_show.c| 12 
 sys/vfs/hammer/hammer_btree.c |  1 +
 sys/vfs/hammer/hammer_btree.h | 10 ++
 3 files changed, 19 insertions(+), 4 deletions(-)

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


-- 
DragonFly BSD source repository


git: sbin/mount_hammer: Minor fixes and cleanups

2015-09-25 Thread Tomohiro Kusumi

commit b519f4e8d802da6eaba0723af1d11720fa0ca698
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Thu Sep 24 21:18:29 2015 +0900

sbin/mount_hammer: Minor fixes and cleanups

Summary of changes:
 sbin/mount_hammer/mount_hammer.c | 41 
 1 file changed, 16 insertions(+), 25 deletions(-)

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Add hammer_xlate_to_phys()

2015-12-09 Thread Tomohiro Kusumi

commit 516655e8506e8e19b200a63ddd45874f2b41c9a3
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Wed Dec 9 22:21:35 2015 +0900

sys/vfs/hammer: Add hammer_xlate_to_phys()

This macro is zone2 --> physical offset version of
hammer_xlate_to_zone2() and hammer_xlate_to_zoneX().

Summary of changes:
 sbin/hammer/ondisk.c   |  4 ++--
 sys/vfs/hammer/hammer_disk.h   |  7 +++
 sys/vfs/hammer/hammer_io.c | 15 ++-
 sys/vfs/hammer/hammer_ondisk.c |  3 +--
 4 files changed, 16 insertions(+), 13 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/516655e8506e8e19b200a63ddd45874f2b41c9a3


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Make hammer_bnew*() call _hammer_bread()

2015-12-09 Thread Tomohiro Kusumi

commit 52a92d779a61aacf3ac2d63cac2a13d4dcde5f92
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Wed Dec 9 18:38:52 2015 +0900

sys/vfs/hammer: Make hammer_bnew*() call _hammer_bread()

Remove _hammer_bnew() since _hammer_bread() and _hammer_bnew()
are the exact same except for isnew arg of hammer_get_buffer().

hammer_bnew*() use isnew=1 to only allocate ondisk buffer with
no disk i/o at the moment.

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

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Add/fix comments on B-Tree node

2015-12-03 Thread Tomohiro Kusumi

commit 4923f6f74dd75a3e7544d51d14e234bfb6147864
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Wed Dec 2 23:20:45 2015 +0900

sys/vfs/hammer: Add/fix comments on B-Tree node

Add/fix missing/incomplete/obsolete comments.

Move struct hammer_node_ondisk to the right place which is
underneath the comment on ondisk node.

Summary of changes:
 sys/vfs/hammer/hammer_btree.h | 93 +++
 1 file changed, 50 insertions(+), 43 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/4923f6f74dd75a3e7544d51d14e234bfb6147864


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Add/fix comments on volume header

2015-12-02 Thread Tomohiro Kusumi

commit 55e3f6f30c7ce5d23f30bb588f477562a674614e
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Wed Dec 2 18:42:02 2015 +0900

sys/vfs/hammer: Add/fix comments on volume header

Summary of changes:
 sys/vfs/hammer/hammer_disk.h | 30 +-
 1 file changed, 21 insertions(+), 9 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/55e3f6f30c7ce5d23f30bb588f477562a674614e


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Use hammer_find_inode()

2015-12-11 Thread Tomohiro Kusumi

commit 587c6c14de739603ac99a467c8087793c5b1591d
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Thu Dec 10 19:51:12 2015 +0900

sys/vfs/hammer: Use hammer_find_inode()

Add __hammer_find_inode() and make hammer_get_*inode() use this.
__hammer_find_inode() is no-ref version of hammer_find_inode()
directly called by hammer_find_inode().

Neither three function arguments obj_id, asof, localization nor
three fields of struct hammer_inode_info are modified in
hammer_get_inode() and hammer_get_dummy_inode(), so getting rid
of hammer_inode_info initialization placed before loop: is ok.

Summary of changes:
 sys/vfs/hammer/hammer_inode.c | 51 +--
 1 file changed, 30 insertions(+), 21 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/587c6c14de739603ac99a467c8087793c5b1591d


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Cleanup

2015-12-11 Thread Tomohiro Kusumi

commit c436263a5b85ec081502587b2d422f66e521
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Thu Dec 10 18:11:11 2015 +0900

sys/vfs/hammer: Cleanup

Summary of changes:
 sys/vfs/hammer/hammer_undo.c | 21 +
 1 file changed, 9 insertions(+), 12 deletions(-)

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Fix wrong parent localization for PFS root

2015-12-11 Thread Tomohiro Kusumi

commit 5b4785a6e4dd45dbce359247b74e49935c08ac9c
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Fri Dec 11 00:11:44 2015 +0900

sys/vfs/hammer: Fix wrong parent localization for PFS root

The idea of PFS root inode having ip localization value of its
parent directory's inode has been #if0'd after ea434b6f in 2008.

(Since then parent_obj_localization field of ondisk inode seems
to be always 0 because the field is never touched after it's
first allocated, unless it's a symlink which uses symlink[24]
part of union)

Since the field is now deprecated, using this as a localization
value of inode's parent is wrong when the inode is PFS root. It
should use a proper localization value HAMMER_DEF_LOCALIZATION
which is also 0.

Note that HAMMER userspace doesn't allow creating a PFS in PFS
unless the parent PFS is PFS0 (see hammer_cmd_pseudofs_create()),
so it doesn't need to consider the parent inode's localization
value other than the default localization value. If that's allowed,
there seems to be no easy way to tell the localization value.

Also remove parent_obj_localization field of ondisk inode since
it's no longer used after this commit.

Summary of changes:
 sys/vfs/hammer/hammer_disk.h  |  5 -
 sys/vfs/hammer/hammer_inode.c | 12 
 sys/vfs/hammer/hammer_vnops.c |  2 +-
 3 files changed, 1 insertion(+), 18 deletions(-)

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


-- 
DragonFly BSD source repository


git: sbin/hammer: Make show print symlink[24] if inode is symlink

2015-12-11 Thread Tomohiro Kusumi

commit 2f89ae4d78f95c17c01c0ce41027f2efe553c2a4
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Fri Dec 11 18:57:03 2015 +0900

sbin/hammer: Make show print symlink[24] if inode is symlink

Since now that parent_obj_localization part of the union
inode.ext is gone. It's either a symlink string or not used.

Summary of changes:
 sbin/hammer/cmd_show.c | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

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


-- 
DragonFly BSD source repository


git: sbin/hammer: Check existence of PFS#0 when creating PFS

2015-12-14 Thread Tomohiro Kusumi

commit e1c333cb4490c25291b202f83f83717708899ea4
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Mon Dec 14 00:35:28 2015 +0900

sbin/hammer: Check existence of PFS#0 when creating PFS

hammer_cmd_pseudofs_create() checks from PFS#0 to PFS#0x
to find available PFS#, but PFS#0 must always exist.

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

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Add HAMMER_ROOT_PFSID macro

2015-12-14 Thread Tomohiro Kusumi

commit 753daa182cb7f253c028b254b79dad6ddf539474
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Mon Dec 14 00:15:08 2015 +0900

sys/vfs/hammer: Add HAMMER_ROOT_PFSID macro

Explicitly show PFS#0 is root PFS.

Summary of changes:
 sbin/hammer/cmd_pfs.c| 10 +-
 sys/vfs/hammer/hammer_disk.h |  1 +
 sys/vfs/hammer/hammer_pfs.c  |  2 +-
 3 files changed, 7 insertions(+), 6 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/753daa182cb7f253c028b254b79dad6ddf539474


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Use HAMMER_DEF_LOCALIZATION

2015-12-14 Thread Tomohiro Kusumi

commit ea6402d47e484f0536aedb50088b63efd28bad75
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Mon Dec 14 22:22:36 2015 +0900

sys/vfs/hammer: Use HAMMER_DEF_LOCALIZATION

for ip localization of root PFS instead of 0.

(see localization arg of hammer_get_inode() for the root inode
of root PFS, which is eventually set to ip->obj_localization,
it doesn't use 0)

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

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


-- 
DragonFly BSD source repository


git: sbin/hammer: Rename sbin/hammer/cmd_pseudofs.c to cmd_pfs.c

2015-12-13 Thread Tomohiro Kusumi

commit 4daef0dd1dceadb61e85f04b633f9a13977cc34a
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sun Dec 13 19:30:49 2015 +0900

sbin/hammer: Rename sbin/hammer/cmd_pseudofs.c to cmd_pfs.c

The kernel side of PFS code that implements ioctl is called
sys/vfs/hammer/hammer_pfs.c, and all hammer pfs commands are
pfs-xxx. It's more natural to have cmd_pfs.c.
(HAMMER2 has sbin/hammer2/cmd_pfs.c)

The names of functions remain pseudofs since that's the way
functions are named in the kernel too.

Summary of changes:
 sbin/hammer/Makefile  | 2 +-
 sbin/hammer/{cmd_pseudofs.c => cmd_pfs.c} | 0
 2 files changed, 1 insertion(+), 1 deletion(-)
 rename sbin/hammer/{cmd_pseudofs.c => cmd_pfs.c} (100%)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/4daef0dd1dceadb61e85f04b633f9a13977cc34a


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Don't let ioctl(HAMMERIOC_SET_PSEUDOFS) create PFS in PFS

2015-12-13 Thread Tomohiro Kusumi

commit 283f6970e848724e9bd2c20d5311e412dea5e67c
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sun Dec 13 19:49:30 2015 +0900

sys/vfs/hammer: Don't let ioctl(HAMMERIOC_SET_PSEUDOFS) create PFS in PFS

hammer pfs-master|slave have been preventing users from creating
a PFS in non-root PFS, but since kernel HAMMER code also assumes
the parent inode of (non-root)PFS root inode has 0 for ip localization,
ioctl(HAMMERIOC_SET_PSEUDOFS) itself should avoid that too.

This commit doesn't affect HAMMER userspace commands because
hammer pfs-master|slave prevent creating a PFS in PFS prior to
calling ioctl(HAMMERIOC_SET_PSEUDOFS). It just makes better sense
to have this check in kernel space as well since one could write
its own userspace program that directly calls ioctl without using
hammer userspace code.

Also see 5b4785a6.

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

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/283f6970e848724e9bd2c20d5311e412dea5e67c


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Rename resv->flush_group to flg_no

2015-12-13 Thread Tomohiro Kusumi

commit f8a7a9009caff3bcd2838df1720ba941e2a8aadd
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sun Dec 13 22:17:45 2015 +0900

sys/vfs/hammer: Rename resv->flush_group to flg_no

Not using flush_group; for int is grep friendly since hammer
mostly uses flush_group; for hammer_flush_group_t variables.

Summary of changes:
 sys/vfs/hammer/hammer.h  | 2 +-
 sys/vfs/hammer/hammer_blockmap.c | 4 ++--
 sys/vfs/hammer/hammer_flusher.c  | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Remove unnecessary casts

2015-12-13 Thread Tomohiro Kusumi

commit 460925a6fe590fe72499729dcbff17076fddc14d
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sat Dec 12 23:33:39 2015 +0900

sys/vfs/hammer: Remove unnecessary casts

These are all int minus int where both ints are flush group #.

Summary of changes:
 sys/vfs/hammer/hammer_flusher.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/460925a6fe590fe72499729dcbff17076fddc14d


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Remove unused count field from hammer_flusher_info

2015-12-12 Thread Tomohiro Kusumi

commit 19dcf63f016d556c744214d98628a8374f683f7f
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sat Dec 12 16:40:56 2015 +0900

sys/vfs/hammer: Remove unused count field from hammer_flusher_info

Summary of changes:
 sys/vfs/hammer/hammer_flusher.c | 2 --
 1 file changed, 2 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/19dcf63f016d556c744214d98628a8374f683f7f


-- 
DragonFly BSD source repository


git: sbin/hammer: Fix hammer(8) manpage

2016-01-04 Thread Tomohiro Kusumi

commit 8babb8e4a233861734cb4f5dac4098a86ec07e69
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sun Jan 3 22:40:43 2016 +0900

sbin/hammer: Fix hammer(8) manpage

Add a sentence that explains PFS via PFS is not allowed.

Summary of changes:
 sbin/hammer/hammer.8 | 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

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


-- 
DragonFly BSD source repository


git: sbin/newfs_hammer: Fix newfs_hammer(8) manpage

2015-12-29 Thread Tomohiro Kusumi

commit 312e991c1a0e3e0071fc907ebe5b0dc18298a90c
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Wed Dec 30 04:01:19 2015 +0900

sbin/newfs_hammer: Fix newfs_hammer(8) manpage

-L is always necessary, but two or more fs with the same -L is allowed.

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

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/312e991c1a0e3e0071fc907ebe5b0dc18298a90c


-- 
DragonFly BSD source repository


git: sbin/newfs_hammer: Fix newfs_hammer(8) manpage

2015-12-29 Thread Tomohiro Kusumi

commit 0e847ba25c7c9cf534b020c2ebca46645f0f24d4
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Wed Dec 30 02:39:16 2015 +0900

sbin/newfs_hammer: Fix newfs_hammer(8) manpage

newfs_hammer has calculations and upper limit for boot area,
which don't result in default 4MB, but rather likely to be 64MB.
Also this isn't used for anything just like memory log area.

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

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


-- 
DragonFly BSD source repository


git: sbin/newfs_hammer: Fix newfs_hammer(8) manpage

2015-12-31 Thread Tomohiro Kusumi

commit 6d58a4e4667702cc0ad7ec8727ee6275ce82f311
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sat Dec 5 21:40:23 2015 +0900

sbin/newfs_hammer: Fix newfs_hammer(8) manpage

Summary of changes:
 sbin/newfs_hammer/newfs_hammer.8 | 25 +++--
 1 file changed, 19 insertions(+), 6 deletions(-)

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


-- 
DragonFly BSD source repository


git: sbin/mount_hammer: Fix mount_hammer(8) manpage

2015-12-31 Thread Tomohiro Kusumi

commit ed3f6f04e2a2e8469f3654aaf587da6486e1cb00
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sat Dec 5 21:40:23 2015 +0900

sbin/mount_hammer: Fix mount_hammer(8) manpage

Summary of changes:
 sbin/mount_hammer/mount_hammer.8 | 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

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


-- 
DragonFly BSD source repository


git: sbin/hammer: Remove global variable NumVolumes

2015-12-23 Thread Tomohiro Kusumi

commit db7b497cbdd6eb264cf2ab90bb8be82d361f34cd
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Wed Dec 23 16:06:53 2015 +0900

sbin/hammer: Remove global variable NumVolumes

Only newfs_hammer uses this, but doesn't need to be global.

(Keeping a number of volumes isn't that important either,
because it can be retrieved directly from volume headers or
by counting the number of elements in the volume_info list)

Summary of changes:
 sbin/hammer/hammer.c |  3 ---
 sbin/hammer/hammer_util.h|  1 -
 sbin/hammer/ondisk.c |  1 -
 sbin/newfs_hammer/newfs_hammer.c | 19 ++-
 4 files changed, 10 insertions(+), 14 deletions(-)

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


-- 
DragonFly BSD source repository


git: sbin/newfs_hammer: Remove total size arg from format_volume()

2015-12-23 Thread Tomohiro Kusumi

commit b251a9e85b2cadf4960f32d89ed929b6907a23a0
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Mon Dec 21 21:56:32 2015 +0900

sbin/newfs_hammer: Remove total size arg from format_volume()

Each HAMMER volume doesn't recognize total filesystem size,
so this unused arg isn't necessary when formatting a volume.

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

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


-- 
DragonFly BSD source repository


git: sbin/hammer: Remove vol_alloc from volume_info

2015-12-23 Thread Tomohiro Kusumi

commit ef927d3e44e4c5152cfd810e0c2b95e0210866d3
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Mon Dec 21 22:14:08 2015 +0900

sbin/hammer: Remove vol_alloc from volume_info

vol_alloc is a fixed sized space before boot/mem/buf area
that the filesystem doesn't recognize once initialized.
(This area is currently used for nothing)

Summary of changes:
 sbin/hammer/hammer_util.h|  1 -
 sbin/hammer/ondisk.c |  6 --
 sbin/newfs_hammer/newfs_hammer.c | 17 -
 3 files changed, 12 insertions(+), 12 deletions(-)

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


-- 
DragonFly BSD source repository


git: sys/gnu/vfs/ext2fs: Remove double initialization of ext2 inode flag

2015-12-19 Thread Tomohiro Kusumi

commit b70b1f36db31c429af33c12deeb0910b278d6831
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sat Dec 19 23:04:50 2015 +0900

sys/gnu/vfs/ext2fs: Remove double initialization of ext2 inode flag

Spotted-by: swildner

Summary of changes:
 sys/gnu/vfs/ext2fs/ext2_inode_cnv.c | 1 -
 1 file changed, 1 deletion(-)

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


-- 
DragonFly BSD source repository


git: hammer: Change u_int{8,16,32,64}_t to uint{8,16,32,64}_t

2015-11-28 Thread Tomohiro Kusumi

commit 46137e17a8da872430785836fc270a05649a93ce
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Wed Nov 25 22:46:57 2015 +0900

hammer: Change u_int{8,16,32,64}_t to uint{8,16,32,64}_t

in the following directories and/or files.

* sys/vfs/hammer
* sbin/hammer
* sbin/newfs_hammer
* sbin/mount_hammer
* usr.bin/fstat/hammer.c
* usr.bin/undo

Summary of changes:
 sbin/hammer/cmd_cleanup.c   |   4 +-
 sbin/hammer/cmd_dedup.c |  46 +++---
 sbin/hammer/cmd_history.c   |   4 +-
 sbin/hammer/cmd_mirror.c|  22 +++
 sbin/hammer/cmd_pseudofs.c  |   2 +-
 sbin/hammer/cmd_show.c  |   8 +--
 sbin/hammer/cmd_snapshot.c  |   2 +-
 sbin/hammer/hammer.c|  10 ++--
 sbin/hammer/hammer.h|   6 +-
 sbin/hammer/ondisk.c|   2 +-
 sbin/hammer/test_dupkey.c   |  18 +++---
 sbin/newfs_hammer/newfs_hammer.c|  14 ++---
 sys/vfs/hammer/hammer.h |  62 +--
 sys/vfs/hammer/hammer_btree.c   |   6 +-
 sys/vfs/hammer/hammer_btree.h   |  32 +-
 sys/vfs/hammer/hammer_disk.h| 116 ++--
 sys/vfs/hammer/hammer_inode.c   |  20 +++
 sys/vfs/hammer/hammer_ioctl.h   |  42 ++---
 sys/vfs/hammer/hammer_mirror.c  |  24 
 sys/vfs/hammer/hammer_mount.h   |   4 +-
 sys/vfs/hammer/hammer_object.c  |   8 +--
 sys/vfs/hammer/hammer_ondisk.c  |   2 +-
 sys/vfs/hammer/hammer_pfs.c |  28 -
 sys/vfs/hammer/hammer_prune.c   |   2 +-
 sys/vfs/hammer/hammer_rebalance.c   |   6 +-
 sys/vfs/hammer/hammer_reblock.c |   2 +-
 sys/vfs/hammer/hammer_recover.c |  12 ++--
 sys/vfs/hammer/hammer_redo.c|   2 +-
 sys/vfs/hammer/hammer_subs.c|  28 -
 sys/vfs/hammer/hammer_transaction.c |  16 ++---
 sys/vfs/hammer/hammer_undo.c|   4 +-
 sys/vfs/hammer/hammer_vfsops.c  |   6 +-
 sys/vfs/hammer/hammer_vnops.c   |  18 +++---
 usr.bin/fstat/hammer.c  |   4 +-
 34 files changed, 291 insertions(+), 291 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/46137e17a8da872430785836fc270a05649a93ce


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Remove HAMMER_HEAD_FLAG_FREE macro

2015-11-28 Thread Tomohiro Kusumi

commit bd129eaaaef8ab6644d46648b7984f4b52a3b285
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sat Nov 28 23:51:48 2015 +0900

sys/vfs/hammer: Remove HAMMER_HEAD_FLAG_FREE macro

This macro is no longer used independently after bf686dbe,
but only used as a part of HAMMER_HEAD_TYPE_PAD.

(it can't be simply removed unless hammer version gets
++ or something, since TYPE_PAD is ondisk representation)

Summary of changes:
 sys/vfs/hammer/hammer_disk.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Remove HAMMER_VOLF_VALID|OPEN macros

2015-11-28 Thread Tomohiro Kusumi

commit f47eb33ad751f59b0284afb990e02495d4bf4e40
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sun Nov 29 00:04:06 2015 +0900

sys/vfs/hammer: Remove HAMMER_VOLF_VALID|OPEN macros

These macros added by 8750964d in 2007 (the first hammer commit)
were never used.

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

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: #if0 HAMMER_BIGBLOCK_OVERFILL

2015-11-28 Thread Tomohiro Kusumi

commit 077bd8a4b0311a06e5941ec34602fa5839c476f0
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sat Nov 28 23:37:23 2015 +0900

sys/vfs/hammer: #if0 HAMMER_BIGBLOCK_OVERFILL

The code using this macro has been #if0'd by b4f86ea3.
(The code isn't obsolete, so it should still be there)

Summary of changes:
 sys/vfs/hammer/hammer_disk.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/077bd8a4b0311a06e5941ec34602fa5839c476f0


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Remove HAMMER_HEAD_TYPE_42|45 macros

2015-11-28 Thread Tomohiro Kusumi

commit 7a2c0f5eefc4baede788782bfe1024a15a6eb831
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sat Nov 28 23:47:37 2015 +0900

sys/vfs/hammer: Remove HAMMER_HEAD_TYPE_42|45 macros

These macros were never used.
See 02428fb6.

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

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Remove integrity_crc field of ondisk inode

2015-11-29 Thread Tomohiro Kusumi

commit 9d5dfd722ac6800ce93663c03f60f64aeaa6ad41
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sun Nov 29 19:07:23 2015 +0900

sys/vfs/hammer: Remove integrity_crc field of ondisk inode

This integrity_crc field was added in 5a930e66,
but never used or explained what this was supposed to be.

Rename it to reserved.
Also rename reserved fields from 01.

Summary of changes:
 sys/vfs/hammer/hammer_disk.h | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Remove time/freq fields of ondisk PFS

2015-11-29 Thread Tomohiro Kusumi

commit f2c87c8e79b234ebd1bbe41e054620167fd01ddc
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sun Nov 29 18:24:01 2015 +0900

sys/vfs/hammer: Remove time/freq fields of ondisk PFS

These ondisk fields were added in 4c038e17 when mirroring
code was committed (without detailed explanation), but the
idea of time/freq was never implemented.

Rename them to reserved.

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

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Remove #if0'd hammer_mirror_write()

2015-11-29 Thread Tomohiro Kusumi

commit 913505ff7043d30524cc618d0966344059ff609b
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sun Nov 29 16:52:46 2015 +0900

sys/vfs/hammer: Remove #if0'd hammer_mirror_write()

and its sub function hammer_mirror_localize_data().

These two functions are replaced by hammer_create_at_cursor()
and hammer_cursor_localize_data() which basically do the same
thing in 83f2a3aa, as the comment says.

Fix some comments that haven't been updated after replacing.

Summary of changes:
 sys/vfs/hammer/hammer_mirror.c | 161 +
 1 file changed, 2 insertions(+), 159 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/913505ff7043d30524cc618d0966344059ff609b


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Remove #if0'd debug kprintfs

2015-11-29 Thread Tomohiro Kusumi

commit 2c7c91ded3f61885fd96e8895665ff7b7489b9ee
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sun Nov 29 16:36:14 2015 +0900

sys/vfs/hammer: Remove #if0'd debug kprintfs

Summary of changes:
 sys/vfs/hammer/hammer_object.c | 10 --
 sys/vfs/hammer/hammer_vnops.c  | 23 +++
 2 files changed, 3 insertions(+), 30 deletions(-)

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Remove #if0'd obsolete symlink format

2015-11-29 Thread Tomohiro Kusumi

commit c426652380c7409a433572b06fcb398f7af9f34e
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sun Nov 29 16:37:06 2015 +0900

sys/vfs/hammer: Remove #if0'd obsolete symlink format

Masters are to use "-1" after "@@", but not "0x",
so this #if0'd code is obsolete.

Summary of changes:
 sys/vfs/hammer/hammer_vnops.c | 6 --
 1 file changed, 6 deletions(-)

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Remove DEBUG_TRUNCATE flag

2015-11-29 Thread Tomohiro Kusumi

commit be236e907172fc612326f34484da1c89d667e957
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sun Nov 29 15:48:44 2015 +0900

sys/vfs/hammer: Remove DEBUG_TRUNCATE flag

This was only used in the early stage of hammer development
for debug kprintfs and no longer used or enabled.

Summary of changes:
 sys/vfs/hammer/hammer_inode.c |  8 
 sys/vfs/hammer/hammer_vnops.c | 24 
 2 files changed, 32 deletions(-)

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Remove forward declaration of struct hammer_cmirror

2015-11-24 Thread Tomohiro Kusumi

commit 60ef395a9e811ee16dfbd9a1f591dbb67cf1d6b7
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Wed Nov 25 01:23:13 2015 +0900

sys/vfs/hammer: Remove forward declaration of struct hammer_cmirror

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

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/60ef395a9e811ee16dfbd9a1f591dbb67cf1d6b7


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Remove signature from ondisk node

2015-11-24 Thread Tomohiro Kusumi

commit 79082206b0b1b9c651f2f77e1096788a28387c7b
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Wed Nov 25 01:00:26 2015 +0900

sys/vfs/hammer: Remove signature from ondisk node

The node signature was added in the early stage of hammer
development, but it's no longer used for anything except
that newfs_hammer sets the field to GOOD (for no reason).

c461935c added some code to propagate the GOOD signature
on node split (just to make it look a bit more sane), but
it's useless anyway.

This commit changes the signature field to reserved00,
and also gets rid of HAMMER_BTREE_SIGNATURE_XXX macros.
The change doesn't affect anything just like c461935c did
nothing good or bad.

Summary of changes:
 sbin/hammer/cmd_show.c   | 2 --
 sbin/newfs_hammer/newfs_hammer.c | 1 -
 sys/vfs/hammer/hammer_btree.c| 4 
 sys/vfs/hammer/hammer_btree.h| 4 +---
 4 files changed, 1 insertion(+), 10 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/79082206b0b1b9c651f2f77e1096788a28387c7b


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Add/fix comments on zones

2015-12-01 Thread Tomohiro Kusumi

commit 6fa871edd8a4c6595226f8af145537a088ffc544
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Tue Dec 1 00:15:47 2015 +0900

sys/vfs/hammer: Add/fix comments on zones

Summary of changes:
 sys/vfs/hammer/hammer_disk.h | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Remove HAMMER_BLOCKMAP_RADIX1|2_PERBUFFER macros

2015-12-01 Thread Tomohiro Kusumi

commit d2530221eb7250e314ae52f47ef6529d089ba587
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Tue Dec 1 20:53:37 2015 +0900

sys/vfs/hammer: Remove HAMMER_BLOCKMAP_RADIX1|2_PERBUFFER macros

Things can be implemented without using these macros that
are a bit difficult to understand what they are.

newfs_hammer is the only program that currently uses them,
but it can be done in a more simple way.

Summary of changes:
 sbin/hammer/ondisk.c | 8 
 sys/vfs/hammer/hammer_disk.h | 5 -
 2 files changed, 4 insertions(+), 9 deletions(-)

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Remove HAMMER_RECTYPE_UNUSED02/03 macros

2015-11-20 Thread Tomohiro Kusumi

commit 2b5191661daa785b2d11ec631d564bad09c11d02
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Fri Nov 20 01:58:31 2015 +0900

sys/vfs/hammer: Remove HAMMER_RECTYPE_UNUSED02/03 macros

These macros aren't used.
Also macros from 0x4 to 0xF do not exist, then it's natural
not to have UNUSED macros for 0x2 and 0x3.

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

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Fix comments

2015-11-20 Thread Tomohiro Kusumi

commit d6571938f2980a4084fe36f604af18ab7823a219
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Fri Nov 20 02:32:45 2015 +0900

sys/vfs/hammer: Fix comments

/* (not including atime/mtime) */
was supposed to be for HAMMER_INODE_DDIRTY according to ddfdf542.

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

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Remove unused bitfield of struct hammer_io

2015-11-23 Thread Tomohiro Kusumi

commit c0a828f7728eda0305ee66489a7797b4afac8d5b
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Mon Nov 23 17:00:37 2015 +0900

sys/vfs/hammer: Remove unused bitfield of struct hammer_io

Remove unused validated field of inmemory I/O structure.
(the bitfields are not ondisk representation)

This field was only used by old cluster code in the early
stage of hammer development.

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

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Remove unused struct hammer_volume members

2015-11-22 Thread Tomohiro Kusumi

commit 39308ea86c73dc02233a0e3aa8655b54119201fa
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sun Nov 22 22:41:21 2015 +0900

sys/vfs/hammer: Remove unused struct hammer_volume members

Remove unused members of inmemory volume structure.
These are mostly from early stage of hammer development.

These are copies of ondisk volume structure fields.
Inmemory volume obviously isn't an exact copy of ondisk volume,
so these aren't necessary unless actually used.

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

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/39308ea86c73dc02233a0e3aa8655b54119201fa


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Remove const from volume names

2015-11-24 Thread Tomohiro Kusumi

commit e73c3403b4ef311cb0dc361abe9f1914088934c2
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Tue Nov 24 03:24:45 2015 +0900

sys/vfs/hammer: Remove const from volume names

struct hammer_mount_info having const char** for volume names
was not necessary.

mount_hammer(8) needs to be able to free info->volumes[i]
since these names are strdup'd char* but not pointers to argv[i].

Also see aeb72a17.

Summary of changes:
 sbin/mount_hammer/mount_hammer.c | 4 ++--
 sys/vfs/hammer/hammer_mount.h| 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

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


-- 
DragonFly BSD source repository


git: sys/dev/disk/dm: Add dm-flakey target

2015-11-19 Thread Tomohiro Kusumi

commit b9790952d463c74d2706f84a3b2b5e035eb3059b
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sun Nov 15 19:22:47 2015 +0900

sys/dev/disk/dm: Add dm-flakey target

This commit adds a new dm target dm-flakey.

This target simulates failing devices for testing purposes.
See dm_target_flakey(4) for details.

Note that using this dm target may results in some unstable
status including kernel panic. For example hammer is likely
to cause kernel panic by write data corruption by dm-flakey.
Don't use this target over any block device in production.

  = Example1 - Error write I/Os
  # kldload dm_target_flakey
  # dmsetup create flakey1 --table "0 234436482 flakey ${DEV} 0 1 1"
  # newfs_hammer -L TEST /dev/mapper/flakey1
  Volume 0 DEVICE /dev/mapper/flakey1 size 111.79GB
  initialize freemap volume 0
  initializing the undo map (504 MB)
  newfs_hammer: Write volume 0 (/dev/mapper/flakey1): Input/output error
  # dmsetup remove /dev/mapper/flakey1

  = Example2 - Silently drop write I/Os
  # newfs_hammer -L TEST ${DEV} > /dev/null
  # mount_hammer ${DEV} /HAMMER
  # cd /HAMMER
  # git clone /usr/local/src/dragonfly
  Cloning into 'dragonfly'...
  done.
  Checking out files: 100% (34434/34434), done.
  # cd
  # umount /HAMMER
  # dmsetup create flakey2 --table "0 234436482 flakey ${DEV} 0 1 1 1 
drop_writes"
  # mount_hammer /dev/mapper/flakey2 /HAMMER
  # dmesg | tail -3
  HAMMER() Critical error inode=-1 error=5 while flushing meta-data
  HAMMER() Forcing read-only mode
  HAMMER(TEST) mounted clean, no recovery needed
  # hammer volume-list /HAMMER
  /dev/mapper/flakey2
  # mount | grep "/HAMMER"
  TEST on /HAMMER (hammer, local, read-only)
  # cd /HAMMER/dragonfly
  # git log -p > /dev/null; echo $?
  0
  # cd
  # umount /HAMMER
  # dmsetup remove /dev/mapper/flakey2

  = Example3 - Corrupt read I/Os
  # dd if=/dev/zero of=${DEV} bs=1024 count=1 >/dev/null 2>&1
  # dmsetup create flakey3 --table "0 234436482 flakey ${DEV} 0 1 1 5 
corrupt_bio_byte 1 r 65 0"
  # od -tx1 /dev/mapper/flakey3 | head -10
  00041  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
  02000  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
  *
  00141  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
  001002000  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
  *
  00241  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
  002002000  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
  *
  00341  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
  # dmsetup remove /dev/mapper/flakey3
  # kldunload dm_target_flakey

Summary of changes:
 share/man/man4/Makefile|   1 +
 .../man4/{dm_target_delay.4 => dm_target_flakey.4} |  74 +++-
 sys/conf/files |   1 +
 sys/config/LINT64  |   1 +
 sys/dev/disk/dm/dm.h   |   1 +
 sys/dev/disk/dm/targets/Makefile   |   2 +-
 sys/dev/disk/dm/targets/flakey/Makefile|   5 +
 sys/dev/disk/dm/targets/flakey/dm_target_flakey.c  | 411 +
 8 files changed, 481 insertions(+), 15 deletions(-)
 copy share/man/man4/{dm_target_delay.4 => dm_target_flakey.4} (50%)
 create mode 100644 sys/dev/disk/dm/targets/flakey/Makefile
 create mode 100644 sys/dev/disk/dm/targets/flakey/dm_target_flakey.c

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


-- 
DragonFly BSD source repository


git: sys/kern/vfs: Fix panic message

2015-11-19 Thread Tomohiro Kusumi

commit 4885d2d65d2a3ce25ed3d56461564787458bd894
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Thu Nov 19 01:50:01 2015 +0900

sys/kern/vfs: Fix panic message

Show # of pushed bios.

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

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/4885d2d65d2a3ce25ed3d56461564787458bd894


-- 
DragonFly BSD source repository


git: autofs: Port autofs from FreeBSD

2016-06-02 Thread Tomohiro Kusumi

commit e2950f411cf734644d0586c7ed409af918988d76
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Wed May 18 17:01:32 2016 +0900

autofs: Port autofs from FreeBSD

Brought in basically from
FreeBSD@GitHub cac9beab7d53f0c37ce2a2a1b893be59028928f4
with lots of changes.
Note that this commit isn't necessarily 1:1 with above commit.

Kernel code is basically a rewrite based on the FreeBSD code.
Userspace is basically 1:1 with FreeBSD except that lots of small
changes (including related commits listed below) were necessary.
This is due to autofs being dependent on FreeBSD specific interface,
command options and such.

For userspace, note that non-functional stuff (e.g. whitespace
warnings via git am) are intentionally left to be 1:1 with FreeBSD.
Userspace is basically portable, so don't try to obfuscate the real
changes made for DragonFly by fixing these for now till things are
considered stable unless it's a bug from FreeBSD.

Summary of newly added or modified files.
- sys/vfs/autofs - autofs filesystem
- usr.sbin/autofs - autofs userspace command and daemons
- etc/ - configuration files and manpages
- others - changes in misc subsystems (not independent of autofs)

Related DragonFly commits.
- usr.sbin/autofs: Workaround namecache bug after unmount
- sys/kern: Don't implement .vfs_sync unless sync is supported
- user.sbin/fstyp: Port fstyp from FreeBSD
- sys/kern: Retry nlookup if nresolve returned ESTALE
- sys/sys: Fix IOCPARM_MAX
- sys/sys: Extend IOCPARM_MAX
- usr.bin/showmount: Add -E option
- sbin/mount_nfs: Add -o retrycnt= option
- sys/kern: Add kqueue EVFILT_FS
- sys/kern: Add kstrndup()

Related DragonFly PRs.
- https://bugs.dragonflybsd.org/issues/2900
- https://bugs.dragonflybsd.org/issues/2901
- https://bugs.dragonflybsd.org/issues/2905
- https://bugs.dragonflybsd.org/issues/2907
- https://bugs.dragonflybsd.org/issues/2908
- https://bugs.dragonflybsd.org/issues/2909
- https://bugs.dragonflybsd.org/issues/2912
- https://bugs.dragonflybsd.org/issues/2913
- https://bugs.dragonflybsd.org/issues/2914

Other related resource.
- http://lists.dragonflybsd.org/pipermail/users/2016-May/thread.html#249556
- http://lists.dragonflybsd.org/pipermail/users/2016-June/thread.html#249680
- https://www.dragonflydigest.com/2016/05/06/18066.html

Summary of changes:
 etc/Makefile   |5 +-
 etc/auto_master|9 +
 etc/autofs/Makefile|   11 +
 etc/autofs/include_ldap|   55 ++
 etc/autofs/special_hosts   |   17 +
 etc/autofs/special_media   |  120 
 etc/autofs/special_noauto  |   29 +
 etc/autofs/special_null|4 +
 etc/defaults/rc.conf   |1 +
 etc/mtree/BSD.include.dist |2 +
 etc/rc.d/Makefile  |1 +
 etc/rc.d/automount |   31 ++
 etc/rc.d/automountd|   19 +
 etc/rc.d/autounmountd  |   18 +
 include/Makefile   |3 +-
 include/mntopts.h  |2 +
 sbin/mount/mount.8 |   12 +-
 sbin/mountd/mountd.c   |3 +
 share/man/man5/Makefile|1 +
 share/man/man5/autofs.5|  125 +
 share/man/man5/rc.conf.5   |   48 +-
 share/man/man7/hier.7  |6 +-
 sys/conf/files |3 +
 sys/conf/options   |1 +
 sys/kern/vfs_subr.c|1 +
 sys/kern/vfs_syscalls.c|6 +-
 sys/sys/mount.h|3 +-
 sys/sys/vfscache.h |2 +-
 sys/vfs/Makefile   |2 +-
 sys/vfs/autofs/Makefile|4 +
 sys/vfs/autofs/autofs.c|  707 +++
 sys/vfs/autofs/autofs.h|  191 +++
 sys/vfs/autofs/autofs_ioctl.h  |  120 
 sys/vfs/autofs/autofs_mount.h  |   40 ++
 sys/vfs/autofs/autofs_vfsops.c |  238 
 sys/vfs/autofs/autofs_vnops.c  |  617 
 usr.sbin/Makefile  |2 +
 usr.sbin/autofs/Makefile   |   17 +
 usr.sbin/autofs/auto_master.5  |  392 +
 usr.sbin/autofs/automount.8|  123 
 usr.sbin/autofs/automount.c|  331 +++
 usr.sbin/autofs/automountd.8   |  116 
 usr.sbin/autofs/automountd.c   |  554 ++
 usr.sbin/autofs/autounmountd.8 |  100 
 usr.sbin/autofs/autounmountd.c |  339 +++
 usr.sbin/autofs/common.c   | 1207 
 usr.sbin/autofs/common.h   |  130 +
 usr.sbin/autofs/defined.c  |  253 +
 usr.sbin/autofs/log.c  |  199 +++
 usr.sbin/autofs/popen.c|  190 +++
 usr.sbin/autofs/token.l|   59 ++
 51 files changed, 6458 insertions(+), 11 deletions(-)
 create mode 100644 etc/auto_master
 create mode 100644 etc/autofs/Makefile
 create mode 100644 etc/autofs/include_ldap
 creat

git: sys/kern: Retry nlookup if nresolve returned ESTALE

2016-06-02 Thread Tomohiro Kusumi

commit ca7294164d097ddba87f8b85282cdedee3fa7641
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Thu May 19 03:07:27 2016 +0900

sys/kern: Retry nlookup if nresolve returned ESTALE

Make nlookup retry the whole thing if nresolve VOP returned ESTALE.

This will be used by autofs (in the next few commits).
This doesn't affect other filesystems, because no other filesystem
returns ESTALE.

Autofs needs this because a target filesystem may get mounted under
the root directory of autofs while running nresolve VOP of autofs.
Autofs tells nlookup the topology has changed by returning ESTALE.
Unless nlookup retries the lookup, the result is obsolete.

Summary of changes:
 sys/kern/vfs_nlookup.c | 23 +++
 1 file changed, 23 insertions(+)

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


-- 
DragonFly BSD source repository


git: usr.bin/showmount: Add -E option

2016-06-02 Thread Tomohiro Kusumi

commit 1ede5aedc95b286da5aadac188ae95ea0746b7ec
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sun May 15 22:05:15 2016 +0900

usr.bin/showmount: Add -E option

Brought in from FreeBSD@GitHub 6fee958d289745f0f52dcc0df16858cf7e093d5c.
Needed by autofs.

Also see https://bugs.dragonflybsd.org/issues/2914.

Summary of changes:
 usr.bin/showmount/showmount.8 | 10 --
 usr.bin/showmount/showmount.c | 30 +++---
 2 files changed, 35 insertions(+), 5 deletions(-)

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


-- 
DragonFly BSD source repository


git: usr.sbin/fstyp: Port fstyp from FreeBSD

2016-06-02 Thread Tomohiro Kusumi

commit 551c4c362a7f8c4ae74e04ff6405c1b9eea40751
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Wed May 18 16:58:01 2016 +0900

usr.sbin/fstyp: Port fstyp from FreeBSD

Brought in from FreeBSD@GitHub 3e3c248f832f796881ac2ce0d45049552e8d9a9b.
Needed by autofs.

Removed ZFS and GEOM support.
Added HAMMER support.

Note that fstyp has been changed to test a filesystem type vector
fsvtypes[] in addition to the existing fstypes[]. This is a bit
ad-hoc, but was necessary to support partial volume(s) for HAMMER
without a major code rewrite.

Summary of changes:
 usr.sbin/fstyp/Makefile  |  10 ++
 usr.sbin/fstyp/cd9660.c  |  60 +++
 usr.sbin/fstyp/ext2fs.c  |  83 
 usr.sbin/fstyp/fstyp.8   | 149 
 usr.sbin/fstyp/fstyp.c   | 253 +++
 usr.sbin/fstyp/fstyp.h   |  52 ++
 usr.sbin/fstyp/hammer.c  | 192 +++
 usr.sbin/fstyp/msdosfs.c | 173 
 usr.sbin/fstyp/msdosfs.h | 141 ++
 usr.sbin/fstyp/ntfs.c| 161 ++
 usr.sbin/fstyp/ufs.c | 111 +
 11 files changed, 1385 insertions(+)
 create mode 100644 usr.sbin/fstyp/Makefile
 create mode 100644 usr.sbin/fstyp/cd9660.c
 create mode 100644 usr.sbin/fstyp/ext2fs.c
 create mode 100644 usr.sbin/fstyp/fstyp.8
 create mode 100644 usr.sbin/fstyp/fstyp.c
 create mode 100644 usr.sbin/fstyp/fstyp.h
 create mode 100644 usr.sbin/fstyp/hammer.c
 create mode 100644 usr.sbin/fstyp/msdosfs.c
 create mode 100644 usr.sbin/fstyp/msdosfs.h
 create mode 100644 usr.sbin/fstyp/ntfs.c
 create mode 100644 usr.sbin/fstyp/ufs.c

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/551c4c362a7f8c4ae74e04ff6405c1b9eea40751


-- 
DragonFly BSD source repository


git: sys/kern: Don't implement .vfs_sync unless sync is supported

2016-06-02 Thread Tomohiro Kusumi

commit ef560bee278f06774ef808da1d503e9b1350f938
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Wed May 25 00:09:48 2016 +0900

sys/kern: Don't implement .vfs_sync unless sync is supported

The only reason filesystems without requirement of syncing
(e.g. no backing storage) need to implement .vfs_sync is because
those fs need a sync with a return value of 0 on unmount.

If unmount allows sync with return value of EOPNOTSUPP for fs
that do not support sync, those fs no longer have to implement
.vfs_sync with vfs_stdsync() only to pass dounmount().

The drawback is when there is a sync (other than vfs_stdnosync)
that returns EOPNOTSUPP for real errors. The existing fs in
DragonFly don't do this (and shouldn't either).

Also see https://bugs.dragonflybsd.org/issues/2912.

 # grep "\.vfs_sync" sys/vfs sys/gnu/vfs -rI | grep vfs_stdsync
 sys/vfs/udf/udf_vfsops.c:   .vfs_sync = vfs_stdsync,
 sys/vfs/portal/portal_vfsops.c: .vfs_sync = vfs_stdsync
 sys/vfs/devfs/devfs_vfsops.c:   .vfs_sync   = vfs_stdsync,
 sys/vfs/isofs/cd9660/cd9660_vfsops.c:   .vfs_sync = 
vfs_stdsync,
 sys/vfs/autofs/autofs_vfsops.c: .vfs_sync = vfs_stdsync,/* 
for unmount(2) */
 sys/vfs/tmpfs/tmpfs_vfsops.c:   .vfs_sync = 
vfs_stdsync,
 sys/vfs/dirfs/dirfs_vfsops.c:   .vfs_sync = 
vfs_stdsync,
 sys/vfs/ntfs/ntfs_vfsops.c: .vfs_sync = vfs_stdsync,
 sys/vfs/procfs/procfs_vfsops.c: .vfs_sync = vfs_stdsync
 sys/vfs/hpfs/hpfs_vfsops.c: .vfs_sync = vfs_stdsync,
 sys/vfs/nullfs/null_vfsops.c:   .vfs_sync = vfs_stdsync,

Summary of changes:
 sys/kern/vfs_syscalls.c  | 16 
 sys/vfs/devfs/devfs_vfsops.c |  1 -
 sys/vfs/dirfs/dirfs_vfsops.c |  1 -
 sys/vfs/hpfs/hpfs_vfsops.c   |  1 -
 sys/vfs/isofs/cd9660/cd9660_vfsops.c |  1 -
 sys/vfs/ntfs/ntfs_vfsops.c   |  1 -
 sys/vfs/nullfs/null_vfsops.c |  1 -
 sys/vfs/portal/portal_vfsops.c   |  1 -
 sys/vfs/procfs/procfs_vfsops.c   |  1 -
 sys/vfs/tmpfs/tmpfs_vfsops.c |  1 -
 sys/vfs/udf/udf_vfsops.c |  1 -
 11 files changed, 8 insertions(+), 18 deletions(-)

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


-- 
DragonFly BSD source repository


git: sys/sys: Extend IOCPARM_MAX

2016-06-02 Thread Tomohiro Kusumi

commit ef5bed6526bbb76169083db5c11e2b9bd99837c9
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Mon May 9 02:39:43 2016 +0900

sys/sys: Extend IOCPARM_MAX

Brought in from FreeBSD@GitHub 598dc07f1ee077b425c2f447aeb3dfb632a1f2a3.
Needed by autofs (and possibly other ioctls in the future).

It was originally for ZFS on FreeBSD, but autofs needed this as well.

Also see https://bugs.dragonflybsd.org/issues/2907.

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

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


-- 
DragonFly BSD source repository


git: usr.sbin/autofs: Workaround namecache bug after unmount

2016-06-02 Thread Tomohiro Kusumi

commit ce54322c03058ba2986bfb3d2ebfc98362ad941d
Author: Tomohiro Kusumi <kusumi.tomoh...@gmail.com>
Date:   Sun May 29 13:59:24 2016 +0900

usr.sbin/autofs: Workaround namecache bug after unmount

autounmountd gets affected by the namecache bug mentioned in
https://bugs.dragonflybsd.org/issues/2908.

This can be worked around by stat(2) (or any syscall that resolves
the name once again) after unmount failed with EBUSY.

Without this workaround, a process at automounted filesystem will
see ENOTCONN after autounmountd's attempt to unmount. This must
not be removed until the namecache bug is fixed.

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

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


-- 
DragonFly BSD source repository


<    1   2   3   4   5   6   7   8   9   10   >