Whamcloud - gitweb
land b_v26 (20040316_1603)
[fs/lustre-release.git] / lustre / include / linux / lustre_compat25.h
index df59db4..4a4e3a0 100644 (file)
@@ -85,6 +85,21 @@ static inline void lustre_daemonize_helper(void)
         current->tty = NULL;
 }
 
+static inline int cleanup_group_info(void)
+{
+        struct group_info *ginfo;
+
+        ginfo = groups_alloc(2);
+        if (!ginfo)
+                return -ENOMEM;
+
+        ginfo->ngroups = 0;
+        set_current_groups(ginfo);
+        put_group_info(ginfo);
+
+        return 0;
+}
+
 #define smp_num_cpus    NR_CPUS
 
 #ifndef conditional_schedule
@@ -160,6 +175,14 @@ static inline void lustre_daemonize_helper(void)
         current->tty = NULL;
 }
 
+static inline int cleanup_group_info(void)
+{
+        /* Get rid of unneeded supplementary groups */
+        current->ngroups = 0;
+        memset(current->groups, 0, sizeof(current->groups));
+        return 0;
+}
+
 #ifndef conditional_schedule
 #define conditional_schedule() if (unlikely(need_resched())) schedule()
 #endif