Skip to content

Commit

Permalink
os/WBThrottle: added check of return value for posix_fadvise()
Browse files Browse the repository at this point in the history
check the return value of posix_fadvise() in WBThrottle::entry()

Signed-off-by: Xing Lin <[email protected]>
  • Loading branch information
xinglin committed Dec 3, 2013
1 parent de09778 commit 9c8df34
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/os/WBThrottle.cc
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,10 @@ void *WBThrottle::entry()
lock.Unlock();
::fdatasync(**wb.get<1>());
#ifdef HAVE_POSIX_FADVISE
if (wb.get<2>().nocache)
posix_fadvise(**wb.get<1>(), 0, 0, POSIX_FADV_DONTNEED);
if (wb.get<2>().nocache) {
int fa_r = posix_fadvise(**wb.get<1>(), 0, 0, POSIX_FADV_DONTNEED);
assert(fa_r == 0);
}
#endif
lock.Lock();
clearing = ghobject_t();
Expand Down

0 comments on commit 9c8df34

Please sign in to comment.