android_kernel_xiaomi_sm7250/fs/configfs
Louis Rilling 6f61076406 configfs: Introduce configfs_dirent_lock
This patch introduces configfs_dirent_lock spinlock to protect configfs_dirent
traversals against linkage mutations (add/del/move). This will allow
configfs_detach_prep() to avoid locking i_mutexes.

Locking rules for configfs_dirent linkage mutations are the same plus the
requirement of taking configfs_dirent_lock. For configfs_dirent walking, one can
either take appropriate i_mutex as before, or take configfs_dirent_lock.

The spinlock could actually be a mutex, but the critical sections are either
O(1) or should not be too long (default groups walking in last patch).

ChangeLog:
  - Clarify the comment on configfs_dirent_lock usage
  - Move sd->s_element init before linking the new dirent
  - In lseek(), do not release configfs_dirent_lock before the dirent is
    relinked.

Signed-off-by: Louis Rilling <Louis.Rilling@kerlabs.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
2008-07-14 13:57:15 -07:00
..
configfs_internal.h configfs: Introduce configfs_dirent_lock 2008-07-14 13:57:15 -07:00
dir.c configfs: Introduce configfs_dirent_lock 2008-07-14 13:57:15 -07:00
file.c fs: replace remaining __FUNCTION__ occurrences 2008-04-30 08:29:54 -07:00
inode.c configfs: Introduce configfs_dirent_lock 2008-07-14 13:57:15 -07:00
item.c
Makefile
mount.c fs: replace remaining __FUNCTION__ occurrences 2008-04-30 08:29:54 -07:00
symlink.c configfs: Introduce configfs_dirent_lock 2008-07-14 13:57:15 -07:00