diff options
author | Adam C. Emerson <aemerson@linuxbox.com> | 2013-05-23 19:09:40 -0700 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-09-04 17:49:36 -0700 |
commit | 0b4bde9881579eda06c16c4d6cd4e23a1c7a06e8 (patch) | |
tree | ec13c52cb0e6917d4acd17824667caf9be4b24d2 | |
parent | 7aba0682c60df13a9c2d46ca2ed4c05514077af2 (diff) | |
download | ceph-0b4bde9881579eda06c16c4d6cd4e23a1c7a06e8.tar.gz |
client: whitespace
Signed-off-by: Matt Benjamin <matt@linuxbox.com>
-rw-r--r-- | src/client/Client.cc | 151 | ||||
-rw-r--r-- | src/client/Client.h | 8 | ||||
-rw-r--r-- | src/client/Dentry.h | 10 | ||||
-rw-r--r-- | src/client/Fh.h | 2 | ||||
-rw-r--r-- | src/client/Inode.cc | 6 | ||||
-rw-r--r-- | src/client/Inode.h | 14 | ||||
-rw-r--r-- | src/client/SyntheticClient.cc | 7 |
7 files changed, 105 insertions, 93 deletions
diff --git a/src/client/Client.cc b/src/client/Client.cc index 77fd2084cf1..b35830b8594 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -1,4 +1,4 @@ -// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab /* * Ceph - scalable distributed file system @@ -7,9 +7,9 @@ * * This is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software + * License version 2.1, as published by the Free Software * Foundation. See file COPYING. - * + * */ @@ -134,7 +134,7 @@ bool Client::CommandHook::call(std::string command, cmdmap_t& cmdmap, dir_result_t::dir_result_t(Inode *in) : inode(in), offset(0), this_offset(2), next_offset(2), release_count(0), start_shared_gen(0), - buffer(0) { + buffer(0) { inode->get(); } @@ -165,7 +165,7 @@ Client::Client(Messenger *m, MonClient *mc) cwd = NULL; - // + // root = 0; num_flushing_caps = 0; @@ -198,7 +198,7 @@ Client::Client(Messenger *m, MonClient *mc) } -Client::~Client() +Client::~Client() { assert(!client_lock.is_locked()); @@ -567,7 +567,8 @@ void Client::update_inode_file_bits(Inode *in, } } -Inode * Client::add_update_inode(InodeStat *st, utime_t from, MetaSession *session) +Inode * Client::add_update_inode(InodeStat *st, utime_t from, + MetaSession *session) { Inode *in; bool was_new = false; @@ -642,7 +643,7 @@ Inode * Client::add_update_inode(InodeStat *st, utime_t from, MetaSession *sessi in->layout = st->layout; in->ctime = st->ctime; in->max_size = st->max_size; // right? - + update_inode_file_bits(in, st->truncate_seq, st->truncate_size, st->size, st->time_warp_seq, st->ctime, st->mtime, st->atime, issued); @@ -672,7 +673,7 @@ Inode * Client::add_update_inode(InodeStat *st, utime_t from, MetaSession *sessi unlink(in->dir->dentry_map.begin()->second, true); close_dir(in->dir); } - } + } return in; } @@ -688,11 +689,11 @@ Dentry *Client::insert_dentry_inode(Dir *dir, const string& dname, LeaseStat *dl Dentry *dn = NULL; if (dir->dentries.count(dname)) dn = dir->dentries[dname]; - + ldout(cct, 12) << "insert_dentry_inode '" << dname << "' vino " << in->vino() << " in dir " << dir->parent_inode->vino() << " dn " << dn << dendl; - + if (dn && dn->inode) { if (dn->inode->vino() == in->vino()) { touch_dn(dn); @@ -2068,8 +2069,8 @@ void Client::handle_lease(MClientLease *m) Dentry *dn = in->dir->dentries[m->dname]; ldout(cct, 10) << " revoked DN lease on " << dn << dendl; dn->lease_mds = -1; - } - + } + revoke: messenger->send_message(new MClientLease(CEPH_MDS_LEASE_RELEASE, seq, m->get_mask(), m->get_ino(), m->get_first(), m->get_last(), m->dname), @@ -2249,7 +2250,7 @@ int Client::get_caps(Inode *in, int need, int want, int *phave, loff_t endoff) in->wanted_max_size = endoff; check_caps(in, false); } - + if (endoff >= 0 && endoff > (loff_t)in->max_size) { ldout(cct, 10) << "waiting on max_size, endoff " << endoff << " max_size " << in->max_size << " on " << *in << dendl; } else if (!in->cap_snaps.empty() && in->cap_snaps.rbegin()->second->writing) { @@ -2377,7 +2378,7 @@ void Client::check_caps(Inode *in, bool is_delayed) else retain |= CEPH_CAP_ANY_SHARED; } - + ldout(cct, 10) << "check_caps on " << *in << " wanted " << ccap_string(wanted) << " used " << ccap_string(used) @@ -2386,13 +2387,13 @@ void Client::check_caps(Inode *in, bool is_delayed) if (in->snapid != CEPH_NOSNAP) return; //snap caps last forever, can't write - + if (in->caps.empty()) return; // guard if at end of func if (in->cap_snaps.size()) flush_snaps(in); - + if (!is_delayed) cap_delay_requeue(in); else @@ -3206,14 +3207,14 @@ inodeno_t Client::update_snap_trace(bufferlist& bl, bool flush) SnapRealm *realm = q.front(); q.pop_front(); ldout(cct, 10) << " flushing caps on " << *realm << dendl; - + xlist<Inode*>::iterator p = realm->inodes_with_caps.begin(); while (!p.end()) { Inode *in = *p; ++p; queue_cap_snap(in, realm->get_snap_context().seq); } - + for (set<SnapRealm*>::iterator p = realm->pchildren.begin(); p != realm->pchildren.end(); ++p) @@ -3547,7 +3548,7 @@ void Client::handle_cap_flushsnap_ack(MetaSession *session, Inode *in, MClientCa << " on " << *in << dendl; // we may not have it if we send multiple FLUSHSNAP requests and (got multiple FLUSHEDSNAPs back) } - + m->put(); } @@ -3560,14 +3561,13 @@ void Client::handle_cap_grant(MetaSession *session, Inode *in, Cap *cap, MClient const int old_caps = cap->issued; const int new_caps = m->get_caps(); ldout(cct, 5) << "handle_cap_grant on in " << m->get_ino() - << " mds." << mds << " seq " << m->get_seq() - << " caps now " << ccap_string(new_caps) - << " was " << ccap_string(old_caps) << dendl; - + << " mds." << mds << " seq " << m->get_seq() + << " caps now " << ccap_string(new_caps) + << " was " << ccap_string(old_caps) << dendl; cap->seq = m->get_seq(); in->layout = m->get_layout(); - + // update inode int implemented = 0; int issued = in->caps_issued(&implemented) | in->caps_dirty(); @@ -3684,7 +3684,7 @@ int Client::mount(const std::string &mount_root) << " and mdsmap " << mdsmap->get_epoch() << dendl; - + // hack: get+pin root inode. // fuse assumes it's always there. MetaRequest *req = new MetaRequest(CEPH_MDS_OP_GETATTR); @@ -3767,15 +3767,15 @@ void Client::unmount() // flush/release all buffered data hash_map<vinodeno_t, Inode*>::iterator next; for (hash_map<vinodeno_t, Inode*>::iterator p = inode_map.begin(); - p != inode_map.end(); - p = next) { + p != inode_map.end(); + p = next) { next = p; ++next; Inode *in = p->second; if (!in) { ldout(cct, 0) << "null inode_map entry ino " << p->first << dendl; assert(in); - } + } if (!in->caps.empty()) { in->get(); _release(in); @@ -3965,7 +3965,7 @@ int Client::_lookup(Inode *dir, const string& dname, Inode **target) r = -ENAMETOOLONG; goto done; } - + if (dname == cct->_conf->client_snapdir && dir->snapid == CEPH_NOSNAP) { *target = open_snapdir(dir); @@ -3982,7 +3982,7 @@ int Client::_lookup(Inode *dir, const string& dname, Inode **target) // is dn lease valid? utime_t now = ceph_clock_now(cct); - if (dn->lease_mds >= 0 && + if (dn->lease_mds >= 0 && dn->lease_ttl > now && mds_sessions.count(dn->lease_mds)) { MetaSession *s = mds_sessions[dn->lease_mds]; @@ -4367,11 +4367,13 @@ int Client::_getattr(Inode *in, int mask, int uid, int gid, bool force) return res; } -int Client::_setattr(Inode *in, struct stat *attr, int mask, int uid, int gid, Inode **inp) +int Client::_setattr(Inode *in, struct stat *attr, int mask, int uid, int gid, + Inode **inp) { int issued = in->caps_issued(); - ldout(cct, 10) << "_setattr mask " << mask << " issued " << ccap_string(issued) << dendl; + ldout(cct, 10) << "_setattr mask " << mask << " issued " << + ccap_string(issued) << dendl; if (in->snapid != CEPH_NOSNAP) { return -EROFS; @@ -5116,7 +5118,7 @@ int Client::readdir_r_cb(dir_result_t *d, add_dirent_cb_t cb, void *p) int err = _readdir_cache_cb(dirp, cb, p); if (err != -EAGAIN) return err; - } + } if (dirp->at_cache_name.length()) { dirp->last_name = dirp->at_cache_name; dirp->at_cache_name.clear(); @@ -5505,7 +5507,7 @@ int Client::_release_fh(Fh *f) in->snap_cap_refs--; } - put_inode( in ); + put_inode(in); delete f; return 0; @@ -5595,7 +5597,7 @@ loff_t Client::_lseek(Fh *f, loff_t offset, int whence) int r; switch (whence) { - case SEEK_SET: + case SEEK_SET: f->pos = offset; break; @@ -5613,7 +5615,7 @@ loff_t Client::_lseek(Fh *f, loff_t offset, int whence) default: assert(0); } - + ldout(cct, 3) << "_lseek(" << f << ", " << offset << ", " << whence << ") = " << f->pos << dendl; return f->pos; } @@ -5633,7 +5635,7 @@ void Client::lock_fh_pos(Fh *f) assert(f->pos_waiters.front() == &cond); f->pos_waiters.pop_front(); } - + f->pos_locked = true; } @@ -5644,11 +5646,11 @@ void Client::unlock_fh_pos(Fh *f) } -// +// // blocking osd interface -int Client::read(int fd, char *buf, loff_t size, loff_t offset) +int Client::read(int fd, char *buf, loff_t size, loff_t offset) { Mutex::Locker lock(client_lock); tout(cct) << "read" << std::endl; @@ -5795,7 +5797,7 @@ int Client::_read_async(Fh *f, uint64_t off, uint64_t len, bufferlist *bl) } } } - + // read (and possibly block) int r, rvalue = 0; Mutex flock("Client::_read_async flock"); @@ -5803,11 +5805,11 @@ int Client::_read_async(Fh *f, uint64_t off, uint64_t len, bufferlist *bl) bool done = false; Context *onfinish = new C_SafeCond(&flock, &cond, &done, &rvalue); r = objectcacher->file_read(&in->oset, &in->layout, in->snapid, - off, len, bl, 0, onfinish); + off, len, bl, 0, onfinish); if (r == 0) { client_lock.Unlock(); flock.Lock(); - while (!done) + while (!done) cond.Wait(flock); flock.Unlock(); client_lock.Lock(); @@ -5835,7 +5837,7 @@ int Client::_read_sync(Fh *f, uint64_t off, uint64_t len, bufferlist *bl) bool done = false; Context *onfinish = new C_SafeCond(&flock, &cond, &done, &r); bufferlist tbl; - + int wanted = left; filer->read_trunc(in->ino, &in->layout, in->snapid, pos, left, &tbl, 0, @@ -5961,7 +5963,7 @@ int Client::_write(Fh *f, int64_t offset, uint64_t size, const char *buf) // use/adjust fd pos? if (offset < 0) { lock_fh_pos(f); - /* + /* * FIXME: this is racy in that we may block _after_ this point waiting for caps, and size may * change out from under us. */ @@ -6038,6 +6040,7 @@ int Client::_write(Fh *f, int64_t offset, uint64_t size, const char *buf) client_lock.Unlock(); flock.Lock(); + while (!done) cond.Wait(flock); flock.Unlock(); @@ -6272,7 +6275,7 @@ int Client::statfs(const char *path, struct statvfs *stbuf) client_lock.Unlock(); lock.Lock(); - while (!done) + while (!done) cond.Wait(lock); lock.Unlock(); client_lock.Lock(); @@ -6517,7 +6520,7 @@ int Client::ll_lookup(vinodeno_t parent, const char *name, struct stat *attr, in void Client::_ll_get(Inode *in) { - if (in->ll_ref == 0) + if (in->ll_ref == 0) in->get(); in->ll_get(); ldout(cct, 20) << "_ll_get " << in << " " << in->ino << " -> " << in->ll_ref << dendl; @@ -6812,6 +6815,7 @@ int Client::_listxattr(Inode *in, char *name, size_t size, int uid, int gid) p != in->xattrs.end(); ++p) r += p->first.length() + 1; + if (in->is_file()) r += sizeof(file_vxattrs); else if (in->is_dir() && in->has_dir_layout()) @@ -6879,11 +6883,12 @@ int Client::_setxattr(Inode *in, const char *name, const void *value, size_t siz bufferlist bl; bl.append((const char*)value, size); req->set_data(bl); - + int res = make_request(req, uid, gid); trim_cache(); - ldout(cct, 3) << "_setxattr(" << in->ino << ", \"" << name << "\") = " << res << dendl; + ldout(cct, 3) << "_setxattr(" << in->ino << ", \"" << name << "\") = " << + res << dendl; return res; } @@ -6968,8 +6973,9 @@ int Client::ll_readlink(vinodeno_t vino, const char **value, int uid, int gid) int Client::_mknod(Inode *dir, const char *name, mode_t mode, dev_t rdev, int uid, int gid, Inode **inp) { - ldout(cct, 3) << "_mknod(" << dir->ino << " " << name << ", 0" << oct << mode << dec << ", " << rdev - << ", uid " << uid << ", gid " << gid << ")" << dendl; + ldout(cct, 3) << "_mknod(" << dir->ino << " " << name << ", 0" << oct + << mode << dec << ", " << rdev << ", uid " << uid << ", gid " + << gid << ")" << dendl; if (strlen(name) > NAME_MAX) return -ENAMETOOLONG; @@ -7034,7 +7040,8 @@ int Client::ll_mknod(vinodeno_t parent, const char *name, mode_t mode, dev_t rde int Client::_create(Inode *dir, const char *name, int flags, mode_t mode, Inode **inp, Fh **fhp, int stripe_unit, int stripe_count, int object_size, const char *data_pool, bool *created, int uid, int gid) { - ldout(cct, 3) << "_create(" << dir->ino << " " << name << ", 0" << oct << mode << dec << ")" << dendl; + ldout(cct, 3) << "_create(" << dir->ino << " " << name << ", 0" << oct << + mode << dec << ")" << dendl; if (strlen(name) > NAME_MAX) return -ENAMETOOLONG; @@ -7108,8 +7115,9 @@ int Client::_create(Inode *dir, const char *name, int flags, mode_t mode, Inode int Client::_mkdir(Inode *dir, const char *name, mode_t mode, int uid, int gid, Inode **inp) { - ldout(cct, 3) << "_mkdir(" << dir->ino << " " << name << ", 0" << oct << mode << dec - << ", uid " << uid << ", gid " << gid << ")" << dendl; + ldout(cct, 3) << "_mkdir(" << dir->ino << " " << name << ", 0" << oct + << mode << dec << ", uid " << uid << ", gid " << gid << ")" + << dendl; if (strlen(name) > NAME_MAX) return -ENAMETOOLONG; @@ -7117,7 +7125,8 @@ int Client::_mkdir(Inode *dir, const char *name, mode_t mode, int uid, int gid, if (dir->snapid != CEPH_NOSNAP && dir->snapid != CEPH_SNAPDIR) { return -EROFS; } - MetaRequest *req = new MetaRequest(dir->snapid == CEPH_SNAPDIR ? CEPH_MDS_OP_MKSNAP:CEPH_MDS_OP_MKDIR); + MetaRequest *req = new MetaRequest(dir->snapid == CEPH_SNAPDIR ? + CEPH_MDS_OP_MKSNAP : CEPH_MDS_OP_MKDIR); filepath path; dir->make_nosnap_relative_path(path); @@ -7126,7 +7135,7 @@ int Client::_mkdir(Inode *dir, const char *name, mode_t mode, int uid, int gid, req->set_inode(dir); req->head.args.mkdir.mode = mode; req->dentry_drop = CEPH_CAP_FILE_SHARED; - req->dentry_unless = CEPH_CAP_FILE_EXCL; + req->dentry_unless = CEPH_CAP_FILE_EXCL; Dentry *de; int res = get_or_create(dir, name, &de); @@ -7171,8 +7180,8 @@ int Client::ll_mkdir(vinodeno_t parent, const char *name, mode_t mode, struct st return r; } -int Client::_symlink(Inode *dir, const char *name, const char *target, int uid, int gid, - Inode **inp) +int Client::_symlink(Inode *dir, const char *name, const char *target, int uid, + int gid, Inode **inp) { ldout(cct, 3) << "_symlink(" << dir->ino << " " << name << ", " << target << ", uid " << uid << ", gid " << gid << ")" << dendl; @@ -7204,10 +7213,10 @@ int Client::_symlink(Inode *dir, const char *name, const char *target, int uid, res = make_request(req, uid, gid, inp); trim_cache(); - ldout(cct, 3) << "_symlink(\"" << path << "\", \"" << target << "\") = " << res << dendl; + ldout(cct, 3) << "_symlink(\"" << path << "\", \"" << target << "\") = " << + res << dendl; return res; - fail: put_request(req); return res; @@ -7299,7 +7308,8 @@ int Client::ll_unlink(vinodeno_t vino, const char *name, int uid, int gid) int Client::_rmdir(Inode *dir, const char *name, int uid, int gid) { - ldout(cct, 3) << "_rmdir(" << dir->ino << " " << name << " uid " << uid << " gid " << gid << ")" << dendl; + ldout(cct, 3) << "_rmdir(" << dir->ino << " " << name << " uid " << uid << + " gid " << gid << ")" << dendl; if (dir->snapid != CEPH_NOSNAP && dir->snapid != CEPH_SNAPDIR) { return -EROFS; @@ -7331,7 +7341,7 @@ int Client::_rmdir(Inode *dir, const char *name, int uid, int gid) if (dir->dir && dir->dir->dentries.count(name) ) { Dentry *dn = dir->dir->dentries[name]; if (dn->inode->dir && dn->inode->dir->is_empty() && - (dn->inode->dn_set.size() == 1)) + (dn->inode->dn_set.size() == 1)) close_dir(dn->inode->dir); // FIXME: maybe i shoudl proactively hose the whole subtree from cache? unlink(dn, false); } @@ -7658,14 +7668,16 @@ int Client::ll_read(Fh *fh, loff_t off, loff_t len, bufferlist *bl) int Client::ll_write(Fh *fh, loff_t off, loff_t len, const char *data) { Mutex::Locker lock(client_lock); - ldout(cct, 3) << "ll_write " << fh << " " << fh->inode->ino << " " << off << "~" << len << dendl; + ldout(cct, 3) << "ll_write " << fh << " " << fh->inode->ino << " " << off << + "~" << len << dendl; tout(cct) << "ll_write" << std::endl; tout(cct) << (unsigned long)fh << std::endl; tout(cct) << off << std::endl; tout(cct) << len << std::endl; int r = _write(fh, off, len, data); - ldout(cct, 3) << "ll_write " << fh << " " << off << "~" << len << " = " << r << dendl; + ldout(cct, 3) << "ll_write " << fh << " " << off << "~" << len << " = " << r + << dendl; return r; } @@ -7679,7 +7691,7 @@ int Client::ll_flush(Fh *fh) return _flush(fh); } -int Client::ll_fsync(Fh *fh, bool syncdataonly) +int Client::ll_fsync(Fh *fh, bool syncdataonly) { Mutex::Locker lock(client_lock); ldout(cct, 3) << "ll_fsync " << fh << " " << fh->inode->ino << " " << dendl; @@ -7797,8 +7809,9 @@ int Client::fallocate(int fd, int mode, loff_t offset, loff_t length) int Client::ll_release(Fh *fh) { Mutex::Locker lock(client_lock); - ldout(cct, 3) << "ll_release " << fh << " " << fh->inode->ino << " " << dendl; - tout(cct) << "ll_release" << std::endl; + ldout(cct, 3) << "ll_release (fh)" << fh << " " << fh->inode->ino << " " << + dendl; + tout(cct) << "ll_release (fh)" << std::endl; tout(cct) << (unsigned long)fh << std::endl; _release_fh(fh); @@ -8004,7 +8017,7 @@ void Client::ms_handle_connect(Connection *con) objecter->ms_handle_connect(con); } -bool Client::ms_handle_reset(Connection *con) +bool Client::ms_handle_reset(Connection *con) { ldout(cct, 0) << "ms_handle_reset on " << con->get_peer_addr() << dendl; Mutex::Locker l(client_lock); @@ -8012,7 +8025,7 @@ bool Client::ms_handle_reset(Connection *con) return false; } -void Client::ms_handle_remote_reset(Connection *con) +void Client::ms_handle_remote_reset(Connection *con) { ldout(cct, 0) << "ms_handle_remote_reset on " << con->get_peer_addr() << dendl; Mutex::Locker l(client_lock); diff --git a/src/client/Client.h b/src/client/Client.h index c7c9cef0e0c..15b10a97008 100644 --- a/src/client/Client.h +++ b/src/client/Client.h @@ -7,9 +7,9 @@ * * This is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software + * License version 2.1, as published by the Free Software * Foundation. See file COPYING. - * + * */ @@ -203,7 +203,7 @@ class Client : public Dispatcher { CommandHook m_command_hook; // cluster descriptors - MDSMap *mdsmap; + MDSMap *mdsmap; OSDMap *osdmap; SafeTimer timer; @@ -685,7 +685,7 @@ public: int get_file_extent_osds(int fd, loff_t off, loff_t *len, vector<int>& osds); int get_osd_addr(int osd, entity_addr_t& addr); - // expose osdmap + // expose osdmap int get_local_osd(); int get_pool_replication(int64_t pool); int64_t get_pool_id(const char *pool_name); diff --git a/src/client/Dentry.h b/src/client/Dentry.h index 932f17dbafc..c51a87cb88c 100644 --- a/src/client/Dentry.h +++ b/src/client/Dentry.h @@ -19,18 +19,18 @@ class Dentry : public LRUObject { uint64_t lease_gen; ceph_seq_t lease_seq; int cap_shared_gen; - + /* * ref==1 -> cached, unused * ref >1 -> pinned in lru */ - void get() { + void get() { assert(ref > 0); if (++ref == 2) - lru_pin(); + lru_pin(); //cout << "dentry.get on " << this << " " << name << " now " << ref << std::endl; } - void put() { + void put() { assert(ref > 0); if (--ref == 1) lru_unpin(); @@ -40,7 +40,7 @@ class Dentry : public LRUObject { } void dump(Formatter *f) const; - + Dentry() : dir(0), inode(0), ref(1), offset(0), lease_mds(-1), lease_gen(0), lease_seq(0), cap_shared_gen(0) { } private: ~Dentry() { diff --git a/src/client/Fh.h b/src/client/Fh.h index 3c573c2c14e..083ccd1ad59 100644 --- a/src/client/Fh.h +++ b/src/client/Fh.h @@ -10,7 +10,7 @@ class Cond; struct Fh { Inode *inode; - loff_t pos; + loff_t pos; int mds; // have to talk to mds we opened with (for now) int mode; // the mode i opened the file with diff --git a/src/client/Inode.cc b/src/client/Inode.cc index 1a9962453a8..4e53e14bd24 100644 --- a/src/client/Inode.cc +++ b/src/client/Inode.cc @@ -21,7 +21,7 @@ ostream& operator<<(ostream &out, Inode &in) out << "("; for (map<int,Cap*>::iterator p = in.caps.begin(); p != in.caps.end(); ++p) { if (p != in.caps.begin()) - out << ','; + out << ','; out << p->first << '=' << ccap_string(p->second->issued); } out << ")"; @@ -126,7 +126,7 @@ bool Inode::put_cap_ref(int cap) assert(cap_refs[c] > 0); } if (--cap_refs[c] == 0) - last = true; + last = true; //cout << "inode " << *this << " put " << cap_string(c) << " " << (cap_refs[c]+1) << " -> " << cap_refs[c] << std::endl; } cap >>= 1; @@ -140,7 +140,7 @@ bool Inode::is_any_caps() return caps.size() || exporting_mds >= 0; } -bool Inode::cap_is_valid(Cap* cap) +bool Inode::cap_is_valid(Cap* cap) { /*cout << "cap_gen " << cap->session-> cap_gen << std::endl << "session gen " << cap->gen << std::endl diff --git a/src/client/Inode.h b/src/client/Inode.h index cc054a654fa..a9420e1c454 100644 --- a/src/client/Inode.h +++ b/src/client/Inode.h @@ -58,7 +58,7 @@ struct CapSnap { xlist<CapSnap*>::item flushing_item; CapSnap(Inode *i) - : in(i), issued(0), dirty(0), + : in(i), issued(0), dirty(0), size(0), time_warp_seq(0), mode(0), uid(0), gid(0), xattr_version(0), writing(false), dirty_data(false), flush_tid(0), flushing_item(this) @@ -89,7 +89,7 @@ class Inode { gid_t gid; // nlink - int32_t nlink; + int32_t nlink; // file (data access) ceph_dir_layout dir_layout; @@ -106,7 +106,7 @@ class Inode { // dirfrag, recursive accountin frag_info_t dirstat; nest_info_t rstat; - + // special stuff version_t version; // auth only version_t xattr_version; @@ -176,16 +176,16 @@ class Inode { void make_long_path(filepath& p); void make_nosnap_relative_path(filepath& p); - void get() { - _ref++; + void get() { + _ref++; lsubdout(cct, mds, 15) << "inode.get on " << this << " " << ino << '.' << snapid - << " now " << _ref << dendl; + << " now " << _ref << dendl; } /// private method to put a reference; see Client::put_inode() int _put(int n=1) { _ref -= n; lsubdout(cct, mds, 15) << "inode.put on " << this << " " << ino << '.' << snapid - << " now " << _ref << dendl; + << " now " << _ref << dendl; assert(_ref >= 0); return _ref; } diff --git a/src/client/SyntheticClient.cc b/src/client/SyntheticClient.cc index cb211f5461b..376b7ff0384 100644 --- a/src/client/SyntheticClient.cc +++ b/src/client/SyntheticClient.cc @@ -1003,7 +1003,6 @@ void SyntheticClient::up() clear_dir(); } - int SyntheticClient::play_trace(Trace& t, string& prefix, bool metadata_only) { dout(4) << "play trace prefix '" << prefix << "'" << dendl; @@ -1015,7 +1014,7 @@ int SyntheticClient::play_trace(Trace& t, string& prefix, bool metadata_only) utime_t start = ceph_clock_now(g_ceph_context); hash_map<int64_t, int64_t> open_files; - hash_map<int64_t, dir_result_t*> open_dirs; + hash_map<int64_t, dir_result_t*> open_dirs; hash_map<int64_t, Fh*> ll_files; hash_map<int64_t, void*> ll_dirs; @@ -1038,7 +1037,7 @@ int SyntheticClient::play_trace(Trace& t, string& prefix, bool metadata_only) utime_t last_status = start; - + int n = 0; // for object traces @@ -1394,7 +1393,7 @@ int SyntheticClient::play_trace(Trace& t, string& prefix, bool metadata_only) int64_t i = t.get_int(); if (ll_inos.count(i)) {} //client->ll_statfs(vinodeno_t(ll_inos[i],CEPH_NOSNAP)); - } + } // object-level traces |