@@ -481,18 +481,18 @@ static inline int ostid_res_name_eq(const struct ost_id *oi,
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)
+ 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)
+ 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)
+ if (oid > OBIF_MAX_OID)
return -E2BIG;
oi->oi_fid.f_oid = oid;
}
@@ -295,11 +295,9 @@ enum fid_seq {
};
#define OBIF_OID_MAX_BITS 32
-#define OBIF_MAX_OID ((1ULL << OBIF_OID_MAX_BITS))
-#define OBIF_OID_MASK ((1ULL << OBIF_OID_MAX_BITS) - 1)
+#define OBIF_MAX_OID ((1ULL << OBIF_OID_MAX_BITS) - 1)
#define IDIF_OID_MAX_BITS 48
-#define IDIF_MAX_OID ((1ULL << IDIF_OID_MAX_BITS))
-#define IDIF_OID_MASK ((1ULL << IDIF_OID_MAX_BITS) - 1)
+#define IDIF_MAX_OID ((1ULL << IDIF_OID_MAX_BITS) - 1)
/** OID for FID_SEQ_SPECIAL */
enum special_oid {
@@ -91,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;
@@ -212,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);