Lines Matching defs:file
10 * NFS file locking at all.
13 * to a file's list of blocked locks through a semaphore. The global
148 nlmsvc_lookup_block(struct nlm_file *file, struct nlm_lock *lock)
154 file, lock->fl.fl_pid,
165 if (block->b_file == file && nlm_compare_locks(fl, &lock->fl)) {
226 struct nlm_file *file, struct nlm_lock *lock,
257 block->b_file = file;
258 file->f_count++;
260 /* Add to file's list of blocks */
261 list_add(&block->b_flist, &file->f_blocks);
279 * It is the caller's responsibility to check whether the file
296 struct nlm_file *file = block->b_file;
300 /* Remove block from file's list of blocks */
302 mutex_unlock(&file->f_mutex);
321 struct nlm_file *file,
327 mutex_lock(&file->f_mutex);
329 list_for_each_entry_safe(block, next, &file->f_blocks, b_flist) {
338 mutex_unlock(&file->f_mutex);
344 mutex_unlock(&file->f_mutex);
480 nlmsvc_lock(struct svc_rqst *rqstp, struct nlm_file *file,
485 struct inode *inode = nlmsvc_file_inode(file);
500 if (nlmsvc_file_file(file)->f_op->lock) {
505 /* Lock file against concurrent access */
506 mutex_lock(&file->f_mutex);
510 block = nlmsvc_lookup_block(file, lock);
512 block = nlmsvc_create_block(rqstp, host, file, lock, cookie);
549 error = vfs_lock_file(file->f_file[mode], F_SETLK, &lock->fl, NULL);
587 mutex_unlock(&file->f_mutex);
597 nlmsvc_testlock(struct svc_rqst *rqstp, struct nlm_file *file,
606 nlmsvc_file_inode(file)->i_sb->s_id,
607 nlmsvc_file_inode(file)->i_ino,
618 error = vfs_test_lock(file->f_file[mode], &lock->fl);
658 nlmsvc_unlock(struct net *net, struct nlm_file *file, struct nlm_lock *lock)
663 nlmsvc_file_inode(file)->i_sb->s_id,
664 nlmsvc_file_inode(file)->i_ino,
670 nlmsvc_cancel_blocked(net, file, lock);
673 lock->fl.fl_file = file->f_file[O_RDONLY];
677 lock->fl.fl_file = file->f_file[O_WRONLY];
690 * The calling procedure must check whether the file can be closed.
693 nlmsvc_cancel_blocked(struct net *net, struct nlm_file *file, struct nlm_lock *lock)
700 nlmsvc_file_inode(file)->i_sb->s_id,
701 nlmsvc_file_inode(file)->i_ino,
709 mutex_lock(&file->f_mutex);
710 block = nlmsvc_lookup_block(file, lock);
711 mutex_unlock(&file->f_mutex);
724 * This is a callback from the filesystem for VFS file lock requests.
830 struct nlm_file *file = block->b_file;
859 error = vfs_lock_file(file->f_file[mode], F_SETLK, &lock->fl, NULL);
907 * then sleep on the file semaphore without disrupting e.g. the nfs client).
929 /* Technically, we should down the file semaphore here. Since we