X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fofd%2Fofd_internal.h;h=951bc2ee93ffd4697c1dd958d91088cbfa3bc5f8;hb=0ecb2a167c56ffff8e4fcb5cf576fb8c5d9e64fe;hp=7970ed482d255d6fb73dfeadff2ad825c8e48f5c;hpb=c97d4cdf4dc78ba02dc0f1c0cc23831f0da63953;p=fs%2Flustre-release.git diff --git a/lustre/ofd/ofd_internal.h b/lustre/ofd/ofd_internal.h index 7970ed4..951bc2e 100644 --- a/lustre/ofd/ofd_internal.h +++ b/lustre/ofd/ofd_internal.h @@ -523,4 +523,21 @@ static inline bool ofd_layout_version_less(__u32 req_version, ((req & LU_LAYOUT_HIGEN) == (ondisk & LU_LAYOUT_HIGEN)); } +static inline int ofd_seq_is_exhausted(struct ofd_device *ofd, + const struct obdo *oa) +{ + struct seq_server_site *ss = &ofd->ofd_seq_site; + __u64 seq_width = ss->ss_client_seq->lcs_width; + __u64 seq = ostid_seq(&oa->o_oi); + __u64 oid = ostid_id(&oa->o_oi); + + if (fid_seq_is_norm(seq)) + return oid >= min(seq_width, OBIF_MAX_OID); + if (fid_seq_is_idif(seq) || fid_seq_is_mdt0(seq)) + return oid >= min(seq_width, IDIF_MAX_OID); + CERROR("%s : invalid o_seq "DOSTID"\n", + ofd_name(ofd), POSTID(&oa->o_oi)); + return -EINVAL; +} + #endif /* _OFD_INTERNAL_H */