History log of /dragonfly/sbin/hammer/cmd_volume.c (Results 1 – 25 of 29)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: v6.2.1, v6.2.0, v6.3.0, v6.0.1, v6.0.0, v6.0.0rc1, v6.1.0, v5.8.3, v5.8.2, v5.8.1, v5.8.0, v5.9.0, v5.8.0rc1, v5.6.3, v5.6.2, v5.6.1, v5.6.0, v5.6.0rc1, v5.7.0, v5.4.3, v5.4.2, v5.4.1, v5.4.0, v5.5.0, v5.4.0rc1, v5.2.2, v5.2.1, v5.2.0, v5.3.0, v5.2.0rc, v5.0.2, v5.0.1, v5.0.0, v5.0.0rc2, v5.1.0, v5.0.0rc1
# 1ec4d15f 24-Sep-2017 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sbin/hammer: Fix strncpy(3) length

The last one is ok, but HAMMER userspace doesn't use strl variants
except for this, then just use strncpy(3) for better portability.


Revision tags: v4.8.1
# 2dba5fa7 12-Apr-2017 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sbin/*hammer: Use typedef'd for struct volume_info*

This is a part of series of commits started from 21e9e7d5ff in 2016.
This is for userspace.


# 052fd72b 11-Apr-2017 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sbin/hammer: Add /* not reached */

that were originally missing.
Recommended by dillon@.
No diff in sbin/hammer binary when assert(3) is disabled.


# 06a1d31f 11-Apr-2017 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sbin/hammer: Add is_regfile() (avoid directly using a string literal)


# f254e677 10-Apr-2017 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sbin/hammer: Partly bring back removed braces from 52e2f1b5

based on comments from dillon@.

(dillon) three types, yah. (1) multi-line condition in if(), (2) if TRUE or FALSE body spans more than o

sbin/hammer: Partly bring back removed braces from 52e2f1b5

based on comments from dillon@.

(dillon) three types, yah. (1) multi-line condition in if(), (2) if TRUE or FALSE body spans more than one line, put braces around both
(dillon) (including if a comment is part of the body)

show more ...


# 52e2f1b5 09-Apr-2017 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sbin/hammer: Cleanup blocks with a single statement

This commit basically does the same as what Linux kernel's coding
style mentions for braces, which is basically the same with BSDs.
https://github

sbin/hammer: Cleanup blocks with a single statement

This commit basically does the same as what Linux kernel's coding
style mentions for braces, which is basically the same with BSDs.
https://github.com/torvalds/linux/blob/master/Documentation/process/coding-style.rst#3-placing-braces-and-spaces

No diff in sbin/hammer/hammer binary when assert(3) is disabled.

show more ...


Revision tags: v4.8.0, v4.6.2, v4.9.0, v4.8.0rc
# 5ebff42a 09-Mar-2017 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sbin/hammer: Have consistent naming for volume variables

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


# 02318f07 15-Dec-2016 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sbin/hammer: Change fprintf/exit to err variants [2/2]

Change
fprintf(stderr, ...); exit(1);
and
perror(...); exit(1);
to
err(1, ...) or errx(1, ...);
where possible for consistency.

This commit is

sbin/hammer: Change fprintf/exit to err variants [2/2]

Change
fprintf(stderr, ...); exit(1);
and
perror(...); exit(1);
to
err(1, ...) or errx(1, ...);
where possible for consistency.

This commit is just conversion to err(3) variants.
Messages themselves are not changed, except for removing
strerror(errno) for err(3), and removing trailing \n,
though err variants add program name in the messages.

err(3) and variants are non standard BSD functions, but HAMMER
userspace has been using BSD stuff aside from the existing
err/errx. Also note that err(3) is available in Linux as well.

show more ...


# fa9d9a9c 04-Dec-2016 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sbin/hammer: Add "[y/n]" before getyn()


# 3e7805d7 29-Oct-2016 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sys/vfs/hammer: Rename mem_area_size to memory_log_size

The name of this field has been "memory area size" ever since it
was added in 90ecab35 in 2009, but rename it to "memory log size"
since this

sys/vfs/hammer: Rename mem_area_size to memory_log_size

The name of this field has been "memory area size" ever since it
was added in 90ecab35 in 2009, but rename it to "memory log size"
since this is the real name for this field.
(see stdout of newfs_hammer and newfs_hammer(8))

This commit changes a name of ioctl structure field, but doesn't
affect or break userspace, as the ioctl is only used or usable by
hammer volume-add command.

show more ...


Revision tags: v4.6.1
# 385a0260 15-Oct-2016 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sbin/hammer: Cleanup arguments of init_volume()

Change the order of arguments to make the i/f similar to open(2)
as well as load_volume().

This is only for newfs (and volume-add), nothing else gets

sbin/hammer: Cleanup arguments of init_volume()

Change the order of arguments to make the i/f similar to open(2)
as well as load_volume().

This is only for newfs (and volume-add), nothing else gets affected.

show more ...


# 0e777cf7 02-Sep-2016 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

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 tha

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.

show more ...


Revision tags: v4.6.0, v4.6.0rc2, v4.6.0rc, v4.7.0, v4.4.3
# b2299751 04-Apr-2016 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sbin/hammer: Print volume list after volume-add|del

Print volume info equivalent of hammer volume-list.
Using -v on hammer volume-add|del will do the same as
using -v on hammer volume-list.

# newf

sbin/hammer: Print volume list after volume-add|del

Print volume info equivalent of hammer volume-list.
Using -v on hammer volume-add|del will do the same as
using -v on hammer volume-list.

# newfs_hammer -L TEST /dev/da1 /dev/da2 /dev/da3 /dev/da4 > /dev/null
# mount_hammer /dev/da1:/dev/da2:/dev/da3:/dev/da4 /HAMMER
# hammer volume-list /HAMMER
/dev/da1
/dev/da2
/dev/da3
/dev/da4
# hammer volume-del /dev/da2 /HAMMER
/dev/da1
/dev/da3
/dev/da4
# hammer volume-del /dev/da3 /HAMMER
/dev/da1
/dev/da4
# hammer volume-del /dev/da4 /HAMMER
/dev/da1
# hammer volume-add /dev/da4 /HAMMER
/dev/da1
/dev/da4
# hammer volume-add /dev/da3 /HAMMER
/dev/da1
/dev/da4
/dev/da3
# hammer volume-add /dev/da2 /HAMMER
/dev/da1
/dev/da4
/dev/da3
/dev/da2

show more ...


# 1d1199eb 03-Apr-2016 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sys/vfs/hammer: Ask before reblocking on volume-del

hammer volume-del finishes instantly if the volume doesn't need
reblocking, but it could take long depending on how much of the
big-blocks within

sys/vfs/hammer: Ask before reblocking on volume-del

hammer volume-del finishes instantly if the volume doesn't need
reblocking, but it could take long depending on how much of the
big-blocks within the volume is used.

This commit makes hammer volume-del ask y/n whether to start
reblocking or not if the volume wasn't empty. Using force option
(-F) makes it reblock without asking.

Also note that reblocking doesn't guarantee anything on removing
a volume from filesystem. It just tries to move data to other
volume(s) so the volume may become empty. Thus users should have
choice.

# hammer volume-del /dev/da2 /HAMMER
/dev/da2 is not empty, do you want to reblock /dev/da2? [y/n]
n
hammer volume-del ioctl: Directory not empty

show more ...


# 56c2f4d6 02-Apr-2016 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sbin/hammer: Make hammer commands print root volume path

Base on the change made by the previous commit, this commit adds
the root volume path information (not root volume#) to hammer info
and hamme

sbin/hammer: Make hammer commands print root volume path

Base on the change made by the previous commit, this commit adds
the root volume path information (not root volume#) to hammer info
and hammer volume-list commands. hammer volume-list shows the path
only on -v. This enables users to explicitly know the root volume.

[A] The existing /sbin/hammer
# hammer -v volume-list /HAMMER
/dev/da1
/dev/da2
/dev/da3
# hammer info /HAMMER | grep Root
Root Volume 0

[B] With this commit
# ./hammer -v volume-list /HAMMER
0 /dev/da1 (Root Volume)
1 /dev/da2
2 /dev/da3
# hammer info /HAMMER | grep Root
Root Volume /dev/da1

show more ...


# 0b7c8f4c 20-Mar-2016 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sbin/hammer: Declare char* at the top of block scope

though gcc compiles without this.

Also change char* to const char*.
These char*s are pointers to argv[].


# 1ad85766 07-Mar-2016 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sbin/hammer: Separate setup_volume() into init/load_volume()

Separate setup_volume() into isnew == 0 and 1 case.
setup_volume() taking two args vol_no and isnew is redundant.

Use init_volume() when

sbin/hammer: Separate setup_volume() into init/load_volume()

Separate setup_volume() into isnew == 0 and 1 case.
setup_volume() taking two args vol_no and isnew is redundant.

Use init_volume() when newly creating a HAMMER volume.
Use load_volume() when the HAMMER volume already exists.

This commit is based on functions added by the previous two commits.

show more ...


Revision tags: v4.4.2, v4.4.1, v4.4.0, v4.5.0, v4.4.0rc
# ff8644cb 19-Aug-2015 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sbin/hammer: Merge check_volume()

There are two check_volume() that basically do the same.
The one in sbin/hammer/cmd_volume.c is copied from newfs_hammer.
Merge them into one.


# b45803e3 12-Aug-2015 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

hammer: Conform to style(9)

Also
* Remove header includes that are already included by
common hammer headers (of either userspace or kernel).
* Add "#include <sys/vnode.h>" to sys/vfs/fifofs/fifo.

hammer: Conform to style(9)

Also
* Remove header includes that are already included by
common hammer headers (of either userspace or kernel).
* Add "#include <sys/vnode.h>" to sys/vfs/fifofs/fifo.h.

show more ...


# f819215c 11-Aug-2015 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sbin/hammer: Add init_boot|mem_area_size()

Integrate copy-pasted code by 6f3076af into functions.


Revision tags: v4.2.4
# 6f3076af 06-Aug-2015 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sbin/hammer: Fix inconsistent boot|mem area size

Bring in the code that initializes BootAreaSize and MemAreaSize
from newfs_hammer to hammer volume-add. hammer volume-add uses
static values for thes

sbin/hammer: Fix inconsistent boot|mem area size

Bring in the code that initializes BootAreaSize and MemAreaSize
from newfs_hammer to hammer volume-add. hammer volume-add uses
static values for these and results having different offset for
freemap to start. This generates filesystem with less space for
data (and inodes, dirents, btree nodes, etc) compared to doing
newfs_hammer against multiple volumes initially.

newfs_hammer + volume-add should results the same as newfs_hammer
for multiple volumes initially, just like the previous commit
fixes wrong big-blocks count.

Example 1.
# newfs_hammer -L TEST /dev/da1 /dev/da2 /dev/da3 > /dev/null
# mount_hammer /dev/da1:/dev/da2:/dev/da3 /HAMMER
# hammer info /HAMMER > a
# umount /HAMMER
Example 2.
# newfs_hammer -L TEST /dev/da1 > /dev/null
# mount_hammer /dev/da1 /HAMMER
# hammer volume-add /dev/da2 /HAMMER
# hammer volume-add /dev/da3 /HAMMER
# hammer volume-blkdevs /HAMMER
/dev/da1:/dev/da2:/dev/da3
# hammer info /HAMMER > b
# umount /HAMMER
# diff -aNur a b
--- a 2015-08-07 04:29:49.909855000 +0900
+++ b 2015-08-07 04:30:51.989857000 +0900
<snip>
HAMMER Version 6
Big-block information
- Total 42740
+ Total 42548
Used 2 (0.00%)
Reserved 45 (0.11%)
- Free 42693 (99.89%)
+ Free 42501 (99.89%)
Space information
No. Inodes 1
- Total size 334G (358529105920 bytes)
+ Total size 332G (356918493184 bytes)
Used 16M (0.00%)
Reserved 360M (0.11%)
- Free 334G (99.89%)
+ Free 332G (99.89%)
PFS information
PFS ID Mode Snaps Mounted on
0 MASTER 0 /HAMMER

With this commit it results the same as the Example 1.
# newfs_hammer -L TEST /dev/da1 > /dev/null
# mount_hammer /dev/da1 /HAMMER
# hammer volume-add /dev/da2 /HAMMER
# hammer volume-add /dev/da3 /HAMMER
# hammer volume-blkdevs /HAMMER
/dev/da1:/dev/da2:/dev/da3
# hammer info /HAMMER > b
# umount /HAMMER
# diff -aNur a b /* only fsid diff */
--- a 2015-08-07 04:29:49.909855000 +0900
+++ b 2015-08-07 04:32:39.349860000 +0900
@@ -1,7 +1,7 @@
<snip>
HAMMER Version 6
Big-block information
Total 42740

show more ...


Revision tags: v4.3.1
# 180b1058 28-Jul-2015 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sbin/hammer: Use HAMMER_BUFSIZE

- Use HAMMER_BUFSIZE insteaf of 16KiB.


Revision tags: v4.2.3
# 2e31de44 03-Jul-2015 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sbin/hammer: Use const char* for string literal args


Revision tags: v4.2.1
# b45632fb 27-Jun-2015 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sbin/hammer: Add hammer volume-blkdevs command

- Many of the low-level hammer commands (e.g. show, blockmap,
checkmap, etc) require -f option with blkdevs format argument,
however hammer command

sbin/hammer: Add hammer volume-blkdevs command

- Many of the low-level hammer commands (e.g. show, blockmap,
checkmap, etc) require -f option with blkdevs format argument,
however hammer command does not provide a way to confirm volumes
in blkdevs format. One often has to manually type devices with
colons to generate blkdevs format via volume-list command.

- hammer volume-blkdevs prints a list of volumes in blkdevs format
which is just a different version of volume-list but useful.

- hammer volume-list and volume-blkdevs are basically the same.
The only difference is volume-list uses '\n' for separator and
volume-blkdevs uses ':' for separator.

# hammer volume-list /HAMMER
/dev/da1
/dev/da2
/dev/da3
# hammer volume-blkdevs /HAMMER
/dev/da1:/dev/da2:/dev/da3
#

show more ...


Revision tags: v4.2.0, v4.0.6, v4.3.0, v4.2.0rc, v4.0.5, v4.0.4, v4.0.3, v4.0.2, v4.0.1, v4.0.0, v4.0.0rc3, v4.0.0rc2, v4.0.0rc, v4.1.0, v3.8.2, v3.8.1, v3.6.3, v3.8.0, v3.8.0rc2, v3.9.0, v3.8.0rc, v3.6.2, v3.6.1, v3.6.0, v3.7.1, v3.6.0rc, v3.7.0, v3.4.3, v3.4.2, v3.4.0, v3.4.1, v3.4.0rc, v3.5.0, v3.2.2, v3.2.1, v3.2.0, v3.3.0, v3.0.3, v3.0.2, v3.0.1, v3.1.0, v3.0.0
# 86d7f5d3 26-Nov-2011 John Marino <draco@marino.st>

Initial import of binutils 2.22 on the new vendor branch

Future versions of binutils will also reside on this branch rather
than continuing to create new binutils branches for each new version.


12