Re: [Pvfs2-users] How to fix: Undeclared 'SLAB_CTOR_CONSTRUCTOR’ error in pvfs2-cache.c

Mark Van De Vyver mvyver at gmail.com
Mon Jun 11 22:40:34 EDT 2007


Hi Pete,
Thanks for the prompt response and the patch.
The patch allows me to get past the undefined SLAB_CTOR_CONSTRUCTOR error.

I then run into a host of 'warning: initialization from incompatible
pointer type' and the following error:
/usr/src/pvfs-2.6.3/src/kernel/linux-2.6/pvfs2-proc.c:340: error: too
many arguments to function 'register_sysctl_table'

I've attached the make log file.  The make instructions are as described before.

Regards
Mark


On 6/10/07, Pete Wyckoff <pw at osc.edu> wrote:
> mvyver at gmail.com wrote on Sun, 10 Jun 2007 14:26 +1000:
> > I'm trying to build pvfs2 on openSuSE 10.2 (kernel 2.6.22.rc4).  when
> > running `make kmod_install` it fails with the error:
> >
> > /usr/src/pvfs-2.6.3/src/kernel/linux-2.6/pvfs2-cache.c: In function
> > 'dev_req_cache_ctor':
> > /usr/src/pvfs-2.6.3/src/kernel/linux-2.6/pvfs2-cache.c:206: error:
> > 'SLAB_CTOR_CONSTRUCTOR' undeclared (first use in this function)
>
> In very recent (rc) kernels, they removed that.  Here's the likely
> patch to fix it.  I'll check it in if you say that it works.
>
>                 -- Pete
>
> Index: src/kernel/linux-2.6/pvfs2-cache.c
> ===================================================================
> RCS file: /projects/cvsroot/pvfs2/src/kernel/linux-2.6/pvfs2-cache.c,v
> retrieving revision 1.40
> diff -u -p -r1.40 pvfs2-cache.c
> --- src/kernel/linux-2.6/pvfs2-cache.c  8 Feb 2007 18:49:50 -0000       1.40
> +++ src/kernel/linux-2.6/pvfs2-cache.c  10 Jun 2007 12:25:32 -0000
> @@ -203,14 +203,7 @@ static void dev_req_cache_ctor(
>      pvfs2_kmem_cache_t * cachep,
>      unsigned long flags)
>  {
> -    if (flags & SLAB_CTOR_CONSTRUCTOR)
> -    {
> -        memset(req, 0, sizeof(MAX_ALIGNED_DEV_REQ_DOWNSIZE));
> -    }
> -    else
> -    {
> -        gossip_err("WARNING!! devreq_ctor called without ctor flag\n");
> -    }
> +    memset(req, 0, sizeof(MAX_ALIGNED_DEV_REQ_DOWNSIZE));
>  }
>
>  int dev_req_cache_initialize(void)
> @@ -269,31 +262,24 @@ static void pvfs2_inode_cache_ctor(
>  {
>      pvfs2_inode_t *pvfs2_inode = (pvfs2_inode_t *)new_pvfs2_inode;
>
> -    if (flags & SLAB_CTOR_CONSTRUCTOR)
> -    {
> -        memset(pvfs2_inode, 0, sizeof(pvfs2_inode_t));
> -        ClearInitFlag(pvfs2_inode);
> +    memset(pvfs2_inode, 0, sizeof(pvfs2_inode_t));
> +    ClearInitFlag(pvfs2_inode);
>
> -        pvfs2_inode_initialize(pvfs2_inode);
> +    pvfs2_inode_initialize(pvfs2_inode);
>
>  #ifndef PVFS2_LINUX_KERNEL_2_4
> -        /*
> -           inode_init_once is from 2.6.x's inode.c; it's normally run
> -           when an inode is allocated by the system's inode slab
> -           allocator.  we call it here since we're overloading the
> -           system's inode allocation with this routine, thus we have
> -           to init vfs inodes manually
> -        */
> -        inode_init_once(&pvfs2_inode->vfs_inode);
> -        pvfs2_inode->vfs_inode.i_version = 1;
> +    /*
> +       inode_init_once is from 2.6.x's inode.c; it's normally run
> +       when an inode is allocated by the system's inode slab
> +       allocator.  we call it here since we're overloading the
> +       system's inode allocation with this routine, thus we have
> +       to init vfs inodes manually
> +    */
> +    inode_init_once(&pvfs2_inode->vfs_inode);
> +    pvfs2_inode->vfs_inode.i_version = 1;
>  #endif
> -        /* Initialize the reader/writer semaphore */
> -        init_rwsem(&pvfs2_inode->xattr_sem);
> -    }
> -    else
> -    {
> -        gossip_err("WARNING!! inode_ctor called without ctor flag\n");
> -    }
> +    /* Initialize the reader/writer semaphore */
> +    init_rwsem(&pvfs2_inode->xattr_sem);
>  }
>
>  static void pvfs2_inode_cache_dtor(
> @@ -403,14 +389,7 @@ static void kiocb_ctor(
>      pvfs2_kmem_cache_t * cachep,
>      unsigned long flags)
>  {
> -    if (flags & SLAB_CTOR_CONSTRUCTOR)
> -    {
> -        memset(req, 0, sizeof(pvfs2_kiocb));
> -    }
> -    else
> -    {
> -        gossip_err("WARNING!! kiocb_ctor called without ctor flag\n");
> -    }
> +    memset(req, 0, sizeof(pvfs2_kiocb));
>  }
>
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pvfs--make-kmod-install.log
Type: text/x-log
Size: 32310 bytes
Desc: not available
Url : http://www.beowulf-underground.org/pipermail/pvfs2-users/attachments/20070612/4f0acb89/pvfs--make-kmod-install-0001.bin


More information about the Pvfs2-users mailing list