public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] remove flags param from xfs_free_eofblocks
@ 2009-01-01 22:45 Eric Sandeen
  2009-01-01 22:57 ` Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Sandeen @ 2009-01-01 22:45 UTC (permalink / raw)
  To: xfs-oss

Remove unused XFS_FREE_EOF_NOLOCK and make XFS_FREE_EOF_LOCK default.

XFS_FREE_EOF_NOLOCK is never used, so remove it, make
XFS_FREE_EOF_LOCK the only behavior, and remove the
flags parameters.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
---

Index: xfs/fs/xfs/xfs_rw.h
===================================================================
--- xfs.orig/fs/xfs/xfs_rw.h
+++ xfs/fs/xfs/xfs_rw.h
@@ -37,13 +37,6 @@ xfs_fsb_to_db(struct xfs_inode *ip, xfs_
 }
 
 /*
- * Flags for xfs_free_eofblocks
- */
-#define XFS_FREE_EOF_LOCK	(1<<0)
-#define XFS_FREE_EOF_NOLOCK	(1<<1)
-
-
-/*
  * helper function to extract extent size hint from inode
  */
 STATIC_INLINE xfs_extlen_t
@@ -81,7 +74,6 @@ extern void xfs_ioerror_alert(char *func
 /*
  * Prototypes for functions in xfs_vnodeops.c.
  */
-extern int xfs_free_eofblocks(struct xfs_mount *mp, struct xfs_inode *ip,
-			int flags);
+extern int xfs_free_eofblocks(struct xfs_mount *mp, struct xfs_inode *ip);
 
 #endif /* __XFS_RW_H__ */
Index: xfs/fs/xfs/xfs_vnodeops.c
===================================================================
--- xfs.orig/fs/xfs/xfs_vnodeops.c
+++ xfs/fs/xfs/xfs_vnodeops.c
@@ -814,8 +814,7 @@ xfs_fsync(
 int
 xfs_free_eofblocks(
 	xfs_mount_t	*mp,
-	xfs_inode_t	*ip,
-	int		flags)
+	xfs_inode_t	*ip)
 {
 	xfs_trans_t	*tp;
 	int		error;
@@ -824,7 +823,6 @@ xfs_free_eofblocks(
 	xfs_filblks_t	map_len;
 	int		nimaps;
 	xfs_bmbt_irec_t	imap;
-	int		use_iolock = (flags & XFS_FREE_EOF_LOCK);
 
 	/*
 	 * Figure out if there are any blocks beyond the end
@@ -865,14 +863,12 @@ xfs_free_eofblocks(
 		 * cache and we can't
 		 * do that within a transaction.
 		 */
-		if (use_iolock)
-			xfs_ilock(ip, XFS_IOLOCK_EXCL);
+		xfs_ilock(ip, XFS_IOLOCK_EXCL);
 		error = xfs_itruncate_start(ip, XFS_ITRUNC_DEFINITE,
 				    ip->i_size);
 		if (error) {
 			xfs_trans_cancel(tp, 0);
-			if (use_iolock)
-				xfs_iunlock(ip, XFS_IOLOCK_EXCL);
+			xfs_iunlock(ip, XFS_IOLOCK_EXCL);
 			return error;
 		}
 
@@ -909,8 +905,7 @@ xfs_free_eofblocks(
 			error = xfs_trans_commit(tp,
 						XFS_TRANS_RELEASE_LOG_RES);
 		}
-		xfs_iunlock(ip, (use_iolock ? (XFS_IOLOCK_EXCL|XFS_ILOCK_EXCL)
-					    : XFS_ILOCK_EXCL));
+		xfs_iunlock(ip, XFS_IOLOCK_EXCL|XFS_ILOCK_EXCL);
 	}
 	return error;
 }
@@ -1204,7 +1199,7 @@ xfs_release(
 		     (ip->i_df.if_flags & XFS_IFEXTENTS))  &&
 		    (!(ip->i_d.di_flags &
 				(XFS_DIFLAG_PREALLOC | XFS_DIFLAG_APPEND)))) {
-			error = xfs_free_eofblocks(mp, ip, XFS_FREE_EOF_LOCK);
+			error = xfs_free_eofblocks(mp, ip);
 			if (error)
 				return error;
 		}
@@ -1275,7 +1270,7 @@ xfs_inactive(
 		     (!(ip->i_d.di_flags &
 				(XFS_DIFLAG_PREALLOC | XFS_DIFLAG_APPEND)) ||
 		      (ip->i_delayed_blks != 0)))) {
-			error = xfs_free_eofblocks(mp, ip, XFS_FREE_EOF_LOCK);
+			error = xfs_free_eofblocks(mp, ip);
 			if (error)
 				return VN_INACTIVE_CACHE;
 		}


_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH] remove flags param from xfs_free_eofblocks
  2009-01-01 22:45 [PATCH] remove flags param from xfs_free_eofblocks Eric Sandeen
@ 2009-01-01 22:57 ` Christoph Hellwig
  2009-01-01 23:03   ` Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2009-01-01 22:57 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: xfs-oss

On Thu, Jan 01, 2009 at 04:45:31PM -0600, Eric Sandeen wrote:
> Remove unused XFS_FREE_EOF_NOLOCK and make XFS_FREE_EOF_LOCK default.
> 
> XFS_FREE_EOF_NOLOCK is never used, so remove it, make
> XFS_FREE_EOF_LOCK the only behavior, and remove the
> flags parameters.

Looks good to me.  

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH] remove flags param from xfs_free_eofblocks
  2009-01-01 22:57 ` Christoph Hellwig
@ 2009-01-01 23:03   ` Christoph Hellwig
  2009-01-01 23:04     ` Eric Sandeen
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2009-01-01 23:03 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: xfs-oss

On Thu, Jan 01, 2009 at 05:57:17PM -0500, Christoph Hellwig wrote:
> On Thu, Jan 01, 2009 at 04:45:31PM -0600, Eric Sandeen wrote:
> > Remove unused XFS_FREE_EOF_NOLOCK and make XFS_FREE_EOF_LOCK default.
> > 
> > XFS_FREE_EOF_NOLOCK is never used, so remove it, make
> > XFS_FREE_EOF_LOCK the only behavior, and remove the
> > flags parameters.
> 
> Looks good to me.  

Actually it's used by dmapi, so we have to keep it.  Would be nice if
we actually had some uptodate tree with dmapi, though..

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH] remove flags param from xfs_free_eofblocks
  2009-01-01 23:03   ` Christoph Hellwig
@ 2009-01-01 23:04     ` Eric Sandeen
  0 siblings, 0 replies; 4+ messages in thread
From: Eric Sandeen @ 2009-01-01 23:04 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs-oss

Christoph Hellwig wrote:
> On Thu, Jan 01, 2009 at 05:57:17PM -0500, Christoph Hellwig wrote:
>> On Thu, Jan 01, 2009 at 04:45:31PM -0600, Eric Sandeen wrote:
>>> Remove unused XFS_FREE_EOF_NOLOCK and make XFS_FREE_EOF_LOCK default.
>>>
>>> XFS_FREE_EOF_NOLOCK is never used, so remove it, make
>>> XFS_FREE_EOF_LOCK the only behavior, and remove the
>>> flags parameters.
>> Looks good to me.  
> 
> Actually it's used by dmapi, so we have to keep it.  Would be nice if
> we actually had some uptodate tree with dmapi, though..
> 

yep I had the wrong tree :(  sorry for the noise.

-Eric

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

end of thread, other threads:[~2009-01-01 23:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-01 22:45 [PATCH] remove flags param from xfs_free_eofblocks Eric Sandeen
2009-01-01 22:57 ` Christoph Hellwig
2009-01-01 23:03   ` Christoph Hellwig
2009-01-01 23:04     ` Eric Sandeen

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