public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] use XFS_I and VFS_I in xfs_dm.c
@ 2008-08-22  1:42 Christoph Hellwig
  2008-09-29  9:21 ` Christoph Hellwig
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Hellwig @ 2008-08-22  1:42 UTC (permalink / raw)
  To: xfs

Convert xfs_dm.c to use the XFS_I and VFI_I helper, or in some cases
IHOLD/IRELE so that it still compiles with Dave's inode unification
patch.  It's only really required for the latter, but also a nice
cleanup without it, so it should probably go in before that patch
series.


Signed-off-by: Christoph Hellwig <hch@lst.de>

Index: linux-2.6-xfs/fs/xfs/dmapi/xfs_dm.c
===================================================================
--- linux-2.6-xfs.orig/fs/xfs/dmapi/xfs_dm.c	2008-08-19 22:42:31.000000000 -0300
+++ linux-2.6-xfs/fs/xfs/dmapi/xfs_dm.c	2008-08-19 22:45:17.000000000 -0300
@@ -140,7 +140,7 @@ xfs_dm_send_data_event(
 	int		flags,
 	int		*lock_flags)
 {
-	struct inode	*inode = ip->i_vnode;
+	struct inode	*inode = VFS_I(ip);
 	int		error;
 	uint16_t	dmstate;
 
@@ -468,7 +468,7 @@ xfs_dm_bulkall_iget_one(
 		return error;
 
 	xfs_ip_to_stat(mp, ino, ip, &xbuf->dx_statinfo);
-	dm_ip_to_handle(ip->i_vnode, &handle);
+	dm_ip_to_handle(VFS_I(ip), &handle);
 	xfs_dm_handle_to_xstat(xbuf, xstat_sz, &handle, sizeof(handle));
 
 	/* Drop ILOCK_SHARED for call to xfs_attr_get */
@@ -476,7 +476,7 @@ xfs_dm_bulkall_iget_one(
 
 	memset(&xbuf->dx_attrdata, 0, sizeof(dm_vardata_t));
 	error = xfs_attr_get(ip, attr_name, attr_buf, &value_len, ATTR_ROOT);
-	iput(ip->i_vnode);
+	IRELE(ip);
 
 	DM_EA_XLATE_ERR(error);
 	if (error && (error != ENOATTR)) {
@@ -726,7 +726,7 @@ xfs_dm_bulkattr_iget_one(
 		return error;
 
 	xfs_ip_to_stat(mp, ino, ip, sbuf);
-	dm_ip_to_handle(ip->i_vnode, &handle);
+	dm_ip_to_handle(VFS_I(ip), &handle);
 	xfs_dm_handle_to_stat(sbuf, stat_sz, &handle, sizeof(handle));
 
 	xfs_iput(ip, XFS_ILOCK_SHARED);
@@ -907,7 +907,7 @@ xfs_dm_f_set_eventlist(
 	ip->i_d.di_dmevmask = (eventset & max_mask) | (ip->i_d.di_dmevmask & ~max_mask);
 
 	xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
-	igrab(ip->i_vnode);
+	IHOLD(ip);
 	xfs_trans_commit(tp, 0);
 
 	return(0);
@@ -2731,7 +2731,7 @@ xfs_dm_send_destroy_event(
 	dm_right_t	vp_right)	/* always DM_RIGHT_NULL */
 {
 	/* Returns positive errors to XFS */
-	return -dm_send_destroy_event(ip->i_vnode, vp_right);
+	return -dm_send_destroy_event(VFS_I(ip), vp_right);
 }
 
 
@@ -2751,8 +2751,8 @@ xfs_dm_send_namesp_event(
 {
 	/* Returns positive errors to XFS */
 	return -dm_send_namesp_event(event, mp ? mp->m_super : NULL,
-				    ip1->i_vnode, vp1_right,
-				    ip2 ? ip2->i_vnode : NULL, vp2_right,
+				    VFS_I(ip1), vp1_right,
+				    ip2 ? VFS_I(ip2) : NULL, vp2_right,
 				    name1, name2,
 				    mode, retcode, flags);
 }
@@ -2779,7 +2779,7 @@ xfs_dm_send_unmount_event(
 	int		retcode,	/* errno, if unmount failed */
 	int		flags)
 {
-	dm_send_unmount_event(mp->m_super, ip ? ip->i_vnode : NULL,
+	dm_send_unmount_event(mp->m_super, ip ? VFS_I(ip) : NULL,
 			      vfsp_right, mode, retcode, flags);
 }
 
@@ -2822,9 +2822,8 @@ xfs_dm_fh_to_inode(
 
 	if (!dmfid->dm_fid_len) {
 		/* filesystem handle */
-		*inode = igrab(mp->m_rootip->i_vnode);
-		if (!*inode)
-			return -ENOENT;
+		IHOLD(mp->m_rootip);
+		*inode = VFS_I(mp->m_rootip);
 		return 0;
 	}
 
@@ -2849,7 +2848,7 @@ xfs_dm_fh_to_inode(
 		return -ENOENT;
 	}
 
-	*inode = ip->i_vnode;
+	*inode = VFS_I(ip);
 	xfs_iunlock(ip, XFS_ILOCK_SHARED);
 	return 0;
 }

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

* Re: [PATCH] use XFS_I and VFS_I in xfs_dm.c
  2008-08-22  1:42 [PATCH] use XFS_I and VFS_I in xfs_dm.c Christoph Hellwig
@ 2008-09-29  9:21 ` Christoph Hellwig
  2008-10-22  5:49   ` Donald Douwsma
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Hellwig @ 2008-09-29  9:21 UTC (permalink / raw)
  To: xfs

ping?

On Fri, Aug 22, 2008 at 03:42:05AM +0200, Christoph Hellwig wrote:
> Convert xfs_dm.c to use the XFS_I and VFI_I helper, or in some cases
> IHOLD/IRELE so that it still compiles with Dave's inode unification
> patch.  It's only really required for the latter, but also a nice
> cleanup without it, so it should probably go in before that patch
> series.
> 
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> 
> Index: linux-2.6-xfs/fs/xfs/dmapi/xfs_dm.c
> ===================================================================
> --- linux-2.6-xfs.orig/fs/xfs/dmapi/xfs_dm.c	2008-08-19 22:42:31.000000000 -0300
> +++ linux-2.6-xfs/fs/xfs/dmapi/xfs_dm.c	2008-08-19 22:45:17.000000000 -0300
> @@ -140,7 +140,7 @@ xfs_dm_send_data_event(
>  	int		flags,
>  	int		*lock_flags)
>  {
> -	struct inode	*inode = ip->i_vnode;
> +	struct inode	*inode = VFS_I(ip);
>  	int		error;
>  	uint16_t	dmstate;
>  
> @@ -468,7 +468,7 @@ xfs_dm_bulkall_iget_one(
>  		return error;
>  
>  	xfs_ip_to_stat(mp, ino, ip, &xbuf->dx_statinfo);
> -	dm_ip_to_handle(ip->i_vnode, &handle);
> +	dm_ip_to_handle(VFS_I(ip), &handle);
>  	xfs_dm_handle_to_xstat(xbuf, xstat_sz, &handle, sizeof(handle));
>  
>  	/* Drop ILOCK_SHARED for call to xfs_attr_get */
> @@ -476,7 +476,7 @@ xfs_dm_bulkall_iget_one(
>  
>  	memset(&xbuf->dx_attrdata, 0, sizeof(dm_vardata_t));
>  	error = xfs_attr_get(ip, attr_name, attr_buf, &value_len, ATTR_ROOT);
> -	iput(ip->i_vnode);
> +	IRELE(ip);
>  
>  	DM_EA_XLATE_ERR(error);
>  	if (error && (error != ENOATTR)) {
> @@ -726,7 +726,7 @@ xfs_dm_bulkattr_iget_one(
>  		return error;
>  
>  	xfs_ip_to_stat(mp, ino, ip, sbuf);
> -	dm_ip_to_handle(ip->i_vnode, &handle);
> +	dm_ip_to_handle(VFS_I(ip), &handle);
>  	xfs_dm_handle_to_stat(sbuf, stat_sz, &handle, sizeof(handle));
>  
>  	xfs_iput(ip, XFS_ILOCK_SHARED);
> @@ -907,7 +907,7 @@ xfs_dm_f_set_eventlist(
>  	ip->i_d.di_dmevmask = (eventset & max_mask) | (ip->i_d.di_dmevmask & ~max_mask);
>  
>  	xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
> -	igrab(ip->i_vnode);
> +	IHOLD(ip);
>  	xfs_trans_commit(tp, 0);
>  
>  	return(0);
> @@ -2731,7 +2731,7 @@ xfs_dm_send_destroy_event(
>  	dm_right_t	vp_right)	/* always DM_RIGHT_NULL */
>  {
>  	/* Returns positive errors to XFS */
> -	return -dm_send_destroy_event(ip->i_vnode, vp_right);
> +	return -dm_send_destroy_event(VFS_I(ip), vp_right);
>  }
>  
>  
> @@ -2751,8 +2751,8 @@ xfs_dm_send_namesp_event(
>  {
>  	/* Returns positive errors to XFS */
>  	return -dm_send_namesp_event(event, mp ? mp->m_super : NULL,
> -				    ip1->i_vnode, vp1_right,
> -				    ip2 ? ip2->i_vnode : NULL, vp2_right,
> +				    VFS_I(ip1), vp1_right,
> +				    ip2 ? VFS_I(ip2) : NULL, vp2_right,
>  				    name1, name2,
>  				    mode, retcode, flags);
>  }
> @@ -2779,7 +2779,7 @@ xfs_dm_send_unmount_event(
>  	int		retcode,	/* errno, if unmount failed */
>  	int		flags)
>  {
> -	dm_send_unmount_event(mp->m_super, ip ? ip->i_vnode : NULL,
> +	dm_send_unmount_event(mp->m_super, ip ? VFS_I(ip) : NULL,
>  			      vfsp_right, mode, retcode, flags);
>  }
>  
> @@ -2822,9 +2822,8 @@ xfs_dm_fh_to_inode(
>  
>  	if (!dmfid->dm_fid_len) {
>  		/* filesystem handle */
> -		*inode = igrab(mp->m_rootip->i_vnode);
> -		if (!*inode)
> -			return -ENOENT;
> +		IHOLD(mp->m_rootip);
> +		*inode = VFS_I(mp->m_rootip);
>  		return 0;
>  	}
>  
> @@ -2849,7 +2848,7 @@ xfs_dm_fh_to_inode(
>  		return -ENOENT;
>  	}
>  
> -	*inode = ip->i_vnode;
> +	*inode = VFS_I(ip);
>  	xfs_iunlock(ip, XFS_ILOCK_SHARED);
>  	return 0;
>  }
---end quoted text---

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

* Re: [PATCH] use XFS_I and VFS_I in xfs_dm.c
  2008-09-29  9:21 ` Christoph Hellwig
@ 2008-10-22  5:49   ` Donald Douwsma
  0 siblings, 0 replies; 3+ messages in thread
From: Donald Douwsma @ 2008-10-22  5:49 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs

Christoph Hellwig wrote:
> ping?

A similar patch has already been checked into the tree (which hopefully
should be working again). I can apply the 3 remaining changes, just
mentioning it here for transparency.

> 
> On Fri, Aug 22, 2008 at 03:42:05AM +0200, Christoph Hellwig wrote:
>> Convert xfs_dm.c to use the XFS_I and VFI_I helper, or in some cases
>> IHOLD/IRELE so that it still compiles with Dave's inode unification
>> patch.  It's only really required for the latter, but also a nice
>> cleanup without it, so it should probably go in before that patch
>> series.
>>
>>
>> Signed-off-by: Christoph Hellwig <hch@lst.de>
>>
>> Index: linux-2.6-xfs/fs/xfs/dmapi/xfs_dm.c
>> ===================================================================
>> --- linux-2.6-xfs.orig/fs/xfs/dmapi/xfs_dm.c	2008-08-19 22:42:31.000000000 -0300
>> +++ linux-2.6-xfs/fs/xfs/dmapi/xfs_dm.c	2008-08-19 22:45:17.000000000 -0300
>> @@ -140,7 +140,7 @@ xfs_dm_send_data_event(
>>  	int		flags,
>>  	int		*lock_flags)
>>  {
>> -	struct inode	*inode = ip->i_vnode;
>> +	struct inode	*inode = VFS_I(ip);
>>  	int		error;
>>  	uint16_t	dmstate;
>>  

Already in

>> @@ -468,7 +468,7 @@ xfs_dm_bulkall_iget_one(
>>  		return error;
>>  
>>  	xfs_ip_to_stat(mp, ino, ip, &xbuf->dx_statinfo);
>> -	dm_ip_to_handle(ip->i_vnode, &handle);
>> +	dm_ip_to_handle(VFS_I(ip), &handle);
>>  	xfs_dm_handle_to_xstat(xbuf, xstat_sz, &handle, sizeof(handle));
>>  
>>  	/* Drop ILOCK_SHARED for call to xfs_attr_get */

Already in

>> @@ -476,7 +476,7 @@ xfs_dm_bulkall_iget_one(
>>  
>>  	memset(&xbuf->dx_attrdata, 0, sizeof(dm_vardata_t));
>>  	error = xfs_attr_get(ip, attr_name, attr_buf, &value_len, ATTR_ROOT);
>> -	iput(ip->i_vnode);
>> +	IRELE(ip);
>>  
>>  	DM_EA_XLATE_ERR(error);
>>  	if (error && (error != ENOATTR)) {

Fixed as
-	iput(ip->i_vnode);
+	iput(VFS_I(ip));


>> @@ -726,7 +726,7 @@ xfs_dm_bulkattr_iget_one(
>>  		return error;
>>  
>>  	xfs_ip_to_stat(mp, ino, ip, sbuf);
>> -	dm_ip_to_handle(ip->i_vnode, &handle);
>> +	dm_ip_to_handle(VFS_I(ip), &handle);
>>  	xfs_dm_handle_to_stat(sbuf, stat_sz, &handle, sizeof(handle));
>>  
>>  	xfs_iput(ip, XFS_ILOCK_SHARED);

Already in

>> @@ -907,7 +907,7 @@ xfs_dm_f_set_eventlist(
>>  	ip->i_d.di_dmevmask = (eventset & max_mask) | (ip->i_d.di_dmevmask & ~max_mask);
>>  
>>  	xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
>> -	igrab(ip->i_vnode);
>> +	IHOLD(ip);
>>  	xfs_trans_commit(tp, 0);
>>  
>>  	return(0);

Fixed as
+	igrab(VFS_I(ip))

>> @@ -2731,7 +2731,7 @@ xfs_dm_send_destroy_event(
>>  	dm_right_t	vp_right)	/* always DM_RIGHT_NULL */
>>  {
>>  	/* Returns positive errors to XFS */
>> -	return -dm_send_destroy_event(ip->i_vnode, vp_right);
>> +	return -dm_send_destroy_event(VFS_I(ip), vp_right);
>>  }

Already in

>>  
>> @@ -2751,8 +2751,8 @@ xfs_dm_send_namesp_event(
>>  {
>>  	/* Returns positive errors to XFS */
>>  	return -dm_send_namesp_event(event, mp ? mp->m_super : NULL,
>> -				    ip1->i_vnode, vp1_right,
>> -				    ip2 ? ip2->i_vnode : NULL, vp2_right,
>> +				    VFS_I(ip1), vp1_right,
>> +				    ip2 ? VFS_I(ip2) : NULL, vp2_right,
>>  				    name1, name2,
>>  				    mode, retcode, flags);
>>  }

Already in

>> @@ -2779,7 +2779,7 @@ xfs_dm_send_unmount_event(
>>  	int		retcode,	/* errno, if unmount failed */
>>  	int		flags)
>>  {
>> -	dm_send_unmount_event(mp->m_super, ip ? ip->i_vnode : NULL,
>> +	dm_send_unmount_event(mp->m_super, ip ? VFS_I(ip) : NULL,
>>  			      vfsp_right, mode, retcode, flags);
>>  }
>>  

Already in

>> @@ -2822,9 +2822,8 @@ xfs_dm_fh_to_inode(
>>  
>>  	if (!dmfid->dm_fid_len) {
>>  		/* filesystem handle */
>> -		*inode = igrab(mp->m_rootip->i_vnode);
>> -		if (!*inode)
>> -			return -ENOENT;
>> +		IHOLD(mp->m_rootip);
>> +		*inode = VFS_I(mp->m_rootip);
>>  		return 0;
>>  	}
>>  

Fixed As
+		*inode = igrab(VFS_I(mp->m_rootip));

>> @@ -2849,7 +2848,7 @@ xfs_dm_fh_to_inode(
>>  		return -ENOENT;
>>  	}
>>  
>> -	*inode = ip->i_vnode;
>> +	*inode = VFS_I(ip);
>>  	xfs_iunlock(ip, XFS_ILOCK_SHARED);
>>  	return 0;
>>  }

Already in

> ---end quoted text---
> 

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

end of thread, other threads:[~2008-10-22  5:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-22  1:42 [PATCH] use XFS_I and VFS_I in xfs_dm.c Christoph Hellwig
2008-09-29  9:21 ` Christoph Hellwig
2008-10-22  5:49   ` Donald Douwsma

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox