diff options
Diffstat (limited to 'fs/ocfs2/dir.c')
-rw-r--r-- | fs/ocfs2/dir.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c index b08050bd3f2e..ccd4dcfc3645 100644 --- a/fs/ocfs2/dir.c +++ b/fs/ocfs2/dir.c | |||
@@ -18,7 +18,7 @@ | |||
18 | * | 18 | * |
19 | * linux/fs/minix/dir.c | 19 | * linux/fs/minix/dir.c |
20 | * | 20 | * |
21 | * Copyright (C) 1991, 1992 Linux Torvalds | 21 | * Copyright (C) 1991, 1992 Linus Torvalds |
22 | * | 22 | * |
23 | * This program is free software; you can redistribute it and/or | 23 | * This program is free software; you can redistribute it and/or |
24 | * modify it under the terms of the GNU General Public | 24 | * modify it under the terms of the GNU General Public |
@@ -2047,22 +2047,19 @@ int ocfs2_check_dir_for_entry(struct inode *dir, | |||
2047 | const char *name, | 2047 | const char *name, |
2048 | int namelen) | 2048 | int namelen) |
2049 | { | 2049 | { |
2050 | int ret; | 2050 | int ret = 0; |
2051 | struct ocfs2_dir_lookup_result lookup = { NULL, }; | 2051 | struct ocfs2_dir_lookup_result lookup = { NULL, }; |
2052 | 2052 | ||
2053 | trace_ocfs2_check_dir_for_entry( | 2053 | trace_ocfs2_check_dir_for_entry( |
2054 | (unsigned long long)OCFS2_I(dir)->ip_blkno, namelen, name); | 2054 | (unsigned long long)OCFS2_I(dir)->ip_blkno, namelen, name); |
2055 | 2055 | ||
2056 | ret = -EEXIST; | 2056 | if (ocfs2_find_entry(name, namelen, dir, &lookup) == 0) { |
2057 | if (ocfs2_find_entry(name, namelen, dir, &lookup) == 0) | 2057 | ret = -EEXIST; |
2058 | goto bail; | 2058 | mlog_errno(ret); |
2059 | } | ||
2059 | 2060 | ||
2060 | ret = 0; | ||
2061 | bail: | ||
2062 | ocfs2_free_dir_lookup_result(&lookup); | 2061 | ocfs2_free_dir_lookup_result(&lookup); |
2063 | 2062 | ||
2064 | if (ret) | ||
2065 | mlog_errno(ret); | ||
2066 | return ret; | 2063 | return ret; |
2067 | } | 2064 | } |
2068 | 2065 | ||