Commit cd16cdfe authored by Trond Myklebust's avatar Trond Myklebust

Merge http://nfsclient.bkbits.net/linux-2.5

into fys.uio.no:/home/linux/bitkeeper/nfsclient-2.5
parents 874ce338 661f482b
...@@ -31,8 +31,8 @@ smb_ioctl(struct inode *inode, struct file *filp, ...@@ -31,8 +31,8 @@ smb_ioctl(struct inode *inode, struct file *filp,
int result = -EINVAL; int result = -EINVAL;
switch (cmd) { switch (cmd) {
uid16_t uid16 = 0; uid16_t uid16;
uid_t uid32 = 0; uid_t uid32;
case SMB_IOC_GETMOUNTUID: case SMB_IOC_GETMOUNTUID:
SET_UID(uid16, server->mnt->mounted_uid); SET_UID(uid16, server->mnt->mounted_uid);
result = put_user(uid16, (uid16_t *) arg); result = put_user(uid16, (uid16_t *) arg);
......
...@@ -53,37 +53,22 @@ extern void __bad_gid(void); ...@@ -53,37 +53,22 @@ extern void __bad_gid(void);
#define low2highuid(uid) ((uid) == (old_uid_t)-1 ? (uid_t)-1 : (uid_t)(uid)) #define low2highuid(uid) ((uid) == (old_uid_t)-1 ? (uid_t)-1 : (uid_t)(uid))
#define low2highgid(gid) ((gid) == (old_gid_t)-1 ? (gid_t)-1 : (gid_t)(gid)) #define low2highgid(gid) ((gid) == (old_gid_t)-1 ? (gid_t)-1 : (gid_t)(gid))
/* uid/gid input should be always 32bit uid_t */ #define __convert_uid(size, uid) \
#define SET_UID(var, uid) \ (size >= sizeof(uid) ? (uid) : high2lowuid(uid))
do { \ #define __convert_gid(size, gid) \
if (sizeof(var) == sizeof(old_uid_t)) (var) = high2lowuid(uid); \ (size >= sizeof(gid) ? (gid) : high2lowgid(gid))
else if (sizeof(var) >= sizeof(uid)) (var) = (uid); \
else __bad_uid(); \
} while(0)
#define SET_GID(var, gid) \
do { \
if (sizeof(var) == sizeof(old_gid_t)) (var) = high2lowgid(gid); \
else if (sizeof(var) >= sizeof(gid)) (var) = (gid); \
else __bad_gid(); \
} while(0)
#else #else
#define SET_UID(var,uid) \ #define __convert_uid(size, uid) (uid)
do { \ #define __convert_gid(size, gid) (gid)
if (sizeof(var) < sizeof(uid)) __bad_uid(); \
(var) = (uid); \
} while (0)
#define SET_GID(var,gid) \
do { \
if (sizeof(var) < sizeof(gid)) __bad_gid(); \
(var) = (gid); \
} while (0);
#endif /* !CONFIG_UID16 */ #endif /* !CONFIG_UID16 */
/* uid/gid input should be always 32bit uid_t */
#define SET_UID(var, uid) do { (var) = __convert_uid(sizeof(var), (uid)); } while (0)
#define SET_GID(var, gid) do { (var) = __convert_gid(sizeof(var), (gid)); } while (0)
/* /*
* Everything below this line is needed on all architectures, to deal with * Everything below this line is needed on all architectures, to deal with
......
...@@ -261,12 +261,16 @@ extern spinlock_t swaplock; ...@@ -261,12 +261,16 @@ extern spinlock_t swaplock;
#define lookup_swap_cache(swp) NULL #define lookup_swap_cache(swp) NULL
#define valid_swaphandles(swp, off) 0 #define valid_swaphandles(swp, off) 0
#define can_share_swap_page(p) 0 #define can_share_swap_page(p) 0
#define remove_exclusive_swap_page(p) 0
#define move_to_swap_cache(p, swp) 1 #define move_to_swap_cache(p, swp) 1
#define move_from_swap_cache(p, i, m) 1 #define move_from_swap_cache(p, i, m) 1
#define __delete_from_swap_cache(p) /*NOTHING*/ #define __delete_from_swap_cache(p) /*NOTHING*/
#define delete_from_swap_cache(p) /*NOTHING*/ #define delete_from_swap_cache(p) /*NOTHING*/
static inline int remove_exclusive_swap_page(struct page *p)
{
return 0;
}
static inline swp_entry_t get_swap_page(void) static inline swp_entry_t get_swap_page(void)
{ {
swp_entry_t entry; swp_entry_t entry;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment