All of lore.kernel.org
 help / color / mirror / Atom feed
* [Cluster-devel] cluster/gfs-kernel/src/gfs inode.c ops_file.c  ...
@ 2007-11-30 21:48 wcheng
  2007-12-01  4:08 ` Fabio Massimo Di Nitto
  0 siblings, 1 reply; 6+ messages in thread
From: wcheng @ 2007-11-30 21:48 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL5
Changes by:	wcheng at sourceware.org	2007-11-30 21:48:54

Modified files:
	gfs-kernel/src/gfs: inode.c ops_file.c ops_file.h 

Log message:
	Red Hat bugzilla 244343:
	
	GFS supports two modes of locking - lock_nolock for single node filesystem
	and lock_dlm for cluster mode locking. The gfs lock methods are removed from
	file operation table for lock_nolock protocol. This would allow VFS to handle
	posix lock and flock logics just like other in-tree filesystems without
	duplication.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/inode.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.26&r2=1.26.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/ops_file.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.28.2.2&r2=1.28.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/ops_file.h.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.2&r2=1.2.2.1

--- cluster/gfs-kernel/src/gfs/inode.c	2006/10/05 16:04:38	1.26
+++ cluster/gfs-kernel/src/gfs/inode.c	2007/11/30 21:48:54	1.26.2.1
@@ -170,6 +170,7 @@
 struct inode *
 gfs_iget(struct gfs_inode *ip, int create)
 {
+	struct gfs_sbd *sdp = ip->i_sbd;
 	struct inode *inode = NULL, *tmp;
 
 	spin_lock(&ip->i_spin);
@@ -189,13 +190,19 @@
 	/* Attach GFS-specific ops vectors */
 	if (ip->i_di.di_type == GFS_FILE_REG) {
 		tmp->i_op = &gfs_file_iops;
-		tmp->i_fop = &gfs_file_fops;
 		memcpy(&ip->gfs_file_aops, &gfs_file_aops,
 			   sizeof(struct address_space_operations));
 		tmp->i_mapping->a_ops = &ip->gfs_file_aops;
+		if (sdp->sd_args.ar_localflocks)
+			tmp->i_fop = &gfs_file_fops_nolock;
+		else
+			tmp->i_fop = &gfs_file_fops;
 	} else if (ip->i_di.di_type == GFS_FILE_DIR) {
 		tmp->i_op = &gfs_dir_iops;
-		tmp->i_fop = &gfs_dir_fops;
+		if (sdp->sd_args.ar_localflocks)
+			tmp->i_fop = &gfs_dir_fops_nolock;
+		else
+			tmp->i_fop = &gfs_dir_fops;
 	} else if (ip->i_di.di_type == GFS_FILE_LNK) {
 		tmp->i_op = &gfs_symlink_iops;
 	} else {
--- cluster/gfs-kernel/src/gfs/ops_file.c	2007/06/17 02:56:43	1.28.2.2
+++ cluster/gfs-kernel/src/gfs/ops_file.c	2007/11/30 21:48:54	1.28.2.3
@@ -1566,21 +1566,6 @@
 	if ((ip->i_di.di_mode & (S_ISGID | S_IXGRP)) == S_ISGID)
 		return -ENOLCK;
 
-	if (sdp->sd_args.ar_localflocks) {
-		if (IS_GETLK(cmd)) {
-			int conflict;
-			struct file_lock tmp;
-
-			conflict = posix_test_lock(file, fl, &tmp);
-			fl->fl_type = F_UNLCK;
-			if (conflict)
-				memcpy(fl, &tmp, sizeof(struct file_lock));
-			return 0;
-		} else {
-			return posix_lock_file_wait(file, fl);
-		}
-	}
-
 	if (IS_GETLK(cmd))
 		return gfs_lm_plock_get(sdp, &name, file, fl);
 	else if (fl->fl_type == F_UNLCK)
@@ -1722,7 +1707,6 @@
 gfs_flock(struct file *file, int cmd, struct file_lock *fl)
 {
 	struct gfs_inode *ip = get_v2ip(file->f_mapping->host);
-	struct gfs_sbd *sdp = ip->i_sbd;
 
 	atomic_inc(&ip->i_sbd->sd_ops_file);
 
@@ -1731,9 +1715,6 @@
 	if ((ip->i_di.di_mode & (S_ISGID | S_IXGRP)) == S_ISGID)
 		return -ENOLCK;
 
-	if (sdp->sd_args.ar_localflocks)
-		return flock_lock_file_wait(file, fl);
-
 	if (fl->fl_type == F_UNLCK) {
 		do_unflock(file, fl);
 		return 0;
@@ -1766,3 +1747,25 @@
 	.lock = gfs_lock,
 	.flock = gfs_flock,
 };
+
+struct file_operations gfs_file_fops_nolock = {
+	.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,
+	.release = gfs_close,
+	.fsync = gfs_fsync,
+	.sendfile = gfs_sendfile,
+};
+
+struct file_operations gfs_dir_fops_nolock = {
+	.readdir = gfs_readdir,
+	.ioctl = gfs_ioctl,
+	.open = gfs_open,
+	.release = gfs_close,
+	.fsync = gfs_fsync,
+};
--- cluster/gfs-kernel/src/gfs/ops_file.h	2006/07/10 23:22:34	1.2
+++ cluster/gfs-kernel/src/gfs/ops_file.h	2007/11/30 21:48:54	1.2.2.1
@@ -16,5 +16,7 @@
 
 extern struct file_operations gfs_file_fops;
 extern struct file_operations gfs_dir_fops;
+extern struct file_operations gfs_file_fops_nolock;
+extern struct file_operations gfs_dir_fops_nolock;
 
 #endif /* __OPS_FILE_DOT_H__ */



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Cluster-devel] cluster/gfs-kernel/src/gfs inode.c ops_file.c ...
  2007-11-30 21:48 [Cluster-devel] cluster/gfs-kernel/src/gfs inode.c ops_file.c wcheng
@ 2007-12-01  4:08 ` Fabio Massimo Di Nitto
  2007-12-02  2:51   ` Wendy Cheng
  0 siblings, 1 reply; 6+ messages in thread
From: Fabio Massimo Di Nitto @ 2007-12-01  4:08 UTC (permalink / raw)
  To: cluster-devel.redhat.com

wcheng at sourceware.org wrote:
> CVSROOT:	/cvs/cluster
> Module name:	cluster
> Branch: 	RHEL5
> Changes by:	wcheng at sourceware.org	2007-11-30 21:48:54
> 
> Modified files:
> 	gfs-kernel/src/gfs: inode.c ops_file.c ops_file.h 
> 
> Log message:
> 	Red Hat bugzilla 244343:
> 	
> 	GFS supports two modes of locking - lock_nolock for single node filesystem
> 	and lock_dlm for cluster mode locking. The gfs lock methods are removed from
> 	file operation table for lock_nolock protocol. This would allow VFS to handle
> 	posix lock and flock logics just like other in-tree filesystems without
> 	duplication.
> 
> Patches:
> http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/inode.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.26&r2=1.26.2.1
> http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/ops_file.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.28.2.2&r2=1.28.2.3
> http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/ops_file.h.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.2&r2=1.2.2.1
> 


Should this patch land in HEAD as well?

Thanks
Fabio

-- 
I'm going to make him an offer he can't refuse.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Cluster-devel] cluster/gfs-kernel/src/gfs inode.c ops_file.c ...
  2007-12-01  4:08 ` Fabio Massimo Di Nitto
@ 2007-12-02  2:51   ` Wendy Cheng
  2007-12-02  7:18     ` Fabio M. Di Nitto
  0 siblings, 1 reply; 6+ messages in thread
From: Wendy Cheng @ 2007-12-02  2:51 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Fabio Massimo Di Nitto wrote:

>wcheng at sourceware.org wrote:
>  
>
>>CVSROOT:	/cvs/cluster
>>Module name:	cluster
>>Branch: 	RHEL5
>>Changes by:	wcheng at sourceware.org	2007-11-30 21:48:54
>>
>>Modified files:
>>	gfs-kernel/src/gfs: inode.c ops_file.c ops_file.h 
>>
>>Log message:
>>	Red Hat bugzilla 244343:
>>	
>>	GFS supports two modes of locking - lock_nolock for single node filesystem
>>	and lock_dlm for cluster mode locking. The gfs lock methods are removed from
>>	file operation table for lock_nolock protocol. This would allow VFS to handle
>>	posix lock and flock logics just like other in-tree filesystems without
>>	duplication.
>>
>>Patches:
>>http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/inode.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.26&r2=1.26.2.1
>>http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/ops_file.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.28.2.2&r2=1.28.2.3
>>http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/ops_file.h.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.2&r2=1.2.2.1
>>
>>    
>>
>
>
>Should this patch land in HEAD as well?
>
>
>  
>
Yes .. but gfs(1)-kernel HEAD is currently broken .. Will review few 
proposed patches (including your NFS patches) and do a clean-up first 
thing next week.

-- Wendy



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Cluster-devel] cluster/gfs-kernel/src/gfs inode.c ops_file.c ...
  2007-12-02  2:51   ` Wendy Cheng
@ 2007-12-02  7:18     ` Fabio M. Di Nitto
  2007-12-02 14:33       ` Wendy Cheng
  0 siblings, 1 reply; 6+ messages in thread
From: Fabio M. Di Nitto @ 2007-12-02  7:18 UTC (permalink / raw)
  To: cluster-devel.redhat.com


Hi Wendy,

On Sat, 1 Dec 2007, Wendy Cheng wrote:

> Fabio Massimo Di Nitto wrote:
>
>> wcheng at sourceware.org wrote:
>> 
>>> CVSROOT:	/cvs/cluster
>>> Module name:	cluster
>>> Branch: 	RHEL5
>>> Changes by:	wcheng at sourceware.org	2007-11-30 21:48:54
>>> 
>>> Modified files:
>>> 	gfs-kernel/src/gfs: inode.c ops_file.c ops_file.h 
>>> Log message:
>>> 	Red Hat bugzilla 244343:
>>> 		GFS supports two modes of locking - lock_nolock for single 
>>> node filesystem
>>> 	and lock_dlm for cluster mode locking. The gfs lock methods are 
>>> removed from
>>> 	file operation table for lock_nolock protocol. This would allow VFS 
>>> to handle
>>> 	posix lock and flock logics just like other in-tree filesystems 
>>> without
>>> 	duplication.
>>> 
>>> Patches:
>>> http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/inode.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.26&r2=1.26.2.1
>>> http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/ops_file.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.28.2.2&r2=1.28.2.3
>>> http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/ops_file.h.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.2&r2=1.2.2.1
>>>
>>> 
>> 
>> 
>> Should this patch land in HEAD as well?
>> 
>>
>> 
> Yes .. but gfs(1)-kernel HEAD is currently broken ..

I am adding Phillip in CC.

So far he has been doing some work on gfs1 for Ubuntu, that includes a 
bunch of fixes. I was not able (mainly I did run out of time) to push them 
all.

We have a git import based on a slightly old cvs head snapshot here:
http://kernel.ubuntu.com/git?p=ubuntu/ubuntu-hardy-lum.git;a=summary

There is a bit of merge that needs to be done between that tree and CVS, 
but there are some valuable fixes in there too that you want to take into 
account.

Phillip knows more and better than me how those should be merged.

Also.. do you know how is gfs1-kernel broken in HEAD?

> Will review few proposed 
> patches (including your NFS patches) and do a clean-up first thing next week.

That's probably not from me :) I never played around with NFS patches ;)

Cheers
Fabio

--
I'm going to make him an offer he can't refuse.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Cluster-devel] cluster/gfs-kernel/src/gfs inode.c ops_file.c ...
  2007-12-02  7:18     ` Fabio M. Di Nitto
@ 2007-12-02 14:33       ` Wendy Cheng
  2007-12-03 13:54         ` Fabio M. Di Nitto
  0 siblings, 1 reply; 6+ messages in thread
From: Wendy Cheng @ 2007-12-02 14:33 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Fabio M. Di Nitto wrote:
>
>> Yes .. but gfs(1)-kernel HEAD is currently broken ..
>
> I am adding Phillip in CC.
>
> So far he has been doing some work on gfs1 for Ubuntu, that includes a 
> bunch of fixes. I was not able (mainly I did run out of time) to push 
> them all.
>
> We have a git import based on a slightly old cvs head snapshot here:
> http://kernel.ubuntu.com/git?p=ubuntu/ubuntu-hardy-lum.git;a=summary

Glad to know people still working on this out-of-tree filesystem ... 
Will look into this.

>
> There is a bit of merge that needs to be done between that tree and 
> CVS, but there are some valuable fixes in there too that you want to 
> take into account.
>
> Phillip knows more and better than me how those should be merged.
>
> Also.. do you know how is gfs1-kernel broken in HEAD?

Few things such as vector read/write .. but the most pressing issue is 
that it won't compile due to newer kernel NFS changes.

>
>> Will review few proposed patches (including your NFS patches) and do 
>> a clean-up first thing next week.
>
> That's probably not from me :) I never played around with NFS patches ;)
>

Well, maybe I remember it wrong ... Anyway, thanks for the info.

-- Wendy



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Cluster-devel] cluster/gfs-kernel/src/gfs inode.c ops_file.c ...
  2007-12-02 14:33       ` Wendy Cheng
@ 2007-12-03 13:54         ` Fabio M. Di Nitto
  0 siblings, 0 replies; 6+ messages in thread
From: Fabio M. Di Nitto @ 2007-12-03 13:54 UTC (permalink / raw)
  To: cluster-devel.redhat.com

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue, 30 Sep 2003, Wendy Cheng wrote:

> Fabio M. Di Nitto wrote:
>> 
>>> Yes .. but gfs(1)-kernel HEAD is currently broken ..
>> 
>> I am adding Phillip in CC.
>> 
>> So far he has been doing some work on gfs1 for Ubuntu, that includes a 
>> bunch of fixes. I was not able (mainly I did run out of time) to push them 
>> all.
>> 
>> We have a git import based on a slightly old cvs head snapshot here:
>> http://kernel.ubuntu.com/git?p=ubuntu/ubuntu-hardy-lum.git;a=summary
>
> Glad to know people still working on this out-of-tree filesystem ... Will 
> look into this.

thanks a lot.

>
>> 
>> There is a bit of merge that needs to be done between that tree and CVS, 
>> but there are some valuable fixes in there too that you want to take into 
>> account.
>> 
>> Phillip knows more and better than me how those should be merged.
>> 
>> Also.. do you know how is gfs1-kernel broken in HEAD?
>
> Few things such as vector read/write .. but the most pressing issue is that 
> it won't compile due to newer kernel NFS changes.

then it is possible that the porting that i did to .24 was due to NFS 
changes. I didn't really dig into why the API was changed. Just ported to 
it following the changes in all other FS'es. :)

Cheers
Fabio

- --
I'm going to make him an offer he can't refuse.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iQIVAwUBR1QKsFA6oBJjVJ+OAQJMlQ//eUivTE/hxO60jqX2IJGQIpAGTrmbY/45
1sO+fw76Ae6ALrpG+qgXIpFBxnSjGf9vySNDK1HaTiSYB6bmfV8q/dukwww6G/v6
bie7B68dY+CMdzBVLT1OiOe4917USoxulmHSdl2TOVTrEuaOv2lSGE6GkQ47sGHT
wbBcnkviClLtu6qjTGr7ni9+x93wAp9GNIG+3+0983DbG6CYSDECInzBHLt2szLT
j/aOqmdUSYFvGy+DRV3Fa84NnD4BEhPWh0plTw9S6Mnr0D89QCZcj3/t3H1zib6z
jDs9x8TTHHJPt9ng1CTTkJ+rTgPMfnIrCJ3/mCh5WcvrUrJ4eA473k5cqRCrV4wW
zq6HtU/d6uglpGX4gVFymtjgDJVT//sYAVzqS9XbL0+63Ee77w2Vtdr66Egfowun
zlHVBnp32DXEVyS5+PuzxvptEZ8uwQnHALMZPCVYsNa+Q7jONqAahluftY+bkRec
neWHOtWxgk46nmBclvvWogpgtYs+vmg1piFLlIGPDs+K+rVTTJXzk5E+Nd45ndrc
hMTg/gXcp6bO57kcjIv5if0BmUOvfw6wFmeVHwR2IEN/cYrrFHyV0NkS5cIxkF5d
y8ARNIyFDku9WLvjqs8oToaSLFZjY7VwcJRAn+QEEHHQLjWz0ZAiX5Gv8dXjtHuW
QThu5AuoadY=
=3xdI
-----END PGP SIGNATURE-----



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-12-03 13:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-30 21:48 [Cluster-devel] cluster/gfs-kernel/src/gfs inode.c ops_file.c wcheng
2007-12-01  4:08 ` Fabio Massimo Di Nitto
2007-12-02  2:51   ` Wendy Cheng
2007-12-02  7:18     ` Fabio M. Di Nitto
2007-12-02 14:33       ` Wendy Cheng
2007-12-03 13:54         ` Fabio M. Di Nitto

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.