All of lore.kernel.org
 help / color / mirror / Atom feed
From: Manfred Spraul <manfred@colorfullife.com>
To: linux-fsdevel@vger.kernel.org, zippel@linux-m68k.org,
	sct@redhat.com, akpm@zip.com.au, adilger@clusterfs.com,
	mikulas@artax.karlin.mff.cuni.cz, aia21@cantab.net
Subject: [RFC,PATCH] remove event from affs, ext3, hpfs, ntfs, ufs
Date: Sun, 27 Oct 2002 16:37:52 +0100	[thread overview]
Message-ID: <3DBC0850.6040801@colorfullife.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 478 bytes --]

Andrew merged the vfs change needed to get rid of 'event', the attached 
patch (vs. 2.5.44-mm5) removes 'event' from all filesystems.

The replacement for
    inode->i_version = event++;
is
    'inode->i_version++;
and
    inode->i_version  = 0;
in the alloc_inode callback.

Additionally, the patch fixes a merge error in ext2 - one hunk is now in 
the wrong function.

Maintainers: Can I send the change to Andrew directly or do you want to 
do that yourself?

--
    Manfred

[-- Attachment #2: patch-event-big --]
[-- Type: text/plain, Size: 7807 bytes --]

diff -u -r 2.5/fs/affs/amigaffs.c build-2.5/fs/affs/amigaffs.c
--- 2.5/fs/affs/amigaffs.c	Sun Sep 22 06:25:04 2002
+++ build-2.5/fs/affs/amigaffs.c	Sun Oct 27 16:13:44 2002
@@ -69,7 +69,7 @@
 	affs_brelse(dir_bh);
 
 	dir->i_mtime = dir->i_ctime = CURRENT_TIME;
-	dir->i_version = ++event;
+	dir->i_version++;
 	mark_inode_dirty(dir);
 
 	return 0;
@@ -121,7 +121,7 @@
 	affs_brelse(bh);
 
 	dir->i_mtime = dir->i_ctime = CURRENT_TIME;
-	dir->i_version = ++event;
+	dir->i_version++;
 	mark_inode_dirty(dir);
 
 	return retval;
diff -u -r 2.5/fs/affs/super.c build-2.5/fs/affs/super.c
--- 2.5/fs/affs/super.c	Sat Oct 26 21:04:33 2002
+++ build-2.5/fs/affs/super.c	Sun Oct 27 16:19:55 2002
@@ -92,6 +92,7 @@
 	ei = (struct affs_inode_info *)kmem_cache_alloc(affs_inode_cachep, SLAB_KERNEL);
 	if (!ei)
 		return NULL;
+	ei->vfs_inode.i_version = 0;
 	return &ei->vfs_inode;
 }
 
diff -u -r 2.5/fs/ext2/ialloc.c build-2.5/fs/ext2/ialloc.c
--- 2.5/fs/ext2/ialloc.c	Sun Oct 27 16:05:34 2002
+++ build-2.5/fs/ext2/ialloc.c	Sun Oct 27 16:18:25 2002
@@ -598,7 +598,6 @@
 	struct buffer_head *bitmap_bh = NULL;
 	int i;
 
-	inode->i_version = 0;
 	lock_super (sb);
 	es = EXT2_SB(sb)->s_es;
 	for (i = 0; i < EXT2_SB(sb)->s_groups_count; i++) {
diff -u -r 2.5/fs/ext2/inode.c build-2.5/fs/ext2/inode.c
--- 2.5/fs/ext2/inode.c	Sun Oct 27 16:05:34 2002
+++ build-2.5/fs/ext2/inode.c	Sun Oct 27 16:18:30 2002
@@ -1015,7 +1015,6 @@
 	}
 	inode->i_blksize = PAGE_SIZE;	/* This is the optimal IO size (for stat), not the fs block size */
 	inode->i_blocks = le32_to_cpu(raw_inode->i_blocks);
-	inode->i_version = 0;
 	ei->i_flags = le32_to_cpu(raw_inode->i_flags);
 	ei->i_faddr = le32_to_cpu(raw_inode->i_faddr);
 	ei->i_frag_no = raw_inode->i_frag;
diff -u -r 2.5/fs/ext2/super.c build-2.5/fs/ext2/super.c
--- 2.5/fs/ext2/super.c	Sun Oct 27 16:05:34 2002
+++ build-2.5/fs/ext2/super.c	Sun Oct 27 16:18:48 2002
@@ -159,6 +159,7 @@
 	ei->i_acl = EXT2_ACL_NOT_CACHED;
 	ei->i_default_acl = EXT2_ACL_NOT_CACHED;
 #endif
+	ei->vfs_inode.i_version = 0;
 	return &ei->vfs_inode;
 }
 
diff -u -r 2.5/fs/ext3/inode.c build-2.5/fs/ext3/inode.c
--- 2.5/fs/ext3/inode.c	Sun Oct 27 16:05:34 2002
+++ build-2.5/fs/ext3/inode.c	Sun Oct 27 16:19:13 2002
@@ -2248,7 +2248,6 @@
 					 * (for stat), not the fs block
 					 * size */  
 	inode->i_blocks = le32_to_cpu(raw_inode->i_blocks);
-	inode->i_version = ++event;
 	ei->i_flags = le32_to_cpu(raw_inode->i_flags);
 #ifdef EXT3_FRAGMENTS
 	ei->i_faddr = le32_to_cpu(raw_inode->i_faddr);
diff -u -r 2.5/fs/ext3/namei.c build-2.5/fs/ext3/namei.c
--- 2.5/fs/ext3/namei.c	Sun Oct 27 16:05:34 2002
+++ build-2.5/fs/ext3/namei.c	Sun Oct 27 15:59:24 2002
@@ -1201,7 +1201,7 @@
 	 */
 	dir->i_mtime = dir->i_ctime = CURRENT_TIME;
 	ext3_update_dx_flag(dir);
-	dir->i_version = ++event;
+	dir->i_version++;
 	ext3_mark_inode_dirty(handle, dir);
 	BUFFER_TRACE(bh, "call ext3_journal_dirty_metadata");
 	err = ext3_journal_dirty_metadata(handle, bh);
@@ -1520,7 +1520,7 @@
 						    le16_to_cpu(de->rec_len));
 			else
 				de->inode = 0;
-			dir->i_version = ++event;
+			dir->i_version++;
 			BUFFER_TRACE(bh, "call ext3_journal_dirty_metadata");
 			ext3_journal_dirty_metadata(handle, bh);
 			return 0;
@@ -1964,7 +1964,7 @@
 		ext3_warning (inode->i_sb, "ext3_rmdir",
 			      "empty directory has nlink!=2 (%d)",
 			      inode->i_nlink);
-	inode->i_version = ++event;
+	inode->i_version++;
 	inode->i_nlink = 0;
 	/* There's no need to set i_disksize: the fact that i_nlink is
 	 * zero will ensure that the right thing happens during any
@@ -2214,7 +2214,7 @@
 		if (EXT3_HAS_INCOMPAT_FEATURE(new_dir->i_sb,
 					      EXT3_FEATURE_INCOMPAT_FILETYPE))
 			new_de->file_type = old_de->file_type;
-		new_dir->i_version = ++event;
+		new_dir->i_version++;
 		BUFFER_TRACE(new_bh, "call ext3_journal_dirty_metadata");
 		ext3_journal_dirty_metadata(handle, new_bh);
 		brelse(new_bh);
diff -u -r 2.5/fs/ext3/super.c build-2.5/fs/ext3/super.c
--- 2.5/fs/ext3/super.c	Sun Oct 27 16:05:34 2002
+++ build-2.5/fs/ext3/super.c	Sun Oct 27 16:19:23 2002
@@ -433,6 +433,7 @@
 	ei->i_acl = EXT3_ACL_NOT_CACHED;
 	ei->i_default_acl = EXT3_ACL_NOT_CACHED;
 #endif
+	ei->vfs_inode.i_version = 0;
 	return &ei->vfs_inode;
 }
 
diff -u -r 2.5/fs/hpfs/dnode.c build-2.5/fs/hpfs/dnode.c
--- 2.5/fs/hpfs/dnode.c	Sat Oct 26 21:03:07 2002
+++ build-2.5/fs/hpfs/dnode.c	Sun Oct 27 16:16:21 2002
@@ -403,7 +403,7 @@
 		c = 1;
 		goto ret;
 	}	
-	i->i_version = ++event;
+	i->i_version++;
 	c = hpfs_add_to_dnode(i, dno, name, namelen, new_de, 0);
 	ret:
 	if (!cdepth) hpfs_unlock_creation(i->i_sb);
@@ -710,7 +710,7 @@
 			return 2;
 		}
 	}
-	i->i_version = ++event;
+	i->i_version++;
 	for_all_poss(i, hpfs_pos_del, (t = get_pos(dnode, de)) + 1, 1);
 	hpfs_delete_de(i->i_sb, dnode, de);
 	hpfs_mark_4buffers_dirty(qbh);
diff -u -r 2.5/fs/hpfs/inode.c build-2.5/fs/hpfs/inode.c
--- 2.5/fs/hpfs/inode.c	Sat Oct 26 21:04:37 2002
+++ build-2.5/fs/hpfs/inode.c	Sun Oct 27 16:18:09 2002
@@ -84,7 +84,6 @@
 	hpfs_inode->i_ea_uid = 0;
 	hpfs_inode->i_ea_gid = 0;
 	hpfs_inode->i_ea_size = 0;
-	i->i_version = ++event;
 
 	hpfs_inode->i_rddir_off = NULL;
 	hpfs_inode->i_dirty = 0;
diff -u -r 2.5/fs/hpfs/super.c build-2.5/fs/hpfs/super.c
--- 2.5/fs/hpfs/super.c	Sat Oct 26 21:04:37 2002
+++ build-2.5/fs/hpfs/super.c	Sun Oct 27 16:17:45 2002
@@ -166,6 +166,7 @@
 	ei = (struct hpfs_inode_info *)kmem_cache_alloc(hpfs_inode_cachep, SLAB_KERNEL);
 	if (!ei)
 		return NULL;
+	ei->vfs_inode.i_version = 0;
 	return &ei->vfs_inode;
 }
 
diff -u -r 2.5/fs/ntfs/inode.c build-2.5/fs/ntfs/inode.c
--- 2.5/fs/ntfs/inode.c	Sun Sep 22 06:25:18 2002
+++ build-2.5/fs/ntfs/inode.c	Sun Oct 27 16:10:07 2002
@@ -495,7 +495,7 @@
 	 * This is for checking whether an inode has changed w.r.t. a file so
 	 * that the file can be updated if necessary (compare with f_version).
 	 */
-	vi->i_version = ++event;
+	vi->i_version = 0;
 
 	vi->i_uid = vol->uid;
 	vi->i_gid = vol->gid;
diff -u -r 2.5/fs/ufs/dir.c build-2.5/fs/ufs/dir.c
--- 2.5/fs/ufs/dir.c	Sat Oct 26 21:02:10 2002
+++ build-2.5/fs/ufs/dir.c	Sun Oct 27 16:21:03 2002
@@ -353,7 +353,7 @@
 void ufs_set_link(struct inode *dir, struct ufs_dir_entry *de,
 		struct buffer_head *bh, struct inode *inode)
 {
-	dir->i_version = ++event;
+	dir->i_version++;
 	de->d_ino = cpu_to_fs32(dir->i_sb, inode->i_ino);
 	mark_buffer_dirty(bh);
 	if (IS_DIRSYNC(dir)) {
@@ -463,7 +463,7 @@
 	}
 	brelse (bh);
 	dir->i_mtime = dir->i_ctime = CURRENT_TIME;
-	dir->i_version = ++event;
+	dir->i_version++;
 	mark_inode_dirty(dir);
 
 	UFSD(("EXIT\n"))
@@ -504,7 +504,7 @@
 				fs16_add(sb, &pde->d_reclen,
 					fs16_to_cpu(sb, dir->d_reclen));
 			dir->d_ino = 0;
-			inode->i_version = ++event;
+			inode->i_version++;
 			inode->i_ctime = inode->i_mtime = CURRENT_TIME;
 			mark_inode_dirty(inode);
 			mark_buffer_dirty(bh);
diff -u -r 2.5/fs/ufs/inode.c build-2.5/fs/ufs/inode.c
--- 2.5/fs/ufs/inode.c	Sat Oct 26 21:04:41 2002
+++ build-2.5/fs/ufs/inode.c	Sun Oct 27 16:21:17 2002
@@ -519,7 +519,7 @@
 	inode->i_mtime = fs32_to_cpu(sb, ufs_inode->ui_mtime.tv_sec);
 	inode->i_blocks = fs32_to_cpu(sb, ufs_inode->ui_blocks);
 	inode->i_blksize = PAGE_SIZE;   /* This is the optimal IO size (for stat) */
-	inode->i_version = ++event;
+	inode->i_version++;
 	ufsi->i_flags = fs32_to_cpu(sb, ufs_inode->ui_flags);
 	ufsi->i_gen = fs32_to_cpu(sb, ufs_inode->ui_gen);
 	ufsi->i_shadow = fs32_to_cpu(sb, ufs_inode->ui_u3.ui_sun.ui_shadow);
diff -u -r 2.5/fs/ufs/super.c build-2.5/fs/ufs/super.c
--- 2.5/fs/ufs/super.c	Sat Oct 26 21:04:41 2002
+++ build-2.5/fs/ufs/super.c	Sun Oct 27 16:21:31 2002
@@ -1006,6 +1006,7 @@
 	ei = (struct ufs_inode_info *)kmem_cache_alloc(ufs_inode_cachep, SLAB_KERNEL);
 	if (!ei)
 		return NULL;
+	ei->vfs_inode.i_version = 0;
 	return &ei->vfs_inode;
 }
 

                 reply	other threads:[~2002-10-27 15:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3DBC0850.6040801@colorfullife.com \
    --to=manfred@colorfullife.com \
    --cc=adilger@clusterfs.com \
    --cc=aia21@cantab.net \
    --cc=akpm@zip.com.au \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=mikulas@artax.karlin.mff.cuni.cz \
    --cc=sct@redhat.com \
    --cc=zippel@linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.