/usr/src/open-vm-tools-10.0.7/vmblock/linux/module.c is in open-vm-tools-dkms 2:10.0.7-3227872-2ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | /*********************************************************
* Copyright (C) 2006 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation version 2 and no later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*********************************************************/
/*
* module.c --
*
* Module loading/unloading functions.
*
*/
#include "driver-config.h"
#include <linux/init.h>
#include <linux/module.h>
#include <linux/limits.h>
#include <linux/errno.h>
#include "vmblockInt.h"
#include "vmblock_version.h"
/* Module parameters */
#ifdef VMX86_DEVEL /* { */
int LOGLEVEL_THRESHOLD = 4;
module_param(LOGLEVEL_THRESHOLD, int, 0600);
MODULE_PARM_DESC(LOGLEVEL_THRESHOLD, "Logging level (0 means no log, "
"10 means very verbose, 4 is default)");
#endif /* } */
static char *root = "/tmp/VMwareDnD";
module_param(root, charp, 0600);
MODULE_PARM_DESC(root, "The directory the file system redirects to.");
/* Module information */
MODULE_AUTHOR("VMware, Inc.");
MODULE_DESCRIPTION("VMware Blocking File System");
MODULE_LICENSE("GPL v2");
MODULE_VERSION(VMBLOCK_DRIVER_VERSION_STRING);
/*
* Starting with SLE10sp2, Novell requires that IHVs sign a support agreement
* with them and mark their kernel modules as externally supported via a
* change to the module header. If this isn't done, the module will not load
* by default (i.e., neither mkinitrd nor modprobe will accept it).
*/
MODULE_INFO(supported, "external");
/*
*----------------------------------------------------------------------------
*
* VMBlockInit --
*
* Module entry point and initialization.
*
* Results:
* Zero on success, negative value on failure.
*
* Side effects:
* /proc entries are available and file system is registered with kernel and
* ready to be mounted.
*
*----------------------------------------------------------------------------
*/
static int
VMBlockInit(void)
{
int ret;
ret = VMBlockInitControlOps();
if (ret < 0) {
goto error;
}
ret = VMBlockInitFileSystem(root);
if (ret < 0) {
VMBlockCleanupControlOps();
goto error;
}
LOG(4, "module loaded\n");
return 0;
error:
Warning("VMBlock: could not initialize module\n");
return ret;
}
module_init(VMBlockInit);
/*
*----------------------------------------------------------------------------
*
* VMBlockExit --
*
* Unloads module from kernel and removes associated state.
*
* Results:
* None.
*
* Side effects:
* Opposite of VMBlockInit(): /proc entries go away and file system is
* unregistered.
*
*----------------------------------------------------------------------------
*/
static void
VMBlockExit(void)
{
VMBlockCleanupControlOps();
VMBlockCleanupFileSystem();
LOG(4, "module unloaded\n");
}
module_exit(VMBlockExit);
|