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. 

Signed-off-by: Qinghuang Feng <[email protected]>
---
--- inode_origin.c      2009-01-07 14:00:56.000000000 +0800
+++ inode.c     2009-01-07 16:03:03.000000000 +0800
@@ -10,6 +10,16 @@
 
 #include "tux3.h"
 
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,27)
+       #include <linux/cred.h>
+       #define tux_current_fsuid() (current_fsuid())
+       #define tux_current_fsgid() (current_fsgid())
+#else
+       #define tux_current_fsuid() (current->fsuid)
+       #define tux_current_fsgid() (current->fsgid)
+#endif
+
+
 #ifndef trace
 #define trace trace_on
 #endif
@@ -454,8 +464,8 @@ static void tux_setup_inode(struct inode
 struct inode *tux_create_inode(struct inode *dir, int mode, dev_t rdev)
 {
        struct tux_iattr iattr = {
-               .uid    = current->fsuid,
-               .gid    = current->fsgid,
+               .uid    = tux_current_fsuid(),
+               .gid    = tux_current_fsgid(),
                .mode   = mode,
        };
        struct inode *inode = tux_new_inode(dir, &iattr, rdev);


_______________________________________________
Tux3 mailing list
[email protected]
http://mailman.tux3.org/cgi-bin/mailman/listinfo/tux3

Reply via email to