linux/fs/ufs
Al Viro 724bb09fdc ufs: don't use lock_ufs() for block pointers tree protection
* stores to block pointers are under per-inode seqlock (meta_lock) and
mutex (truncate_mutex)
* fetches of block pointers are either under truncate_mutex, or wrapped
into seqretry loop on meta_lock
* all changes of ->i_size are under truncate_mutex and i_mutex
* all changes of ->i_lastfrag are under truncate_mutex

It's similar to what ext2 is doing; the main difference is that unlike
ext2 we can't rely upon the atomicity of stores into block pointers -
on UFS2 they are 64bit.  So we can't cut the corner when switching
a pointer from NULL to non-NULL as we could in ext2_splice_branch()
and need to use meta_lock on all modifications.

We use seqlock where ext2 uses rwlock; ext2 could probably also benefit
from such change...

Another non-trivial difference is that with UFS we *cannot* have reader
grab truncate_mutex in case of race - it has to keep retrying.  That
might be possible to change, but not until we lift tail unpacking
several levels up in call chain.

After that commit we do *NOT* hold fs-wide serialization on accesses
to block pointers anymore.  Moreover, lock_ufs() can become a normal
mutex now - it's only used on statfs, remount and sync_fs and none
of those uses are recursive.  As the matter of fact, *now* it can be
collapsed with ->s_lock, and be eventually replaced with saner
per-cylinder-group spinlocks, but that's a separate story.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-07-06 17:39:25 -04:00
..
balloc.c ufs: don't use lock_ufs() for block pointers tree protection 2015-07-06 17:39:25 -04:00
cylinder.c drop linux/ufs_fs.h from userspace export and relocate it to fs/ufs/ufs_fs.h 2008-02-08 09:22:39 -08:00
dir.c ufs: use dir_pages instead of ufs_dir_pages() 2015-06-23 18:02:01 -04:00
file.c make new_sync_{read,write}() static 2015-04-11 22:29:40 -04:00
ialloc.c fs/ufs: restore s_lock mutex 2015-06-16 02:07:38 -04:00
inode.c ufs: don't use lock_ufs() for block pointers tree protection 2015-07-06 17:39:25 -04:00
Kconfig fs/ufs: remove depends on CONFIG_EXPERIMENTAL 2013-01-21 14:39:06 -08:00
Makefile fs/ufs: convert printk to pr_foo() 2014-08-08 15:57:21 -07:00
namei.c Merge branch 'for-linus' into for-next 2015-06-17 14:44:05 -04:00
super.c ufs: don't use lock_ufs() for block pointers tree protection 2015-07-06 17:39:25 -04:00
swab.h ufs: replace __inline with inline 2008-04-28 08:58:45 -07:00
symlink.c ufs: switch to simple_follow_link() 2015-05-10 22:18:25 -04:00
truncate.c ufs: don't use lock_ufs() for block pointers tree protection 2015-07-06 17:39:25 -04:00
ufs_fs.h fs/ufs: get rid of write_super 2012-07-22 23:58:16 +04:00
ufs.h ufs: don't use lock_ufs() for block pointers tree protection 2015-07-06 17:39:25 -04:00
util.c fs: ufs: remove cast for kmalloc return value 2013-03-18 14:15:58 +01:00
util.h ufs: use little-endian bitops 2011-03-23 19:46:19 -07:00