]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit - libxcmd/paths.c
xfsprogs: libxcmd: kill "search" arg in fs_device_number()
authorAlex Elder <aelder@sgi.com>
Wed, 28 Sep 2011 10:57:10 +0000 (10:57 +0000)
committerAlex Elder <aelder@sgi.com>
Thu, 29 Sep 2011 14:30:47 +0000 (09:30 -0500)
commit519dbb1f0e40fccbe8b9c4f01149537a42a62376
treea1087151a9f94bbe9b8ab5f0875b5f0b5e9e54c7
parent80a3572bac57373ccf78ba0db346d25a108a4afa
xfsprogs: libxcmd: kill "search" arg in fs_device_number()

The function fs_device_number() in libxcmd allows the caller to
optionally "search" in /dev for a given device path in order to look
up the dev_t that represents that device path.

If set, all that function does is prepend "/dev/" to the path to see
if that produces a device path that works.  So it appears this might
have been to support providing just the basename of a device as a
shorthand for its full path.

In practice, the paths passed to this function with "search" set are
those used in the mount options for a mounted XFS filesystem for the
optional log and real-time device paths.  When such paths are used
in the XFS mount path, they will have been subject to a AT_FDCWD
path lookup, so unless the process mounting the filesystem was
sitting in /dev no relative path would ever be specified as just the
basename.

Even though the "mounting with CWD=/dev" is a conceivable scenario,
I think it is not likely enough to warrant the special handling to
cover that case in fs_device_number().

So delete the code that retries with a "/dev" prepended, eliminate
the "search" argument that enables it, and fix the callers
accordingly.

Signed-off-by: Alex Elder <aelder@sgi.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
libxcmd/paths.c