UF_TRACKED file flag from stat.h

做~自己de王妃 提交于 2019-12-11 07:36:35

问题


In the header stat.h on osx 10.7 I found define on fileflag UF_TRACKED. I googled that define but didn't find anything about flag. Can you describe me what does this flag mean? I encountered with it when I try to apply attributes to the file wich placed on the mounted folder. That folder is HFS+ folder on the remoted osx 10.7.3. Maybe I can ignore it? And what can happen in that case?


回答1:


The UF_TRACKED is a flag which tells HFS to send an event to a tracked file handler in user mode on any change to the file's dentry (i.e. rename or delete, and changes in metadata, but not file modification). You can see that both in the header file:

#define UF_TRACKED      0x00000040  /* file renames and deletes are tracked */

The code to handle this is in the kernel, bsd/hfs/hfs_vfsutils.c:

int
check_for_tracked_file(struct vnode *vp, time_t ctime, uint64_t op_type, void *arg)
{
        int tracked_error = 0, snapshot_error = 0;

        if (vp == NULL) {
                return 0;
        }

        if (VTOC(vp)->c_bsdflags & UF_TRACKED) {
 ... 

And is called all over the place, primarily from hfs_vnops.c



来源:https://stackoverflow.com/questions/10607877/uf-tracked-file-flag-from-stat-h

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!