Whamcloud - gitweb
LU-1581 osd: zfs osd to take svname from lsi
authorAlex Zhuravlev <bzzz@whamcloud.com>
Mon, 30 Jul 2012 14:00:21 +0000 (18:00 +0400)
committerOleg Drokin <green@whamcloud.com>
Thu, 16 Aug 2012 13:00:45 +0000 (09:00 -0400)
as the label is marked with ':' at the beginning

Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: I54b651392834278bf1b0d72807576970887ca2b3
Reviewed-on: http://review.whamcloud.com/3610
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
lustre/osd-zfs/osd_handler.c

index 67240f3..3c2abe5 100644 (file)
@@ -403,23 +403,6 @@ static int osd_init_capa_ctxt(const struct lu_env *env, struct dt_device *d,
        RETURN(0);
 }
 
-static char *osd_label_get(const struct lu_env *env, const struct dt_device *d)
-{
-       struct osd_device *dev = osd_dt_dev(d);
-       int rc;
-       ENTRY;
-
-       rc = -udmu_userprop_get_str(&dev->od_objset, DMU_OSD_SVNAME,
-                                   dev->od_svname, sizeof(dev->od_svname));
-       if (rc != 0) {
-               if (rc == -EOVERFLOW)
-                       CWARN("%s: buffer too small\n", dev->od_svname);
-               RETURN(NULL);
-       }
-
-       RETURN(&dev->od_svname[0]);
-}
-
 static struct dt_device_operations osd_dt_ops = {
        .dt_root_get            = osd_root_get,
        .dt_statfs              = osd_statfs,
@@ -504,7 +487,6 @@ static int osd_mount(const struct lu_env *env,
        struct lustre_mount_info        *lmi;
        struct lustre_sb_info           *lsi;
        dmu_buf_t                       *rootdb;
-       char                            *label;
        int                              rc;
        ENTRY;
 
@@ -524,6 +506,7 @@ static int osd_mount(const struct lu_env *env,
                RETURN(-E2BIG);
 
        strcpy(o->od_mntdev, dev);
+       strcpy(o->od_svname, lsi->lsi_ldd->ldd_svname);
 
        rc = -udmu_objset_open(o->od_mntdev, &o->od_objset);
        if (rc) {
@@ -547,15 +530,11 @@ static int osd_mount(const struct lu_env *env,
        if (rc)
                GOTO(err, rc);
 
-       label = osd_label_get(env, &o->od_dt_dev);
-       if (label == NULL)
-               GOTO(err, rc = -ENODEV);
-
        /* Use our own ZAP for inode accounting by default, this can be changed
         * via procfs to estimate the inode usage from the block usage */
        o->od_quota_iused_est = 0;
 
-       rc = osd_procfs_init(o, label);
+       rc = osd_procfs_init(o, o->od_svname);
        if (rc)
                GOTO(err, rc);