History log of /dflybsd-src/sys/vfs/hammer/hammer_vfsops.c (Results 26 – 50 of 179)
Revision Date Author Comments
# 87b8f936 17-Sep-2015 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

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

mount(8) is unable to print nomirror mount option while other
two (nohistory, master=) are properly printed. This is because
hammer's mountctl

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

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

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

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

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

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

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

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

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

show more ...


# 11605a5c 15-Sep-2015 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

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

This commit does the following.

1. Add macros hdkprintf() and hdkrateprintf() that embed
the following prefix.
"function_name

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

This commit does the following.

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

show more ...


# d053aa8a 11-Sep-2015 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

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

This commit does the following.

1. Remove an inline function hkprintf().
2. Add a macro version of hkprintf() and its variants that

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

This commit does the following.

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

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

show more ...


# 9d756529 15-Sep-2015 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

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

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

# moun

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

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

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

show more ...


# 8fc055b2 06-Sep-2015 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sys/vfs/hammer: Remove unnecessary header includes


# 97fb61c0 06-Sep-2015 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

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

Remove
#include <sys/buf2.h>
#include <sys/mountctl.h>
#include <sys/globaldata.h>
#include <vm/vm_page2.h>
from sys/vfs/hammer/hammer.h


# 7bb4ec32 06-Sep-2015 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sys/vfs/hammer: Add header includes to hammer.h

Add
#include <sys/fcntl.h>
#include <sys/dirent.h>
#include <sys/sysctl.h>
#include <sys/event.h>
#include <sys/file.h>
#include <vm/swap_pager.

sys/vfs/hammer: Add header includes to hammer.h

Add
#include <sys/fcntl.h>
#include <sys/dirent.h>
#include <sys/sysctl.h>
#include <sys/event.h>
#include <sys/file.h>
#include <vm/swap_pager.h>
to sys/vfs/hammer/hammer.h

show more ...


# 1bcc9299 18-Aug-2015 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sys/vfs/hammer: Remove obsolete code and comments

from very early stage of hammer development.


# 8bae937e 18-Aug-2015 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sys/vfs/hammer: Add hammer_flush_dirty()


# 783fb170 18-Aug-2015 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sys/vfs/hammer: Use HAMMER_OBJID_ROOT for root inode#

instead of hardcoded 1.


# c54975d5 18-Aug-2015 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sys/vfs/hammer: Use either HAMMER: or hammer:

Should be either of the following.
kprintf("HAMMER: ...\n");
kprintf("hammer: ...\n");

The existing code mostly uses "HAMMER:" so use "HAMMER:".
Assumi

sys/vfs/hammer: Use either HAMMER: or hammer:

Should be either of the following.
kprintf("HAMMER: ...\n");
kprintf("hammer: ...\n");

The existing code mostly uses "HAMMER:" so use "HAMMER:".
Assuming no one or no userspace triggers anything via
"hammer:" string in dmesg.

show more ...


# deabdbfb 16-Aug-2015 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sys/vfs/hammer: Remove duplicated vfs code

Much of the code in sys/vfs/hammer/hammer_volume.c is taken
from the existing code, and some of them could be integrated
into mainstream hammer code. This

sys/vfs/hammer: Remove duplicated vfs code

Much of the code in sys/vfs/hammer/hammer_volume.c is taken
from the existing code, and some of them could be integrated
into mainstream hammer code. This commit does that without
messing up interface or making functional changes.

This greatly reduces and simplifies code, and also gets rid
of extra (and unnecessary) vfs open/close operations that
existed only to initialize or erase volume header while in
kernel space on ioctl.

show more ...


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


# 542b88c2 10-Aug-2015 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sys/vfs/hammer: Fix wrong function name in kprintf

It used to be "hammer_mountroot" according to 104cb849.
"hammer_mount" still isn't name of a function, but this
is what other kprintfs around here

sys/vfs/hammer: Fix wrong function name in kprintf

It used to be "hammer_mountroot" according to 104cb849.
"hammer_mount" still isn't name of a function, but this
is what other kprintfs around here use.

show more ...


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

sys/vfs/hammer: Avoid volume# inconsistency on mount

hammer_vfs_mount() should check and compare # of volumes
to mount (# of volumes in mount_hammer arg in blkdevs format)
and vol_count field in vol

sys/vfs/hammer: Avoid volume# inconsistency on mount

hammer_vfs_mount() should check and compare # of volumes
to mount (# of volumes in mount_hammer arg in blkdevs format)
and vol_count field in volume header.

mount_hammer should fail if they don't match even if it's
technically possible to mount at the moment after newfs.

In the following Example1, it's possible to safely mount
/dev/da1 without /dev/da2:/dev/da3 or
/dev/da1:/dev/da2 without /dev/da3 or
/dev/da1:/dev/da3 without /dev/da2 at this point because
both /dev/da2 and /dev/da3 has no data (only layer2 big-block)
right after newfs_hammer, however if filesystem has enough
data that zone2 next_offset has already reached the missing
volume before unmount, there is going to be inconsistency
between blockmap and actual mounted volumes, which results
in kernel panic. mount needs to avoid this by checking #
of volumes as the Example2 shows.

Example 1. - newfs 3 volumes and then mount 2 volumes
# newfs_hammer -L TEST /dev/da1 /dev/da2 /dev/da3 > /dev/null
# mount_hammer /dev/da1:/dev/da2:/dev/da3 /HAMMER
# mount | grep /HAMMER
TEST on /HAMMER (hammer, local)
# hammer volume-blkdevs /HAMMER
/dev/da1:/dev/da2:/dev/da3
# umount /HAMMER
# mount_hammer /dev/da1:/dev/da2 /HAMMER
# mount | grep /HAMMER
TEST on /HAMMER (hammer, local)
# hammer volume-blkdevs /HAMMER
/dev/da1:/dev/da2

Example 2. - with this commit it fails to mount
# newfs_hammer -L TEST /dev/da1 /dev/da2 /dev/da3 > /dev/null
# mount_hammer /dev/da1:/dev/da2:/dev/da3 /HAMMER
# mount | grep /HAMMER
TEST on /HAMMER (hammer, local)
# hammer volume-blkdevs /HAMMER
/dev/da1:/dev/da2:/dev/da3
# umount /HAMMER
# mount_hammer /dev/da1:/dev/da2 /HAMMER
mount_hammer: Unknown error: Invalid argument
# dmesg | tail -1
hammer_mount: volume header says 3 volumes, but 2 installed
# mount_hammer /dev/da1 /HAMMER
mount_hammer: Unknown error: Invalid argument
# dmesg | tail -1
hammer_mount: volume header says 3 volumes, but 1 installed

show more ...


# 721f3110 09-Aug-2015 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sys/vfs/hammer: Fix error check on mount

Since it already has failed: that does the same thing,
goto failed; on each error case makes code more clear.

Remove error==0 from the first if() conditiona

sys/vfs/hammer: Fix error check on mount

Since it already has failed: that does the same thing,
goto failed; on each error case makes code more clear.

Remove error==0 from the first if() conditional since
error isn't 0 when hmp->rootvol==NULL.

show more ...


# bfbd8331 27-Jul-2015 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sys/vfs/hammer: Add HAMMER_BTREE_TYPE_NONE

- No functional changes, but just makes things clearer.

- root_btree_{beg|end} has 0 (not used) for btype.
Defining a macro for it makes code clearer th

sys/vfs/hammer: Add HAMMER_BTREE_TYPE_NONE

- No functional changes, but just makes things clearer.

- root_btree_{beg|end} has 0 (not used) for btype.
Defining a macro for it makes code clearer than
implicitly taking care of btype by 0 or non-0.

show more ...


# 7866ea2a 12-Jul-2015 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sys/vfs/hammer: Cleanup whitespace(0x20) before tab

- Get rid of 0x20s that are being highlighted by editors
whereas other lines in hammer are aligned only by tabs.


# 745703c7 07-Jul-2015 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

hammer: Remove trailing whitespaces

- (Non-functional commits could make it difficult to git-blame
the history if there are too many of those)


# 66611793 07-Jul-2015 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

hammer: Remove trailing tabs

- (Non-functional commits could make it difficult to git-blame
the history if there are too many of those)


# a8d31329 20-May-2015 Matthew Dillon <dillon@apollo.backplane.com>

hammer - limit certain diagnostics to 1/sec.

* Limit certain diagnostics that can degenerately print in huge volumes
to the console to one per second.


# 6a85c61b 10-May-2015 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sys/kern: Fix comments

- hunk1 - Add missing MPSAFE comment.

- hunk2 - It actually acquires per-mount-token and get_mplock();
although it says get_mplock(); is /* TEMPORARY */.
See sys/sys/moun

sys/kern: Fix comments

- hunk1 - Add missing MPSAFE comment.

- hunk2 - It actually acquires per-mount-token and get_mplock();
although it says get_mplock(); is /* TEMPORARY */.
See sys/sys/mount.h.

show more ...


# e04ee2de 31-Jan-2015 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

hammer: fix terminology of "large block"

This cleanup patch changes terminology "large block" to "big block".

- Both "large block" and "big block" are widely used in hammer source from
kernel to us

hammer: fix terminology of "large block"

This cleanup patch changes terminology "large block" to "big block".

- Both "large block" and "big block" are widely used in hammer source from
kernel to userspace, however these two refer to the same data structure which
is a 8MB sized chunk within low level blockmapped storage layer.

- The original design document https://www.dragonflybsd.org/hammer/hammer.pdf
uses big block for this data structure. Having two expressions in its
implementation is confusing and makes grep difficult.

Closes: #2782

show more ...


# 7529c2ac 30-Jul-2014 Antonio Huete Jimenez <tuxillo@quantumachine.net>

hammer - Fix max volumes check on mount time


# cf6a53ca 14-Oct-2013 Matthew Dillon <dillon@apollo.backplane.com>

kernel - Fix hammer recovery crash (due to recent syncer work)

* Unconditionally create a syncer thread for each mount. This way we can
create the thread prior to calling VFS_MOUNT.

* hammer(1)

kernel - Fix hammer recovery crash (due to recent syncer work)

* Unconditionally create a syncer thread for each mount. This way we can
create the thread prior to calling VFS_MOUNT.

* hammer(1) needs to acquire vnodes and potentially issue vn_rdwr()'s during
mount for recovery purposes. This syncer thread is expected to already
exist. (and it does now).

* Remove the default syncer thread.

* rewrite speedup_syncer().

show more ...


12345678