[PATCH] Faster ext2_clear_inode()

2007-07-08 Thread Alexey Dobriyan
If CONFIG_EXT2_FS_POSIX_ACL is not configured, ext2_clear_inode() will be empty
function. However, there still will be call and immediate return which can be
avoided.

Signed-off-by: Alexey Dobriyan <[EMAIL PROTECTED]>
---

 fs/ext2/super.c |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -184,9 +184,9 @@ static void destroy_inodecache(void)
kmem_cache_destroy(ext2_inode_cachep);
 }
 
+#ifdef CONFIG_EXT2_FS_POSIX_ACL
 static void ext2_clear_inode(struct inode *inode)
 {
-#ifdef CONFIG_EXT2_FS_POSIX_ACL
struct ext2_inode_info *ei = EXT2_I(inode);
 
if (ei->i_acl && ei->i_acl != EXT2_ACL_NOT_CACHED) {
@@ -197,8 +197,10 @@ static void ext2_clear_inode(struct inode *inode)
posix_acl_release(ei->i_default_acl);
ei->i_default_acl = EXT2_ACL_NOT_CACHED;
}
-#endif
 }
+#else
+#define ext2_clear_inode NULL
+#endif
 
 static int ext2_show_options(struct seq_file *seq, struct vfsmount *vfs)
 {

-
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


inserting/deleting into/from the middle of large files?

2007-07-08 Thread Ninel Evol

'lo there, =)

having a DVB-S receiver running Linux (PPC) I found myself 
wondering how to delete data from the middle of a large file 
(stripping a recording of ads, for example - or messing 
around in a virtual disk file, etc.). Currently, the common 
way of doing this seems to be by copying the file (leaving a 
part behind) and then deleting the original. Of course, on a 
large file (say 12 GB) this can take an eternity; also you 
can run into trouble if the filesystem is nearly full...

Is it me, or doesn't that make any sense?
Having a block-oriented filesystem, operations like this 
should only take an instance.

So basically I'm looking for functions to:
- insert a chunk into a file
- delete a chunk from a file
- move a chunk from one file into another

All of the above would be very useful when dealing with 
large data, such as DVB-recordings (Linux being the nr.1 OS 
on those receivers, naturally:-).

Seeing a large file as a chain of blocks, making such an 
operation on a block-sized basis should already be easy to 
accomplish. However, if you want full support there should 
be the possibility to insert "sparse blocks" (less content 
than the usual) within a chain of blocks (including the 
beginning).

Is this already possible?
Would it be difficult to implement?

Think about it: instead of copying gigabytes with the 
drive's heads clicking around - taking minutes to hours, 
such operations could be performed in (milli)seconds.

I think that there should indeed be a standard (Posix?) for 
providing such functionality. (One call could be to 
determine if the filesystem supports those operations fast -
it could return a version for instance, 0 meaning that the 
operations, although provided, will be slow.)

What is needed in the first place however, is a filesystem 
supporting those operations - making it first choice for 
VDRs running Linux. (The others would surely follow soon 
after, at which point there should be the chance for 
establishing a standard.)


Looking forward for some enlightenment... :-)

   LC ([EMAIL PROTECTED])


-- 
Pt! Schon vom neuen GMX MultiMessenger gehört?
Der kanns mit allen: http://www.gmx.net/de/go/multimessenger
-
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html