Re: [prepatch] Directory Notification

From: Adam Heath (adam@doogie.org)
Date: Sun May 21 2000 - 15:09:17 EDT

  • Next message: Peter T. Breuer: "Re: 2.2.15 + IPv6: serious bug when removing aliased interfaces"

    On Sun, 21 May 2000 willy@thepuffingroup.com wrote:

    > It delivers a realtime signal to tasks which have requested it. The task
    > can then call fstat to find out what changed.

    So, the application maintains a list of dirs it is watching, and, when it
    recieves this signal, it has to make more callbacks into the kernel, to find
    what was updated? That seems sub-obtimal(to this non-fs programmer).

    Here is what I would like to see, as a possible api:

    ....

    void handle_inode_update_signal() {

        int count;
        struct inode_t **inode_list;

        count = get_updated_inode_count();
        inode_list = malloc(count * sizeof(struct inode_t));
        get_updated_inodes_all(inode_list, count);
        add_updated_inodes_to_queue(inode_list, count);
        return;
    }

    void add_updated_inodes_to_queue(struct inode_t **inode_list, int count) {

        /* Insert linked-list handling code here. */

    }

    struct inode_t **global_inode_list;

    ....

    void setup_inode_update_signal() {

        watch_inodes(global_inode_list, global_inode_count, &handle_inode_update_signal);

    }

    ....

    Again, I am not a filesystem programmer. And, I've recently been doing alot
    in java, so the above might not be valid c.

    ----BEGIN GEEK CODE BLOCK----
    Version: 3.12
    GCS d- s: a-- c+++ UL++++ P+ L++++ !E W+ M o+ K- W--- !O M- !V PS--
    PE++ Y+ PGP++ t* 5++ X+ tv b+ D++ G e h*! !r z?
    -----END GEEK CODE BLOCK-----
    ----BEGIN PGP INFO----
    Adam Heath <doogie@debian.org> Finger Print | KeyID
    67 01 42 93 CA 37 FB 1E 63 C9 80 1D 08 CF 84 0A | DE656B05 PGP
    AD46 C888 F587 F8A3 A6DA 3261 8A2C 7DC2 8BD4 A489 | 8BD4A489 GPG
    -----END PGP INFO-----

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.rutgers.edu
    Please read the FAQ at http://www.tux.org/lkml/



    This archive was generated by hypermail 2b29 : Sun May 21 2000 - 15:16:43 EDT