Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 359623
b: refs/heads/master
c: 0bee82f
h: refs/heads/master
i:
  359621: 20cf53f
  359619: 6c5c720
  359615: 79f36e3
v: v3
  • Loading branch information
Sage Weil committed Feb 14, 2013
1 parent c81edf0 commit d35496b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 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: f36e4472969a78ae65e514b553e9a0feacb40a28
refs/heads/master: 0bee82fb4b8d49541fe474ed460d2b917f329568
20 changes: 8 additions & 12 deletions trunk/fs/ceph/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -569,13 +569,17 @@ ssize_t ceph_getxattr(struct dentry *dentry, const char *name, void *value,
if (!ceph_is_valid_xattr(name))
return -ENODATA;

/* let's see if a virtual xattr was requested */
vxattr = ceph_match_vxattr(inode, name);

spin_lock(&ci->i_ceph_lock);
dout("getxattr %p ver=%lld index_ver=%lld\n", inode,
ci->i_xattrs.version, ci->i_xattrs.index_version);

/* let's see if a virtual xattr was requested */
vxattr = ceph_match_vxattr(inode, name);
if (vxattr && !(vxattr->exists_cb && !vxattr->exists_cb(ci))) {
err = vxattr->getxattr_cb(ci, value, size);
goto out;
}

if (__ceph_caps_issued_mask(ci, CEPH_CAP_XATTR_SHARED, 1) &&
(ci->i_xattrs.index_version >= ci->i_xattrs.version)) {
goto get_xattr;
Expand All @@ -589,23 +593,15 @@ ssize_t ceph_getxattr(struct dentry *dentry, const char *name, void *value,

spin_lock(&ci->i_ceph_lock);

if (vxattr && vxattr->readonly) {
err = vxattr->getxattr_cb(ci, value, size);
goto out;
}

err = __build_xattrs(inode);
if (err < 0)
goto out;

get_xattr:
err = -ENODATA; /* == ENOATTR */
xattr = __get_xattr(ci, name);
if (!xattr) {
if (vxattr)
err = vxattr->getxattr_cb(ci, value, size);
if (!xattr)
goto out;
}

err = -ERANGE;
if (size && size < xattr->val_len)
Expand Down

0 comments on commit d35496b

Please sign in to comment.