Skip to content

Commit

Permalink
Coding style and remove unused debug log.
Browse files Browse the repository at this point in the history
  • Loading branch information
ibwroot committed Feb 21, 2017
1 parent 29ad18f commit feb03a0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
5 changes: 3 additions & 2 deletions fuse_lowlevel/bfs_ll_mount.cc
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,11 @@ static void dirbuf_add(fuse_req_t req, struct dirbuf *b, const char *name,

static int reply_buf_limited(fuse_req_t req, const char *buf, size_t bufsize,
off_t off, size_t maxsize) {
if (bufsize - off > 0)
if (bufsize - off > 0) {
return fuse_reply_buf(req, buf + off, min(bufsize - off, maxsize));
else
} else {
return fuse_reply_buf(req, NULL, 0);
}
}

static void bfs_ll_readdir(fuse_req_t req, fuse_ino_t ino,
Expand Down
11 changes: 3 additions & 8 deletions src/nameserver/namespace.cc
Original file line number Diff line number Diff line change
Expand Up @@ -243,14 +243,13 @@ bool NameSpace::IGet(int64_t entry_id, FileInfo * info) {

//unfinshed, consistency not guranteed, to be continue
bool NameSpace::DeleteFileInfo(const std::string file_key, NameServerLog* log) {
int64_t entry_id;
std::string file_key_i;
FileInfo info;
if (!GetFromStore(file_key, &info)) {
LOG(INFO, "DeleteFileInfo GetFromStore for entry_id return false");
return false;
}
entry_id = info.entry_id();
int64_t entry_id = info.entry_id();
LOG(DEBUG, "DeleteFileInfo get entry_id from db_ E%ld return true", entry_id);
leveldb::Status s = db_->Delete(leveldb::WriteOptions(), file_key);
if (!s.ok()) {
Expand Down Expand Up @@ -315,8 +314,6 @@ StatusCode NameSpace::BuildPath(const std::string& path, FileInfo* file_info, st
LOG(INFO, "path split fail %s", path.c_str());
return kBadParameter;
}
LOG(INFO, "path split %s", path.c_str());
LOG(INFO, "path[0] %s", paths[0].c_str());

/// Find parent directory, create if not exist.
int64_t parent_id = kRootEntryid;
Expand Down Expand Up @@ -770,14 +767,12 @@ StatusCode NameSpace::InternalDeleteDirectory(const FileInfo& dir_info,

leveldb::Status s = db_->Write(leveldb::WriteOptions(), &batch);
if (!s.ok()) {
LOG(INFO, "Unlink dentry fail: %s\n", dir_info.name().c_str());
LOG(FATAL, "Namespace write to db_ fail!");
LOG(FATAL, "Unlink dentry write to db_ fail: %s\n", dir_info.name().c_str());
return kUpdateError;
}
s = db_i->Write(leveldb::WriteOptions(), &batch);
if (!s.ok()) {
LOG(INFO, "Unlink dentry fail: %s\n", dir_info.name().c_str());
LOG(FATAL, "Namespace write to db_i fail!");
LOG(FATAL, "Unlink dentry write to db_i fail: %s\n", dir_info.name().c_str());
return kUpdateError;
}
LOG(INFO, "Delete directory done: %s[%s]",
Expand Down
2 changes: 1 addition & 1 deletion src/sdk/bfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class File {
};

struct BfsFileInfo {
uint64_t ino;
int64_t ino;
int64_t size;
uint32_t ctime;
uint32_t mode;
Expand Down

0 comments on commit feb03a0

Please sign in to comment.