#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,28)
orgfsuid = current->fsuid;
orgfsgid = current->fsgid;
/* as root */
current->fsuid = current->fsgid = 0;
#else
orgfsuid = current_fsuid();
orgfsgid = current_fsgid();
override_cred = prepare_creds();
if (!override_cred)
return -ENOMEM;
override_cred->fsuid = 0;
override_cred->fsgid = 0;
old_cred = (struct cred *)override_creds(override_cred);
#endif
/*****/
linux kernel file operation
/*****/
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,28)
current->fsuid = orgfsuid;
current->fsgid = orgfsgid;
#else
revert_creds(old_cred);
put_cred(override_cred);
#endif