VirtualBox

source: vbox/trunk/src/VBox/Additions/linux/sharedfolders/vbsfmount.h@ 77390

Last change on this file since 77390 was 77138, checked in by vboxsync, 6 years ago

linux/vboxsf: More read code tweaking, making the max read/write buffer size configurable (mount option maxiopages). Also added code for dealing with the host running out of heap. bugref:9172

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.2 KB
Line 
1/* $Id: vbsfmount.h 77138 2019-02-01 19:00:23Z vboxsync $ */
2/** @file
3 * vboxsf - VBox Linux Shared Folders VFS, mount(2) parameter structure.
4 */
5
6/*
7 * Copyright (C) 2006-2019 Oracle Corporation
8 *
9 * Permission is hereby granted, free of charge, to any person
10 * obtaining a copy of this software and associated documentation
11 * files (the "Software"), to deal in the Software without
12 * restriction, including without limitation the rights to use,
13 * copy, modify, merge, publish, distribute, sublicense, and/or sell
14 * copies of the Software, and to permit persons to whom the
15 * Software is furnished to do so, subject to the following
16 * conditions:
17 *
18 * The above copyright notice and this permission notice shall be
19 * included in all copies or substantial portions of the Software.
20 *
21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
23 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
24 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
25 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
26 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
28 * OTHER DEALINGS IN THE SOFTWARE.
29 */
30
31#ifndef GA_INCLUDED_SRC_linux_sharedfolders_vbsfmount_h
32#define GA_INCLUDED_SRC_linux_sharedfolders_vbsfmount_h
33#ifndef RT_WITHOUT_PRAGMA_ONCE
34# pragma once
35#endif
36
37/* Linux constraints the size of data mount argument to PAGE_SIZE - 1. */
38#define MAX_HOST_NAME 256
39#define MAX_NLS_NAME 32
40
41#define VBSF_MOUNT_SIGNATURE_BYTE_0 '\377'
42#define VBSF_MOUNT_SIGNATURE_BYTE_1 '\376'
43#define VBSF_MOUNT_SIGNATURE_BYTE_2 '\375'
44
45struct vbsf_mount_info_new {
46 /**
47 * The old version of the mount_info struct started with a
48 * char name[MAX_HOST_NAME] field, where name cannot be '\0'.
49 * So the new version of the mount_info struct starts with a
50 * nullchar field which is always 0 so that we can detect and
51 * reject the old structure being passed.
52 */
53 char nullchar;
54 char signature[3]; /**< signature */
55 int length; /**< length of the whole structure */
56 char name[MAX_HOST_NAME]; /**< share name */
57 char nls_name[MAX_NLS_NAME]; /**< name of an I/O charset */
58 int uid; /**< user ID for all entries, default 0=root */
59 int gid; /**< group ID for all entries, default 0=root */
60 int ttl; /**< time to live */
61 int dmode; /**< mode for directories if != 0xffffffff */
62 int fmode; /**< mode for regular files if != 0xffffffff */
63 int dmask; /**< umask applied to directories */
64 int fmask; /**< umask applied to regular files */
65 char tag[32]; /**< Mount tag for VBoxService automounter. @since 6.0 */
66 uint32_t cMaxIoPages; /**< Max pages to read & write at a time. @since 6.0.6 */
67};
68
69struct vbsf_mount_opts {
70 int uid;
71 int gid;
72 int ttl;
73 int dmode;
74 int fmode;
75 int dmask;
76 int fmask;
77 int ronly;
78 int sloppy;
79 int noexec;
80 int nodev;
81 int nosuid;
82 int remount;
83 char nls_name[MAX_NLS_NAME];
84 char *convertcp;
85 uint32_t cMaxIoPages;
86};
87
88/** Completes the mount operation by adding the new mount point to mtab if required. */
89int vbsfmount_complete(const char *host_name, const char *mount_point,
90 unsigned long flags, struct vbsf_mount_opts *opts);
91
92#endif /* !GA_INCLUDED_SRC_linux_sharedfolders_vbsfmount_h */
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette