*/
/*
* This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
*
* lustre/ofd/ofd_fs.c
*
/* if seq is already initialized */
oseq = ofd_seq_get(ofd, seq);
- if (oseq != NULL)
+ if (oseq != NULL) {
+ CDEBUG(D_TRACE, "%s: got sequence %#llx "DOSTID"\n",
+ ofd_name(ofd), seq, POSTID(&oseq->os_oi));
RETURN(oseq);
+ }
OBD_ALLOC_PTR(oseq);
if (oseq == NULL)
if (info->fti_attr.la_size == 0) {
/* object is just created, initialize last id */
- if (OBD_FAIL_CHECK(OBD_FAIL_OFD_SET_OID))
- ofd_seq_last_oid_set(oseq, 0xffffff00);
- else
+ if (OBD_FAIL_CHECK(OBD_FAIL_OFD_SET_OID)) {
+ struct seq_server_site *ss = &ofd->ofd_seq_site;
+ struct lu_client_seq *client_seq = ss->ss_client_seq;
+ __u64 seq_width = fid_seq_is_norm(seq) ?
+ min(OBIF_MAX_OID, client_seq->lcs_width) :
+ min(IDIF_MAX_OID, client_seq->lcs_width);
+
+ ofd_seq_last_oid_set(oseq, seq_width > 255 ?
+ seq_width - 255 : seq_width);
+ } else {
ofd_seq_last_oid_set(oseq, OFD_INIT_OBJID);
+ }
ofd_seq_last_oid_write(env, ofd, oseq);
} else if (info->fti_attr.la_size == sizeof(lastid)) {
info->fti_off = 0;
GOTO(cleanup, rc = -EINVAL);
}
+ CDEBUG(D_HA, "%s: adding sequence %#llx\n", ofd_name(ofd), seq);
+
oseq = ofd_seq_add(env, ofd, oseq);
RETURN((oseq != NULL) ? oseq : ERR_PTR(-ENOENT));
cleanup: