~ubuntu-branches/ubuntu/trusty/ceph/trusty-updates

« back to all changes in this revision

Viewing changes to src/libcephfs.cc

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-04-09 11:14:03 UTC
  • mfrom: (1.1.33)
  • Revision ID: package-import@ubuntu.com-20140409111403-jlql95pa8kg1nk9a
Tags: 0.79-0ubuntu1
* New upstream release (LP: #1278466):
  - d/p/modules.patch: Refreshed.
  - d/ceph.install: Install all jerasure modules.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1169
1169
  return (cmount->get_client())->ll_get_inode(vino);
1170
1170
}
1171
1171
 
 
1172
 
 
1173
/**
 
1174
 * Populates the client cache with the requested inode, and its
 
1175
 * parent dentry.
 
1176
 */
 
1177
extern "C" int ceph_ll_lookup_inode(
 
1178
    struct ceph_mount_info *cmount,
 
1179
    struct inodeno_t ino,
 
1180
    Inode **inode)
 
1181
{
 
1182
  int r = (cmount->get_client())->lookup_ino(ino, inode);
 
1183
  if (r) {
 
1184
    return r;
 
1185
  }
 
1186
  if (inode) {
 
1187
    assert(*inode != NULL);
 
1188
  }
 
1189
 
 
1190
  // Request the parent inode, so that we can look up the name
 
1191
  Inode *parent;
 
1192
  r = (cmount->get_client())->lookup_parent(*inode, &parent);
 
1193
  if (r && r != -EINVAL) {
 
1194
    // Unexpected error
 
1195
    (cmount->get_client())->ll_forget(*inode, 1);
 
1196
    return r;
 
1197
  } else if (r == -EINVAL) {
 
1198
    // EINVAL indicates node without parents (root), drop out now
 
1199
    // and don't try to look up the non-existent dentry.
 
1200
    return 0;
 
1201
  }
 
1202
  assert(parent != NULL);
 
1203
 
 
1204
  // Finally, get the name (dentry) of the requested inode
 
1205
  r = (cmount->get_client())->lookup_name(*inode, parent);
 
1206
  if (r) {
 
1207
    // Unexpected error
 
1208
    (cmount->get_client())->ll_forget(parent, 1);
 
1209
    (cmount->get_client())->ll_forget(*inode, 1);
 
1210
    return r;
 
1211
  }
 
1212
 
 
1213
  (cmount->get_client())->ll_forget(parent, 1);
 
1214
  return 0;
 
1215
}
 
1216
 
1172
1217
extern "C" int ceph_ll_lookup(class ceph_mount_info *cmount,
1173
1218
                              struct Inode *parent, const char *name,
1174
1219
                              struct stat *attr, Inode **out,