xfs
[Top] [All Lists]

Re: [PATCH 2/6] libxfs/linux.c: Replace use of ustat by stat

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH 2/6] libxfs/linux.c: Replace use of ustat by stat
From: Felix Janda <felix.janda@xxxxxxxxx>
Date: Sat, 18 Jun 2016 16:53:49 +0200
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <20160114102009.GD27644@xxxxxxxxxxxxx>
References: <cover.1452627740.git.felix.janda@xxxxxxxxx> <20160112195945.GC568@nyan> <20160113075501.GC21939@xxxxxxxxxxxxx> <20160113174241.GC10942@nyan> <20160114102009.GD27644@xxxxxxxxxxxxx>
User-agent: Mutt/1.6.1 (2016-04-27)
On Thu, 14 Jan 2016 at 02:20:09 -0800, Christoph Hellwig wrote:
> On Wed, Jan 13, 2016 at 06:42:41PM +0100, Felix Janda wrote:
> > Is this really performance relevant?
> 
> I'm not entirely sure.  There are systems with giant amounts of mounted
> file systems, in which case iterating each of them and requiring
> multiple syscalls each might not be a good idea.
> 
> > Hmm, so we couldn't we use for linux just something like
> > 
> > int
> > platform_check_ismounted(char *name, char *block, struct stat64 *s, int 
> > verbose)
> > {
> >     int fd = open(block, O_EXCL);
> >     int e = errno;
> >     
> >     if (fd != -1) close(fd);
> >     if (e == EBUSY) {
> >             if (verbose)
> >                     fprintf(stderr, _("%s: %s contains a mounted 
> > filesystem\n"), progname, name);
> >             return 1;
> >     }
> > 
> >     return 0;
> 
> Please give me a couple of days to come up with an idea to use O_EXCL
> on Linux and work around it on other platforms in a more integrated way.

Ping?

Thanks,
Felix

<Prev in Thread] Current Thread [Next in Thread>