Displaying 7 results from an estimated 7 matches for "cifs_magic_number".
2017 Oct 04
2
Re: [PATCH v2 2/2] builder: Choose better weights in the planner.
...mllib_statvfs_filesystem_is_remote (value pathv)
> +{
> +#ifdef HAVE_STATFS
> + struct statfs buf;
> +
> + if (statfs (String_val (pathv), &buf) == -1)
> + unix_error (errno, (char *) "statvfs", pathv);
> +
> + return Val_bool (buf.f_type == 0xff534d42 /* CIFS_MAGIC_NUMBER */ ||
> + buf.f_type == 0x6969 /* NFS_SUPER_MAGIC */ ||
> + buf.f_type == 0x517b /* SMB_SUPER_MAGIC */);
Using linux/magic.h + the constants from it should avoid the hardcoded
numbers, and possibly allow more remote filesystems. Not a big issue
otherwise,...
2017 Oct 11
1
[PATCH] common/mlutils: fix f_type comparisons
...c.c b/common/mlutils/unix_utils-c.c
index f8c4f8abe..2afdc9e5f 100644
--- a/common/mlutils/unix_utils-c.c
+++ b/common/mlutils/unix_utils-c.c
@@ -357,9 +357,9 @@ guestfs_int_mllib_statvfs_is_network_filesystem (value pathv)
#define SMB_SUPER_MAGIC 0x517b
#endif
- return Val_bool (buf.f_type == CIFS_MAGIC_NUMBER ||
- buf.f_type == NFS_SUPER_MAGIC ||
- buf.f_type == SMB_SUPER_MAGIC);
+ return Val_bool ((unsigned int) buf.f_type == CIFS_MAGIC_NUMBER ||
+ (unsigned int) buf.f_type == NFS_SUPER_MAGIC ||
+ (unsigned int) buf.f_type == SMB_...
2017 Oct 04
0
Re: [PATCH v2 2/2] builder: Choose better weights in the planner.
On Wed, Oct 04, 2017 at 03:20:53PM +0200, Pino Toscano wrote:
> > + return Val_bool (buf.f_type == 0xff534d42 /* CIFS_MAGIC_NUMBER */ ||
> > + buf.f_type == 0x6969 /* NFS_SUPER_MAGIC */ ||
> > + buf.f_type == 0x517b /* SMB_SUPER_MAGIC */);
>
> Using linux/magic.h + the constants from it should avoid the hardcoded
> numbers, and possibly allow more remote filesystems. N...
2017 Oct 02
3
[PATCH 0/2] builder: Choose better weights in the planner.
It started out as "this'll be just a simple fix ..."
and turned into something a bit over-engineered in the end.
Here it is anyway.
Rich.
2017 Oct 03
0
[PATCH v2 2/2] builder: Choose better weights in the planner.
...lloc" call. */
+value
+guestfs_int_mllib_statvfs_filesystem_is_remote (value pathv)
+{
+#ifdef HAVE_STATFS
+ struct statfs buf;
+
+ if (statfs (String_val (pathv), &buf) == -1)
+ unix_error (errno, (char *) "statvfs", pathv);
+
+ return Val_bool (buf.f_type == 0xff534d42 /* CIFS_MAGIC_NUMBER */ ||
+ buf.f_type == 0x6969 /* NFS_SUPER_MAGIC */ ||
+ buf.f_type == 0x517b /* SMB_SUPER_MAGIC */);
+#else
+ return Val_bool (0);
+#endif
+}
diff --git a/common/mlutils/unix_utils.ml b/common/mlutils/unix_utils.ml
index 085eff65b..e516ba8bb 100644
--- a/common/...
2017 Oct 03
4
[PATCH v2 0/2] builder: Choose better weights in the planner.
v1 -> v2:
- Removed the f_type field from StatVFS.statvfs structure.
- New function StatVFS.filesystem_is_remote, written in C.
[Thinking about it, this should probably be called
?is_network_filesystem?, but I can change that before
pushing].
- Use statvfs instead of fstatvfs, and statfs instead of fstatfs.
- Rejigged the comments in builder/builder.ml to make them simpler
2017 Oct 04
2
[PATCH v3 0/2] builder: Choose better weights in the planner.
v2 -> v3:
- Drop gnulib fallback.