switch (type) { case ACL_TYPE_ACCESS:
key = XATTR_NAME_POSIX_ACL_ACCESS; break; case ACL_TYPE_DEFAULT:
key = XATTR_NAME_POSIX_ACL_DEFAULT; break; default:
gossip_err("orangefs_get_acl: bogus value of type %d\n", type); return ERR_PTR(-EINVAL);
} /* *Ratherthanincurringanetworkcalljusttodeterminetheexact *lengthoftheattribute,Ijustallocateamaxlengthtosaveon *thenetworkcall.Conceivably,wecouldpassNULLto *orangefs_inode_getxattr()toprobethelengthofthevalue,but *Idon'tdothatfornow.
*/
value = kmalloc(ORANGEFS_MAX_XATTR_VALUELEN, GFP_KERNEL); if (!value) return ERR_PTR(-ENOMEM);
gossip_debug(GOSSIP_ACL_DEBUG, "inode %pU, key %s, type %d\n",
get_khandle_from_ino(inode),
key,
type);
ret = orangefs_inode_getxattr(inode, key, value,
ORANGEFS_MAX_XATTR_VALUELEN); /* if the key exists, convert it to an in-memory rep */ if (ret > 0) {
acl = posix_acl_from_xattr(&init_user_ns, value, ret);
} elseif (ret == -ENODATA || ret == -ENOSYS) {
acl = NULL;
} else {
gossip_err("inode %pU retrieving acl's failed with error %d\n",
get_khandle_from_ino(inode),
ret);
acl = ERR_PTR(ret);
} /* kfree(NULL) is safe, so don't worry if value ever got used */
kfree(value); return acl;
}
int __orangefs_set_acl(struct inode *inode, struct posix_acl *acl, int type)
{ int error = 0; void *value = NULL;
size_t size = 0; constchar *name = NULL;
switch (type) { case ACL_TYPE_ACCESS:
name = XATTR_NAME_POSIX_ACL_ACCESS; break; case ACL_TYPE_DEFAULT:
name = XATTR_NAME_POSIX_ACL_DEFAULT; break; default:
gossip_err("%s: invalid type %d!\n", __func__, type); return -EINVAL;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.