• Home
  • Raw
  • Download

Lines Matching refs:file

45 static inline void nlm_debug_print_file(char *msg, struct nlm_file *file)  in nlm_debug_print_file()  argument
47 struct inode *inode = file_inode(file->f_file); in nlm_debug_print_file()
58 static inline void nlm_debug_print_file(char *msg, struct nlm_file *file) in nlm_debug_print_file() argument
86 struct nlm_file *file; in nlm_lookup_file() local
97 hlist_for_each_entry(file, &nlm_files[hash], f_list) in nlm_lookup_file()
98 if (!nfs_compare_fh(&file->f_handle, f)) in nlm_lookup_file()
104 file = kzalloc(sizeof(*file), GFP_KERNEL); in nlm_lookup_file()
105 if (!file) in nlm_lookup_file()
108 memcpy(&file->f_handle, f, sizeof(struct nfs_fh)); in nlm_lookup_file()
109 mutex_init(&file->f_mutex); in nlm_lookup_file()
110 INIT_HLIST_NODE(&file->f_list); in nlm_lookup_file()
111 INIT_LIST_HEAD(&file->f_blocks); in nlm_lookup_file()
119 if ((nfserr = nlmsvc_ops->fopen(rqstp, f, &file->f_file)) != 0) { in nlm_lookup_file()
124 hlist_add_head(&file->f_list, &nlm_files[hash]); in nlm_lookup_file()
127 dprintk("lockd: found file %p (count %d)\n", file, file->f_count); in nlm_lookup_file()
128 *result = file; in nlm_lookup_file()
129 file->f_count++; in nlm_lookup_file()
137 kfree(file); in nlm_lookup_file()
145 nlm_delete_file(struct nlm_file *file) in nlm_delete_file() argument
147 nlm_debug_print_file("closing file", file); in nlm_delete_file()
148 if (!hlist_unhashed(&file->f_list)) { in nlm_delete_file()
149 hlist_del(&file->f_list); in nlm_delete_file()
150 nlmsvc_ops->fclose(file->f_file); in nlm_delete_file()
151 kfree(file); in nlm_delete_file()
162 nlm_traverse_locks(struct nlm_host *host, struct nlm_file *file, in nlm_traverse_locks() argument
165 struct inode *inode = nlmsvc_file_inode(file); in nlm_traverse_locks()
173 file->f_locks = 0; in nlm_traverse_locks()
180 file->f_locks++; in nlm_traverse_locks()
190 if (vfs_lock_file(file->f_file, F_SETLK, &lock, NULL) < 0) { in nlm_traverse_locks()
213 nlm_inspect_file(struct nlm_host *host, struct nlm_file *file, nlm_host_match_fn_t match) in nlm_inspect_file() argument
215 nlmsvc_traverse_blocks(host, file, match); in nlm_inspect_file()
216 nlmsvc_traverse_shares(host, file, match); in nlm_inspect_file()
217 return nlm_traverse_locks(host, file, match); in nlm_inspect_file()
225 nlm_file_inuse(struct nlm_file *file) in nlm_file_inuse() argument
227 struct inode *inode = nlmsvc_file_inode(file); in nlm_file_inuse()
231 if (file->f_count || !list_empty(&file->f_blocks) || file->f_shares) in nlm_file_inuse()
244 file->f_locks = 0; in nlm_file_inuse()
253 int (*is_failover_file)(void *data, struct nlm_file *file)) in nlm_traverse_files() argument
256 struct nlm_file *file; in nlm_traverse_files() local
261 hlist_for_each_entry_safe(file, next, &nlm_files[i], f_list) { in nlm_traverse_files()
262 if (is_failover_file && !is_failover_file(data, file)) in nlm_traverse_files()
264 file->f_count++; in nlm_traverse_files()
269 if (nlm_inspect_file(data, file, match)) in nlm_traverse_files()
273 file->f_count--; in nlm_traverse_files()
275 if (list_empty(&file->f_blocks) && !file->f_locks in nlm_traverse_files()
276 && !file->f_shares && !file->f_count) { in nlm_traverse_files()
277 hlist_del(&file->f_list); in nlm_traverse_files()
278 nlmsvc_ops->fclose(file->f_file); in nlm_traverse_files()
279 kfree(file); in nlm_traverse_files()
297 nlm_release_file(struct nlm_file *file) in nlm_release_file() argument
300 file, file->f_count); in nlm_release_file()
306 if (--file->f_count == 0 && !nlm_file_inuse(file)) in nlm_release_file()
307 nlm_delete_file(file); in nlm_release_file()
413 nlmsvc_match_sb(void *datap, struct nlm_file *file) in nlmsvc_match_sb() argument
417 return sb == file_inode(file->f_file)->i_sb; in nlmsvc_match_sb()