GFS2: Only do one directory search on create
authorSteven Whitehouse <swhiteho@redhat.com>
Tue, 11 Jun 2013 12:45:29 +0000 (13:45 +0100)
committerSteven Whitehouse <swhiteho@redhat.com>
Tue, 11 Jun 2013 12:45:29 +0000 (13:45 +0100)
commit5a00f3cc978be45b9d2597851bedaa40630bc597
tree716a1b29594e352c4c793b699331d4d57578cce9
parenta9aefd707c65aa5a7945b3f16bd39f314aa8414d
GFS2: Only do one directory search on create

Creation of a new inode requires a directory search in order to ensure
that we are not trying to create an inode with the same name as an
existing one. This was hidden away inside the create_ok() function.

In the case that there was an existing inode, and a lookup can be
substituted for a create (which is the case with regular files
when the O_EXCL flag is not in use) then we were doing a second
lookup in order to return the inode.

This patch merges these two lookups into one. This can be done by
passing a flag to gfs2_dir_search() to tell it to just return -EEXIST
in the cases where we don't actually want to look up the inode.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
fs/gfs2/dir.c
fs/gfs2/dir.h
fs/gfs2/inode.c
This page took 0.025972 seconds and 5 git commands to generate.