]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] iget_locked [4/6]
authorJan Harkes <jaharkes@cs.cmu.edu>
Mon, 20 May 2002 02:25:12 +0000 (19:25 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Mon, 20 May 2002 02:25:12 +0000 (19:25 -0700)
Now that we have no more users of iget4 we can kill the function and the
associated read_inode2 callback (i.e. the 'reiserfs specific hack').

Document iget5_locked as the replacement for iget4 in filesystems/porting.

Documentation/filesystems/Locking
Documentation/filesystems/porting
fs/inode.c
include/linux/fs.h
kernel/ksyms.c

index 1acc415a99a3ef43f23d54ced9b843e21f5ac611..72288b4d8f9e13007f1d8aa36eb4d181cca7a679 100644 (file)
@@ -115,7 +115,7 @@ statfs:             yes     no      no
 remount_fs:    yes     yes     maybe           (see below)
 umount_begin:  yes     no      maybe           (see below)
 
-->read_inode() is not a method - it's a callback used in iget()/iget4().
+->read_inode() is not a method - it's a callback used in iget().
 rules for mount_sem are not too nice - it is going to die and be replaced
 by better scheme anyway.
 
index df06a180b650eb001914fad0804ca0b1bf5cba1c..ce31f689bdc2dc78e86a24703eef21a5d34820b0 100644 (file)
@@ -152,3 +152,36 @@ settles down a bit.
 s_export_op is now required for exporting a filesystem.
 isofs, ext2, ext3, resierfs, fat
 can be used as examples of very different filesystems.
+
+---
+[mandatory]
+
+iget4() and the read_inode2 callback have been superseded by iget5_locked()
+which has the following prototype,
+
+    struct inode *iget5_locked(struct super_block *sb, unsigned long ino,
+                               int (*test)(struct inode *, void *),
+                               int (*set)(struct inode *, void *),
+                               void *data);
+
+'test' is an additional function that can be used when the inode
+number is not sufficient to identify the actual file object. 'set'
+should be a non-blocking function that initializes those parts of a
+newly created inode to allow the test function to succeed. 'data' is
+passed as an opaque value to both test and set functions.
+
+When the inode has been created by iget5_locked(), it will be returned with
+the I_NEW flag set and will still be locked. read_inode has not been
+called so the file system still has to finalize the initialization. Once
+the inode is initialized it must be unlocked by calling unlock_new_inode().
+
+There is also a simpler iget_locked function that just takes the
+superblock and inode number as arguments.
+
+e.g.
+       inode = iget_locked(sb, ino);
+       if (inode->i_state & I_NEW) {
+               read_inode_from_disk(inode);
+               unlock_new_inode(inode);
+       }
+
index c56a53a35c9bfc2618bfb36cbc7f41e8cacebdee..58e41be7ee76e14ea239a76b1c70268fd42f2519 100644 (file)
@@ -669,27 +669,6 @@ EXPORT_SYMBOL(iget5_locked);
 EXPORT_SYMBOL(iget_locked);
 EXPORT_SYMBOL(unlock_new_inode);
 
-struct inode *iget4(struct super_block *sb, unsigned long ino, int (*test)(struct inode *, void *), int (*set)(struct inode *, void *), void *data)
-{
-       struct inode *inode = iget5_locked(sb, ino, test, set, data);
-
-       if (inode && (inode->i_state & I_NEW)) {
-               /* reiserfs specific hack right here.  We don't
-               ** want this to last, and are looking for VFS changes
-               ** that will allow us to get rid of it.
-               ** -- mason@suse.com 
-               */
-               if (sb->s_op->read_inode2) {
-                       sb->s_op->read_inode2(inode, data);
-               } else {
-                       sb->s_op->read_inode(inode);
-               }
-               unlock_new_inode(inode);
-       }
-
-       return inode;
-}
-
 /**
  *     insert_inode_hash - hash an inode
  *     @inode: unhashed inode
index 2f82322fb04b9df96556c22af2021eb18404de9e..4ec6c2fe76c693058ba980f9931dda3dc7148f5b 100644 (file)
@@ -769,13 +769,6 @@ struct super_operations {
 
        void (*read_inode) (struct inode *);
   
-       /* reiserfs kludge.  reiserfs needs 64 bits of information to
-       ** find an inode.  We are using the read_inode2 call to get
-       ** that information.  We don't like this, and are waiting on some
-       ** VFS changes for the real solution.
-       ** iget4 calls read_inode2, iff it is defined
-       */
-       void (*read_inode2) (struct inode *, void *) ;
        void (*dirty_inode) (struct inode *);
        void (*write_inode) (struct inode *, int);
        void (*put_inode) (struct inode *);
@@ -1212,7 +1205,6 @@ extern struct inode * iget5_locked(struct super_block *, unsigned long, int (*te
 extern struct inode * iget_locked(struct super_block *, unsigned long);
 extern void unlock_new_inode(struct inode *);
 
-extern struct inode * iget4(struct super_block *, unsigned long, int (*test)(struct inode *, void *), int (*set)(struct inode *, void *), void *);
 static inline struct inode *iget(struct super_block *sb, unsigned long ino)
 {
        struct inode *inode = iget_locked(sb, ino);
index 9001c829f4ef82975056e4991e9868c6dee96fe6..a3a721cbd42647a455d66eac8f71a5fb075cd5b6 100644 (file)
@@ -137,7 +137,6 @@ EXPORT_SYMBOL(fput);
 EXPORT_SYMBOL(fget);
 EXPORT_SYMBOL(igrab);
 EXPORT_SYMBOL(iunique);
-EXPORT_SYMBOL(iget4);
 EXPORT_SYMBOL(iput);
 EXPORT_SYMBOL(inode_init_once);
 EXPORT_SYMBOL(force_delete);