diff --git a/src/efivarfs.c b/src/efivarfs.c index d4cee453..6483004d 100644 --- a/src/efivarfs.c +++ b/src/efivarfs.c @@ -246,16 +246,6 @@ efivarfs_get_variable(efi_guid_t guid, const char *name, uint8_t **data, int fd = -1; char *path = NULL; int rc; - int ratelimit; - - /* - * The kernel rate limiter hits us if we go faster than 100 efi - * variable reads per second as non-root. So if we're not root, just - * delay this long after each read. The user is not going to notice. - * - * 1s / 100 = 10000us. - */ - ratelimit = geteuid() == 0 ? 0 : 10000; rc = make_efivarfs_path(&path, guid, name); if (rc < 0) { @@ -269,14 +259,12 @@ efivarfs_get_variable(efi_guid_t guid, const char *name, uint8_t **data, goto err; } - usleep(ratelimit); rc = read(fd, &ret_attributes, sizeof (ret_attributes)); if (rc < 0) { efi_error("read failed"); goto err; } - usleep(ratelimit); rc = read_file(fd, &ret_data, &size); if (rc < 0) { efi_error("read_file failed"); diff --git a/src/vars.c b/src/vars.c index ea37f85f..1df6a662 100644 --- a/src/vars.c +++ b/src/vars.c @@ -290,16 +290,6 @@ vars_get_variable(efi_guid_t guid, const char *name, uint8_t **data, char *path = NULL; int rc; int fd = -1; - int ratelimit; - - /* - * The kernel rate limiter hits us if we go faster than 100 efi - * variable reads per second as non-root. So if we're not root, just - * delay this long after each read. The user is not going to notice. - * - * 1s / 100 = 10000us. - */ - ratelimit = geteuid() == 0 ? 0 : 10000; rc = asprintf(&path, "%s%s-" GUID_FORMAT "/raw_var", get_vars_path(), name, GUID_FORMAT_ARGS(&guid)); @@ -314,7 +304,6 @@ vars_get_variable(efi_guid_t guid, const char *name, uint8_t **data, goto err; } - usleep(ratelimit); rc = read_file(fd, &buf, &bufsize); if (rc < 0) { efi_error("read_file(%s) failed", path);