]> git.baikalelectronics.ru Git - kernel.git/commit
[PATCH] sanitize locate_fd()
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 24 Apr 2008 00:38:10 +0000 (20:38 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 25 Apr 2008 13:24:05 +0000 (09:24 -0400)
commitd79b6e704072d45f0dcb55421d6008ce63b85c0c
tree618c1ed56eb48da11189f1db9216dd92750c9812
parent2675b465e188ef317ba365ef204f28d8b9520cf1
[PATCH] sanitize locate_fd()

* 'file' argument is unused; lose it.
* move setting flags from the caller (dupfd()) to locate_fd();
  pass cloexec flag as new argument.  Note that files_fdtable()
  that used to be in dupfd() isn't needed in the place in
  locate_fd() where the moved code ends up - we know that ->file_lock
  hadn't been dropped since the last time we calculated fdt because
  we can get there only if expand_files() returns 0 and it doesn't
  drop/reacquire in that case.
* move getting/dropping ->file_lock into locate_fd().  Now the caller
  doesn't need to do anything with files_struct *files anymore and
  we can move that inside locate_fd() as well, killing the
  struct files_struct * argument.

At that point locate_fd() is extremely similar to get_unused_fd_flags()
and the next patches will merge those two.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/fcntl.c