Skip to content

Commit

Permalink
fs: Drop wait_unfrozen wait queue
Browse files Browse the repository at this point in the history
wait_unfrozen waitqueue is used only in quota code to wait for
filesystem to become unfrozen. In that place we can just use
sb_start_write() - sb_end_write() pair to achieve the same. So just
remove the waitqueue.

Reviewed-by: Christian Brauner <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Jan Kara <[email protected]>
  • Loading branch information
jankara committed May 30, 2023
1 parent b8b9e8b commit 576215c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
5 changes: 3 additions & 2 deletions fs/quota/quota.c
Original file line number Diff line number Diff line change
Expand Up @@ -895,8 +895,9 @@ static struct super_block *quotactl_block(const char __user *special, int cmd)
up_write(&sb->s_umount);
else
up_read(&sb->s_umount);
wait_event(sb->s_writers.wait_unfrozen,
sb->s_writers.frozen == SB_UNFROZEN);
/* Wait for sb to unfreeze */
sb_start_write(sb);
sb_end_write(sb);
put_super(sb);
goto retry;
}
Expand Down
4 changes: 0 additions & 4 deletions fs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ static struct super_block *alloc_super(struct file_system_type *type, int flags,
&type->s_writers_key[i]))
goto fail;
}
init_waitqueue_head(&s->s_writers.wait_unfrozen);
s->s_bdi = &noop_backing_dev_info;
s->s_flags = flags;
if (s->s_user_ns != &init_user_ns)
Expand Down Expand Up @@ -1706,7 +1705,6 @@ int freeze_super(struct super_block *sb)
if (ret) {
sb->s_writers.frozen = SB_UNFROZEN;
sb_freeze_unlock(sb, SB_FREEZE_PAGEFAULT);
wake_up(&sb->s_writers.wait_unfrozen);
deactivate_locked_super(sb);
return ret;
}
Expand All @@ -1722,7 +1720,6 @@ int freeze_super(struct super_block *sb)
"VFS:Filesystem freeze failed\n");
sb->s_writers.frozen = SB_UNFROZEN;
sb_freeze_unlock(sb, SB_FREEZE_FS);
wake_up(&sb->s_writers.wait_unfrozen);
deactivate_locked_super(sb);
return ret;
}
Expand Down Expand Up @@ -1768,7 +1765,6 @@ static int thaw_super_locked(struct super_block *sb)
sb->s_writers.frozen = SB_UNFROZEN;
sb_freeze_unlock(sb, SB_FREEZE_FS);
out:
wake_up(&sb->s_writers.wait_unfrozen);
deactivate_locked_super(sb);
return 0;
}
Expand Down
1 change: 0 additions & 1 deletion include/linux/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,6 @@ enum {

struct sb_writers {
int frozen; /* Is sb frozen? */
wait_queue_head_t wait_unfrozen; /* wait for thaw */
struct percpu_rw_semaphore rw_sem[SB_FREEZE_LEVELS];
};

Expand Down

0 comments on commit 576215c

Please sign in to comment.