61 #if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 10, 53, 0)
62 /*
63 * LU-1783
64 * We only #include a kernel level include file here because
65 * important MS_ flag #defines are missing from the SLES version
66 * of sys/mount.h
67 * In the futureif SLES updates sys/mount.h to have a more complete
68 * set of flag #defines we should stop including linux/fs.h
69 */
70 #if !defined(MS_RDONLY)
71 #include <linux/fs.h>
72 #endif
73 #endif
61 #if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 10, 53, 0)
62 /*
63 * LU-1783
64 * We only #include a kernel level include file here because
65 * important MS_ flag #defines are missing from the SLES version
66 * of sys/mount.h
67 * In the futureif SLES updates sys/mount.h to have a more complete
68 * set of flag #defines we should stop including linux/fs.h
69 */
70 #if !defined(MS_RDONLY)
71 #include <linux/fs.h>
72 #endif
73 #endif
2106 #if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 11, 56, 0)
2107 /* Since lustre 2.8, this flag will not be needed, instead this DEAD
2108 * and orphan flags will be stored in LMA (see LMAI_ORPHAN)
2109 * Keep this flag just for LFSCK, because it still might meet such
2110 * flag when it checks the old FS */
2111 #define LMV_HASH_FLAG_DEAD 0x40000000
2112 #endif
James Nunez (Inactive)
added a comment - As of today, Lustre 2.10.58+ still has the following version checks for version 2.x with x <=11:
lustre/ofd/ofd_dev.c:#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 8, 53, 0)
1779 out_nolock:
1780 if (rc == 0) {
1781 # if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 8, 53, 0)
1782 struct ofd_thread_info *info = ofd_info(tsi->tsi_env);
1783 struct lu_fid *fid = &info->fti_fid;
1784
1785 /* For compatible purpose, it needs to convert back to
1786 * OST ID before put it on wire. */
1787 *fid = rep_oa->o_oi.oi_fid;
1788 fid_to_ostid(fid, &rep_oa->o_oi);
1789 #endif
1790 rep_oa->o_valid |= OBD_MD_FLID | OBD_MD_FLGROUP;
1791 }
lustre/utils/liblustreapi_util.c:#if LUSTRE_VERSION_CODE > OBD_OCD_VERSION(2, 8, 53, 0)
160 int llapi_get_version( char *buffer, int buffer_size, char **version)
161 {
162 int rc;
163 # if LUSTRE_VERSION_CODE > OBD_OCD_VERSION(2, 8, 53, 0)
164 static bool printed;
165 if (!printed) {
166 fprintf(stderr,
167 "%s deprecated, use llapi_get_version_string()\n" ,
168 __func__);
169 printed = true ;
170 }
171 #endif
172
lustre/llite/dir.c:#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 9, 50, 0)
1260
1261 # if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 9, 50, 0)
1262 mode = data->ioc_type != 0 ? data->ioc_type : S_IRWXUGO;
1263 # else
1264 mode = data->ioc_type;
1265 #endif
1266 rc = ll_dir_setdirstripe(dentry, lum, lumlen, filename, mode);
lustre/utils/liblustreapi.c:#if LUSTRE_VERSION_CODE > OBD_OCD_VERSION(2, 9, 59, 0)
4395 int llapi_mv( char *path, struct find_param *param)
4396 {
4397 # if LUSTRE_VERSION_CODE > OBD_OCD_VERSION(2, 9, 59, 0)
4398 static bool printed;
4399
4400 if (!printed) {
4401 llapi_error(LLAPI_MSG_ERROR, -ESTALE,
4402 "llapi_mv() is deprecated, use llapi_migrate_mdt()\n" );
4403 printed = true ;
4404 }
4405 #endif
4406 return llapi_migrate_mdt(path, param);
4407 }
lustre/utils/mount_lustre.c:#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 10, 53, 0)
61 # if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 10, 53, 0)
62 /*
63 * LU-1783
64 * We only #include a kernel level include file here because
65 * important MS_ flag #defines are missing from the SLES version
66 * of sys/mount.h
67 * In the future if SLES updates sys/mount.h to have a more complete
68 * set of flag #defines we should stop including linux/fs.h
69 */
70 # if !defined(MS_RDONLY)
71 #include <linux/fs.h>
72 #endif
73 #endif
lustre/include/uapi/linux/lustre/lustre_idl.h:#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 11, 56, 0)
2106 # if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 11, 56, 0)
2107 /* Since lustre 2.8, this flag will not be needed, instead this DEAD
2108 * and orphan flags will be stored in LMA (see LMAI_ORPHAN)
2109 * Keep this flag just for LFSCK, because it still might meet such
2110 * flag when it checks the old FS */
2111 #define LMV_HASH_FLAG_DEAD 0x40000000
2112 #endif
> It can't be guaranteed that the tools will be running against a lustre kernel version it was built again.
I agree but when it comes to utilities the version is (mostly) not being used in that way (i.e. to manage ABI compatibility). Instead it's being used to manage deprecation and removal of the utility features, options, etc.
John Hammond
added a comment - > It can't be guaranteed that the tools will be running against a lustre kernel version it was built again.
I agree but when it comes to utilities the version is (mostly) not being used in that way (i.e. to manage ABI compatibility). Instead it's being used to manage deprecation and removal of the utility features, options, etc.
I was pondering if lustre_ver.h really needs to be exposed to user land the other day. It can't be guaranteed that the tools will be running against a lustre kernel version it was built again.
James A Simmons
added a comment - I was pondering if lustre_ver.h really needs to be exposed to user land the other day. It can't be guaranteed that the tools will be running against a lustre kernel version it was built again.
Update: As of November 1, 2019, here are all the conditional code based on Lustre version up to 2.14.50:
lustre/ofd/ofd_dev.c:#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 8, 53, 0)
1726 #if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 8, 53, 0) 1727 struct ofd_thread_info *info = ofd_info(tsi->tsi_env); 1728 struct lu_fid *fid = &info->fti_fid; 1729 1730 /* For compatible purpose, it needs to convert back to 1731 * OST ID before put it on wire. */ 1732 *fid = rep_oa->o_oi.oi_fid; 1733 fid_to_ostid(fid, &rep_oa->o_oi); 1734 #endif
lustre/utils/liblustreapi_util.c:#if LUSTRE_VERSION_CODE > OBD_OCD_VERSION(2, 8, 53, 0)
lustre/llite/dir.c:#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 9, 50, 0)
lustre/utils/liblustreapi.c:#if LUSTRE_VERSION_CODE > OBD_OCD_VERSION(2, 9, 59, 0)
lustre/utils/mount_lustre.c:#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 10, 53, 0)
lustre/llite/llite_lib.c:#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 12, 50, 0)
464 #if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 12, 50, 0) 465 data->ocd_connect_flags |= OBD_CONNECT_LOCKAHEAD_OLD; 466 #endif
lustre/llite/dir.c:#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 13, 53, 0)
lustre/llite/dir.c:#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 13, 53, 0)
561 #if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 13, 53, 0) 562 struct lustre_sb_info *lsi = s2lsi(inode->i_sb); 563 struct obd_device *mgc = lsi->lsi_mgc; 564 #endif
lustre/llite/dir.c:#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 13, 53, 0)
lustre/mgc/mgc_request.c:#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 13, 53, 0)
lustre/mgc/mgc_request.c:#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 13, 53, 0)
lustre/mgs/mgs_handler.c:#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 13, 53, 0)
lustre/mgs/mgs_handler.c:#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 13, 53, 0)
1205 #if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 13, 53, 0) 1206 TGT_MGS_HDL(HAS_REPLY | IS_MUTABLE, MGS_SET_INFO, mgs_set_info), 1207 #endif 1208 TGT_MGS_HDL(HAS_REPLY | IS_MUTABLE, MGS_TARGET_REG, mgs_target_reg),
lustre/ptlrpc/layout.c:#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 13, 53, 0)
lustre/ptlrpc/layout.c:#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 13, 53, 0)
760 #if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 13, 53, 0) 761 &RQF_MGS_SET_INFO, 762 #endif
lustre/ptlrpc/layout.c:#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 13, 53, 0)
lustre/ptlrpc/layout.c:#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 13, 53, 0)
lustre/utils/wirecheck.c:#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 13, 53, 0)
lustre/utils/wirecheck.c:#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 13, 53, 0)
2896 #if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 13, 53, 0) 2897 check_mgs_send_param(); 2898 #endif
lustre/include/uapi/linux/lustre/lustre_idl.h:#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 13, 53, 0)