diff options
author | Karel Zak | 2012-02-24 21:30:22 +0100 |
---|---|---|
committer | Karel Zak | 2012-02-24 21:30:22 +0100 |
commit | ea371ea30e873f553bd4666f1e8f7b0620dc5345 (patch) | |
tree | 347621498153a66f24d5a2e7720edbe0a2da1604 /libmount/src/tab.c | |
parent | lib/canonicalize: always remove tailing slash (diff) | |
download | kernel-qcow2-util-linux-ea371ea30e873f553bd4666f1e8f7b0620dc5345.tar.gz kernel-qcow2-util-linux-ea371ea30e873f553bd4666f1e8f7b0620dc5345.tar.xz kernel-qcow2-util-linux-ea371ea30e873f553bd4666f1e8f7b0620dc5345.zip |
libmount: optimize for paths with tailing slash
mnt_table_find_target() canonicalizes paths by libmnt cache, but it's
overkill if the difference between paths is tailing slash only.
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src/tab.c')
-rw-r--r-- | libmount/src/tab.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libmount/src/tab.c b/libmount/src/tab.c index f10c1de47..66a9e4dcd 100644 --- a/libmount/src/tab.c +++ b/libmount/src/tab.c @@ -438,7 +438,7 @@ struct libmnt_fs *mnt_table_find_target(struct libmnt_table *tb, const char *pat /* native @target */ mnt_reset_iter(&itr, direction); while(mnt_table_next_fs(tb, &itr, &fs) == 0) { - if (fs->target && strcmp(fs->target, path) == 0) + if (fs->target && streq_except_trailing_slash(fs->target, path)) return fs; } if (!tb->cache || !(cn = mnt_resolve_path(path, tb->cache))) |