cephfs: prepare for changes to VFS locking
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest3 patches 1 replyIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | cephfs: Use d_alloc_trylock() in ceph_readdir_prepopulate()fs/ | +17 | 0 replies | |
| 2/3 | cephfs: Don't d_drop() before d_splice_alias()fs/ fs/ | +0 | 0 replies | |
| 3/3 | cephfs: stop using d_add()fs/ fs/ | +3 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/3] cephfs: prepare for changes to VFS locking
I am working on changes to directory locking. The medium term goal is to lift d_alloc_parallel() locking above i_rwsem, so d_alloc_paralle() can be run unlocked, and consequently cannot be called when ->i_rwsem is held.
The requires:
1/ that d_alloc_parallel() not be called while i_rwsem is held and also
that d_alloc()/d_splice_alias() not be used (unless the filesystems doesn't support creating objects).
cephfs uses d_alloc()/d_splice_alias() when priming the dcache from the results of readdir. A new interface d_alloc_trylock() is now available and can be used instead.
2/ a dentry must not be d_drop()ed while an operation is ongoing, as an
unlocked d_alloc_parallel() would then be able to create a new dentry with the same name. cephfs calls d_drop() in couple of places before d_splice_alias() but this is no longer needed as d_splice_alias() handles spliced aliases now.
Patch 3/3 isn't strictly needed here but I'd like to deprecate d_add() in favour of d_splice_alias() as the latter now does everything the former can do. So the last patch removes uses of d_add() from fs/ceph.
The patches depend on patches recently added to the vfs tree. I would prefer these land in that tree too with an Acked-by or similar from cifs maintainers.
Thanks,
NeilBrown
[PATCH 1/3] cephfs: Use d_alloc_trylock() in [PATCH 2/3] cephfs: Don't d_drop() before d_splice_alias() [PATCH 3/3] cephfs: stop using d_add()