Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 318436
b: refs/heads/master
c: 8ded2bb
h: refs/heads/master
v: v3
  • Loading branch information
Josh Boyer authored and Linus Torvalds committed Jul 26, 2012
1 parent eabf843 commit 5ee6032
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 33 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4cb38750d49010ae72e718d46605ac9ba5a851b4
refs/heads/master: 8ded2bbc1845e19c771eb55209aab166ef011243
2 changes: 1 addition & 1 deletion trunk/arch/mips/kernel/kspd.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ static void sp_cleanup(void)
fdt = files_fdtable(files);
for (;;) {
unsigned long set;
i = j * __NFDBITS;
i = j * BITS_PER_LONG;
if (i >= fdt->max_fds)
break;
set = fdt->open_fds[j++];
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1020,7 +1020,7 @@ static void flush_old_files(struct files_struct * files)
unsigned long set, i;

j++;
i = j * __NFDBITS;
i = j * BITS_PER_LONG;
fdt = files_fdtable(files);
if (i >= fdt->max_fds)
break;
Expand Down
10 changes: 5 additions & 5 deletions trunk/fs/select.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,8 @@ static int max_select_fd(unsigned long n, fd_set_bits *fds)
struct fdtable *fdt;

/* handle last in-complete long-word first */
set = ~(~0UL << (n & (__NFDBITS-1)));
n /= __NFDBITS;
set = ~(~0UL << (n & (BITS_PER_LONG-1)));
n /= BITS_PER_LONG;
fdt = files_fdtable(current->files);
open_fds = fdt->open_fds + n;
max = 0;
Expand All @@ -373,7 +373,7 @@ static int max_select_fd(unsigned long n, fd_set_bits *fds)
max++;
set >>= 1;
} while (set);
max += n * __NFDBITS;
max += n * BITS_PER_LONG;
}

return max;
Expand Down Expand Up @@ -435,11 +435,11 @@ int do_select(int n, fd_set_bits *fds, struct timespec *end_time)
in = *inp++; out = *outp++; ex = *exp++;
all_bits = in | out | ex;
if (all_bits == 0) {
i += __NFDBITS;
i += BITS_PER_LONG;
continue;
}

for (j = 0; j < __NFDBITS; ++j, ++i, bit <<= 1) {
for (j = 0; j < BITS_PER_LONG; ++j, ++i, bit <<= 1) {
int fput_needed;
if (i >= n)
break;
Expand Down
18 changes: 3 additions & 15 deletions trunk/include/linux/posix_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,14 @@
*/

/*
* Those macros may have been defined in <gnu/types.h>. But we always
* use the ones here.
* This macro may have been defined in <gnu/types.h>. But we always
* use the one here.
*/
#undef __NFDBITS
#define __NFDBITS (8 * sizeof(unsigned long))

#undef __FD_SETSIZE
#define __FD_SETSIZE 1024

#undef __FDSET_LONGS
#define __FDSET_LONGS (__FD_SETSIZE/__NFDBITS)

#undef __FDELT
#define __FDELT(d) ((d) / __NFDBITS)

#undef __FDMASK
#define __FDMASK(d) (1UL << ((d) % __NFDBITS))

typedef struct {
unsigned long fds_bits [__FDSET_LONGS];
unsigned long fds_bits[__FD_SETSIZE / (8 * sizeof(long))];
} __kernel_fd_set;

/* Type of a signal handler. */
Expand Down
8 changes: 0 additions & 8 deletions trunk/include/linux/time.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,14 +257,6 @@ static __always_inline void timespec_add_ns(struct timespec *a, u64 ns)

#endif /* __KERNEL__ */

#define NFDBITS __NFDBITS

#define FD_SETSIZE __FD_SETSIZE
#define FD_SET(fd,fdsetp) __FD_SET(fd,fdsetp)
#define FD_CLR(fd,fdsetp) __FD_CLR(fd,fdsetp)
#define FD_ISSET(fd,fdsetp) __FD_ISSET(fd,fdsetp)
#define FD_ZERO(fdsetp) __FD_ZERO(fdsetp)

/*
* Names of the interval timers, and structure
* defining a timer setting:
Expand Down
2 changes: 1 addition & 1 deletion trunk/kernel/exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ static void close_files(struct files_struct * files)
rcu_read_unlock();
for (;;) {
unsigned long set;
i = j * __NFDBITS;
i = j * BITS_PER_LONG;
if (i >= fdt->max_fds)
break;
set = fdt->open_fds[j++];
Expand Down
2 changes: 1 addition & 1 deletion trunk/security/selinux/hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -2129,7 +2129,7 @@ static inline void flush_unauthorized_files(const struct cred *cred,
int fd;

j++;
i = j * __NFDBITS;
i = j * BITS_PER_LONG;
fdt = files_fdtable(files);
if (i >= fdt->max_fds)
break;
Expand Down

0 comments on commit 5ee6032

Please sign in to comment.