Hi!
> +#define V9FS_MAGIC 0x01021997 /* kernel-source/include/linux/magic.h */
> +int tst_is_cwd_v9fs(void)
> +{
> + struct statfs sf;
> + statfs(".", &sf);
> +
> + /* Verify that the file is not on a nfs filesystem */
> + return sf.f_type == V9FS_MAGIC ? 1 : 0;
> +}
The "? 1 : 0" redundant here.
> #define RAMFS_MAGIC 0x858458f6
> int tst_is_cwd_ramfs(void)
> {
> diff --git a/testcases/kernel/syscalls/utime/utime01.c
> b/testcases/kernel/syscalls/utime/utime01.c
> index c917afa..f635ae6 100644
> --- a/testcases/kernel/syscalls/utime/utime01.c
> +++ b/testcases/kernel/syscalls/utime/utime01.c
> @@ -120,6 +120,14 @@ int main(int ac, char **av)
> "Cannot do utime on a file located on an NFS
> filesystem");
> }
>
> + /*
> + * check if the current filesystem is v9fs
> + */
> + if (tst_is_cwd_v9fs()) {
> + tst_brkm(TCONF, cleanup,
> + "Cannot do utime on a file located on an 9P
> filesystem");
> + }
> +
> /* set the expected errnos... */
> TEST_EXP_ENOS(exp_enos);
The comment here is redundant too :). The function name tst_is_cwd_v9fs
is decriptive enough.
--
Cyril Hrubis
[email protected]
------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in
Real-Time with Splunk. Collect, index and harness all the fast moving IT data
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business
insights. http://p.sf.net/sfu/splunk-dev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list