Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
80f2ba7f
Commit
80f2ba7f
authored
Dec 14, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lib/nfs/Connection: move code to Service()
parent
32bca649
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
12 deletions
+28
-12
Connection.cxx
src/lib/nfs/Connection.cxx
+23
-12
Connection.hxx
src/lib/nfs/Connection.hxx
+5
-0
No files found.
src/lib/nfs/Connection.cxx
View file @
80f2ba7f
...
@@ -404,20 +404,11 @@ NfsConnection::ScheduleSocket()
...
@@ -404,20 +404,11 @@ NfsConnection::ScheduleSocket()
SocketMonitor
::
Schedule
(
libnfs_to_events
(
nfs_which_events
(
context
)));
SocketMonitor
::
Schedule
(
libnfs_to_events
(
nfs_which_events
(
context
)));
}
}
bool
inline
int
NfsConnection
::
OnSocketReady
(
unsigned
flags
)
NfsConnection
::
Service
(
unsigned
flags
)
{
{
assert
(
GetEventLoop
().
IsInside
());
assert
(
GetEventLoop
().
IsInside
());
assert
(
deferred_close
.
empty
());
assert
(
context
!=
nullptr
);
bool
closed
=
false
;
const
bool
was_mounted
=
mount_finished
;
if
(
!
mount_finished
)
/* until the mount is finished, the NFS client may use
various sockets, therefore we unregister and
re-register it each time */
SocketMonitor
::
Steal
();
#ifndef NDEBUG
#ifndef NDEBUG
assert
(
!
in_event
);
assert
(
!
in_event
);
...
@@ -435,6 +426,26 @@ NfsConnection::OnSocketReady(unsigned flags)
...
@@ -435,6 +426,26 @@ NfsConnection::OnSocketReady(unsigned flags)
in_service
=
false
;
in_service
=
false
;
#endif
#endif
return
result
;
}
bool
NfsConnection
::
OnSocketReady
(
unsigned
flags
)
{
assert
(
GetEventLoop
().
IsInside
());
assert
(
deferred_close
.
empty
());
bool
closed
=
false
;
const
bool
was_mounted
=
mount_finished
;
if
(
!
mount_finished
)
/* until the mount is finished, the NFS client may use
various sockets, therefore we unregister and
re-register it each time */
SocketMonitor
::
Steal
();
const
int
result
=
Service
(
flags
);
while
(
!
deferred_close
.
empty
())
{
while
(
!
deferred_close
.
empty
())
{
InternalClose
(
deferred_close
.
front
());
InternalClose
(
deferred_close
.
front
());
deferred_close
.
pop_front
();
deferred_close
.
pop_front
();
...
...
src/lib/nfs/Connection.hxx
View file @
80f2ba7f
...
@@ -207,6 +207,11 @@ private:
...
@@ -207,6 +207,11 @@ private:
void
ScheduleSocket
();
void
ScheduleSocket
();
/**
* Wrapper for nfs_service().
*/
int
Service
(
unsigned
flags
);
/* virtual methods from SocketMonitor */
/* virtual methods from SocketMonitor */
virtual
bool
OnSocketReady
(
unsigned
flags
)
override
;
virtual
bool
OnSocketReady
(
unsigned
flags
)
override
;
...
...
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