Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Chris
Cam Test
Commits
27d91b20
Commit
27d91b20
authored
11 years ago
by
Pranav Vashi
Committed by
hellsgod
11 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Add new helpers
Signed-off-by:
Pranav Vashi
<
neobuddy89@gmail.com
>
parent
70c5b5f3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
include/linux/file.h
include/linux/file.h
+27
-0
No files found.
include/linux/file.h
View file @
27d91b20
...
...
@@ -26,10 +26,37 @@ static inline void fput_light(struct file *file, int fput_needed)
fput
(
file
);
}
struct
fd
{
struct
file
*
file
;
int
need_put
;
};
static
inline
void
fdput
(
struct
fd
fd
)
{
if
(
fd
.
need_put
)
fput
(
fd
.
file
);
}
extern
struct
file
*
fget
(
unsigned
int
fd
);
extern
struct
file
*
fget_light
(
unsigned
int
fd
,
int
*
fput_needed
);
static
inline
struct
fd
fdget
(
unsigned
int
fd
)
{
int
b
;
struct
file
*
f
=
fget_light
(
fd
,
&
b
);
return
(
struct
fd
){
f
,
b
};
}
extern
struct
file
*
fget_raw
(
unsigned
int
fd
);
extern
struct
file
*
fget_raw_light
(
unsigned
int
fd
,
int
*
fput_needed
);
static
inline
struct
fd
fdget_raw
(
unsigned
int
fd
)
{
int
b
;
struct
file
*
f
=
fget_raw_light
(
fd
,
&
b
);
return
(
struct
fd
){
f
,
b
};
}
extern
void
set_close_on_exec
(
unsigned
int
fd
,
int
flag
);
extern
void
put_filp
(
struct
file
*
);
extern
int
alloc_fd
(
unsigned
start
,
unsigned
flags
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment