Commit a413a276 authored by Andrew Morton's avatar Andrew Morton Committed by James Bottomley

[PATCH] convert file_lock to a spinlock

Time to write a 2M file, one byte at a time:

Before:
        1.09s user 4.92s system 99% cpu 6.014 total
        0.74s user 5.28s system 99% cpu 6.023 total
        1.03s user 4.97s system 100% cpu 5.991 total

After:
	0.79s user 5.17s system 99% cpu 5.993 total
	0.79s user 5.17s system 100% cpu 5.957 total
	0.84s user 5.11s system 100% cpu 5.942 total
parent 300c2652
...@@ -1874,7 +1874,7 @@ static void __do_SAK(void *arg) ...@@ -1874,7 +1874,7 @@ static void __do_SAK(void *arg)
} }
task_lock(p); task_lock(p);
if (p->files) { if (p->files) {
read_lock(&p->files->file_lock); spin_lock(&p->files->file_lock);
for (i=0; i < p->files->max_fds; i++) { for (i=0; i < p->files->max_fds; i++) {
filp = fcheck_files(p->files, i); filp = fcheck_files(p->files, i);
if (filp && (filp->f_op == &tty_fops) && if (filp && (filp->f_op == &tty_fops) &&
...@@ -1886,7 +1886,7 @@ static void __do_SAK(void *arg) ...@@ -1886,7 +1886,7 @@ static void __do_SAK(void *arg)
break; break;
} }
} }
read_unlock(&p->files->file_lock); spin_unlock(&p->files->file_lock);
} }
task_unlock(p); task_unlock(p);
} }
......
...@@ -749,7 +749,7 @@ static inline void flush_old_files(struct files_struct * files) ...@@ -749,7 +749,7 @@ static inline void flush_old_files(struct files_struct * files)
{ {
long j = -1; long j = -1;
write_lock(&files->file_lock); spin_lock(&files->file_lock);
for (;;) { for (;;) {
unsigned long set, i; unsigned long set, i;
...@@ -761,16 +761,16 @@ static inline void flush_old_files(struct files_struct * files) ...@@ -761,16 +761,16 @@ static inline void flush_old_files(struct files_struct * files)
if (!set) if (!set)
continue; continue;
files->close_on_exec->fds_bits[j] = 0; files->close_on_exec->fds_bits[j] = 0;
write_unlock(&files->file_lock); spin_unlock(&files->file_lock);
for ( ; set ; i++,set >>= 1) { for ( ; set ; i++,set >>= 1) {
if (set & 1) { if (set & 1) {
sys_close(i); sys_close(i);
} }
} }
write_lock(&files->file_lock); spin_lock(&files->file_lock);
} }
write_unlock(&files->file_lock); spin_unlock(&files->file_lock);
} }
int flush_old_exec(struct linux_binprm * bprm) int flush_old_exec(struct linux_binprm * bprm)
......
...@@ -23,21 +23,21 @@ extern int fcntl_getlease(struct file *filp); ...@@ -23,21 +23,21 @@ extern int fcntl_getlease(struct file *filp);
void set_close_on_exec(unsigned int fd, int flag) void set_close_on_exec(unsigned int fd, int flag)
{ {
struct files_struct *files = current->files; struct files_struct *files = current->files;
write_lock(&files->file_lock); spin_lock(&files->file_lock);
if (flag) if (flag)
FD_SET(fd, files->close_on_exec); FD_SET(fd, files->close_on_exec);
else else
FD_CLR(fd, files->close_on_exec); FD_CLR(fd, files->close_on_exec);
write_unlock(&files->file_lock); spin_unlock(&files->file_lock);
} }
static inline int get_close_on_exec(unsigned int fd) static inline int get_close_on_exec(unsigned int fd)
{ {
struct files_struct *files = current->files; struct files_struct *files = current->files;
int res; int res;
read_lock(&files->file_lock); spin_lock(&files->file_lock);
res = FD_ISSET(fd, files->close_on_exec); res = FD_ISSET(fd, files->close_on_exec);
read_unlock(&files->file_lock); spin_unlock(&files->file_lock);
return res; return res;
} }
...@@ -134,15 +134,15 @@ static int dupfd(struct file *file, int start) ...@@ -134,15 +134,15 @@ static int dupfd(struct file *file, int start)
struct files_struct * files = current->files; struct files_struct * files = current->files;
int fd; int fd;
write_lock(&files->file_lock); spin_lock(&files->file_lock);
fd = locate_fd(files, file, start); fd = locate_fd(files, file, start);
if (fd >= 0) { if (fd >= 0) {
FD_SET(fd, files->open_fds); FD_SET(fd, files->open_fds);
FD_CLR(fd, files->close_on_exec); FD_CLR(fd, files->close_on_exec);
write_unlock(&files->file_lock); spin_unlock(&files->file_lock);
fd_install(fd, file); fd_install(fd, file);
} else { } else {
write_unlock(&files->file_lock); spin_unlock(&files->file_lock);
fput(file); fput(file);
} }
...@@ -155,7 +155,7 @@ asmlinkage long sys_dup2(unsigned int oldfd, unsigned int newfd) ...@@ -155,7 +155,7 @@ asmlinkage long sys_dup2(unsigned int oldfd, unsigned int newfd)
struct file * file, *tofree; struct file * file, *tofree;
struct files_struct * files = current->files; struct files_struct * files = current->files;
write_lock(&files->file_lock); spin_lock(&files->file_lock);
if (!(file = fcheck(oldfd))) if (!(file = fcheck(oldfd)))
goto out_unlock; goto out_unlock;
err = newfd; err = newfd;
...@@ -186,7 +186,7 @@ asmlinkage long sys_dup2(unsigned int oldfd, unsigned int newfd) ...@@ -186,7 +186,7 @@ asmlinkage long sys_dup2(unsigned int oldfd, unsigned int newfd)
files->fd[newfd] = file; files->fd[newfd] = file;
FD_SET(newfd, files->open_fds); FD_SET(newfd, files->open_fds);
FD_CLR(newfd, files->close_on_exec); FD_CLR(newfd, files->close_on_exec);
write_unlock(&files->file_lock); spin_unlock(&files->file_lock);
if (tofree) if (tofree)
filp_close(tofree, files); filp_close(tofree, files);
...@@ -194,11 +194,11 @@ asmlinkage long sys_dup2(unsigned int oldfd, unsigned int newfd) ...@@ -194,11 +194,11 @@ asmlinkage long sys_dup2(unsigned int oldfd, unsigned int newfd)
out: out:
return err; return err;
out_unlock: out_unlock:
write_unlock(&files->file_lock); spin_unlock(&files->file_lock);
goto out; goto out;
out_fput: out_fput:
write_unlock(&files->file_lock); spin_unlock(&files->file_lock);
fput(file); fput(file);
goto out; goto out;
} }
......
...@@ -65,7 +65,7 @@ int expand_fd_array(struct files_struct *files, int nr) ...@@ -65,7 +65,7 @@ int expand_fd_array(struct files_struct *files, int nr)
goto out; goto out;
nfds = files->max_fds; nfds = files->max_fds;
write_unlock(&files->file_lock); spin_unlock(&files->file_lock);
/* /*
* Expand to the max in easy steps, and keep expanding it until * Expand to the max in easy steps, and keep expanding it until
...@@ -89,7 +89,7 @@ int expand_fd_array(struct files_struct *files, int nr) ...@@ -89,7 +89,7 @@ int expand_fd_array(struct files_struct *files, int nr)
error = -ENOMEM; error = -ENOMEM;
new_fds = alloc_fd_array(nfds); new_fds = alloc_fd_array(nfds);
write_lock(&files->file_lock); spin_lock(&files->file_lock);
if (!new_fds) if (!new_fds)
goto out; goto out;
...@@ -110,15 +110,15 @@ int expand_fd_array(struct files_struct *files, int nr) ...@@ -110,15 +110,15 @@ int expand_fd_array(struct files_struct *files, int nr)
memset(&new_fds[i], 0, memset(&new_fds[i], 0,
(nfds-i) * sizeof(struct file *)); (nfds-i) * sizeof(struct file *));
write_unlock(&files->file_lock); spin_unlock(&files->file_lock);
free_fd_array(old_fds, i); free_fd_array(old_fds, i);
write_lock(&files->file_lock); spin_lock(&files->file_lock);
} }
} else { } else {
/* Somebody expanded the array while we slept ... */ /* Somebody expanded the array while we slept ... */
write_unlock(&files->file_lock); spin_unlock(&files->file_lock);
free_fd_array(new_fds, nfds); free_fd_array(new_fds, nfds);
write_lock(&files->file_lock); spin_lock(&files->file_lock);
} }
error = 0; error = 0;
out: out:
...@@ -167,7 +167,7 @@ int expand_fdset(struct files_struct *files, int nr) ...@@ -167,7 +167,7 @@ int expand_fdset(struct files_struct *files, int nr)
goto out; goto out;
nfds = files->max_fdset; nfds = files->max_fdset;
write_unlock(&files->file_lock); spin_unlock(&files->file_lock);
/* Expand to the max in easy steps */ /* Expand to the max in easy steps */
do { do {
...@@ -183,7 +183,7 @@ int expand_fdset(struct files_struct *files, int nr) ...@@ -183,7 +183,7 @@ int expand_fdset(struct files_struct *files, int nr)
error = -ENOMEM; error = -ENOMEM;
new_openset = alloc_fdset(nfds); new_openset = alloc_fdset(nfds);
new_execset = alloc_fdset(nfds); new_execset = alloc_fdset(nfds);
write_lock(&files->file_lock); spin_lock(&files->file_lock);
if (!new_openset || !new_execset) if (!new_openset || !new_execset)
goto out; goto out;
...@@ -208,21 +208,21 @@ int expand_fdset(struct files_struct *files, int nr) ...@@ -208,21 +208,21 @@ int expand_fdset(struct files_struct *files, int nr)
nfds = xchg(&files->max_fdset, nfds); nfds = xchg(&files->max_fdset, nfds);
new_openset = xchg(&files->open_fds, new_openset); new_openset = xchg(&files->open_fds, new_openset);
new_execset = xchg(&files->close_on_exec, new_execset); new_execset = xchg(&files->close_on_exec, new_execset);
write_unlock(&files->file_lock); spin_unlock(&files->file_lock);
free_fdset (new_openset, nfds); free_fdset (new_openset, nfds);
free_fdset (new_execset, nfds); free_fdset (new_execset, nfds);
write_lock(&files->file_lock); spin_lock(&files->file_lock);
return 0; return 0;
} }
/* Somebody expanded the array while we slept ... */ /* Somebody expanded the array while we slept ... */
out: out:
write_unlock(&files->file_lock); spin_unlock(&files->file_lock);
if (new_openset) if (new_openset)
free_fdset(new_openset, nfds); free_fdset(new_openset, nfds);
if (new_execset) if (new_execset)
free_fdset(new_execset, nfds); free_fdset(new_execset, nfds);
write_lock(&files->file_lock); spin_lock(&files->file_lock);
return error; return error;
} }
...@@ -182,11 +182,11 @@ struct file *fget(unsigned int fd) ...@@ -182,11 +182,11 @@ struct file *fget(unsigned int fd)
struct file *file; struct file *file;
struct files_struct *files = current->files; struct files_struct *files = current->files;
read_lock(&files->file_lock); spin_lock(&files->file_lock);
file = fcheck(fd); file = fcheck(fd);
if (file) if (file)
get_file(file); get_file(file);
read_unlock(&files->file_lock); spin_unlock(&files->file_lock);
return file; return file;
} }
......
...@@ -702,7 +702,7 @@ int get_unused_fd(void) ...@@ -702,7 +702,7 @@ int get_unused_fd(void)
int fd, error; int fd, error;
error = -EMFILE; error = -EMFILE;
write_lock(&files->file_lock); spin_lock(&files->file_lock);
repeat: repeat:
fd = find_next_zero_bit(files->open_fds->fds_bits, fd = find_next_zero_bit(files->open_fds->fds_bits,
...@@ -751,7 +751,7 @@ int get_unused_fd(void) ...@@ -751,7 +751,7 @@ int get_unused_fd(void)
error = fd; error = fd;
out: out:
write_unlock(&files->file_lock); spin_unlock(&files->file_lock);
return error; return error;
} }
...@@ -765,9 +765,9 @@ static inline void __put_unused_fd(struct files_struct *files, unsigned int fd) ...@@ -765,9 +765,9 @@ static inline void __put_unused_fd(struct files_struct *files, unsigned int fd)
void put_unused_fd(unsigned int fd) void put_unused_fd(unsigned int fd)
{ {
struct files_struct *files = current->files; struct files_struct *files = current->files;
write_lock(&files->file_lock); spin_lock(&files->file_lock);
__put_unused_fd(files, fd); __put_unused_fd(files, fd);
write_unlock(&files->file_lock); spin_unlock(&files->file_lock);
} }
/* /*
...@@ -786,11 +786,11 @@ void put_unused_fd(unsigned int fd) ...@@ -786,11 +786,11 @@ void put_unused_fd(unsigned int fd)
void fd_install(unsigned int fd, struct file * file) void fd_install(unsigned int fd, struct file * file)
{ {
struct files_struct *files = current->files; struct files_struct *files = current->files;
write_lock(&files->file_lock); spin_lock(&files->file_lock);
if (unlikely(files->fd[fd] != NULL)) if (unlikely(files->fd[fd] != NULL))
BUG(); BUG();
files->fd[fd] = file; files->fd[fd] = file;
write_unlock(&files->file_lock); spin_unlock(&files->file_lock);
} }
asmlinkage long sys_open(const char __user * filename, int flags, int mode) asmlinkage long sys_open(const char __user * filename, int flags, int mode)
...@@ -870,7 +870,7 @@ asmlinkage long sys_close(unsigned int fd) ...@@ -870,7 +870,7 @@ asmlinkage long sys_close(unsigned int fd)
struct file * filp; struct file * filp;
struct files_struct *files = current->files; struct files_struct *files = current->files;
write_lock(&files->file_lock); spin_lock(&files->file_lock);
if (fd >= files->max_fds) if (fd >= files->max_fds)
goto out_unlock; goto out_unlock;
filp = files->fd[fd]; filp = files->fd[fd];
...@@ -879,11 +879,11 @@ asmlinkage long sys_close(unsigned int fd) ...@@ -879,11 +879,11 @@ asmlinkage long sys_close(unsigned int fd)
files->fd[fd] = NULL; files->fd[fd] = NULL;
FD_CLR(fd, files->close_on_exec); FD_CLR(fd, files->close_on_exec);
__put_unused_fd(files, fd); __put_unused_fd(files, fd);
write_unlock(&files->file_lock); spin_unlock(&files->file_lock);
return filp_close(filp, files); return filp_close(filp, files);
out_unlock: out_unlock:
write_unlock(&files->file_lock); spin_unlock(&files->file_lock);
return -EBADF; return -EBADF;
} }
......
...@@ -117,16 +117,16 @@ static int proc_fd_link(struct inode *inode, struct dentry **dentry, struct vfsm ...@@ -117,16 +117,16 @@ static int proc_fd_link(struct inode *inode, struct dentry **dentry, struct vfsm
atomic_inc(&files->count); atomic_inc(&files->count);
task_unlock(task); task_unlock(task);
if (files) { if (files) {
read_lock(&files->file_lock); spin_lock(&files->file_lock);
file = fcheck_files(files, fd); file = fcheck_files(files, fd);
if (file) { if (file) {
*mnt = mntget(file->f_vfsmnt); *mnt = mntget(file->f_vfsmnt);
*dentry = dget(file->f_dentry); *dentry = dget(file->f_dentry);
read_unlock(&files->file_lock); spin_unlock(&files->file_lock);
put_files_struct(files); put_files_struct(files);
return 0; return 0;
} }
read_unlock(&files->file_lock); spin_unlock(&files->file_lock);
put_files_struct(files); put_files_struct(files);
} }
return -ENOENT; return -ENOENT;
...@@ -655,7 +655,7 @@ static int proc_readfd(struct file * filp, void * dirent, filldir_t filldir) ...@@ -655,7 +655,7 @@ static int proc_readfd(struct file * filp, void * dirent, filldir_t filldir)
task_unlock(p); task_unlock(p);
if (!files) if (!files)
goto out; goto out;
read_lock(&files->file_lock); spin_lock(&files->file_lock);
for (fd = filp->f_pos-2; for (fd = filp->f_pos-2;
fd < files->max_fds; fd < files->max_fds;
fd++, filp->f_pos++) { fd++, filp->f_pos++) {
...@@ -663,7 +663,7 @@ static int proc_readfd(struct file * filp, void * dirent, filldir_t filldir) ...@@ -663,7 +663,7 @@ static int proc_readfd(struct file * filp, void * dirent, filldir_t filldir)
if (!fcheck_files(files, fd)) if (!fcheck_files(files, fd))
continue; continue;
read_unlock(&files->file_lock); spin_unlock(&files->file_lock);
j = NUMBUF; j = NUMBUF;
i = fd; i = fd;
...@@ -675,12 +675,12 @@ static int proc_readfd(struct file * filp, void * dirent, filldir_t filldir) ...@@ -675,12 +675,12 @@ static int proc_readfd(struct file * filp, void * dirent, filldir_t filldir)
ino = fake_ino(pid, PROC_PID_FD_DIR + fd); ino = fake_ino(pid, PROC_PID_FD_DIR + fd);
if (filldir(dirent, buf+j, NUMBUF-j, fd+2, ino, DT_LNK) < 0) { if (filldir(dirent, buf+j, NUMBUF-j, fd+2, ino, DT_LNK) < 0) {
read_lock(&files->file_lock); spin_lock(&files->file_lock);
break; break;
} }
read_lock(&files->file_lock); spin_lock(&files->file_lock);
} }
read_unlock(&files->file_lock); spin_unlock(&files->file_lock);
put_files_struct(files); put_files_struct(files);
} }
out: out:
...@@ -824,13 +824,13 @@ static int pid_fd_revalidate(struct dentry * dentry, int flags) ...@@ -824,13 +824,13 @@ static int pid_fd_revalidate(struct dentry * dentry, int flags)
atomic_inc(&files->count); atomic_inc(&files->count);
task_unlock(task); task_unlock(task);
if (files) { if (files) {
read_lock(&files->file_lock); spin_lock(&files->file_lock);
if (fcheck_files(files, fd)) { if (fcheck_files(files, fd)) {
read_unlock(&files->file_lock); spin_unlock(&files->file_lock);
put_files_struct(files); put_files_struct(files);
return 1; return 1;
} }
read_unlock(&files->file_lock); spin_unlock(&files->file_lock);
put_files_struct(files); put_files_struct(files);
} }
d_drop(dentry); d_drop(dentry);
...@@ -920,7 +920,7 @@ static struct dentry *proc_lookupfd(struct inode * dir, struct dentry * dentry) ...@@ -920,7 +920,7 @@ static struct dentry *proc_lookupfd(struct inode * dir, struct dentry * dentry)
if (!files) if (!files)
goto out_unlock; goto out_unlock;
inode->i_mode = S_IFLNK; inode->i_mode = S_IFLNK;
read_lock(&files->file_lock); spin_lock(&files->file_lock);
file = fcheck_files(files, fd); file = fcheck_files(files, fd);
if (!file) if (!file)
goto out_unlock2; goto out_unlock2;
...@@ -928,7 +928,7 @@ static struct dentry *proc_lookupfd(struct inode * dir, struct dentry * dentry) ...@@ -928,7 +928,7 @@ static struct dentry *proc_lookupfd(struct inode * dir, struct dentry * dentry)
inode->i_mode |= S_IRUSR | S_IXUSR; inode->i_mode |= S_IRUSR | S_IXUSR;
if (file->f_mode & 2) if (file->f_mode & 2)
inode->i_mode |= S_IWUSR | S_IXUSR; inode->i_mode |= S_IWUSR | S_IXUSR;
read_unlock(&files->file_lock); spin_unlock(&files->file_lock);
put_files_struct(files); put_files_struct(files);
inode->i_op = &proc_pid_link_inode_operations; inode->i_op = &proc_pid_link_inode_operations;
inode->i_size = 64; inode->i_size = 64;
...@@ -940,7 +940,7 @@ static struct dentry *proc_lookupfd(struct inode * dir, struct dentry * dentry) ...@@ -940,7 +940,7 @@ static struct dentry *proc_lookupfd(struct inode * dir, struct dentry * dentry)
return NULL; return NULL;
out_unlock2: out_unlock2:
read_unlock(&files->file_lock); spin_unlock(&files->file_lock);
put_files_struct(files); put_files_struct(files);
out_unlock: out_unlock:
iput(inode); iput(inode);
......
...@@ -179,9 +179,9 @@ int do_select(int n, fd_set_bits *fds, long *timeout) ...@@ -179,9 +179,9 @@ int do_select(int n, fd_set_bits *fds, long *timeout)
int retval, i, off; int retval, i, off;
long __timeout = *timeout; long __timeout = *timeout;
read_lock(&current->files->file_lock); spin_lock(&current->files->file_lock);
retval = max_select_fd(n, fds); retval = max_select_fd(n, fds);
read_unlock(&current->files->file_lock); spin_unlock(&current->files->file_lock);
if (retval < 0) if (retval < 0)
return retval; return retval;
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
*/ */
struct files_struct { struct files_struct {
atomic_t count; atomic_t count;
rwlock_t file_lock; /* Protects all the below members. Nests inside tsk->alloc_lock */ spinlock_t file_lock; /* Protects all the below members. Nests inside tsk->alloc_lock */
int max_fds; int max_fds;
int max_fdset; int max_fdset;
int next_fd; int next_fd;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#define INIT_FILES \ #define INIT_FILES \
{ \ { \
.count = ATOMIC_INIT(1), \ .count = ATOMIC_INIT(1), \
.file_lock = RW_LOCK_UNLOCKED, \ .file_lock = SPIN_LOCK_UNLOCKED, \
.max_fds = NR_OPEN_DEFAULT, \ .max_fds = NR_OPEN_DEFAULT, \
.max_fdset = __FD_SETSIZE, \ .max_fdset = __FD_SETSIZE, \
.next_fd = 0, \ .next_fd = 0, \
......
...@@ -603,7 +603,7 @@ static int copy_files(unsigned long clone_flags, struct task_struct * tsk) ...@@ -603,7 +603,7 @@ static int copy_files(unsigned long clone_flags, struct task_struct * tsk)
atomic_set(&newf->count, 1); atomic_set(&newf->count, 1);
newf->file_lock = RW_LOCK_UNLOCKED; newf->file_lock = SPIN_LOCK_UNLOCKED;
newf->next_fd = 0; newf->next_fd = 0;
newf->max_fds = NR_OPEN_DEFAULT; newf->max_fds = NR_OPEN_DEFAULT;
newf->max_fdset = __FD_SETSIZE; newf->max_fdset = __FD_SETSIZE;
...@@ -616,13 +616,13 @@ static int copy_files(unsigned long clone_flags, struct task_struct * tsk) ...@@ -616,13 +616,13 @@ static int copy_files(unsigned long clone_flags, struct task_struct * tsk)
size = oldf->max_fdset; size = oldf->max_fdset;
if (size > __FD_SETSIZE) { if (size > __FD_SETSIZE) {
newf->max_fdset = 0; newf->max_fdset = 0;
write_lock(&newf->file_lock); spin_lock(&newf->file_lock);
error = expand_fdset(newf, size-1); error = expand_fdset(newf, size-1);
write_unlock(&newf->file_lock); spin_unlock(&newf->file_lock);
if (error) if (error)
goto out_release; goto out_release;
} }
read_lock(&oldf->file_lock); spin_lock(&oldf->file_lock);
open_files = count_open_files(oldf, size); open_files = count_open_files(oldf, size);
...@@ -633,15 +633,15 @@ static int copy_files(unsigned long clone_flags, struct task_struct * tsk) ...@@ -633,15 +633,15 @@ static int copy_files(unsigned long clone_flags, struct task_struct * tsk)
*/ */
nfds = NR_OPEN_DEFAULT; nfds = NR_OPEN_DEFAULT;
if (open_files > nfds) { if (open_files > nfds) {
read_unlock(&oldf->file_lock); spin_unlock(&oldf->file_lock);
newf->max_fds = 0; newf->max_fds = 0;
write_lock(&newf->file_lock); spin_lock(&newf->file_lock);
error = expand_fd_array(newf, open_files-1); error = expand_fd_array(newf, open_files-1);
write_unlock(&newf->file_lock); spin_unlock(&newf->file_lock);
if (error) if (error)
goto out_release; goto out_release;
nfds = newf->max_fds; nfds = newf->max_fds;
read_lock(&oldf->file_lock); spin_lock(&oldf->file_lock);
} }
old_fds = oldf->fd; old_fds = oldf->fd;
...@@ -656,7 +656,7 @@ static int copy_files(unsigned long clone_flags, struct task_struct * tsk) ...@@ -656,7 +656,7 @@ static int copy_files(unsigned long clone_flags, struct task_struct * tsk)
get_file(f); get_file(f);
*new_fds++ = f; *new_fds++ = f;
} }
read_unlock(&oldf->file_lock); spin_unlock(&oldf->file_lock);
/* compute the remainder to be cleared */ /* compute the remainder to be cleared */
size = (newf->max_fds - open_files) * sizeof(struct file *); size = (newf->max_fds - open_files) * sizeof(struct file *);
......
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