From 63a296c31a51cf8ac29f6e339e5686192da14769 Mon Sep 17 00:00:00 2001 From: Alex Zhuravlev Date: Thu, 18 Jun 2015 08:38:03 +0300 Subject: [PATCH] LU-6742 osd: remove legacy code osd_convert_root_to_new_seq() was introduced to convert the filesystems created with pre-production Orion code. we don't need this anymore. Change-Id: Ib5657fc7a905bebacd4074878cc76365e1e3d8d9 Signed-off-by: Alex Zhuravlev Reviewed-on: http://review.whamcloud.com/15335 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Mike Pershin Reviewed-by: Nathaniel Clark --- lustre/osd-zfs/osd_handler.c | 4 -- lustre/osd-zfs/osd_internal.h | 2 - lustre/osd-zfs/osd_oi.c | 100 ------------------------------------------ 3 files changed, 106 deletions(-) diff --git a/lustre/osd-zfs/osd_handler.c b/lustre/osd-zfs/osd_handler.c index c73184e..5ee3e18 100644 --- a/lustre/osd-zfs/osd_handler.c +++ b/lustre/osd-zfs/osd_handler.c @@ -991,10 +991,6 @@ static int osd_mount(const struct lu_env *env, if (rc) GOTO(err, rc); - rc = osd_convert_root_to_new_seq(env, o); - if (rc) - GOTO(err, rc); - /* 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; diff --git a/lustre/osd-zfs/osd_internal.h b/lustre/osd-zfs/osd_internal.h index 9f567d6..bf3a3a4 100644 --- a/lustre/osd-zfs/osd_internal.h +++ b/lustre/osd-zfs/osd_internal.h @@ -462,8 +462,6 @@ int osd_fid_lookup(const struct lu_env *env, uint64_t osd_get_name_n_idx(const struct lu_env *env, struct osd_device *osd, const struct lu_fid *fid, char *buf); int osd_options_init(void); -int osd_convert_root_to_new_seq(const struct lu_env *env, - struct osd_device *o); int osd_ost_seq_exists(const struct lu_env *env, struct osd_device *osd, __u64 seq); /* osd_index.c */ diff --git a/lustre/osd-zfs/osd_oi.c b/lustre/osd-zfs/osd_oi.c index 22f6ff0..54f3107 100644 --- a/lustre/osd-zfs/osd_oi.c +++ b/lustre/osd-zfs/osd_oi.c @@ -680,106 +680,6 @@ osd_oi_init_compat(const struct lu_env *env, struct osd_device *o) RETURN(rc); } -static char *root2convert = "ROOT"; -/* - * due to DNE requirements we have to change sequence of /ROOT object - * so that it doesn't belong to the local sequence FID_SEQ_LOCAL_FILE - * but a normal sequence living on MDS#0 - * this is the sole purpose of this function. - * - * This is only needed for pre-production 2.4 ZFS filesystems, and - * can be removed in the future. - */ -int osd_convert_root_to_new_seq(const struct lu_env *env, struct osd_device *o) -{ - struct luz_direntry *lze = &osd_oti_get(env)->oti_zde; - char *buf = osd_oti_get(env)->oti_str; - struct lu_fid newfid; - uint64_t zapid; - dmu_tx_t *tx = NULL; - int rc; - ENTRY; - - /* ignore OSTs */ - if (strstr(o->od_svname, "MDT") == NULL) - RETURN(0); - - /* lookup /ROOT */ - rc = -zap_lookup(o->od_os, o->od_root, root2convert, 8, - sizeof(*lze) / 8, (void *)lze); - /* doesn't exist or let actual user to handle the error */ - if (rc) - RETURN(0); - - CDEBUG(D_OTHER, "%s: /ROOT -> "DFID" -> "LPU64"\n", o->od_svname, - PFID(&lze->lzd_fid), (long long int) lze->lzd_reg.zde_dnode); - - /* already right one? */ - if (fid_seq(&lze->lzd_fid) == FID_SEQ_ROOT) - return 0; - - tx = dmu_tx_create(o->od_os); - if (tx == NULL) - return -ENOMEM; - - dmu_tx_hold_bonus(tx, o->od_root); - - /* declare delete/insert of the name */ - dmu_tx_hold_zap(tx, o->od_root, TRUE, root2convert); - dmu_tx_hold_zap(tx, o->od_root, FALSE, root2convert); - - /* declare that we'll remove object from fid-dnode mapping */ - zapid = osd_get_name_n_idx(env, o, &lze->lzd_fid, buf); - dmu_tx_hold_bonus(tx, zapid); - dmu_tx_hold_zap(tx, zapid, FALSE, buf); - - /* declare that we'll add object to fid-dnode mapping */ - newfid.f_seq = FID_SEQ_ROOT; - newfid.f_oid = FID_OID_ROOT; - newfid.f_ver = 0; - zapid = osd_get_name_n_idx(env, o, &newfid, buf); - dmu_tx_hold_bonus(tx, zapid); - dmu_tx_hold_zap(tx, zapid, TRUE, buf); - - rc = -dmu_tx_assign(tx, TXG_WAIT); - if (rc) - GOTO(err, rc); - - rc = -zap_remove(o->od_os, o->od_root, root2convert, tx); - if (rc) - GOTO(err, rc); - - /* remove from OI */ - zapid = osd_get_name_n_idx(env, o, &lze->lzd_fid, buf); - rc = -zap_remove(o->od_os, zapid, buf, tx); - if (rc) - GOTO(err, rc); - - lze->lzd_fid = newfid; - rc = -zap_add(o->od_os, o->od_root, root2convert, - 8, sizeof(*lze) / 8, (void *)lze, tx); - if (rc) - GOTO(err, rc); - - /* add to OI with the new fid */ - zapid = osd_get_name_n_idx(env, o, &newfid, buf); - rc = -zap_add(o->od_os, zapid, buf, 8, 1, &lze->lzd_reg, tx); - if (rc) - GOTO(err, rc); - - - /* LMA will be updated in mdd_compat_fixes */ - dmu_tx_commit(tx); - - RETURN(rc); - -err: - if (tx) - dmu_tx_abort(tx); - CERROR("%s: can't convert to new fid: rc = %d\n", o->od_svname, rc); - RETURN(rc); -} - /** * Initialize the OIs by either opening or creating them as needed. */ -- 1.8.3.1