In lfn_open() there is no point of building the Index if the
cache lookup is successful and caller is not asking for Index.
Signed-off-by: Somnath Roy <somnath.roy@sandisk.com>
( oid.shard_id == shard_id_t::NO_SHARD &&
oid.generation == ghobject_t::NO_GEN ));
assert(outfd);
+ int r = 0;
bool need_lock = true;
+ if (!replaying) {
+ *outfd = fdcache.lookup(oid);
+ if (*outfd) {
+ if (!index) {
+ return 0;
+ } else {
+ if (!((*index).index)) {
+ r = get_index(cid, index);
+ return r;
+ }
+ }
+ }
+ }
+
int flags = O_RDWR;
if (create)
flags |= O_CREAT;
if (!index) {
index = &index2;
}
- int r = 0;
+
if (!((*index).index)) {
r = get_index(cid, index);
} else {
}
int fd, exist;
- if (!replaying) {
- *outfd = fdcache.lookup(oid);
- if (*outfd)
- return 0;
- }
assert(NULL != (*index).index);