Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
a5b470ba
Commit
a5b470ba
authored
Aug 27, 2012
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new helpers: fdget()/fdput()
Signed-off-bs: Al Viro <viro@zeniv.linux.org.uk>
parent
2a117354
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
include/linux/file.h
include/linux/file.h
+26
-0
No files found.
include/linux/file.h
View file @
a5b470ba
...
...
@@ -26,8 +26,34 @@ 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
};
}
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
struct
file
*
fget_raw
(
unsigned
int
fd
);
extern
struct
file
*
fget_raw_light
(
unsigned
int
fd
,
int
*
fput_needed
);
extern
int
f_dupfd
(
unsigned
int
from
,
struct
file
*
file
,
unsigned
flags
);
...
...
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