diff options
| author | Andre Noll <maan@tuebingen.mpg.de> | 2026-03-01 20:45:56 +0100 |
|---|---|---|
| committer | Andre Noll <maan@tuebingen.mpg.de> | 2026-03-17 19:25:05 +0100 |
| commit | 6b35adcfdcf3757541b4c19f9d4aead7b65f5e49 (patch) | |
| tree | 72b40de41ba462564c5b157813bf620c05024cdd | |
| parent | ef3f4056b98c499ce438e72fe126faff6dabb276 (diff) | |
Remove struct rmatt_event_data.
It contains only an 8 bit integer, so we may as well just pass a pointer to
uint8_t instead.
| -rw-r--r-- | afs.h | 8 | ||||
| -rw-r--r-- | aft.c | 4 | ||||
| -rw-r--r-- | attribute.c | 6 |
3 files changed, 5 insertions, 13 deletions
@@ -70,14 +70,6 @@ enum afs_events { }; /** - * Structure for events of type ATTRIBUTE_REMOVE. - */ -struct rmatt_event_data { - /** The bit number of the attribute being removed. */ - unsigned char bitnum; -}; - -/** * Structure for events of type ATTRIBUTE_AFSI_CHANGE. */ struct afsi_change_event_data { @@ -2500,11 +2500,11 @@ static int aft_create(const char *dir) static int clear_attribute(struct osl_row *row, void *data) { - struct rmatt_event_data *red = data; + uint8_t bitnum = *(uint8_t *)data; struct afs_info afsi; struct osl_object obj; int ret = get_afsi_object_of_row(row, &obj); - uint64_t mask = ~(1ULL << red->bitnum); + uint64_t mask = ~(1ULL << bitnum); if (ret < 0) return ret; diff --git a/attribute.c b/attribute.c index d80d755b..48d0baf0 100644 --- a/attribute.c +++ b/attribute.c @@ -292,9 +292,9 @@ static int remove_attribute(struct osl_table *table, struct osl_row *row, { struct afs_callback_arg *aca = data; int ret; - struct rmatt_event_data red; + uint8_t bitnum; - ret = get_attribute_bitnum_by_name(name, &red.bitnum); + ret = get_attribute_bitnum_by_name(name, &bitnum); if (ret < 0) { afs_error(aca, "cannot get bit number of %s\n", name); return ret; @@ -305,7 +305,7 @@ static int remove_attribute(struct osl_table *table, struct osl_row *row, afs_error(aca, "cannot remove %s\n", name); return ret; } - return afs_event(ATTRIBUTE_REMOVE, &red); + return afs_event(ATTRIBUTE_REMOVE, &bitnum); } static int com_rmatt_callback(struct afs_callback_arg *aca) |
