diff options
| author | Len Brown <len.brown@intel.com> | 2010-08-15 01:06:31 -0400 |
|---|---|---|
| committer | Len Brown <len.brown@intel.com> | 2010-08-15 01:06:31 -0400 |
| commit | 95ee46aa8698f2000647dfb362400fadbb5807cf (patch) | |
| tree | e5a05c7297f997e191c73091934e42e3195c0e40 /fs/file_table.c | |
| parent | cfa806f059801dbe7e435745eb2e187c8bfe1e7f (diff) | |
| parent | 92fa5bd9a946b6e7aab6764e7312e4e3d9bed295 (diff) | |
Merge branch 'linus' into release
Conflicts:
drivers/acpi/debug.c
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'fs/file_table.c')
| -rw-r--r-- | fs/file_table.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/fs/file_table.c b/fs/file_table.c index 5c7d10ead4ad..edecd36fed9b 100644 --- a/fs/file_table.c +++ b/fs/file_table.c | |||
| @@ -289,11 +289,20 @@ struct file *fget(unsigned int fd) | |||
| 289 | EXPORT_SYMBOL(fget); | 289 | EXPORT_SYMBOL(fget); |
| 290 | 290 | ||
| 291 | /* | 291 | /* |
| 292 | * Lightweight file lookup - no refcnt increment if fd table isn't shared. | 292 | * Lightweight file lookup - no refcnt increment if fd table isn't shared. |
| 293 | * You can use this only if it is guranteed that the current task already | 293 | * |
| 294 | * holds a refcnt to that file. That check has to be done at fget() only | 294 | * You can use this instead of fget if you satisfy all of the following |
| 295 | * and a flag is returned to be passed to the corresponding fput_light(). | 295 | * conditions: |
| 296 | * There must not be a cloning between an fget_light/fput_light pair. | 296 | * 1) You must call fput_light before exiting the syscall and returning control |
| 297 | * to userspace (i.e. you cannot remember the returned struct file * after | ||
| 298 | * returning to userspace). | ||
| 299 | * 2) You must not call filp_close on the returned struct file * in between | ||
| 300 | * calls to fget_light and fput_light. | ||
| 301 | * 3) You must not clone the current task in between the calls to fget_light | ||
| 302 | * and fput_light. | ||
| 303 | * | ||
| 304 | * The fput_needed flag returned by fget_light should be passed to the | ||
| 305 | * corresponding fput_light. | ||
| 297 | */ | 306 | */ |
| 298 | struct file *fget_light(unsigned int fd, int *fput_needed) | 307 | struct file *fget_light(unsigned int fd, int *fput_needed) |
| 299 | { | 308 | { |
