]> git.tue.mpg.de Git - paraslash.git/commitdiff
com_setatt(): Generate an afs event if attributes were modified.
authorAndre Noll <maan@systemlinux.org>
Sun, 25 Nov 2007 18:11:50 +0000 (19:11 +0100)
committerAndre Noll <maan@systemlinux.org>
Sun, 25 Nov 2007 18:11:50 +0000 (19:11 +0100)
afs.h
attribute.c

diff --git a/afs.h b/afs.h
index e30978b7e479e0b2695ac7c878d7cace331fd749..888003aa07fc141d073f076d03194b56b694a8e3 100644 (file)
--- 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;
 };
 
index 88b394adc7cf37e764153ddbe53d93607aa1e337..4acfd515b1160bbbd642893b97e94b1c600c90ac 100644 (file)
@@ -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;
 }