diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-02-15 01:26:22 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-02-15 02:26:54 -0500 |
commit | 24643087e748bf192f1182766716e522dc1c972f (patch) | |
tree | f67283376c36f6745f1f26c9f67b953ff0b4de55 | |
parent | 844a391799c25d9ba85cbce33e4697db06083ec6 (diff) |
in do_lookup() split RCU and non-RCU cases of need_revalidate
and use unlikely() instead of gotos, for fsck sake...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | fs/namei.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/fs/namei.c b/fs/namei.c index 9ce6d272f4f2..7609bacc7046 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -1259,9 +1259,15 @@ static int do_lookup(struct nameidata *nd, struct qstr *name, | |||
1259 | return -ECHILD; | 1259 | return -ECHILD; |
1260 | 1260 | ||
1261 | nd->seq = seq; | 1261 | nd->seq = seq; |
1262 | if (dentry->d_flags & DCACHE_OP_REVALIDATE) | 1262 | if (unlikely(dentry->d_flags & DCACHE_OP_REVALIDATE)) { |
1263 | goto need_revalidate; | 1263 | dentry = do_revalidate(dentry, nd); |
1264 | done2: | 1264 | if (!dentry) |
1265 | goto need_lookup; | ||
1266 | if (IS_ERR(dentry)) | ||
1267 | goto fail; | ||
1268 | if (!(nd->flags & LOOKUP_RCU)) | ||
1269 | goto done; | ||
1270 | } | ||
1265 | path->mnt = mnt; | 1271 | path->mnt = mnt; |
1266 | path->dentry = dentry; | 1272 | path->dentry = dentry; |
1267 | if (likely(__follow_mount_rcu(nd, path, inode, false))) | 1273 | if (likely(__follow_mount_rcu(nd, path, inode, false))) |
@@ -1274,8 +1280,13 @@ done2: | |||
1274 | if (!dentry) | 1280 | if (!dentry) |
1275 | goto need_lookup; | 1281 | goto need_lookup; |
1276 | found: | 1282 | found: |
1277 | if (dentry->d_flags & DCACHE_OP_REVALIDATE) | 1283 | if (unlikely(dentry->d_flags & DCACHE_OP_REVALIDATE)) { |
1278 | goto need_revalidate; | 1284 | dentry = do_revalidate(dentry, nd); |
1285 | if (!dentry) | ||
1286 | goto need_lookup; | ||
1287 | if (IS_ERR(dentry)) | ||
1288 | goto fail; | ||
1289 | } | ||
1279 | done: | 1290 | done: |
1280 | path->mnt = mnt; | 1291 | path->mnt = mnt; |
1281 | path->dentry = dentry; | 1292 | path->dentry = dentry; |
@@ -1317,16 +1328,6 @@ need_lookup: | |||
1317 | mutex_unlock(&dir->i_mutex); | 1328 | mutex_unlock(&dir->i_mutex); |
1318 | goto found; | 1329 | goto found; |
1319 | 1330 | ||
1320 | need_revalidate: | ||
1321 | dentry = do_revalidate(dentry, nd); | ||
1322 | if (!dentry) | ||
1323 | goto need_lookup; | ||
1324 | if (IS_ERR(dentry)) | ||
1325 | goto fail; | ||
1326 | if (nd->flags & LOOKUP_RCU) | ||
1327 | goto done2; | ||
1328 | goto done; | ||
1329 | |||
1330 | fail: | 1331 | fail: |
1331 | return PTR_ERR(dentry); | 1332 | return PTR_ERR(dentry); |
1332 | } | 1333 | } |