Skip to content

Commit

Permalink
update comments and whitespace issues per code review.
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewVon committed Jul 22, 2013
1 parent 7bb846b commit cc0ff65
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 29 deletions.
6 changes: 3 additions & 3 deletions include/leveldb/env.h
Expand Up @@ -83,9 +83,9 @@ class Env {
WritableFile** result) = 0;

// Riak specific:
// Derived from NewWritableFile. Special version of
// NewWritableFile that enables write and close operations
// to execute on background threads (where supported).
// Allows for virtualized version of NewWritableFile that enables write
// and close operations to execute on background threads
// (where platform supported).
//
// The returned file will only be accessed by one thread at a time.
virtual Status NewWriteOnlyFile(const std::string& fname,
Expand Down
50 changes: 25 additions & 25 deletions util/env_posix.cc
Expand Up @@ -1079,11 +1079,11 @@ void BGFileCloser(void * arg)
if (0 != file_ptr->unused_)
{
ret_val=ftruncate(file_ptr->fd_, file_ptr->offset_ + file_ptr->length_ - file_ptr->unused_);
if (0!=ret_val)
{
syslog(LOG_ERR,"BGFileCloser ftruncate failed [%d, %m]", errno);
err_flag=true;
} // if
if (0!=ret_val)
{
syslog(LOG_ERR,"BGFileCloser ftruncate failed [%d, %m]", errno);
err_flag=true;
} // if
}

close(file_ptr->fd_);
Expand Down Expand Up @@ -1122,38 +1122,38 @@ void BGFileCloser2(void * arg)
{
// must fdatasync for DONTNEED to work
ret_val=fdatasync(file_ptr->fd_);
if (0!=ret_val)
{
syslog(LOG_ERR,"BGFileCloser2 fdatasync failed [%d, %m]", errno);
err_flag=true;
} // if
if (0!=ret_val)
{
syslog(LOG_ERR,"BGFileCloser2 fdatasync failed [%d, %m]", errno);
err_flag=true;
} // if

ret_val=posix_fadvise(file_ptr->fd_, file_ptr->offset_, file_ptr->length_, POSIX_FADV_DONTNEED);
if (0!=ret_val)
{
syslog(LOG_ERR,"BGFileCloser2 posix_fadvise DONTNEED failed [%d, %m]", errno);
err_flag=true;
} // if
if (0!=ret_val)
{
syslog(LOG_ERR,"BGFileCloser2 posix_fadvise DONTNEED failed [%d, %m]", errno);
err_flag=true;
} // if
} // if
else
{
ret_val=posix_fadvise(file_ptr->fd_, file_ptr->offset_, file_ptr->length_, POSIX_FADV_WILLNEED);
if (0!=ret_val)
{
syslog(LOG_ERR,"BGFileCloser2 posix_fadvise WILLNEED failed [%d, %m]", errno);
err_flag=true;
} // if
if (0!=ret_val)
{
syslog(LOG_ERR,"BGFileCloser2 posix_fadvise WILLNEED failed [%d, %m]", errno);
err_flag=true;
} // if
} // else
#endif

if (0 != file_ptr->unused_)
{
ret_val=ftruncate(file_ptr->fd_, file_ptr->offset_ + file_ptr->length_ - file_ptr->unused_);
if (0!=ret_val)
{
syslog(LOG_ERR,"BGFileCloser2 ftruncate failed [%d, %m]", errno);
err_flag=true;
} // if
if (0!=ret_val)
{
syslog(LOG_ERR,"BGFileCloser2 ftruncate failed [%d, %m]", errno);
err_flag=true;
} // if
}
close(file_ptr->fd_);
delete file_ptr;
Expand Down
2 changes: 1 addition & 1 deletion util/perf_count.cc
Expand Up @@ -515,7 +515,7 @@ PerformanceCounters * gPerfCounters(&LocalStartupCounters);
"ThrottleKeys1",
"ThrottleBacklog1",
"ThrottleCompacts1",
"BGWriteError"
"BGWriteError"
};


Expand Down

0 comments on commit cc0ff65

Please sign in to comment.