* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
- * Copyright (c) 2011, 2012, Whamcloud, Inc.
+ * Copyright (c) 2011, 2013, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
if (!xattr_name)
RETURN(-EFAULT);
- if (!(req->rq_export->exp_connect_flags & OBD_CONNECT_XATTR) &&
- !strncmp(xattr_name, user_string, sizeof(user_string) - 1))
- RETURN(-EOPNOTSUPP);
+ if (!(exp_connect_flags(req->rq_export) & OBD_CONNECT_XATTR) &&
+ !strncmp(xattr_name, user_string, sizeof(user_string) - 1))
+ RETURN(-EOPNOTSUPP);
size = mo_xattr_get(info->mti_env,
mdt_object_child(info->mti_object),
{
struct ptlrpc_request *req = mdt_info_req(info);
struct mdt_export_data *med = mdt_req2med(req);
- struct md_ucred *uc = mdt_ucred(info);
+ struct lu_ucred *uc = mdt_ucred(info);
struct mdt_body *reqbody;
struct mdt_body *repbody = NULL;
struct md_object *next;
ENTRY;
LASSERT(info->mti_object != NULL);
- LASSERT(lu_object_assert_exists(&info->mti_object->mot_obj.mo_lu));
+ LASSERT(lu_object_assert_exists(&info->mti_object->mot_obj));
CDEBUG(D_INODE, "getxattr "DFID"\n", PFID(&info->mti_body->fid1));
if (reqbody == NULL)
RETURN(err_serious(-EFAULT));
- rc = mdt_init_ucred(info, reqbody);
+ rc = mdt_init_ucred(info, reqbody);
if (rc)
RETURN(err_serious(rc));
if (unlikely(!remote))
GOTO(out, rc = err_serious(-EINVAL));
- perm = mdt_identity_get_perm(uc->mu_identity, remote,
- req->rq_peer.nid);
+ perm = mdt_identity_get_perm(uc->uc_identity, remote,
+ req->rq_peer.nid);
if (!(perm & CFS_RMTACL_PERM))
GOTO(out, rc = err_serious(-EPERM));
{
struct ptlrpc_request *req = mdt_info_req(info);
struct mdt_export_data *med = mdt_req2med(req);
- struct md_ucred *uc = mdt_ucred(info);
+ struct lu_ucred *uc = mdt_ucred(info);
struct lu_buf *buf = &info->mti_buf;
int rc;
ENTRY;
struct mdt_lock_handle *unused)
{
struct ptlrpc_request *req = mdt_info_req(info);
- struct md_ucred *uc = mdt_ucred(info);
+ struct lu_ucred *uc = mdt_ucred(info);
struct mdt_lock_handle *lh;
const struct lu_env *env = info->mti_env;
struct lu_buf *buf = &info->mti_buf;
CDEBUG(D_INODE, "%s xattr %s\n",
valid & OBD_MD_FLXATTR ? "set" : "remove", xattr_name);
- rc = mdt_init_ucred_reint(info);
+ rc = mdt_init_ucred_reint(info);
if (rc != 0)
RETURN(rc);
if (unlikely(!remote))
GOTO(out, rc = err_serious(-EINVAL));
- perm = mdt_identity_get_perm(uc->mu_identity, remote,
- req->rq_peer.nid);
+ perm = mdt_identity_get_perm(uc->uc_identity, remote,
+ req->rq_peer.nid);
if (!(perm & CFS_RMTACL_PERM))
GOTO(out, rc = err_serious(-EPERM));
}
if (strncmp(xattr_name, XATTR_USER_PREFIX,
sizeof(XATTR_USER_PREFIX) - 1) == 0) {
- if (!(req->rq_export->exp_connect_flags & OBD_CONNECT_XATTR))
- GOTO(out, rc = -EOPNOTSUPP);
+ if (!(exp_connect_flags(req->rq_export) & OBD_CONNECT_XATTR))
+ GOTO(out, rc = -EOPNOTSUPP);
if (strcmp(xattr_name, XATTR_NAME_LOV) == 0)
GOTO(out, rc = -EACCES);
if (strcmp(xattr_name, XATTR_NAME_LMA) == 0)
* not change the access permissions of this inode, nor any
* other existing inodes. It is setting the ACLs inherited
* by new directories/files at create time. */
+ /* We need revoke both LOOKUP|PERM lock here, see mdt_attr_set. */
if (!strcmp(xattr_name, XATTR_NAME_ACL_ACCESS))
- lockpart |= MDS_INODELOCK_LOOKUP;
+ lockpart |= MDS_INODELOCK_PERM | MDS_INODELOCK_LOOKUP;
lh = &info->mti_lh[MDT_LH_PARENT];
/* ACLs were sent to clients under LCK_CR locks, so taking LCK_EX
if (rc)
GOTO(out_unlock, rc);
- if (unlikely(!(valid & OBD_MD_FLCTIME))) {
- /* This isn't strictly an error, but all current clients
- * should set OBD_MD_FLCTIME when setting attributes. */
- CWARN("%s: client miss to set OBD_MD_FLCTIME when "
- "setxattr %s: [object "DFID"] [valid "LPU64"]\n",
- info->mti_exp->exp_obd->obd_name, xattr_name,
- PFID(rr->rr_fid1), valid);
- attr->la_ctime = cfs_time_current_sec();
- }
+ if (unlikely(!(valid & OBD_MD_FLCTIME))) {
+ /* This isn't strictly an error, but all current clients
+ * should set OBD_MD_FLCTIME when setting attributes. */
+ CWARN("%s: client miss to set OBD_MD_FLCTIME when "
+ "setxattr %s: [object "DFID"] [valid "LPU64"]\n",
+ mdt_obd_name(info->mti_mdt), xattr_name,
+ PFID(rr->rr_fid1), valid);
+ attr->la_ctime = cfs_time_current_sec();
+ }
attr->la_valid = LA_CTIME;
child = mdt_object_child(obj);
if (valid & OBD_MD_FLXATTR) {
if (unlikely(new_xattr != NULL))
lustre_posix_acl_xattr_free(new_xattr, xattr_len);
out:
- mdt_exit_ucred(info);
- return rc;
+ mdt_exit_ucred(info);
+ return rc;
}