hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/fs/affs/affs.h
....@@ -43,8 +43,8 @@
4343 */
4444 struct affs_inode_info {
4545 atomic_t i_opencnt;
46
- struct semaphore i_link_lock; /* Protects internal inode access. */
47
- struct semaphore i_ext_lock; /* Protects internal inode access. */
46
+ struct mutex i_link_lock; /* Protects internal inode access. */
47
+ struct mutex i_ext_lock; /* Protects internal inode access. */
4848 #define i_hash_lock i_ext_lock
4949 u32 i_blkcnt; /* block count */
5050 u32 i_extcnt; /* extended block count */
....@@ -293,30 +293,30 @@
293293 static inline void
294294 affs_lock_link(struct inode *inode)
295295 {
296
- down(&AFFS_I(inode)->i_link_lock);
296
+ mutex_lock(&AFFS_I(inode)->i_link_lock);
297297 }
298298 static inline void
299299 affs_unlock_link(struct inode *inode)
300300 {
301
- up(&AFFS_I(inode)->i_link_lock);
301
+ mutex_unlock(&AFFS_I(inode)->i_link_lock);
302302 }
303303 static inline void
304304 affs_lock_dir(struct inode *inode)
305305 {
306
- down(&AFFS_I(inode)->i_hash_lock);
306
+ mutex_lock_nested(&AFFS_I(inode)->i_hash_lock, SINGLE_DEPTH_NESTING);
307307 }
308308 static inline void
309309 affs_unlock_dir(struct inode *inode)
310310 {
311
- up(&AFFS_I(inode)->i_hash_lock);
311
+ mutex_unlock(&AFFS_I(inode)->i_hash_lock);
312312 }
313313 static inline void
314314 affs_lock_ext(struct inode *inode)
315315 {
316
- down(&AFFS_I(inode)->i_ext_lock);
316
+ mutex_lock(&AFFS_I(inode)->i_ext_lock);
317317 }
318318 static inline void
319319 affs_unlock_ext(struct inode *inode)
320320 {
321
- up(&AFFS_I(inode)->i_ext_lock);
321
+ mutex_unlock(&AFFS_I(inode)->i_ext_lock);
322322 }