From: Alex Zhuravlev Date: Wed, 23 Mar 2016 19:30:03 +0000 (+0300) Subject: LU-7905 osd: pin OI objects X-Git-Tag: 2.8.54~42 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F03%2F19103%2F8;p=fs%2Flustre-release.git LU-7905 osd: pin OI objects so that corresponing dnodes are kept in memory. Change-Id: Ic312bfc57e3adc1032cefdd97efcf8f819418dc8 Signed-off-by: Alex Zhuravlev Reviewed-on: http://review.whamcloud.com/19103 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Fan Yong Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- diff --git a/lustre/osd-zfs/osd_internal.h b/lustre/osd-zfs/osd_internal.h index fa0c3f2..a59ff87 100644 --- a/lustre/osd-zfs/osd_internal.h +++ b/lustre/osd-zfs/osd_internal.h @@ -54,6 +54,7 @@ #include #include #include +#include /** * By design including kmem.h overrides the Linux slab interfaces to provide @@ -221,6 +222,7 @@ struct osd_thandle { struct osd_oi { char oi_name[OSD_OI_NAME_SIZE]; /* unused */ uint64_t oi_zapid; + dmu_buf_t *oi_db; }; struct osd_seq { diff --git a/lustre/osd-zfs/osd_oi.c b/lustre/osd-zfs/osd_oi.c index ef9aefc..6cb2c80 100644 --- a/lustre/osd-zfs/osd_oi.c +++ b/lustre/osd-zfs/osd_oi.c @@ -128,10 +128,9 @@ osd_oi_lookup(const struct lu_env *env, struct osd_device *o, if (rc >= sizeof(oi->oi_name)) return -E2BIG; - rc = 0; oi->oi_zapid = zde->zde_dnode; - return rc; + return 0; } /** @@ -505,6 +504,8 @@ osd_oi_remove_table(const struct lu_env *env, struct osd_device *o, int key) oi = o->od_oi_table[key]; if (oi) { + if (oi->oi_db) + sa_buf_rele(oi->oi_db, osd_obj_tag); OBD_FREE_PTR(oi); o->od_oi_table[key] = NULL; } @@ -534,6 +535,7 @@ osd_oi_add_table(const struct lu_env *env, struct osd_device *o, } o->od_oi_table[key] = oi; + __osd_obj2dbuf(env, o->od_os, oi->oi_zapid, &oi->oi_db); return 0; }