From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: util-linux-owner@vger.kernel.org Received: from mx1.redhat.com ([209.132.183.28]:1192 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754310Ab3BNPCO (ORCPT ); Thu, 14 Feb 2013 10:02:14 -0500 Date: Thu, 14 Feb 2013 16:02:00 +0100 From: Karel Zak To: Bernhard Voelker Cc: kerolasa@gmail.com, Sami Kerola , Mantas =?utf-8?Q?Mikul=C4=97nas?= , util-linux@vger.kernel.org Subject: Re: lslocks =?utf-8?B?4oCTICJmYWlsZQ==?= =?utf-8?Q?d?= to parse pid: 'WRITE'" Message-ID: <20130214150200.GG19379@x2.net.home> References: <51197D69.6050901@gmail.com> <20130212111248.GG20408@x2.net.home> <511A2DDA.40504@bernhard-voelker.de> <20130212131830.GA18597@x2.net.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20130212131830.GA18597@x2.net.home> Sender: util-linux-owner@vger.kernel.org List-ID: On Tue, Feb 12, 2013 at 02:18:30PM +0100, Karel Zak wrote: > On Tue, Feb 12, 2013 at 12:56:10PM +0100, Bernhard Voelker wrote: > > On 02/12/2013 12:23 PM, Sami Kerola wrote: > > > Almost off topic. > > > > while we're at it - ;-) > > is it necessary to open/read/close "/proc/self/mountinfo" so often? > > > > $ strace -e open ./lslocks 2>&1 | grep mountinfo | wc -l > > 67 > > especially when we have libmount in the same source tree :-) Just use > mnt_new_table_from_file(_PATH_PROC_MOUNTINFO) and keep the pointer... Fixed. $ strace -e open ./lslocks 2>&1 | grep mountinfo | wc -l 1 Karel -- Karel Zak http://karelzak.blogspot.com