From e3c3f43f3e85242422729549c1d7901bf63823c3 Mon Sep 17 00:00:00 2001 From: adilger <adilger> Date: Tue, 2 Sep 2008 22:36:46 +0000 Subject: [PATCH] Branch b1_6 Add compatibility function for llapi_file_fget_lov_uuid(), to match b1_8 and HEAD. --- lustre/include/lustre/liblustreapi.h | 3 +++ lustre/utils/liblustreapi.c | 14 ++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/lustre/include/lustre/liblustreapi.h b/lustre/include/lustre/liblustreapi.h index b3c0adfc54..ee7307ed7d 100644 --- a/lustre/include/lustre/liblustreapi.h +++ b/lustre/include/lustre/liblustreapi.h @@ -137,6 +137,9 @@ extern int llapi_ping(char *obd_type, char *obd_name); extern int llapi_target_check(int num_types, char **obd_types, char *dir); extern int llapi_catinfo(char *dir, char *keyword, char *node_name); extern int llapi_file_get_lov_uuid(const char *path, struct obd_uuid *lov_uuid); +extern int llapi_file_fget_lov_uuid(int fd, struct obd_uuid *lov_uuid); +/* Use llapi_file_fget_lov_uuid() instead of llapi_file_get_lov_fuuid(), the + * latter is deprecated and will be removed in a later Lustre release. */ extern int llapi_file_get_lov_fuuid(int fd, struct obd_uuid *lov_uuid); extern int llapi_lov_get_uuids(int fd, struct obd_uuid *uuidp, int *ost_count); extern int llapi_is_lustre_mnttype(const char *type); diff --git a/lustre/utils/liblustreapi.c b/lustre/utils/liblustreapi.c index 015c422477..7fc6b4e42d 100644 --- a/lustre/utils/liblustreapi.c +++ b/lustre/utils/liblustreapi.c @@ -346,7 +346,7 @@ static void find_param_fini(struct find_param *param) free(param->lmd); } -int llapi_file_get_lov_fuuid(int fd, struct obd_uuid *lov_name) +int llapi_file_fget_lov_uuid(int fd, struct obd_uuid *lov_name) { int rc = ioctl(fd, OBD_IOC_GETNAME, lov_name); if (rc) { @@ -356,6 +356,12 @@ int llapi_file_get_lov_fuuid(int fd, struct obd_uuid *lov_name) return rc; } +/* deprecated in favour of llapi_file_fget_lov_uuid() in 1.8 and 2.0 */ +int llapi_file_get_lov_fuuid(int fd, struct obd_uuid *lov_name) +{ + return llapi_file_fget_lov_uuid(fd, lov_name); +} + int llapi_file_get_lov_uuid(const char *path, struct obd_uuid *lov_uuid) { int fd, rc; @@ -367,7 +373,7 @@ int llapi_file_get_lov_uuid(const char *path, struct obd_uuid *lov_uuid) return rc; } - rc = llapi_file_get_lov_fuuid(fd, lov_uuid); + rc = llapi_file_fget_lov_uuid(fd, lov_uuid); close(fd); @@ -388,7 +394,7 @@ int llapi_lov_get_uuids(int fd, struct obd_uuid *uuidp, int *ost_count) int rc = 0, index = 0; /* Get the lov name */ - rc = llapi_file_get_lov_fuuid(fd, &lov_name); + rc = llapi_file_fget_lov_uuid(fd, &lov_name); if (rc) return rc; @@ -430,7 +436,7 @@ static int setup_obd_uuid(DIR *dir, char *dname, struct find_param *param) int rc = 0, index; /* Get the lov name */ - rc = llapi_file_get_lov_fuuid(dirfd(dir), &lov_uuid); + rc = llapi_file_fget_lov_uuid(dirfd(dir), &lov_uuid); if (rc) { if (errno != ENOTTY) { rc = errno; -- GitLab