Commit 22376789 authored by Patrick Mochel's avatar Patrick Mochel

driverfs: use dentry->d_subdirs list instead of our own list when removing directory

struct dentry already has a list of the children files in a directory, making the list in
struct driver_dir_entry irrelevant. 

This is step one in removing it. Instead of iterating over our list, we iterate over 
->d_subdirs and call driverfs_unlink on each one. 
parent 173d4827
...@@ -767,19 +767,19 @@ void driverfs_remove_dir(struct driver_dir_entry * dir) ...@@ -767,19 +767,19 @@ void driverfs_remove_dir(struct driver_dir_entry * dir)
down(&dentry->d_parent->d_inode->i_sem); down(&dentry->d_parent->d_inode->i_sem);
down(&dentry->d_inode->i_sem); down(&dentry->d_inode->i_sem);
node = dir->files.next; node = dentry->d_subdirs.next;
while (node != &dir->files) { while (node != &dentry->d_subdirs) {
struct driver_file_entry * entry; struct dentry * d = list_entry(node,struct dentry,d_child);
entry = list_entry(node,struct driver_file_entry,node); struct driver_file_entry * entry = d->d_fsdata;
list_del_init(node); node = node->next;
driverfs_unlink(dentry->d_inode,entry->dentry);
dput(entry->dentry); list_del_init(&entry->node);
driverfs_unlink(dentry->d_inode,d);
dput(dentry);
put_mount(); put_mount();
node = dir->files.next;
} }
up(&dentry->d_inode->i_sem); up(&dentry->d_inode->i_sem);
driverfs_rmdir(dentry->d_parent->d_inode,dentry); driverfs_rmdir(dentry->d_parent->d_inode,dentry);
up(&dentry->d_parent->d_inode->i_sem); up(&dentry->d_parent->d_inode->i_sem);
dput(dentry); dput(dentry);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment