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]:53601 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933048Ab3BLNSp (ORCPT ); Tue, 12 Feb 2013 08:18:45 -0500 Date: Tue, 12 Feb 2013 14:18:30 +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: <20130212131830.GA18597@x2.net.home> References: <51197D69.6050901@gmail.com> <20130212111248.GG20408@x2.net.home> <511A2DDA.40504@bernhard-voelker.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <511A2DDA.40504@bernhard-voelker.de> Sender: util-linux-owner@vger.kernel.org List-ID: 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... Karel -- Karel Zak http://karelzak.blogspot.com