linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fix udf reservation discarding
@ 2004-12-12 13:38 Christoph Hellwig
  0 siblings, 0 replies; only message in thread
From: Christoph Hellwig @ 2004-12-12 13:38 UTC (permalink / raw)
  To: akpm; +Cc: linux-fsdevel

UDF discards file preallocations on every ->put_inode which is totally
bogus.  It already discards them in ->release which makes sense for
normal writes, so the only additional discard is in ->clear_inode so we
make sure we don't leak any reservations for shared writeable mappings.

This follows similar changes to ext2 and ext3.

(This patch needs to be applied after the iget patch)


--- 1.42/fs/udf/inode.c	2004-09-17 08:58:42 +02:00
+++ edited/fs/udf/inode.c	2004-12-12 14:00:57 +01:00
@@ -70,30 +70,6 @@
 static int udf_get_block(struct inode *, sector_t, struct buffer_head *, int);
 
 /*
- * udf_put_inode
- *
- * PURPOSE
- *
- * DESCRIPTION
- *	This routine is called whenever the kernel no longer needs the inode.
- *
- * HISTORY
- *	July 1, 1997 - Andrew E. Mileski
- *	Written, tested, and released.
- *
- *  Called at each iput()
- */
-void udf_put_inode(struct inode * inode)
-{
-	if (!(inode->i_sb->s_flags & MS_RDONLY))
-	{
-		lock_kernel();
-		udf_discard_prealloc(inode);
-		unlock_kernel();
-	}
-}
-
-/*
  * udf_delete_inode
  *
  * PURPOSE
@@ -129,6 +105,12 @@
 
 void udf_clear_inode(struct inode *inode)
 {
+	if (!(inode->i_sb->s_flags & MS_RDONLY)) {
+		lock_kernel();
+		udf_discard_prealloc(inode);
+		unlock_kernel();
+	}
+
 	kfree(UDF_I_DATA(inode));
 	UDF_I_DATA(inode) = NULL;
 }
--- 1.45/fs/udf/super.c	2004-09-09 20:49:06 +02:00
+++ edited/fs/udf/super.c	2004-12-12 14:02:19 +01:00
@@ -163,7 +163,6 @@
 	.alloc_inode		= udf_alloc_inode,
 	.destroy_inode		= udf_destroy_inode,
 	.write_inode		= udf_write_inode,
-	.put_inode		= udf_put_inode,
 	.delete_inode		= udf_delete_inode,
 	.clear_inode		= udf_clear_inode,
 	.put_super		= udf_put_super,
--- 1.18/fs/udf/udfdecl.h	2004-09-17 08:58:42 +02:00
+++ edited/fs/udf/udfdecl.h	2004-12-10 20:12:58 +01:00
@@ -96,7 +96,6 @@
 extern struct buffer_head * udf_bread(struct inode *, int, int, int *);
 extern void udf_truncate(struct inode *);
 extern void udf_read_inode(struct inode *);
-extern void udf_put_inode(struct inode *);
 extern void udf_delete_inode(struct inode *);
 extern void udf_clear_inode(struct inode *);
 extern int udf_write_inode(struct inode *, int);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-12-12 13:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-12 13:38 [PATCH] fix udf reservation discarding Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).