scoutfs-utils: naturally align ioctl structs

Use natuturally aligned and explicitly padded ioctl structs.

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2019-06-27 11:39:19 -07:00
committed by Zach Brown
parent 674224d454
commit 8597fd0bfc
6 changed files with 91 additions and 29 deletions
+4 -4
View File
@@ -45,13 +45,13 @@ int parse_u32(char *str, u32 *val_ret)
return 0;
}
int parse_timespec(char *str, struct scoutfs_timespec *ts)
int parse_timespec(char *str, struct timespec *ts)
{
unsigned long long sec;
unsigned int nsec;
int ret;
memset(ts, 0, sizeof(struct scoutfs_timespec));
memset(ts, 0, sizeof(struct timespec));
ret = sscanf(str, "%llu.%u", &sec, &nsec);
if (ret != 2) {
@@ -64,8 +64,8 @@ int parse_timespec(char *str, struct scoutfs_timespec *ts)
return -EINVAL;
}
ts->sec = cpu_to_le64(sec);
ts->nsec = cpu_to_le32(nsec);
ts->tv_sec = sec;
ts->tv_nsec = nsec;
return 0;
}