]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libmount: optimize mtab and utab parsing in umount
authorKarel Zak <kzak@redhat.com>
Tue, 25 Sep 2012 14:47:18 +0000 (16:47 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 1 Oct 2012 10:00:06 +0000 (12:00 +0200)
commit9cc03553f7b8494c7193024eec6e13b903eb2eec
treebfb4b1e53b9143de6fee9c483c7893010c126f09
parenta411bef7850b79fdd46588a1f520926ad4d17351
libmount: optimize mtab and utab parsing in umount

create 8000 NFS mountpoints:
#!/bin/bash
mount=/tmp/mount
if [ ! -d $mount ]; then
    mkdir -p $mount
fi
for dir in {1..8000}; do
    if [ ! -d $mount/$dir ]; then
mkdir -p $mount/$dir
    fi
    echo mount $dir
    mount -t nfs 127.0.0.1:/ $mount/$dir
done

old version:
time ./umount /tmp/mount/2255

real 0m1.254s
user 0m1.002s
sys 0m0.238s

new version:
time ./umount /tmp/mount/2244

real 0m0.332s
user 0m0.111s
sys 0m0.218s

Reported-by: chenditang <chendt.fnst@cn.fujitsu.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/context.c
libmount/src/context_umount.c
libmount/src/mountP.h
libmount/src/tab_parse.c