History log of /dflybsd-src/sbin/hammer/cmd_mirror.c (Results 1 – 25 of 66)
Revision Date Author Comments
# 16a0098c 25-Sep-2017 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

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

(missed ones from 118205ce)


# 90da8fc8 21-Sep-2017 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sys/vfs/hammer: Add typedef hammer_uuid_t

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

sys/vfs/hammer: Add typedef hammer_uuid_t

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

No functional changes.

show more ...


# 3cd578ed 21-Sep-2017 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sbin/hammer: Add uuid.c

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

No functional changes.


# 4362c066 17-Apr-2017 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sys/vfs/hammer: Drop typedefs for struct hammer_ioc_{hist_entry,mrecord_head}

These are the only two ioctl structs with pointer typedefs. All the
rest of ioctl structs aren't typedef'd, and there is

sys/vfs/hammer: Drop typedefs for struct hammer_ioc_{hist_entry,mrecord_head}

These are the only two ioctl structs with pointer typedefs. All the
rest of ioctl structs aren't typedef'd, and there isn't really any
reason that these two need to be typedef'd.

Note that almost all non ioctl HAMMER structs have pointer typedef,
and majority of variables have been typedef'd ones from the beginning
(since they were mostly pointers). Rest were changed to use typedef'd
at some point in 2016, to avoid mix of these for no reason, though
typedef'd pointers have ugliness when used as const.

show more ...


# 9930da22 17-Apr-2017 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sbin/*hammer: Add missing braces to conform to code style

These were the missing ones due to
1. the code were written by several devs
2. they were missing ever since originally written by dillon@


# 005a4da7 14-Apr-2017 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sbin/*hammer: Use consistent static/inline/returntype format for functions

Change them to HAMMER2 style which has much more stable code style
than HAMMER1. HAMMER1 is basically a mix of every possib

sbin/*hammer: Use consistent static/inline/returntype format for functions

Change them to HAMMER2 style which has much more stable code style
than HAMMER1. HAMMER1 is basically a mix of every possible pattern
(even in the code originally written only by dillon@).

show more ...


# 88cdee70 11-Apr-2017 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sbin/hammer: Add /* not reached */ for usage() variants

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


# 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.


# 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 ...


# 4c09d9c4 17-Mar-2017 Matthew Dillon <dillon@apollo.backplane.com>

hammer - HAMMER Version 7

* Add support for version 7 which changes the CRC mechanic from the
old slow CRC code to the faster ISCSI CRC code. We don't use the CRC
instruction yet but ths base I

hammer - HAMMER Version 7

* Add support for version 7 which changes the CRC mechanic from the
old slow CRC code to the faster ISCSI CRC code. We don't use the CRC
instruction yet but ths base ISCSI CRC from FreeBSD is 6x faster than
the CRC code we were using before.

* Change newfs_hammer default to version 7 (for master).

show more ...


# 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()


# 578f0d56 21-Sep-2016 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sbin/hammer: Partly revert 8b640662 in 2014

I guess it makes sense that 8b640662 silently ignores trailing / and
do destructive operations to a filesystem, since there isn't really
anything one can

sbin/hammer: Partly revert 8b640662 in 2014

I guess it makes sense that 8b640662 silently ignores trailing / and
do destructive operations to a filesystem, since there isn't really
anything one can do by specifying a root inode (directory) of a PFS,
but it shouldn't silently modify (not ignore) the user input.

A command like pfs-status uses that input after calling getpfs(),
so the program should not silently modify the string and print it
as if that was the user input, because it's not. It should also avoid
modifying argv[i] even if it's technically possible (make it shorter).

It's also better to do it based on lstat(2) result than unconditionally
checking a trailing / based on assumption that a symlink that ends
with / is a directory (which is right if it actually exists).

The only case behaves differently from 8b640662 is when there is a
slave PFS that hasn't been synced with a master PFS yet after created.
In this case it fails to run commands using path arg with trailing /,
because lstat(2) mentioned above in scanpfsid() fails due to lack of
the root inode. This occurs by design of HAMMER, but not a tool issue.

Above won't be a problem either because the scenario mentioned in
8b640662 is mostly about auto completion by a shell, while in this
case the shell just recognizes it as a broken link. The tool doesn't
need to assist everything that users would potentially do based on
assumption that may be right or wrong.
Also see http://lists.dragonflybsd.org/pipermail/users/2015-April/228012.html

-----
Actually I even suspect reports by users and 8b640662 were wrong
in the first place, because one would still get the same PFS id from
both "symlink" and "symlink/" when "symlink" is a symlink to PFS.
"symlink" can extract the PFS id directly from "@@.." format, but
"symlink/" eventually results the same via hammer_pfs_autodetect().
In fact I could pfs-upgrade/pfs-downgrade by reverting whole 8b640662.

Having said that, it still needs to strip trailing / on pfs-destroy
otherwise it won't be able to remove a symlink to PFS after it gets
destroyed.

show more ...


# 1b23fc22 09-Sep-2016 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

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().

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.

show more ...


# 45643966 05-Sep-2016 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

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.


# 8679ed64 11-Aug-2016 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sbin/hammer: Move score_printf()/hammer_check_restrict() to cmd_mirror.c

Make sbin/hammer/misc.c independent of /sbin/hammer's global variables
(used by two functions score_printf()/hammer_check_res

sbin/hammer: Move score_printf()/hammer_check_restrict() to cmd_mirror.c

Make sbin/hammer/misc.c independent of /sbin/hammer's global variables
(used by two functions score_printf()/hammer_check_restrict()) that
aren't accessible from other programs such as /sbin/newfs_hammer
which already links to some of sbin/hammer/*.o's.

/sbin/newfs_hammer could make use of misc.o, but globals have been
preventing from linking against sbin/hammer/misc.o. If these are
to be used by other hammer commands, they need to be reimplemented
without dependencies.

show more ...


# 778c2d2c 03-Apr-2016 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sbin/hammer: Make getyn() non static

This can be used by other commands (needed in the next commit).

Also rename static function getyn() in sbin/hammer/cmd_mirror.c
to getyntty() to avoid symbol na

sbin/hammer: Make getyn() non static

This can be used by other commands (needed in the next commit).

Also rename static function getyn() in sbin/hammer/cmd_mirror.c
to getyntty() to avoid symbol name conflict.

show more ...


# 2bacc088 25-Feb-2016 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sys/vfs/hammer: Add hammer_is_pfs_{master|slave|deleted}()

Makes code more readable, but introducing these macros could
make |= and &=~ unclear by hiding &.
There are a few |= and &=~ but not many.


# 60c52d1d 27-Feb-2016 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sbin/hammer: Printf "PFS" instead of "pfs"

The existing printfs as well as hammer(5) use "PFS" unless
it's a part of command name like "pfs-master".


# 46137e17 25-Nov-2015 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

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
*

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

show more ...


# 9a620123 09-Aug-2015 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

hammer: Fix unusual line break style


# ba8e5b0f 18-Apr-2015 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sbin/hammer: Make hammer mirror-dump print localization

- Add printf for localiazation in addition to other
struct hammer_base_elm fields.


# 764d0c8c 14-Apr-2015 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sbin/hammer: Add missing free(3) and relpfs()

- Add missing free(3) for mirror buffer and relpfs() to release pfs.


# cc71ff00 14-Apr-2015 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sbin/hammer: Add missing free(3)

- Add missing free(3) for a return value of read_mrecord().


123