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 47733e5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
10 changes: 5 additions & 5 deletions fuse_lowlevel/bfs_ll_mount.cc
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,13 @@ static void bfs_ll_lookup(fuse_req_t req, fuse_ino_t parent, const char *name) {

struct dirbuf {
char *p;
uint32_t size_used;
int32_t size_used;
};

static void dirbuf_add(fuse_req_t req, struct dirbuf *b, const char *name,
fuse_ino_t ino) {
struct stat st;
size_t oldsize = b->size_used;
int32_t oldsize = b->size_used;
b->size_used += fuse_add_direntry(req, NULL, 0, name, NULL, 0);
b->p = (char *) realloc(b->p, b->size_used);
memset(&st, 0, sizeof(st));
Expand All @@ -159,9 +159,9 @@ static void dirbuf_add(fuse_req_t req, struct dirbuf *b, const char *name,
b->size_used);
}

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)
static int reply_buf_limited(fuse_req_t req, const char *buf, int32_t bufsize,
off_t off, int32_t maxsize) {
if (bufsize > off)
return fuse_reply_buf(req, buf + off, min(bufsize - off, maxsize));
else
return fuse_reply_buf(req, NULL, 0);
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 47733e5

Please sign in to comment.