Whamcloud - gitweb
LU-7905 osd: pin OI objects 03/19103/8
authorAlex Zhuravlev <alexey.zhuravlev@intel.com>
Wed, 23 Mar 2016 19:30:03 +0000 (22:30 +0300)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 27 May 2016 00:57:49 +0000 (00:57 +0000)
so that corresponing dnodes are kept in memory.

Change-Id: Ic312bfc57e3adc1032cefdd97efcf8f819418dc8
Signed-off-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-on: http://review.whamcloud.com/19103
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/osd-zfs/osd_internal.h
lustre/osd-zfs/osd_oi.c

index fa0c3f2..a59ff87 100644 (file)
@@ -54,6 +54,7 @@
 #include <sys/nvpair.h>
 #include <sys/zfs_znode.h>
 #include <sys/zap.h>
 #include <sys/nvpair.h>
 #include <sys/zfs_znode.h>
 #include <sys/zap.h>
+#include <sys/dbuf.h>
 
 /**
  * By design including kmem.h overrides the Linux slab interfaces to provide
 
 /**
  * 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;
 struct osd_oi {
        char                    oi_name[OSD_OI_NAME_SIZE]; /* unused */
        uint64_t                oi_zapid;
+       dmu_buf_t              *oi_db;
 };
 
 struct osd_seq {
 };
 
 struct osd_seq {
index ef9aefc..6cb2c80 100644 (file)
@@ -128,10 +128,9 @@ osd_oi_lookup(const struct lu_env *env, struct osd_device *o,
        if (rc >= sizeof(oi->oi_name))
                return -E2BIG;
 
        if (rc >= sizeof(oi->oi_name))
                return -E2BIG;
 
-       rc = 0;
        oi->oi_zapid = zde->zde_dnode;
 
        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) {
 
        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;
        }
                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;
        }
 
        o->od_oi_table[key] = oi;
+       __osd_obj2dbuf(env, o->od_os, oi->oi_zapid, &oi->oi_db);
 
        return 0;
 }
 
        return 0;
 }