Lines Matching refs:filp

39 static int setfl(int fd, struct file * filp, unsigned int arg)  in setfl()  argument
41 struct inode * inode = file_inode(filp); in setfl()
48 if (((arg ^ filp->f_flags) & O_APPEND) && IS_APPEND(inode)) in setfl()
52 if ((arg & O_NOATIME) && !(filp->f_flags & O_NOATIME)) in setfl()
53 if (!inode_owner_or_capable(file_mnt_idmap(filp), inode)) in setfl()
64 !(filp->f_mode & FMODE_CAN_ODIRECT)) in setfl()
67 if (filp->f_op->check_flags) in setfl()
68 error = filp->f_op->check_flags(arg); in setfl()
75 if (((arg ^ filp->f_flags) & FASYNC) && filp->f_op->fasync) { in setfl()
76 error = filp->f_op->fasync(fd, filp, (arg & FASYNC) != 0); in setfl()
82 spin_lock(&filp->f_lock); in setfl()
83 filp->f_flags = (arg & SETFL_MASK) | (filp->f_flags & ~SETFL_MASK); in setfl()
84 filp->f_iocb_flags = iocb_flags(filp); in setfl()
85 spin_unlock(&filp->f_lock); in setfl()
127 void __f_setown(struct file *filp, struct pid *pid, enum pid_type type, in __f_setown() argument
132 f_owner = file_f_owner(filp); in __f_setown()
144 security_file_set_fowner(filp); in __f_setown()
153 int f_setown(struct file *filp, int who, int force) in f_setown() argument
171 ret = file_f_owner_allocate(filp); in f_setown()
183 __f_setown(filp, pid, type, force); in f_setown()
190 void f_delown(struct file *filp) in f_delown() argument
192 __f_setown(filp, NULL, PIDTYPE_TGID, 1); in f_delown()
195 pid_t f_getown(struct file *filp) in f_getown() argument
200 f_owner = file_f_owner(filp); in f_getown()
216 static int f_setown_ex(struct file *filp, unsigned long arg) in f_setown_ex() argument
245 ret = file_f_owner_allocate(filp); in f_setown_ex()
254 __f_setown(filp, pid, type, 1); in f_setown_ex()
260 static int f_getown_ex(struct file *filp, unsigned long arg) in f_getown_ex() argument
268 f_owner = file_f_owner(filp); in f_getown_ex()
308 static int f_getowner_uids(struct file *filp, unsigned long arg) in f_getowner_uids() argument
316 f_owner = file_f_owner(filp); in f_getowner_uids()
330 static int f_getowner_uids(struct file *filp, unsigned long arg) in f_getowner_uids() argument
396 static long f_dupfd_query(int fd, struct file *filp) in f_dupfd_query() argument
411 return fd_file(f) == filp; in f_dupfd_query()
415 static long f_created_query(const struct file *filp) in f_created_query() argument
417 return !!(filp->f_mode & FMODE_CREATED); in f_created_query()
420 static int f_owner_sig(struct file *filp, int signum, bool setsig) in f_owner_sig() argument
431 ret = file_f_owner_allocate(filp); in f_owner_sig()
436 f_owner = file_f_owner(filp); in f_owner_sig()
445 struct file *filp) in do_fcntl() argument
455 err = f_created_query(filp); in do_fcntl()
458 err = f_dupfd(argi, filp, 0); in do_fcntl()
461 err = f_dupfd(argi, filp, O_CLOEXEC); in do_fcntl()
464 err = f_dupfd_query(argi, filp); in do_fcntl()
474 err = filp->f_flags; in do_fcntl()
477 err = setfl(fd, filp, argi); in do_fcntl()
486 err = fcntl_getlk(filp, cmd, &flock); in do_fcntl()
500 err = fcntl_setlk(fd, filp, cmd, &flock); in do_fcntl()
510 err = f_getown(filp); in do_fcntl()
514 err = f_setown(filp, argi, 1); in do_fcntl()
517 err = f_getown_ex(filp, arg); in do_fcntl()
520 err = f_setown_ex(filp, arg); in do_fcntl()
523 err = f_getowner_uids(filp, arg); in do_fcntl()
526 err = f_owner_sig(filp, 0, false); in do_fcntl()
529 err = f_owner_sig(filp, argi, true); in do_fcntl()
532 err = fcntl_getlease(filp); in do_fcntl()
535 err = fcntl_setlease(fd, filp, argi); in do_fcntl()
538 err = fcntl_dirnotify(fd, filp, argi); in do_fcntl()
542 err = pipe_fcntl(filp, cmd, argi); in do_fcntl()
546 err = memfd_fcntl(filp, cmd, argi); in do_fcntl()
549 err = fcntl_get_rw_hint(filp, arg); in do_fcntl()
552 err = fcntl_set_rw_hint(filp, arg); in do_fcntl()
557 err = fcntl_getdeleg(filp, &deleg); in do_fcntl()
564 err = fcntl_setdeleg(fd, filp, &deleg); in do_fcntl()
1001 int fasync_remove_entry(struct file *filp, struct fasync_struct **fapp) in fasync_remove_entry() argument
1006 spin_lock(&filp->f_lock); in fasync_remove_entry()
1009 if (fa->fa_file != filp) in fasync_remove_entry()
1018 filp->f_flags &= ~FASYNC; in fasync_remove_entry()
1023 spin_unlock(&filp->f_lock); in fasync_remove_entry()
1049 struct fasync_struct *fasync_insert_entry(int fd, struct file *filp, struct fasync_struct **fapp, s… in fasync_insert_entry() argument
1053 spin_lock(&filp->f_lock); in fasync_insert_entry()
1056 if (fa->fa_file != filp) in fasync_insert_entry()
1067 new->fa_file = filp; in fasync_insert_entry()
1071 filp->f_flags |= FASYNC; in fasync_insert_entry()
1075 spin_unlock(&filp->f_lock); in fasync_insert_entry()
1083 static int fasync_add_entry(int fd, struct file *filp, struct fasync_struct **fapp) in fasync_add_entry() argument
1098 if (fasync_insert_entry(fd, filp, fapp, new)) { in fasync_add_entry()
1112 int fasync_helper(int fd, struct file * filp, int on, struct fasync_struct **fapp) in fasync_helper() argument
1115 return fasync_remove_entry(filp, fapp); in fasync_helper()
1116 return fasync_add_entry(fd, filp, fapp); in fasync_helper()