int file_lookup_open(struct fio_file *f, int flags) { struct fio_file *__f; int from_hash; __f = lookup_file_hash(f->file_name); if (__f) { dprint(FD_FILE, "found file in hash %s\n", f->file_name); /* * racy, need the __f->lock locked */ f->lock = __f->lock; from_hash = 1; } else { dprint(FD_FILE, "file not found in hash %s\n", f->file_name); from_hash = 0; } #ifdef WIN32 flags |= _O_BINARY; #endif f->fd = open(f->file_name, flags, 0600); return from_hash; }
static int file_lookup_open(struct fio_file *f, int flags) { struct fio_file *__f; int from_hash; __f = lookup_file_hash(f->file_name); if (__f) { dprint(FD_FILE, "found file in hash %s\n", f->file_name); /* * racy, need the __f->lock locked */ f->lock = __f->lock; f->lock_owner = __f->lock_owner; f->lock_batch = __f->lock_batch; f->lock_ddir = __f->lock_ddir; from_hash = 1; } else { dprint(FD_FILE, "file not found in hash %s\n", f->file_name); from_hash = 0; } f->fd = open(f->file_name, flags, 0600); return from_hash; }