From 83c428fcc375e3cafe87e5ede648354440f33d44 Mon Sep 17 00:00:00 2001 From: "Paul E. McKenney" Date: Mon, 22 Feb 2010 17:04:53 -0800 Subject: [PATCH] --- yaml --- r: 182249 b: refs/heads/master c: af61b96b4f68f7ab25ebf34fed275fabf64f2edc h: refs/heads/master i: 182247: c81168c9a607c2c00c3dc55ad401fd25f3398600 v: v3 --- [refs] | 2 +- trunk/include/linux/fdtable.h | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 43ed60ed8e1a..121084d3ea64 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 7dc52157982ab771f40e3c0b7dc55b954c3c2d19 +refs/heads/master: af61b96b4f68f7ab25ebf34fed275fabf64f2edc diff --git a/trunk/include/linux/fdtable.h b/trunk/include/linux/fdtable.h index 144412ffaced..013dc529e95f 100644 --- a/trunk/include/linux/fdtable.h +++ b/trunk/include/linux/fdtable.h @@ -57,11 +57,14 @@ struct files_struct { struct file * fd_array[NR_OPEN_DEFAULT]; }; -#define files_fdtable(files) \ - (rcu_dereference_check((files)->fdt, \ +#define rcu_dereference_check_fdtable(files, fdtfd) \ + (rcu_dereference_check((fdtfd), \ rcu_read_lock_held() || \ lockdep_is_held(&(files)->file_lock) || \ - atomic_read(&files->count) == 1)) + atomic_read(&(files)->count) == 1)) + +#define files_fdtable(files) \ + (rcu_dereference_check_fdtable((files), (files)->fdt)) struct file_operations; struct vfsmount; @@ -82,7 +85,7 @@ static inline struct file * fcheck_files(struct files_struct *files, unsigned in struct fdtable *fdt = files_fdtable(files); if (fd < fdt->max_fds) - file = rcu_dereference_check(fdt->fd[fd], rcu_read_lock_held() || lockdep_is_held(&files->file_lock) || atomic_read(&files->count) == 1); + file = rcu_dereference_check_fdtable(files, fdt->fd[fd]); return file; }