/* getdir result */
struct DirEntry {
- explicit DirEntry(const string &s) : d_name(s), stmask(0) {}
- DirEntry(const string &n, struct stat& s, int stm) : d_name(n), st(s), stmask(stm) {}
+ explicit DirEntry(const std::string &s) : d_name(s), stmask(0) {}
+ DirEntry(const std::string &n, struct stat& s, int stm)
+ : d_name(n), st(s), stmask(stm) {}
- string d_name;
+ std::string d_name;
struct stat st;
int stmask;
};
// ((frag value) << 28) | (the nth entry in frag);
unsigned next_offset; // offset of next chunk (last_name's + 1)
- string last_name; // last entry in previous chunk
+ std::string last_name; // last entry in previous chunk
uint64_t release_count;
uint64_t ordered_count;
frag_t buffer_frag;
- vector<dentry> buffer;
+ std::vector<dentry> buffer;
struct dirent de;
};
int readdir_r(dir_result_t *dirp, struct dirent *de);
int readdirplus_r(dir_result_t *dirp, struct dirent *de, struct ceph_statx *stx, unsigned want, unsigned flags, Inode **out);
- int getdir(const char *relpath, list<string>& names,
+ int getdir(const char *relpath, std::list<std::string>& names,
const UserPerm& perms); // get the whole dir at once.
/**
int describe_layout(const char *path, file_layout_t* layout,
const UserPerm& perms);
int fdescribe_layout(int fd, file_layout_t* layout);
- int get_file_stripe_address(int fd, loff_t offset, vector<entity_addr_t>& address);
- int get_file_extent_osds(int fd, loff_t off, loff_t *len, vector<int>& osds);
+ int get_file_stripe_address(int fd, loff_t offset, std::vector<entity_addr_t>& address);
+ int get_file_extent_osds(int fd, loff_t off, loff_t *len, std::vector<int>& osds);
int get_osd_addr(int osd, entity_addr_t& addr);
// expose mdsmap
int get_local_osd();
int get_pool_replication(int64_t pool);
int64_t get_pool_id(const char *pool_name);
- string get_pool_name(int64_t pool);
- int get_osd_crush_location(int id, vector<pair<string, string> >& path);
+ std::string get_pool_name(int64_t pool);
+ int get_osd_crush_location(int id, std::vector<std::pair<std::string, std::string> >& path);
- int enumerate_layout(int fd, vector<ObjectExtent>& result,
+ int enumerate_layout(int fd, std::vector<ObjectExtent>& result,
loff_t length, loff_t offset);
int mksnap(const char *path, const char *name, const UserPerm& perm,
int get_caps_used(Inode *in);
void maybe_update_snaprealm(SnapRealm *realm, snapid_t snap_created, snapid_t snap_highwater,
- vector<snapid_t>& snaps);
+ std::vector<snapid_t>& snaps);
void handle_quota(const MConstRef<MClientQuota>& m);
void handle_snap(const MConstRef<MClientSnap>& m);
void finish_cap_snap(Inode *in, CapSnap &capsnap, int used);
void _schedule_invalidate_dentry_callback(Dentry *dn, bool del);
- void _async_dentry_invalidate(vinodeno_t dirino, vinodeno_t ino, string& name);
+ void _async_dentry_invalidate(vinodeno_t dirino, vinodeno_t ino, std::string& name);
void _try_to_trim_inode(Inode *in, bool sched_inval);
void _schedule_invalidate_callback(Inode *in, int64_t off, int64_t len);
Inode *add_update_inode(InodeStat *st, utime_t ttl, MetaSession *session,
const UserPerm& request_perms);
- Dentry *insert_dentry_inode(Dir *dir, const string& dname, LeaseStat *dlease,
+ Dentry *insert_dentry_inode(Dir *dir, const std::string& dname, LeaseStat *dlease,
Inode *in, utime_t from, MetaSession *session,
Dentry *old_dentry = NULL);
void update_dentry_lease(Dentry *dn, LeaseStat *dlease, utime_t from, MetaSession *session);
// helpers
void wake_up_session_caps(MetaSession *s, bool reconnect);
- void wait_on_context_list(list<Context*>& ls);
- void signal_context_list(list<Context*>& ls);
+ void wait_on_context_list(std::list<Context*>& ls);
+ void signal_context_list(std::list<Context*>& ls);
// -- metadata cache stuff
* leave dn set to default NULL unless you're trying to add
* a new inode to a pre-created Dentry
*/
- Dentry* link(Dir *dir, const string& name, Inode *in, Dentry *dn);
+ Dentry* link(Dir *dir, const std::string& name, Inode *in, Dentry *dn);
void unlink(Dentry *dn, bool keepdir, bool keepdentry);
int fill_stat(Inode *in, struct stat *st, frag_info_t *dirstat=0, nest_info_t *rstat=0);
* statistics and layout metadata.
*/
struct VXattr {
- const string name;
- size_t (Client::*getxattr_cb)(Inode *in, char *val, size_t size);
- bool readonly;
- bool (Client::*exists_cb)(Inode *in);
- unsigned int flags;
+ const std::string name;
+ size_t (Client::*getxattr_cb)(Inode *in, char *val, size_t size);
+ bool readonly;
+ bool (Client::*exists_cb)(Inode *in);
+ unsigned int flags;
};
enum {
// internal interface
// call these with client_lock held!
- int _do_lookup(Inode *dir, const string& name, int mask, InodeRef *target,
+ int _do_lookup(Inode *dir, const std::string& name, int mask, InodeRef *target,
const UserPerm& perms);
- int _lookup(Inode *dir, const string& dname, int mask, InodeRef *target,
+ int _lookup(Inode *dir, const std::string& dname, int mask, InodeRef *target,
const UserPerm& perm, std::string* alternate_name=nullptr);
int _link(Inode *in, Inode *dir, const char *name, const UserPerm& perm, std::string alternate_name,
int flags, const UserPerm& perms);
int _setxattr(InodeRef &in, const char *name, const void *value, size_t len,
int flags, const UserPerm& perms);
- int _setxattr_check_data_pool(string& name, string& value, const OSDMap *osdmap);
+ int _setxattr_check_data_pool(std::string& name, std::string& value, const OSDMap *osdmap);
void _setxattr_maybe_wait_for_osdmap(const char *name, const void *value, size_t len);
int _removexattr(Inode *in, const char *nm, const UserPerm& perms);
int _removexattr(InodeRef &in, const char *nm, const UserPerm& perms);
utime_t last_auto_reconnect;
// trace generation
- ofstream traceout;
+ std::ofstream traceout;
ceph::condition_variable mount_cond, sync_cond;
uint32_t mode = 0;
uid_t uid = 0;
gid_t gid = 0;
- map<string,bufferptr> xattrs;
+ std::map<std::string,bufferptr> xattrs;
version_t xattr_version = 0;
bufferlist inline_data;
return layout != file_layout_t();
}
- __u32 hash_dentry_name(const string &dn) {
+ __u32 hash_dentry_name(const std::string &dn) {
int which = dir_layout.dl_dir_hash;
if (!which)
which = CEPH_STR_HASH_LINUX;
SnapRealm *snaprealm = 0;
xlist<Inode*>::item snaprealm_item;
InodeRef snapdir_parent; // only if we are a snapdir inode
- map<snapid_t,CapSnap> cap_snaps; // pending flush to mds
+ std::map<snapid_t,CapSnap> cap_snaps; // pending flush to mds
//int open_by_mode[CEPH_FILE_MODE_NUM];
- map<int,int> open_by_mode;
- map<int,int> cap_refs;
+ std::map<int,int> open_by_mode;
+ std::map<int,int> cap_refs;
ObjectCacher::ObjectSet oset; // ORDER DEPENDENCY: ino
uint64_t ll_ref = 0; // separate ref count for ll client
xlist<Dentry *> dentries; // if i'm linked to a dentry.
- string symlink; // symlink content, if it's a symlink
- map<string,bufferptr> xattrs;
- map<frag_t,int> fragmap; // known frag -> mds mappings
- map<frag_t, std::vector<mds_rank_t>> frag_repmap; // non-auth mds mappings
+ std::string symlink; // symlink content, if it's a symlink
+ std::map<std::string,bufferptr> xattrs;
+ std::map<frag_t,int> fragmap; // known frag -> mds mappings
+ std::map<frag_t, std::vector<mds_rank_t>> frag_repmap; // non-auth mds mappings
std::list<ceph::condition_variable*> waitfor_caps;
std::list<ceph::condition_variable*> waitfor_commit;
(flock_locks && !flock_locks->empty());
}
- list<Delegation> delegations;
+ std::list<Delegation> delegations;
xlist<MetaRequest*> unsafe_ops;
};
-ostream& operator<<(ostream &out, const Inode &in);
+std::ostream& operator<<(std::ostream &out, const Inode &in);
#endif