Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 336177
b: refs/heads/master
c: a77cfcb
h: refs/heads/master
i:
  336175: d9b5b21
v: v3
  • Loading branch information
Al Viro committed Nov 30, 2012
1 parent adb130d commit 0b22894
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 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: 21d8a15ac333b05f1fecdf9fdc30996be2e11d60
refs/heads/master: a77cfcb429ed98845a4e4df72473b8f37acd890b
14 changes: 8 additions & 6 deletions trunk/fs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -994,16 +994,18 @@ int iterate_fd(struct files_struct *files, unsigned n,
const void *p)
{
struct fdtable *fdt;
struct file *file;
int res = 0;
if (!files)
return 0;
spin_lock(&files->file_lock);
fdt = files_fdtable(files);
while (!res && n < fdt->max_fds) {
file = rcu_dereference_check_fdtable(files, fdt->fd[n++]);
if (file)
res = f(p, file, n);
for (fdt = files_fdtable(files); n < fdt->max_fds; n++) {
struct file *file;
file = rcu_dereference_check_fdtable(files, fdt->fd[n]);
if (!file)
continue;
res = f(p, file, n);
if (res)
break;
}
spin_unlock(&files->file_lock);
return res;
Expand Down

0 comments on commit 0b22894

Please sign in to comment.