forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6: (292 commits) [GFS2] Fix endian bug for de_type [GFS2] Initialize SELinux extended attributes at inode creation time. [GFS2] Move logging code into log.c (mostly) [GFS2] Mark nlink cleared so VFS sees it happen [GFS2] Two redundant casts removed [GFS2] Remove uneeded endian conversion [GFS2] Remove duplicate sb reading code [GFS2] Mark metadata reads for blktrace [GFS2] Remove iflags.h, use FS_ [GFS2] Fix code style/indent in ops_file.c [GFS2] streamline-generic_file_-interfaces-and-filemap gfs fix [GFS2] Remove readv/writev methods and use aio_read/aio_write instead (gfs bits) [GFS2] inode-diet: Eliminate i_blksize from the inode structure [GFS2] inode_diet: Replace inode.u.generic_ip with inode.i_private (gfs) [GFS2] Fix typo in last patch [GFS2] Fix direct i/o logic in filemap.c [GFS2] Fix bug in Makefiles for lock modules [GFS2] Remove (extra) fs_subsys declaration [GFS2/DLM] Fix trailing whitespace [GFS2] Tidy up meta_io code ...
- Loading branch information
Showing
126 changed files
with
40,197 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
Global File System | ||
------------------ | ||
|
||
http://sources.redhat.com/cluster/ | ||
|
||
GFS is a cluster file system. It allows a cluster of computers to | ||
simultaneously use a block device that is shared between them (with FC, | ||
iSCSI, NBD, etc). GFS reads and writes to the block device like a local | ||
file system, but also uses a lock module to allow the computers coordinate | ||
their I/O so file system consistency is maintained. One of the nifty | ||
features of GFS is perfect consistency -- changes made to the file system | ||
on one machine show up immediately on all other machines in the cluster. | ||
|
||
GFS uses interchangable inter-node locking mechanisms. Different lock | ||
modules can plug into GFS and each file system selects the appropriate | ||
lock module at mount time. Lock modules include: | ||
|
||
lock_nolock -- allows gfs to be used as a local file system | ||
|
||
lock_dlm -- uses a distributed lock manager (dlm) for inter-node locking | ||
The dlm is found at linux/fs/dlm/ | ||
|
||
In addition to interfacing with an external locking manager, a gfs lock | ||
module is responsible for interacting with external cluster management | ||
systems. Lock_dlm depends on user space cluster management systems found | ||
at the URL above. | ||
|
||
To use gfs as a local file system, no external clustering systems are | ||
needed, simply: | ||
|
||
$ mkfs -t gfs2 -p lock_nolock -j 1 /dev/block_device | ||
$ mount -t gfs2 /dev/block_device /dir | ||
|
||
GFS2 is not on-disk compatible with previous versions of GFS. | ||
|
||
The following man pages can be found at the URL above: | ||
gfs2_fsck to repair a filesystem | ||
gfs2_grow to expand a filesystem online | ||
gfs2_jadd to add journals to a filesystem online | ||
gfs2_tool to manipulate, examine and tune a filesystem | ||
gfs2_quota to examine and change quota values in a filesystem | ||
mount.gfs2 to help mount(8) mount a filesystem | ||
mkfs.gfs2 to make a filesystem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
menu "Distributed Lock Manager" | ||
depends on INET && EXPERIMENTAL | ||
|
||
config DLM | ||
tristate "Distributed Lock Manager (DLM)" | ||
depends on IPV6 || IPV6=n | ||
depends on IP_SCTP | ||
select CONFIGFS_FS | ||
help | ||
A general purpose distributed lock manager for kernel or userspace | ||
applications. | ||
|
||
config DLM_DEBUG | ||
bool "DLM debugging" | ||
depends on DLM | ||
help | ||
Under the debugfs mount point, the name of each lockspace will | ||
appear as a file in the "dlm" directory. The output is the | ||
list of resource and locks the local node knows about. | ||
|
||
endmenu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
obj-$(CONFIG_DLM) += dlm.o | ||
dlm-y := ast.o \ | ||
config.o \ | ||
dir.o \ | ||
lock.o \ | ||
lockspace.o \ | ||
lowcomms.o \ | ||
main.o \ | ||
member.o \ | ||
memory.o \ | ||
midcomms.o \ | ||
rcom.o \ | ||
recover.o \ | ||
recoverd.o \ | ||
requestqueue.o \ | ||
user.o \ | ||
util.o | ||
dlm-$(CONFIG_DLM_DEBUG) += debug_fs.o | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,173 @@ | ||
/****************************************************************************** | ||
******************************************************************************* | ||
** | ||
** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. | ||
** Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved. | ||
** | ||
** 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 General Public License v.2. | ||
** | ||
******************************************************************************* | ||
******************************************************************************/ | ||
|
||
#include "dlm_internal.h" | ||
#include "lock.h" | ||
#include "user.h" | ||
|
||
#define WAKE_ASTS 0 | ||
|
||
static struct list_head ast_queue; | ||
static spinlock_t ast_queue_lock; | ||
static struct task_struct * astd_task; | ||
static unsigned long astd_wakeflags; | ||
static struct mutex astd_running; | ||
|
||
|
||
void dlm_del_ast(struct dlm_lkb *lkb) | ||
{ | ||
spin_lock(&ast_queue_lock); | ||
if (lkb->lkb_ast_type & (AST_COMP | AST_BAST)) | ||
list_del(&lkb->lkb_astqueue); | ||
spin_unlock(&ast_queue_lock); | ||
} | ||
|
||
void dlm_add_ast(struct dlm_lkb *lkb, int type) | ||
{ | ||
if (lkb->lkb_flags & DLM_IFL_USER) { | ||
dlm_user_add_ast(lkb, type); | ||
return; | ||
} | ||
DLM_ASSERT(lkb->lkb_astaddr != DLM_FAKE_USER_AST, dlm_print_lkb(lkb);); | ||
|
||
spin_lock(&ast_queue_lock); | ||
if (!(lkb->lkb_ast_type & (AST_COMP | AST_BAST))) { | ||
kref_get(&lkb->lkb_ref); | ||
list_add_tail(&lkb->lkb_astqueue, &ast_queue); | ||
} | ||
lkb->lkb_ast_type |= type; | ||
spin_unlock(&ast_queue_lock); | ||
|
||
set_bit(WAKE_ASTS, &astd_wakeflags); | ||
wake_up_process(astd_task); | ||
} | ||
|
||
static void process_asts(void) | ||
{ | ||
struct dlm_ls *ls = NULL; | ||
struct dlm_rsb *r = NULL; | ||
struct dlm_lkb *lkb; | ||
void (*cast) (long param); | ||
void (*bast) (long param, int mode); | ||
int type = 0, found, bmode; | ||
|
||
for (;;) { | ||
found = 0; | ||
spin_lock(&ast_queue_lock); | ||
list_for_each_entry(lkb, &ast_queue, lkb_astqueue) { | ||
r = lkb->lkb_resource; | ||
ls = r->res_ls; | ||
|
||
if (dlm_locking_stopped(ls)) | ||
continue; | ||
|
||
list_del(&lkb->lkb_astqueue); | ||
type = lkb->lkb_ast_type; | ||
lkb->lkb_ast_type = 0; | ||
found = 1; | ||
break; | ||
} | ||
spin_unlock(&ast_queue_lock); | ||
|
||
if (!found) | ||
break; | ||
|
||
cast = lkb->lkb_astaddr; | ||
bast = lkb->lkb_bastaddr; | ||
bmode = lkb->lkb_bastmode; | ||
|
||
if ((type & AST_COMP) && cast) | ||
cast(lkb->lkb_astparam); | ||
|
||
/* FIXME: Is it safe to look at lkb_grmode here | ||
without doing a lock_rsb() ? | ||
Look at other checks in v1 to avoid basts. */ | ||
|
||
if ((type & AST_BAST) && bast) | ||
if (!dlm_modes_compat(lkb->lkb_grmode, bmode)) | ||
bast(lkb->lkb_astparam, bmode); | ||
|
||
/* this removes the reference added by dlm_add_ast | ||
and may result in the lkb being freed */ | ||
dlm_put_lkb(lkb); | ||
|
||
schedule(); | ||
} | ||
} | ||
|
||
static inline int no_asts(void) | ||
{ | ||
int ret; | ||
|
||
spin_lock(&ast_queue_lock); | ||
ret = list_empty(&ast_queue); | ||
spin_unlock(&ast_queue_lock); | ||
return ret; | ||
} | ||
|
||
static int dlm_astd(void *data) | ||
{ | ||
while (!kthread_should_stop()) { | ||
set_current_state(TASK_INTERRUPTIBLE); | ||
if (!test_bit(WAKE_ASTS, &astd_wakeflags)) | ||
schedule(); | ||
set_current_state(TASK_RUNNING); | ||
|
||
mutex_lock(&astd_running); | ||
if (test_and_clear_bit(WAKE_ASTS, &astd_wakeflags)) | ||
process_asts(); | ||
mutex_unlock(&astd_running); | ||
} | ||
return 0; | ||
} | ||
|
||
void dlm_astd_wake(void) | ||
{ | ||
if (!no_asts()) { | ||
set_bit(WAKE_ASTS, &astd_wakeflags); | ||
wake_up_process(astd_task); | ||
} | ||
} | ||
|
||
int dlm_astd_start(void) | ||
{ | ||
struct task_struct *p; | ||
int error = 0; | ||
|
||
INIT_LIST_HEAD(&ast_queue); | ||
spin_lock_init(&ast_queue_lock); | ||
mutex_init(&astd_running); | ||
|
||
p = kthread_run(dlm_astd, NULL, "dlm_astd"); | ||
if (IS_ERR(p)) | ||
error = PTR_ERR(p); | ||
else | ||
astd_task = p; | ||
return error; | ||
} | ||
|
||
void dlm_astd_stop(void) | ||
{ | ||
kthread_stop(astd_task); | ||
} | ||
|
||
void dlm_astd_suspend(void) | ||
{ | ||
mutex_lock(&astd_running); | ||
} | ||
|
||
void dlm_astd_resume(void) | ||
{ | ||
mutex_unlock(&astd_running); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/****************************************************************************** | ||
******************************************************************************* | ||
** | ||
** Copyright (C) 2005 Red Hat, Inc. All rights reserved. | ||
** | ||
** 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 General Public License v.2. | ||
** | ||
******************************************************************************* | ||
******************************************************************************/ | ||
|
||
#ifndef __ASTD_DOT_H__ | ||
#define __ASTD_DOT_H__ | ||
|
||
void dlm_add_ast(struct dlm_lkb *lkb, int type); | ||
void dlm_del_ast(struct dlm_lkb *lkb); | ||
|
||
void dlm_astd_wake(void); | ||
int dlm_astd_start(void); | ||
void dlm_astd_stop(void); | ||
void dlm_astd_suspend(void); | ||
void dlm_astd_resume(void); | ||
|
||
#endif | ||
|
Oops, something went wrong.