#include "afs/sysincludes.h"
#include "afsincludes.h"
#include "afs/afs_stats.h"
-#include "h/smp_lock.h"
+#include <linux/smp_lock.h>
+#include "osi_compat.h"
struct vcache *afs_globalVp = 0;
struct vfs *afs_globalVFS = 0;
#else
static struct superblock *
afs_get_sb(struct file_system_type *fs_type, int flags,
- const char *dev_name, void *data)
+ const char *dev_name, void *data) {
return get_sb_nodev(fs_type, flags, data, afs_fill_super);
}
#endif
__module_get(THIS_MODULE);
afs_globalVFS = sb;
+ sb->s_flags |= MS_NOATIME;
sb->s_blocksize = 1024;
sb->s_blocksize_bits = 10;
sb->s_magic = AFS_VFSMAGIC;
#if defined(HAVE_BDI_INIT)
bdi_init(&afs_backing_dev_info);
#endif
+#if defined (STRUCT_SUPER_BLOCK_HAS_S_BDI)
+ sb->s_bdi = &afs_backing_dev_info;
+ /* The name specified here will appear in the flushing thread name - flush-afs */
+ bdi_register(&afs_backing_dev_info, NULL, "afs");
+#endif
#if !defined(AFS_NONFSTRANS)
sb->s_export_op = &afs_export_ops;
#endif
code = afs_root(sb);
if (code) {
afs_globalVFS = NULL;
+ osi_linux_free_inode_pages();
module_put(THIS_MODULE);
}
#if defined(STRUCT_SUPER_HAS_ALLOC_INODE)
-#if defined(HAVE_KMEM_CACHE_T)
-static kmem_cache_t *afs_inode_cachep;
-#else
-struct kmem_cache *afs_inode_cachep;
-#endif
+static afs_kmem_cache_t *afs_inode_cachep;
static struct inode *
afs_alloc_inode(struct super_block *sb)
{
struct vcache *vcp;
-#if defined(SLAB_KERNEL)
- vcp = (struct vcache *) kmem_cache_alloc(afs_inode_cachep, SLAB_KERNEL);
-#else
- vcp = (struct vcache *) kmem_cache_alloc(afs_inode_cachep, GFP_KERNEL);
-#endif
+ vcp = (struct vcache *) kmem_cache_alloc(afs_inode_cachep, KALLOC_TYPE);
if (!vcp)
return NULL;
kmem_cache_free(afs_inode_cachep, inode);
}
-static void
-#if defined(HAVE_KMEM_CACHE_T)
-init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
-#elif defined(KMEM_CACHE_INIT)
-init_once(struct kmem_cache * cachep, void * foo)
-#else
-init_once(void * foo, struct kmem_cache * cachep, unsigned long flags)
-#endif
+void
+init_once(void * foo)
{
struct vcache *vcp = (struct vcache *) foo;
-#if defined(SLAB_CTOR_VERIFY)
- if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
- SLAB_CTOR_CONSTRUCTOR)
-#endif
- inode_init_once(AFSTOV(vcp));
+ inode_init_once(AFSTOV(vcp));
}
int
afs_init_inodecache(void)
{
-#ifndef SLAB_RECLAIM_ACCOUNT
-#define SLAB_RECLAIM_ACCOUNT 0
-#endif
-
#if defined(KMEM_CACHE_TAKES_DTOR)
afs_inode_cachep = kmem_cache_create("afs_inode_cache",
- sizeof(struct vcache),
- 0, SLAB_HWCACHE_ALIGN | SLAB_RECLAIM_ACCOUNT,
- init_once, NULL);
+ sizeof(struct vcache), 0,
+ SLAB_HWCACHE_ALIGN | SLAB_RECLAIM_ACCOUNT, init_once_func, NULL);
#else
afs_inode_cachep = kmem_cache_create("afs_inode_cache",
- sizeof(struct vcache),
- 0, SLAB_HWCACHE_ALIGN | SLAB_RECLAIM_ACCOUNT,
- init_once);
+ sizeof(struct vcache), 0,
+ SLAB_HWCACHE_ALIGN | SLAB_RECLAIM_ACCOUNT, init_once_func);
#endif
if (afs_inode_cachep == NULL)
return -ENOMEM;