plfs/plfs-core — pull request #218 by zhang-jingwang (2013-04-15 02:26:23+00:00)
Title: Add plfs_flush and plfs_invalidate_cache to manage internal cache

I add two API to libplfs: plfs_flush(pathname) and plfs_invalidate_cache(pathname). They will provide a consistency guarantee for small file mode as following:
Process A:
Make some changes to /mnt/plfs/dir1/file1; // Changeset 1
Create/delete files in /mnt/plfs/dir1/; // Changeset 2
Call plfs_flush(/mnt/plfs/dir1/file1; // at timestamp 1.

Process B:
Call plfs_invalidate_cache(/mnt/plfs/dir1/file1); // at some time after timestamp 1. (barrier could guarantee that order in time).
Then process B is guaranteed to see the changes in Changeset 1 and Changeset 2.

I've modified fs_test tool to test it. I add plfs_invalidate_cache(target) right after the barrier() before read()/write(), and then run fs_test.x with --io plfs --barrier bread,bwrite. Then the fs_test.x tool succeed without errors.