git: sbin/hammer: Remove redundant ioctl(GET_PSEUDOFS) call in getpfs()
tkusumi at crater.dragonflybsd.org
Thu Oct 6 14:28:57 PDT 2016
Author: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Date: Wed Sep 21 09:18:55 2016 +0900
sbin/hammer: Remove redundant ioctl(GET_PSEUDOFS) call in getpfs()
If scanpfsid() failed, it needs to try to open(2) the path whether
it's a symlink or a file or a directory, but it needs not to call
ioctl(GET_PSEUDOFS) which gets called right after this anyway.
The error message "Cannot access PFS" is misleading too, because
once scanpfsid() fails, the path isn't necessarily a PFS or a symlink
to a PFS.
Also note that calling this ioctl with -1 set to pfs.pfs_id is okay.
In that case, the ioctl will try to detect the PFS id based on fd.
Summary of changes:
sbin/hammer/cmd_pfs.c | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
DragonFly BSD source repository
More information about the Commits