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
7fa1a84e
Commit
7fa1a84e
authored
Dec 14, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lib/nfs/Connection: move code to method InternalClose()
parent
ab4bb26a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
3 deletions
+17
-3
Connection.cxx
src/lib/nfs/Connection.cxx
+12
-3
Connection.hxx
src/lib/nfs/Connection.hxx
+5
-0
No files found.
src/lib/nfs/Connection.cxx
View file @
7fa1a84e
...
@@ -331,12 +331,22 @@ DummyCallback(int, struct nfs_context *, void *, void *)
...
@@ -331,12 +331,22 @@ DummyCallback(int, struct nfs_context *, void *, void *)
{
{
}
}
inline
void
NfsConnection
::
InternalClose
(
struct
nfsfh
*
fh
)
{
assert
(
GetEventLoop
().
IsInside
());
assert
(
context
!=
nullptr
);
assert
(
fh
!=
nullptr
);
nfs_close_async
(
context
,
fh
,
DummyCallback
,
nullptr
);
}
void
void
NfsConnection
::
Close
(
struct
nfsfh
*
fh
)
NfsConnection
::
Close
(
struct
nfsfh
*
fh
)
{
{
assert
(
GetEventLoop
().
IsInside
());
assert
(
GetEventLoop
().
IsInside
());
nfs_close_async
(
context
,
fh
,
DummyCallback
,
nullptr
);
InternalClose
(
fh
);
ScheduleSocket
();
ScheduleSocket
();
}
}
...
@@ -424,8 +434,7 @@ NfsConnection::OnSocketReady(unsigned flags)
...
@@ -424,8 +434,7 @@ NfsConnection::OnSocketReady(unsigned flags)
#endif
#endif
while
(
!
deferred_close
.
empty
())
{
while
(
!
deferred_close
.
empty
())
{
nfs_close_async
(
context
,
deferred_close
.
front
(),
InternalClose
(
deferred_close
.
front
());
DummyCallback
,
nullptr
);
deferred_close
.
pop_front
();
deferred_close
.
pop_front
();
}
}
...
...
src/lib/nfs/Connection.hxx
View file @
7fa1a84e
...
@@ -187,6 +187,11 @@ private:
...
@@ -187,6 +187,11 @@ private:
void
DestroyContext
();
void
DestroyContext
();
/**
/**
* Wrapper for nfs_close_async().
*/
void
InternalClose
(
struct
nfsfh
*
fh
);
/**
* Invoke nfs_close_async() after nfs_service() returns.
* Invoke nfs_close_async() after nfs_service() returns.
*/
*/
void
DeferClose
(
struct
nfsfh
*
fh
);
void
DeferClose
(
struct
nfsfh
*
fh
);
...
...
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