clear_bit(BDI_pdflush, &bdi->state);
}
+static noinline void block_dump___mark_inode_dirty(struct inode *inode)
+{
+ if (inode->i_ino || strcmp(inode->i_sb->s_id, "bdev")) {
+ struct dentry *dentry;
+ const char *name = "?";
+
+ dentry = d_find_alias(inode);
+ if (dentry) {
+ spin_lock(&dentry->d_lock);
+ name = (const char *) dentry->d_name.name;
+ }
+ printk(KERN_DEBUG
+ "%s(%d): dirtied inode %lu (%s) on %s\n",
+ current->comm, task_pid_nr(current), inode->i_ino,
+ name, inode->i_sb->s_id);
+ if (dentry) {
+ spin_unlock(&dentry->d_lock);
+ dput(dentry);
+ }
+ }
+}
+
/**
* __mark_inode_dirty - internal function
* @inode: inode to mark
if ((inode->i_state & flags) == flags)
return;
- if (unlikely(block_dump)) {
- struct dentry *dentry = NULL;
- const char *name = "?";
-
- if (!list_empty(&inode->i_dentry)) {
- dentry = list_entry(inode->i_dentry.next,
- struct dentry, d_alias);
- if (dentry && dentry->d_name.name)
- name = (const char *) dentry->d_name.name;
- }
-
- if (inode->i_ino || strcmp(inode->i_sb->s_id, "bdev"))
- printk(KERN_DEBUG
- "%s(%d): dirtied inode %lu (%s) on %s\n",
- current->comm, task_pid_nr(current), inode->i_ino,
- name, inode->i_sb->s_id);
- }
+ if (unlikely(block_dump))
+ block_dump___mark_inode_dirty(inode);
spin_lock(&inode_lock);
if ((inode->i_state & flags) != flags) {