Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1711116 > unrolled thread

[PATCH 00/64] staging: lustre: uapi: normalize the lustre headers

Started byJames Simmons <jsimmons@infradead.org>
First post2017-08-14 18:10 +0200
Last post2017-08-17 18:30 +0200
Articles 10 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 00/64] staging: lustre: uapi: normalize the lustre headers James Simmons <jsimmons@infradead.org> - 2017-08-14 18:10 +0200
    [PATCH 12/64] staging: lustre: uapi: move lustre_ioctl.h to uapi directory James Simmons <jsimmons@infradead.org> - 2017-08-14 18:10 +0200
    [PATCH 10/64] staging: lustre: uapi: move obd_ioctl_getdata() declaration James Simmons <jsimmons@infradead.org> - 2017-08-14 18:10 +0200
    [PATCH 06/64] staging: lustre: uapi: remove unused function in lustre_disk.h James Simmons <jsimmons@infradead.org> - 2017-08-14 18:10 +0200
    [PATCH 14/64] staging: lustre: uapi: cleanup headers for lustre_ioctl.h James Simmons <jsimmons@infradead.org> - 2017-08-14 18:10 +0200
    [PATCH 04/64] staging: lustre: uapi: update URL doc link in lustre_fid.h James Simmons <jsimmons@infradead.org> - 2017-08-14 18:10 +0200
    [PATCH 02/64] staging: lustre: uapi: remove unused functions for lustre_fid.h James Simmons <jsimmons@infradead.org> - 2017-08-14 18:10 +0200
    [PATCH 16/64] staging: lustre: uapi: move kernel only prototypes out of lustre_param.h James Simmons <jsimmons@infradead.org> - 2017-08-14 18:10 +0200
    [PATCH 05/64] staging: lustre: uapi: move lu_fid, ost_id funcs out of lustre_idl.h James Simmons <jsimmons@infradead.org> - 2017-08-14 18:10 +0200
    Re: [PATCH 00/64] staging: lustre: uapi: normalize the lustre headers Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-17 18:30 +0200

#1711116 — [PATCH 00/64] staging: lustre: uapi: normalize the lustre headers

FromJames Simmons <jsimmons@infradead.org>
Date2017-08-14 18:10 +0200
Subject[PATCH 00/64] staging: lustre: uapi: normalize the lustre headers
Message-ID<uepMR-5WA-3@gated-at.bofh.it>
The headers for lustre/LNet for a long time lacked a clean separation in
its internal headers which resulted in kernel specific data structures
being exposed in user land code. This work unravels this mess and creates
a clear separation between lustre kernel space and lustre user land.
With this work done the include paths in the lustre kernel code can now
be normalized.

Ben Evans (4):
  staging: lustre: uapi: Move functions out of lustre_idl.h
  staging: lustre: uapi: return error code for ostid_set_id
  staging: lustre: uapi: update URL doc link in lustre_fid.h
  staging: lustre: uapi: move lu_fid, ost_id funcs out of lustre_idl.h

James Simmons (60):
  staging: lustre: uapi: remove unused functions for lustre_fid.h
  staging: lustre: uapi: remove unused function in lustre_disk.h
  staging: lustre: uapi: remove userland version of obd_ioctl_*()
  staging: lustre: uapi: remove obd_ioctl_freedata() wrapper
  staging: lustre: uapi: remove obd_ioctl_popdata() wrapper
  staging: lustre: uapi: move obd_ioctl_getdata() declaration
  staging: lustre: uapi: move obd_ioctl_is_invalid() to linux-module.c
  staging: lustre: uapi: move lustre_ioctl.h to uapi directory
  staging: lustre: uapi: use __ALIGN_KERNEL for lustre_ioctl.h
  staging: lustre: uapi: cleanup headers for lustre_ioctl.h
  staging: lustre: uapi: label lustre_ioctl.h as a UAPI header
  staging: lustre: uapi: move kernel only prototypes out of lustre_param.h
  staging: lustre: uapi: remove included headers out of lustre_param.h
  staging: lustre: uapi: move lustre_param.h to uapi directory
  staging: lustre: uapi: label lustre_param.h as an uapi header
  staging: lustre: uapi: style cleanups for lustre_param.h
  staging: lustre: uapi: remove lustre_cfg_free wrapper
  staging: lustre: uapi: don't memory allocate in UAPI header
  staging: lustre: uapi: move lustre_cfg_string() to obd_config.c
  staging: lustre: obdclass: no need to check for kfree
  staging: lustre: uapi: move lustre_cfg.h to uapi directory
  staging: lustre: uapi: remove need for libcfs.h from lustre_cfg.h
  staging: lustre: uapi: change variable type to match
  staging: lustre: uapi: check if argument for lustre_cfg_buf() is NULL
  staging: lustre: uapi: style cleanup of lustre_cfg.h
  staging: lustre: uapi: label lustre_cfg.h as an uapi header
  staging: lustre: libcfs: remove htonl hack in libcfs.h
  staging: lustre: libcfs: remove LOGL and LOGU macros
  staging: lustre: libcfs: create libcfs_debug.h UAPI header
  staging: lustre: socklnd: create socklnd.h UAPI header
  staging: lustre: lnet: delete lnet.h
  staging: lustre: lnet: migrate headers to lnet uapi directory
  staging: lustre: libcfs: sort headers in libcfs.h
  staging: lustre: lnet: remove userland function prototype in lnetctl.h
  staging: lustre: lnet: remove BIT macro from lnetctl.h
  staging: lustre: uapi: remove libcfs.h from lustre_id.h/lustre_user.h
  staging: lustre: uapi: migrate remaining uapi headers to uapi directory
  staging: lustre: uapi: remove CONFIG_LUSTRE_OBD_MAX_IOCTL
  staging: lustre: uapi: use proper byteorder functions in lustre_idl.h
  staging: lustre: uapi: remove BIT macro from UAPI headers
  staging: lustre: fid: add include path to Makefile
  staging: lustre: fld: add include path to Makefile
  staging: lustre: ptlrpc: add include path to Makefile
  staging: lustre: llite: add include path to Makefile
  staging: lustre: lmv: add include path to Makefile
  staging: lustre: lov: add include path to Makefile
  staging: lustre: mdc: add include path to Makefile
  staging: lustre: mgc: add include path to Makefile
  staging: lustre: obdclass: add include path to Makefile
  staging: lustre: obdecho: add include path to Makefile
  staging: lustre: osc: add include path to Makefile
  staging: lustre: lustre: cleanup paths for lustre internal headers
  staging: lustre: lustre: cleanup paths for lustre UAPI headers
  staging: lustre: lnet: selftest: add include path to Makefile
  staging: lustre: lnet: add include path to Makefile
  staging: lustre: ko2iblnd: add include path to Makefile
  staging: lustre: ksocklnd: add include path to Makefile
  staging: lustre: libcfs: add include path to Makefile
  staging: lustre: libcfs: cleanup paths for libcfs headers
  staging: lustre: lnet: cleanup paths for all LNet headers

 .../staging/lustre/include/linux/libcfs/libcfs.h   |  28 +-
 .../lustre/include/linux/libcfs/libcfs_debug.h     | 104 +---
 .../lustre/include/linux/libcfs/libcfs_private.h   |  26 -
 drivers/staging/lustre/include/linux/lnet/api.h    |   2 +-
 .../staging/lustre/include/linux/lnet/lib-lnet.h   |  12 +-
 .../staging/lustre/include/linux/lnet/lib-types.h  |   4 +-
 .../staging/lustre/include/linux/lnet/socklnd.h    |  12 +-
 .../lustre/include/uapi/linux/lnet/libcfs_debug.h  | 149 +++++
 .../libcfs => uapi/linux/lnet}/libcfs_ioctl.h      |   0
 .../lnet/lib-dlc.h => uapi/linux/lnet/lnet-dlc.h}  |   4 +-
 .../lnet/types.h => uapi/linux/lnet/lnet-types.h}  |   0
 .../lustre/include/{ => uapi}/linux/lnet/lnetctl.h |  51 +-
 .../lustre/include/{ => uapi}/linux/lnet/lnetst.h  |   0
 .../lustre/include/{ => uapi}/linux/lnet/nidstr.h  |   2 +-
 .../lnet/lnet.h => uapi/linux/lnet/socklnd.h}      |  24 +-
 .../uapi/linux/lustre}/lustre_cfg.h                | 188 +++---
 .../lustre/include/uapi/linux/lustre/lustre_fid.h  | 293 +++++++++
 .../uapi/linux/lustre/lustre_fiemap.h}             |   6 +-
 .../uapi/linux}/lustre/lustre_idl.h                | 682 +--------------------
 .../uapi/linux}/lustre/lustre_ioctl.h              | 203 +-----
 .../uapi/linux/lustre/lustre_kernelcomm.h}         |   6 +-
 .../include/uapi/linux/lustre/lustre_ostid.h       | 235 +++++++
 .../include/uapi/linux/lustre/lustre_param.h       |  94 +++
 .../uapi/linux}/lustre/lustre_user.h               |  15 +-
 .../uapi/linux/lustre}/lustre_ver.h                |   0
 drivers/staging/lustre/lnet/klnds/o2iblnd/Makefile |   3 +
 .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h    |   5 +-
 drivers/staging/lustre/lnet/klnds/socklnd/Makefile |   3 +
 .../staging/lustre/lnet/klnds/socklnd/socklnd.h    |   7 +-
 drivers/staging/lustre/lnet/libcfs/Makefile        |   3 +
 drivers/staging/lustre/lnet/libcfs/debug.c         |   2 +-
 drivers/staging/lustre/lnet/libcfs/fail.c          |   2 +-
 drivers/staging/lustre/lnet/libcfs/hash.c          |   2 +-
 drivers/staging/lustre/lnet/libcfs/libcfs_cpu.c    |   2 +-
 drivers/staging/lustre/lnet/libcfs/libcfs_lock.c   |   2 +-
 drivers/staging/lustre/lnet/libcfs/libcfs_mem.c    |   2 +-
 drivers/staging/lustre/lnet/libcfs/libcfs_string.c |   2 +-
 .../staging/lustre/lnet/libcfs/linux/linux-cpu.c   |   2 +-
 .../lustre/lnet/libcfs/linux/linux-crypto.c        |   4 +-
 .../lustre/lnet/libcfs/linux/linux-curproc.c       |   2 +-
 .../staging/lustre/lnet/libcfs/linux/linux-debug.c |   2 +-
 .../staging/lustre/lnet/libcfs/linux/linux-mem.c   |   2 +-
 .../lustre/lnet/libcfs/linux/linux-module.c        |   2 +-
 .../staging/lustre/lnet/libcfs/linux/linux-prim.c  |   2 +-
 .../lustre/lnet/libcfs/linux/linux-tracefile.c     |   2 +-
 drivers/staging/lustre/lnet/libcfs/module.c        |   9 +-
 drivers/staging/lustre/lnet/libcfs/prng.c          |   2 +-
 drivers/staging/lustre/lnet/libcfs/tracefile.c     |   2 +-
 drivers/staging/lustre/lnet/libcfs/tracefile.h     |   2 +-
 drivers/staging/lustre/lnet/libcfs/workitem.c      |   2 +-
 drivers/staging/lustre/lnet/lnet/Makefile          |   3 +
 drivers/staging/lustre/lnet/lnet/acceptor.c        |   2 +-
 drivers/staging/lustre/lnet/lnet/api-ni.c          |   4 +-
 drivers/staging/lustre/lnet/lnet/config.c          |   2 +-
 drivers/staging/lustre/lnet/lnet/lib-eq.c          |   3 +-
 drivers/staging/lustre/lnet/lnet/lib-md.c          |   2 +-
 drivers/staging/lustre/lnet/lnet/lib-me.c          |   2 +-
 drivers/staging/lustre/lnet/lnet/lib-move.c        |   2 +-
 drivers/staging/lustre/lnet/lnet/lib-msg.c         |   2 +-
 drivers/staging/lustre/lnet/lnet/lib-ptl.c         |   2 +-
 drivers/staging/lustre/lnet/lnet/lib-socket.c      |   4 +-
 drivers/staging/lustre/lnet/lnet/lo.c              |   3 +-
 drivers/staging/lustre/lnet/lnet/module.c          |   5 +-
 drivers/staging/lustre/lnet/lnet/net_fault.c       |   4 +-
 drivers/staging/lustre/lnet/lnet/nidstrings.c      |   4 +-
 drivers/staging/lustre/lnet/lnet/peer.c            |   4 +-
 drivers/staging/lustre/lnet/lnet/router.c          |   3 +-
 drivers/staging/lustre/lnet/lnet/router_proc.c     |   5 +-
 drivers/staging/lustre/lnet/selftest/Makefile      |   3 +
 drivers/staging/lustre/lnet/selftest/conctl.c      |   6 +-
 drivers/staging/lustre/lnet/selftest/conrpc.c      |   4 +-
 drivers/staging/lustre/lnet/selftest/conrpc.h      |   7 +-
 drivers/staging/lustre/lnet/selftest/console.c     |   4 +-
 drivers/staging/lustre/lnet/selftest/console.h     |   7 +-
 drivers/staging/lustre/lnet/selftest/rpc.h         |   2 +-
 drivers/staging/lustre/lnet/selftest/selftest.h    |   9 +-
 drivers/staging/lustre/lustre/Kconfig              |  10 -
 drivers/staging/lustre/lustre/fid/Makefile         |   3 +
 drivers/staging/lustre/lustre/fid/fid_internal.h   |   4 +-
 drivers/staging/lustre/lustre/fid/fid_lib.c        |   5 +-
 drivers/staging/lustre/lustre/fid/fid_request.c    |  12 +-
 drivers/staging/lustre/lustre/fid/lproc_fid.c      |  12 +-
 drivers/staging/lustre/lustre/fld/Makefile         |   3 +
 drivers/staging/lustre/lustre/fld/fld_cache.c      |  16 +-
 drivers/staging/lustre/lustre/fld/fld_internal.h   |   8 +-
 drivers/staging/lustre/lustre/fld/fld_request.c    |  18 +-
 drivers/staging/lustre/lustre/fld/lproc_fld.c      |  14 +-
 drivers/staging/lustre/lustre/include/cl_object.h  |   4 +-
 drivers/staging/lustre/lustre/include/llog_swab.h  |   3 +-
 .../staging/lustre/lustre/include/lprocfs_status.h |   6 +-
 drivers/staging/lustre/lustre/include/lu_object.h  |   6 +-
 .../staging/lustre/lustre/include/lustre_compat.h  |   2 +-
 .../staging/lustre/lustre/include/lustre_debug.h   |   4 +-
 .../staging/lustre/lustre/include/lustre_disk.h    |  23 +-
 drivers/staging/lustre/lustre/include/lustre_dlm.h |  25 +-
 .../lustre/include/{lustre => }/lustre_errno.h     |   0
 .../staging/lustre/lustre/include/lustre_export.h  |   6 +-
 drivers/staging/lustre/lustre/include/lustre_fid.h |  84 ++-
 drivers/staging/lustre/lustre/include/lustre_fld.h |   5 +-
 .../staging/lustre/lustre/include/lustre_handles.h |   2 +-
 .../staging/lustre/lustre/include/lustre_import.h  |   4 +-
 .../lustre/lustre/include/lustre_kernelcomm.h      |   2 +-
 drivers/staging/lustre/lustre/include/lustre_lib.h |  12 +-
 drivers/staging/lustre/lustre/include/lustre_lmv.h |   2 +-
 drivers/staging/lustre/lustre/include/lustre_log.h |   4 +-
 drivers/staging/lustre/lustre/include/lustre_mdc.h |  15 +-
 drivers/staging/lustre/lustre/include/lustre_mds.h |  11 +-
 drivers/staging/lustre/lustre/include/lustre_net.h |  28 +-
 drivers/staging/lustre/lustre/include/lustre_nrs.h |   2 +-
 .../staging/lustre/lustre/include/lustre_obdo.h    |   2 +-
 .../staging/lustre/lustre/include/lustre_param.h   | 109 ----
 .../staging/lustre/lustre/include/lustre_swab.h    |   8 +-
 drivers/staging/lustre/lustre/include/obd.h        |  18 +-
 drivers/staging/lustre/lustre/include/obd_cksum.h  |   6 +-
 drivers/staging/lustre/lustre/include/obd_class.h  |  35 +-
 .../staging/lustre/lustre/include/obd_support.h    |   6 +-
 drivers/staging/lustre/lustre/include/seq_range.h  |   2 +-
 drivers/staging/lustre/lustre/ldlm/interval_tree.c |   6 +-
 drivers/staging/lustre/lustre/ldlm/l_lock.c        |   6 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_extent.c   |  12 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_flock.c    |   8 +-
 .../staging/lustre/lustre/ldlm/ldlm_inodebits.c    |   6 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_internal.h |   6 +
 drivers/staging/lustre/lustre/ldlm/ldlm_lib.c      |  12 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_lock.c     |   8 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c    |   6 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_plain.c    |   6 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_pool.c     |   8 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_request.c  |  34 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_resource.c |   6 +-
 drivers/staging/lustre/lustre/llite/Makefile       |   3 +
 drivers/staging/lustre/lustre/llite/dcache.c       |   6 +-
 drivers/staging/lustre/lustre/llite/dir.c          |  22 +-
 drivers/staging/lustre/lustre/llite/file.c         |  10 +-
 drivers/staging/lustre/lustre/llite/glimpse.c      |  16 +-
 drivers/staging/lustre/lustre/llite/lcommon_cl.c   |  35 +-
 drivers/staging/lustre/lustre/llite/lcommon_misc.c |   8 +-
 .../staging/lustre/lustre/llite/llite_internal.h   |  20 +-
 drivers/staging/lustre/lustre/llite/llite_lib.c    |  21 +-
 drivers/staging/lustre/lustre/llite/lproc_llite.c  |   4 +-
 drivers/staging/lustre/lustre/llite/namei.c        |   7 +-
 drivers/staging/lustre/lustre/llite/range_lock.c   |   2 +-
 drivers/staging/lustre/lustre/llite/range_lock.h   |   4 +-
 drivers/staging/lustre/lustre/llite/rw.c           |   2 +-
 drivers/staging/lustre/lustre/llite/statahead.c    |   4 +-
 drivers/staging/lustre/lustre/llite/super25.c      |   6 +-
 drivers/staging/lustre/lustre/llite/vvp_dev.c      |   2 +-
 drivers/staging/lustre/lustre/llite/vvp_internal.h |   4 +-
 drivers/staging/lustre/lustre/llite/vvp_io.c       |   2 +-
 drivers/staging/lustre/lustre/llite/vvp_lock.c     |   2 +-
 drivers/staging/lustre/lustre/llite/vvp_object.c   |   4 +-
 drivers/staging/lustre/lustre/llite/xattr.c        |   5 +-
 drivers/staging/lustre/lustre/llite/xattr_cache.c  |   5 +-
 drivers/staging/lustre/lustre/lmv/Makefile         |   3 +
 drivers/staging/lustre/lustre/lmv/lmv_fld.c        |  15 +-
 drivers/staging/lustre/lustre/lmv/lmv_intent.c     |  17 +-
 drivers/staging/lustre/lustre/lmv/lmv_internal.h   |   6 +-
 drivers/staging/lustre/lustre/lmv/lmv_obd.c        |  19 +-
 drivers/staging/lustre/lustre/lmv/lproc_lmv.c      |   4 +-
 drivers/staging/lustre/lustre/lov/Makefile         |   3 +
 .../staging/lustre/lustre/lov/lov_cl_internal.h    |   6 +-
 drivers/staging/lustre/lustre/lov/lov_dev.c        |   2 +-
 drivers/staging/lustre/lustre/lov/lov_ea.c         |   6 +-
 drivers/staging/lustre/lustre/lov/lov_internal.h   |   4 +-
 drivers/staging/lustre/lustre/lov/lov_merge.c      |   4 +-
 drivers/staging/lustre/lustre/lov/lov_obd.c        |  40 +-
 drivers/staging/lustre/lustre/lov/lov_offset.c     |   4 +-
 drivers/staging/lustre/lustre/lov/lov_pack.c       |  13 +-
 drivers/staging/lustre/lustre/lov/lov_pool.c       |   4 +-
 drivers/staging/lustre/lustre/lov/lov_request.c    |   6 +-
 drivers/staging/lustre/lustre/lov/lproc_lov.c      |   4 +-
 drivers/staging/lustre/lustre/mdc/Makefile         |   3 +
 drivers/staging/lustre/lustre/mdc/lproc_mdc.c      |   4 +-
 drivers/staging/lustre/lustre/mdc/mdc_internal.h   |   2 +-
 drivers/staging/lustre/lustre/mdc/mdc_lib.c        |  10 +-
 drivers/staging/lustre/lustre/mdc/mdc_locks.c      |  22 +-
 drivers/staging/lustre/lustre/mdc/mdc_reint.c      |   4 +-
 drivers/staging/lustre/lustre/mdc/mdc_request.c    |  25 +-
 drivers/staging/lustre/lustre/mgc/Makefile         |   3 +
 drivers/staging/lustre/lustre/mgc/lproc_mgc.c      |   4 +-
 drivers/staging/lustre/lustre/mgc/mgc_internal.h   |  11 +-
 drivers/staging/lustre/lustre/mgc/mgc_request.c    |  23 +-
 drivers/staging/lustre/lustre/obdclass/Makefile    |   3 +
 drivers/staging/lustre/lustre/obdclass/cl_io.c     |   8 +-
 drivers/staging/lustre/lustre/obdclass/cl_lock.c   |   8 +-
 drivers/staging/lustre/lustre/obdclass/cl_object.c |  14 +-
 drivers/staging/lustre/lustre/obdclass/cl_page.c   |   8 +-
 drivers/staging/lustre/lustre/obdclass/class_obd.c |  35 +-
 drivers/staging/lustre/lustre/obdclass/debug.c     |   6 +-
 drivers/staging/lustre/lustre/obdclass/genops.c    |   6 +-
 .../staging/lustre/lustre/obdclass/kernelcomm.c    |   4 +-
 drivers/staging/lustre/lustre/obdclass/linkea.c    |   6 +-
 .../lustre/lustre/obdclass/linux/linux-module.c    | 100 ++-
 .../lustre/lustre/obdclass/linux/linux-sysctl.c    |   6 +-
 drivers/staging/lustre/lustre/obdclass/llog.c      |   6 +-
 drivers/staging/lustre/lustre/obdclass/llog_cat.c  |   2 +-
 .../staging/lustre/lustre/obdclass/llog_internal.h |   2 +-
 drivers/staging/lustre/lustre/obdclass/llog_obd.c  |   4 +-
 drivers/staging/lustre/lustre/obdclass/llog_swab.c |   4 +-
 .../lustre/lustre/obdclass/lprocfs_counters.c      |   4 +-
 .../lustre/lustre/obdclass/lprocfs_status.c        |   6 +-
 drivers/staging/lustre/lustre/obdclass/lu_object.c |  20 +-
 drivers/staging/lustre/lustre/obdclass/lu_ref.c    |  10 +-
 .../lustre/lustre/obdclass/lustre_handles.c        |   6 +-
 .../staging/lustre/lustre/obdclass/lustre_peer.c   |  14 +-
 .../staging/lustre/lustre/obdclass/obd_config.c    |  74 ++-
 drivers/staging/lustre/lustre/obdclass/obd_mount.c |  44 +-
 drivers/staging/lustre/lustre/obdclass/obdo.c      |   6 +-
 .../staging/lustre/lustre/obdclass/statfs_pack.c   |   8 +-
 drivers/staging/lustre/lustre/obdclass/uuid.c      |   6 +-
 drivers/staging/lustre/lustre/obdecho/Makefile     |   3 +
 .../staging/lustre/lustre/obdecho/echo_client.c    |  31 +-
 drivers/staging/lustre/lustre/osc/Makefile         |   3 +
 drivers/staging/lustre/lustre/osc/lproc_osc.c      |   6 +-
 .../staging/lustre/lustre/osc/osc_cl_internal.h    |   6 +-
 drivers/staging/lustre/lustre/osc/osc_dev.c        |   2 +-
 drivers/staging/lustre/lustre/osc/osc_internal.h   |   2 +-
 drivers/staging/lustre/lustre/osc/osc_io.c         |   2 +-
 drivers/staging/lustre/lustre/osc/osc_lock.c       |   4 +-
 drivers/staging/lustre/lustre/osc/osc_object.c     |   9 +-
 drivers/staging/lustre/lustre/osc/osc_quota.c      |   2 +-
 drivers/staging/lustre/lustre/osc/osc_request.c    |  32 +-
 drivers/staging/lustre/lustre/ptlrpc/Makefile      |   3 +
 drivers/staging/lustre/lustre/ptlrpc/client.c      |  12 +-
 drivers/staging/lustre/lustre/ptlrpc/connection.c  |   6 +-
 drivers/staging/lustre/lustre/ptlrpc/errno.c       |   4 +-
 drivers/staging/lustre/lustre/ptlrpc/events.c      |   8 +-
 drivers/staging/lustre/lustre/ptlrpc/import.c      |  16 +-
 drivers/staging/lustre/lustre/ptlrpc/layout.c      |  18 +-
 drivers/staging/lustre/lustre/ptlrpc/llog_client.c |   8 +-
 drivers/staging/lustre/lustre/ptlrpc/llog_net.c    |   6 +-
 .../staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c    |  12 +-
 drivers/staging/lustre/lustre/ptlrpc/niobuf.c      |  10 +-
 drivers/staging/lustre/lustre/ptlrpc/nrs.c         |  10 +-
 drivers/staging/lustre/lustre/ptlrpc/nrs_fifo.c    |   6 +-
 .../staging/lustre/lustre/ptlrpc/pack_generic.c    |  20 +-
 drivers/staging/lustre/lustre/ptlrpc/pers.c        |  10 +-
 drivers/staging/lustre/lustre/ptlrpc/pinger.c      |   4 +-
 .../staging/lustre/lustre/ptlrpc/ptlrpc_module.c   |   8 +-
 drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c     |  18 +-
 drivers/staging/lustre/lustre/ptlrpc/recover.c     |  18 +-
 drivers/staging/lustre/lustre/ptlrpc/sec.c         |  16 +-
 drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c    |  20 +-
 drivers/staging/lustre/lustre/ptlrpc/sec_config.c  |  13 +-
 drivers/staging/lustre/lustre/ptlrpc/sec_gc.c      |  10 +-
 drivers/staging/lustre/lustre/ptlrpc/sec_lproc.c   |  16 +-
 drivers/staging/lustre/lustre/ptlrpc/sec_null.c    |  10 +-
 drivers/staging/lustre/lustre/ptlrpc/sec_plain.c   |  10 +-
 drivers/staging/lustre/lustre/ptlrpc/service.c     |  11 +-
 drivers/staging/lustre/lustre/ptlrpc/wiretest.c    |   8 +-
 250 files changed, 2089 insertions(+), 2182 deletions(-)
 create mode 100644 drivers/staging/lustre/include/uapi/linux/lnet/libcfs_debug.h
 rename drivers/staging/lustre/include/{linux/libcfs => uapi/linux/lnet}/libcfs_ioctl.h (100%)
 rename drivers/staging/lustre/include/{linux/lnet/lib-dlc.h => uapi/linux/lnet/lnet-dlc.h} (97%)
 rename drivers/staging/lustre/include/{linux/lnet/types.h => uapi/linux/lnet/lnet-types.h} (100%)
 rename drivers/staging/lustre/include/{ => uapi}/linux/lnet/lnetctl.h (62%)
 rename drivers/staging/lustre/include/{ => uapi}/linux/lnet/lnetst.h (100%)
 rename drivers/staging/lustre/include/{ => uapi}/linux/lnet/nidstr.h (98%)
 rename drivers/staging/lustre/include/{linux/lnet/lnet.h => uapi/linux/lnet/socklnd.h} (70%)
 rename drivers/staging/lustre/{lustre/include => include/uapi/linux/lustre}/lustre_cfg.h (52%)
 create mode 100644 drivers/staging/lustre/include/uapi/linux/lustre/lustre_fid.h
 rename drivers/staging/lustre/{lustre/include/lustre/ll_fiemap.h => include/uapi/linux/lustre/lustre_fiemap.h} (96%)
 rename drivers/staging/lustre/{lustre/include => include/uapi/linux}/lustre/lustre_idl.h (83%)
 rename drivers/staging/lustre/{lustre/include => include/uapi/linux}/lustre/lustre_ioctl.h (63%)
 rename drivers/staging/lustre/{lustre/include/uapi_kernelcomm.h => include/uapi/linux/lustre/lustre_kernelcomm.h} (95%)
 create mode 100644 drivers/staging/lustre/include/uapi/linux/lustre/lustre_ostid.h
 create mode 100644 drivers/staging/lustre/include/uapi/linux/lustre/lustre_param.h
 rename drivers/staging/lustre/{lustre/include => include/uapi/linux}/lustre/lustre_user.h (99%)
 rename drivers/staging/lustre/{lustre/include => include/uapi/linux/lustre}/lustre_ver.h (100%)
 rename drivers/staging/lustre/lustre/include/{lustre => }/lustre_errno.h (100%)
 delete mode 100644 drivers/staging/lustre/lustre/include/lustre_param.h

-- 
1.8.3.1

[toc] | [next] | [standalone]


#1711117 — [PATCH 12/64] staging: lustre: uapi: move lustre_ioctl.h to uapi directory

FromJames Simmons <jsimmons@infradead.org>
Date2017-08-14 18:10 +0200
Subject[PATCH 12/64] staging: lustre: uapi: move lustre_ioctl.h to uapi directory
Message-ID<ueq6f-6jm-29@gated-at.bofh.it>
In reply to#1711116
Move the header lustre_ioctl.h to proper uapi directory.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401
Reviewed-on: https://review.whamcloud.com/24568
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Ben Evans <bevans@cray.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 .../{lustre/include => include/uapi/linux}/lustre/lustre_ioctl.h     | 5 ++---
 drivers/staging/lustre/lustre/llite/dir.c                            | 2 +-
 drivers/staging/lustre/lustre/llite/file.c                           | 2 +-
 drivers/staging/lustre/lustre/llite/llite_lib.c                      | 2 +-
 drivers/staging/lustre/lustre/lmv/lmv_obd.c                          | 2 +-
 drivers/staging/lustre/lustre/lov/lov_obd.c                          | 2 +-
 drivers/staging/lustre/lustre/mdc/mdc_request.c                      | 2 +-
 drivers/staging/lustre/lustre/obdclass/class_obd.c                   | 2 +-
 drivers/staging/lustre/lustre/obdclass/linux/linux-module.c          | 2 +-
 drivers/staging/lustre/lustre/obdclass/obd_config.c                  | 2 +-
 drivers/staging/lustre/lustre/obdecho/echo_client.c                  | 2 +-
 drivers/staging/lustre/lustre/osc/osc_request.c                      | 2 +-
 12 files changed, 13 insertions(+), 14 deletions(-)
 rename drivers/staging/lustre/{lustre/include => include/uapi/linux}/lustre/lustre_ioctl.h (98%)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h
similarity index 98%
rename from drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h
rename to drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h
index 8585302..880dd92 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h
+++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h
@@ -29,13 +29,12 @@
 #define LUSTRE_IOCTL_H_
 
 #include <linux/types.h>
-#include "../../../include/linux/libcfs/libcfs.h"
-#include "lustre_idl.h"
+#include "../../../linux/libcfs/libcfs.h"
+#include "../../../../lustre/include/lustre/lustre_idl.h"
 
 #ifdef __KERNEL__
 # include <linux/ioctl.h>
 # include <linux/string.h>
-# include "../obd_support.h"
 #else /* __KERNEL__ */
 # include <malloc.h>
 # include <string.h>
diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c
index dd592d9..4b46271 100644
--- a/drivers/staging/lustre/lustre/llite/dir.c
+++ b/drivers/staging/lustre/lustre/llite/dir.c
@@ -46,7 +46,7 @@
 
 #include "../include/obd_support.h"
 #include "../include/obd_class.h"
-#include "../include/lustre/lustre_ioctl.h"
+#include "../../include/uapi/linux/lustre/lustre_ioctl.h"
 #include "../include/lustre_lib.h"
 #include "../include/lustre_dlm.h"
 #include "../include/lustre_fid.h"
diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c
index 215479a..71d1878 100644
--- a/drivers/staging/lustre/lustre/llite/file.c
+++ b/drivers/staging/lustre/lustre/llite/file.c
@@ -43,7 +43,7 @@
 #include <linux/sched.h>
 #include <linux/mount.h>
 #include "../include/lustre/ll_fiemap.h"
-#include "../include/lustre/lustre_ioctl.h"
+#include "../../include/uapi/linux/lustre/lustre_ioctl.h"
 #include "../include/lustre_swab.h"
 
 #include "../include/cl_object.h"
diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c
index 451e4fa..e7d5228 100644
--- a/drivers/staging/lustre/lustre/llite/llite_lib.c
+++ b/drivers/staging/lustre/lustre/llite/llite_lib.c
@@ -41,7 +41,7 @@
 #include <linux/types.h>
 #include <linux/mm.h>
 
-#include "../include/lustre/lustre_ioctl.h"
+#include "../../include/uapi/linux/lustre/lustre_ioctl.h"
 #include "../include/lustre_ha.h"
 #include "../include/lustre_dlm.h"
 #include "../include/lprocfs_status.h"
diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
index 1c9ff24..ab77dbe 100644
--- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c
+++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
@@ -49,7 +49,7 @@
 #include "../include/lprocfs_status.h"
 #include "../include/cl_object.h"
 #include "../include/lustre_fid.h"
-#include "../include/lustre/lustre_ioctl.h"
+#include "../../include/uapi/linux/lustre/lustre_ioctl.h"
 #include "../include/lustre_kernelcomm.h"
 #include "lmv_internal.h"
 
diff --git a/drivers/staging/lustre/lustre/lov/lov_obd.c b/drivers/staging/lustre/lustre/lov/lov_obd.c
index 8871624..8777d4b 100644
--- a/drivers/staging/lustre/lustre/lov/lov_obd.c
+++ b/drivers/staging/lustre/lustre/lov/lov_obd.c
@@ -41,7 +41,7 @@
 #include "../../include/linux/libcfs/libcfs.h"
 
 #include "../include/lustre/lustre_idl.h"
-#include "../include/lustre/lustre_ioctl.h"
+#include "../../include/uapi/linux/lustre/lustre_ioctl.h"
 
 #include "../include/cl_object.h"
 #include "../include/lustre_dlm.h"
diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c b/drivers/staging/lustre/lustre/mdc/mdc_request.c
index dc775bb..93fb195 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_request.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c
@@ -45,7 +45,7 @@
 #include "../include/lprocfs_status.h"
 #include "../include/lustre_acl.h"
 #include "../include/lustre_fid.h"
-#include "../include/lustre/lustre_ioctl.h"
+#include "../../include/uapi/linux/lustre/lustre_ioctl.h"
 #include "../include/lustre_kernelcomm.h"
 #include "../include/lustre_lmv.h"
 #include "../include/lustre_log.h"
diff --git a/drivers/staging/lustre/lustre/obdclass/class_obd.c b/drivers/staging/lustre/lustre/obdclass/class_obd.c
index 477d611..ed30333 100644
--- a/drivers/staging/lustre/lustre/obdclass/class_obd.c
+++ b/drivers/staging/lustre/lustre/obdclass/class_obd.c
@@ -40,7 +40,7 @@
 #include "../include/lprocfs_status.h"
 #include <linux/list.h>
 #include "../include/cl_object.h"
-#include "../include/lustre/lustre_ioctl.h"
+#include "../../include/uapi/linux/lustre/lustre_ioctl.h"
 #include "llog_internal.h"
 
 struct obd_device *obd_devs[MAX_OBD_DEVICES];
diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
index 092e68a..9f83345 100644
--- a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
+++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
@@ -65,7 +65,7 @@
 #include "../../include/obd_support.h"
 #include "../../include/obd_class.h"
 #include "../../include/lprocfs_status.h"
-#include "../../include/lustre/lustre_ioctl.h"
+#include "../../../include/uapi/linux/lustre/lustre_ioctl.h"
 #include "../../include/lustre_ver.h"
 
 static int obd_ioctl_is_invalid(struct obd_ioctl_data *data)
diff --git a/drivers/staging/lustre/lustre/obdclass/obd_config.c b/drivers/staging/lustre/lustre/obdclass/obd_config.c
index 6a7e7a7..2a93d67 100644
--- a/drivers/staging/lustre/lustre/obdclass/obd_config.c
+++ b/drivers/staging/lustre/lustre/obdclass/obd_config.c
@@ -38,7 +38,7 @@
 
 #include <linux/string.h>
 
-#include "../include/lustre/lustre_ioctl.h"
+#include "../../include/uapi/linux/lustre/lustre_ioctl.h"
 #include "../include/llog_swab.h"
 #include "../include/lprocfs_status.h"
 #include "../include/lustre_log.h"
diff --git a/drivers/staging/lustre/lustre/obdecho/echo_client.c b/drivers/staging/lustre/lustre/obdecho/echo_client.c
index 6cbe58f3..31e549f 100644
--- a/drivers/staging/lustre/lustre/obdecho/echo_client.c
+++ b/drivers/staging/lustre/lustre/obdecho/echo_client.c
@@ -41,7 +41,7 @@
 #include "../include/cl_object.h"
 #include "../include/lustre_fid.h"
 #include "../include/lustre_acl.h"
-#include "../include/lustre/lustre_ioctl.h"
+#include "../../include/uapi/linux/lustre/lustre_ioctl.h"
 #include "../include/lustre_net.h"
 
 #include "echo_internal.h"
diff --git a/drivers/staging/lustre/lustre/osc/osc_request.c b/drivers/staging/lustre/lustre/osc/osc_request.c
index 922d0cb..e103d5a 100644
--- a/drivers/staging/lustre/lustre/osc/osc_request.c
+++ b/drivers/staging/lustre/lustre/osc/osc_request.c
@@ -41,7 +41,7 @@
 
 #include "../include/lustre_ha.h"
 #include "../include/lprocfs_status.h"
-#include "../include/lustre/lustre_ioctl.h"
+#include "../../include/uapi/linux/lustre/lustre_ioctl.h"
 #include "../include/lustre_debug.h"
 #include "../include/lustre_obdo.h"
 #include "../include/lustre_param.h"
-- 
1.8.3.1

[toc] | [prev] | [next] | [standalone]


#1711120 — [PATCH 10/64] staging: lustre: uapi: move obd_ioctl_getdata() declaration

FromJames Simmons <jsimmons@infradead.org>
Date2017-08-14 18:10 +0200
Subject[PATCH 10/64] staging: lustre: uapi: move obd_ioctl_getdata() declaration
Message-ID<ueq6e-6jm-27@gated-at.bofh.it>
In reply to#1711116
Move obd_ioctl_getdata() from lustre_ioctl.h to obd_class.h
since this function is only used by kernel space.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401
Reviewed-on: https://review.whamcloud.com/24568
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Ben Evans <bevans@cray.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h | 2 --
 drivers/staging/lustre/lustre/include/obd_class.h           | 3 +++
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h b/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h
index da9a071..914cea1 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h
@@ -208,8 +208,6 @@ static inline int obd_ioctl_is_invalid(struct obd_ioctl_data *data)
 	return 0;
 }
 
-int obd_ioctl_getdata(char **buf, int *len, void __user *arg);
-
 /*
  * OBD_IOC_DATA_TYPE is only for compatibility reasons with older
  * Linux Lustre user tools. New ioctls should NOT use this macro as
diff --git a/drivers/staging/lustre/lustre/include/obd_class.h b/drivers/staging/lustre/lustre/include/obd_class.h
index a6a4b2f..d4a632a 100644
--- a/drivers/staging/lustre/lustre/include/obd_class.h
+++ b/drivers/staging/lustre/lustre/include/obd_class.h
@@ -1559,4 +1559,7 @@ struct root_squash_info {
 	struct rw_semaphore	rsi_sem;
 };
 
+/* linux-module.c */
+int obd_ioctl_getdata(char **buf, int *len, void __user *arg);
+
 #endif /* __LINUX_OBD_CLASS_H */
-- 
1.8.3.1

[toc] | [prev] | [next] | [standalone]


#1711122 — [PATCH 06/64] staging: lustre: uapi: remove unused function in lustre_disk.h

FromJames Simmons <jsimmons@infradead.org>
Date2017-08-14 18:10 +0200
Subject[PATCH 06/64] staging: lustre: uapi: remove unused function in lustre_disk.h
Message-ID<ueq6f-6jm-37@gated-at.bofh.it>
In reply to#1711116
Delete code that is used by only the server or just in user
land. Now this file is a normal kernel header. The UAPI
version of this header is only needed for server side so
no need to create a new header in uapi directory.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401
Reviewed-on: https://review.whamcloud.com/25194
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lustre/include/lustre_disk.h | 18 ------------------
 1 file changed, 18 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_disk.h b/drivers/staging/lustre/lustre/include/lustre_disk.h
index a676bcc..1a532ad 100644
--- a/drivers/staging/lustre/lustre/include/lustre_disk.h
+++ b/drivers/staging/lustre/lustre/include/lustre_disk.h
@@ -108,14 +108,6 @@ struct lustre_mount_data {
 
 #define lmd_is_client(x) ((x)->lmd_flags & LMD_FLG_CLIENT)
 
-/****************** last_rcvd file *********************/
-
-/** version recovery epoch */
-#define LR_EPOCH_BITS   32
-#define lr_epoch(a) ((a) >> LR_EPOCH_BITS)
-#define LR_EXPIRE_INTERVALS 16 /**< number of intervals to track transno */
-#define ENOENT_VERSION 1 /** 'virtual' version of non-existent object */
-
 /****************** superblock additional info *********************/
 
 struct ll_sb_info;
@@ -141,16 +133,6 @@ struct lustre_sb_info {
 #define     s2lsi_nocast(sb) ((sb)->s_fs_info)
 
 #define     get_profile_name(sb)   (s2lsi(sb)->lsi_lmd->lmd_profile)
-#define	    get_mount_flags(sb)	   (s2lsi(sb)->lsi_lmd->lmd_flags)
-#define	    get_mntdev_name(sb)	   (s2lsi(sb)->lsi_lmd->lmd_dev)
-
-/****************** mount lookup info *********************/
-
-struct lustre_mount_info {
-	char		 *lmi_name;
-	struct super_block   *lmi_sb;
-	struct list_head	    lmi_list_chain;
-};
 
 /****************** prototypes *********************/
 
-- 
1.8.3.1

[toc] | [prev] | [next] | [standalone]


#1711124 — [PATCH 14/64] staging: lustre: uapi: cleanup headers for lustre_ioctl.h

FromJames Simmons <jsimmons@infradead.org>
Date2017-08-14 18:10 +0200
Subject[PATCH 14/64] staging: lustre: uapi: cleanup headers for lustre_ioctl.h
Message-ID<ueq6f-6jm-43@gated-at.bofh.it>
In reply to#1711116
With the cleanups we no longer need to drag in tons of
user land headers. Lets simplify the include headers.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401
Reviewed-on: https://review.whamcloud.com/24568
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Ben Evans <bevans@cray.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 .../staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h    | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h
index a7e2fc4..fb87a8b 100644
--- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h
+++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h
@@ -28,19 +28,11 @@
 #ifndef LUSTRE_IOCTL_H_
 #define LUSTRE_IOCTL_H_
 
+#include <linux/ioctl.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include "../../../../lustre/include/lustre/lustre_idl.h"
 
-#ifdef __KERNEL__
-# include <linux/ioctl.h>
-# include <linux/string.h>
-#else /* __KERNEL__ */
-# include <malloc.h>
-# include <string.h>
-#include <libcfs/util/ioctl.h>
-#endif /* !__KERNEL__ */
-
 #if !defined(__KERNEL__) && !defined(LUSTRE_UTILS)
 # error This file is for Lustre internal use only.
 #endif
-- 
1.8.3.1

[toc] | [prev] | [next] | [standalone]


#1711125 — [PATCH 04/64] staging: lustre: uapi: update URL doc link in lustre_fid.h

FromJames Simmons <jsimmons@infradead.org>
Date2017-08-14 18:10 +0200
Subject[PATCH 04/64] staging: lustre: uapi: update URL doc link in lustre_fid.h
Message-ID<ueq6f-6jm-47@gated-at.bofh.it>
In reply to#1711116
From: Ben Evans <bevans@cray.com>

The wiki has been revived so update the URL about the FID
design in lustre_fid.h.

Signed-off-by: Ben Evans <bevans@cray.com>
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401
Reviewed-on: https://review.whamcloud.com/22712
Reviewed-on: https://review.whamcloud.com/24569
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Frank Zago <fzago@cray.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lustre/include/lustre_fid.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_fid.h b/drivers/staging/lustre/lustre/include/lustre_fid.h
index 681f698..0446bec 100644
--- a/drivers/staging/lustre/lustre/include/lustre_fid.h
+++ b/drivers/staging/lustre/lustre/include/lustre_fid.h
@@ -41,7 +41,7 @@
  *
  * @{
  *
- * http://wiki.old.lustre.org/index.php/Architecture_-_Interoperability_fids_zfs
+ * http://wiki.lustre.org/index.php/Architecture_-_Interoperability_fids_zfs
  * describes the FID namespace and interoperability requirements for FIDs.
  * The important parts of that document are included here for reference.
  *
-- 
1.8.3.1

[toc] | [prev] | [next] | [standalone]


#1711126 — [PATCH 02/64] staging: lustre: uapi: remove unused functions for lustre_fid.h

FromJames Simmons <jsimmons@infradead.org>
Date2017-08-14 18:10 +0200
Subject[PATCH 02/64] staging: lustre: uapi: remove unused functions for lustre_fid.h
Message-ID<ueq6f-6jm-45@gated-at.bofh.it>
In reply to#1711116
The inline function fid_is_namespace_visible and ost_fid_from_resid
are only used for server code so we can remove it.

Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lustre/include/lustre_fid.h | 29 ----------------------
 1 file changed, 29 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_fid.h b/drivers/staging/lustre/lustre/include/lustre_fid.h
index 6dc24a7..681f698 100644
--- a/drivers/staging/lustre/lustre/include/lustre_fid.h
+++ b/drivers/staging/lustre/lustre/include/lustre_fid.h
@@ -288,18 +288,6 @@ static inline int fid_is_quota(const struct lu_fid *fid)
 	       fid_seq(fid) == FID_SEQ_QUOTA_GLB;
 }
 
-static inline int fid_is_namespace_visible(const struct lu_fid *fid)
-{
-	const __u64 seq = fid_seq(fid);
-
-	/* Here, we cannot distinguish whether the normal FID is for OST
-	 * object or not. It is caller's duty to check more if needed.
-	 */
-	return (!fid_is_last_id(fid) &&
-		(fid_seq_is_norm(seq) || fid_seq_is_igif(seq))) ||
-	       fid_is_root(fid) || fid_is_dot_lustre(fid);
-}
-
 static inline int fid_seq_in_fldb(__u64 seq)
 {
 	return fid_seq_is_igif(seq) || fid_seq_is_norm(seq) ||
@@ -522,23 +510,6 @@ static inline void ost_fid_build_resid(const struct lu_fid *fid,
 	}
 }
 
-static inline void ost_fid_from_resid(struct lu_fid *fid,
-				      const struct ldlm_res_id *name,
-				      int ost_idx)
-{
-	if (fid_seq_is_mdt0(name->name[LUSTRE_RES_ID_VER_OID_OFF])) {
-		/* old resid */
-		struct ost_id oi;
-
-		ostid_set_seq(&oi, name->name[LUSTRE_RES_ID_VER_OID_OFF]);
-		ostid_set_id(&oi, name->name[LUSTRE_RES_ID_SEQ_OFF]);
-		ostid_to_fid(fid, &oi, ost_idx);
-	} else {
-		/* new resid */
-		fid_extract_from_res_name(fid, name);
-	}
-}
-
 /**
  * Flatten 128-bit FID values into a 64-bit value for use as an inode number.
  * For non-IGIF FIDs this starts just over 2^32, and continues without
-- 
1.8.3.1

[toc] | [prev] | [next] | [standalone]


#1711127 — [PATCH 16/64] staging: lustre: uapi: move kernel only prototypes out of lustre_param.h

FromJames Simmons <jsimmons@infradead.org>
Date2017-08-14 18:10 +0200
Subject[PATCH 16/64] staging: lustre: uapi: move kernel only prototypes out of lustre_param.h
Message-ID<ueq6g-6jm-55@gated-at.bofh.it>
In reply to#1711116
Move all the kernel specific function prototypes from
lustre_param.h into obd_config.h which is a kernel only
header.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401
Reviewed-on: https://review.whamcloud.com/24325
Reviewed-by: Ben Evans <bevans@cray.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lustre/include/lustre_param.h | 11 -----------
 drivers/staging/lustre/lustre/include/obd_class.h    | 18 ++++++++++++++++++
 2 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_param.h b/drivers/staging/lustre/lustre/include/lustre_param.h
index 8061a04..2620e02 100644
--- a/drivers/staging/lustre/lustre/include/lustre_param.h
+++ b/drivers/staging/lustre/lustre/include/lustre_param.h
@@ -47,17 +47,6 @@
  * @{
  */
 
-/* For interoperability */
-struct cfg_interop_param {
-	char *old_param;
-	char *new_param;
-};
-
-/* obd_config.c */
-int class_find_param(char *buf, char *key, char **valp);
-int class_parse_nid(char *buf, lnet_nid_t *nid, char **endh);
-int class_parse_nid_quiet(char *buf, lnet_nid_t *nid, char **endh);
-
 /****************** User-settable parameter keys *********************/
 /* e.g.
 	tunefs.lustre --param="failover.node=192.168.0.13@tcp0" /dev/sda
diff --git a/drivers/staging/lustre/lustre/include/obd_class.h b/drivers/staging/lustre/lustre/include/obd_class.h
index d4a632a..8cc13ea 100644
--- a/drivers/staging/lustre/lustre/include/obd_class.h
+++ b/drivers/staging/lustre/lustre/include/obd_class.h
@@ -105,10 +105,28 @@ void obd_put_mod_rpc_slot(struct client_obd *cli, u32 opc,
 struct llog_rec_hdr;
 typedef int (*llog_cb_t)(const struct lu_env *, struct llog_handle *,
 			 struct llog_rec_hdr *, void *);
+
 /* obd_config.c */
 int class_process_config(struct lustre_cfg *lcfg);
 int class_process_proc_param(char *prefix, struct lprocfs_vars *lvars,
 			     struct lustre_cfg *lcfg, void *data);
+
+/* For interoperability */
+struct cfg_interop_param {
+	char *old_param;
+	char *new_param;
+};
+
+int class_find_param(char *buf, char *key, char **valp);
+struct cfg_interop_param *class_find_old_param(const char *param,
+					       struct cfg_interop_param *ptr);
+int class_get_next_param(char **params, char *copy);
+int class_parse_nid(char *buf, lnet_nid_t *nid, char **endh);
+int class_parse_nid_quiet(char *buf, lnet_nid_t *nid, char **endh);
+int class_parse_net(char *buf, u32 *net, char **endh);
+int class_match_nid(char *buf, char *key, lnet_nid_t nid);
+int class_match_net(char *buf, char *key, u32 net);
+
 struct obd_device *class_incref(struct obd_device *obd,
 				const char *scope, const void *source);
 void class_decref(struct obd_device *obd,
-- 
1.8.3.1

[toc] | [prev] | [next] | [standalone]


#1711129 — [PATCH 05/64] staging: lustre: uapi: move lu_fid, ost_id funcs out of lustre_idl.h

FromJames Simmons <jsimmons@infradead.org>
Date2017-08-14 18:10 +0200
Subject[PATCH 05/64] staging: lustre: uapi: move lu_fid, ost_id funcs out of lustre_idl.h
Message-ID<ueq6g-6jm-57@gated-at.bofh.it>
In reply to#1711116
From: Ben Evans <bevans@cray.com>

Move lu_fid functions into lustre/lustre_fid.h
Move ost_id functions into lustre/lustre_ostid.h
Fix indenting, include new headers as needed.

Several inline functions in the header lustre_ostid.h
are using debug macros instead of returning proper errors.
Remove the debug macros and properly handle the returned
error codes. Place both UAPI headers lustre_fid.h and
lustre_ostid.h into the uapi directory.

Signed-off-by: Ben Evans <bevans@cray.com>
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401
Reviewed-on: https://review.whamcloud.com/22712
Reviewed-on: https://review.whamcloud.com/24569
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Frank Zago <fzago@cray.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 .../lustre/include/uapi/linux/lustre/lustre_fid.h  | 293 +++++++++++
 .../include/uapi/linux/lustre/lustre_ostid.h       | 236 +++++++++
 .../lustre/lustre/include/lustre/lustre_idl.h      | 541 +--------------------
 drivers/staging/lustre/lustre/include/lustre_fid.h |  49 +-
 drivers/staging/lustre/lustre/include/lustre_fld.h |   1 +
 drivers/staging/lustre/lustre/ldlm/ldlm_request.c  |   2 +
 drivers/staging/lustre/lustre/mdc/mdc_request.c    |   2 +
 7 files changed, 586 insertions(+), 538 deletions(-)
 create mode 100644 drivers/staging/lustre/include/uapi/linux/lustre/lustre_fid.h
 create mode 100644 drivers/staging/lustre/include/uapi/linux/lustre/lustre_ostid.h

diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_fid.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_fid.h
new file mode 100644
index 0000000..9adc106
--- /dev/null
+++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_fid.h
@@ -0,0 +1,293 @@
+/*
+ * GPL HEADER START
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 only,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License version 2 for more details (a copy is included
+ * in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License
+ * version 2 along with this program; If not, see
+ * http://www.gnu.org/licenses/gpl-2.0.html
+ *
+ * GPL HEADER END
+ */
+/*
+ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Use is subject to license terms.
+ *
+ * Copyright (c) 2011, 2014, Intel Corporation.
+ *
+ * Copyright 2016 Cray Inc, all rights reserved.
+ * Author: Ben Evans.
+ *
+ * all fid manipulation functions go here
+ *
+ * FIDS are globally unique within a Lustre filessytem, and are made up
+ * of three parts: sequence, Object ID, and version.
+ *
+ */
+#ifndef _UAPI_LUSTRE_FID_H_
+#define _UAPI_LUSTRE_FID_H_
+
+#include "../../../../lustre/include/lustre/lustre_idl.h"
+
+/** returns fid object sequence */
+static inline __u64 fid_seq(const struct lu_fid *fid)
+{
+	return fid->f_seq;
+}
+
+/** returns fid object id */
+static inline __u32 fid_oid(const struct lu_fid *fid)
+{
+	return fid->f_oid;
+}
+
+/** returns fid object version */
+static inline __u32 fid_ver(const struct lu_fid *fid)
+{
+	return fid->f_ver;
+}
+
+static inline void fid_zero(struct lu_fid *fid)
+{
+	memset(fid, 0, sizeof(*fid));
+}
+
+static inline __u64 fid_ver_oid(const struct lu_fid *fid)
+{
+	return (__u64)fid_ver(fid) << 32 | fid_oid(fid);
+}
+
+static inline bool fid_seq_is_mdt0(__u64 seq)
+{
+	return seq == FID_SEQ_OST_MDT0;
+}
+
+static inline bool fid_seq_is_mdt(__u64 seq)
+{
+	return seq == FID_SEQ_OST_MDT0 || seq >= FID_SEQ_NORMAL;
+};
+
+static inline bool fid_seq_is_echo(__u64 seq)
+{
+	return seq == FID_SEQ_ECHO;
+}
+
+static inline bool fid_is_echo(const struct lu_fid *fid)
+{
+	return fid_seq_is_echo(fid_seq(fid));
+}
+
+static inline bool fid_seq_is_llog(__u64 seq)
+{
+	return seq == FID_SEQ_LLOG;
+}
+
+static inline bool fid_is_llog(const struct lu_fid *fid)
+{
+	/* file with OID == 0 is not llog but contains last oid */
+	return fid_seq_is_llog(fid_seq(fid)) && fid_oid(fid) > 0;
+}
+
+static inline bool fid_seq_is_rsvd(__u64 seq)
+{
+	return seq > FID_SEQ_OST_MDT0 && seq <= FID_SEQ_RSVD;
+};
+
+static inline bool fid_seq_is_special(__u64 seq)
+{
+	return seq == FID_SEQ_SPECIAL;
+};
+
+static inline bool fid_seq_is_local_file(__u64 seq)
+{
+	return seq == FID_SEQ_LOCAL_FILE ||
+	       seq == FID_SEQ_LOCAL_NAME;
+};
+
+static inline bool fid_seq_is_root(__u64 seq)
+{
+	return seq == FID_SEQ_ROOT;
+}
+
+static inline bool fid_seq_is_dot(__u64 seq)
+{
+	return seq == FID_SEQ_DOT_LUSTRE;
+}
+
+static inline bool fid_seq_is_default(__u64 seq)
+{
+	return seq == FID_SEQ_LOV_DEFAULT;
+}
+
+static inline bool fid_is_mdt0(const struct lu_fid *fid)
+{
+	return fid_seq_is_mdt0(fid_seq(fid));
+}
+
+/**
+ * Check if a fid is igif or not.
+ * \param fid the fid to be tested.
+ * \return true if the fid is an igif; otherwise false.
+ */
+static inline bool fid_seq_is_igif(__u64 seq)
+{
+	return seq >= FID_SEQ_IGIF && seq <= FID_SEQ_IGIF_MAX;
+}
+
+static inline bool fid_is_igif(const struct lu_fid *fid)
+{
+	return fid_seq_is_igif(fid_seq(fid));
+}
+
+/**
+ * Check if a fid is idif or not.
+ * \param fid the fid to be tested.
+ * \return true if the fid is an idif; otherwise false.
+ */
+static inline bool fid_seq_is_idif(__u64 seq)
+{
+	return seq >= FID_SEQ_IDIF && seq <= FID_SEQ_IDIF_MAX;
+}
+
+static inline bool fid_is_idif(const struct lu_fid *fid)
+{
+	return fid_seq_is_idif(fid_seq(fid));
+}
+
+static inline bool fid_is_local_file(const struct lu_fid *fid)
+{
+	return fid_seq_is_local_file(fid_seq(fid));
+}
+
+static inline bool fid_seq_is_norm(__u64 seq)
+{
+	return (seq >= FID_SEQ_NORMAL);
+}
+
+static inline bool fid_is_norm(const struct lu_fid *fid)
+{
+	return fid_seq_is_norm(fid_seq(fid));
+}
+
+/* convert an OST objid into an IDIF FID SEQ number */
+static inline __u64 fid_idif_seq(__u64 id, __u32 ost_idx)
+{
+	return FID_SEQ_IDIF | (ost_idx << 16) | ((id >> 32) & 0xffff);
+}
+
+/* convert a packed IDIF FID into an OST objid */
+static inline __u64 fid_idif_id(__u64 seq, __u32 oid, __u32 ver)
+{
+	return ((__u64)ver << 48) | ((seq & 0xffff) << 32) | oid;
+}
+
+static inline __u32 idif_ost_idx(__u64 seq)
+{
+	return (seq >> 16) & 0xffff;
+}
+
+/* extract ost index from IDIF FID */
+static inline __u32 fid_idif_ost_idx(const struct lu_fid *fid)
+{
+	return idif_ost_idx(fid_seq(fid));
+}
+
+/**
+ * Get inode number from an igif.
+ * \param fid an igif to get inode number from.
+ * \return inode number for the igif.
+ */
+static inline ino_t lu_igif_ino(const struct lu_fid *fid)
+{
+	return fid_seq(fid);
+}
+
+/**
+ * Get inode generation from an igif.
+ * \param fid an igif to get inode generation from.
+ * \return inode generation for the igif.
+ */
+static inline __u32 lu_igif_gen(const struct lu_fid *fid)
+{
+	return fid_oid(fid);
+}
+
+/**
+ * Build igif from the inode number/generation.
+ */
+static inline void lu_igif_build(struct lu_fid *fid, __u32 ino, __u32 gen)
+{
+	fid->f_seq = ino;
+	fid->f_oid = gen;
+	fid->f_ver = 0;
+}
+
+/*
+ * Fids are transmitted across network (in the sender byte-ordering),
+ * and stored on disk in big-endian order.
+ */
+static inline void fid_cpu_to_le(struct lu_fid *dst, const struct lu_fid *src)
+{
+	dst->f_seq = __cpu_to_le64(fid_seq(src));
+	dst->f_oid = __cpu_to_le32(fid_oid(src));
+	dst->f_ver = __cpu_to_le32(fid_ver(src));
+}
+
+static inline void fid_le_to_cpu(struct lu_fid *dst, const struct lu_fid *src)
+{
+	dst->f_seq = __le64_to_cpu(fid_seq(src));
+	dst->f_oid = __le32_to_cpu(fid_oid(src));
+	dst->f_ver = __le32_to_cpu(fid_ver(src));
+}
+
+static inline void fid_cpu_to_be(struct lu_fid *dst, const struct lu_fid *src)
+{
+	dst->f_seq = __cpu_to_be64(fid_seq(src));
+	dst->f_oid = __cpu_to_be32(fid_oid(src));
+	dst->f_ver = __cpu_to_be32(fid_ver(src));
+}
+
+static inline void fid_be_to_cpu(struct lu_fid *dst, const struct lu_fid *src)
+{
+	dst->f_seq = __be64_to_cpu(fid_seq(src));
+	dst->f_oid = __be32_to_cpu(fid_oid(src));
+	dst->f_ver = __be32_to_cpu(fid_ver(src));
+}
+
+static inline bool fid_is_sane(const struct lu_fid *fid)
+{
+	return fid && ((fid_seq(fid) >= FID_SEQ_START && !fid_ver(fid)) ||
+			fid_is_igif(fid) || fid_is_idif(fid) ||
+			fid_seq_is_rsvd(fid_seq(fid)));
+}
+
+static inline bool lu_fid_eq(const struct lu_fid *f0, const struct lu_fid *f1)
+{
+	return !memcmp(f0, f1, sizeof(*f0));
+}
+
+static inline int lu_fid_cmp(const struct lu_fid *f0,
+			     const struct lu_fid *f1)
+{
+	if (fid_seq(f0) != fid_seq(f1))
+		return fid_seq(f0) > fid_seq(f1) ? 1 : -1;
+
+	if (fid_oid(f0) != fid_oid(f1))
+		return fid_oid(f0) > fid_oid(f1) ? 1 : -1;
+
+	if (fid_ver(f0) != fid_ver(f1))
+		return fid_ver(f0) > fid_ver(f1) ? 1 : -1;
+
+	return 0;
+}
+#endif
diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ostid.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ostid.h
new file mode 100644
index 0000000..19fca61
--- /dev/null
+++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ostid.h
@@ -0,0 +1,236 @@
+/*
+ * GPL HEADER START
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 only,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License version 2 for more details (a copy is included
+ * in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License
+ * version 2 along with this program; If not, see
+ * http://www.gnu.org/licenses/gpl-2.0.html
+ *
+ * GPL HEADER END
+ */
+/*
+ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Use is subject to license terms.
+ *
+ * Copyright (c) 2011, 2014, Intel Corporation.
+ *
+ * Copyright 2015 Cray Inc, all rights reserved.
+ * Author: Ben Evans.
+ *
+ * Define ost_id  associated functions
+ */
+
+#ifndef _UAPI_LUSTRE_OSTID_H_
+#define _UAPI_LUSTRE_OSTID_H_
+
+#include "lustre_fid.h"
+#include "../../../../lustre/include/lustre/lustre_idl.h"
+
+static inline __u64 lmm_oi_id(const struct ost_id *oi)
+{
+	return oi->oi.oi_id;
+}
+
+static inline __u64 lmm_oi_seq(const struct ost_id *oi)
+{
+	return oi->oi.oi_seq;
+}
+
+static inline void lmm_oi_set_seq(struct ost_id *oi, __u64 seq)
+{
+	oi->oi.oi_seq = seq;
+}
+
+static inline void lmm_oi_set_id(struct ost_id *oi, __u64 oid)
+{
+	oi->oi.oi_id = oid;
+}
+
+static inline void lmm_oi_le_to_cpu(struct ost_id *dst_oi,
+				    const struct ost_id *src_oi)
+{
+	dst_oi->oi.oi_id = __le64_to_cpu(src_oi->oi.oi_id);
+	dst_oi->oi.oi_seq = __le64_to_cpu(src_oi->oi.oi_seq);
+}
+
+static inline void lmm_oi_cpu_to_le(struct ost_id *dst_oi,
+				    const struct ost_id *src_oi)
+{
+	dst_oi->oi.oi_id = __cpu_to_le64(src_oi->oi.oi_id);
+	dst_oi->oi.oi_seq = __cpu_to_le64(src_oi->oi.oi_seq);
+}
+
+/* extract OST sequence (group) from a wire ost_id (id/seq) pair */
+static inline __u64 ostid_seq(const struct ost_id *ostid)
+{
+	if (fid_seq_is_mdt0(ostid->oi.oi_seq))
+		return FID_SEQ_OST_MDT0;
+
+	if (fid_seq_is_default(ostid->oi.oi_seq))
+		return FID_SEQ_LOV_DEFAULT;
+
+	if (fid_is_idif(&ostid->oi_fid))
+		return FID_SEQ_OST_MDT0;
+
+	return fid_seq(&ostid->oi_fid);
+}
+
+/* extract OST objid from a wire ost_id (id/seq) pair */
+static inline __u64 ostid_id(const struct ost_id *ostid)
+{
+	if (fid_seq_is_mdt0(ostid->oi.oi_seq))
+		return ostid->oi.oi_id & IDIF_OID_MASK;
+
+	if (fid_seq_is_default(ostid->oi.oi_seq))
+		return ostid->oi.oi_id;
+
+	if (fid_is_idif(&ostid->oi_fid))
+		return fid_idif_id(fid_seq(&ostid->oi_fid),
+				   fid_oid(&ostid->oi_fid), 0);
+
+	return fid_oid(&ostid->oi_fid);
+}
+
+static inline void ostid_set_seq(struct ost_id *oi, __u64 seq)
+{
+	if (fid_seq_is_mdt0(seq) || fid_seq_is_default(seq)) {
+		oi->oi.oi_seq = seq;
+	} else {
+		oi->oi_fid.f_seq = seq;
+		/*
+		 * Note: if f_oid + f_ver is zero, we need init it
+		 * to be 1, otherwise, ostid_seq will treat this
+		 * as old ostid (oi_seq == 0)
+		 */
+		if (!oi->oi_fid.f_oid && !oi->oi_fid.f_ver)
+			oi->oi_fid.f_oid = LUSTRE_FID_INIT_OID;
+	}
+}
+
+static inline void ostid_set_seq_mdt0(struct ost_id *oi)
+{
+	ostid_set_seq(oi, FID_SEQ_OST_MDT0);
+}
+
+static inline void ostid_set_seq_echo(struct ost_id *oi)
+{
+	ostid_set_seq(oi, FID_SEQ_ECHO);
+}
+
+static inline void ostid_set_seq_llog(struct ost_id *oi)
+{
+	ostid_set_seq(oi, FID_SEQ_LLOG);
+}
+
+static inline void ostid_cpu_to_le(const struct ost_id *src_oi,
+				   struct ost_id *dst_oi)
+{
+	if (fid_seq_is_mdt0(src_oi->oi.oi_seq)) {
+		dst_oi->oi.oi_id = __cpu_to_le64(src_oi->oi.oi_id);
+		dst_oi->oi.oi_seq = __cpu_to_le64(src_oi->oi.oi_seq);
+	} else {
+		fid_cpu_to_le(&dst_oi->oi_fid, &src_oi->oi_fid);
+	}
+}
+
+static inline void ostid_le_to_cpu(const struct ost_id *src_oi,
+				   struct ost_id *dst_oi)
+{
+	if (fid_seq_is_mdt0(src_oi->oi.oi_seq)) {
+		dst_oi->oi.oi_id = __le64_to_cpu(src_oi->oi.oi_id);
+		dst_oi->oi.oi_seq = __le64_to_cpu(src_oi->oi.oi_seq);
+	} else {
+		fid_le_to_cpu(&dst_oi->oi_fid, &src_oi->oi_fid);
+	}
+}
+
+/**
+ * Sigh, because pre-2.4 uses
+ * struct lov_mds_md_v1 {
+ *	........
+ *	__u64 lmm_object_id;
+ *	__u64 lmm_object_seq;
+ *      ......
+ *      }
+ * to identify the LOV(MDT) object, and lmm_object_seq will
+ * be normal_fid, which make it hard to combine these conversion
+ * to ostid_to FID. so we will do lmm_oi/fid conversion separately
+ *
+ * We can tell the lmm_oi by this way,
+ * 1.8: lmm_object_id = {inode}, lmm_object_gr = 0
+ * 2.1: lmm_object_id = {oid < 128k}, lmm_object_seq = FID_SEQ_NORMAL
+ * 2.4: lmm_oi.f_seq = FID_SEQ_NORMAL, lmm_oi.f_oid = {oid < 128k},
+ *      lmm_oi.f_ver = 0
+ *
+ * But currently lmm_oi/lsm_oi does not have any "real" usages,
+ * except for printing some information, and the user can always
+ * get the real FID from LMA, besides this multiple case check might
+ * make swab more complicate. So we will keep using id/seq for lmm_oi.
+ */
+
+static inline void fid_to_lmm_oi(const struct lu_fid *fid,
+				 struct ost_id *oi)
+{
+	oi->oi.oi_id = fid_oid(fid);
+	oi->oi.oi_seq = fid_seq(fid);
+}
+
+/**
+ * Unpack an OST object id/seq (group) into a FID.  This is needed for
+ * converting all obdo, lmm, lsm, etc. 64-bit id/seq pairs into proper
+ * FIDs.  Note that if an id/seq is already in FID/IDIF format it will
+ * be passed through unchanged.  Only legacy OST objects in "group 0"
+ * will be mapped into the IDIF namespace so that they can fit into the
+ * struct lu_fid fields without loss.
+ */
+static inline int ostid_to_fid(struct lu_fid *fid, const struct ost_id *ostid,
+			       __u32 ost_idx)
+{
+	__u64 seq = ostid_seq(ostid);
+
+	if (ost_idx > 0xffff)
+		return -EBADF;
+
+	if (fid_seq_is_mdt0(seq)) {
+		__u64 oid = ostid_id(ostid);
+
+		/* This is a "legacy" (old 1.x/2.early) OST object in "group 0"
+		 * that we map into the IDIF namespace.  It allows up to 2^48
+		 * objects per OST, as this is the object namespace that has
+		 * been in production for years.  This can handle create rates
+		 * of 1M objects/s/OST for 9 years, or combinations thereof.
+		 */
+		if (oid >= IDIF_MAX_OID)
+			return -EBADF;
+
+		fid->f_seq = fid_idif_seq(oid, ost_idx);
+		/* truncate to 32 bits by assignment */
+		fid->f_oid = oid;
+		/* in theory, not currently used */
+		fid->f_ver = oid >> 48;
+	} else if (!fid_seq_is_default(seq)) {
+		/* This is either an IDIF object, which identifies objects
+		 * across all OSTs, or a regular FID.  The IDIF namespace
+		 * maps legacy OST objects into the FID namespace.  In both
+		 * cases, we just pass the FID through, no conversion needed.
+		 */
+		if (ostid->oi_fid.f_ver)
+			return -EBADF;
+
+		*fid = ostid->oi_fid;
+	}
+
+	return 0;
+}
+#endif /* _UAPI_LUSTRE_OSTID_H_ */
diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index d70495d..fab624e 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -74,7 +74,6 @@
 
 /* Defn's shared with user-space. */
 #include "lustre_user.h"
-#include "lustre_errno.h"
 #include "../lustre_ver.h"
 
 /*
@@ -217,34 +216,6 @@ enum {
 	LUSTRE_FID_INIT_OID  = 1UL
 };
 
-/** returns fid object sequence */
-static inline __u64 fid_seq(const struct lu_fid *fid)
-{
-	return fid->f_seq;
-}
-
-/** returns fid object id */
-static inline __u32 fid_oid(const struct lu_fid *fid)
-{
-	return fid->f_oid;
-}
-
-/** returns fid object version */
-static inline __u32 fid_ver(const struct lu_fid *fid)
-{
-	return fid->f_ver;
-}
-
-static inline void fid_zero(struct lu_fid *fid)
-{
-	memset(fid, 0, sizeof(*fid));
-}
-
-static inline __u64 fid_ver_oid(const struct lu_fid *fid)
-{
-	return ((__u64)fid_ver(fid) << 32 | fid_oid(fid));
-}
-
 /* copytool uses a 32b bitmask field to encode archive-Ids during register
  * with MDT thru kuc.
  * archive num = 0 => all
@@ -313,451 +284,12 @@ enum dot_lustre_oid {
 	FID_OID_DOT_LUSTRE_OBF = 2UL,
 };
 
-static inline bool fid_seq_is_mdt0(__u64 seq)
-{
-	return (seq == FID_SEQ_OST_MDT0);
-}
-
-static inline bool fid_seq_is_mdt(__u64 seq)
-{
-	return seq == FID_SEQ_OST_MDT0 || seq >= FID_SEQ_NORMAL;
+/** OID for FID_SEQ_ROOT */
+enum root_oid {
+	FID_OID_ROOT		= 1UL,
+	FID_OID_ECHO_ROOT	= 2UL,
 };
 
-static inline bool fid_seq_is_echo(__u64 seq)
-{
-	return (seq == FID_SEQ_ECHO);
-}
-
-static inline bool fid_is_echo(const struct lu_fid *fid)
-{
-	return fid_seq_is_echo(fid_seq(fid));
-}
-
-static inline bool fid_seq_is_llog(__u64 seq)
-{
-	return (seq == FID_SEQ_LLOG);
-}
-
-static inline bool fid_is_llog(const struct lu_fid *fid)
-{
-	/* file with OID == 0 is not llog but contains last oid */
-	return fid_seq_is_llog(fid_seq(fid)) && fid_oid(fid) > 0;
-}
-
-static inline bool fid_seq_is_rsvd(__u64 seq)
-{
-	return (seq > FID_SEQ_OST_MDT0 && seq <= FID_SEQ_RSVD);
-};
-
-static inline bool fid_seq_is_special(__u64 seq)
-{
-	return seq == FID_SEQ_SPECIAL;
-};
-
-static inline bool fid_seq_is_local_file(__u64 seq)
-{
-	return seq == FID_SEQ_LOCAL_FILE ||
-	       seq == FID_SEQ_LOCAL_NAME;
-};
-
-static inline bool fid_seq_is_root(__u64 seq)
-{
-	return seq == FID_SEQ_ROOT;
-}
-
-static inline bool fid_seq_is_dot(__u64 seq)
-{
-	return seq == FID_SEQ_DOT_LUSTRE;
-}
-
-static inline bool fid_seq_is_default(__u64 seq)
-{
-	return seq == FID_SEQ_LOV_DEFAULT;
-}
-
-static inline bool fid_is_mdt0(const struct lu_fid *fid)
-{
-	return fid_seq_is_mdt0(fid_seq(fid));
-}
-
-static inline void lu_root_fid(struct lu_fid *fid)
-{
-	fid->f_seq = FID_SEQ_ROOT;
-	fid->f_oid = 1;
-	fid->f_ver = 0;
-}
-
-/**
- * Check if a fid is igif or not.
- * \param fid the fid to be tested.
- * \return true if the fid is a igif; otherwise false.
- */
-static inline bool fid_seq_is_igif(__u64 seq)
-{
-	return seq >= FID_SEQ_IGIF && seq <= FID_SEQ_IGIF_MAX;
-}
-
-static inline bool fid_is_igif(const struct lu_fid *fid)
-{
-	return fid_seq_is_igif(fid_seq(fid));
-}
-
-/**
- * Check if a fid is idif or not.
- * \param fid the fid to be tested.
- * \return true if the fid is a idif; otherwise false.
- */
-static inline bool fid_seq_is_idif(__u64 seq)
-{
-	return seq >= FID_SEQ_IDIF && seq <= FID_SEQ_IDIF_MAX;
-}
-
-static inline bool fid_is_idif(const struct lu_fid *fid)
-{
-	return fid_seq_is_idif(fid_seq(fid));
-}
-
-static inline bool fid_is_local_file(const struct lu_fid *fid)
-{
-	return fid_seq_is_local_file(fid_seq(fid));
-}
-
-static inline bool fid_seq_is_norm(__u64 seq)
-{
-	return (seq >= FID_SEQ_NORMAL);
-}
-
-static inline bool fid_is_norm(const struct lu_fid *fid)
-{
-	return fid_seq_is_norm(fid_seq(fid));
-}
-
-/* convert an OST objid into an IDIF FID SEQ number */
-static inline __u64 fid_idif_seq(__u64 id, __u32 ost_idx)
-{
-	return FID_SEQ_IDIF | (ost_idx << 16) | ((id >> 32) & 0xffff);
-}
-
-/* convert a packed IDIF FID into an OST objid */
-static inline __u64 fid_idif_id(__u64 seq, __u32 oid, __u32 ver)
-{
-	return ((__u64)ver << 48) | ((seq & 0xffff) << 32) | oid;
-}
-
-/* extract ost index from IDIF FID */
-static inline __u32 fid_idif_ost_idx(const struct lu_fid *fid)
-{
-	return (fid_seq(fid) >> 16) & 0xffff;
-}
-
-/* extract OST sequence (group) from a wire ost_id (id/seq) pair */
-static inline __u64 ostid_seq(const struct ost_id *ostid)
-{
-	if (fid_seq_is_mdt0(ostid->oi.oi_seq))
-		return FID_SEQ_OST_MDT0;
-
-	if (unlikely(fid_seq_is_default(ostid->oi.oi_seq)))
-		return FID_SEQ_LOV_DEFAULT;
-
-	if (fid_is_idif(&ostid->oi_fid))
-		return FID_SEQ_OST_MDT0;
-
-	return fid_seq(&ostid->oi_fid);
-}
-
-/* extract OST objid from a wire ost_id (id/seq) pair */
-static inline __u64 ostid_id(const struct ost_id *ostid)
-{
-	if (fid_seq_is_mdt0(ostid->oi.oi_seq))
-		return ostid->oi.oi_id & IDIF_OID_MASK;
-
-	if (unlikely(fid_seq_is_default(ostid->oi.oi_seq)))
-		return ostid->oi.oi_id;
-
-	if (fid_is_idif(&ostid->oi_fid))
-		return fid_idif_id(fid_seq(&ostid->oi_fid),
-				   fid_oid(&ostid->oi_fid), 0);
-
-	return fid_oid(&ostid->oi_fid);
-}
-
-static inline void ostid_set_seq(struct ost_id *oi, __u64 seq)
-{
-	if (fid_seq_is_mdt0(seq) || fid_seq_is_default(seq)) {
-		oi->oi.oi_seq = seq;
-	} else {
-		oi->oi_fid.f_seq = seq;
-		/* Note: if f_oid + f_ver is zero, we need init it
-		 * to be 1, otherwise, ostid_seq will treat this
-		 * as old ostid (oi_seq == 0)
-		 */
-		if (oi->oi_fid.f_oid == 0 && oi->oi_fid.f_ver == 0)
-			oi->oi_fid.f_oid = LUSTRE_FID_INIT_OID;
-	}
-}
-
-static inline void ostid_set_seq_mdt0(struct ost_id *oi)
-{
-	ostid_set_seq(oi, FID_SEQ_OST_MDT0);
-}
-
-static inline void ostid_set_seq_echo(struct ost_id *oi)
-{
-	ostid_set_seq(oi, FID_SEQ_ECHO);
-}
-
-static inline void ostid_set_seq_llog(struct ost_id *oi)
-{
-	ostid_set_seq(oi, FID_SEQ_LLOG);
-}
-
-/**
- * Note: we need check oi_seq to decide where to set oi_id,
- * so oi_seq should always be set ahead of oi_id.
- */
-static inline int ostid_set_id(struct ost_id *oi, __u64 oid)
-{
-	if (fid_seq_is_mdt0(oi->oi.oi_seq)) {
-		if (oid >= IDIF_MAX_OID)
-			return -E2BIG;
-		oi->oi.oi_id = oid;
-	} else if (fid_is_idif(&oi->oi_fid)) {
-		if (oid >= IDIF_MAX_OID)
-			return -E2BIG;
-		oi->oi_fid.f_seq = fid_idif_seq(oid,
-						fid_idif_ost_idx(&oi->oi_fid));
-		oi->oi_fid.f_oid = oid;
-		oi->oi_fid.f_ver = oid >> 48;
-	} else {
-		if (oid >= OBIF_MAX_OID)
-			return -E2BIG;
-		oi->oi_fid.f_oid = oid;
-	}
-	return 0;
-}
-
-static inline int fid_set_id(struct lu_fid *fid, __u64 oid)
-{
-	if (unlikely(fid_seq_is_igif(fid->f_seq))) {
-		CERROR("bad IGIF, " DFID "\n", PFID(fid));
-		return -EBADF;
-	}
-
-	if (fid_is_idif(fid)) {
-		if (oid >= IDIF_MAX_OID) {
-			CERROR("Too large OID %#llx to set IDIF " DFID "\n",
-			       (unsigned long long)oid, PFID(fid));
-			return -EBADF;
-		}
-		fid->f_seq = fid_idif_seq(oid, fid_idif_ost_idx(fid));
-		fid->f_oid = oid;
-		fid->f_ver = oid >> 48;
-	} else {
-		if (oid >= OBIF_MAX_OID) {
-			CERROR("Too large OID %#llx to set REG " DFID "\n",
-			       (unsigned long long)oid, PFID(fid));
-			return -EBADF;
-		}
-		fid->f_oid = oid;
-	}
-	return 0;
-}
-
-/**
- * Unpack an OST object id/seq (group) into a FID.  This is needed for
- * converting all obdo, lmm, lsm, etc. 64-bit id/seq pairs into proper
- * FIDs.  Note that if an id/seq is already in FID/IDIF format it will
- * be passed through unchanged.  Only legacy OST objects in "group 0"
- * will be mapped into the IDIF namespace so that they can fit into the
- * struct lu_fid fields without loss.  For reference see:
- * http://wiki.old.lustre.org/index.php/Architecture_-_Interoperability_fids_zfs
- */
-static inline int ostid_to_fid(struct lu_fid *fid, struct ost_id *ostid,
-			       __u32 ost_idx)
-{
-	__u64 seq = ostid_seq(ostid);
-
-	if (ost_idx > 0xffff) {
-		CERROR("bad ost_idx, " DOSTID " ost_idx:%u\n", POSTID(ostid),
-		       ost_idx);
-		return -EBADF;
-	}
-
-	if (fid_seq_is_mdt0(seq)) {
-		__u64 oid = ostid_id(ostid);
-
-		/* This is a "legacy" (old 1.x/2.early) OST object in "group 0"
-		 * that we map into the IDIF namespace.  It allows up to 2^48
-		 * objects per OST, as this is the object namespace that has
-		 * been in production for years.  This can handle create rates
-		 * of 1M objects/s/OST for 9 years, or combinations thereof.
-		 */
-		if (oid >= IDIF_MAX_OID) {
-			CERROR("bad MDT0 id, " DOSTID " ost_idx:%u\n",
-			       POSTID(ostid), ost_idx);
-			return -EBADF;
-		}
-		fid->f_seq = fid_idif_seq(oid, ost_idx);
-		/* truncate to 32 bits by assignment */
-		fid->f_oid = oid;
-		/* in theory, not currently used */
-		fid->f_ver = oid >> 48;
-	} else if (likely(!fid_seq_is_default(seq))) {
-	       /* This is either an IDIF object, which identifies objects across
-		* all OSTs, or a regular FID.  The IDIF namespace maps legacy
-		* OST objects into the FID namespace.  In both cases, we just
-		* pass the FID through, no conversion needed.
-		*/
-		if (ostid->oi_fid.f_ver != 0) {
-			CERROR("bad MDT0 id, " DOSTID " ost_idx:%u\n",
-			       POSTID(ostid), ost_idx);
-			return -EBADF;
-		}
-		*fid = ostid->oi_fid;
-	}
-
-	return 0;
-}
-
-/* pack any OST FID into an ostid (id/seq) for the wire/disk */
-static inline int fid_to_ostid(const struct lu_fid *fid, struct ost_id *ostid)
-{
-	if (unlikely(fid_seq_is_igif(fid->f_seq))) {
-		CERROR("bad IGIF, " DFID "\n", PFID(fid));
-		return -EBADF;
-	}
-
-	if (fid_is_idif(fid)) {
-		ostid_set_seq_mdt0(ostid);
-		ostid_set_id(ostid, fid_idif_id(fid_seq(fid), fid_oid(fid),
-						fid_ver(fid)));
-	} else {
-		ostid->oi_fid = *fid;
-	}
-
-	return 0;
-}
-
-/* Check whether the fid is for LAST_ID */
-static inline bool fid_is_last_id(const struct lu_fid *fid)
-{
-	return (fid_oid(fid) == 0);
-}
-
-/**
- * Get inode number from a igif.
- * \param fid a igif to get inode number from.
- * \return inode number for the igif.
- */
-static inline ino_t lu_igif_ino(const struct lu_fid *fid)
-{
-	return fid_seq(fid);
-}
-
-/**
- * Get inode generation from a igif.
- * \param fid a igif to get inode generation from.
- * \return inode generation for the igif.
- */
-static inline __u32 lu_igif_gen(const struct lu_fid *fid)
-{
-	return fid_oid(fid);
-}
-
-/**
- * Build igif from the inode number/generation.
- */
-static inline void lu_igif_build(struct lu_fid *fid, __u32 ino, __u32 gen)
-{
-	fid->f_seq = ino;
-	fid->f_oid = gen;
-	fid->f_ver = 0;
-}
-
-/*
- * Fids are transmitted across network (in the sender byte-ordering),
- * and stored on disk in big-endian order.
- */
-static inline void fid_cpu_to_le(struct lu_fid *dst, const struct lu_fid *src)
-{
-	dst->f_seq = cpu_to_le64(fid_seq(src));
-	dst->f_oid = cpu_to_le32(fid_oid(src));
-	dst->f_ver = cpu_to_le32(fid_ver(src));
-}
-
-static inline void fid_le_to_cpu(struct lu_fid *dst, const struct lu_fid *src)
-{
-	dst->f_seq = le64_to_cpu(fid_seq(src));
-	dst->f_oid = le32_to_cpu(fid_oid(src));
-	dst->f_ver = le32_to_cpu(fid_ver(src));
-}
-
-static inline void fid_cpu_to_be(struct lu_fid *dst, const struct lu_fid *src)
-{
-	dst->f_seq = cpu_to_be64(fid_seq(src));
-	dst->f_oid = cpu_to_be32(fid_oid(src));
-	dst->f_ver = cpu_to_be32(fid_ver(src));
-}
-
-static inline void fid_be_to_cpu(struct lu_fid *dst, const struct lu_fid *src)
-{
-	dst->f_seq = be64_to_cpu(fid_seq(src));
-	dst->f_oid = be32_to_cpu(fid_oid(src));
-	dst->f_ver = be32_to_cpu(fid_ver(src));
-}
-
-static inline bool fid_is_sane(const struct lu_fid *fid)
-{
-	return fid &&
-	       ((fid_seq(fid) >= FID_SEQ_START && fid_ver(fid) == 0) ||
-		fid_is_igif(fid) || fid_is_idif(fid) ||
-		fid_seq_is_rsvd(fid_seq(fid)));
-}
-
-static inline bool lu_fid_eq(const struct lu_fid *f0, const struct lu_fid *f1)
-{
-	return memcmp(f0, f1, sizeof(*f0)) == 0;
-}
-
-#define __diff_normalize(val0, val1)			    \
-({							      \
-	typeof(val0) __val0 = (val0);			   \
-	typeof(val1) __val1 = (val1);			   \
-								\
-	(__val0 == __val1 ? 0 : __val0 > __val1 ? 1 : -1);     \
-})
-
-static inline int lu_fid_cmp(const struct lu_fid *f0,
-			     const struct lu_fid *f1)
-{
-	return
-		__diff_normalize(fid_seq(f0), fid_seq(f1)) ?:
-		__diff_normalize(fid_oid(f0), fid_oid(f1)) ?:
-		__diff_normalize(fid_ver(f0), fid_ver(f1));
-}
-
-static inline void ostid_cpu_to_le(const struct ost_id *src_oi,
-				   struct ost_id *dst_oi)
-{
-	if (fid_seq_is_mdt0(ostid_seq(src_oi))) {
-		dst_oi->oi.oi_id = cpu_to_le64(src_oi->oi.oi_id);
-		dst_oi->oi.oi_seq = cpu_to_le64(src_oi->oi.oi_seq);
-	} else {
-		fid_cpu_to_le(&dst_oi->oi_fid, &src_oi->oi_fid);
-	}
-}
-
-static inline void ostid_le_to_cpu(const struct ost_id *src_oi,
-				   struct ost_id *dst_oi)
-{
-	if (fid_seq_is_mdt0(ostid_seq(src_oi))) {
-		dst_oi->oi.oi_id = le64_to_cpu(src_oi->oi.oi_id);
-		dst_oi->oi.oi_seq = le64_to_cpu(src_oi->oi.oi_seq);
-	} else {
-		fid_le_to_cpu(&dst_oi->oi_fid, &src_oi->oi_fid);
-	}
-}
-
 /** @} lu_fid */
 
 /** \defgroup lu_dir lu_dir
@@ -1377,71 +909,6 @@ struct lov_mds_md_v1 {	    /* LOV EA mds/wire data (little-endian) */
 	struct lov_ost_data_v1 lmm_objects[0]; /* per-stripe data */
 };
 
-/**
- * Sigh, because pre-2.4 uses
- * struct lov_mds_md_v1 {
- *	........
- *	__u64 lmm_object_id;
- *	__u64 lmm_object_seq;
- *      ......
- *      }
- * to identify the LOV(MDT) object, and lmm_object_seq will
- * be normal_fid, which make it hard to combine these conversion
- * to ostid_to FID. so we will do lmm_oi/fid conversion separately
- *
- * We can tell the lmm_oi by this way,
- * 1.8: lmm_object_id = {inode}, lmm_object_gr = 0
- * 2.1: lmm_object_id = {oid < 128k}, lmm_object_seq = FID_SEQ_NORMAL
- * 2.4: lmm_oi.f_seq = FID_SEQ_NORMAL, lmm_oi.f_oid = {oid < 128k},
- *      lmm_oi.f_ver = 0
- *
- * But currently lmm_oi/lsm_oi does not have any "real" usages,
- * except for printing some information, and the user can always
- * get the real FID from LMA, besides this multiple case check might
- * make swab more complicate. So we will keep using id/seq for lmm_oi.
- */
-
-static inline void fid_to_lmm_oi(const struct lu_fid *fid,
-				 struct ost_id *oi)
-{
-	oi->oi.oi_id = fid_oid(fid);
-	oi->oi.oi_seq = fid_seq(fid);
-}
-
-static inline void lmm_oi_set_seq(struct ost_id *oi, __u64 seq)
-{
-	oi->oi.oi_seq = seq;
-}
-
-static inline void lmm_oi_set_id(struct ost_id *oi, __u64 oid)
-{
-	oi->oi.oi_id = oid;
-}
-
-static inline __u64 lmm_oi_id(const struct ost_id *oi)
-{
-	return oi->oi.oi_id;
-}
-
-static inline __u64 lmm_oi_seq(const struct ost_id *oi)
-{
-	return oi->oi.oi_seq;
-}
-
-static inline void lmm_oi_le_to_cpu(struct ost_id *dst_oi,
-				    const struct ost_id *src_oi)
-{
-	dst_oi->oi.oi_id = le64_to_cpu(src_oi->oi.oi_id);
-	dst_oi->oi.oi_seq = le64_to_cpu(src_oi->oi.oi_seq);
-}
-
-static inline void lmm_oi_cpu_to_le(struct ost_id *dst_oi,
-				    const struct ost_id *src_oi)
-{
-	dst_oi->oi.oi_id = cpu_to_le64(src_oi->oi.oi_id);
-	dst_oi->oi.oi_seq = cpu_to_le64(src_oi->oi.oi_seq);
-}
-
 #define MAX_MD_SIZE							\
 	(sizeof(struct lov_mds_md) + 4 * sizeof(struct lov_ost_data))
 #define MIN_MD_SIZE							\
diff --git a/drivers/staging/lustre/lustre/include/lustre_fid.h b/drivers/staging/lustre/lustre/include/lustre_fid.h
index 0446bec..7c51642 100644
--- a/drivers/staging/lustre/lustre/include/lustre_fid.h
+++ b/drivers/staging/lustre/lustre/include/lustre_fid.h
@@ -149,8 +149,9 @@
  */
 
 #include "../../include/linux/libcfs/libcfs.h"
+#include "../../include/uapi/linux/lustre/lustre_fid.h"
 #include "lustre/lustre_idl.h"
-#include "seq_range.h"
+#include "../../include/uapi/linux/lustre/lustre_ostid.h"
 
 struct lu_env;
 struct lu_site;
@@ -494,6 +495,52 @@ static inline int ostid_res_name_eq(const struct ost_id *oi,
 	}
 }
 
+/**
+ * Note: we need check oi_seq to decide where to set oi_id,
+ * so oi_seq should always be set ahead of oi_id.
+ */
+static inline int ostid_set_id(struct ost_id *oi, __u64 oid)
+{
+	if (fid_seq_is_mdt0(oi->oi.oi_seq)) {
+		if (oid >= IDIF_MAX_OID)
+			return -E2BIG;
+		oi->oi.oi_id = oid;
+	} else if (fid_is_idif(&oi->oi_fid)) {
+		if (oid >= IDIF_MAX_OID)
+			return -E2BIG;
+		oi->oi_fid.f_seq = fid_idif_seq(oid,
+						fid_idif_ost_idx(&oi->oi_fid));
+		oi->oi_fid.f_oid = oid;
+		oi->oi_fid.f_ver = oid >> 48;
+	} else {
+		if (oid >= OBIF_MAX_OID)
+			return -E2BIG;
+		oi->oi_fid.f_oid = oid;
+	}
+	return 0;
+}
+
+/* pack any OST FID into an ostid (id/seq) for the wire/disk */
+static inline int fid_to_ostid(const struct lu_fid *fid, struct ost_id *ostid)
+{
+	int rc = 0;
+
+	if (fid_seq_is_igif(fid->f_seq))
+		return -EBADF;
+
+	if (fid_is_idif(fid)) {
+		u64 objid = fid_idif_id(fid_seq(fid), fid_oid(fid),
+					fid_ver(fid));
+
+		ostid_set_seq_mdt0(ostid);
+		rc = ostid_set_id(ostid, objid);
+	} else {
+		ostid->oi_fid = *fid;
+	}
+
+	return rc;
+}
+
 /* The same as osc_build_res_name() */
 static inline void ost_fid_build_resid(const struct lu_fid *fid,
 				       struct ldlm_res_id *resname)
diff --git a/drivers/staging/lustre/lustre/include/lustre_fld.h b/drivers/staging/lustre/lustre/include/lustre_fld.h
index 6ef1b03..f3c61d1 100644
--- a/drivers/staging/lustre/lustre/include/lustre_fld.h
+++ b/drivers/staging/lustre/lustre/include/lustre_fld.h
@@ -40,6 +40,7 @@
 
 #include "lustre/lustre_idl.h"
 #include "../../include/linux/libcfs/libcfs.h"
+#include "seq_range.h"
 
 struct lu_client_fld;
 struct lu_server_fld;
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
index 2e3db5e..b8002e9 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
@@ -57,6 +57,8 @@
 
 #define DEBUG_SUBSYSTEM S_LDLM
 
+#include "../include/lustre/lustre_errno.h"
+
 #include "../include/lustre_dlm.h"
 #include "../include/obd_class.h"
 #include "../include/obd.h"
diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c b/drivers/staging/lustre/lustre/mdc/mdc_request.c
index 1a3fa1b..dc775bb 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_request.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c
@@ -38,6 +38,8 @@
 # include <linux/init.h>
 # include <linux/utsname.h>
 
+#include "../include/lustre/lustre_errno.h"
+
 #include "../include/cl_object.h"
 #include "../include/llog_swab.h"
 #include "../include/lprocfs_status.h"
-- 
1.8.3.1

[toc] | [prev] | [next] | [standalone]


#1714189

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-08-17 18:30 +0200
Message-ID<ufvQe-7mK-27@gated-at.bofh.it>
In reply to#1711116
On Mon, Aug 14, 2017 at 11:46:28AM -0400, James Simmons wrote:
> The headers for lustre/LNet for a long time lacked a clean separation in
> its internal headers which resulted in kernel specific data structures
> being exposed in user land code. This work unravels this mess and creates
> a clear separation between lustre kernel space and lustre user land.
> With this work done the include paths in the lustre kernel code can now
> be normalized.

Nice work, all now applied.

greg k-h

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web