Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 208418
b: refs/heads/master
c: 5893947
h: refs/heads/master
v: v3
  • Loading branch information
Tony Battersby authored and Linus Torvalds committed Aug 11, 2010
1 parent e94c7f1 commit ebfcc50
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 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: 5a19ae4bb003a428b9c8367daf05eed5029dc4cd
refs/heads/master: 58939473bacf08e7e7346673c6d70bc367bd091a
19 changes: 14 additions & 5 deletions trunk/fs/file_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,11 +298,20 @@ struct file *fget(unsigned int fd)
EXPORT_SYMBOL(fget);

/*
* Lightweight file lookup - no refcnt increment if fd table isn't shared.
* You can use this only if it is guranteed that the current task already
* holds a refcnt to that file. That check has to be done at fget() only
* and a flag is returned to be passed to the corresponding fput_light().
* There must not be a cloning between an fget_light/fput_light pair.
* Lightweight file lookup - no refcnt increment if fd table isn't shared.
*
* You can use this instead of fget if you satisfy all of the following
* conditions:
* 1) You must call fput_light before exiting the syscall and returning control
* to userspace (i.e. you cannot remember the returned struct file * after
* returning to userspace).
* 2) You must not call filp_close on the returned struct file * in between
* calls to fget_light and fput_light.
* 3) You must not clone the current task in between the calls to fget_light
* and fput_light.
*
* The fput_needed flag returned by fget_light should be passed to the
* corresponding fput_light.
*/
struct file *fget_light(unsigned int fd, int *fput_needed)
{
Expand Down

0 comments on commit ebfcc50

Please sign in to comment.