Commit 771187d6 authored by Alexey Dobriyan's avatar Alexey Dobriyan Committed by Al Viro

proc: unsigned file descriptors

Make struct proc_inode::fd unsigned.

This allows better code generation on x86_64 (less sign extensions).
Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 9b80a184
...@@ -31,7 +31,7 @@ static int seq_show(struct seq_file *m, void *v) ...@@ -31,7 +31,7 @@ static int seq_show(struct seq_file *m, void *v)
put_task_struct(task); put_task_struct(task);
if (files) { if (files) {
int fd = proc_fd(m->private); unsigned int fd = proc_fd(m->private);
spin_lock(&files->file_lock); spin_lock(&files->file_lock);
file = fcheck_files(files, fd); file = fcheck_files(files, fd);
...@@ -86,7 +86,7 @@ static int tid_fd_revalidate(struct dentry *dentry, unsigned int flags) ...@@ -86,7 +86,7 @@ static int tid_fd_revalidate(struct dentry *dentry, unsigned int flags)
struct task_struct *task; struct task_struct *task;
const struct cred *cred; const struct cred *cred;
struct inode *inode; struct inode *inode;
int fd; unsigned int fd;
if (flags & LOOKUP_RCU) if (flags & LOOKUP_RCU)
return -ECHILD; return -ECHILD;
...@@ -158,7 +158,7 @@ static int proc_fd_link(struct dentry *dentry, struct path *path) ...@@ -158,7 +158,7 @@ static int proc_fd_link(struct dentry *dentry, struct path *path)
} }
if (files) { if (files) {
int fd = proc_fd(d_inode(dentry)); unsigned int fd = proc_fd(d_inode(dentry));
struct file *fd_file; struct file *fd_file;
spin_lock(&files->file_lock); spin_lock(&files->file_lock);
...@@ -253,7 +253,7 @@ static int proc_readfd_common(struct file *file, struct dir_context *ctx, ...@@ -253,7 +253,7 @@ static int proc_readfd_common(struct file *file, struct dir_context *ctx,
continue; continue;
rcu_read_unlock(); rcu_read_unlock();
len = snprintf(name, sizeof(name), "%d", fd); len = snprintf(name, sizeof(name), "%u", fd);
if (!proc_fill_cache(file, ctx, if (!proc_fill_cache(file, ctx,
name, len, instantiate, p, name, len, instantiate, p,
(void *)(unsigned long)fd)) (void *)(unsigned long)fd))
......
...@@ -11,7 +11,7 @@ extern const struct inode_operations proc_fdinfo_inode_operations; ...@@ -11,7 +11,7 @@ extern const struct inode_operations proc_fdinfo_inode_operations;
extern int proc_fd_permission(struct inode *inode, int mask); extern int proc_fd_permission(struct inode *inode, int mask);
static inline int proc_fd(struct inode *inode) static inline unsigned int proc_fd(struct inode *inode)
{ {
return PROC_I(inode)->fd; return PROC_I(inode)->fd;
} }
......
...@@ -60,7 +60,7 @@ union proc_op { ...@@ -60,7 +60,7 @@ union proc_op {
struct proc_inode { struct proc_inode {
struct pid *pid; struct pid *pid;
int fd; unsigned int fd;
union proc_op op; union proc_op op;
struct proc_dir_entry *pde; struct proc_dir_entry *pde;
struct ctl_table_header *sysctl; struct ctl_table_header *sysctl;
......
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