git: sys/vfs/hammer: Change/Fix ioctl API for HAMMERIOC_PFS_ITERATE

2016-08-14 Thread Tomohiro Kusumi

commit e0f42079306350f7daca49530c8efcbfbe5febf2
Author: Tomohiro Kusumi 
Date:   Sat Aug 13 14:52:29 2016 +0900

sys/vfs/hammer: Change/Fix ioctl API for HAMMERIOC_PFS_ITERATE

Rewrite hammer_ioc_iterate_pseudofs() as a proper hammer ioctl.
This commit requires buildworld, but it only affects libhammer and
hammer info command.

This ioctl has had lots of design issues as mentioned in 898f9540
and d8c56f70 in 2015. This ioctl is also just a variant of the
existing HAMMER_IOC_GET_PSEUDOFS which originally existed before
HAMMERIOC_PFS_ITERATE was added.

(It can't be replaced with HAMMER_IOC_GET_PSEUDOFS at the moment,
because of the difference in handling ondisk PFS data with deleted
flag set, but it should be replaced or removed in the future.
This interface is too tightly coupled with libhammer that no one
else really needs this, and there is a way to do the same thing
without using this ioctl. There is also a possible bug that comes
from the way this ioctl and libhammer is assuming about PFS data
with deleted flag set)

This commit breaks userspace that's been directly using this ioctl,
but I doubt anyone has done except for libhammer, as the existence
of such an ioctl has never been mentioned in DragonFly manpages or
other documents. Also note that this ioctl was added for libhammer,
so no one else is likely to really care about it.

Summary of changes:
 lib/libhammer/info.c  | 21 -
 sys/vfs/hammer/hammer.h   |  2 +-
 sys/vfs/hammer/hammer_ioctl.c |  2 +-
 sys/vfs/hammer/hammer_ioctl.h | 12 ++--
 sys/vfs/hammer/hammer_pfs.c   | 38 +-
 5 files changed, 33 insertions(+), 42 deletions(-)

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


-- 
DragonFly BSD source repository


git: sbin/newfs_hammer: Add exit_code arg to usage()

2016-08-15 Thread Tomohiro Kusumi

commit c5792f02d6d708d7bb4f545c374a9e1ba3273666
Author: Tomohiro Kusumi 
Date:   Mon Aug 15 21:06:14 2016 +0900

sbin/newfs_hammer: Add exit_code arg to usage()

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

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


-- 
DragonFly BSD source repository


git: sbin/hammer: Cleanups

2016-08-15 Thread Tomohiro Kusumi

commit 5bbf2e86ebb05ecff3a372ce9177685fa9f5bcac
Author: Tomohiro Kusumi 
Date:   Mon Aug 15 20:48:37 2016 +0900

sbin/hammer: Cleanups

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

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


-- 
DragonFly BSD source repository


git: sbin/newfs_hammer: Add -C option from hammer(8)

2016-08-15 Thread Tomohiro Kusumi

commit 25ee129e19d202a0ca0e1ea9855c933a7d545cb6
Author: Tomohiro Kusumi 
Date:   Mon Aug 15 00:54:05 2016 +0900

sbin/newfs_hammer: Add -C option from hammer(8)

Just to support the same options given that these are both based
on the same volume/buffer structure.

Summary of changes:
 sbin/hammer/cache.c  | 40 
 sbin/hammer/hammer.c | 32 +---
 sbin/hammer/hammer.h |  2 --
 sbin/hammer/hammer_util.h|  3 +++
 sbin/newfs_hammer/newfs_hammer.8 |  6 +-
 sbin/newfs_hammer/newfs_hammer.c |  8 ++--
 6 files changed, 55 insertions(+), 36 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/25ee129e19d202a0ca0e1ea9855c933a7d545cb6


-- 
DragonFly BSD source repository


git: sbin/newfs_hammer: Add -h option

2016-08-15 Thread Tomohiro Kusumi

commit 591440d1dddcb6bee54d9d01faaa966c0cbbfd65
Author: Tomohiro Kusumi 
Date:   Mon Aug 15 21:11:31 2016 +0900

sbin/newfs_hammer: Add -h option

Summary of changes:
 sbin/newfs_hammer/newfs_hammer.8 | 4 +++-
 sbin/newfs_hammer/newfs_hammer.c | 7 +--
 2 files changed, 8 insertions(+), 3 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/591440d1dddcb6bee54d9d01faaa966c0cbbfd65


-- 
DragonFly BSD source repository


git: sbin/hammer: Fix memory leak

2016-08-16 Thread Tomohiro Kusumi

commit 16712f18f748c9c82535b14934e368ad9fb33c7a
Author: Tomohiro Kusumi 
Date:   Tue Aug 16 20:45:44 2016 +0900

sbin/hammer: Fix memory leak

strsep moves * by taking **, so the caller need to keep a pointer to 
strdup'd address.

Summary of changes:
 sbin/hammer/cmd_remote.c |  6 +++---
 sbin/hammer/hammer.c | 13 +++--
 2 files changed, 10 insertions(+), 9 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/16712f18f748c9c82535b14934e368ad9fb33c7a


-- 
DragonFly BSD source repository


git: sbin/hammer: Refactoring

2016-08-16 Thread Tomohiro Kusumi

commit 93056456a8d6c17cae1d6098da85608caac029bb
Author: Tomohiro Kusumi 
Date:   Tue Aug 16 20:11:46 2016 +0900

sbin/hammer: Refactoring

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

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/93056456a8d6c17cae1d6098da85608caac029bb


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Fix wrong comment and unnecessary argument

2016-08-17 Thread Tomohiro Kusumi

commit b077a45cfef52183808ce73c3f13795fb6b779db
Author: Tomohiro Kusumi 
Date:   Wed Aug 17 20:08:01 2016 +0900

sys/vfs/hammer: Fix wrong comment and unnecessary argument

B-Tree code isn't aware of PFS (or other HAMMER record types built
on top of B-Tree) by design. In fact pfsm argument is unused and
no longer necessary after sometime in 2008.

Summary of changes:
 sys/vfs/hammer/hammer.h|  1 -
 sys/vfs/hammer/hammer_btree.c  |  8 +---
 sys/vfs/hammer/hammer_object.c | 10 --
 3 files changed, 5 insertions(+), 14 deletions(-)

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


-- 
DragonFly BSD source repository


git: sbin/hammer: Minor hammer show cleanups

2016-08-18 Thread Tomohiro Kusumi

commit 00dd9c672baf53a2d68fc46acc5a8fe21c949bc1
Author: Tomohiro Kusumi 
Date:   Thu Aug 18 20:28:55 2016 +0900

sbin/hammer: Minor hammer show cleanups

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

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/00dd9c672baf53a2d68fc46acc5a8fe21c949bc1


-- 
DragonFly BSD source repository


git: sbin/hammer: Add inode size check to hammer show

2016-08-18 Thread Tomohiro Kusumi

commit 6adb5810ad35b79d3d5303debd2e1136bf577049
Author: Tomohiro Kusumi 
Date:   Thu Aug 18 20:33:58 2016 +0900

sbin/hammer: Add inode size check to hammer show

Do the same sanity check as what hammer_crc_set|test_leaf()
do in kernel space.

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

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


-- 
DragonFly BSD source repository


git: sbin/hammer: Remove if(QuietOpt) conditionals in hammer show/checkmap

2016-08-18 Thread Tomohiro Kusumi

commit fc1246037064176aa5afb5962b4e63c9ad76e484
Author: Tomohiro Kusumi 
Date:   Thu Aug 18 21:35:39 2016 +0900

sbin/hammer: Remove if(QuietOpt) conditionals in hammer show/checkmap

mostly since it doesn't make much difference anyway.

The only QuietOpt conditional left is for print_record(elm) in
print_btree_elm() which makes amount of output text quite diffrent.

Summary of changes:
 sbin/hammer/cmd_blockmap.c | 16 -
 sbin/hammer/cmd_show.c | 82 --
 2 files changed, 43 insertions(+), 55 deletions(-)

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Remove unused HAMMER_IOC_PFS_XXX macros

2016-08-18 Thread Tomohiro Kusumi

commit af80276762ada3b1276a56f7b42307ebfaec5b6b
Author: Tomohiro Kusumi 
Date:   Thu Aug 18 23:25:11 2016 +0900

sys/vfs/hammer: Remove unused HAMMER_IOC_PFS_XXX macros

These were added in 5fa5c92f in 2008, but never used.

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

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Integrate ondisk uint32 reserveds into []

2016-08-19 Thread Tomohiro Kusumi

commit cbccd318bdb6c80873b0943b360402dd3e7b3f5b
Author: Tomohiro Kusumi 
Date:   Sat Aug 20 13:01:56 2016 +0900

sys/vfs/hammer: Integrate ondisk uint32 reserveds into []

Reserved field id's aren't in order from 00 to 11, so keeping them
with id's isn't that important, but rather confusing.

Also remove obsolete comment from ddfdf542 in 2008.
The idea of "birth time" was never explained in neither source nor
commit messages.

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

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Add comments on filesystem capacity

2016-08-19 Thread Tomohiro Kusumi

commit a003db3d5076bb648c807c1bdbaf5a77db67f8b2
Author: Tomohiro Kusumi 
Date:   Sat Aug 20 13:14:54 2016 +0900

sys/vfs/hammer: Add comments on filesystem capacity

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

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


-- 
DragonFly BSD source repository


git: sbin/hammer: Don't ioctl(SET_PFS) before attempt to destroy PFS

2016-08-20 Thread Tomohiro Kusumi

commit 9376f71b677e9fcde9af7c16cd3f31cfcdb43121
Author: Tomohiro Kusumi 
Date:   Thu Aug 18 23:00:44 2016 +0900

sbin/hammer: Don't ioctl(SET_PFS) before attempt to destroy PFS

This is part 1/2 of what's mentioned in below post.
Two ondisk PFS data (deleted PFS followed by undeleted PFS data) will
still appear with this commit, like what's mentioned in below post.
(This comes from HAMMER's flushing mechanism, so it's basically a bad
idea to try to fix it unless it's possible without touching core part
of HAMMER's flusher code, provided that this extra ondisk PFS data
does nothing bad. This may be fixed in the future as part 2/2 patch.)

http://lists.dragonflybsd.org/pipermail/users/2016-August/313004.html

This part 1/2 patch alone is still effective even without part 2/2.

If the PFS is successfully destroyed, the ondisk PFS data written by
ioctl(HAMMERIOC_SET_PSEUDOFS) prior to destroying (which is the code
removed by this commit) gets shadowed by the one with deleted flag,
so no one is to (or no one needs to) access that.

If failed to destroy the PFS, the original ondisk PFS data is restored
using a copy of the original data, so ioctl(HAMMERIOC_SET_PSEUDOFS)
prior to destroying is still unnecessary. Also see 750beaef.
Restoring part by 750beaef could be removed too since the PFS is not
downgraded or updated anymore.

Summary of changes:
 sbin/hammer/cmd_pfs.c | 17 +
 1 file changed, 1 insertion(+), 16 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/9376f71b677e9fcde9af7c16cd3f31cfcdb43121


-- 
DragonFly BSD source repository


git: sbin/hammer: Drop bug fix by 750beaef after 9376f71b

2016-08-20 Thread Tomohiro Kusumi

commit 3a47b32224d0d1d9491f023413b794b4c7620013
Author: Tomohiro Kusumi 
Date:   Sun Aug 21 11:02:57 2016 +0900

sbin/hammer: Drop bug fix by 750beaef after 9376f71b

Since ondisk PFS data is no longer degraded or updated,
a bug fix made by 750beaef in 2015 can be removed.

Summary of changes:
 sbin/hammer/cmd_pfs.c | 18 --
 1 file changed, 18 deletions(-)

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


-- 
DragonFly BSD source repository


git: sbin/hammer: Remove unused AssertOnFailure

2016-08-21 Thread Tomohiro Kusumi

commit e0c64b7d0cb193a63ac23013a40839ed49224ea7
Author: Tomohiro Kusumi 
Date:   Sun Aug 21 15:45:30 2016 +0900

sbin/hammer: Remove unused AssertOnFailure

After the previous commit, AssertOnFailure is no longer needed
as a global variable. It can be removed or replaced with DebugOpt
which is what AssertOnFailure was based on in some commands.

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

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


-- 
DragonFly BSD source repository


git: sbin/hammer: Remove AssertOnFailure assertion in blockmap lookup

2016-08-21 Thread Tomohiro Kusumi

commit 72e23ddf80e56ca3257f04d6caf7021ae64f9416
Author: Tomohiro Kusumi 
Date:   Sun Aug 21 15:07:30 2016 +0900

sbin/hammer: Remove AssertOnFailure assertion in blockmap lookup

This isn't necessary as blockmap_lookup() callers are going to
check returned offset and/or *errorp value. Callers don't want
blockmap_lookup() to kill the process instantly via errx()
especially when the callers are diagnostic commands like hammer
show or blockmap or checkmap.

This is also the only place where AssertOnFailure needs to be
a global variable. Once this gets removed, other ones can be
removed or changed to local variables.

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

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/72e23ddf80e56ca3257f04d6caf7021ae64f9416


-- 
DragonFly BSD source repository


git: sbin/hammer: Make get_buffer() static

2016-08-21 Thread Tomohiro Kusumi

commit 7f56be5f4baea684cc858f2ef3231e7135c82e99
Author: Tomohiro Kusumi 
Date:   Sun Aug 21 16:49:54 2016 +0900

sbin/hammer: Make get_buffer() static

This is always called via other get functions (but not directly)
from various hammer commands.

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

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


-- 
DragonFly BSD source repository


git: sbin/hammer: Add print_blockmap() for common blockmap output format

2016-08-22 Thread Tomohiro Kusumi

commit dce7ae2c730e5e9d4b2438f6dffd053eef34c056
Author: Tomohiro Kusumi 
Date:   Sun Aug 21 21:16:19 2016 +0900

sbin/hammer: Add print_blockmap() for common blockmap output format

This is for hammer blockmap,checkmap,show,show-undo commands.
These hammer commands print blockmap information prior to checking
whatever filesystem structure they're looking for, with slightly
different format but essentially the same thing.

print_blockmap() defines a common format so that these commands
can print blockmap information in the same format. print_blockmap()
is based on hammer blockmap command's output format since it has
the best readable format.

Summary of changes:
 sbin/hammer/cmd_blockmap.c | 30 ---
 sbin/hammer/cmd_show.c | 30 ---
 sbin/hammer/hammer_util.h  |  2 ++
 sbin/hammer/ondisk.c   | 60 ++
 4 files changed, 71 insertions(+), 51 deletions(-)

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


-- 
DragonFly BSD source repository


git: sbin/hammer: Make sizetostr() print B if <1KB

2016-08-22 Thread Tomohiro Kusumi

commit 3f55980b1eebeac6906ca471818c5e0544982f80
Author: Tomohiro Kusumi 
Date:   Mon Aug 22 21:23:32 2016 +0900

sbin/hammer: Make sizetostr() print B if <1KB

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

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


-- 
DragonFly BSD source repository


git: sbin/hammer: Don't print mountpoint of PFS

2016-08-23 Thread Tomohiro Kusumi

commit d6c59c720c8103f8d9c75cf66dcfbd14d3ecdc90
Author: Tomohiro Kusumi 
Date:   Tue Aug 23 19:59:26 2016 +0900

sbin/hammer: Don't print mountpoint of PFS

/sbin/hammer should not care if PFS are null mounted or where PFS are
mounted. It has nothing to do with the filesystem itself. PFS is just
a pointer to jump into a subset of HAMMER's B-Tree (clustered by
localization parameter). Just because DragonFly's installer used to
use PFS (not anymore) and null mount by default doesn't mean /sbin
/hammer needs to provide null mount info.

If someone does mount PFS to somewhere and want to know where PFS are
mounted, one needs to just type mount. In fact this is much better
than getting mountpoints info via hammer info command because mount(8)
doesn't use hammer's ioctl which may cause B-Tree lookup, but instead
retrieves mountpoints directly from vfs.

Also note that printing such info gives users wrong assumption that
PFS in HAMMER is something equivalent of ZFS (created out of storage
zpool) which is not true. As mentioned above, PFS is just a pointer to
a subset of a single HAMMER filesystem. These are not independent fs.

Also note that hammer info still has bugs due to bugs from libhammer
and its attached ioctl as mentioned in e0f42079, including things under
investigation now. Whatever it is, hammer info needs to be rewritten
(as a different command like hammer fsinfo) in short and straight
forward code like other commands, without unnecessary abstraction.
I've been fixing and adding missing stuff to this hammer info command,
however hammer info is basically going nowhere because this command is
too tightly attached to libhammer.

Summary of changes:
 sbin/hammer/cmd_info.c | 11 ++-
 1 file changed, 2 insertions(+), 9 deletions(-)

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


-- 
DragonFly BSD source repository


git: lib/libhammer: Fix segmentation fault by null dereference

2016-08-23 Thread Tomohiro Kusumi

commit 4f82a29aabd65cb99b954188c910fb13fd5c42c4
Author: Tomohiro Kusumi 
Date:   Tue Aug 23 23:48:35 2016 +0900

lib/libhammer: Fix segmentation fault by null dereference

If libhammer cares about mountpoints of hammer and null,
it needs to care about the case where pfs0 happens to be NULL.
This occurs when a PFS(>#0) is null mounted on the mountpoint of PFS#0.

This commit avoids segmentation fault, but that doesn't mean the
result is correct. It's basically that this library doesn't fully
consider the complexity of ondisk PFS data within HAMMER's B-Tree.

Summary of changes:
 lib/libhammer/snapshot.c | 3 +++
 1 file changed, 3 insertions(+)

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


-- 
DragonFly BSD source repository


git: sbin/hammer: Sync dce7ae2c format with zone statistics

2016-08-24 Thread Tomohiro Kusumi

commit 8a05145d7e3d50e409cfa0d41d0d3b2c29ecef2a
Author: Tomohiro Kusumi 
Date:   Wed Aug 24 19:54:31 2016 +0900

sbin/hammer: Sync dce7ae2c format with zone statistics

Add "zone #" and change "next_tid" to "vol0_next_tid".

Summary of changes:
 sbin/hammer/misc.c   |  9 +
 sbin/hammer/ondisk.c | 23 ---
 2 files changed, 17 insertions(+), 15 deletions(-)

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


-- 
DragonFly BSD source repository


git: sbin/newfs_hammer: Set HAMMER_OBJTYPE_DIRECTORY for ondisk PFS#0 data

2016-08-25 Thread Tomohiro Kusumi

commit 935c61ab3898085f4f64a200dfbc57c3ca542c47
Author: Tomohiro Kusumi 
Date:   Thu Aug 25 21:40:12 2016 +0900

sbin/newfs_hammer: Set HAMMER_OBJTYPE_DIRECTORY for ondisk PFS#0 data

Ondisk PFS data is a record part of the root ip (inode) when
a new PFS is created via ioctl, so it's normal for ondisk PFS
data to have HAMMER_OBJTYPE_DIRECTORY for obj_type. It's
rather insane that PFS#0 (the only PFS created without ioctl)
has 0 (HAMMER_OBJTYPE_UNKNOWN) for obj_type while the root ip
(not PFS root but HAMMER root) is apparently a directory.

Although PFS#0 and the rest of the PFS are a bit different,
PFS ioctls treat all the ondisk PFS data in the same fashion.
Having consistent obj_type value for the same data type is
considered better than not having.

This change does affect 1 byte of ondisk PFS#0 data initially
created by newfs_hammer, but doesn't break compatibility.
Also see hammer_mkroot_pseudofs().

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

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/935c61ab3898085f4f64a200dfbc57c3ca542c47


-- 
DragonFly BSD source repository


git: sbin/hammer: Use "objid" for inode#

2016-08-26 Thread Tomohiro Kusumi

commit 0297144284bfb22a614d831b89364138f5faa630
Author: Tomohiro Kusumi 
Date:   Sat Aug 27 11:13:30 2016 +0900

sbin/hammer: Use "objid" for inode#

"objid" is a commonly used one in kprintf as well as this command.
so change "obj", "ino" to "objid" which are all inode#.

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

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/0297144284bfb22a614d831b89364138f5faa630


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Remove wrong comment

2016-08-26 Thread Tomohiro Kusumi

commit 38fd96e928f46e91e96735fc9a8560793e7eb3c3
Author: Tomohiro Kusumi 
Date:   Sat Aug 27 12:48:57 2016 +0900

sys/vfs/hammer: Remove wrong comment

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

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/38fd96e928f46e91e96735fc9a8560793e7eb3c3


-- 
DragonFly BSD source repository


git: sbin/hammer: Use . for pfs-status if no arg

2016-08-27 Thread Tomohiro Kusumi

commit fdba95482c4418ca425141f5d0a007f491dc089a
Author: Tomohiro Kusumi 
Date:   Sat Aug 27 18:29:45 2016 +0900

sbin/hammer: Use . for pfs-status if no arg

hammer pfs-status can take 1 or more args unlike other pfs-xxx,
so allow 0 arg for default ".".

Summary of changes:
 sbin/hammer/cmd_pfs.c | 49 +
 1 file changed, 29 insertions(+), 20 deletions(-)

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Use typedef'd for struct hammer_blockmap_xxx*

2016-08-28 Thread Tomohiro Kusumi

commit 21e9e7d5ffe0b12b63c1652a38322ec4b105dd51
Author: Tomohiro Kusumi 
Date:   Sun Aug 28 16:22:30 2016 +0900

sys/vfs/hammer: Use typedef'd for struct hammer_blockmap_xxx*

The whole hammer code is mix of using struct and typedef'd.
Use typedef'd because majority of the code use typedef'd.

Summary of changes:
 sbin/hammer/blockmap.c   | 16 
 sbin/hammer/cmd_blockmap.c   | 30 +++---
 sbin/hammer/hammer_util.h|  6 +++---
 sbin/hammer/misc.c   |  2 +-
 sbin/hammer/ondisk.c |  6 +++---
 sys/vfs/hammer/hammer_blockmap.c | 38 +++---
 sys/vfs/hammer/hammer_volume.c   | 12 ++--
 7 files changed, 55 insertions(+), 55 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/21e9e7d5ffe0b12b63c1652a38322ec4b105dd51


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Conform to typical hammer code format

2016-08-28 Thread Tomohiro Kusumi

commit 2dcf7f7f74c2066b11108b66a2606259785d2436
Author: Tomohiro Kusumi 
Date:   Sun Aug 28 16:46:09 2016 +0900

sys/vfs/hammer: Conform to typical hammer code format

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

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Use typedef'd for union hammer_data_ondisk*

2016-08-28 Thread Tomohiro Kusumi

commit 513f50d558e1d549079be35bb3783100f71bf2aa
Author: Tomohiro Kusumi 
Date:   Sun Aug 28 16:50:56 2016 +0900

sys/vfs/hammer: Use typedef'd for union hammer_data_ondisk*

The whole hammer code is mix of using struct and typedef'd.
Use typedef'd because majority of the code use typedef'd.

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

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/513f50d558e1d549079be35bb3783100f71bf2aa


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Use typedef'd for struct hammer_pseudofs_data*

2016-08-28 Thread Tomohiro Kusumi

commit 2be0af6e5d36ebd4bc711f4de1c872455f7e6f65
Author: Tomohiro Kusumi 
Date:   Sun Aug 28 16:48:42 2016 +0900

sys/vfs/hammer: Use typedef'd for struct hammer_pseudofs_data*

The whole hammer code is mix of using struct and typedef'd.
Use typedef'd because majority of the code use typedef'd.

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

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Use typedef'd for struct hammer_btree_leaf_elm*

2016-08-28 Thread Tomohiro Kusumi

commit 053f997d05b241000bfb3535f536e8a74fcd55ac
Author: Tomohiro Kusumi 
Date:   Sun Aug 28 17:28:43 2016 +0900

sys/vfs/hammer: Use typedef'd for struct hammer_btree_leaf_elm*

The whole hammer code is mix of using struct and typedef'd.
Use typedef'd because majority of the code use typedef'd.

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

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/053f997d05b241000bfb3535f536e8a74fcd55ac


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Use typedef'd for struct hammer_transaction*

2016-08-28 Thread Tomohiro Kusumi

commit 87d206095e2792a7d6475020d455cda8cdd181ae
Author: Tomohiro Kusumi 
Date:   Sun Aug 28 17:58:23 2016 +0900

sys/vfs/hammer: Use typedef'd for struct hammer_transaction*

The whole hammer code is mix of using struct and typedef'd.
Use typedef'd because majority of the code use typedef'd.

Summary of changes:
 sys/vfs/hammer/hammer.h | 16 
 sys/vfs/hammer/hammer_object.c  |  6 +++---
 sys/vfs/hammer/hammer_transaction.c | 11 ---
 3 files changed, 15 insertions(+), 18 deletions(-)

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Use typedef'd for struct hammer_node_ondisk*

2016-08-28 Thread Tomohiro Kusumi

commit 3367f3b3a2433b8fcdb90a00bb9ad1cec41ae051
Author: Tomohiro Kusumi 
Date:   Sun Aug 28 17:39:50 2016 +0900

sys/vfs/hammer: Use typedef'd for struct hammer_node_ondisk*

The whole hammer code is mix of using struct and typedef'd.
Use typedef'd because majority of the code use typedef'd.

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

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/3367f3b3a2433b8fcdb90a00bb9ad1cec41ae051


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Use typedef'd for struct hammer_volume_ondisk*

2016-08-28 Thread Tomohiro Kusumi

commit b419d3eea735c76d0979e536ae81102699ace6f7
Author: Tomohiro Kusumi 
Date:   Sun Aug 28 16:38:55 2016 +0900

sys/vfs/hammer: Use typedef'd for struct hammer_volume_ondisk*

The whole hammer code is mix of using struct and typedef'd.
Use typedef'd because majority of the code use typedef'd.

Summary of changes:
 sbin/hammer/cmd_show.c   |  2 +-
 sbin/hammer/hammer_util.h|  2 +-
 sbin/hammer/ondisk.c |  6 +++---
 sbin/newfs_hammer/newfs_hammer.c |  2 +-
 sys/vfs/hammer/hammer.h  |  2 +-
 sys/vfs/hammer/hammer_ioctl.c|  2 +-
 sys/vfs/hammer/hammer_ondisk.c   | 10 +-
 sys/vfs/hammer/hammer_volume.c   | 12 ++--
 8 files changed, 19 insertions(+), 19 deletions(-)

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Use typedef'd for struct hammer_inode*

2016-08-28 Thread Tomohiro Kusumi

commit e106786207dbc1d42397a79dde09a00ead066600
Author: Tomohiro Kusumi 
Date:   Sun Aug 28 18:08:02 2016 +0900

sys/vfs/hammer: Use typedef'd for struct hammer_inode*

The whole hammer code is mix of using struct and typedef'd.
Use typedef'd because majority of the code use typedef'd.

Summary of changes:
 sys/vfs/hammer/hammer.h | 26 +-
 sys/vfs/hammer/hammer_cursor.h  |  2 +-
 sys/vfs/hammer/hammer_inode.c   | 36 -
 sys/vfs/hammer/hammer_object.c  | 10 +++
 sys/vfs/hammer/hammer_ondisk.c  |  2 +-
 sys/vfs/hammer/hammer_recover.c |  2 +-
 sys/vfs/hammer/hammer_vfsops.c  |  4 +--
 sys/vfs/hammer/hammer_vnops.c   | 58 -
 8 files changed, 70 insertions(+), 70 deletions(-)

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Use typedef'd for struct hammer_record*

2016-08-28 Thread Tomohiro Kusumi

commit 877580d2b2c811ee7eac982b60bb451212f5a5e3
Author: Tomohiro Kusumi 
Date:   Sun Aug 28 18:10:42 2016 +0900

sys/vfs/hammer: Use typedef'd for struct hammer_record*

The whole hammer code is mix of using struct and typedef'd.
Use typedef'd because majority of the code use typedef'd.

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

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/877580d2b2c811ee7eac982b60bb451212f5a5e3


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Use typedef'd for struct hammer_io*

2016-08-28 Thread Tomohiro Kusumi

commit 6b48233965e93ded21fb2fa96d63ccbeb7ab24e5
Author: Tomohiro Kusumi 
Date:   Sun Aug 28 19:14:23 2016 +0900

sys/vfs/hammer: Use typedef'd for struct hammer_io*

The whole hammer code is mix of using struct and typedef'd.
Use typedef'd because majority of the code use typedef'd.

Summary of changes:
 sys/vfs/hammer/hammer.h| 22 +++---
 sys/vfs/hammer/hammer_io.c | 24 
 2 files changed, 23 insertions(+), 23 deletions(-)

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Use typedef'd for struct hammer_base_elm*

2016-08-28 Thread Tomohiro Kusumi

commit 5f532f105075a8fba3d7af3ad3f772b73466605f
Author: Tomohiro Kusumi 
Date:   Sun Aug 28 16:57:19 2016 +0900

sys/vfs/hammer: Use typedef'd for struct hammer_base_elm*

The whole hammer code is mix of using struct and typedef'd.
Use typedef'd because majority of the code use typedef'd.

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

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Use typedef'd for struct hammer_node_lock*

2016-08-28 Thread Tomohiro Kusumi

commit b59ba5b8894b79231c7277e76588f1f9bac7e7f3
Author: Tomohiro Kusumi 
Date:   Sun Aug 28 19:57:03 2016 +0900

sys/vfs/hammer: Use typedef'd for struct hammer_node_lock*

The whole hammer code is mix of using struct and typedef'd.
Use typedef'd because majority of the code use typedef'd.

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

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Use typedef'd for struct hammer_mount*

2016-08-28 Thread Tomohiro Kusumi

commit ba2be8e9e87a602a9fbaf1ac22c1bb205ffc7f74
Author: Tomohiro Kusumi 
Date:   Sun Aug 28 20:06:34 2016 +0900

sys/vfs/hammer: Use typedef'd for struct hammer_mount*

The whole hammer code is mix of using struct and typedef'd.
Use typedef'd because majority of the code use typedef'd.

The last 17 commits including this one don't affect binary.

Summary of changes:
 sys/vfs/hammer/hammer.h |  6 +++---
 sys/vfs/hammer/hammer_btree.c   |  6 +++---
 sys/vfs/hammer/hammer_dedup.c   |  2 +-
 sys/vfs/hammer/hammer_flusher.c |  2 +-
 sys/vfs/hammer/hammer_inode.c   |  2 +-
 sys/vfs/hammer/hammer_io.c  |  4 ++--
 sys/vfs/hammer/hammer_ioctl.c   |  2 +-
 sys/vfs/hammer/hammer_transaction.c |  6 +++---
 sys/vfs/hammer/hammer_vfsops.c  |  8 
 sys/vfs/hammer/hammer_vnops.c   |  4 ++--
 sys/vfs/hammer/hammer_volume.c  | 14 +++---
 11 files changed, 28 insertions(+), 28 deletions(-)

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Use typedef'd for struct hammer_buffer*

2016-08-28 Thread Tomohiro Kusumi

commit 562d34c292ec91ee006e90392b9e7188836da078
Author: Tomohiro Kusumi 
Date:   Sun Aug 28 19:50:24 2016 +0900

sys/vfs/hammer: Use typedef'd for struct hammer_buffer*

The whole hammer code is mix of using struct and typedef'd.
Use typedef'd because majority of the code use typedef'd.

Summary of changes:
 sys/vfs/hammer/hammer.h | 12 ++--
 sys/vfs/hammer/hammer_cursor.h  |  2 +-
 sys/vfs/hammer/hammer_ondisk.c  | 12 ++--
 sys/vfs/hammer/hammer_reblock.c |  2 +-
 sys/vfs/hammer/hammer_recover.c |  8 
 5 files changed, 18 insertions(+), 18 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/562d34c292ec91ee006e90392b9e7188836da078


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Remove prototypes for not existing functions

2016-08-28 Thread Tomohiro Kusumi

commit 61cc5b39f460184bfc023255d445c32c666a3acf
Author: Tomohiro Kusumi 
Date:   Sun Aug 28 19:23:52 2016 +0900

sys/vfs/hammer: Remove prototypes for not existing functions

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

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/61cc5b39f460184bfc023255d445c32c666a3acf


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Use typedef'd for struct hammer_volume*

2016-08-28 Thread Tomohiro Kusumi

commit a6b7735b68d59f9a727b8167c2bf972544b23aef
Author: Tomohiro Kusumi 
Date:   Sun Aug 28 19:22:07 2016 +0900

sys/vfs/hammer: Use typedef'd for struct hammer_volume*

The whole hammer code is mix of using struct and typedef'd.
Use typedef'd because majority of the code use typedef'd.

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

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Use typedef'd for struct hammer_node*

2016-08-28 Thread Tomohiro Kusumi

commit 56bbb8618b8b66ea6b5d5b10b4981b4248628643
Author: Tomohiro Kusumi 
Date:   Sun Aug 28 19:54:55 2016 +0900

sys/vfs/hammer: Use typedef'd for struct hammer_node*

The whole hammer code is mix of using struct and typedef'd.
Use typedef'd because majority of the code use typedef'd.

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

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/56bbb8618b8b66ea6b5d5b10b4981b4248628643


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Typedef struct on declaration

2016-08-28 Thread Tomohiro Kusumi

commit 22a0040d3aac58bb55b1291c4f1eec48599efb14
Author: Tomohiro Kusumi 
Date:   Sun Aug 28 22:27:20 2016 +0900

sys/vfs/hammer: Typedef struct on declaration

Most structs in hammer are typedef'd.
Some structs define it on declaration, but others don't.

Summary of changes:
 sys/vfs/hammer/hammer.h | 78 ++---
 sys/vfs/hammer/hammer_btree.h   | 30 ++--
 sys/vfs/hammer/hammer_cursor.h  |  6 ++--
 sys/vfs/hammer/hammer_disk.h| 57 +++---
 sys/vfs/hammer/hammer_flusher.c |  6 ++--
 sys/vfs/hammer/hammer_ioctl.h   | 12 +++
 6 files changed, 64 insertions(+), 125 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/22a0040d3aac58bb55b1291c4f1eec48599efb14


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Use typedef'd for enum hammer_io_type

2016-08-28 Thread Tomohiro Kusumi

commit 7251986aa271099d7bb5b6ea0a819493e91a001a
Author: Tomohiro Kusumi 
Date:   Sun Aug 28 23:08:01 2016 +0900

sys/vfs/hammer: Use typedef'd for enum hammer_io_type

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

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/7251986aa271099d7bb5b6ea0a819493e91a001a


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Remove unused struct hammer_io_list

2016-08-28 Thread Tomohiro Kusumi

commit 7af5c3a4176c403e17c4f1abff2c99daafc58c3b
Author: Tomohiro Kusumi 
Date:   Sun Aug 28 23:13:11 2016 +0900

sys/vfs/hammer: Remove unused struct hammer_io_list

This struct is no longer used after 1afb73cf in 2011.

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

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


-- 
DragonFly BSD source repository


git: sbin/hammer: Sync zone statistics format with print_blockmap()

2016-08-29 Thread Tomohiro Kusumi

commit be541fc2c0d68b64c5cde6cd238873487c83acf3
Author: Tomohiro Kusumi 
Date:   Mon Aug 29 20:16:39 2016 +0900

sbin/hammer: Sync zone statistics format with print_blockmap()

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

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


-- 
DragonFly BSD source repository


git: sbin/hammer: Fix irrelevant comments

2016-08-29 Thread Tomohiro Kusumi

commit f402100cbf6dcd3a007f949f82a88baab7d0324a
Author: Tomohiro Kusumi 
Date:   Mon Aug 29 20:24:14 2016 +0900

sbin/hammer: Fix irrelevant comments

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

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


-- 
DragonFly BSD source repository


git: sys/kern: Make struct buf::b_dep a member of union

2016-08-29 Thread Tomohiro Kusumi

commit 3dd1f60cc80ec027140207d223a7e0c26cd74336
Author: Tomohiro Kusumi 
Date:   Mon Aug 29 22:13:21 2016 +0900

sys/kern: Make struct buf::b_dep a member of union

struct buf::b_dep being a list head is too specific to UFS.
HAMMER or other filesystems want this to be a void* pointer.

It also forces HAMMER or other filesystems to define their own
struct worklist because no such struct is defined outside of
the UFS source which is insane in terms of a kernel structure
for general blk i/o.

Also see 71199586f.

Summary of changes:
 sys/sys/buf.h   |  5 -
 sys/vfs/hammer/hammer.h | 14 ++
 2 files changed, 6 insertions(+), 13 deletions(-)

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


-- 
DragonFly BSD source repository


git: sbin/hammer: Don't expose softprune specific data structure

2016-08-29 Thread Tomohiro Kusumi

commit ce6ddec9106a5835deb429382b0fa1a71d8172f4
Author: Tomohiro Kusumi 
Date:   Mon Aug 29 19:45:37 2016 +0900

sbin/hammer: Don't expose softprune specific data structure

Expose softprune function rather than both function and data structure.

Summary of changes:
 sbin/hammer/cmd_cleanup.c   | 10 --
 sbin/hammer/cmd_softprune.c | 34 --
 sbin/hammer/hammer.h|  4 +---
 sbin/hammer/hammer_util.h   |  9 -
 4 files changed, 37 insertions(+), 20 deletions(-)

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Add typedefs for ondisk structures without typedefs

2016-08-29 Thread Tomohiro Kusumi

commit 1743d7babe28b0fac7867da2e5ce389079cde1e3
Author: Tomohiro Kusumi 
Date:   Tue Aug 30 00:10:18 2016 +0900

sys/vfs/hammer: Add typedefs for ondisk structures without typedefs

Some ondisk data structures have typedefs, but others don't.

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

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/1743d7babe28b0fac7867da2e5ce389079cde1e3


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Use typedef'd for struct hammer_inode_data*

2016-08-29 Thread Tomohiro Kusumi

commit 71db84daa26878d248143cbf8b50553f4a49232d
Author: Tomohiro Kusumi 
Date:   Tue Aug 30 00:28:02 2016 +0900

sys/vfs/hammer: Use typedef'd for struct hammer_inode_data*

The whole hammer code is mix of using struct and typedef'd.
Use typedef'd because majority of the code use typedef'd.

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

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/71db84daa26878d248143cbf8b50553f4a49232d


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Use typedef'd for struct hammer_snapshot_data*

2016-08-29 Thread Tomohiro Kusumi

commit 46e9f340df345f7c34ed9964375c50976a26638e
Author: Tomohiro Kusumi 
Date:   Tue Aug 30 00:25:28 2016 +0900

sys/vfs/hammer: Use typedef'd for struct hammer_snapshot_data*

The whole hammer code is mix of using struct and typedef'd.
Use typedef'd because majority of the code use typedef'd.

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

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/46e9f340df345f7c34ed9964375c50976a26638e


-- 
DragonFly BSD source repository


git: sbin/hammer: Don't expose VolList

2016-08-31 Thread Tomohiro Kusumi

commit 173bd31c83fbfedc86f124cfc05cd7a9227d3839
Author: Tomohiro Kusumi 
Date:   Tue Aug 30 21:54:29 2016 +0900

sbin/hammer: Don't expose VolList

This is just a cleanup to hide a volume list data itself from
each hammer command (actually only hammer recover command).
Use whatever apis provided instead of raw access to data.

Volume initialization part of hammer recover needs to be fixed
anyway. It needs to allow a broken header (at least to certain
extent) given that the purpose of this command is to recover
from a broken filesystem. It currently forces all the sanity
checks on volume header.

Summary of changes:
 sbin/hammer/cmd_recover.c |  6 +-
 sbin/hammer/hammer_util.h |  3 ---
 sbin/hammer/ondisk.c  | 15 ++-
 3 files changed, 15 insertions(+), 9 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/173bd31c83fbfedc86f124cfc05cd7a9227d3839


-- 
DragonFly BSD source repository


git: sbin/hammer: Make struct volume_info::name const

2016-09-01 Thread Tomohiro Kusumi

commit 21000e424c0824b5ee3445a3eea54959ee3c3b39
Author: Tomohiro Kusumi 
Date:   Thu Sep 1 20:27:45 2016 +0900

sbin/hammer: Make struct volume_info::name const

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

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/21000e424c0824b5ee3445a3eea54959ee3c3b39


-- 
DragonFly BSD source repository


git: sbin/hammer: Make use of struct buffer_info::cache at offset 0

2016-09-01 Thread Tomohiro Kusumi

commit 7603683a7d0f9b3ed823c273b74d9279904f82e2
Author: Tomohiro Kusumi 
Date:   Thu Sep 1 20:38:36 2016 +0900

sbin/hammer: Make use of struct buffer_info::cache at offset 0

No need to hold a pointer to each other.

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

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/7603683a7d0f9b3ed823c273b74d9279904f82e2


-- 
DragonFly BSD source repository


git: sbin/hammer: Remove hammer_cache_set()

2016-09-02 Thread Tomohiro Kusumi

commit 6c7ae023122453a991a69a6ffa9c457d02a8552e
Author: Tomohiro Kusumi 
Date:   Fri Sep 2 21:15:09 2016 +0900

sbin/hammer: Remove hammer_cache_set()

Summary of changes:
 sbin/hammer/cache.c   | 9 ++---
 sbin/hammer/hammer_util.h | 1 -
 2 files changed, 2 insertions(+), 8 deletions(-)

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


-- 
DragonFly BSD source repository


git: sbin/hammer: Move pidfile_loc[] to hammer.h

2016-09-02 Thread Tomohiro Kusumi

commit 6d52f9f2b73b3feb44d1e47915cbdd9ee0e345c9
Author: Tomohiro Kusumi 
Date:   Fri Sep 2 21:48:15 2016 +0900

sbin/hammer: Move pidfile_loc[] to hammer.h

It's more appropriate to define this in hammer.h than hammer_util.h,
as this string is only used by /sbin/hammer commands.

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

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


-- 
DragonFly BSD source repository


git: sbin/hammer: Always call check_volume()

2016-09-02 Thread Tomohiro Kusumi

commit 0e777cf7d155dda39e738bb50e58d8dc61507ad4
Author: Tomohiro Kusumi 
Date:   Fri Sep 2 22:10:33 2016 +0900

sbin/hammer: Always call check_volume()

Calling ioctl(DIOCGPART) isn't any overhead compared to i/o workload,
so always just retrieve all the volume info whenever volume_info is
allocated rather than each command calling it on demand.

Summary of changes:
 sbin/hammer/cmd_recover.c| 1 -
 sbin/hammer/cmd_volume.c | 1 -
 sbin/hammer/hammer_util.h| 1 -
 sbin/hammer/ondisk.c | 8 +++-
 sbin/newfs_hammer/newfs_hammer.c | 6 --
 5 files changed, 3 insertions(+), 14 deletions(-)

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


-- 
DragonFly BSD source repository


git: sbin/hammer: Make blockmap.c/misc.c include hammer_util.h (not hammer.h)

2016-09-02 Thread Tomohiro Kusumi

commit 4c18cb161b29d3f9e9aecdc19b86dde4fd997703
Author: Tomohiro Kusumi 
Date:   Fri Sep 2 21:37:25 2016 +0900

sbin/hammer: Make blockmap.c/misc.c include hammer_util.h (not hammer.h)

If a file is to be linked from non /sbin/hammer (i.e. /sbin/newfs_hammer)
include hammer_util.h, but not hammer.h.

That's basically how things are defined in these two headers.

Summary of changes:
 sbin/hammer/blockmap.c | 2 +-
 sbin/hammer/misc.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

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


-- 
DragonFly BSD source repository


git: sbin/hammer: Cleanup struct volume_info

2016-09-02 Thread Tomohiro Kusumi

commit 684002f258d19ff41c5e29f6ebc20560340ab598
Author: Tomohiro Kusumi 
Date:   Fri Sep 2 23:08:45 2016 +0900

sbin/hammer: Cleanup struct volume_info

Mention vol_free_off,beg are initialized only by /sbin/newfs_hammer.
(i.e. these two are 0 when running /sbin/hammer)

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

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/684002f258d19ff41c5e29f6ebc20560340ab598


-- 
DragonFly BSD source repository


git: sbin/hammer: Add assert_volume_offset()

2016-09-02 Thread Tomohiro Kusumi

commit 9221b5983f165c1cf10be28424138e02a1788207
Author: Tomohiro Kusumi 
Date:   Sat Sep 3 12:19:32 2016 +0900

sbin/hammer: Add assert_volume_offset()

It's invalid to call functions that are based on vol_free_off/end
values unless these are properly initialized with zone-2 offsets.

Summary of changes:
 sbin/hammer/blockmap.c|  1 +
 sbin/hammer/hammer_util.h |  1 +
 sbin/hammer/ondisk.c  | 11 +++
 3 files changed, 13 insertions(+)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/9221b5983f165c1cf10be28424138e02a1788207


-- 
DragonFly BSD source repository


git: sbin/hammer: Use int64_t for zone stats blocks/items/used

2016-09-02 Thread Tomohiro Kusumi

commit 138468249e4de02a78089ba5cad461b940b16028
Author: Tomohiro Kusumi 
Date:   Sat Sep 3 11:58:45 2016 +0900

sbin/hammer: Use int64_t for zone stats blocks/items/used

Summary of changes:
 sbin/hammer/hammer_util.h |  8 
 sbin/hammer/misc.c| 15 +++
 2 files changed, 11 insertions(+), 12 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/138468249e4de02a78089ba5cad461b940b16028


-- 
DragonFly BSD source repository


git: sbin/hammer: Don't use hard-coded 1024 for # of layer1 per volume

2016-09-02 Thread Tomohiro Kusumi

commit 27242c33963bfcfd2b1ffb731fe2a89684a98537
Author: Tomohiro Kusumi 
Date:   Sat Sep 3 12:07:14 2016 +0900

sbin/hammer: Don't use hard-coded 1024 for # of layer1 per volume

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

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/27242c33963bfcfd2b1ffb731fe2a89684a98537


-- 
DragonFly BSD source repository


git: sbin/hammer: Remove default volume initialization from alloc_bigblock()

2016-09-02 Thread Tomohiro Kusumi

commit a2cc732ccbf1e41343a3698b4cc5000c78dae5df
Author: Tomohiro Kusumi 
Date:   Sat Sep 3 14:11:18 2016 +0900

sbin/hammer: Remove default volume initialization from alloc_bigblock()

No one calls this with NULL when allocating a big-block for
one of the HAMMER volumes. A caller certainly has a pointer
to that volume. It should also be explicit.

Summary of changes:
 sbin/hammer/blockmap.c | 3 ---
 1 file changed, 3 deletions(-)

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Remove HAMMER_RECTYPE_LOWEST

2016-09-03 Thread Tomohiro Kusumi

commit 332c168f54858ea5f247f34a317ffaf82d6b9829
Author: Tomohiro Kusumi 
Date:   Sat Sep 3 16:48:31 2016 +0900

sys/vfs/hammer: Remove HAMMER_RECTYPE_LOWEST

No one needs the non-zero lowest rectype to be defined,
though the maximum possible (0x) is used on lookup.

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

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/332c168f54858ea5f247f34a317ffaf82d6b9829


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Fix comment on lo in direntry

2016-09-03 Thread Tomohiro Kusumi

commit 8ee2162490613df7708c851959ebbd367d3722e5
Author: Tomohiro Kusumi 
Date:   Sat Sep 3 17:08:18 2016 +0900

sys/vfs/hammer: Fix comment on lo in direntry

lo field in direntry actually has PFS# in its upper 16 bits,
and there's no alternative behavior, so remove "possible to".

Also see hammer_ip_add_direntry().

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

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Fix numbering of reserved fields for vol0

2016-09-03 Thread Tomohiro Kusumi

commit 2283716341f28f9d1c7f5d9049e8dd5572fdd86b
Author: Tomohiro Kusumi 
Date:   Sat Sep 3 18:33:44 2016 +0900

sys/vfs/hammer: Fix numbering of reserved fields for vol0

Make vol0_reserved fields start from 00.

Reserved fields in volume header aren't in order from 00 to 11,
so it's not really important to keep whatever numbers assigned.

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

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/2283716341f28f9d1c7f5d9049e8dd5572fdd86b


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Fix confusing comment

2016-09-03 Thread Tomohiro Kusumi

commit 8cf688a796ff27fcb4a6873aeb7a9989e6ad0dd0
Author: Tomohiro Kusumi 
Date:   Sat Sep 3 18:27:51 2016 +0900

sys/vfs/hammer: Fix confusing comment

This part is talking about hdr_seq in struct hammer_fifo_head.

It's confusing unless one is looking at it along with 02428fb6
which contains a diff that replaces reserved01 with hdr_seq.

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

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Integrate ondisk reserved fields and unused fields

2016-09-03 Thread Tomohiro Kusumi

commit 77f7bc0a0ce69f98f64c7b94e13e0b0d87ba4069
Author: Tomohiro Kusumi 
Date:   Sat Sep 3 19:53:02 2016 +0900

sys/vfs/hammer: Integrate ondisk reserved fields and unused fields

In addition to the previous commit, we could reassign the whole
numbering for reserved/unused fields since HAMMER1 ondisk format
has basically been fixed for years.

Integrate unusedXX fields into the existing reservedXX fields,
where XX starts from 01. Nothing changes (and shouldn't change)
in terms of ondisk format.

Summary of changes:
 sys/vfs/hammer/hammer_btree.h | 12 ++--
 sys/vfs/hammer/hammer_disk.h  | 14 +++---
 sys/vfs/hammer/hammer_ioctl.h | 18 +-
 3 files changed, 22 insertions(+), 22 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/77f7bc0a0ce69f98f64c7b94e13e0b0d87ba4069


-- 
DragonFly BSD source repository


git: sbin/hammer: Remove unused zone field in struct zone_stat

2016-09-03 Thread Tomohiro Kusumi

commit 31222e7c2720297fef432918f853b83ea91287db
Author: Tomohiro Kusumi 
Date:   Sat Sep 3 21:38:47 2016 +0900

sbin/hammer: Remove unused zone field in struct zone_stat

Zone statistics' init api returns a pointer to calloc'd array
where an index represents zone itself, so this zone field isn't
necessary as the comment says it's unused.

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

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/31222e7c2720297fef432918f853b83ea91287db


-- 
DragonFly BSD source repository


git: sbin/newfs_hammer: Don't bother initializing reserved ondisk field

2016-09-03 Thread Tomohiro Kusumi

commit c3cfd6ce08cb747fafb51f0719dce5883456e62d
Author: Tomohiro Kusumi 
Date:   Sat Sep 3 21:59:53 2016 +0900

sbin/newfs_hammer: Don't bother initializing reserved ondisk field

pfsd is bzero'd, so no need to explicitly zero clear a reserved field
that isn't used for anything.

The numbering for reserved fields has been reassigned in 77f7bc0a
so as to cleanup mixed up name and numbering, based on the fact
that reserved fields are not touched by anyone *except* for this.
Doesn't break anything, but it should still just not care about it.

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

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


-- 
DragonFly BSD source repository


git: sbin/newfs_hammer: Cleanup

2016-09-03 Thread Tomohiro Kusumi

commit 4d8a23489695ade9247e1595bf006757f6a9ea7d
Author: Tomohiro Kusumi 
Date:   Sun Sep 4 00:11:44 2016 +0900

sbin/newfs_hammer: Cleanup

Summary of changes:
 sbin/newfs_hammer/newfs_hammer.c | 8 +---
 sys/vfs/hammer/hammer_btree.h| 2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

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


-- 
DragonFly BSD source repository


git: sbin/hammer: Use HAMMER_ENTRY_NAME_OFF

2016-09-04 Thread Tomohiro Kusumi

commit 2252fcf8fc2686e284149aca36affe101d29dfc7
Author: Tomohiro Kusumi 
Date:   Sun Sep 4 13:24:16 2016 +0900

sbin/hammer: Use HAMMER_ENTRY_NAME_OFF

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

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/2252fcf8fc2686e284149aca36affe101d29dfc7


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Make the existing CRC functions inline

2016-09-04 Thread Tomohiro Kusumi

commit 87d99cc5c1948919c108eef7a55591be4de9c1e2
Author: Tomohiro Kusumi 
Date:   Sun Sep 4 20:11:39 2016 +0900

sys/vfs/hammer: Make the existing CRC functions inline

Summary of changes:
 sys/vfs/hammer/hammer.h  | 65 
 sys/vfs/hammer/hammer_subs.c | 46 ---
 2 files changed, 53 insertions(+), 58 deletions(-)

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Add inline CRC functions hammer_crc_get_xxx()

2016-09-04 Thread Tomohiro Kusumi

commit c577aa50f5b320b86dc9ec1656662e10dc872776
Author: Tomohiro Kusumi 
Date:   Sun Sep 4 14:50:21 2016 +0900

sys/vfs/hammer: Add inline CRC functions hammer_crc_get_xxx()

in addition to the existing hammer_crc_set_xxx() and hammer_crc_test_xxx().
Reduces overly duplicated crc32(&..., HAMMER_XXX_CRCSIZE);.

The only functional difference is that hammer_crc_test_leaf()
now compares (leaf->data_crc == 0) if hammer_crc_get_leaf()
returns 0 for inode whose length is not sizeof(hammer_inode_data).
It previously directly returned false for this case.

It is still expected that (leaf->data_crc == 0) would be false,
however inode size (not file size, but the size of inode itself)
other than sizeof(hammer_inode_data) is wrong which shouldn't
happen in the first place. hammer_crc_set_leaf() has assertion
for this like it did before, but only if INVARIANTS is set.

Summary of changes:
 sys/vfs/hammer/hammer.h  | 49 -
 sys/vfs/hammer/hammer_subs.c | 65 
 2 files changed, 59 insertions(+), 55 deletions(-)

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Add inline CRC functions for layer1/2

2016-09-04 Thread Tomohiro Kusumi

commit 961b3eecbd8f482aa0ee049c5086153190dfe532
Author: Tomohiro Kusumi 
Date:   Sun Sep 4 20:45:20 2016 +0900

sys/vfs/hammer: Add inline CRC functions for layer1/2

Summary of changes:
 sys/vfs/hammer/hammer.h  | 36 ++
 sys/vfs/hammer/hammer_blockmap.c | 79 
 sys/vfs/hammer/hammer_volume.c   |  8 ++--
 3 files changed, 79 insertions(+), 44 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/961b3eecbd8f482aa0ee049c5086153190dfe532


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Add inline CRC functions for undo/redo fifo head

2016-09-05 Thread Tomohiro Kusumi

commit e027fd447240b399683c7d7a71542a19c089db37
Author: Tomohiro Kusumi 
Date:   Mon Sep 5 22:24:32 2016 +0900

sys/vfs/hammer: Add inline CRC functions for undo/redo fifo head

Note that undo->head is at offset 0 of undo,
and the same for redo->head.

Summary of changes:
 sys/vfs/hammer/hammer.h | 19 +++
 sys/vfs/hammer/hammer_recover.c |  3 +--
 sys/vfs/hammer/hammer_redo.c|  3 +--
 sys/vfs/hammer/hammer_undo.c|  9 +++--
 4 files changed, 24 insertions(+), 10 deletions(-)

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Add inline CRC functions for mrec head

2016-09-05 Thread Tomohiro Kusumi

commit d8fe5ece28a3e0a81946b00e32c958101b2a1233
Author: Tomohiro Kusumi 
Date:   Mon Sep 5 22:40:18 2016 +0900

sys/vfs/hammer: Add inline CRC functions for mrec head

Summary of changes:
 sys/vfs/hammer/hammer.h| 18 ++
 sys/vfs/hammer/hammer_mirror.c | 10 +++---
 2 files changed, 21 insertions(+), 7 deletions(-)

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Add sys/vfs/hammer/hammer_crc.h

2016-09-06 Thread Tomohiro Kusumi

commit 8856c8bd6cbcd6c533c080374ed9303015471d17
Author: Tomohiro Kusumi 
Date:   Mon Sep 5 23:34:53 2016 +0900

sys/vfs/hammer: Add sys/vfs/hammer/hammer_crc.h

HAMMER's CRC functions currently defined in sys/vfs/hammer/hammer.h
could be exposed to userspace, since CRCs in various ondisk data
structures are a part of HAMMER's ondisk format. In fact, userspace
has a copy-pasted function from kernel code.

This commit adds a new file sys/vfs/hammer/hammer_crc.h for both
kernel and userspace. CRC functions are moved to this file.

The reason for adding a new file instead of adding these inlined
functions to hammer_{disk,btree,ioctl}.h is because crc32() requires
explicit function prototype in userspace.
(i.e. causes include order issues by userspace headers)

Having function prototypes in hammer_{disk,btree}.h should also be
avoided, because that brings in unnecessary dependencies that could
be avoided for headers for ondisk format.

Summary of changes:
 sys/vfs/hammer/hammer.h | 176 +-
 sys/vfs/hammer/hammer_crc.h | 224 
 usr.bin/fstat/hammer.c  |   1 +
 3 files changed, 226 insertions(+), 175 deletions(-)
 create mode 100644 sys/vfs/hammer/hammer_crc.h

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/8856c8bd6cbcd6c533c080374ed9303015471d17


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Change HAMMER_VOLUME_NUMBER_XXX macros to inline functions

2016-09-06 Thread Tomohiro Kusumi

commit 75e4d787861504e083f572d48305f9f2b450d270
Author: Tomohiro Kusumi 
Date:   Tue Sep 6 19:56:44 2016 +0900

sys/vfs/hammer: Change HAMMER_VOLUME_NUMBER_XXX macros to inline functions

I've added these macros in 78249d7f in 2015 for a bug fix,
but these macros should have been inline functions.
Not very readable.

Summary of changes:
 sys/vfs/hammer/hammer.h| 51 +-
 sys/vfs/hammer/hammer_ondisk.c |  4 ++--
 sys/vfs/hammer/hammer_volume.c |  2 +-
 3 files changed, 39 insertions(+), 18 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/75e4d787861504e083f572d48305f9f2b450d270


-- 
DragonFly BSD source repository


git: sbin/hammer: Use inline CRC functions in userspace

2016-09-06 Thread Tomohiro Kusumi

commit 4564396607ddbe09b2e35670c46054c9222300d4
Author: Tomohiro Kusumi 
Date:   Mon Sep 5 23:45:34 2016 +0900

sbin/hammer: Use inline CRC functions in userspace

Remove crc32 prototypes in sbin/hammer/hammer_util.h.
Remove hammer_crc_test_leaf() which is a copy-pasted function
from kernel code.

Summary of changes:
 sbin/hammer/blockmap.c   |  8 
 sbin/hammer/cmd_blockmap.c   |  8 +++-
 sbin/hammer/cmd_mirror.c | 11 +++
 sbin/hammer/cmd_recover.c|  2 +-
 sbin/hammer/cmd_show.c   |  4 ++--
 sbin/hammer/hammer_util.h|  6 +-
 sbin/hammer/misc.c   | 22 --
 sbin/hammer/ondisk.c | 18 --
 sbin/newfs_hammer/newfs_hammer.c |  6 +++---
 9 files changed, 25 insertions(+), 60 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/4564396607ddbe09b2e35670c46054c9222300d4


-- 
DragonFly BSD source repository


git: sbin/hammer: Refactoring

2016-09-08 Thread Tomohiro Kusumi

commit f831b060481917353935e6e1ab40a4302c523ed7
Author: Tomohiro Kusumi 
Date:   Thu Sep 8 21:22:44 2016 +0900

sbin/hammer: Refactoring

fd is < 0 only when both scanpfs() and open(2) failed.

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

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


-- 
DragonFly BSD source repository


git: sbin/hammer: Return -1 if readlink(2) failed

2016-09-08 Thread Tomohiro Kusumi

commit 40649c3e1265748cc5756251898a317c1f124999
Author: Tomohiro Kusumi 
Date:   Thu Sep 8 21:24:10 2016 +0900

sbin/hammer: Return -1 if readlink(2) failed

If the path is a link and readlink(2) failed, it shouldn't continue
with empty buf[].

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

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/40649c3e1265748cc5756251898a317c1f124999


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Remove wrong comment

2016-09-08 Thread Tomohiro Kusumi

commit 5bfc3998ec7749317f5d14e0f8dade07239eb164
Author: Tomohiro Kusumi 
Date:   Fri Sep 9 01:07:09 2016 +0900

sys/vfs/hammer: Remove wrong comment

This comment is true for other ioctls, but not for HAMMERIOC_SET_PSEUDOFS.

hammer_mkroot_pseudofs() uses this ip to make sure localization
equals that of PFS#0. In other words, a new PFS can only be created
under PFS#0.

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

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


-- 
DragonFly BSD source repository


git: sys/vfs/hammer: Change unused PFS ioctl flag to reserved

2016-09-09 Thread Tomohiro Kusumi

commit f659d161e2868365eac3a54729b5711cca7aec9e
Author: Tomohiro Kusumi 
Date:   Sat Sep 10 02:02:28 2016 +0900

sys/vfs/hammer: Change unused PFS ioctl flag to reserved

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

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


-- 
DragonFly BSD source repository


git: sbin/hammer: Add clrpfs()

2016-09-09 Thread Tomohiro Kusumi

commit 1b23fc226632a6152a2060520576b99cd3f876ac
Author: Tomohiro Kusumi 
Date:   Sat Sep 10 01:00:24 2016 +0900

sbin/hammer: Add clrpfs()

The one in getpfs() is okay to clear pfs_id with -1,
because scanpfsid() will overwrite pfs_id without using it.

It's also okay to clear the whole &pfs before init_pfsd().
This is actually better than not clearing header part.

Summary of changes:
 sbin/hammer/cmd_cleanup.c   |  5 +
 sbin/hammer/cmd_mirror.c| 18 --
 sbin/hammer/cmd_pfs.c   | 40 +---
 sbin/hammer/cmd_snapshot.c  |  6 +-
 sbin/hammer/cmd_softprune.c |  6 +-
 sbin/hammer/hammer.h|  2 ++
 6 files changed, 30 insertions(+), 47 deletions(-)

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


-- 
DragonFly BSD source repository


git: sys/dev/disk/dm: Remove #if0'd dmminphys() from NetBSD

2016-10-01 Thread Tomohiro Kusumi

commit 338bb82bb1ae130b78e5c921f12dd94ce3f2c570
Author: Tomohiro Kusumi 
Date:   Wed Sep 21 11:36:51 2016 +0900

sys/dev/disk/dm: Remove #if0'd dmminphys() from NetBSD

This is specific to NetBSD, so we can remove this.

Summary of changes:
 sys/dev/disk/dm/device-mapper.c | 12 
 1 file changed, 12 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/338bb82bb1ae130b78e5c921f12dd94ce3f2c570


-- 
DragonFly BSD source repository


git: sys/dev/disk/dm: Remove default:break for switch enums on kldload

2016-10-01 Thread Tomohiro Kusumi

commit 2ca885947e0db8ea30fa720049322079657b1c6c
Author: Tomohiro Kusumi 
Date:   Sun Oct 2 06:20:55 2016 +0900

sys/dev/disk/dm: Remove default:break for switch enums on kldload

This could be reverted as compilers may warn if not all enum elements
are covered, but some dm targets don't have default case on loading,
and it's been working. Compiles with LINT64.

Summary of changes:
 sys/dev/disk/dm/device-mapper.c | 3 ---
 sys/dev/disk/dm/dm_target_error.c   | 3 ---
 sys/dev/disk/dm/dm_target_zero.c| 3 ---
 sys/dev/disk/dm/targets/crypt/dm_target_crypt.c | 3 ---
 sys/dev/disk/dm/targets/linear/dm_target_linear.c   | 3 ---
 sys/dev/disk/dm/targets/striped/dm_target_striped.c | 3 ---
 6 files changed, 18 deletions(-)

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


-- 
DragonFly BSD source repository


git: sys/dev/disk/dm: Cleanup

2016-10-01 Thread Tomohiro Kusumi

commit 0b985ce1074ab29e1e5a26e94e2823dee61a3e21
Author: Tomohiro Kusumi 
Date:   Wed Sep 21 11:29:49 2016 +0900

sys/dev/disk/dm: Cleanup

Summary of changes:
 sys/dev/disk/dm/device-mapper.c | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

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


-- 
DragonFly BSD source repository


git: sbin/hammer: Make get_node() a wrapper over get_buffer_data()

2016-10-06 Thread Tomohiro Kusumi

commit 38f16a2db7941071123ee36370ebf6b74503a0c1
Author: Tomohiro Kusumi 
Date:   Mon Sep 26 07:20:44 2016 +0900

sbin/hammer: Make get_node() a wrapper over get_buffer_data()

get_node() which is only used by hammer show/blockmap commands should
be a wrapper over the existing get_buffer_data().

It needs to do rel_buffer() if the given offset is out of range when
*bufferp is non NULL. Adding this check makes this function equivalent
of get_buffer_data() with 0 for isnew. isnew must be 0 because this
function assumes and only works when the B-Tree node already exists.

This doesn't change anything because hammer show/blockmap always give
NULL for *bufferp, but it should still be changed.

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

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/38f16a2db7941071123ee36370ebf6b74503a0c1


-- 
DragonFly BSD source repository


git: sbin/hammer: Remove get_ondisk() after previous commits

2016-10-06 Thread Tomohiro Kusumi

commit 22b23697054400f59703e2cb16ce000a04661880
Author: Tomohiro Kusumi 
Date:   Mon Sep 26 09:52:20 2016 +0900

sbin/hammer: Remove get_ondisk() after previous commits

After the previous commits, a static function get_ondisk() is only
used by get_buffer_data() which is a function for arbitrary ondisk
data, so it can simply be a part of get_buffer_data().

Summary of changes:
 sbin/hammer/ondisk.c | 11 ---
 1 file changed, 11 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/22b23697054400f59703e2cb16ce000a04661880


-- 
DragonFly BSD source repository


git: sbin/hammer: Remove get_node()

2016-10-06 Thread Tomohiro Kusumi

commit 1ba4249f8f732d0a963a13b94b8164b6eb55809a
Author: Tomohiro Kusumi 
Date:   Mon Sep 26 09:51:45 2016 +0900

sbin/hammer: Remove get_node()

Just call get_data_buffer(offset, &buffer, 0) like other data do.

Summary of changes:
 sbin/hammer/cmd_blockmap.c |  2 +-
 sbin/hammer/cmd_show.c |  6 +++---
 sbin/hammer/hammer_util.h  |  3 ---
 sbin/hammer/ondisk.c   | 10 --
 4 files changed, 4 insertions(+), 17 deletions(-)

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


-- 
DragonFly BSD source repository


git: sbin/hammer: Rename alloc_btree_element() to alloc_btree_node()

2016-10-06 Thread Tomohiro Kusumi

commit 73eb8826d5aeb338045fe64ec37fb25ba0ec115a
Author: Tomohiro Kusumi 
Date:   Mon Sep 26 10:22:50 2016 +0900

sbin/hammer: Rename alloc_btree_element() to alloc_btree_node()

Make it clear that it's allocating a 4KB node, but not elm part.
Also change return type to hammer_node_ondisk_t.
Don't need to cast to void* on returning.

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

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/73eb8826d5aeb338045fe64ec37fb25ba0ec115a


-- 
DragonFly BSD source repository


git: sbin/hammer: Move hammer_btree_cmp() to cmd_show.c

2016-10-06 Thread Tomohiro Kusumi

commit 28b9bac335cf6f1ad6d83be8f2c08af8a921afb3
Author: Tomohiro Kusumi 
Date:   Mon Sep 26 10:39:57 2016 +0900

sbin/hammer: Move hammer_btree_cmp() to cmd_show.c

This function isn't necessary in userspace unless a command wants
to walk through the B-Tree. The only hammer command that needs to
do this is hammer show, so make it a static function of hammer show
just like other node/elm related functions are static.

This is a copy-pasted function from sys/vfs/hammer/hammer_btree.c,
but keep it copy-pasted code without having it as an static inline
function in hammer_btree.h, as it has bunch of conditionals that
make asm of a caller unreadable.

Summary of changes:
 sbin/hammer/cmd_show.c| 41 
 sbin/hammer/hammer_util.h |  1 -
 sbin/hammer/misc.c| 48 ---
 3 files changed, 41 insertions(+), 49 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/28b9bac335cf6f1ad6d83be8f2c08af8a921afb3


-- 
DragonFly BSD source repository


git: sbin/hammer: Sync return value of test_btree_search() with hammer_btree_cmp()

2016-10-06 Thread Tomohiro Kusumi

commit 9a4f151e2be289fe8ce42c16113ead4b47513246
Author: Tomohiro Kusumi 
Date:   Tue Sep 27 01:26:55 2016 +0900

sbin/hammer: Sync return value of test_btree_search() with 
hammer_btree_cmp()

Sync with the previous commit.
Doesn't change anything as all it matters is whether it's + or - or 0.

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

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


-- 
DragonFly BSD source repository


git: sbin/hammer: Remove redundant ioctl(GET_PSEUDOFS) call in getpfs()

2016-10-06 Thread Tomohiro Kusumi

commit ec206eb9d5e9317a7365a123f0b28947d257e176
Author: Tomohiro Kusumi 
Date:   Wed Sep 21 09:18:55 2016 +0900

sbin/hammer: Remove redundant ioctl(GET_PSEUDOFS) call in getpfs()

If scanpfsid() failed, it needs to try to open(2) the path whether
it's a symlink or a file or a directory, but it needs not to call
ioctl(GET_PSEUDOFS) which gets called right after this anyway.

The error message "Cannot access PFS" is misleading too, because
once scanpfsid() fails, the path isn't necessarily a PFS or a symlink
to a PFS.

Also note that calling this ioctl with -1 set to pfs.pfs_id is okay.
In that case, the ioctl will try to detect the PFS id based on fd.

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

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


-- 
DragonFly BSD source repository


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