2006-01-17 00:50:04 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
|
2006-05-19 03:09:15 +08:00
|
|
|
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
2006-01-17 00:50:04 +08:00
|
|
|
*
|
|
|
|
* This copyrighted material is made available to anyone wishing to use,
|
|
|
|
* modify, copy, or redistribute it subject to the terms and conditions
|
2006-09-01 23:05:15 +08:00
|
|
|
* of the GNU General Public License version 2.
|
2006-01-17 00:50:04 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __GLOPS_DOT_H__
|
|
|
|
#define __GLOPS_DOT_H__
|
|
|
|
|
2006-09-05 22:39:21 +08:00
|
|
|
#include "incore.h"
|
|
|
|
|
2006-08-30 21:30:00 +08:00
|
|
|
extern const struct gfs2_glock_operations gfs2_meta_glops;
|
|
|
|
extern const struct gfs2_glock_operations gfs2_inode_glops;
|
|
|
|
extern const struct gfs2_glock_operations gfs2_rgrp_glops;
|
|
|
|
extern const struct gfs2_glock_operations gfs2_trans_glops;
|
|
|
|
extern const struct gfs2_glock_operations gfs2_iopen_glops;
|
|
|
|
extern const struct gfs2_glock_operations gfs2_flock_glops;
|
|
|
|
extern const struct gfs2_glock_operations gfs2_nondisk_glops;
|
|
|
|
extern const struct gfs2_glock_operations gfs2_quota_glops;
|
|
|
|
extern const struct gfs2_glock_operations gfs2_journal_glops;
|
GFS2: Add a "demote a glock" interface to sysfs
This adds a sysfs file called demote_rq to GFS2's
per filesystem directory. Its possible to use this
file to demote arbitrary glocks in exactly the same
way as if a request had come in from a remote node.
This is intended for testing issues relating to caching
of data under glocks. Despite that, the interface is
generic enough to send requests to any type of glock,
but be careful as its not always safe to send an
arbitrary message to an arbitrary glock. For that reason
and to prevent DoS, this interface is restricted to root
only.
The messages look like this:
<type>:<glocknumber> <mode>
Example:
echo -n "2:13324 EX" >/sys/fs/gfs2/unity:myfs/demote_rq
Which means "please demote inode glock (type 2) number 13324 so that
I can get an EX (exclusive) lock". The lock modes are those which
would normally be sent by a remote node in its callback so if you
want to unlock a glock, you use EX, to demote to shared, use SH or PR
(depending on whether you like GFS2 or DLM lock modes better!).
If the glock doesn't exist, you'll get -ENOENT returned. If the
arguments don't make sense, you'll get -EINVAL returned.
The plan is that this interface will be used in combination with
the blktrace patch which I recently posted for comments although
it is, of course, still useful in its own right.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
2009-02-12 21:31:58 +08:00
|
|
|
extern const struct gfs2_glock_operations *gfs2_glops_list[];
|
2006-01-17 00:50:04 +08:00
|
|
|
|
2011-04-14 16:54:02 +08:00
|
|
|
extern void gfs2_ail_flush(struct gfs2_glock *gl);
|
|
|
|
|
2006-01-17 00:50:04 +08:00
|
|
|
#endif /* __GLOPS_DOT_H__ */
|