Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 11871
b: refs/heads/master
c: 7f04c26
h: refs/heads/master
i:
  11869: 8fddd42
  11867: f1b25d8
  11863: 2518c60
  11855: 77fd292
  11839: c30a76a
v: v3
  • Loading branch information
Andrea Arcangeli authored and Linus Torvalds committed Oct 31, 2005
1 parent e257852 commit 1060488
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 52303e8b5f8aa234865d40d76ea16b0ff4b27022
refs/heads/master: 7f04c26d715a2467a49a2384268de8f70f787b51
28 changes: 16 additions & 12 deletions trunk/fs/fs-writeback.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,22 +230,27 @@ __sync_single_inode(struct inode *inode, struct writeback_control *wbc)
* The inode is clean, unused
*/
list_move(&inode->i_list, &inode_unused);
inodes_stat.nr_unused++;
}
}
wake_up_inode(inode);
return ret;
}

/*
* Write out an inode's dirty pages. Called under inode_lock.
* Write out an inode's dirty pages. Called under inode_lock. Either the
* caller has ref on the inode (either via __iget or via syscall against an fd)
* or the inode has I_WILL_FREE set (via generic_forget_inode)
*/
static int
__writeback_single_inode(struct inode *inode,
struct writeback_control *wbc)
__writeback_single_inode(struct inode *inode, struct writeback_control *wbc)
{
wait_queue_head_t *wqh;

if (!atomic_read(&inode->i_count))
WARN_ON(!(inode->i_state & I_WILL_FREE));
else
WARN_ON(inode->i_state & I_WILL_FREE);

if ((wbc->sync_mode != WB_SYNC_ALL) && (inode->i_state & I_LOCK)) {
list_move(&inode->i_list, &inode->i_sb->s_dirty);
return 0;
Expand All @@ -259,11 +264,9 @@ __writeback_single_inode(struct inode *inode,

wqh = bit_waitqueue(&inode->i_state, __I_LOCK);
do {
__iget(inode);
spin_unlock(&inode_lock);
__wait_on_bit(wqh, &wq, inode_wait,
TASK_UNINTERRUPTIBLE);
iput(inode);
spin_lock(&inode_lock);
} while (inode->i_state & I_LOCK);
}
Expand Down Expand Up @@ -541,14 +544,15 @@ void sync_inodes(int wait)
}

/**
* write_inode_now - write an inode to disk
* @inode: inode to write to disk
* @sync: whether the write should be synchronous or not
* write_inode_now - write an inode to disk
* @inode: inode to write to disk
* @sync: whether the write should be synchronous or not
*
* This function commits an inode to disk immediately if it is dirty. This is
* primarily needed by knfsd.
*
* This function commits an inode to disk immediately if it is
* dirty. This is primarily needed by knfsd.
* The caller must either have a ref on the inode or must have set I_WILL_FREE.
*/

int write_inode_now(struct inode *inode, int sync)
{
int ret;
Expand Down
1 change: 1 addition & 0 deletions trunk/fs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1088,6 +1088,7 @@ static void generic_forget_inode(struct inode *inode)
if (inode->i_data.nrpages)
truncate_inode_pages(&inode->i_data, 0);
clear_inode(inode);
wake_up_inode(inode);
destroy_inode(inode);
}

Expand Down

0 comments on commit 1060488

Please sign in to comment.