VirtualBox

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

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

linux/vboxsf: Default dentry/stat TTL to 200 ms as on solaris. bugref:9172

  • Use the same stat/direntry TTL default value as we do on solaris (200 ms).
  • Changed the ttl=xxx mount option to be milliseconds rather than jiffies.
  • Force inode restat in sf_setattr() as a temp workaround for issue when TTL is non-zero (see older @todo in code).
  • Have separate dentry and inode update jiffies.
  • Reworked sf_dentry_revalidate and made it avoid restatting inodes more aggressively.
  • Extend TTL of parent dentry after successful opens and creation (does not extend to inodes, of course).
  • Stop using dentry::d_time like the rest of the file systems did around 4.9.0 (kernels back to 2.4.0 never seem to touch this from what I can tell, it was an file system internal field).
  • Since we only have one set of dentry ops, set super_block::s_d_op rather than calling d_set_d_op().
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.3 KB
Line 
1/* $Id: vbsfmount.h 77492 2019-02-28 01:55:50Z 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#define VBSF_DEFAULT_TTL_MS 200
41
42#define VBSF_MOUNT_SIGNATURE_BYTE_0 '\377'
43#define VBSF_MOUNT_SIGNATURE_BYTE_1 '\376'
44#define VBSF_MOUNT_SIGNATURE_BYTE_2 '\375'
45
46struct vbsf_mount_info_new {
47 /**
48 * The old version of the mount_info struct started with a
49 * char name[MAX_HOST_NAME] field, where name cannot be '\0'.
50 * So the new version of the mount_info struct starts with a
51 * nullchar field which is always 0 so that we can detect and
52 * reject the old structure being passed.
53 */
54 char nullchar;
55 char signature[3]; /**< signature */
56 int length; /**< length of the whole structure */
57 char name[MAX_HOST_NAME]; /**< share name */
58 char nls_name[MAX_NLS_NAME]; /**< name of an I/O charset */
59 int uid; /**< user ID for all entries, default 0=root */
60 int gid; /**< group ID for all entries, default 0=root */
61 int ttl; /**< directory entry and inode time to live in milliseconds.
62 * -1 for kernel default, 0 to disable caching. */
63 int dmode; /**< mode for directories if != 0xffffffff */
64 int fmode; /**< mode for regular files if != 0xffffffff */
65 int dmask; /**< umask applied to directories */
66 int fmask; /**< umask applied to regular files */
67 char tag[32]; /**< Mount tag for VBoxService automounter. @since 6.0 */
68 uint32_t cMaxIoPages; /**< Max pages to read & write at a time. @since 6.0.6 */
69};
70
71struct vbsf_mount_opts {
72 int uid;
73 int gid;
74 int ttl;
75 int dmode;
76 int fmode;
77 int dmask;
78 int fmask;
79 int ronly;
80 int sloppy;
81 int noexec;
82 int nodev;
83 int nosuid;
84 int remount;
85 char nls_name[MAX_NLS_NAME];
86 char *convertcp;
87 uint32_t cMaxIoPages;
88};
89
90/** Completes the mount operation by adding the new mount point to mtab if required. */
91int vbsfmount_complete(const char *host_name, const char *mount_point,
92 unsigned long flags, struct vbsf_mount_opts *opts);
93
94#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