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-3336 lfsck: namespace visible lost+found directory
[fs/lustre-release.git]
/
lustre
/
osd-zfs
/
osd_index.c
diff --git
a/lustre/osd-zfs/osd_index.c
b/lustre/osd-zfs/osd_index.c
index
a6f0dd3
..
51db373
100644
(file)
--- a/
lustre/osd-zfs/osd_index.c
+++ b/
lustre/osd-zfs/osd_index.c
@@
-498,7
+498,8
@@
static int osd_remote_fid(const struct lu_env *env, struct osd_device *osd,
{
ENTRY;
- if (!fid_is_norm(fid) && !fid_is_root(fid))
+ /* FID seqs not in FLDB, must be local seq */
+ if (unlikely(!fid_seq_in_fldb(fid_seq(fid))))
RETURN(0);
if (osd_seq_exists(env, osd, fid_seq(fid)))
@@
-932,11
+933,11
@@
static int osd_dir_it_rec(const struct lu_env *env, const struct dt_it *di,
LASSERT(lde);
- lde->lde_hash = cpu_to_le64(udmu_zap_cursor_serialize(it->ozi_zc));
-
- if ((rc = -zap_cursor_retrieve(it->ozi_zc, za)))
+ rc = -zap_cursor_retrieve(it->ozi_zc, za);
+ if (unlikely(rc != 0))
GOTO(out, rc);
+ lde->lde_hash = cpu_to_le64(udmu_zap_cursor_serialize(it->ozi_zc));
namelen = strlen(za->za_name);
if (namelen > NAME_MAX)
GOTO(out, rc = -EOVERFLOW);
@@
-1043,8
+1044,9
@@
static struct dt_index_operations osd_dir_ops = {
* Primitives for index files using binary keys.
*/
-static int osd_prepare_key(struct osd_object *o, __u64 *dst,
- const struct dt_key *src)
+/* key integer_size is 8 */
+static int osd_prepare_key_uint64(struct osd_object *o, __u64 *dst,
+ const struct dt_key *src)
{
int size;
@@
-1061,7
+1063,7
@@
static int osd_prepare_key(struct osd_object *o, __u64 *dst,
memset(dst + o->oo_keysize, 0, size - o->oo_keysize);
memcpy(dst, (const char *)src, o->oo_keysize);
- return
size
;
+ return
(size/sizeof(__u64))
;
}
static int osd_index_lookup(const struct lu_env *env, struct dt_object *dt,
@@
-1074,7
+1076,7
@@
static int osd_index_lookup(const struct lu_env *env, struct dt_object *dt,
int rc;
ENTRY;
- rc = osd_prepare_key(obj, k, key);
+ rc = osd_prepare_key
_uint64
(obj, k, key);
rc = -zap_lookup_uint64(osd->od_objset.os, obj->oo_db->db_object,
k, rc, obj->oo_recusize, obj->oo_recsize,
@@
-1126,7
+1128,7
@@
static int osd_index_insert(const struct lu_env *env, struct dt_object *dt,
oh = container_of0(th, struct osd_thandle, ot_super);
- rc = osd_prepare_key(obj, k, key);
+ rc = osd_prepare_key
_uint64
(obj, k, key);
/* Insert (key,oid) into ZAP */
rc = -zap_add_uint64(osd->od_objset.os, obj->oo_db->db_object,
@@
-1170,7
+1172,7
@@
static int osd_index_delete(const struct lu_env *env, struct dt_object *dt,
LASSERT(th != NULL);
oh = container_of0(th, struct osd_thandle, ot_super);
- rc = osd_prepare_key(obj, k, key);
+ rc = osd_prepare_key
_uint64
(obj, k, key);
/* Remove binary key from the ZAP */
rc = -zap_remove_uint64(osd->od_objset.os, obj->oo_db->db_object,
@@
-1271,7
+1273,7
@@
static int osd_index_it_rec(const struct lu_env *env, const struct dt_it *di,
if (rc)
RETURN(rc);
- rc = osd_prepare_key(obj, k, (const struct dt_key *)za->za_name);
+ rc = osd_prepare_key
_uint64
(obj, k, (const struct dt_key *)za->za_name);
rc = -zap_lookup_uint64(osd->od_objset.os, obj->oo_db->db_object,
k, rc, obj->oo_recusize, obj->oo_recsize,