+ unsigned int changed = 0;
+
+ if (ce->ce_mtime.sec != htonl(st->st_mtime))
+ changed |= MTIME_CHANGED;
+ if (ce->ce_ctime.sec != htonl(st->st_ctime))
+ changed |= CTIME_CHANGED;
+
+#ifdef NSEC
+ /*
+ * nsec seems unreliable - not all filesystems support it, so
+ * as long as it is in the inode cache you get right nsec
+ * but after it gets flushed, you get zero nsec.
+ */
+ if (ce->ce_mtime.nsec != htonl(st->st_mtim.tv_nsec)
+ changed |= MTIME_CHANGED;
+ if (ce->ce_ctime.nsec != htonl(st->st_ctim.tv_nsec)
+ changed |= CTIME_CHANGED;
+#endif
+
+ if (ce->ce_uid != htonl(st->st_uid) ||
+ ce->ce_gid != htonl(st->st_gid))
+ changed |= OWNER_CHANGED;
+ /* We consider only the owner x bit to be relevant for "mode changes" */
+ if (0100 & (ntohl(ce->ce_mode) ^ st->st_mode))
+ changed |= MODE_CHANGED;
+ if (ce->ce_dev != htonl(st->st_dev) ||
+ ce->ce_ino != htonl(st->st_ino))
+ changed |= INODE_CHANGED;
+ if (ce->ce_size != htonl(st->st_size))
+ changed |= DATA_CHANGED;
+ return changed;