From: Andre Noll Date: Sun, 25 Nov 2007 18:11:50 +0000 (+0100) Subject: com_setatt(): Generate an afs event if attributes were modified. X-Git-Tag: v0.3.0~83 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=1040882da196d0829b15cbe186feca445956a58a com_setatt(): Generate an afs event if attributes were modified. --- diff --git a/afs.h b/afs.h index e30978b7..888003aa 100644 --- a/afs.h +++ b/afs.h @@ -66,7 +66,7 @@ struct rmatt_event_data { struct afsi_change_event_data { - const struct osl_row *aft_row; + struct osl_row *aft_row; struct afs_info *old_afsi; }; diff --git a/attribute.c b/attribute.c index 88b394ad..4acfd515 100644 --- a/attribute.c +++ b/attribute.c @@ -250,13 +250,13 @@ static int com_setatt_callback(const struct osl_object *query, (long long unsigned)del_mask); for (; p < (char *)query->data + query->size; p += len + 1) { /* TODO: fnmatch */ struct afs_info old_afsi, new_afsi; - struct osl_row *aft_row; + struct afsi_change_event_data aced = {.old_afsi = &old_afsi}; len = strlen(p); - ret = aft_get_row_of_path(p, &aft_row); + ret = aft_get_row_of_path(p, &aced.aft_row); if (ret < 0) return ret; - ret = get_afsi_object_of_row(aft_row, &obj); + ret = get_afsi_object_of_row(aced.aft_row, &obj); if (ret < 0) return ret; ret = load_afsi(&old_afsi, &obj); @@ -266,7 +266,7 @@ static int com_setatt_callback(const struct osl_object *query, new_afsi.attributes |= add_mask; new_afsi.attributes &= ~del_mask; save_afsi(&new_afsi, &obj); /* in-place update */ - // FIXME: Event? + afs_event(AFSI_CHANGE, NULL, &aced); } return 1; }