Skip to contentSkip to conversation

slab ctor prototype change

PATCH In review Manfred Spraul 5 participants 9 messages Oct 31, 2002 – Nov 2, 2002

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

PATCH 1/1 slab ctor prototype change

The patch adds a return value to the ctor callback for custom slab caches: this is needed for complex constructors, for example for constructors that internally allocate further memory.

This was always the intention of the constructors - the GFP_ATOMIC flag is forwarded to the constructor, but without the ability to fail it was useless.
The patch is quite large because it changes the prototype of the slab constructor, and every filesystem has a custom slab with a constructor.

Sent to Linus a few minutes ago.

--
Manfred

// $Header$
// Kernel Version:

//  VERSION = 2
//  PATCHLEVEL = 5
//  SUBLEVEL = 45
//  EXTRAVERSION =
include/linux/slab.h +2 -2
@@ -50,8 +50,8 @@
 
 extern kmem_cache_t *kmem_find_general_cachep(size_t, int gfpflags);
 extern kmem_cache_t *kmem_cache_create(const char *, size_t, size_t, unsigned long,
-				       void (*)(void *, kmem_cache_t *, unsigned long),
-				       void (*)(void *, kmem_cache_t *, unsigned long));
+				       int (*ctor)(void *, kmem_cache_t *, unsigned long),
+				       void (*dtor)(void *, kmem_cache_t *, unsigned long));
 extern int kmem_cache_destroy(kmem_cache_t *);
 extern int kmem_cache_shrink(kmem_cache_t *);
 extern void *kmem_cache_alloc(kmem_cache_t *, int);
mm/slab.c +59 -9

133 lines not on this page · raw message

./fs/xfs/linux/xfs_super.c +2 -1
@@ -362,7 +362,7 @@
 	kmem_cache_free(linvfs_inode_cachep, LINVFS_GET_VP(inode));
 }
 
-STATIC void
+STATIC int 
 init_once(
 	void			*data,
 	kmem_cache_t		*cachep,
@@ -373,6 +373,7 @@
 	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
 	    SLAB_CTOR_CONSTRUCTOR)
 		inode_init_once(LINVFS_GET_IP(vp));
+	return 0;
 }
 
 STATIC int
./fs/jfs/super.c +2 -1
@@ -395,7 +395,7 @@
 extern void txExit(void);
 extern void metapage_exit(void);
 
-static void init_once(void *foo, kmem_cache_t * cachep, unsigned long flags)
+static int init_once(void *foo, kmem_cache_t * cachep, unsigned long flags)
 {
 	struct jfs_inode_info *jfs_ip = (struct jfs_inode_info *) foo;
 
@@ -409,6 +409,7 @@
 		jfs_ip->active_ag = -1;
 		inode_init_once(&jfs_ip->vfs_inode);
 	}
+	return 0;
 }
 
 static int __init init_jfs_fs(void)
./fs/jfs/jfs_metapage.c +2 -1
@@ -90,7 +90,7 @@
 static kmem_cache_t *metapage_cache;
 static mempool_t *metapage_mempool;
 
-static void init_once(void *foo, kmem_cache_t *cachep, unsigned long flags)
+static int init_once(void *foo, kmem_cache_t *cachep, unsigned long flags)
 {
 	struct metapage *mp = (struct metapage *)foo;
 
@@ -105,6 +105,7 @@
 		set_bit(META_free, &mp->flag);
 		init_waitqueue_head(&mp->wait);
 	}
+	return 0;
 }
 
 static inline struct metapage *alloc_metapage(int no_wait)
./fs/nfs/inode.c +2 -1
@@ -1548,7 +1548,7 @@
 	kmem_cache_free(nfs_inode_cachep, NFS_I(inode));
 }
 
-static void init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
+static int init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
 {
 	struct nfs_inode *nfsi = (struct nfs_inode *) foo;
 
@@ -1565,6 +1565,7 @@
 		nfsi->npages = 0;
 		init_waitqueue_head(&nfsi->nfs_i_wait);
 	}
+	return 0;
 }
  
 int nfs_init_inodecache(void)
./fs/hfs/super.c +2 -1
@@ -58,13 +58,14 @@
 	kmem_cache_free(hfs_inode_cachep, HFS_I(inode));
 }
 
-static void init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
+static int init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
 {
 	struct hfs_inode_info *ei = (struct hfs_inode_info *) foo;
 
 	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
 	    SLAB_CTOR_CONSTRUCTOR)
 		inode_init_once(&ei->vfs_inode);
+	return 0;
 }
  
 static int init_inodecache(void)
./fs/ufs/super.c +2 -1
@@ -1014,13 +1014,14 @@
 	kmem_cache_free(ufs_inode_cachep, UFS_I(inode));
 }
 
-static void init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
+static int init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
 {
 	struct ufs_inode_info *ei = (struct ufs_inode_info *) foo;
 
 	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
 	    SLAB_CTOR_CONSTRUCTOR)
 		inode_init_once(&ei->vfs_inode);
+	return 0;
 }
  
 static int init_inodecache(void)
./fs/jffs2/super.c +2 -1
@@ -46,7 +46,7 @@
 	kmem_cache_free(jffs2_inode_cachep, JFFS2_INODE_INFO(inode));
 }
 
-static void jffs2_i_init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
+static int jffs2_i_init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
 {
 	struct jffs2_inode_info *ei = (struct jffs2_inode_info *) foo;
 
@@ -55,6 +55,7 @@
 		init_MUTEX(&ei->sem);
 		inode_init_once(&ei->vfs_inode);
 	}
+	return 0;
 }
 
 static struct super_operations jffs2_super_operations =
./fs/coda/inode.c +2 -1
@@ -56,13 +56,14 @@
 	kmem_cache_free(coda_inode_cachep, ITOC(inode));
 }
 
-static void init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
+static int init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
 {
 	struct coda_inode_info *ei = (struct coda_inode_info *) foo;
 
 	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
 	    SLAB_CTOR_CONSTRUCTOR)
 		inode_init_once(&ei->vfs_inode);
+	return 0;
 }
  
 int coda_init_inodecache(void)
./fs/ext2/super.c +2 -1
@@ -165,7 +165,7 @@
 	kmem_cache_free(ext2_inode_cachep, EXT2_I(inode));
 }
 
-static void init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
+static int init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
 {
 	struct ext2_inode_info *ei = (struct ext2_inode_info *) foo;
 
@@ -174,6 +174,7 @@
 		rwlock_init(&ei->i_meta_lock);
 		inode_init_once(&ei->vfs_inode);
 	}
+	return 0;
 }
  
 static int init_inodecache(void)
./fs/adfs/super.c +2 -1
@@ -220,13 +220,14 @@
 	kmem_cache_free(adfs_inode_cachep, ADFS_I(inode));
 }
 
-static void init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
+static int init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
 {
 	struct adfs_inode_info *ei = (struct adfs_inode_info *) foo;
 
 	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
 	    SLAB_CTOR_CONSTRUCTOR)
 		inode_init_once(&ei->vfs_inode);
+	return 0;
 }
  
 static int init_inodecache(void)
./fs/udf/super.c +2 -1
@@ -127,13 +127,14 @@
 	kmem_cache_free(udf_inode_cachep, UDF_I(inode));
 }
 
-static void init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
+static int init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
 {
 	struct udf_inode_info *ei = (struct udf_inode_info *) foo;
 
 	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
 	    SLAB_CTOR_CONSTRUCTOR)
 		inode_init_once(&ei->vfs_inode);
+	return 0;
 }
  
 static int init_inodecache(void)
./fs/proc/inode.c +2 -1
@@ -109,13 +109,14 @@
 	kmem_cache_free(proc_inode_cachep, PROC_I(inode));
 }
 
-static void init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
+static int init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
 {
 	struct proc_inode *ei = (struct proc_inode *) foo;
 
 	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
 	    SLAB_CTOR_CONSTRUCTOR)
 		inode_init_once(&ei->vfs_inode);
+	return 0;
 }
  
 int __init proc_init_inodecache(void)
./fs/bfs/inode.c +2 -1
@@ -226,13 +226,14 @@
 	kmem_cache_free(bfs_inode_cachep, BFS_I(inode));
 }
 
-static void init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
+static int init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
 {
 	struct bfs_inode_info *bi = foo;
 
 	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
 	    SLAB_CTOR_CONSTRUCTOR)
 		inode_init_once(&bi->vfs_inode);
+	return 0;
 }
  
 static int init_inodecache(void)
./fs/reiserfs/super.c +2 -1
@@ -424,7 +424,7 @@
 	kmem_cache_free(reiserfs_inode_cachep, REISERFS_I(inode));
 }
 
-static void init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
+static int init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
 {
 	struct reiserfs_inode_info *ei = (struct reiserfs_inode_info *) foo;
 
@@ -433,6 +433,7 @@
 		INIT_LIST_HEAD(&ei->i_prealloc_list) ;
 		inode_init_once(&ei->vfs_inode);
 	}
+	return 0;
 }
  
 static int init_inodecache(void)
./fs/ncpfs/inode.c +2 -1
@@ -56,7 +56,7 @@
 	kmem_cache_free(ncp_inode_cachep, NCP_FINFO(inode));
 }
 
-static void init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
+static int init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
 {
 	struct ncp_inode_info *ei = (struct ncp_inode_info *) foo;
 
@@ -65,6 +65,7 @@
 		init_MUTEX(&ei->open_sem);
 		inode_init_once(&ei->vfs_inode);
 	}
+	return 0;
 }
  
 static int init_inodecache(void)
./fs/ntfs/super.c +2 -1
@@ -1598,7 +1598,7 @@
 kmem_cache_t *ntfs_big_inode_cache;
 
 /* Init once constructor for the inode slab cache. */
-static void ntfs_big_inode_init_once(void *foo, kmem_cache_t *cachep,
+static int ntfs_big_inode_init_once(void *foo, kmem_cache_t *cachep,
 		unsigned long flags)
 {
 	ntfs_inode *ni = (ntfs_inode *)foo;
@@ -1606,6 +1606,7 @@
 	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
 			SLAB_CTOR_CONSTRUCTOR)
 		inode_init_once(VFS_I(ni));
+	return 0;
 }
 
 /*
./fs/sysv/inode.c +2 -1
@@ -301,13 +301,14 @@
 	kmem_cache_free(sysv_inode_cachep, SYSV_I(inode));
 }
 
-static void init_once(void *p, kmem_cache_t *cachep, unsigned long flags)
+static int init_once(void *p, kmem_cache_t *cachep, unsigned long flags)
 {
 	struct sysv_inode_info *si = (struct sysv_inode_info *)p;
 
 	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
 			SLAB_CTOR_CONSTRUCTOR)
 		inode_init_once(&si->vfs_inode);
+	return 0;
 }
 
 struct super_operations sysv_sops = {
./fs/hpfs/super.c +2 -1
@@ -174,7 +174,7 @@
 	kmem_cache_free(hpfs_inode_cachep, hpfs_i(inode));
 }
 
-static void init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
+static int init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
 {
 	struct hpfs_inode_info *ei = (struct hpfs_inode_info *) foo;
 
@@ -183,6 +183,7 @@
 		init_MUTEX(&ei->i_sem);
 		inode_init_once(&ei->vfs_inode);
 	}
+	return 0;
 }
  
 static int init_inodecache(void)
./fs/fat/inode.c +2 -1
@@ -672,7 +672,7 @@
 	kmem_cache_free(fat_inode_cachep, MSDOS_I(inode));
 }
 
-static void init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
+static int init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
 {
 	struct msdos_inode_info *ei = (struct msdos_inode_info *) foo;
 
@@ -681,6 +681,7 @@
 		INIT_LIST_HEAD(&ei->i_fat_hash);
 		inode_init_once(&ei->vfs_inode);
 	}
+	return 0;
 }
  
 int __init fat_init_inodecache(void)
./fs/ext3/super.c +2 -1
@@ -464,7 +464,7 @@
 	kmem_cache_free(ext3_inode_cachep, EXT3_I(inode));
 }
 
-static void init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
+static int init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
 {
 	struct ext3_inode_info *ei = (struct ext3_inode_info *) foo;
 
@@ -474,6 +474,7 @@
 		init_rwsem(&ei->truncate_sem);
 		inode_init_once(&ei->vfs_inode);
 	}
+	return 0;
 }
  
 static int init_inodecache(void)
./fs/smbfs/inode.c +2 -1
@@ -64,13 +64,14 @@
 	kmem_cache_free(smb_inode_cachep, SMB_I(inode));
 }
 
-static void init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
+static int init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
 {
 	struct smb_inode_info *ei = (struct smb_inode_info *) foo;
 	unsigned long flagmask = SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR;
 
 	if ((flags & flagmask) == SLAB_CTOR_CONSTRUCTOR)
 		inode_init_once(&ei->vfs_inode);
+	return 0;
 }
  
 static int init_inodecache(void)
./fs/isofs/inode.c +2 -1
@@ -92,13 +92,14 @@
 	kmem_cache_free(isofs_inode_cachep, ISOFS_I(inode));
 }
 
-static void init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
+static int init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
 {
 	struct iso_inode_info *ei = (struct iso_inode_info *) foo;
 
 	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
 	    SLAB_CTOR_CONSTRUCTOR)
 		inode_init_once(&ei->vfs_inode);
+	return 0;
 }
  
 static int init_inodecache(void)
./fs/efs/super.c +2 -1
@@ -44,13 +44,14 @@
 	kmem_cache_free(efs_inode_cachep, INODE_INFO(inode));
 }
 
-static void init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
+static int init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
 {
 	struct efs_inode_info *ei = (struct efs_inode_info *) foo;
 
 	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
 	    SLAB_CTOR_CONSTRUCTOR)
 		inode_init_once(&ei->vfs_inode);
+	return 0;
 }
  
 static int init_inodecache(void)
./fs/affs/super.c +2 -1
@@ -100,7 +100,7 @@
 	kmem_cache_free(affs_inode_cachep, AFFS_I(inode));
 }
 
-static void init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
+static int init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
 {
 	struct affs_inode_info *ei = (struct affs_inode_info *) foo;
 
@@ -110,6 +110,7 @@
 		init_MUTEX(&ei->i_ext_lock);
 		inode_init_once(&ei->vfs_inode);
 	}
+	return 0;
 }
 
 static int init_inodecache(void)
./fs/romfs/inode.c +2 -1
@@ -563,13 +563,14 @@
 	kmem_cache_free(romfs_inode_cachep, ROMFS_I(inode));
 }
 
-static void init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
+static int init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
 {
 	struct romfs_inode_info *ei = (struct romfs_inode_info *) foo;
 
 	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
 	    SLAB_CTOR_CONSTRUCTOR)
 		inode_init_once(&ei->vfs_inode);
+	return 0;
 }
  
 static int init_inodecache(void)
./fs/minix/inode.c +2 -1
@@ -65,13 +65,14 @@
 	kmem_cache_free(minix_inode_cachep, minix_i(inode));
 }
 
-static void init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
+static int init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
 {
 	struct minix_inode_info *ei = (struct minix_inode_info *) foo;
 
 	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
 	    SLAB_CTOR_CONSTRUCTOR)
 		inode_init_once(&ei->vfs_inode);
+	return 0;
 }
  
 static int init_inodecache(void)
./fs/qnx4/inode.c +2 -1
@@ -520,7 +520,7 @@
 	kmem_cache_free(qnx4_inode_cachep, qnx4_i(inode));
 }
 
-static void init_once(void *foo, kmem_cache_t * cachep,
+static int init_once(void *foo, kmem_cache_t * cachep,
 		      unsigned long flags)
 {
 	struct qnx4_inode_info *ei = (struct qnx4_inode_info *) foo;
@@ -528,6 +528,7 @@
 	if ((flags & (SLAB_CTOR_VERIFY | SLAB_CTOR_CONSTRUCTOR)) ==
 	    SLAB_CTOR_CONSTRUCTOR)
 		inode_init_once(&ei->vfs_inode);
+	return 0;
 }
 
 static int init_inodecache(void)
./fs/befs/linuxvfs.c +2 -1
@@ -293,7 +293,7 @@
         kmem_cache_free(befs_inode_cachep, BEFS_I(inode));
 }
 
-static void init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
+static int init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
 {
         struct befs_inode_info *bi = (struct befs_inode_info *) foo;
 	
@@ -301,6 +301,7 @@
 		            SLAB_CTOR_CONSTRUCTOR) {
 			inode_init_once(&bi->vfs_inode);
 		}
+	return 0;
 }
 
 static void
./fs/cifs/cifsfs.c +2 -1
@@ -296,7 +296,7 @@
 	.release = cifs_closedir,
 };
 
-static void
+static int 
 cifs_init_once(void *inode, kmem_cache_t * cachep, unsigned long flags)
 {
 	struct cifsInodeInfo *cifsi = (struct cifsInodeInfo *) inode;
@@ -306,6 +306,7 @@
 		inode_init_once(&cifsi->vfs_inode);
 		INIT_LIST_HEAD(&cifsi->lockList);
 	}
+	return 0;
 }
 
 int
./fs/afs/super.c +2 -1
@@ -541,7 +541,7 @@
  * initialise an inode cache slab element prior to any use
  */
 #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
-static void afs_i_init_once(void *_vnode, kmem_cache_t *cachep, unsigned long flags)
+static int afs_i_init_once(void *_vnode, kmem_cache_t *cachep, unsigned long flags)
 {
 	afs_vnode_t *vnode = (afs_vnode_t *) _vnode;
 
@@ -554,6 +554,7 @@
 		INIT_LIST_HEAD(&vnode->cb_hash_link);
 		afs_timer_init(&vnode->cb_timeout,&afs_vnode_cb_timed_out_ops);
 	}
+	return 0;
 
 } /* end afs_i_init_once() */
 #endif
./fs/buffer.c +2 -1
@@ -2609,7 +2609,7 @@
 }
 EXPORT_SYMBOL(free_buffer_head);
 
-static void init_buffer_head(void *data, kmem_cache_t *cachep, unsigned long flags)
+static int init_buffer_head(void *data, kmem_cache_t *cachep, unsigned long flags)
 {
 	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
 			    SLAB_CTOR_CONSTRUCTOR) {
@@ -2618,6 +2618,7 @@
 		memset(bh, 0, sizeof(*bh));
 		INIT_LIST_HEAD(&bh->b_assoc_buffers);
 	}
+	return 0;
 }
 
 static void *bh_mempool_alloc(int gfp_mask, void *pool_data)
./fs/block_dev.c +2 -1
@@ -223,7 +223,7 @@
 	 ((struct block_device *) kmem_cache_alloc(bdev_cachep, SLAB_KERNEL))
 #define destroy_bdev(bdev) kmem_cache_free(bdev_cachep, (bdev))
 
-static void init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
+static int init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
 {
 	struct block_device * bdev = (struct block_device *) foo;
 
@@ -234,6 +234,7 @@
 		sema_init(&bdev->bd_sem, 1);
 		INIT_LIST_HEAD(&bdev->bd_inodes);
 	}
+	return 0;
 }
 
 void __init bdev_cache_init(void)
./fs/char_dev.c +2 -1
@@ -20,7 +20,7 @@
 	 ((struct char_device *) kmem_cache_alloc(cdev_cachep, SLAB_KERNEL))
 #define destroy_cdev(cdev) kmem_cache_free(cdev_cachep, (cdev))
 
-static void init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
+static int init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
 {
 	struct char_device * cdev = (struct char_device *) foo;
 
@@ -30,6 +30,7 @@
 		memset(cdev, 0, sizeof(*cdev));
 		sema_init(&cdev->sem, 1);
 	}
+	return 0;
 }
 
 void __init cdev_cache_init(void)
./fs/inode.c +2 -1
@@ -181,13 +181,14 @@
 	INIT_LIST_HEAD(&inode->i_data.i_mmap_shared);
 }
 
-static void init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
+static int init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
 {
 	struct inode * inode = (struct inode *) foo;
 
 	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
 	    SLAB_CTOR_CONSTRUCTOR)
 		inode_init_once(inode);
+	return 0;
 }
 
 /*
./fs/locks.c +3 -2
@@ -195,15 +195,16 @@
  * Initialises the fields of the file lock which are invariant for
  * free file_locks.
  */
-static void init_once(void *foo, kmem_cache_t *cache, unsigned long flags)
+static int init_once(void *foo, kmem_cache_t *cache, unsigned long flags)
 {
 	struct file_lock *lock = (struct file_lock *) foo;
 
 	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) !=
 					SLAB_CTOR_CONSTRUCTOR)
-		return;
+		return 0;
 
 	locks_init_lock(lock);
+	return 0;
 }
 
 /*
./lib/radix-tree.c +2 -1
@@ -338,9 +338,10 @@
 }
 EXPORT_SYMBOL(radix_tree_delete);
 
-static void radix_tree_node_ctor(void *node, kmem_cache_t *cachep, unsigned long flags)
+static int radix_tree_node_ctor(void *node, kmem_cache_t *cachep, unsigned long flags)
 {
 	memset(node, 0, sizeof(struct radix_tree_node));
+	return 0;
 }
 
 static void *radix_tree_node_pool_alloc(int gfp_mask, void *data)
./mm/rmap.c +2 -1
@@ -514,11 +514,12 @@
  ** functions.
  **/
 
-static void pte_chain_ctor(void *p, kmem_cache_t *cachep, unsigned long flags)
+static int pte_chain_ctor(void *p, kmem_cache_t *cachep, unsigned long flags)
 {
 	struct pte_chain *pc = p;
 
 	memset(pc, 0, sizeof(*pc));
+	return 0;
 }
 
 void __init pte_chain_init(void)
./mm/shmem.c +2 -1
@@ -1739,7 +1739,7 @@
 	kmem_cache_free(shmem_inode_cachep, SHMEM_I(inode));
 }
 
-static void init_once(void *foo, kmem_cache_t *cachep, unsigned long flags)
+static int init_once(void *foo, kmem_cache_t *cachep, unsigned long flags)
 {
 	struct shmem_inode_info *p = (struct shmem_inode_info *) foo;
 
@@ -1747,6 +1747,7 @@
 	    SLAB_CTOR_CONSTRUCTOR) {
 		inode_init_once(&p->vfs_inode);
 	}
+	return 0;
 }
 
 static int init_inodecache(void)
./net/core/skbuff.c +2 -1
@@ -225,7 +225,7 @@
 /*
  *	Slab constructor for a skb head.
  */
-static inline void skb_headerinit(void *p, kmem_cache_t *cache,
+static inline int skb_headerinit(void *p, kmem_cache_t *cache,
 				  unsigned long flags)
 {
 	struct sk_buff *skb = p;
@@ -257,6 +257,7 @@
 #ifdef CONFIG_NET_SCHED
 	skb->tc_index	  = 0;
 #endif
+	return 0;
 }
 
 static void skb_drop_fraglist(struct sk_buff *skb)
./net/socket.c +2 -1
@@ -297,13 +297,14 @@
 			container_of(inode, struct socket_alloc, vfs_inode));
 }
 
-static void init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
+static int init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
 {
 	struct socket_alloc *ei = (struct socket_alloc *) foo;
 
 	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
 	    SLAB_CTOR_CONSTRUCTOR)
 		inode_init_once(&ei->vfs_inode);
+	return 0;
 }
  
 static int init_inodecache(void)
#1 lore raw

Question about ongoing projects

Hi,

I was wondering if anyone was working on a file-system that worked with large blocks (i.e. 64KB). This would be quite useful when working with large RAID array.

I would look in the archives, but there isn't one listed in 'http://vger.kernel.org/vger-lists.html'.

Thanks.
Peter Ashford

#2 lore raw

Re: Question about ongoing projects

Quoted 5 lines · Peter L. Ashford

Hi,

I was wondering if anyone was working on a file-system that worked with large blocks (i.e. 64KB). This would be quite useful when working with large RAID array.

XFS supports 64KB blocksizes (that's the upper bound for XFS atm).

cheers.

Signature · 1 line
Nathan
#3 lore raw

Re: Question about ongoing projects

Nathan,

Quoted 5 lines
Quoted 3 lines

I was wondering if anyone was working on a file-system that worked with large blocks (i.e. 64KB). This would be quite useful when working with large RAID array.

XFS supports 64KB blocksizes (that's the upper bound for XFS atm).

I worked with XFS under IRIX. It seemed to be fairly good. The benchmarks on large PC file servers also look good. I wouldn't mind using it.

However, according to the man page for mkfs.XFS, the Linux implementation only supports 4KB blocks. Has SGI finished the XFS port, removing this limitation? If so, in what kernel?

Thanks.
Peter Ashford

#4 lore raw

Re: Question about ongoing projects

Quoted 8 lines · Peter L. Ashford

Nathan,

Quoted 5 lines
Quoted 3 lines

I was wondering if anyone was working on a file-system that worked with large blocks (i.e. 64KB). This would be quite useful when working with large RAID array.

XFS supports 64KB blocksizes (that's the upper bound for XFS atm).

Quoted 7 lines

I worked with XFS under IRIX. It seemed to be fairly good. The benchmarks on large PC file servers also look good. I wouldn't mind using it.

However, according to the man page for mkfs.XFS, the Linux implementation only supports 4KB blocks. Has SGI finished the XFS port, removing this limitation? If so, in what kernel?

Well I wouldn't say the port is finished - there are still several unsupported components from IRIX and a number of planned features, fixes, etc.

But your man page is no longer correct (did it say 4K explicitly?
- I can't recall - the actual restriction was the page size); new versions of xfsprogs have an updated mkfs.xfs.8 which now states:
"XFS on Linux currently only supports pagesize or smaller blocks."

This has been available in CVS for several months now, and the XFS code in the 2.5 kernels has always supported multiple blocksizes. The first "official" Linux/XFS release to support different block sizes will be the 1.2 release (rsn) - I don't remember the actual kernel version where this first went in though.

cheers.

Signature · 1 line
Nathan
#5 lore raw

Re: Question about ongoing projects

Nathan,

< Snip answered questions >

Quoted 4 lines
Quoted 3 lines

However, according to the man page for mkfs.XFS, the Linux implementation only supports 4KB blocks. Has SGI finished the XFS port, removing this limitation? If so, in what kernel?

Quoted 8 lines

Well I wouldn't say the port is finished - there are still several unsupported components from IRIX and a number of planned features, fixes, etc.

But your man page is no longer correct (did it say 4K explicitly?
- I can't recall - the actual restriction was the page size); new versions of xfsprogs have an updated mkfs.xfs.8 which now states:
"XFS on Linux currently only supports pagesize or smaller blocks."

The man page installed with RedHat 7.3 is the same as can be found at 'http://oss.sgi.com/projects/xfs/manpages/mkfs.xfs.html'. Under the '-b' option, it explicitly states 4KB.

The features page ('http://oss.sgi.com/projects/xfs/features.html') specifies page size.

Quoted 5 lines

This has been available in CVS for several months now, and the XFS code in the 2.5 kernels has always supported multiple blocksizes. The first "official" Linux/XFS release to support different block sizes will be the 1.2 release (rsn) - I don't remember the actual kernel version where this first went in though.

This information is contrary to the information in 'http://oss.sgi.com/projects/xfs/todos.html', which says:

There are no plans to implement the following features in XFS for Linux.

2. Multiple filesystem blocksize support for block size > page size

Thanks.
Peter Ashford

#6 lore raw

Re: Question about ongoing projects

Quoted 4 lines · Peter L. Ashford

The man page installed with RedHat 7.3 is the same as can be found at 'http://oss.sgi.com/projects/xfs/manpages/mkfs.xfs.html'. Under the '-b' option, it explicitly states 4KB.

The web site is stale here.

Quoted 10 lines

The features page ('http://oss.sgi.com/projects/xfs/features.html') specifies page size.

Quoted 5 lines

This has been available in CVS for several months now, and the XFS code in the 2.5 kernels has always supported multiple blocksizes. The first "official" Linux/XFS release to support different block sizes will be the 1.2 release (rsn) - I don't remember the actual kernel version where this first went in though.

Quoted 7 lines

This information is contrary to the information in 'http://oss.sgi.com/projects/xfs/todos.html', which says:

There are no plans to implement the following features in XFS for Linux.

2. Multiple filesystem blocksize support for block size > page size

That's different, variable blocksizes less than the system page size is what we added. Sizes larger than a page size lead to all sorts of issues, I am not sure there are any linux filesystems which support this. Linus had talked about bumping the PAGE_CACHE_SIZE to be larger than PAGE_SIZE. That would have given us support for larger block sizes, but it seems to have fallen by the wayside somewhere.

Steve

Signature · 2 lines
Steve Lord                                      voice: +1-651-683-3511
Principal Engineer, Filesystem Software         email: [email protected]
#7 lore raw

Re: Question about ongoing projects

Quoted 11 lines · Steve Lord
Quoted 2 lines · Peter L. Ashford

...
2. Multiple filesystem blocksize support for block size > page size

That's different, variable blocksizes less than the system page size is what we added. Sizes larger than a page size lead to all sorts of issues, I am not sure there are any linux filesystems which support this. Linus had talked about bumping the PAGE_CACHE_SIZE to be larger than PAGE_SIZE. That would have given us support for larger block sizes, but it seems to have fallen by the wayside somewhere.

Yes, sorry - I should have pointed that out too. So, if you want to use 64KB blocks you need a platform which can support pages of that size - I've run XFS on an IA64 Linux machine with 64KB pages and a 64KB filesystem blocksize in the past, so that's definately feasible.

cheers.

Signature · 1 line
Nathan
#8 lore raw

RE: Question about ongoing projects

Ah - but here's a follow-up question:

Is anyone doing large page/block support for IA32 platforms? *That* would be excellent.

If so, how can such support be made to work?

Thanks,

Eff Norwood

Quoted 5 lines

Yes, sorry - I should have pointed that out too. So, if you want to use 64KB blocks you need a platform which can support pages of that size - I've run XFS on an IA64 Linux machine with 64KB pages and a 64KB filesystem blocksize in the past, so that's definately feasible.