2 * Michal Simek <monstr@monstr.eu>, 2009-08-03 - ramfs
3 * Kumar Gala <galak@kernel.crashing.org>, 2007-11-14 - nfs
4 * Ricky Ng-Adam <rngadam@yahoo.com>, 2005-01-01 - tmpfs
7 * Check if current directory is on a tmpfs/nfs/ramfs filesystem
8 * If current directory is tmpfs/nfs/ramfs, return 1
9 * If current directory is NOT tmpfs/nfs/ramfs, return 0
14 #define TMPFS_MAGIC 0x01021994 /* man 2 statfs */
15 int tst_is_cwd_tmpfs(void)
20 /* Verify that the file is not on a tmpfs (in-memory) filesystem */
21 return sf
.f_type
== TMPFS_MAGIC
? 1 : 0;
24 #define NFS_MAGIC 0x6969 /* man 2 statfs */
25 int tst_is_cwd_nfs(void)
30 /* Verify that the file is not on a nfs filesystem */
31 return sf
.f_type
== NFS_MAGIC
? 1 : 0;
34 #define RAMFS_MAGIC 0x858458f6
35 int tst_is_cwd_ramfs(void)
40 /* Verify that the file is not on a ramfs (in-memory) filesystem */
41 return sf
.f_type
== RAMFS_MAGIC
? 1 : 0;