Commit 3cbdf133 authored by Dave Jones's avatar Dave Jones Committed by Linus Torvalds

[PATCH] list_for_each is fs/

From the kernel janitor folks
parent 6037891c
...@@ -62,7 +62,7 @@ static Node *check_file(struct linux_binprm *bprm) ...@@ -62,7 +62,7 @@ static Node *check_file(struct linux_binprm *bprm)
char *p = strrchr(bprm->filename, '.'); char *p = strrchr(bprm->filename, '.');
struct list_head *l; struct list_head *l;
for (l = entries.next; l != &entries; l = l->next) { list_for_each(l, &entries) {
Node *e = list_entry(l, Node, list); Node *e = list_entry(l, Node, list);
char *s; char *s;
int j; int j;
......
...@@ -337,7 +337,7 @@ static struct block_device *bdfind(dev_t dev, struct list_head *head) ...@@ -337,7 +337,7 @@ static struct block_device *bdfind(dev_t dev, struct list_head *head)
{ {
struct list_head *p; struct list_head *p;
struct block_device *bdev; struct block_device *bdev;
for (p=head->next; p!=head; p=p->next) { list_for_each(p, head) {
bdev = list_entry(p, struct block_device, bd_hash); bdev = list_entry(p, struct block_device, bd_hash);
if (bdev->bd_dev != dev) if (bdev->bd_dev != dev)
continue; continue;
......
...@@ -67,7 +67,7 @@ static struct char_device *cdfind(dev_t dev, struct list_head *head) ...@@ -67,7 +67,7 @@ static struct char_device *cdfind(dev_t dev, struct list_head *head)
{ {
struct list_head *p; struct list_head *p;
struct char_device *cdev; struct char_device *cdev;
for (p=head->next; p!=head; p=p->next) { list_for_each(p, head) {
cdev = list_entry(p, struct char_device, hash); cdev = list_entry(p, struct char_device, hash);
if (cdev->dev != dev) if (cdev->dev != dev)
continue; continue;
......
...@@ -486,7 +486,7 @@ struct dentry *fat_fh_to_dentry(struct super_block *sb, __u32 *fh, ...@@ -486,7 +486,7 @@ struct dentry *fat_fh_to_dentry(struct super_block *sb, __u32 *fh,
* code. * code.
*/ */
spin_lock(&dcache_lock); spin_lock(&dcache_lock);
for (lp = inode->i_dentry.next; lp != &inode->i_dentry ; lp=lp->next) { list_for_each(lp, &inode->i_dentry) {
result = list_entry(lp,struct dentry, d_alias); result = list_entry(lp,struct dentry, d_alias);
if (! (result->d_flags & DCACHE_NFSD_DISCONNECTED)) { if (! (result->d_flags & DCACHE_NFSD_DISCONNECTED)) {
dget_locked(result); dget_locked(result);
......
...@@ -169,7 +169,7 @@ int fs_may_remount_ro(struct super_block *sb) ...@@ -169,7 +169,7 @@ int fs_may_remount_ro(struct super_block *sb)
/* Check that no files are currently opened for writing. */ /* Check that no files are currently opened for writing. */
file_list_lock(); file_list_lock();
for (p = sb->s_files.next; p != &sb->s_files; p = p->next) { list_for_each(p, &sb->s_files) {
struct file *file = list_entry(p, struct file, f_list); struct file *file = list_entry(p, struct file, f_list);
struct inode *inode = file->f_dentry->d_inode; struct inode *inode = file->f_dentry->d_inode;
......
...@@ -160,7 +160,7 @@ static struct dentry *nfsd_iget(struct super_block *sb, unsigned long ino, __u32 ...@@ -160,7 +160,7 @@ static struct dentry *nfsd_iget(struct super_block *sb, unsigned long ino, __u32
* If possible, get a well-connected one * If possible, get a well-connected one
*/ */
spin_lock(&dcache_lock); spin_lock(&dcache_lock);
for (lp = inode->i_dentry.next; lp != &inode->i_dentry ; lp=lp->next) { list_for_each(lp, &inode->i_dentry) {
result = list_entry(lp,struct dentry, d_alias); result = list_entry(lp,struct dentry, d_alias);
if (! (result->d_flags & DCACHE_NFSD_DISCONNECTED)) { if (! (result->d_flags & DCACHE_NFSD_DISCONNECTED)) {
dget_locked(result); dget_locked(result);
......
...@@ -404,7 +404,7 @@ static void proc_kill_inodes(struct proc_dir_entry *de) ...@@ -404,7 +404,7 @@ static void proc_kill_inodes(struct proc_dir_entry *de)
* Actually it's a partial revoke(). * Actually it's a partial revoke().
*/ */
file_list_lock(); file_list_lock();
for (p = sb->s_files.next; p != &sb->s_files; p = p->next) { list_for_each(p, &sb->s_files) {
struct file * filp = list_entry(p, struct file, f_list); struct file * filp = list_entry(p, struct file, f_list);
struct dentry * dentry = filp->f_dentry; struct dentry * dentry = filp->f_dentry;
struct inode * inode; struct inode * inode;
......
...@@ -1289,7 +1289,7 @@ struct dentry *reiserfs_fh_to_dentry(struct super_block *sb, __u32 *data, ...@@ -1289,7 +1289,7 @@ struct dentry *reiserfs_fh_to_dentry(struct super_block *sb, __u32 *data,
* If possible, get a well-connected one * If possible, get a well-connected one
*/ */
spin_lock(&dcache_lock); spin_lock(&dcache_lock);
for (lp = inode->i_dentry.next; lp != &inode->i_dentry ; lp=lp->next) { list_for_each(lp, &inode->i_dentry) {
result = list_entry(lp,struct dentry, d_alias); result = list_entry(lp,struct dentry, d_alias);
if (! (result->d_flags & DCACHE_NFSD_DISCONNECTED)) { if (! (result->d_flags & DCACHE_NFSD_DISCONNECTED)) {
dget_locked(result); dget_locked(result);
......
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