1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-02 22:42:30 +03:00
lvm2/lib/locking/locking_types.h
David Teigland 6e6ef95ba6 Implement lock-override options without locking type
The options: --nolocking, --readonly, --sysinit
override, or make exceptions to, the normal file locking
behavior.  Implement these by just checking for the
options in the file locking path instead of using
special locking types.
2018-06-07 16:17:04 +01:00

39 lines
1.3 KiB
C

/*
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
* Copyright (C) 2004-2009 Red Hat, Inc. All rights reserved.
*
* This file is part of LVM2.
*
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
* of the GNU Lesser General Public License v.2.1.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "lib/metadata/metadata.h"
#include "lib/config/config.h"
typedef int (*lock_resource_fn) (struct cmd_context * cmd, const char *resource,
uint32_t flags, const struct logical_volume *lv);
typedef int (*query_resource_fn) (const char *resource, const char *node, int *mode);
typedef void (*fin_lock_fn) (void);
typedef void (*reset_lock_fn) (void);
#define LCK_FLOCK 0x00000001
struct locking_type {
uint32_t flags; /* 0 means file locking is disabled */
lock_resource_fn lock_resource;
query_resource_fn query_resource;
reset_lock_fn reset_locking;
fin_lock_fn fin_locking;
};
int init_file_locking(struct locking_type *locking, struct cmd_context *cmd,
int suppress_messages);