[Tux3] [PATCH] tux3: fix compile error in linus-git

sniper s3c24xx at gmail.com
Wed Jan 7 01:39:17 PST 2009


On Wed, Jan 7, 2009 at 5:17 PM, Daniel Phillips <phillips at phunq.net> wrote:
> On Wednesday 07 January 2009 00:36, Qinghuang Feng wrote:
>> Hello, I am that "sniper" guy. This mail account is used to post patches.
>>
>> When I compiled the latest tux3 under linus-git:
>> fs/tux3/inode.c: In function ‘tux_create_inode’:
>> fs/tux3/inode.c:457: error: ‘struct task_struct’ has no member named ‘fsuid’
>> fs/tux3/inode.c:458: error: ‘struct task_struct’ has no member named ‘fsgid’
>>
>> This patch fix this compile error, and the latest tux3 works fine.
>
> Hi Qinghuang,
>
> Thanks for the fix.
>
> Your patch breaks the user space compile because your macro definitions
> appear outside the __KERNEL__ macro.  Could you try this version?

Yes, It is OK, and better than my version.

>
> Regards,
>
> Daniel
>
> diff -r 68f754221c50 user/kernel/inode.c
> --- a/user/kernel/inode.c       Tue Jan 06 14:09:37 2009 -0800
> +++ b/user/kernel/inode.c       Wed Jan 07 01:13:39 2009 -0800
> @@ -454,8 +454,13 @@ struct inode *tux_create_inode(struct in
>  struct inode *tux_create_inode(struct inode *dir, int mode, dev_t rdev)
>  {
>        struct tux_iattr iattr = {
> +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
> +               .uid    = current_fsuid(),
> +               .gid    = current_fsgid(),
> +#else
>                .uid    = current->fsuid,
>                .gid    = current->fsgid,
> +#endif
>                .mode   = mode,
>        };
>        struct inode *inode = tux_new_inode(dir, &iattr, rdev);
> diff -r 68f754221c50 user/kernel/tux3.h
> --- a/user/kernel/tux3.h        Tue Jan 06 14:09:37 2009 -0800
> +++ b/user/kernel/tux3.h        Wed Jan 07 01:13:39 2009 -0800
> @@ -9,6 +9,10 @@
>  #include <linux/fs.h>
>  #include <linux/buffer_head.h>
>  #include <linux/mutex.h>
> +
> +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
> +#include <linux/cred.h> // fsuid
> +#endif
>
>  typedef loff_t block_t;
>
>
_______________________________________________
Tux3 mailing list
Tux3 at tux3.org
http://mailman.tux3.org/cgi-bin/mailman/listinfo/tux3


More information about the Tux3 mailing list