diff options
| author | Andrew Morton <akpm@osdl.org> | 2004-04-12 19:22:25 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-04-12 19:22:25 -0700 |
| commit | a16129b8509728ae92ce205114ab453509e200f0 (patch) | |
| tree | 319f039762eec16abed44ea4e8d759dd073cf2ed /kernel | |
| parent | c2bd12474ca2323e84fa40eed61de4fc8311d4a3 (diff) | |
[PATCH] get_files_struct cleanup
From: Russell King <rmk@arm.linux.org.uk>
Cleanup the 4 duplicate "get_files_struct" implementations into one
get_files_struct() function to compliment put_files_struct().
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/exit.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index 0ec66729ead8..96d7394ccb26 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -385,6 +385,19 @@ static inline void close_files(struct files_struct * files) } } +struct files_struct *get_files_struct(struct task_struct *task) +{ + struct files_struct *files; + + task_lock(task); + files = task->files; + if (files) + atomic_inc(&files->count); + task_unlock(task); + + return files; +} + void fastcall put_files_struct(struct files_struct *files) { if (atomic_dec_and_test(&files->count)) { |
