I_DIRTY和I_DIRTY_SYNC有什么区别

时间:2014-07-31 12:57:15

标签: linux

在fs代码中,我看到mark_inode_dirty()函数,该函数与参数I_DIRTY和I_DIRTY_SYNC一起传递 两者有什么区别。我想两者都会将inode标记为脏并将更改提交给 磁盘。

1 个答案:

答案 0 :(得分:4)

见这里:http://ehc.ac/p/mrvopensource/linux-ppc-2.6/ci/1c0eeaf5698597146ed9b873e2f9e0961edcf0f9/tree/include/linux/fs.h?barediff=2e6883bdf49abd0e7f0d9b6297fc3be7ebb2250b

I_DIRTY是I_DIRTY_SYNC的超集:

#define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES)

记录为:

I_DIRTY_SYNC        Inode itself is dirty.
I_DIRTY_DATASYNC    Data-related inode changes pending
I_DIRTY_PAGES       Inode has dirty pages.  Inode itself may be clean.