… | |
… | |
3893 | # define EV_INOTIFY_BUFSIZE (sizeof (struct inotify_event) * 2 + NAME_MAX) |
3893 | # define EV_INOTIFY_BUFSIZE (sizeof (struct inotify_event) * 2 + NAME_MAX) |
3894 | |
3894 | |
3895 | static void noinline |
3895 | static void noinline |
3896 | infy_add (EV_P_ ev_stat *w) |
3896 | infy_add (EV_P_ ev_stat *w) |
3897 | { |
3897 | { |
3898 | w->wd = inotify_add_watch (fs_fd, w->path, IN_ATTRIB | IN_DELETE_SELF | IN_MOVE_SELF | IN_MODIFY | IN_DONT_FOLLOW | IN_MASK_ADD); |
3898 | w->wd = inotify_add_watch (fs_fd, w->path, |
|
|
3899 | IN_ATTRIB | IN_DELETE_SELF | IN_MOVE_SELF | IN_MODIFY |
|
|
3900 | | IN_CREATE | IN_DELETE | IN_MOVED_FROM | IN_MOVED_TO |
|
|
3901 | | IN_DONT_FOLLOW | IN_MASK_ADD); |
3899 | |
3902 | |
3900 | if (w->wd >= 0) |
3903 | if (w->wd >= 0) |
3901 | { |
3904 | { |
3902 | struct statfs sfs; |
3905 | struct statfs sfs; |
3903 | |
3906 | |
… | |
… | |
3907 | |
3910 | |
3908 | if (!fs_2625) |
3911 | if (!fs_2625) |
3909 | w->timer.repeat = w->interval ? w->interval : DEF_STAT_INTERVAL; |
3912 | w->timer.repeat = w->interval ? w->interval : DEF_STAT_INTERVAL; |
3910 | else if (!statfs (w->path, &sfs) |
3913 | else if (!statfs (w->path, &sfs) |
3911 | && (sfs.f_type == 0x1373 /* devfs */ |
3914 | && (sfs.f_type == 0x1373 /* devfs */ |
|
|
3915 | || sfs.f_type == 0x4006 /* fat */ |
|
|
3916 | || sfs.f_type == 0x4d44 /* msdos */ |
3912 | || sfs.f_type == 0xEF53 /* ext2/3 */ |
3917 | || sfs.f_type == 0xEF53 /* ext2/3 */ |
|
|
3918 | || sfs.f_type == 0x72b6 /* jffs2 */ |
|
|
3919 | || sfs.f_type == 0x858458f6 /* ramfs */ |
|
|
3920 | || sfs.f_type == 0x5346544e /* ntfs */ |
3913 | || sfs.f_type == 0x3153464a /* jfs */ |
3921 | || sfs.f_type == 0x3153464a /* jfs */ |
|
|
3922 | || sfs.f_type == 0x9123683e /* btrfs */ |
3914 | || sfs.f_type == 0x52654973 /* reiser3 */ |
3923 | || sfs.f_type == 0x52654973 /* reiser3 */ |
3915 | || sfs.f_type == 0x01021994 /* tempfs */ |
3924 | || sfs.f_type == 0x01021994 /* tmpfs */ |
3916 | || sfs.f_type == 0x58465342 /* xfs */)) |
3925 | || sfs.f_type == 0x58465342 /* xfs */)) |
3917 | w->timer.repeat = 0.; /* filesystem is local, kernel new enough */ |
3926 | w->timer.repeat = 0.; /* filesystem is local, kernel new enough */ |
3918 | else |
3927 | else |
3919 | w->timer.repeat = w->interval ? w->interval : NFS_STAT_INTERVAL; /* remote, use reduced frequency */ |
3928 | w->timer.repeat = w->interval ? w->interval : NFS_STAT_INTERVAL; /* remote, use reduced frequency */ |
3920 | } |
3929 | } |