diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2016-09-01 17:42:02 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2016-09-27 18:47:38 -0400 |
commit | 771187d61bb3cbaf62c492ec3b8b789933f7691e (patch) | |
tree | fd7a5835ed056cdcee8994484abfdc58f1d35d44 | |
parent | 9b80a184eaadc117f27faad522008f31d571621b (diff) |
proc: unsigned file descriptors
Make struct proc_inode::fd unsigned.
This allows better code generation on x86_64 (less sign extensions).
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | fs/proc/fd.c | 8 | ||||
-rw-r--r-- | fs/proc/fd.h | 2 | ||||
-rw-r--r-- | fs/proc/internal.h | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/fs/proc/fd.c b/fs/proc/fd.c index 01df23cc81f6..d21dafef3102 100644 --- a/fs/proc/fd.c +++ b/fs/proc/fd.c | |||
@@ -31,7 +31,7 @@ static int seq_show(struct seq_file *m, void *v) | |||
31 | put_task_struct(task); | 31 | put_task_struct(task); |
32 | 32 | ||
33 | if (files) { | 33 | if (files) { |
34 | int fd = proc_fd(m->private); | 34 | unsigned int fd = proc_fd(m->private); |
35 | 35 | ||
36 | spin_lock(&files->file_lock); | 36 | spin_lock(&files->file_lock); |
37 | file = fcheck_files(files, fd); | 37 | file = fcheck_files(files, fd); |
@@ -86,7 +86,7 @@ static int tid_fd_revalidate(struct dentry *dentry, unsigned int flags) | |||
86 | struct task_struct *task; | 86 | struct task_struct *task; |
87 | const struct cred *cred; | 87 | const struct cred *cred; |
88 | struct inode *inode; | 88 | struct inode *inode; |
89 | int fd; | 89 | unsigned int fd; |
90 | 90 | ||
91 | if (flags & LOOKUP_RCU) | 91 | if (flags & LOOKUP_RCU) |
92 | return -ECHILD; | 92 | return -ECHILD; |
@@ -158,7 +158,7 @@ static int proc_fd_link(struct dentry *dentry, struct path *path) | |||
158 | } | 158 | } |
159 | 159 | ||
160 | if (files) { | 160 | if (files) { |
161 | int fd = proc_fd(d_inode(dentry)); | 161 | unsigned int fd = proc_fd(d_inode(dentry)); |
162 | struct file *fd_file; | 162 | struct file *fd_file; |
163 | 163 | ||
164 | spin_lock(&files->file_lock); | 164 | spin_lock(&files->file_lock); |
@@ -253,7 +253,7 @@ static int proc_readfd_common(struct file *file, struct dir_context *ctx, | |||
253 | continue; | 253 | continue; |
254 | rcu_read_unlock(); | 254 | rcu_read_unlock(); |
255 | 255 | ||
256 | len = snprintf(name, sizeof(name), "%d", fd); | 256 | len = snprintf(name, sizeof(name), "%u", fd); |
257 | if (!proc_fill_cache(file, ctx, | 257 | if (!proc_fill_cache(file, ctx, |
258 | name, len, instantiate, p, | 258 | name, len, instantiate, p, |
259 | (void *)(unsigned long)fd)) | 259 | (void *)(unsigned long)fd)) |
diff --git a/fs/proc/fd.h b/fs/proc/fd.h index 7c047f256ae2..46dafadd0083 100644 --- a/fs/proc/fd.h +++ b/fs/proc/fd.h | |||
@@ -11,7 +11,7 @@ extern const struct inode_operations proc_fdinfo_inode_operations; | |||
11 | 11 | ||
12 | extern int proc_fd_permission(struct inode *inode, int mask); | 12 | extern int proc_fd_permission(struct inode *inode, int mask); |
13 | 13 | ||
14 | static inline int proc_fd(struct inode *inode) | 14 | static inline unsigned int proc_fd(struct inode *inode) |
15 | { | 15 | { |
16 | return PROC_I(inode)->fd; | 16 | return PROC_I(inode)->fd; |
17 | } | 17 | } |
diff --git a/fs/proc/internal.h b/fs/proc/internal.h index 7931c558c192..5378441ec1b7 100644 --- a/fs/proc/internal.h +++ b/fs/proc/internal.h | |||
@@ -60,7 +60,7 @@ union proc_op { | |||
60 | 60 | ||
61 | struct proc_inode { | 61 | struct proc_inode { |
62 | struct pid *pid; | 62 | struct pid *pid; |
63 | int fd; | 63 | unsigned int fd; |
64 | union proc_op op; | 64 | union proc_op op; |
65 | struct proc_dir_entry *pde; | 65 | struct proc_dir_entry *pde; |
66 | struct ctl_table_header *sysctl; | 66 | struct ctl_table_header *sysctl; |