Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6
Browse files Browse the repository at this point in the history
* 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
Linus Torvalds committed Oct 4, 2006
2 parents d002ec4 + 7ecdb70 commit 4a61f17
Show file tree
Hide file tree
Showing 126 changed files with 40,197 additions and 6 deletions.
6 changes: 3 additions & 3 deletions CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -3578,11 +3578,11 @@ S: Fargo, North Dakota 58122
S: USA

N: Steven Whitehouse
E: [email protected]
E: [email protected]
W: http://www.chygwyn.com/~steve
D: Linux DECnet project: http://www.sucs.swan.ac.uk/~rohan/DECnet/index.html
D: Linux DECnet project
D: Minor debugging of other networking protocols.
D: Misc bug fixes and filesystem development
D: Misc bug fixes and GFS2 filesystem development

N: Hans-Joachim Widmaier
E: [email protected]
Expand Down
43 changes: 43 additions & 0 deletions Documentation/filesystems/gfs2.txt
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
18 changes: 18 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,16 @@ M: [email protected]
L: [email protected]
S: Maintained

DISTRIBUTED LOCK MANAGER
P: Patrick Caulfield
M: [email protected]
P: David Teigland
M: [email protected]
L: [email protected]
W: http://sources.redhat.com/cluster/
T: git kernel.org:/pub/scm/linux/kernel/git/steve/gfs-2.6.git
S: Supported

DAVICOM FAST ETHERNET (DMFE) NETWORK DRIVER
P: Tobias Ringstrom
M: [email protected]
Expand Down Expand Up @@ -1173,6 +1183,14 @@ M: [email protected]
W: http://www.kernel.org/pub/linux/utils/net/hdlc/
S: Maintained

GFS2 FILE SYSTEM
P: Steven Whitehouse
M: [email protected]
L: [email protected]
W: http://sources.redhat.com/cluster/
T: git kernel.org:/pub/scm/linux/kernel/git/steve/gfs-2.6.git
S: Supported

GIGASET ISDN DRIVERS
P: Hansjoerg Lipp
M: [email protected]
Expand Down
2 changes: 2 additions & 0 deletions fs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ config FS_POSIX_ACL
default n

source "fs/xfs/Kconfig"
source "fs/gfs2/Kconfig"

config OCFS2_FS
tristate "OCFS2 file system support"
Expand Down Expand Up @@ -1995,6 +1996,7 @@ endmenu
endif

source "fs/nls/Kconfig"
source "fs/dlm/Kconfig"

endmenu

2 changes: 2 additions & 0 deletions fs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ obj-$(CONFIG_CONFIGFS_FS) += configfs/
obj-y += devpts/

obj-$(CONFIG_PROFILING) += dcookies.o
obj-$(CONFIG_DLM) += dlm/

# Do not add any filesystems before this line
obj-$(CONFIG_REISERFS_FS) += reiserfs/
Expand Down Expand Up @@ -110,3 +111,4 @@ obj-$(CONFIG_HOSTFS) += hostfs/
obj-$(CONFIG_HPPFS) += hppfs/
obj-$(CONFIG_DEBUG_FS) += debugfs/
obj-$(CONFIG_OCFS2_FS) += ocfs2/
obj-$(CONFIG_GFS2_FS) += gfs2/
2 changes: 1 addition & 1 deletion fs/configfs/item.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,4 +224,4 @@ EXPORT_SYMBOL(config_item_init);
EXPORT_SYMBOL(config_group_init);
EXPORT_SYMBOL(config_item_get);
EXPORT_SYMBOL(config_item_put);

EXPORT_SYMBOL(config_group_find_obj);
21 changes: 21 additions & 0 deletions fs/dlm/Kconfig
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
19 changes: 19 additions & 0 deletions fs/dlm/Makefile
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

173 changes: 173 additions & 0 deletions fs/dlm/ast.c
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);
}

26 changes: 26 additions & 0 deletions fs/dlm/ast.h
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

Loading

0 comments on commit 4a61f17

Please sign in to comment.