Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 328968
b: refs/heads/master
c: 1983e78
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro committed Sep 27, 2012
1 parent cae26f0 commit 09311e7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 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: b9e02af0ae0783894abb576fbab45ec29aa8e7fc
refs/heads/master: 1983e781da2f7f77906f4ccc2c3dc279cd61d1ff
17 changes: 2 additions & 15 deletions trunk/fs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,8 @@ static void free_fdtable_rcu(struct rcu_head *rcu)
struct fdtable_defer *fddef;

BUG_ON(!fdt);
BUG_ON(fdt->max_fds <= NR_OPEN_DEFAULT);

if (fdt->max_fds <= NR_OPEN_DEFAULT) {
/*
* This fdtable is embedded in the files structure and that
* structure itself is getting destroyed.
*/
kmem_cache_free(files_cachep,
container_of(fdt, struct files_struct, fdtab));
return;
}
if (!is_vmalloc_addr(fdt->fd) && !is_vmalloc_addr(fdt->open_fds)) {
kfree(fdt->fd);
kfree(fdt->open_fds);
Expand All @@ -116,11 +108,6 @@ static void free_fdtable_rcu(struct rcu_head *rcu)
}
}

static inline void free_fdtable(struct fdtable *fdt)
{
call_rcu(&fdt->rcu, free_fdtable_rcu);
}

/*
* Expand the fdset in the files_struct. Called with the files spinlock
* held for write.
Expand Down Expand Up @@ -234,7 +221,7 @@ static int expand_fdtable(struct files_struct *files, int nr)
copy_fdtable(new_fdt, cur_fdt);
rcu_assign_pointer(files->fdt, new_fdt);
if (cur_fdt->max_fds > NR_OPEN_DEFAULT)
free_fdtable(cur_fdt);
call_rcu(&cur_fdt->rcu, free_fdtable_rcu);
} else {
/* Somebody else expanded, so undo our attempt */
__free_fdtable(new_fdt);
Expand Down

0 comments on commit 09311e7

Please sign in to comment.