Skip to content

Commit

Permalink
fs/bcachefs: Fix __wait_on_freeing_inode() definition of waitqueue entry
Browse files Browse the repository at this point in the history
The following recent commit made DEFINE_WAIT_BIT() type requirements stricter:

  2382d68 ("sched: change wake_up_bit() and related function to expect unsigned long *")

.. which results in a build failure:

  > fs/bcachefs/fs.c: In function '__wait_on_freeing_inode':
  > fs/bcachefs/fs.c:281:31: error: initialization of 'long unsigned int *' from incompatible pointer type 'u32 *' {aka 'unsigned int *'} [-Wincompatible-pointer-types]
  >   281 |         DEFINE_WAIT_BIT(wait, &inode->v.i_state, __I_NEW);

Since this code relies on the waitqueue initialization within
inode_bit_waitqueue() anyway, the DEFINE_WAIT_BIT() initialization
is unnecessary - we can just declare a waitqueue entry.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Suggested-by: NeilBrown <neilb@suse.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
  • Loading branch information
Ingo Molnar committed Oct 9, 2024
1 parent 0ac8f14 commit 7266f0a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/bcachefs/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,9 @@ static void __wait_on_freeing_inode(struct bch_fs *c,
struct bch_inode_info *inode,
subvol_inum inum)
{
struct wait_bit_queue_entry wait;
wait_queue_head_t *wq;
DEFINE_WAIT_BIT(wait, &inode->v.i_state, __I_NEW);

wq = inode_bit_waitqueue(&wait, &inode->v, __I_NEW);
prepare_to_wait(wq, &wait.wq_entry, TASK_UNINTERRUPTIBLE);
spin_unlock(&inode->v.i_lock);
Expand Down

0 comments on commit 7266f0a

Please sign in to comment.