Skip to contentSkip to conversation

PATCH 2.5.2.9: ext2 unbork fs.h (part 6/7)

PATCH Jeff Garzik 1 participant 1 message Jan 7, 2002

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

patch6 desc: add sb->s_op->{alloc,destroy}_inode to VFS API

fs/Makefile +1 -1
diff -Naur -X /g/g/lib/dontdiff linux-fs5/fs/Makefile linux-fs6/fs/Makefile
@@ -7,7 +7,7 @@
 
 O_TARGET := fs.o
 
-export-objs :=	filesystems.o open.o dcache.o buffer.o bio.o
+export-objs :=	filesystems.o open.o dcache.o buffer.o bio.o inode.o
 mod-subdirs :=	nls
 
 obj-y :=	open.o read_write.o devices.o file_table.o buffer.o \
fs/inode.c +31 -11

105 lines not on this page · raw message

include/linux/fs.h +4 -8
diff -Naur -X /g/g/lib/dontdiff linux-fs5/include/linux/fs.h linux-fs6/include/linux/fs.h
@@ -885,6 +885,8 @@
 	int (*remount_fs) (struct super_block *, int *, char *);
 	void (*clear_inode) (struct inode *);
 	void (*umount_begin) (struct super_block *);
+	struct inode * (*alloc_inode) (struct super_block *);
+	void (*destroy_inode) (struct inode *);
 
 	/* Following are for knfsd to interact with "interesting" filesystems
 	 * Currently just reiserfs, but possibly FAT and others later
@@ -1345,17 +1347,11 @@
 }
 
 extern void clear_inode(struct inode *);
-extern struct inode * get_empty_inode(void);
+extern struct inode * get_empty_inode(struct super_block *);
 
 static inline struct inode * new_inode(struct super_block *sb)
 {
-	struct inode *inode = get_empty_inode();
-	if (inode) {
-		inode->i_sb = sb;
-		inode->i_dev = sb->s_dev;
-		inode->i_blkbits = sb->s_blocksize_bits;
-	}
-	return inode;
+	return get_empty_inode(sb);
 }
 extern void remove_suid(struct inode *inode);
 
net/socket.c +1 -1
diff -Naur -X /g/g/lib/dontdiff linux-fs5/net/socket.c linux-fs6/net/socket.c
@@ -440,7 +440,7 @@
 	struct inode * inode;
 	struct socket * sock;
 
-	inode = get_empty_inode();
+	inode = get_empty_inode(NULL);
 	if (!inode)
 		return NULL;