File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4646 check : true )
4747 conf.set(' GIT_VERSION' , ' "@0@"' .format(r.stdout().strip()))
4848endif
49+ conf.set(' PROJECT_VERSION' , ' "@0@"' .format(meson .project_version()))
4950
5051conf.set(' SYSCONFDIR' , ' "@0@"' .format(sysconfdir))
5152
Original file line number Diff line number Diff line change 1+ LIBNVME_1_1 {
2+ global:
3+ nvme_get_version;
4+ };
5+
16LIBNVME_1_0 {
27 global:
38 nvme_admin_passthru64;
Original file line number Diff line number Diff line change @@ -778,3 +778,15 @@ struct nvmf_ext_attr *nvmf_exat_ptr_next(struct nvmf_ext_attr *p)
778778 return (struct nvmf_ext_attr * )
779779 ((uintptr_t )p + (ptrdiff_t )nvmf_exat_size (le16_to_cpu (p -> exatlen )));
780780}
781+
782+ const char * nvme_get_version (enum nvme_version type )
783+ {
784+ switch (type ) {
785+ case NVME_VERSION_PROJECT :
786+ return PROJECT_VERSION ;
787+ case NVME_VERSION_GIT :
788+ return GIT_VERSION ;
789+ default :
790+ return "n/a" ;
791+ }
792+ }
Original file line number Diff line number Diff line change @@ -532,4 +532,23 @@ static inline __u16 nvmf_exat_size(size_t val_len)
532532 */
533533struct nvmf_ext_attr * nvmf_exat_ptr_next (struct nvmf_ext_attr * p );
534534
535+ /**
536+ * enum nvme_version - Selector for version to be returned by @nvme_get_version
537+ *
538+ * NVME_VERSION_PROJECT: Project release version
539+ * NVME_VERSION_GIT: Git reference
540+ */
541+ enum nvme_version {
542+ NVME_VERSION_PROJECT = 0 ,
543+ NVME_VERSION_GIT = 1 ,
544+ };
545+
546+ /**
547+ * nvme_get_version - Return version libnvme string
548+ * @type: Selects which version type (see @struct nvme_version)
549+ *
550+ * Return: Returns version string for known types or else "n/a"
551+ */
552+ const char * nvme_get_version (enum nvme_version type );
553+
535554#endif /* _LIBNVME_UTIL_H */
You can’t perform that action at this time.
0 commit comments