Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F108534881
D21043.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D21043.diff
View Options
Index: head/lib/libc/gen/getvfsbyname.c
===================================================================
--- head/lib/libc/gen/getvfsbyname.c
+++ head/lib/libc/gen/getvfsbyname.c
@@ -37,10 +37,26 @@
#include <sys/mount.h>
#include <sys/sysctl.h>
#include <errno.h>
+#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
/*
+ * fusefs(5) file systems may have a "subtype" which gets appended to
+ * statfs(2)'s f_fstypename field on a per-mount basis. Allow getvfsbyname to
+ * match either the full "fusefs.foobar" or the more general "fusefs".
+ */
+static bool
+are_fusefs(const char *fsname, const char *vfc_name)
+{
+ const static char fusefs[] = "fusefs";
+ const static char fusefs_dot[] = "fusefs.";
+
+ return (strncmp(fsname, fusefs_dot, sizeof(fusefs_dot) - 1) == 0 &&
+ strcmp(fusefs, vfc_name) == 0);
+}
+
+/*
* Given a filesystem name, determine if it is resident in the kernel,
* and if it is resident, return its xvfsconf structure.
*/
@@ -62,7 +78,8 @@
}
cnt = buflen / sizeof(struct xvfsconf);
for (i = 0; i < cnt; i++) {
- if (strcmp(fsname, xvfsp[i].vfc_name) == 0) {
+ if (strcmp(fsname, xvfsp[i].vfc_name) == 0 ||
+ are_fusefs(fsname, xvfsp[i].vfc_name)) {
memcpy(vfcp, xvfsp + i, sizeof(struct xvfsconf));
free(xvfsp);
return (0);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jan 27, 12:46 AM (1 m, 4 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16184311
Default Alt Text
D21043.diff (1 KB)
Attached To
Mode
D21043: special-case getvfsbyname(3) for fusefs(5)
Attached
Detach File
Event Timeline
Log In to Comment