diff options
Diffstat (limited to 'fs/select.c')
-rw-r--r-- | fs/select.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/fs/select.c b/fs/select.c index fe0893afd931..a974082b0824 100644 --- a/fs/select.c +++ b/fs/select.c | |||
@@ -14,10 +14,10 @@ | |||
14 | * of fds to overcome nfds < 16390 descriptors limit (Tigran Aivazian). | 14 | * of fds to overcome nfds < 16390 descriptors limit (Tigran Aivazian). |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #include <linux/kernel.h> | ||
17 | #include <linux/syscalls.h> | 18 | #include <linux/syscalls.h> |
18 | #include <linux/module.h> | 19 | #include <linux/module.h> |
19 | #include <linux/slab.h> | 20 | #include <linux/slab.h> |
20 | #include <linux/smp_lock.h> | ||
21 | #include <linux/poll.h> | 21 | #include <linux/poll.h> |
22 | #include <linux/personality.h> /* for STICKY_TIMEOUTS */ | 22 | #include <linux/personality.h> /* for STICKY_TIMEOUTS */ |
23 | #include <linux/file.h> | 23 | #include <linux/file.h> |
@@ -26,7 +26,6 @@ | |||
26 | 26 | ||
27 | #include <asm/uaccess.h> | 27 | #include <asm/uaccess.h> |
28 | 28 | ||
29 | #define ROUND_UP(x,y) (((x)+(y)-1)/(y)) | ||
30 | #define DEFAULT_POLLMASK (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM) | 29 | #define DEFAULT_POLLMASK (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM) |
31 | 30 | ||
32 | struct poll_table_page { | 31 | struct poll_table_page { |
@@ -65,7 +64,7 @@ EXPORT_SYMBOL(poll_initwait); | |||
65 | 64 | ||
66 | static void free_poll_entry(struct poll_table_entry *entry) | 65 | static void free_poll_entry(struct poll_table_entry *entry) |
67 | { | 66 | { |
68 | remove_wait_queue(entry->wait_address,&entry->wait); | 67 | remove_wait_queue(entry->wait_address, &entry->wait); |
69 | fput(entry->filp); | 68 | fput(entry->filp); |
70 | } | 69 | } |
71 | 70 | ||
@@ -129,7 +128,7 @@ static void __pollwait(struct file *filp, wait_queue_head_t *wait_address, | |||
129 | entry->filp = filp; | 128 | entry->filp = filp; |
130 | entry->wait_address = wait_address; | 129 | entry->wait_address = wait_address; |
131 | init_waitqueue_entry(&entry->wait, current); | 130 | init_waitqueue_entry(&entry->wait, current); |
132 | add_wait_queue(wait_address,&entry->wait); | 131 | add_wait_queue(wait_address, &entry->wait); |
133 | } | 132 | } |
134 | 133 | ||
135 | #define FDS_IN(fds, n) (fds->in + n) | 134 | #define FDS_IN(fds, n) (fds->in + n) |
@@ -399,7 +398,7 @@ asmlinkage long sys_select(int n, fd_set __user *inp, fd_set __user *outp, | |||
399 | if ((u64)tv.tv_sec >= (u64)MAX_INT64_SECONDS) | 398 | if ((u64)tv.tv_sec >= (u64)MAX_INT64_SECONDS) |
400 | timeout = -1; /* infinite */ | 399 | timeout = -1; /* infinite */ |
401 | else { | 400 | else { |
402 | timeout = ROUND_UP(tv.tv_usec, USEC_PER_SEC/HZ); | 401 | timeout = DIV_ROUND_UP(tv.tv_usec, USEC_PER_SEC/HZ); |
403 | timeout += tv.tv_sec * HZ; | 402 | timeout += tv.tv_sec * HZ; |
404 | } | 403 | } |
405 | } | 404 | } |
@@ -454,7 +453,7 @@ asmlinkage long sys_pselect7(int n, fd_set __user *inp, fd_set __user *outp, | |||
454 | if ((u64)ts.tv_sec >= (u64)MAX_INT64_SECONDS) | 453 | if ((u64)ts.tv_sec >= (u64)MAX_INT64_SECONDS) |
455 | timeout = -1; /* infinite */ | 454 | timeout = -1; /* infinite */ |
456 | else { | 455 | else { |
457 | timeout = ROUND_UP(ts.tv_nsec, NSEC_PER_SEC/HZ); | 456 | timeout = DIV_ROUND_UP(ts.tv_nsec, NSEC_PER_SEC/HZ); |
458 | timeout += ts.tv_sec * HZ; | 457 | timeout += ts.tv_sec * HZ; |
459 | } | 458 | } |
460 | } | 459 | } |
@@ -776,7 +775,7 @@ asmlinkage long sys_ppoll(struct pollfd __user *ufds, unsigned int nfds, | |||
776 | if ((u64)ts.tv_sec >= (u64)MAX_INT64_SECONDS) | 775 | if ((u64)ts.tv_sec >= (u64)MAX_INT64_SECONDS) |
777 | timeout = -1; /* infinite */ | 776 | timeout = -1; /* infinite */ |
778 | else { | 777 | else { |
779 | timeout = ROUND_UP(ts.tv_nsec, NSEC_PER_SEC/HZ); | 778 | timeout = DIV_ROUND_UP(ts.tv_nsec, NSEC_PER_SEC/HZ); |
780 | timeout += ts.tv_sec * HZ; | 779 | timeout += ts.tv_sec * HZ; |
781 | } | 780 | } |
782 | } | 781 | } |