* FID_SEQ_START + 2 is for .lustre directory and its objects
*/
const struct lu_seq_range LUSTRE_SEQ_SPACE_RANGE = {
- FID_SEQ_DISTRIBUTED_START,
+ FID_SEQ_NORMAL,
(__u64)~0ULL
};
EXPORT_SYMBOL(LUSTRE_SEQ_SPACE_RANGE);
EXPORT_SYMBOL(LUSTRE_BFL_FID);
/** Special fid for ".lustre" directory */
-const struct lu_fid LU_DOT_LUSTRE_FID = { .f_seq = LU_DOT_LUSTRE_SEQ,
+const struct lu_fid LU_DOT_LUSTRE_FID = { .f_seq = FID_SEQ_DOT_LUSTRE,
.f_oid = 0x0000000000000001,
.f_ver = 0x0000000000000000 };
EXPORT_SYMBOL(LU_DOT_LUSTRE_FID);
/** Special fid for "fid" special object in .lustre */
-const struct lu_fid LU_OBF_FID = { .f_seq = LU_DOT_LUSTRE_SEQ,
+const struct lu_fid LU_OBF_FID = { .f_seq = FID_SEQ_DOT_LUSTRE,
.f_oid = 0x0000000000000002,
.f_ver = 0x0000000000000000 };
EXPORT_SYMBOL(LU_OBF_FID);
fld->lsf_control_exp = NULL;
/* Insert reserved sequence number of ".lustre" into fld cache. */
- range.lsr_start = LU_DOT_LUSTRE_SEQ;
- range.lsr_end = LU_DOT_LUSTRE_SEQ + 1;
+ range.lsr_start = FID_SEQ_DOT_LUSTRE;
+ range.lsr_end = FID_SEQ_DOT_LUSTRE + 1;
range.lsr_mdt = 0;
fld_cache_insert(fld->lsf_cache, &range);
}
/**
+ * Note that reserved SEQ numbers below 12 will conflict with ldiskfs
+ * inodes in the IGIF namespace, so these reserved SEQ numbers can be
+ * used for other purposes and not risk collisions with existing inodes.
+ *
* Different FID Format
* http://arch.lustre.org/index.php?title=Interoperability_fids_zfs#NEW.0
*/
LUSTRE_SEQ_SUPER_WIDTH = ((1ULL << 30ULL) * LUSTRE_SEQ_META_WIDTH)
};
-/** special fid seq: used for local object create. */
-#define FID_SEQ_LOCAL_FILE (FID_SEQ_START + 1)
-
-/** special fid seq: used for .lustre objects. */
-#define LU_DOT_LUSTRE_SEQ (FID_SEQ_START + 0x02ULL)
-
-/* Note that reserved SEQ numbers below 12 will conflict with ldiskfs
- * inodes in the IGIF namespace, so these reserved SEQ numbers must be
- * used sparingly until ldiskfs-based MDT backends and/or IGIF FIDs
- * have been completely removed. */
-
-/** fid sequence for distributed fs objects */
-#define FID_SEQ_DISTRIBUTED_START (FID_SEQ_START + 0x400ULL)
-
/** special OID for local objects */
-enum {
+enum local_oid {
/** \see osd_oi_index_create */
OSD_OI_FID_16_OID = 2UL,
/** \see fld_mod_init */
} else
next_id = filter_last_id(filter, group) + 1;
- /* Temporary solution for oid in CMD before fid-on-OST */
- if ((fid_seq_is_mdt0(oa->o_seq) && next_id >= IDIF_MAX_OID) &&
- (fid_seq_is_cmd(oa->o_seq) && next_id >= OBIF_MAX_OID)) {
- CERROR("%s:"POSTID" hit the max IDIF_MAX_OID(1<<48)!\n",
+ /* Don't create objects beyond the valid range for this SEQ */
+ if (unlikely(fid_seq_is_mdt0(group) &&
+ next_id >= IDIF_MAX_OID)) {
+ CERROR("%s:"POSTID" hit the IDIF_MAX_OID (1<<48)!\n",
+ obd->obd_name, next_id, group);
+ GOTO(cleanup, rc = -ENOSPC);
+ } else if (unlikely(!fid_seq_is_mdt0(group) &&
+ next_id >= OBIF_MAX_OID)) {
+ CERROR("%s:"POSTID" hit the OBIF_MAX_OID (1<<32)!\n",
obd->obd_name, next_id, group);
GOTO(cleanup, rc = -ENOSPC);
}
result = __osd_object_create(info, obj, attr, hint, dof, th);
/* objects under osd root shld have igif fid, so dont add fid EA */
- if (result == 0 && fid_seq(fid) >= FID_SEQ_DISTRIBUTED_START)
+ if (result == 0 && fid_seq(fid) >= FID_SEQ_NORMAL)
result = osd_ea_fid_set(env, dt, fid);
if (result == 0)
child = osd_child_dentry_get(info->oti_env, pobj, name, strlen(name));
if (fid_is_igif((struct lu_fid *)fid) ||
- fid_seq((struct lu_fid *)fid) >= FID_SEQ_DISTRIBUTED_START) {
+ fid_seq((struct lu_fid *)fid) >= FID_SEQ_NORMAL) {
ldp = (struct ldiskfs_dentry_param *)info->oti_ldp;
osd_get_ldiskfs_dirent_param(ldp, fid);
child->d_fsdata = (void*) ldp;
if (!dir->oo_compat_dot_created)
return -EINVAL;
- if (fid_seq((struct lu_fid *) dot_fid) >= FID_SEQ_DISTRIBUTED_START) {
+ if (fid_seq((struct lu_fid *)dot_fid) >= FID_SEQ_NORMAL) {
osd_get_ldiskfs_dirent_param(dot_ldp, dot_fid);
osd_get_ldiskfs_dirent_param(dot_dot_ldp, dot_dot_fid);
} else {