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
fc7478a2
Commit
fc7478a2
authored
Mar 21, 2013
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pipe: switch wait_for_partner() and wake_up_partner() to pipe_inode_info
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
599a0ac1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
fs/pipe.c
fs/pipe.c
+9
-9
No files found.
fs/pipe.c
View file @
fc7478a2
...
...
@@ -986,21 +986,21 @@ SYSCALL_DEFINE1(pipe, int __user *, fildes)
return
sys_pipe2
(
fildes
,
0
);
}
static
int
wait_for_partner
(
struct
inode
*
inod
e
,
unsigned
int
*
cnt
)
static
int
wait_for_partner
(
struct
pipe_inode_info
*
pip
e
,
unsigned
int
*
cnt
)
{
int
cur
=
*
cnt
;
while
(
cur
==
*
cnt
)
{
pipe_wait
(
inode
->
i_
pipe
);
pipe_wait
(
pipe
);
if
(
signal_pending
(
current
))
break
;
}
return
cur
==
*
cnt
?
-
ERESTARTSYS
:
0
;
}
static
void
wake_up_partner
(
struct
inode
*
inod
e
)
static
void
wake_up_partner
(
struct
pipe_inode_info
*
pip
e
)
{
wake_up_interruptible
(
&
inode
->
i_
pipe
->
wait
);
wake_up_interruptible
(
&
pipe
->
wait
);
}
static
int
fifo_open
(
struct
inode
*
inode
,
struct
file
*
filp
)
...
...
@@ -1032,7 +1032,7 @@ static int fifo_open(struct inode *inode, struct file *filp)
*/
pipe
->
r_counter
++
;
if
(
pipe
->
readers
++
==
0
)
wake_up_partner
(
inod
e
);
wake_up_partner
(
pip
e
);
if
(
!
is_pipe
&&
!
pipe
->
writers
)
{
if
((
filp
->
f_flags
&
O_NONBLOCK
))
{
...
...
@@ -1040,7 +1040,7 @@ static int fifo_open(struct inode *inode, struct file *filp)
* seen a writer */
filp
->
f_version
=
pipe
->
w_counter
;
}
else
{
if
(
wait_for_partner
(
inod
e
,
&
pipe
->
w_counter
))
if
(
wait_for_partner
(
pip
e
,
&
pipe
->
w_counter
))
goto
err_rd
;
}
}
...
...
@@ -1058,10 +1058,10 @@ static int fifo_open(struct inode *inode, struct file *filp)
pipe
->
w_counter
++
;
if
(
!
pipe
->
writers
++
)
wake_up_partner
(
inod
e
);
wake_up_partner
(
pip
e
);
if
(
!
is_pipe
&&
!
pipe
->
readers
)
{
if
(
wait_for_partner
(
inod
e
,
&
pipe
->
r_counter
))
if
(
wait_for_partner
(
pip
e
,
&
pipe
->
r_counter
))
goto
err_wr
;
}
break
;
...
...
@@ -1079,7 +1079,7 @@ static int fifo_open(struct inode *inode, struct file *filp)
pipe
->
r_counter
++
;
pipe
->
w_counter
++
;
if
(
pipe
->
readers
==
1
||
pipe
->
writers
==
1
)
wake_up_partner
(
inod
e
);
wake_up_partner
(
pip
e
);
break
;
default:
...
...
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