Return-Path: Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.74) (envelope-from ) id 1PsdZI-0007e7-5c for ltp-list@lists.sourceforge.net; Thu, 24 Feb 2011 15:57:28 +0000 Date: Thu, 24 Feb 2011 17:01:27 +0100 From: Cyril Hrubis Message-ID: <20110224160127.GD29199@saboteur.suse.cz> References: <1297916867-14470-1-git-send-email-harsh@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1297916867-14470-1-git-send-email-harsh@linux.vnet.ibm.com> Subject: Re: [LTP] [PATCH] utime: Add exception for V9FS for utime functional test List-Id: Linux Test Project General Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ltp-list-bounces@lists.sourceforge.net To: Harsh Prateek Bora Cc: ltp-list@lists.sf.net 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 chrubis@suse.cz ------------------------------------------------------------------------------ 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 Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list