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-3963 libcfs: convert md[d/t]/mg[c/s] to linux atomic primitives
[fs/lustre-release.git]
/
lustre
/
mdd
/
mdd_compat.c
diff --git
a/lustre/mdd/mdd_compat.c
b/lustre/mdd/mdd_compat.c
index
fe1eb49
..
7b50624
100644
(file)
--- a/
lustre/mdd/mdd_compat.c
+++ b/
lustre/mdd/mdd_compat.c
@@
-20,7
+20,7
@@
* GPL HEADER END
*/
/*
* GPL HEADER END
*/
/*
- * Copyright (c) 201
2
, Intel Corporation.
+ * Copyright (c) 201
3
, Intel Corporation.
*/
#define DEBUG_SUBSYSTEM S_MDS
*/
#define DEBUG_SUBSYSTEM S_MDS
@@
-56,7
+56,7
@@
static int mdd_convert_remove_dots(const struct lu_env *env,
struct mdd_device *mdd,
struct mdd_object *o)
{
struct mdd_device *mdd,
struct mdd_object *o)
{
- struct thandle *th
= NULL
;
+ struct thandle *th;
const struct dt_key *dot = (const struct dt_key *)".";
const struct dt_key *dotdot = (const struct dt_key *)"..";
int rc;
const struct dt_key *dot = (const struct dt_key *)".";
const struct dt_key *dotdot = (const struct dt_key *)"..";
int rc;
@@
-68,6
+68,7
@@
static int mdd_convert_remove_dots(const struct lu_env *env,
th = dt_trans_create(env, mdd->mdd_child);
if (IS_ERR(th))
RETURN(PTR_ERR(th));
th = dt_trans_create(env, mdd->mdd_child);
if (IS_ERR(th))
RETURN(PTR_ERR(th));
+
rc = dt_declare_delete(env, mdd_object_child(o), dot, th);
if (rc)
GOTO(out, rc);
rc = dt_declare_delete(env, mdd_object_child(o), dot, th);
if (rc)
GOTO(out, rc);
@@
-91,8
+92,7
@@
static int mdd_convert_remove_dots(const struct lu_env *env,
GOTO(out, rc);
out:
GOTO(out, rc);
out:
- if (th)
- dt_trans_stop(env, mdd->mdd_child, th);
+ dt_trans_stop(env, mdd->mdd_child, th);
RETURN(rc);
}
RETURN(rc);
}
@@
-101,13
+101,16
@@
static int mdd_convert_linkea(const struct lu_env *env,
struct mdd_object *o,
const struct lu_name *name)
{
struct mdd_object *o,
const struct lu_name *name)
{
- struct thandle *th
= NULL
;
+ struct thandle *th;
struct lu_fid oldfid;
int rc;
ENTRY;
th = dt_trans_create(env, mdd->mdd_child);
struct lu_fid oldfid;
int rc;
ENTRY;
th = dt_trans_create(env, mdd->mdd_child);
- rc = mdd_declare_links_add(env, o, th);
+ if (IS_ERR(th))
+ RETURN(PTR_ERR(th));
+
+ rc = mdd_declare_links_add(env, o, th, NULL);
if (rc)
GOTO(out, rc);
rc = dt_trans_start_local(env, mdd->mdd_child, th);
if (rc)
GOTO(out, rc);
rc = dt_trans_start_local(env, mdd->mdd_child, th);
@@
-118,13
+121,12
@@
static int mdd_convert_linkea(const struct lu_env *env,
oldfid.f_oid = MDD_ROOT_INDEX_OID;
oldfid.f_ver = 0;
rc = mdd_links_rename(env, o, &oldfid, name, &mdd->mdd_root_fid,
oldfid.f_oid = MDD_ROOT_INDEX_OID;
oldfid.f_ver = 0;
rc = mdd_links_rename(env, o, &oldfid, name, &mdd->mdd_root_fid,
- name, th, 0, 1);
+ name, th,
NULL,
0, 1);
if (rc == -ENOENT || rc == -EEXIST)
rc = 0;
out:
if (rc == -ENOENT || rc == -EEXIST)
rc = 0;
out:
- if (th)
- dt_trans_stop(env, mdd->mdd_child, th);
+ dt_trans_stop(env, mdd->mdd_child, th);
RETURN(rc);
}
RETURN(rc);
}
@@
-134,7
+136,7
@@
static int mdd_convert_object(const struct lu_env *env,
const struct lu_name *name)
{
struct mdd_object *o;
const struct lu_name *name)
{
struct mdd_object *o;
- struct lu_attr *la =
&mdd_env_info(env)->mti_la
;
+ struct lu_attr *la =
MDD_ENV_VAR(env, cattr)
;
int rc;
ENTRY;
int rc;
ENTRY;
@@
-171,7
+173,7
@@
static int mdd_convert_lma(const struct lu_env *env, struct mdd_device *mdd,
struct mdd_object *o)
{
struct lustre_mdt_attrs *lma;
struct mdd_object *o)
{
struct lustre_mdt_attrs *lma;
- struct thandle *th
= NULL
;
+ struct thandle *th;
struct lu_fid fid;
struct lu_buf buf;
int rc;
struct lu_fid fid;
struct lu_buf buf;
int rc;
@@
-180,7
+182,7
@@
static int mdd_convert_lma(const struct lu_env *env, struct mdd_device *mdd,
lu_root_fid(&fid);
lma = (struct lustre_mdt_attrs *)&mdd_env_info(env)->mti_xattr_buf;
lu_root_fid(&fid);
lma = (struct lustre_mdt_attrs *)&mdd_env_info(env)->mti_xattr_buf;
- lustre_lma_init(lma, &fid);
+ lustre_lma_init(lma, &fid
, 0, 0
);
lustre_lma_swab(lma);
buf.lb_buf = lma;
buf.lb_len = sizeof(*lma);
lustre_lma_swab(lma);
buf.lb_buf = lma;
buf.lb_len = sizeof(*lma);
@@
-196,8
+198,7
@@
static int mdd_convert_lma(const struct lu_env *env, struct mdd_device *mdd,
GOTO(out, rc);
rc = mdo_xattr_set(env, o, &buf, XATTR_NAME_LMA, 0, th, BYPASS_CAPA);
out:
GOTO(out, rc);
rc = mdo_xattr_set(env, o, &buf, XATTR_NAME_LMA, 0, th, BYPASS_CAPA);
out:
- if (th)
- dt_trans_stop(env, mdd->mdd_child, th);
+ dt_trans_stop(env, mdd->mdd_child, th);
RETURN(rc);
}
RETURN(rc);
}
@@
-284,7
+285,7
@@
static int mdd_fill_fldb(const struct lu_env *env, struct mdd_device *mdd)
/* Pre-existing ZFS does not insert any entries to FLDB, we need
* to insert it to FLDB during convertion */
range.lsr_start = FID_SEQ_NORMAL;
/* Pre-existing ZFS does not insert any entries to FLDB, we need
* to insert it to FLDB during convertion */
range.lsr_start = FID_SEQ_NORMAL;
-
range.lsr_flags = LU_SEQ_RANGE_MDT
;
+
fld_range_set_mdt(&range)
;
mutex_lock(&ss->ss_server_fld->lsf_lock);
rc = fld_insert_entry(env, ss->ss_server_fld, &range);
mutex_lock(&ss->ss_server_fld->lsf_lock);
rc = fld_insert_entry(env, ss->ss_server_fld, &range);
@@
-359,7
+360,7
@@
int mdd_compat_fixes(const struct lu_env *env, struct mdd_device *mdd)
LUSTRE_OSD_ZFS_NAME) != 0) {
CERROR("%s: "DFID" is used on ldiskfs?!\n",
mdd2obd_dev(mdd)->obd_name, PFID(&mdd->mdd_root_fid));
LUSTRE_OSD_ZFS_NAME) != 0) {
CERROR("%s: "DFID" is used on ldiskfs?!\n",
mdd2obd_dev(mdd)->obd_name, PFID(&mdd->mdd_root_fid));
-
RETURN(
-ENOTSUPP);
+
GOTO(out, rc =
-ENOTSUPP);
}
LCONSOLE_INFO("%s: FID of /ROOT has been changed. "
}
LCONSOLE_INFO("%s: FID of /ROOT has been changed. "