From fd6f11c92e2f6f54384d1ebd3474a77b0c0ded95 Mon Sep 17 00:00:00 2001 From: Arnaud Guignard Date: Thu, 25 Jun 2015 13:59:03 +0200 Subject: [PATCH] LU-6766 utils: remove llapi_quotachown() and cb_quotachown() The SYS_chown syscall is not available on arm64, but the functions llapi_quotachown() and cb_quotachown() are not needed anymore and should have been removed in the patch http://review.whamcloud.com/4022 Change-Id: I11fa4ab901327c1c8bcfb7e6dfe14a955e2f2618 Signed-off-by: Arnaud Guignard Reviewed-on: http://review.whamcloud.com/15396 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: James Simmons Reviewed-by: Niu Yawei Reviewed-by: Oleg Drokin --- lustre/include/lustre/lustreapi.h | 1 - lustre/utils/liblustreapi.c | 55 --------------------------------------- 2 files changed, 56 deletions(-) diff --git a/lustre/include/lustre/lustreapi.h b/lustre/include/lustre/lustreapi.h index 5fecf98..135a3c8 100644 --- a/lustre/include/lustre/lustreapi.h +++ b/lustre/include/lustre/lustreapi.h @@ -272,7 +272,6 @@ extern int llapi_mv(char *path, struct find_param *param); struct mntent; #define HAVE_LLAPI_IS_LUSTRE_MNT extern int llapi_is_lustre_mnt(struct mntent *mnt); -extern int llapi_quotachown(char *path, int flag); extern int llapi_quotactl(char *mnt, struct if_quotactl *qctl); extern int llapi_target_iterate(int type_num, char **obd_type, void *args, llapi_cb_t cb); diff --git a/lustre/utils/liblustreapi.c b/lustre/utils/liblustreapi.c index 4c3ca8c..fbcfb2d 100644 --- a/lustre/utils/liblustreapi.c +++ b/lustre/utils/liblustreapi.c @@ -3757,61 +3757,6 @@ int llapi_quotactl(char *mnt, struct if_quotactl *qctl) return rc; } -static int cb_quotachown(char *path, DIR *parent, DIR **dirp, void *data, - struct dirent64 *de) -{ - struct find_param *param = (struct find_param *)data; - DIR *d = dirp == NULL ? NULL : *dirp; - lstat_t *st; - int rc; - - LASSERT(parent != NULL || d != NULL); - - rc = get_lmd_info(path, parent, d, param->fp_lmd, param->fp_lum_size); - if (rc) { - if (rc == -ENODATA) { - if (!param->fp_obd_uuid && !param->fp_quiet) - llapi_error(LLAPI_MSG_ERROR, -ENODATA, - "%s has no stripe info", path); - rc = 0; - } else if (rc == -ENOENT) { - rc = 0; - } - return rc; - } - - st = ¶m->fp_lmd->lmd_st; - - /* libc chown() will do extra check, and if the real owner is - * the same as the ones to set, it won't fall into kernel, so - * invoke syscall directly. */ - rc = syscall(SYS_chown, path, -1, -1); - if (rc) - llapi_error(LLAPI_MSG_ERROR, errno, - "error: chown %s", path); - - rc = chmod(path, st->st_mode); - if (rc) { - rc = -errno; - llapi_error(LLAPI_MSG_ERROR, rc, "error: chmod %s (%hu)", - path, st->st_mode); - } - - return rc; -} - -int llapi_quotachown(char *path, int flag) -{ - struct find_param param; - - memset(¶m, 0, sizeof(param)); - param.fp_recursive = 1; - param.fp_verbose = 0; - param.fp_quiet = 1; - - return param_callback(path, cb_quotachown, NULL, ¶m); -} - #include #include #include -- 1.8.3.1