if (dname == "..") {
if (dir->dn_set.empty())
- r = -ENOENT;
+ *target = dir;
else
*target = dir->get_first_parent()->dir->parent_inode; //dirs can't be hard-linked
goto done;
if (dirp->offset == 1) {
ldout(cct, 15) << " including .." << dendl;
uint64_t next_off = 2;
- if (!diri->dn_set.empty()) {
- InodeRef& in = diri->get_first_parent()->inode;
- fill_stat(in, &st);
- fill_dirent(&de, "..", S_IFDIR, st.st_ino, next_off);
- } else {
- /* must be at the root (no parent),
- * so we add the dotdot with a special inode (3) */
- fill_dirent(&de, "..", S_IFDIR, CEPH_INO_DOTDOT, next_off);
- }
+ InodeRef in;
+ if (diri->dn_set.empty())
+ in = diri;
+ else
+ in = diri->get_first_parent()->inode;
+ fill_stat(in, &st);
+ fill_dirent(&de, "..", S_IFDIR, st.st_ino, next_off);
client_lock.Unlock();
int r = cb(p, &de, &st, -1, next_off);
tout(cct) << "ll_getattr" << std::endl;
tout(cct) << vino.ino.val << std::endl;
- /* special case for dotdot (..) */
- if (vino.ino.val == CEPH_INO_DOTDOT) {
- attr->st_mode = S_IFDIR | 0755;
- attr->st_nlink = 2;
- return 0;
- }
-
int res;
if (vino.snapid < CEPH_NOSNAP)
res = 0;
#define CEPH_INO_ROOT 1
#define CEPH_INO_CEPH 2 /* hidden .ceph dir */
-#define CEPH_INO_DOTDOT 3 /* used by ceph fuse for parent (..) */
#define CEPH_INO_LOST_AND_FOUND 4 /* reserved ino for use in recovery */
/* arbitrary limit on max # of monitors (cluster of 3 is typical) */