[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] cluster cman/lib/libcman.c cman/lib/libcman.h ...



CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	STABLE
Changes by:	rpeterso sourceware org	2007-02-07 15:25:06

Modified files:
	cman/lib       : libcman.c libcman.h 
	cman-kernel/src: cnxman.c 
	dlm-kernel/src : lowcomms.c memory.c 
	gfs-kernel/src/dlm: lock_dlm.h 
	gfs-kernel/src/gfs: diaper.c dir.c file.c file.h gfs.h glock.c 
	                    inode.c ioctl.c ops_file.c ops_fstype.c 
	                    ops_inode.c ops_super.c recovery.c util.c 
	                    util.h 
	gfs-kernel/src/gulm: gulm.h gulm_fs.c handler.h 
	gfs-kernel/src/harness: main.c 
	gfs-kernel/src/nolock: main.c 
	gnbd-kernel/src: gnbd.c 

Log message:
	Bring the STABLE branch of cluster suite up to the 2.6.20-rc7 and
	similar kernels.  This also includes Wendy Cheng's GFS kernel change
	for Asynch IO (aio) and fixes a kernel panic reported on the
	linux-cluster mailing list.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/lib/libcman.c.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.3.6.1.2.5&r2=1.3.6.1.2.6
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/lib/libcman.h.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.2.6.1.2.6&r2=1.2.6.1.2.7
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman-kernel/src/cnxman.c.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.42.2.12.4.1.2.14&r2=1.42.2.12.4.1.2.15
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/dlm-kernel/src/lowcomms.c.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.22.2.8.4.2.2.2&r2=1.22.2.8.4.2.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/dlm-kernel/src/memory.c.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.3&r2=1.3.8.1
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/dlm/lock_dlm.h.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.18.2.3.6.3&r2=1.18.2.3.6.4
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/diaper.c.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.1.2.1.4.1.2.1&r2=1.1.2.1.4.1.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/dir.c.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.8.6.1.2.3&r2=1.8.6.1.2.4
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/file.c.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.4.6.1.2.1&r2=1.4.6.1.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/file.h.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.2.8.1&r2=1.2.8.2
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/gfs.h.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.5.6.1&r2=1.5.6.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/glock.c.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.20.2.1.4.1.2.2&r2=1.20.2.1.4.1.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/inode.c.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.20.6.2.2.2&r2=1.20.6.2.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/ioctl.c.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.7.6.1.2.2&r2=1.7.6.1.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/ops_file.c.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.16.6.2.2.7&r2=1.16.6.2.2.8
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/ops_fstype.c.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.13.2.1.4.2.2.3&r2=1.13.2.1.4.2.2.4
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/ops_inode.c.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.6.6.1.2.5&r2=1.6.6.1.2.6
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/ops_super.c.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.12.2.1.4.2.2.2&r2=1.12.2.1.4.2.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/recovery.c.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.5.8.1&r2=1.5.8.2
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/util.c.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.9.2.1&r2=1.9.2.1.6.1
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/util.h.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.7.8.1&r2=1.7.8.2
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gulm/gulm.h.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.11.6.1&r2=1.11.6.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gulm/gulm_fs.c.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.15.2.1&r2=1.15.2.1.6.1
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gulm/handler.h.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.1&r2=1.1.8.1
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/harness/main.c.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.3&r2=1.3.8.1
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/nolock/main.c.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.4.6.2.2.1&r2=1.4.6.2.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gnbd-kernel/src/gnbd.c.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.6.6.1.2.4&r2=1.6.6.1.2.5

--- cluster/cman/lib/libcman.c	2006/04/26 08:55:26	1.3.6.1.2.5
+++ cluster/cman/lib/libcman.c	2007/02/07 15:25:04	1.3.6.1.2.6
@@ -501,3 +501,7 @@
 	return ioctl(h->fd, SIOCCLUSTER_SET_VOTES, nodeid, sizeof(int));
 }
 
+int cman_replyto_shutdown(cman_handle_t handle, int yesno)
+{
+	return 0;
+}
--- cluster/cman/lib/libcman.h	2006/09/01 08:37:10	1.2.6.1.2.6
+++ cluster/cman/lib/libcman.h	2007/02/07 15:25:04	1.2.6.1.2.7
@@ -162,4 +162,5 @@
 int cman_unregister_quorum_device(cman_handle_t handle);
 int cman_poll_quorum_device(cman_handle_t handle, int isavailable);
 
+int cman_replyto_shutdown(cman_handle_t handle, int yesno);
 #endif
--- cluster/cman-kernel/src/Attic/cnxman.c	2007/01/19 10:24:46	1.42.2.12.4.1.2.14
+++ cluster/cman-kernel/src/Attic/cnxman.c	2007/02/07 15:25:04	1.42.2.12.4.1.2.15
@@ -1760,7 +1760,7 @@
 
 	/* Make sure we have a node name */
 	if (nodename[0] == '\0')
-		strcpy(nodename, system_utsname.nodename);
+			strcpy(nodename, init_utsname()->nodename);
 
 	membership_pid = start_membership_services(kcluster_pid);
 	if (membership_pid < 0) {
--- cluster/dlm-kernel/src/Attic/lowcomms.c	2005/12/20 09:22:04	1.22.2.8.4.2.2.2
+++ cluster/dlm-kernel/src/Attic/lowcomms.c	2007/02/07 15:25:04	1.22.2.8.4.2.2.3
@@ -133,7 +133,7 @@
 /* An array of pointers to connections, indexed by NODEID */
 static struct connection **connections;
 static struct semaphore connections_lock;
-static kmem_cache_t *con_cache;
+static struct kmem_cache *con_cache;
 static int conn_array_size;
 static atomic_t accepting;
 
--- cluster/dlm-kernel/src/Attic/memory.c	2004/07/15 07:45:57	1.3
+++ cluster/dlm-kernel/src/Attic/memory.c	2007/02/07 15:25:04	1.3.8.1
@@ -24,12 +24,12 @@
 /* as the man says...Shouldn't this be in a header file somewhere? */
 #define	BYTES_PER_WORD		sizeof(void *)
 
-static kmem_cache_t *rsb_cache_small;
-static kmem_cache_t *rsb_cache_large;
-static kmem_cache_t *lkb_cache;
-static kmem_cache_t *lvb_cache;
-static kmem_cache_t *resdir_cache_large;
-static kmem_cache_t *resdir_cache_small;
+static struct kmem_cache *rsb_cache_small;
+static struct kmem_cache *rsb_cache_large;
+static struct kmem_cache *lkb_cache;
+static struct kmem_cache *lvb_cache;
+static struct kmem_cache *resdir_cache_large;
+static struct kmem_cache *resdir_cache_small;
 
 /* The thresholds above which we allocate large RSBs/direntry rather than small 
  * ones. This must make the resultant structure end on a word boundary */
--- cluster/gfs-kernel/src/dlm/Attic/lock_dlm.h	2006/12/08 17:27:44	1.18.2.3.6.3
+++ cluster/gfs-kernel/src/dlm/Attic/lock_dlm.h	2007/02/07 15:25:05	1.18.2.3.6.4
@@ -24,10 +24,11 @@
 #include <linux/socket.h>
 #include <linux/kthread.h>
 #include <net/sock.h>
-#include <linux/lm_interface.h>
-#include <cluster/cnxman.h>
-#include <cluster/service.h>
-#include <cluster/dlm.h>
+
+#include "lm_interface.h"
+#include "cluster/cnxman.h"
+#include "cluster/service.h"
+#include "cluster/dlm.h"
 
 /* We take a shortcut and use lm_lockname structs for internal locks.  This
    means we must be careful to keep these types different from those used in
--- cluster/gfs-kernel/src/gfs/Attic/diaper.c	2006/06/26 21:53:51	1.1.2.1.4.1.2.1
+++ cluster/gfs-kernel/src/gfs/Attic/diaper.c	2007/02/07 15:25:05	1.1.2.1.4.1.2.2
@@ -50,7 +50,7 @@
 static LIST_HEAD(diaper_list);
 static spinlock_t diaper_lock;
 static DEFINE_IDR(diaper_idr);
-kmem_cache_t *diaper_slab;
+struct kmem_cache *diaper_slab;
 
 /**
  * diaper_open -
@@ -232,9 +232,9 @@
 	struct inode *inode;
 	int error;
 
-	mutex_lock(&real->bd_mount_mutex);
+	down(&real->bd_mount_sem);
 	sb = sget(&gfs_fs_type, gfs_test_bdev_super, gfs_set_bdev_super, real);
-	mutex_unlock(&real->bd_mount_mutex);
+	up(&real->bd_mount_sem);
 	if (IS_ERR(sb))
 		return PTR_ERR(sb);
 
@@ -252,7 +252,6 @@
 	sb->s_op = &gfs_dummy_sops;
 	sb->s_fs_info = dh;
 
-	up_write(&sb->s_umount);
 	module_put(gfs_fs_type.owner);
 
 	dh->dh_dummy_sb = sb;
@@ -263,7 +262,6 @@
 	iput(inode);
 
  fail:
-	up_write(&sb->s_umount);
 	deactivate_super(sb);
 	return error;
 }
--- cluster/gfs-kernel/src/gfs/dir.c	2006/06/29 16:50:41	1.8.6.1.2.3
+++ cluster/gfs-kernel/src/gfs/dir.c	2007/02/07 15:25:05	1.8.6.1.2.4
@@ -2213,7 +2213,7 @@
 		dip->i_di.di_blocks--;
 	}
 
-	error = gfs_writei(dip, ht, index * sizeof (uint64_t), size, gfs_zero_blocks);
+	error = gfs_writei(dip, ht, index * sizeof (uint64_t), size, gfs_zero_blocks, NULL);
 
 	if (error != size) {
 		if (error >= 0)
--- cluster/gfs-kernel/src/gfs/file.c	2006/02/20 03:55:31	1.4.6.1.2.1
+++ cluster/gfs-kernel/src/gfs/file.c	2007/02/07 15:25:05	1.4.6.1.2.2
@@ -305,8 +305,9 @@
 
 int
 gfs_writei(struct gfs_inode *ip, void *buf,
-	   uint64_t offset, unsigned int size,
-	   write_copy_fn_t copy_fn)
+		   uint64_t offset, unsigned int size,
+		   write_copy_fn_t copy_fn,
+		   struct kiocb *iocb)
 {
 	struct gfs_sbd *sdp = ip->i_sbd;
 	struct buffer_head *dibh, *bh;
--- cluster/gfs-kernel/src/gfs/file.h	2006/02/20 03:55:31	1.2.8.1
+++ cluster/gfs-kernel/src/gfs/file.h	2007/02/07 15:25:05	1.2.8.2
@@ -32,7 +32,8 @@
 int gfs_copy_from_user(struct gfs_inode *ip, struct buffer_head *bh, void **buf,
 		       unsigned int offset, unsigned int size, int new);
 int gfs_writei(struct gfs_inode *ip, void *buf, uint64_t offset,
-	       unsigned int size, write_copy_fn_t copy_fn);
+			   unsigned int size, write_copy_fn_t copy_fn,
+			   struct kiocb *iocb);
 
 int gfs_zero_blocks(struct gfs_inode *ip, struct buffer_head *bh, void **buf,
 		    unsigned int offset, unsigned int size, int new);
@@ -48,7 +49,7 @@
 gfs_internal_write(struct gfs_inode *ip, char *buf, uint64_t offset,
 		   unsigned int size)
 {
-	return gfs_writei(ip, buf, offset, size, gfs_copy_from_mem);
+	return gfs_writei(ip, buf, offset, size, gfs_copy_from_mem, NULL);
 }
 
 #endif /* __FILE_DOT_H__ */
--- cluster/gfs-kernel/src/gfs/gfs.h	2005/04/26 18:33:10	1.5.6.1
+++ cluster/gfs-kernel/src/gfs/gfs.h	2007/02/07 15:25:05	1.5.6.1.2.1
@@ -16,9 +16,9 @@
 
 #define GFS_RELEASE_NAME "<CVS>"
 
-#include <linux/lm_interface.h>
 #include <linux/gfs_ondisk.h>
 
+#include "lm_interface.h"
 #include "fixed_div64.h"
 #include "lvb.h"
 #include "incore.h"
@@ -67,8 +67,8 @@
 
 #define get_v2sdp(sb) ((struct gfs_sbd *)(sb)->s_fs_info)
 #define set_v2sdp(sb, sdp) (sb)->s_fs_info = (sdp)
-#define get_v2ip(inode) ((struct gfs_inode *)(inode)->u.generic_ip)
-#define set_v2ip(inode, ip) (inode)->u.generic_ip = (ip)
+#define get_v2ip(inode) ((struct gfs_inode *)(inode)->i_private)
+#define set_v2ip(inode, ip) (inode)->i_private = (ip)
 #define get_v2fp(file) ((struct gfs_file *)(file)->private_data)
 #define set_v2fp(file, fp) (file)->private_data = (fp)
 #define get_v2bd(bh) ((struct gfs_bufdata *)(bh)->b_private)
--- cluster/gfs-kernel/src/gfs/glock.c	2006/05/17 15:28:24	1.20.2.1.4.1.2.2
+++ cluster/gfs-kernel/src/gfs/glock.c	2007/02/07 15:25:05	1.20.2.1.4.1.2.3
@@ -38,7 +38,7 @@
 
 struct greedy {
 	struct gfs_holder gr_gh;
-	struct work_struct gr_work;
+	struct delayed_work gr_work;
 };
 
 typedef void (*glock_examiner) (struct gfs_glock * gl);
@@ -1747,9 +1747,9 @@
  */
 
 static void
-greedy_work(void *data)
+greedy_work(struct work_struct *work)
 {
-	struct greedy *gr = (struct greedy *)data;
+	struct greedy *gr = container_of(work, struct greedy, gr_work.work);
 	struct gfs_holder *gh = &gr->gr_gh;
 	struct gfs_glock *gl = gh->gh_gl;
 	struct gfs_glock_operations *glops = gl->gl_ops;
@@ -1804,7 +1804,7 @@
 	gfs_holder_init(gl, 0, 0, gh);
 	set_bit(HIF_GREEDY, &gh->gh_iflags);
 	gh->gh_owner = NULL;
-	INIT_WORK(&gr->gr_work, greedy_work, gr);
+	INIT_DELAYED_WORK(&gr->gr_work, greedy_work);
 
 	set_bit(GLF_SKIP_WAITERS2, &gl->gl_flags);
 	schedule_delayed_work(&gr->gr_work, time);
--- cluster/gfs-kernel/src/gfs/inode.c	2005/09/18 03:01:24	1.20.6.2.2.2
+++ cluster/gfs-kernel/src/gfs/inode.c	2007/02/07 15:25:05	1.20.6.2.2.3
@@ -97,7 +97,6 @@
 	inode->i_mtime.tv_sec = ip->i_di.di_mtime;
 	inode->i_ctime.tv_sec = ip->i_di.di_ctime;
 	inode->i_atime.tv_nsec = inode->i_mtime.tv_nsec = inode->i_ctime.tv_nsec = 0;
-	inode->i_blksize = PAGE_SIZE;
 	inode->i_blocks = ip->i_di.di_blocks <<
 		(ip->i_sbd->sd_sb.sb_bsize_shift - GFS_BASIC_BLOCK_SHIFT);
 	inode->i_generation = ip->i_di.di_header.mh_incarn;
--- cluster/gfs-kernel/src/gfs/ioctl.c	2006/11/13 22:48:06	1.7.6.1.2.2
+++ cluster/gfs-kernel/src/gfs/ioctl.c	2007/02/07 15:25:05	1.7.6.1.2.3
@@ -1231,7 +1231,7 @@
 	}
 
 	error = gfs_writei(ip, gi->gi_data, gi->gi_offset, gi->gi_size,
-			   gfs_copy_from_user);
+					   gfs_copy_from_user, NULL);
 
 	gfs_trans_end(sdp);
 
--- cluster/gfs-kernel/src/gfs/ops_file.c	2007/01/17 22:30:12	1.16.6.2.2.7
+++ cluster/gfs-kernel/src/gfs/ops_file.c	2007/02/07 15:25:05	1.16.6.2.2.8
@@ -74,9 +74,10 @@
 };
 
 typedef ssize_t(*do_rw_t) (struct file * file,
-			   char *buf,
-			   size_t size, loff_t * offset,
-			   unsigned int num_gh, struct gfs_holder * ghs);
+						   char *buf,
+						   size_t size, loff_t * offset,
+                           struct kiocb *iocb,
+						   unsigned int num_gh, struct gfs_holder * ghs);
 
 /**
  * gfs_llseek - seek to a location in a file
@@ -129,7 +130,7 @@
 
 static ssize_t
 walk_vm_hard(struct file *file, char *buf, size_t size, loff_t *offset,
-	     do_rw_t operation)
+	     struct kiocb *iocb, do_rw_t operation)
 {
 	struct gfs_holder *ghs;
 	unsigned int num_gh = 0;
@@ -178,7 +179,7 @@
 		gfs_assert(get_v2sdp(sb), x == num_gh,);
 	}
 
-	count = operation(file, buf, size, offset, num_gh, ghs);
+	count = operation(file, buf, size, offset, iocb, num_gh, ghs);
 
 	while (num_gh--)
 		gfs_holder_uninit(&ghs[num_gh]);
@@ -204,7 +205,7 @@
 
 static ssize_t
 walk_vm(struct file *file, char *buf, size_t size, loff_t *offset,
-	do_rw_t operation)
+		struct kiocb *iocb,	do_rw_t operation)
 {
 	if (current->mm) {
 		struct super_block *sb = file->f_dentry->d_inode->i_sb;
@@ -231,11 +232,11 @@
 
 	{
 		struct gfs_holder gh;
-		return operation(file, buf, size, offset, 0, &gh);
+		return operation(file, buf, size, offset, iocb, 0, &gh);
 	}
 
  do_locks:
-	return walk_vm_hard(file, buf, size, offset, operation);
+	return walk_vm_hard(file, buf, size, offset,  iocb, operation);
 }
 
 /**
@@ -250,7 +251,8 @@
  */
 
 static ssize_t
-do_read_readi(struct file *file, char *buf, size_t size, loff_t *offset)
+do_read_readi(struct file *file, char *buf, size_t size, loff_t *offset,
+			  struct kiocb *iocb)
 {
 	struct gfs_inode *ip = get_v2ip(file->f_mapping->host);
 	ssize_t count = 0;
@@ -291,7 +293,8 @@
 
 static ssize_t
 do_read_direct(struct file *file, char *buf, size_t size, loff_t *offset,
-	       unsigned int num_gh, struct gfs_holder *ghs)
+			   struct kiocb *iocb,
+			   unsigned int num_gh, struct gfs_holder *ghs)
 {
 	struct inode *inode = file->f_mapping->host;
 	struct gfs_inode *ip = get_v2ip(inode);
@@ -324,10 +327,18 @@
 		if (((*offset) & mask) || (((unsigned long)buf) & mask))
 			goto out_gunlock;
 
-		count = do_read_readi(file, buf, size & ~mask, offset);
+		count = do_read_readi(file, buf, size & ~mask, offset, iocb);
+	}
+	else {
+		if (!iocb)
+			count = do_sync_read(file, buf, size, offset);
+		else {
+			struct iovec local_iov = { .iov_base = buf, .iov_len = size};
+
+			count = generic_file_aio_read(iocb, &local_iov, 1, *offset);
+			iocb->ki_pos = *offset;
+		}
 	}
-	else
-		count = generic_file_read(file, buf, size, offset);
 
 	error = 0;
 
@@ -356,7 +367,8 @@
 
 static ssize_t
 do_read_buf(struct file *file, char *buf, size_t size, loff_t *offset,
-	    unsigned int num_gh, struct gfs_holder *ghs)
+			struct kiocb *iocb,
+			unsigned int num_gh, struct gfs_holder *ghs)
 {
 	struct gfs_inode *ip = get_v2ip(file->f_mapping->host);
 	ssize_t count = 0;
@@ -370,9 +382,17 @@
 
 	if (gfs_is_jdata(ip) ||
 	    (gfs_is_stuffed(ip) && !test_bit(GIF_PAGED, &ip->i_flags)))
-		count = do_read_readi(file, buf, size, offset);
-	else
-		count = generic_file_read(file, buf, size, offset);
+		count = do_read_readi(file, buf, size, offset, iocb);
+	else {
+		if (!iocb) {
+			count = do_sync_read(file, buf, size, offset);
+		} else {
+			struct iovec local_iov = { .iov_base = buf, .iov_len = size};
+
+			count = generic_file_aio_read(iocb, &local_iov, 1, *offset);
+			iocb->ki_pos = *offset;
+		}
+	}
 
 	gfs_glock_dq_m(num_gh + 1, ghs);
 
@@ -382,6 +402,18 @@
 	return (count) ? count : error;
 }
 
+static ssize_t
+__gfs_read(struct file *file, char *buf, size_t size, loff_t *offset,
+		 struct kiocb *iocb)
+{
+	atomic_inc(&get_v2sdp(file->f_mapping->host->i_sb)->sd_ops_file);
+
+	if (file->f_flags & O_DIRECT)
+		return walk_vm(file, buf, size, offset, iocb, do_read_direct);
+	else
+		return walk_vm(file, buf, size, offset, iocb, do_read_buf);
+}
+
 /**
  * gfs_read - Read bytes from a file
  * @file: The file to read from
@@ -397,12 +429,21 @@
 static ssize_t
 gfs_read(struct file *file, char *buf, size_t size, loff_t *offset)
 {
-	atomic_inc(&get_v2sdp(file->f_mapping->host->i_sb)->sd_ops_file);
+	return(__gfs_read(file, buf, size, offset, NULL));
+}
 
-	if (file->f_flags & O_DIRECT)
-		return walk_vm(file, buf, size, offset, do_read_direct);
-	else
-		return walk_vm(file, buf, size, offset, do_read_buf);
+/*
+ * gfs_aio_read: match with vfs generic_file_aio_read as:
+ * 	(struct kiocb *iocb, char __user *buf, size_t count, loff_t pos)
+ */
+static ssize_t
+gfs_aio_read(struct kiocb *iocb, const struct iovec *iov, unsigned long count,
+			 loff_t pos)
+{
+	struct file *filp = iocb->ki_filp;
+
+	BUG_ON(iocb->ki_pos != pos);
+	return(__gfs_read(filp, iov->iov_base, iov->iov_len, &iocb->ki_pos, iocb));
 }
 
 /**
@@ -437,6 +478,41 @@
 }
 
 /**
+ * gfs_file_aio_write_nolock - Call vfs aio layer to write bytes to a file
+ * @file: The file to write to
+ * @buf: The buffer to copy from
+ * @size: The amount of data requested
+ * @offset: The offset in the file to write
+ * @iocb: The io control block.  If NULL, a temporary one will be used.
+ *
+ * Returns: The number of bytes written, errno on failure
+ */
+static ssize_t
+gfs_file_aio_write_nolock(struct file *file, char *buf, size_t size,
+						  loff_t *offset, struct kiocb *iocb)
+{
+	struct iovec local_iov = { .iov_base = buf, .iov_len = size };
+	struct kiocb local_iocb, *kiocb = NULL;
+	ssize_t count;
+
+	if (!iocb) {
+		init_sync_kiocb(&local_iocb, file);
+		local_iocb.ki_nr_segs = 1;
+		kiocb = &local_iocb;
+	}
+	else
+		kiocb = iocb;
+	
+	kiocb->ki_pos = *offset;
+	count = generic_file_aio_write_nolock(kiocb, &local_iov, kiocb->ki_nr_segs,
+										  kiocb->ki_pos);
+	*offset = kiocb->ki_pos;
+	if (kiocb == &local_iocb && count == -EIOCBQUEUED)
+		count = wait_on_sync_kiocb(kiocb);
+	return count;
+}
+
+/**
  * do_write_direct_alloc - Write bytes to a file
  * @file: The file to write to
  * @buf: The buffer to copy from
@@ -449,13 +525,13 @@
  */
 
 static ssize_t
-do_write_direct_alloc(struct file *file, char *buf, size_t size, loff_t *offset)
+do_write_direct_alloc(struct file *file, char *buf, size_t size, loff_t *offset,
+			struct kiocb *iocb)
 {
 	struct inode *inode = file->f_mapping->host;
 	struct gfs_inode *ip = get_v2ip(inode);
 	struct gfs_sbd *sdp = ip->i_sbd;
 	struct gfs_alloc *al = NULL;
-	struct iovec local_iov = { .iov_base = buf, .iov_len = size };
 	struct buffer_head *dibh;
 	unsigned int data_blocks, ind_blocks;
 	ssize_t count;
@@ -508,7 +584,7 @@
 			goto fail_end_trans;
 	}
 
-	count = generic_file_write_nolock(file, &local_iov, 1, offset);
+	count = gfs_file_aio_write_nolock(file, buf, size, offset, iocb);
 	if (count < 0) {
 		error = count;
 		goto fail_end_trans;
@@ -576,6 +652,7 @@
 
 static ssize_t
 do_write_direct(struct file *file, char *buf, size_t size, loff_t *offset,
+		struct kiocb *iocb,
 		unsigned int num_gh, struct gfs_holder *ghs)
 {
 	struct gfs_inode *ip = get_v2ip(file->f_mapping->host);
@@ -646,13 +723,19 @@
 	if (alloc_required) {
 		set_bit(GFF_DID_DIRECT_ALLOC, &fp->f_flags);
 
+		/* for asynchronous IO, the buffer can not be splitted */
+		if (iocb) {
+			count = do_write_direct_alloc(file, buf, size, offset, iocb);
+			goto out_iocb_write;
+		}
+
 		/* split large writes into smaller atomic transactions */
 		while (size) {
 			s = gfs_tune_get(sdp, gt_max_atomic_write);
 			if (s > size)
 				s = size;
 
-			error = do_write_direct_alloc(file, buf, s, offset);
+			error = do_write_direct_alloc(file, buf, s, offset, iocb);
 			if (error < 0)
 				goto out_gunlock;
 
@@ -661,7 +744,6 @@
 			count += error;
 		}
 	} else {
-		struct iovec local_iov = { .iov_base = buf, .iov_len = size };
 		struct gfs_holder t_gh;
 
 		clear_bit(GFF_DID_DIRECT_ALLOC, &fp->f_flags);
@@ -670,17 +752,17 @@
 		if (error)
 			goto out_gunlock;
 
-		count = generic_file_write_nolock(file, &local_iov, 1, offset);
-
+		count = gfs_file_aio_write_nolock(file, buf, size, offset, iocb);
 		gfs_glock_dq_uninit(&t_gh);
 	}
 
+out_iocb_write:
 	error = 0;
 
-      out_gunlock:
+out_gunlock:
 	gfs_glock_dq_m(num_gh + 1, ghs);
 
-      out:
+out:
 	gfs_holder_uninit(&ghs[num_gh]);
 
 	return (count) ? count : error;
@@ -699,7 +781,8 @@
  */
 
 static ssize_t
-do_do_write_buf(struct file *file, char *buf, size_t size, loff_t *offset)
+do_do_write_buf(struct file *file, char *buf, size_t size, loff_t *offset,
+				struct kiocb *iocb)
 {
 	struct inode *inode = file->f_mapping->host;
 	struct gfs_inode *ip = get_v2ip(inode);
@@ -777,7 +860,7 @@
 	    (gfs_is_stuffed(ip) && !test_bit(GIF_PAGED, &ip->i_flags) &&
 	     *offset + size <= sdp->sd_sb.sb_bsize - sizeof(struct gfs_dinode))) {
 
-		count = gfs_writei(ip, buf, *offset, size, gfs_copy_from_user);
+		count = gfs_writei(ip, buf, *offset, size, gfs_copy_from_user, iocb);
 		if (count < 0) {
 			error = count;
 			goto fail_end_trans;
@@ -792,9 +875,7 @@
 		}
 		*offset += count;
 	} else {
-		struct iovec local_iov = { .iov_base = buf, .iov_len = size };
-
-		count = generic_file_write_nolock(file, &local_iov, 1, offset);
+		count = gfs_file_aio_write_nolock(file, buf, size, offset, iocb);
 		if (count < 0) {
 			error = count;
 			goto fail_end_trans;
@@ -869,8 +950,9 @@
 
 static ssize_t
 do_write_buf(struct file *file,
-	     char *buf, size_t size, loff_t *offset,
-	     unsigned int num_gh, struct gfs_holder *ghs)
+			 char *buf, size_t size, loff_t *offset,
+			 struct kiocb *iocb,
+			 unsigned int num_gh, struct gfs_holder *ghs)
 {
 	struct gfs_inode *ip = get_v2ip(file->f_mapping->host);
 	struct gfs_sbd *sdp = ip->i_sbd;
@@ -907,7 +989,7 @@
 		if (s > size)
 			s = size;
 
-		error = do_do_write_buf(file, buf, s, offset);
+		error = do_do_write_buf(file, buf, s, offset, iocb);
 		if (error < 0)
 			goto out_gunlock;
 
@@ -940,7 +1022,7 @@
  */
 
 static ssize_t
-gfs_write(struct file *file, const char *buf, size_t size, loff_t *offset)
+__gfs_write(struct file *file, const char *buf, size_t size, loff_t *offset, struct kiocb *iocb)
 {
 	struct inode *inode = file->f_mapping->host;
 	ssize_t count;
@@ -954,14 +1036,32 @@
 
 	mutex_lock(&inode->i_mutex);
 	if (file->f_flags & O_DIRECT)
-		count = walk_vm(file, (char *)buf, size, offset, do_write_direct);
+		count = walk_vm(file, (char *)buf, size, offset, iocb, do_write_direct);
 	else
-		count = walk_vm(file, (char *)buf, size, offset, do_write_buf);
+		count = walk_vm(file, (char *)buf, size, offset, iocb, do_write_buf);
 	mutex_unlock(&inode->i_mutex);
 
 	return count;
 }
 
+static ssize_t
+gfs_write(struct file *file, const char *buf, size_t size, loff_t *offset)
+{
+	return(__gfs_write(file, buf, size, offset, NULL));
+}
+
+static ssize_t
+gfs_aio_write(struct kiocb *iocb, const struct iovec *iov, unsigned long segs,
+			  loff_t pos)
+{
+	struct file *file = iocb->ki_filp;
+
+	BUG_ON(iocb->ki_pos != pos);
+
+	return(__gfs_write(file, iov->iov_base, iov->iov_len, &iocb->ki_pos, 
+					   iocb));
+}
+
 /**
  * filldir_reg_func - Report a directory entry to the caller of gfs_dir_read()
  * @opaque: opaque data used by the function
@@ -1647,6 +1747,8 @@
 	.llseek = gfs_llseek,
 	.read = gfs_read,
 	.write = gfs_write,
+	.aio_read = gfs_aio_read,
+	.aio_write = gfs_aio_write,
 	.ioctl = gfs_ioctl,
 	.mmap = gfs_mmap,
 	.open = gfs_open,
--- cluster/gfs-kernel/src/gfs/ops_fstype.c	2006/06/29 16:50:41	1.13.2.1.4.2.2.3
+++ cluster/gfs-kernel/src/gfs/ops_fstype.c	2007/02/07 15:25:05	1.13.2.1.4.2.2.4
@@ -2,7 +2,7 @@
 *******************************************************************************
 **
 **  Copyright (C) Sistina Software, Inc.  1997-2003  All rights reserved.
-**  Copyright (C) 2004 Red Hat, Inc.  All rights reserved.
+**  Copyright (C) 2004-2007 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
@@ -29,6 +29,7 @@
 #include "inode.h"
 #include "lm.h"
 #include "mount.h"
+#include "ops_dentry.h"
 #include "ops_export.h"
 #include "ops_fstype.h"
 #include "ops_super.h"
@@ -492,6 +493,7 @@
 		error = -ENOMEM;
 		goto fail_li_free;
 	}
+	sb->s_root->d_op = &gfs_dops;
 
 	/*  Start up the logd thread  */
 
@@ -679,9 +681,8 @@
  * Returns: the new superblock
  */
 
-struct super_block *
-gfs_get_sb(struct file_system_type *fs_type, int flags,
-	   const char *dev_name, void *data)
+static int gfs_get_sb(struct file_system_type *fs_type, int flags,
+					  const char *dev_name, void *data, struct vfsmount *mnt)
 {
 	struct block_device *real, *diaper;
 	struct super_block *sb;
@@ -689,17 +690,17 @@
 
 	real = open_bdev_excl(dev_name, flags, fs_type);
 	if (IS_ERR(real))
-		return (struct super_block *)real;
+		return PTR_ERR(real);
 
 	diaper = gfs_diaper_get(real, flags);
 	if (IS_ERR(diaper)) {
 		close_bdev_excl(real);
-		return (struct super_block *)diaper;
+		return PTR_ERR(diaper);
 	}
 
-	mutex_lock(&diaper->bd_mount_mutex);
+	down(&diaper->bd_mount_sem);
 	sb = sget(fs_type, gfs_test_bdev_super, gfs_set_bdev_super, diaper);
-	mutex_unlock(&diaper->bd_mount_mutex);
+	up(&diaper->bd_mount_sem);
 	if (IS_ERR(sb))
 		goto out;
 
@@ -723,14 +724,20 @@
 			sb = ERR_PTR(error);
 		} else
 			sb->s_flags |= MS_ACTIVE;
+		if (real->bd_disk) {
+			if (real->bd_part)
+				kobject_uevent(&real->bd_part->kobj, KOBJ_MOUNT);
+			else
+				kobject_uevent(&real->bd_disk->kobj, KOBJ_MOUNT);
+		}
 	}
 
-	return sb;
+	return simple_set_mnt(mnt, sb);
 
  out:
 	gfs_diaper_put(diaper);
 	close_bdev_excl(real);
-	return sb;
+	return simple_set_mnt(mnt, sb);
 }
 
 /**
@@ -752,6 +759,13 @@
 	set_blocksize(diaper, bsize);
 	set_blocksize(real, bsize);
 	gfs_diaper_put(diaper);
+	if (real->bd_disk) {
+		if (real->bd_part)
+			kobject_uevent(&real->bd_part->kobj, KOBJ_UMOUNT);
+		else
+			kobject_uevent(&real->bd_disk->kobj, KOBJ_UMOUNT);
+	}
+	sync_blockdev(real);
 	close_bdev_excl(real);
 }
 
--- cluster/gfs-kernel/src/gfs/ops_inode.c	2006/08/16 14:40:54	1.6.6.1.2.5
+++ cluster/gfs-kernel/src/gfs/ops_inode.c	2007/02/07 15:25:05	1.6.6.1.2.6
@@ -171,22 +171,22 @@
 	parent = dget_parent(dentry);
 
 	if (gfs_filecmp(&dentry->d_name, "@hostname", 9))
-		new = lookup_one_len(system_utsname.nodename,
+		new = lookup_one_len(init_utsname()->nodename,
 				     parent,
-				     strlen(system_utsname.nodename));
+				     strlen(init_utsname()->nodename));
 	else if (gfs_filecmp(&dentry->d_name, "@nodeid", 7))
 		new = lookup_one_len(buf, 
 				     parent, 
 				     sprintf(buf, "%s%i", "node", 
 					     get_my_nodeid()));
 	else if (gfs_filecmp(&dentry->d_name, "@mach", 5))
-		new = lookup_one_len(system_utsname.machine,
+		new = lookup_one_len(init_utsname()->machine,
 				     parent,
-				     strlen(system_utsname.machine));
+				     strlen(init_utsname()->machine));
 	else if (gfs_filecmp(&dentry->d_name, "@os", 3))
-		new = lookup_one_len(system_utsname.sysname,
+		new = lookup_one_len(init_utsname()->sysname,
 				     parent,
-				     strlen(system_utsname.sysname));
+				     strlen(init_utsname()->sysname));
 	else if (gfs_filecmp(&dentry->d_name, "@uid", 4))
 		new = lookup_one_len(buf,
 				     parent,
@@ -199,8 +199,8 @@
 		new = lookup_one_len(buf,
 				     parent,
 				     sprintf(buf, "%s_%s",
-					     system_utsname.machine,
-					     system_utsname.sysname));
+					     init_utsname()->machine,
+					     init_utsname()->sysname));
 	else if (gfs_filecmp(&dentry->d_name, "@jid", 4))
 		new = lookup_one_len(buf,
 				     parent,
@@ -235,22 +235,22 @@
 	parent = dget_parent(dentry);
 
 	if (gfs_filecmp(&dentry->d_name, "{hostname}", 10))
-		new = lookup_one_len(system_utsname.nodename,
+		new = lookup_one_len(init_utsname()->nodename,
 				     parent,
-				     strlen(system_utsname.nodename));
+				     strlen(init_utsname()->nodename));
 	else if (gfs_filecmp(&dentry->d_name, "{nodeid}", 8))
 		new = lookup_one_len(buf,
 				     parent,
 				     sprintf(buf, "%s%i", "node",
 					     get_my_nodeid()));
 	else if (gfs_filecmp(&dentry->d_name, "{mach}", 6))
-		new = lookup_one_len(system_utsname.machine,
+		new = lookup_one_len(init_utsname()->machine,
 				     parent,
-				     strlen(system_utsname.machine));
+				     strlen(init_utsname()->machine));
 	else if (gfs_filecmp(&dentry->d_name, "{os}", 4))
-		new = lookup_one_len(system_utsname.sysname,
+		new = lookup_one_len(init_utsname()->sysname,
 				     parent,
-				     strlen(system_utsname.sysname));
+				     strlen(init_utsname()->sysname));
 	else if (gfs_filecmp(&dentry->d_name, "{uid}", 5))
 		new = lookup_one_len(buf,
 				     parent,
@@ -263,8 +263,8 @@
 		new = lookup_one_len(buf,
 				     parent,
 				     sprintf(buf, "%s_%s",
-					     system_utsname.machine,
-					     system_utsname.sysname));
+					     init_utsname()->machine,
+					     init_utsname()->sysname));
 	else if (gfs_filecmp(&dentry->d_name, "{jid}", 5))
 		new = lookup_one_len(buf,
 				     parent,
--- cluster/gfs-kernel/src/gfs/ops_super.c	2006/02/15 22:49:19	1.12.2.1.4.2.2.2
+++ cluster/gfs-kernel/src/gfs/ops_super.c	2007/02/07 15:25:05	1.12.2.1.4.2.2.3
@@ -275,8 +275,9 @@
  */
 
 static int
-gfs_statfs(struct super_block *sb, struct kstatfs *buf)
+gfs_statfs(struct dentry *dentry, struct kstatfs *buf)
 {
+	struct super_block *sb = dentry->d_inode->i_sb;
 	struct gfs_sbd *sdp = get_v2sdp(sb);
 	struct gfs_stat_gfs sg;
 	int error;
--- cluster/gfs-kernel/src/gfs/recovery.c	2006/02/15 22:46:43	1.5.8.1
+++ cluster/gfs-kernel/src/gfs/recovery.c	2007/02/07 15:25:05	1.5.8.2
@@ -548,7 +548,7 @@
 }
 
 /**
- * gfs_recover_journal - recovery a given journal
+ * gfs_recover_journal - recover a given journal
  * @sdp: the filesystem
  * @jid: the number of the journal to recover
  * @jdesc: the struct gfs_jindex describing the journal
@@ -573,7 +573,7 @@
 	printk("GFS: fsid=%s: jid=%u: Trying to acquire journal lock...\n",
 	       sdp->sd_fsname, jid);
 
-	/*  Aquire the journal lock so we can do recovery  */
+	/*  Acquire the journal lock so we can do recovery  */
 
 	error = gfs_glock_nq_num(sdp,
 				 jdesc->ji_addr, &gfs_meta_glops,
--- cluster/gfs-kernel/src/gfs/util.c	2005/03/22 15:54:09	1.9.2.1
+++ cluster/gfs-kernel/src/gfs/util.c	2007/02/07 15:25:05	1.9.2.1.6.1
@@ -26,10 +26,10 @@
 
 uint32_t gfs_random_number;
 
-kmem_cache_t *gfs_glock_cachep = NULL;
-kmem_cache_t *gfs_inode_cachep = NULL;
-kmem_cache_t *gfs_bufdata_cachep = NULL;
-kmem_cache_t *gfs_mhc_cachep = NULL;
+struct kmem_cache *gfs_glock_cachep = NULL;
+struct kmem_cache *gfs_inode_cachep = NULL;
+struct kmem_cache *gfs_bufdata_cachep = NULL;
+struct kmem_cache *gfs_mhc_cachep = NULL;
 
 /**
  * gfs_random - Generate a random 32-bit number
--- cluster/gfs-kernel/src/gfs/util.h	2006/02/20 04:01:05	1.7.8.1
+++ cluster/gfs-kernel/src/gfs/util.h	2007/02/07 15:25:05	1.7.8.2
@@ -311,10 +311,10 @@
 	yield(); \
 }
 
-extern kmem_cache_t *gfs_glock_cachep;
-extern kmem_cache_t *gfs_inode_cachep;
-extern kmem_cache_t *gfs_bufdata_cachep;
-extern kmem_cache_t *gfs_mhc_cachep;
+extern struct kmem_cache *gfs_glock_cachep;
+extern struct kmem_cache *gfs_inode_cachep;
+extern struct kmem_cache *gfs_bufdata_cachep;
+extern struct kmem_cache *gfs_mhc_cachep;
 
 void *gmalloc(unsigned int size);
 
--- cluster/gfs-kernel/src/gulm/Attic/gulm.h	2005/06/01 19:11:58	1.11.6.1
+++ cluster/gfs-kernel/src/gulm/Attic/gulm.h	2007/02/07 15:25:05	1.11.6.1.2.1
@@ -24,7 +24,6 @@
 #include <linux/slab.h>
 #include <linux/spinlock.h>
 #include <asm/atomic.h>
-#include <linux/config.h>
 #include <linux/version.h>
 #include <linux/smp_lock.h>
 #include <linux/list.h>
@@ -73,7 +72,7 @@
 /*  Divide x by y.  Round up if there is a remainder.  */
 #define DIV_RU(x, y) (((x) + (y) - 1) / (y))
 
-#include <linux/lm_interface.h>
+#include "lm_interface.h"
 
 #include "gulm_prints.h"
 
--- cluster/gfs-kernel/src/gulm/Attic/gulm_fs.c	2005/03/04 20:08:00	1.15.2.1
+++ cluster/gfs-kernel/src/gulm/Attic/gulm_fs.c	2007/02/07 15:25:05	1.15.2.1.6.1
@@ -258,7 +258,7 @@
 		if (hostdata != NULL && strlen (hostdata) > 0) {
 			strncpy (gulm_cm.myName, hostdata, 64);
 		} else {
-			strncpy (gulm_cm.myName, system_utsname.nodename, 64);
+			strncpy (gulm_cm.myName, init_utsname()->nodename, 64);
 		}
 		gulm_cm.myName[63] = '\0';
 
--- cluster/gfs-kernel/src/gulm/Attic/handler.h	2004/06/24 08:53:28	1.1
+++ cluster/gfs-kernel/src/gulm/Attic/handler.h	2007/02/07 15:25:05	1.1.8.1
@@ -13,7 +13,8 @@
 
 #ifndef __handler_c__
 #define __handler_c__
-#include <linux/lm_interface.h>
+
+#include "lm_interface.h"
 
 struct callback_qu_s {
 	struct completion startup;
--- cluster/gfs-kernel/src/harness/Attic/main.c	2004/12/22 02:23:11	1.3
+++ cluster/gfs-kernel/src/harness/Attic/main.c	2007/02/07 15:25:05	1.3.8.1
@@ -19,7 +19,8 @@
 #include <linux/sched.h>
 #include <linux/kmod.h>
 #include <linux/fs.h>
-#include <linux/lm_interface.h>
+
+#include "lm_interface.h"
 
 #define RELEASE_NAME "<CVS>"
 
--- cluster/gfs-kernel/src/nolock/Attic/main.c	2006/06/26 21:27:43	1.4.6.2.2.1
+++ cluster/gfs-kernel/src/nolock/Attic/main.c	2007/02/07 15:25:05	1.4.6.2.2.2
@@ -18,7 +18,8 @@
 #include <linux/types.h>
 #include <linux/fs.h>
 #include <linux/smp_lock.h>
-#include <linux/lm_interface.h>
+
+#include "lm_interface.h"
 
 #define RELEASE_NAME "<CVS>"
 
--- cluster/gnbd-kernel/src/gnbd.c	2006/07/12 17:34:29	1.6.6.1.2.4
+++ cluster/gnbd-kernel/src/gnbd.c	2007/02/07 15:25:05	1.6.6.1.2.5
@@ -30,12 +30,11 @@
 #include <linux/buffer_head.h>
 #include <linux/miscdevice.h>
 #include <linux/moduleparam.h>
-#include <linux/devfs_fs_kernel.h>
 
 #include <asm/uaccess.h>
 #include <asm/types.h>
 
-#include <linux/gnbd.h>
+#include "gnbd.h"
 
 static int major_nr = 0;
 uint64_t insmod_time;
@@ -578,10 +577,10 @@
 		struct gnbd_device *dev;
 
 		blkdev_dequeue_request(req);
-		dprintk(DBG_BLKDEV, "%s: request %p: dequeued (flags=%lx)\n",
-				req->rq_disk->disk_name, req, req->flags);
+		dprintk(DBG_BLKDEV, "%s: request %p: dequeued (flags=%x)\n",
+				req->rq_disk->disk_name, req, req->cmd_type);
 
-		if (!(req->flags & REQ_CMD))
+		if (!blk_fs_request(req))
 			goto error_out;
 		
 		dev = req->rq_disk->private_data;
@@ -845,7 +844,6 @@
 {
         .minor = MISC_DYNAMIC_MINOR,
         .name  = "gnbd_ctl",
-        .devfs_name = "gnbd_ctl",
         .fops = &_gnbd_ctl_fops
 };
 
@@ -890,12 +888,12 @@
 		printk(KERN_CRIT "gnbd: sizeof gnbd_request needs to be 28 in order to work!\n" );
 		return -EIO;
 	}
-	shutdown_req.flags = REQ_SPECIAL;
+	shutdown_req.cmd_type = REQ_TYPE_SPECIAL;
 	gnbd_cmd(&shutdown_req) = GNBD_CMD_DISC;
 	shutdown_req.sector = 0;
 	shutdown_req.nr_sectors = 0;
 
-	ping_req.flags = REQ_SPECIAL;
+	ping_req.cmd_type = REQ_TYPE_SPECIAL;
 	gnbd_cmd(&ping_req) = GNBD_CMD_PING;
 	ping_req.sector = 0;
 	ping_req.nr_sectors = 0;
@@ -926,7 +924,6 @@
 	printk(KERN_INFO "gnbd: registered device at major %d\n", major_nr);
 	dprintk(DBG_INIT, "gnbd: debugflags=0x%x\n", debugflags);
 
-	devfs_mk_dir("gnbd_minor");
 	err = class_register(&gnbd_class);
 	if (err)
 		goto out_unregister;
@@ -982,7 +979,6 @@
 		disk->fops = &gnbd_fops;
 		disk->private_data = &gnbd_dev[i];
 		sprintf(disk->disk_name, "gnbd%d", i);
-		sprintf(disk->devfs_name, "gnbd_minor/%d", i);
 		set_capacity(disk, 0);
 		add_disk(disk);
 		if(sysfs_create_link(&gnbd_dev[i].class_dev.kobj,
@@ -1036,7 +1032,6 @@
 			kfree(gnbd_dev[i].server_name);
 	}
 	class_unregister(&gnbd_class);
-	devfs_remove("gnbd");
 	unregister_blkdev(major_nr, "gnbd");
 	printk(KERN_INFO "gnbd: unregistered device at major %d\n", major_nr);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]