Lines Matching refs:ff
35 static void put_filelock(struct fio_filelock *ff)
37 flist_add(&ff->list, &fld->free_list);
42 struct fio_filelock *ff;
47 ff = flist_first_entry(&fld->free_list, struct fio_filelock, list);
48 flist_del_init(&ff->list);
49 return ff;
54 struct fio_filelock *ff;
57 ff = __get_filelock();
58 if (ff || trylock)
67 return ff;
85 struct fio_filelock *ff = &fld->ffs[i];
87 if (__fio_mutex_init(&ff->lock, FIO_MUTEX_UNLOCKED))
89 flist_add_tail(&ff->list, &fld->free_list);
107 struct fio_filelock *ff;
109 ff = flist_first_entry(&fld->free_list, struct fio_filelock, list);
111 flist_del_init(&ff->list);
112 __fio_mutex_remove(&ff->lock);
122 struct fio_filelock *ff;
125 ff = flist_entry(entry, struct fio_filelock, list);
126 if (ff->hash == hash)
127 return ff;
135 struct fio_filelock *ff;
137 ff = fio_hash_find(hash);
138 if (!ff) {
141 ff = get_filelock(trylock, &retry);
142 if (!ff)
155 put_filelock(ff);
160 ff->hash = hash;
161 ff->references = 0;
162 flist_add(&ff->list, &fld->list);
165 return ff;
170 struct fio_filelock *ff;
176 ff = fio_hash_get(hash, trylock);
177 if (ff)
178 ff->references++;
181 if (!ff) {
187 fio_mutex_down(&ff->lock);
191 if (!fio_mutex_down_trylock(&ff->lock))
200 if (ff->references != 1) {
201 ff->references--;
202 ff = NULL;
207 if (ff) {
208 fio_mutex_down(&ff->lock);
227 struct fio_filelock *ff;
234 ff = fio_hash_find(hash);
235 if (ff) {
236 int refs = --ff->references;
237 fio_mutex_up(&ff->lock);
239 flist_del_init(&ff->list);
240 put_filelock(ff);