Whamcloud - gitweb
LU-16831 lod: replace (__u16)-1 with LOV_ALL_STRIPES
[fs/lustre-release.git] / lustre / include / uapi / linux / lustre / lustre_ostid.h
index 8282b09..baf7c8f 100644 (file)
@@ -23,7 +23,7 @@
  * 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 (c) 2011, 2017, Intel Corporation.
  *
  * Copyright 2015 Cray Inc, all rights reserved.
  * Author: Ben Evans.
 #define _UAPI_LUSTRE_OSTID_H_
 
 #include <linux/errno.h>
-/*
- * This is due to us being out of kernel and the way the OpenSFS branch
- * handles CFLAGS.
- */
-#ifdef __KERNEL__
-#include <uapi/linux/lustre/lustre_fid.h>
-#else
+#include <linux/types.h>
 #include <linux/lustre/lustre_fid.h>
-#endif
 
 static inline __u64 lmm_oi_id(const struct ost_id *oi)
 {
@@ -98,7 +91,7 @@ static inline __u64 ostid_seq(const struct ost_id *ostid)
 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;
+               return ostid->oi.oi_id & IDIF_MAX_OID;
 
        if (fid_seq_is_default(ostid->oi.oi_seq))
                return ostid->oi.oi_id;
@@ -219,7 +212,7 @@ static inline int ostid_to_fid(struct lu_fid *fid, const struct ost_id *ostid,
                 * 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)
+               if (oid > IDIF_MAX_OID)
                        return -EBADF;
 
                fid->f_seq = fid_idif_seq(oid, ost_idx);