Commit 24643087e748bf192f1182766716e522dc1c972f

Authored by Al Viro
1 parent 844a391799

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>

Showing 1 changed file with 16 additions and 15 deletions Side-by-side Diff

... ... @@ -1259,9 +1259,15 @@
1259 1259 return -ECHILD;
1260 1260  
1261 1261 nd->seq = seq;
1262   - if (dentry->d_flags & DCACHE_OP_REVALIDATE)
1263   - goto need_revalidate;
1264   -done2:
  1262 + if (unlikely(dentry->d_flags & DCACHE_OP_REVALIDATE)) {
  1263 + dentry = do_revalidate(dentry, nd);
  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 1271 path->mnt = mnt;
1266 1272 path->dentry = dentry;
1267 1273 if (likely(__follow_mount_rcu(nd, path, inode, false)))
... ... @@ -1274,8 +1280,13 @@
1274 1280 if (!dentry)
1275 1281 goto need_lookup;
1276 1282 found:
1277   - if (dentry->d_flags & DCACHE_OP_REVALIDATE)
1278   - goto need_revalidate;
  1283 + if (unlikely(dentry->d_flags & DCACHE_OP_REVALIDATE)) {
  1284 + dentry = do_revalidate(dentry, nd);
  1285 + if (!dentry)
  1286 + goto need_lookup;
  1287 + if (IS_ERR(dentry))
  1288 + goto fail;
  1289 + }
1279 1290 done:
1280 1291 path->mnt = mnt;
1281 1292 path->dentry = dentry;
... ... @@ -1316,16 +1327,6 @@
1316 1327 */
1317 1328 mutex_unlock(&dir->i_mutex);
1318 1329 goto found;
1319   -
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  
1330 1331 fail:
1331 1332 return PTR_ERR(dentry);