Skip to content

Commit

Permalink
dont lock inode in mkwrite, try adjust extent_sem in get_block
Browse files Browse the repository at this point in the history
**WIP**

This basically undoes part of e972c85, adjusts the locking requirement
in scoutfs_get_block to just grab the extent and not lock the whole
inode.

Signed-off-by: Auke Kok <[email protected]>
  • Loading branch information
aversecat committed Jul 23, 2024
1 parent 2f25eb5 commit 920070d
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions kmod/src/data.c
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ static int scoutfs_get_block(struct inode *inode, sector_t iblock,
u64 offset;
int ret;

WARN_ON_ONCE(create && !inode_is_locked(inode));
WARN_ON_ONCE(create && !rwsem_is_locked(&si->extent_sem));

/* make sure caller holds a cluster lock */
lock = scoutfs_per_task_get(&si->pt_data_lock);
Expand Down Expand Up @@ -1915,7 +1915,6 @@ static int scoutfs_data_page_mkwrite(struct vm_area_struct *vma,
int err;

sb_start_pagefault(sb);
inode_lock(inode);
down_write(&si->extent_sem);

retry:
Expand Down Expand Up @@ -2008,7 +2007,6 @@ static int scoutfs_data_page_mkwrite(struct vm_area_struct *vma,
scoutfs_per_task_del(&si->pt_data_lock, &pt_ent);
scoutfs_unlock(sb, lock, SCOUTFS_LOCK_WRITE);
up_write(&si->extent_sem);
inode_unlock(inode);
if (scoutfs_data_wait_found(&dw)) {
ret = scoutfs_data_wait(inode, &dw);
if (ret == 0)
Expand Down

0 comments on commit 920070d

Please sign in to comment.