Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LU-7669 lmv: assume a real connection in lmv_connect()
[fs/lustre-release.git]
/
lustre
/
llite
/
lcommon_cl.c
diff --git
a/lustre/llite/lcommon_cl.c
b/lustre/llite/lcommon_cl.c
index
53b5d4e
..
94fda5a
100644
(file)
--- a/
lustre/llite/lcommon_cl.c
+++ b/
lustre/llite/lcommon_cl.c
@@
-27,7
+27,7
@@
* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
- * Copyright (c) 2011, 201
4
, Intel Corporation.
+ * Copyright (c) 2011, 201
5
, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
*/
/*
* This file is part of Lustre, http://www.lustre.org/
@@
-64,7
+64,7
@@
* mutex.
*/
struct lu_env *cl_inode_fini_env;
* mutex.
*/
struct lu_env *cl_inode_fini_env;
-
int
cl_inode_fini_refcheck;
+
__u16
cl_inode_fini_refcheck;
/**
* A mutex serializing calls to slp_inode_fini() under extreme memory
/**
* A mutex serializing calls to slp_inode_fini() under extreme memory
@@
-73,12
+73,12
@@
int cl_inode_fini_refcheck;
static DEFINE_MUTEX(cl_inode_fini_guard);
int cl_setattr_ost(struct cl_object *obj, const struct iattr *attr,
static DEFINE_MUTEX(cl_inode_fini_guard);
int cl_setattr_ost(struct cl_object *obj, const struct iattr *attr,
- unsigned int attr_flags
, struct obd_capa *capa
)
+ unsigned int attr_flags)
{
struct lu_env *env;
struct cl_io *io;
int result;
{
struct lu_env *env;
struct cl_io *io;
int result;
-
int
refcheck;
+
__u16
refcheck;
ENTRY;
ENTRY;
@@
-88,6
+88,7
@@
int cl_setattr_ost(struct cl_object *obj, const struct iattr *attr,
io = vvp_env_thread_io(env);
io->ci_obj = obj;
io = vvp_env_thread_io(env);
io->ci_obj = obj;
+ io->ci_verify_layout = 1;
io->u.ci_setattr.sa_attr.lvb_atime = LTIME_S(attr->ia_atime);
io->u.ci_setattr.sa_attr.lvb_mtime = LTIME_S(attr->ia_mtime);
io->u.ci_setattr.sa_attr.lvb_atime = LTIME_S(attr->ia_atime);
io->u.ci_setattr.sa_attr.lvb_mtime = LTIME_S(attr->ia_mtime);
@@
-96,7
+97,6
@@
int cl_setattr_ost(struct cl_object *obj, const struct iattr *attr,
io->u.ci_setattr.sa_attr_flags = attr_flags;
io->u.ci_setattr.sa_valid = attr->ia_valid;
io->u.ci_setattr.sa_parent_fid = lu_object_fid(&obj->co_lu);
io->u.ci_setattr.sa_attr_flags = attr_flags;
io->u.ci_setattr.sa_valid = attr->ia_valid;
io->u.ci_setattr.sa_parent_fid = lu_object_fid(&obj->co_lu);
- io->u.ci_setattr.sa_capa = capa;
again:
if (cl_io_init(env, io, CIT_SETATTR, io->ci_obj) == 0) {
again:
if (cl_io_init(env, io, CIT_SETATTR, io->ci_obj) == 0) {
@@
-114,12
+114,7
@@
again:
cl_io_fini(env, io);
if (unlikely(io->ci_need_restart))
goto again;
cl_io_fini(env, io);
if (unlikely(io->ci_need_restart))
goto again;
- /* HSM import case: file is released, cannot be restored
- * no need to fail except if restore registration failed
- * with -ENODATA */
- if (result == -ENODATA && io->ci_restore_needed &&
- io->ci_result != -ENODATA)
- result = 0;
+
cl_env_put(env, &refcheck);
RETURN(result);
}
cl_env_put(env, &refcheck);
RETURN(result);
}
@@
-140,14
+135,14
@@
int cl_file_inode_init(struct inode *inode, struct lustre_md *md)
struct cl_object *clob;
struct lu_site *site;
struct lu_fid *fid;
struct cl_object *clob;
struct lu_site *site;
struct lu_fid *fid;
-
struct cl_object_conf conf = {
-
.coc_inode = inode,
-
.u = {
- .coc_md = md
-
}
-
};
+ struct cl_object_conf conf = {
+ .coc_inode = inode,
+ .u = {
+ .coc_layout = md->layout,
+ }
+ };
int result = 0;
int result = 0;
-
int
refcheck;
+
__u16
refcheck;
LASSERT(md->body->mbo_valid & OBD_MD_FLID);
LASSERT(S_ISREG(inode->i_mode));
LASSERT(md->body->mbo_valid & OBD_MD_FLID);
LASSERT(S_ISREG(inode->i_mode));
@@
-176,7
+171,6
@@
int cl_file_inode_init(struct inode *inode, struct lustre_md *md)
* locked by I_NEW bit.
*/
lli->lli_clob = clob;
* locked by I_NEW bit.
*/
lli->lli_clob = clob;
- lli->lli_has_smd = lsm_has_objects(md->lsm);
lu_object_ref_add(&clob->co_lu, "inode", inode);
} else
result = PTR_ERR(clob);
lu_object_ref_add(&clob->co_lu, "inode", inode);
} else
result = PTR_ERR(clob);
@@
-212,14
+206,14
@@
static void cl_object_put_last(struct lu_env *env, struct cl_object *obj)
bkt = lu_site_bkt_from_fid(site, &header->loh_fid);
bkt = lu_site_bkt_from_fid(site, &header->loh_fid);
- init_waitqueue_entry
_current(&waiter
);
+ init_waitqueue_entry
(&waiter, current
);
add_wait_queue(&bkt->lsb_marche_funebre, &waiter);
while (1) {
set_current_state(TASK_UNINTERRUPTIBLE);
if (atomic_read(&header->loh_ref) == 1)
break;
add_wait_queue(&bkt->lsb_marche_funebre, &waiter);
while (1) {
set_current_state(TASK_UNINTERRUPTIBLE);
if (atomic_read(&header->loh_ref) == 1)
break;
-
waitq_wait(&waiter, TASK_UNINTERRUPTIBLE
);
+
schedule(
);
}
set_current_state(TASK_RUNNING);
}
set_current_state(TASK_RUNNING);
@@
-233,20
+227,16
@@
void cl_inode_fini(struct inode *inode)
{
struct lu_env *env;
struct ll_inode_info *lli = ll_i2info(inode);
{
struct lu_env *env;
struct ll_inode_info *lli = ll_i2info(inode);
-
struct cl_object *clob = lli->lli_clob;
-
int
refcheck;
-
int emergency;
+ struct cl_object *clob = lli->lli_clob;
+
__u16
refcheck;
+ int emergency;
- if (clob != NULL) {
- void *cookie;
-
- cookie = cl_env_reenter();
- env = cl_env_get(&refcheck);
- emergency = IS_ERR(env);
+ if (clob != NULL) {
+ env = cl_env_get(&refcheck);
+ emergency = IS_ERR(env);
if (emergency) {
mutex_lock(&cl_inode_fini_guard);
LASSERT(cl_inode_fini_env != NULL);
if (emergency) {
mutex_lock(&cl_inode_fini_guard);
LASSERT(cl_inode_fini_env != NULL);
- cl_env_implant(cl_inode_fini_env, &refcheck);
env = cl_inode_fini_env;
}
env = cl_inode_fini_env;
}
@@
-259,15
+249,11
@@
void cl_inode_fini(struct inode *inode)
lu_object_ref_del(&clob->co_lu, "inode", inode);
cl_object_put_last(env, clob);
lli->lli_clob = NULL;
lu_object_ref_del(&clob->co_lu, "inode", inode);
cl_object_put_last(env, clob);
lli->lli_clob = NULL;
- if (emergency) {
- cl_env_unplant(cl_inode_fini_env, &refcheck);
+ if (emergency)
mutex_unlock(&cl_inode_fini_guard);
mutex_unlock(&cl_inode_fini_guard);
- } else {
+ else
cl_env_put(env, &refcheck);
cl_env_put(env, &refcheck);
- }
-
- cl_env_reexit(cookie);
- }
+ }
}
/**
}
/**