Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 359180
b: refs/heads/master
c: 79f9f99
h: refs/heads/master
v: v3
  • Loading branch information
Sage Weil authored and Al Viro committed Feb 26, 2013
1 parent 5d27f2a commit db7cd07
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4f522a247bc26d4ab5c8fc406ffffa8b3a77abe3
refs/heads/master: 79f9f99ad1e3e19d4ac300573b51289e3ee8ba86
40 changes: 38 additions & 2 deletions trunk/fs/ceph/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1130,8 +1130,8 @@ int ceph_fill_trace(struct super_block *sb, struct ceph_mds_request *req,
req->r_request_started);
dout(" final dn %p\n", dn);
i++;
} else if (req->r_op == CEPH_MDS_OP_LOOKUPSNAP ||
req->r_op == CEPH_MDS_OP_MKSNAP) {
} else if ((req->r_op == CEPH_MDS_OP_LOOKUPSNAP ||
req->r_op == CEPH_MDS_OP_MKSNAP) && !req->r_aborted) {
struct dentry *dn = req->r_dentry;

/* fill out a snapdir LOOKUPSNAP dentry */
Expand Down Expand Up @@ -1195,6 +1195,39 @@ int ceph_fill_trace(struct super_block *sb, struct ceph_mds_request *req,
/*
* Prepopulate our cache with readdir results, leases, etc.
*/
static int readdir_prepopulate_inodes_only(struct ceph_mds_request *req,
struct ceph_mds_session *session)
{
struct ceph_mds_reply_info_parsed *rinfo = &req->r_reply_info;
int i, err = 0;

for (i = 0; i < rinfo->dir_nr; i++) {
struct ceph_vino vino;
struct inode *in;
int rc;

vino.ino = le64_to_cpu(rinfo->dir_in[i].in->ino);
vino.snap = le64_to_cpu(rinfo->dir_in[i].in->snapid);

in = ceph_get_inode(req->r_dentry->d_sb, vino);
if (IS_ERR(in)) {
err = PTR_ERR(in);
dout("new_inode badness got %d\n", err);
continue;
}
rc = fill_inode(in, &rinfo->dir_in[i], NULL, session,
req->r_request_started, -1,
&req->r_caps_reservation);
if (rc < 0) {
pr_err("fill_inode badness on %p got %d\n", in, rc);
err = rc;
continue;
}
}

return err;
}

int ceph_readdir_prepopulate(struct ceph_mds_request *req,
struct ceph_mds_session *session)
{
Expand All @@ -1209,6 +1242,9 @@ int ceph_readdir_prepopulate(struct ceph_mds_request *req,
u64 frag = le32_to_cpu(rhead->args.readdir.frag);
struct ceph_dentry_info *di;

if (req->r_aborted)
return readdir_prepopulate_inodes_only(req, session);

if (le32_to_cpu(rinfo->head->op) == CEPH_MDS_OP_LSSNAP) {
snapdir = ceph_get_snapdir(parent->d_inode);
parent = d_find_alias(snapdir);
Expand Down

0 comments on commit db7cd07

Please sign in to comment.