From: Shaun Tancheff Date: Mon, 10 Jun 2019 20:48:54 +0000 (-0500) Subject: LU-12400 osd-ldiskfs: get rid of legacy 'get_ds()' function X-Git-Tag: 2.12.56~11 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=15f6148bea2baea8e199707645f968a7ddc50cc7 LU-12400 osd-ldiskfs: get rid of legacy 'get_ds()' function get rid of legacy 'get_ds()' function Every in-kernel use of this function defined it to KERNEL_DS (either as an actual define, or as an inline function). Linux-commit: 736706bee3298208343a76096370e4f6a5c55915 Test-Parameters: trivial Signed-off-by: Shaun Tancheff Change-Id: I3aabe74802f1a953b140728f22c83125dae270c3 Reviewed-on: https://review.whamcloud.com/35238 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Petros Koutoupis Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- diff --git a/libcfs/libcfs/linux/linux-prim.c b/libcfs/libcfs/linux/linux-prim.c index f263e9e..d0797a3 100644 --- a/libcfs/libcfs/linux/linux-prim.c +++ b/libcfs/libcfs/linux/linux-prim.c @@ -111,7 +111,7 @@ int cfs_kernel_write(struct file *filp, const void *buf, size_t count, mm_segment_t __old_fs = get_fs(); int rc; - set_fs(get_ds()); + set_fs(KERNEL_DS); rc = vfs_write(filp, (__force const char __user *)buf, count, pos); set_fs(__old_fs); diff --git a/lustre/osd-ldiskfs/osd_compat.c b/lustre/osd-ldiskfs/osd_compat.c index 40e6d76..8f231cb 100644 --- a/lustre/osd-ldiskfs/osd_compat.c +++ b/lustre/osd-ldiskfs/osd_compat.c @@ -59,7 +59,7 @@ static void osd_push_ctxt(const struct osd_device *dev, OBD_SET_CTXT_MAGIC(newctxt); newctxt->pwdmnt = dev->od_mnt; newctxt->pwd = dev->od_mnt->mnt_root; - newctxt->fs = get_ds(); + newctxt->fs = KERNEL_DS; newctxt->umask = current_umask(); newctxt->dt = NULL; diff --git a/lustre/osd-ldiskfs/osd_io.c b/lustre/osd-ldiskfs/osd_io.c index 72cb3d0..072e12c 100644 --- a/lustre/osd-ldiskfs/osd_io.c +++ b/lustre/osd-ldiskfs/osd_io.c @@ -1374,7 +1374,7 @@ static int osd_is_mapped(struct dt_object *dt, __u64 offset, fei.fi_extents_start = &fe; saved_fs = get_fs(); - set_fs(get_ds()); + set_fs(KERNEL_DS); rc = inode->i_op->fiemap(inode, &fei, offset, FIEMAP_MAX_OFFSET-offset); set_fs(saved_fs); if (rc != 0) @@ -2258,7 +2258,7 @@ static int osd_fiemap_get(const struct lu_env *env, struct dt_object *dt, /* Save previous value address limit */ cur_fs = get_fs(); /* Set the address limit of the kernel */ - set_fs(get_ds()); + set_fs(KERNEL_DS); rc = inode->i_op->fiemap(inode, &fieinfo, fm->fm_start, len); fm->fm_flags = fieinfo.fi_flags; diff --git a/lustre/osd-ldiskfs/osd_scrub.c b/lustre/osd-ldiskfs/osd_scrub.c index 2d5c558..c1fb942 100644 --- a/lustre/osd-ldiskfs/osd_scrub.c +++ b/lustre/osd-ldiskfs/osd_scrub.c @@ -2594,7 +2594,7 @@ int osd_scrub_setup(const struct lu_env *env, struct osd_device *dev) OBD_SET_CTXT_MAGIC(ctxt); ctxt->pwdmnt = dev->od_mnt; ctxt->pwd = dev->od_mnt->mnt_root; - ctxt->fs = get_ds(); + ctxt->fs = KERNEL_DS; init_waitqueue_head(&scrub->os_thread.t_ctl_waitq); init_rwsem(&scrub->os_rwsem); diff --git a/lustre/ptlrpc/sec_ctx.c b/lustre/ptlrpc/sec_ctx.c index 5667495..9f426b8 100644 --- a/lustre/ptlrpc/sec_ctx.c +++ b/lustre/ptlrpc/sec_ctx.c @@ -37,9 +37,9 @@ /* Debugging check only needed during development */ #ifdef OBD_CTXT_DEBUG # define ASSERT_CTXT_MAGIC(magic) LASSERT((magic) == OBD_RUN_CTXT_MAGIC) -# define ASSERT_NOT_KERNEL_CTXT(msg) LASSERTF(!segment_eq(get_fs(), get_ds()),\ +# define ASSERT_NOT_KERNEL_CTXT(msg) LASSERTF(!segment_eq(get_fs(), KERNEL_DS),\ msg) -# define ASSERT_KERNEL_CTXT(msg) LASSERTF(segment_eq(get_fs(), get_ds()), msg) +# define ASSERT_KERNEL_CTXT(msg) LASSERTF(segment_eq(get_fs(), KERNEL_DS), msg) #else # define ASSERT_CTXT_MAGIC(magic) do {} while(0) # define ASSERT_NOT_KERNEL_CTXT(msg) do {} while(0)