/fs/ |
D | fcntl.c | 146 static int setfl(int fd, struct file * filp, unsigned long arg) in setfl() argument 148 struct inode * inode = filp->f_path.dentry->d_inode; in setfl() 155 if (((arg ^ filp->f_flags) & O_APPEND) && IS_APPEND(inode)) in setfl() 159 if ((arg & O_NOATIME) && !(filp->f_flags & O_NOATIME)) in setfl() 169 if (!filp->f_mapping || !filp->f_mapping->a_ops || in setfl() 170 !filp->f_mapping->a_ops->direct_IO) in setfl() 174 if (filp->f_op && filp->f_op->check_flags) in setfl() 175 error = filp->f_op->check_flags(arg); in setfl() 184 if ((arg ^ filp->f_flags) & FASYNC) { in setfl() 185 if (filp->f_op && filp->f_op->fasync) { in setfl() [all …]
|
D | ioctl.c | 36 static long vfs_ioctl(struct file *filp, unsigned int cmd, in vfs_ioctl() argument 41 if (!filp->f_op) in vfs_ioctl() 44 if (filp->f_op->unlocked_ioctl) { in vfs_ioctl() 45 error = filp->f_op->unlocked_ioctl(filp, cmd, arg); in vfs_ioctl() 49 } else if (filp->f_op->ioctl) { in vfs_ioctl() 51 error = filp->f_op->ioctl(filp->f_path.dentry->d_inode, in vfs_ioctl() 52 filp, cmd, arg); in vfs_ioctl() 60 static int ioctl_fibmap(struct file *filp, int __user *p) in ioctl_fibmap() argument 62 struct address_space *mapping = filp->f_mapping; in ioctl_fibmap() 184 static int ioctl_fiemap(struct file *filp, unsigned long arg) in ioctl_fiemap() argument [all …]
|
D | locks.c | 271 static int flock_make_lock(struct file *filp, struct file_lock **lock, in flock_make_lock() argument 283 fl->fl_file = filp; in flock_make_lock() 310 static int flock_to_posix_lock(struct file *filp, struct file_lock *fl, in flock_to_posix_lock() argument 320 start = filp->f_pos; in flock_to_posix_lock() 323 start = i_size_read(filp->f_path.dentry->d_inode); in flock_to_posix_lock() 351 fl->fl_file = filp; in flock_to_posix_lock() 360 static int flock64_to_posix_lock(struct file *filp, struct file_lock *fl, in flock64_to_posix_lock() argument 370 start = filp->f_pos; in flock64_to_posix_lock() 373 start = i_size_read(filp->f_path.dentry->d_inode); in flock64_to_posix_lock() 397 fl->fl_file = filp; in flock64_to_posix_lock() [all …]
|
D | fifo.c | 34 static int fifo_open(struct inode *inode, struct file *filp) in fifo_open() argument 48 filp->f_version = 0; in fifo_open() 51 filp->f_mode &= (FMODE_READ | FMODE_WRITE); in fifo_open() 53 switch (filp->f_mode) { in fifo_open() 60 filp->f_op = &read_pipefifo_fops; in fifo_open() 66 if ((filp->f_flags & O_NONBLOCK)) { in fifo_open() 69 filp->f_version = pipe->w_counter; in fifo_open() 86 if ((filp->f_flags & O_NONBLOCK) && !pipe->readers) in fifo_open() 89 filp->f_op = &write_pipefifo_fops; in fifo_open() 108 filp->f_op = &rdwr_pipefifo_fops; in fifo_open()
|
D | pipe.c | 285 struct file *filp = iocb->ki_filp; in pipe_read() local 286 struct inode *inode = filp->f_path.dentry->d_inode; in pipe_read() 366 if (filp->f_flags & O_NONBLOCK) { in pipe_read() 390 file_accessed(filp); in pipe_read() 398 struct file *filp = iocb->ki_filp; in pipe_write() local 399 struct inode *inode = filp->f_path.dentry->d_inode; in pipe_write() 537 if (filp->f_flags & O_NONBLOCK) { in pipe_write() 563 file_update_time(filp); in pipe_write() 568 bad_pipe_r(struct file *filp, char __user *buf, size_t count, loff_t *ppos) in bad_pipe_r() argument 574 bad_pipe_w(struct file *filp, const char __user *buf, size_t count, in bad_pipe_w() argument [all …]
|
/fs/ext3/ |
D | dir.c | 36 static int ext3_dx_readdir(struct file * filp, 39 struct file * filp); 94 static int ext3_readdir(struct file * filp, in ext3_readdir() argument 103 struct inode *inode = filp->f_path.dentry->d_inode; in ext3_readdir() 113 err = ext3_dx_readdir(filp, dirent, filldir); in ext3_readdir() 122 EXT3_I(filp->f_path.dentry->d_inode)->i_flags &= ~EXT3_INDEX_FL; in ext3_readdir() 125 offset = filp->f_pos & (sb->s_blocksize - 1); in ext3_readdir() 127 while (!error && !stored && filp->f_pos < inode->i_size) { in ext3_readdir() 128 unsigned long blk = filp->f_pos >> EXT3_BLOCK_SIZE_BITS(sb); in ext3_readdir() 138 if (!ra_has_index(&filp->f_ra, index)) in ext3_readdir() [all …]
|
D | ioctl.c | 21 int ext3_ioctl (struct inode * inode, struct file * filp, unsigned int cmd, in ext3_ioctl() argument 42 err = mnt_want_write(filp->f_path.mnt); in ext3_ioctl() 128 mnt_drop_write(filp->f_path.mnt); in ext3_ioctl() 143 err = mnt_want_write(filp->f_path.mnt); in ext3_ioctl() 163 mnt_drop_write(filp->f_path.mnt); in ext3_ioctl() 204 err = mnt_want_write(filp->f_path.mnt); in ext3_ioctl() 235 mnt_drop_write(filp->f_path.mnt); in ext3_ioctl() 246 err = mnt_want_write(filp->f_path.mnt); in ext3_ioctl() 261 mnt_drop_write(filp->f_path.mnt); in ext3_ioctl() 272 err = mnt_want_write(filp->f_path.mnt); in ext3_ioctl() [all …]
|
/fs/ext4/ |
D | dir.c | 36 static int ext4_dx_readdir(struct file *filp, 39 struct file *filp); 94 static int ext4_readdir(struct file *filp, in ext4_readdir() argument 103 struct inode *inode = filp->f_path.dentry->d_inode; in ext4_readdir() 113 err = ext4_dx_readdir(filp, dirent, filldir); in ext4_readdir() 122 EXT4_I(filp->f_path.dentry->d_inode)->i_flags &= ~EXT4_INDEX_FL; in ext4_readdir() 125 offset = filp->f_pos & (sb->s_blocksize - 1); in ext4_readdir() 127 while (!error && !stored && filp->f_pos < inode->i_size) { in ext4_readdir() 128 ext4_lblk_t blk = filp->f_pos >> EXT4_BLOCK_SIZE_BITS(sb); in ext4_readdir() 138 if (!ra_has_index(&filp->f_ra, index)) in ext4_readdir() [all …]
|
D | ioctl.c | 21 long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) in ext4_ioctl() argument 23 struct inode *inode = filp->f_dentry->d_inode; in ext4_ioctl() 47 err = mnt_want_write(filp->f_path.mnt); in ext4_ioctl() 128 mnt_drop_write(filp->f_path.mnt); in ext4_ioctl() 144 err = mnt_want_write(filp->f_path.mnt); in ext4_ioctl() 165 mnt_drop_write(filp->f_path.mnt); in ext4_ioctl() 203 err = mnt_want_write(filp->f_path.mnt); in ext4_ioctl() 213 mnt_drop_write(filp->f_path.mnt); in ext4_ioctl() 229 err = mnt_want_write(filp->f_path.mnt); in ext4_ioctl() 239 mnt_drop_write(filp->f_path.mnt); in ext4_ioctl() [all …]
|
/fs/nfs/ |
D | file.c | 45 static ssize_t nfs_file_splice_read(struct file *filp, loff_t *ppos, 55 static int nfs_lock(struct file *filp, int cmd, struct file_lock *fl); 56 static int nfs_flock(struct file *filp, int cmd, struct file_lock *fl); 118 nfs_file_open(struct inode *inode, struct file *filp) in nfs_file_open() argument 123 filp->f_path.dentry->d_parent->d_name.name, in nfs_file_open() 124 filp->f_path.dentry->d_name.name); in nfs_file_open() 126 res = nfs_check_flags(filp->f_flags); in nfs_file_open() 131 res = nfs_open(inode, filp); in nfs_file_open() 136 nfs_file_release(struct inode *inode, struct file *filp) in nfs_file_release() argument 138 struct dentry *dentry = filp->f_path.dentry; in nfs_file_release() [all …]
|
/fs/hpfs/ |
D | dir.c | 11 static int hpfs_dir_release(struct inode *inode, struct file *filp) in hpfs_dir_release() argument 14 hpfs_del_pos(inode, &filp->f_pos); in hpfs_dir_release() 22 static loff_t hpfs_dir_lseek(struct file *filp, loff_t off, int whence) in hpfs_dir_lseek() argument 24 loff_t new_off = off + (whence == 1 ? filp->f_pos : 0); in hpfs_dir_lseek() 27 struct inode *i = filp->f_path.dentry->d_inode; in hpfs_dir_lseek() 45 return filp->f_pos = new_off; in hpfs_dir_lseek() 53 static int hpfs_readdir(struct file *filp, void *dirent, filldir_t filldir) in hpfs_readdir() argument 55 struct inode *inode = filp->f_path.dentry->d_inode; in hpfs_readdir() 101 if (filp->f_pos == 12) { /* diff -r requires this (note, that diff -r */ in hpfs_readdir() 102 filp->f_pos = 13; /* also fails on msdos filesystem in 2.0) */ in hpfs_readdir() [all …]
|
/fs/isofs/ |
D | dir.c | 81 static int do_isofs_readdir(struct inode *inode, struct file *filp, in do_isofs_readdir() argument 97 offset = filp->f_pos & (bufsize - 1); in do_isofs_readdir() 98 block = filp->f_pos >> bufbits; in do_isofs_readdir() 100 while (filp->f_pos < inode->i_size) { in do_isofs_readdir() 122 filp->f_pos = (filp->f_pos + ISOFS_BLOCK_SIZE) & ~(ISOFS_BLOCK_SIZE - 1); in do_isofs_readdir() 123 block = filp->f_pos >> bufbits; in do_isofs_readdir() 167 filp->f_pos += de_len; in do_isofs_readdir() 174 if (filldir(dirent, ".", 1, filp->f_pos, inode->i_ino, DT_DIR) < 0) in do_isofs_readdir() 176 filp->f_pos += de_len; in do_isofs_readdir() 184 inode_number = parent_ino(filp->f_path.dentry); in do_isofs_readdir() [all …]
|
/fs/affs/ |
D | dir.c | 43 affs_readdir(struct file *filp, void *dirent, filldir_t filldir) in affs_readdir() argument 45 struct inode *inode = filp->f_path.dentry->d_inode; in affs_readdir() 59 pr_debug("AFFS: readdir(ino=%lu,f_pos=%lx)\n",inode->i_ino,(unsigned long)filp->f_pos); in affs_readdir() 65 f_pos = filp->f_pos; in affs_readdir() 68 filp->private_data = (void *)0; in affs_readdir() 71 filp->f_pos = f_pos = 1; in affs_readdir() 75 if (filldir(dirent, "..", 2, f_pos, parent_ino(filp->f_path.dentry), DT_DIR) < 0) in affs_readdir() 77 filp->f_pos = f_pos = 2; in affs_readdir() 88 filp->f_pos = ((hash_pos << 16) | chain_pos) + 2; in affs_readdir() 97 ino = (u32)(long)filp->private_data; in affs_readdir() [all …]
|
/fs/9p/ |
D | vfs_dir.c | 69 static int v9fs_dir_readdir(struct file *filp, void *dirent, filldir_t filldir) in v9fs_dir_readdir() argument 79 P9_DPRINTK(P9_DEBUG_VFS, "name %s\n", filp->f_path.dentry->d_name.name); in v9fs_dir_readdir() 80 fid = filp->private_data; in v9fs_dir_readdir() 88 err = v9fs_file_readn(filp, statbuf, NULL, buflen, in v9fs_dir_readdir() 108 filp->f_pos, v9fs_qid2ino(&st.qid), dt_type(&st)); in v9fs_dir_readdir() 110 filp->f_pos += st.size+2; in v9fs_dir_readdir() 134 int v9fs_dir_release(struct inode *inode, struct file *filp) in v9fs_dir_release() argument 138 fid = filp->private_data; in v9fs_dir_release() 140 "inode: %p filp: %p fid: %d\n", inode, filp, fid->fid); in v9fs_dir_release()
|
D | vfs_file.c | 103 static int v9fs_file_lock(struct file *filp, int cmd, struct file_lock *fl) in v9fs_file_lock() argument 106 struct inode *inode = filp->f_path.dentry->d_inode; in v9fs_file_lock() 108 P9_DPRINTK(P9_DEBUG_VFS, "filp: %p lock: %p\n", filp, fl); in v9fs_file_lock() 133 v9fs_file_readn(struct file *filp, char *data, char __user *udata, u32 count, in v9fs_file_readn() argument 137 struct p9_fid *fid = filp->private_data; in v9fs_file_readn() 175 v9fs_file_read(struct file *filp, char __user *udata, size_t count, in v9fs_file_read() argument 182 fid = filp->private_data; in v9fs_file_read() 185 ret = v9fs_file_readn(filp, NULL, udata, count, *offset); in v9fs_file_read() 205 v9fs_file_write(struct file *filp, const char __user * data, in v9fs_file_write() argument 211 struct inode *inode = filp->f_path.dentry->d_inode; in v9fs_file_write() [all …]
|
/fs/proc/ |
D | proc_sysctl.c | 129 static ssize_t proc_sys_call_handler(struct file *filp, void __user *buf, in proc_sys_call_handler() argument 132 struct inode *inode = filp->f_path.dentry->d_inode; in proc_sys_call_handler() 156 error = table->proc_handler(table, write, filp, buf, &res, ppos); in proc_sys_call_handler() 165 static ssize_t proc_sys_read(struct file *filp, char __user *buf, in proc_sys_read() argument 168 return proc_sys_call_handler(filp, (void __user *)buf, count, ppos, 0); in proc_sys_read() 171 static ssize_t proc_sys_write(struct file *filp, const char __user *buf, in proc_sys_write() argument 174 return proc_sys_call_handler(filp, (void __user *)buf, count, ppos, 1); in proc_sys_write() 178 static int proc_sys_fill_cache(struct file *filp, void *dirent, in proc_sys_fill_cache() argument 183 struct dentry *child, *dir = filp->f_path.dentry; in proc_sys_fill_cache() 213 return !!filldir(dirent, qname.name, qname.len, filp->f_pos, ino, type); in proc_sys_fill_cache() [all …]
|
/fs/hfs/ |
D | dir.c | 54 static int hfs_readdir(struct file *filp, void *dirent, filldir_t filldir) in hfs_readdir() argument 56 struct inode *inode = filp->f_path.dentry->d_inode; in hfs_readdir() 65 if (filp->f_pos >= inode->i_size) in hfs_readdir() 74 switch ((u32)filp->f_pos) { in hfs_readdir() 79 filp->f_pos++; in hfs_readdir() 96 filp->f_pos++; in hfs_readdir() 99 if (filp->f_pos >= inode->i_size) in hfs_readdir() 101 err = hfs_brec_goto(&fd, filp->f_pos - 1); in hfs_readdir() 121 if (filldir(dirent, strbuf, len, filp->f_pos, in hfs_readdir() 130 if (filldir(dirent, strbuf, len, filp->f_pos, in hfs_readdir() [all …]
|
/fs/qnx4/ |
D | dir.c | 23 static int qnx4_readdir(struct file *filp, void *dirent, filldir_t filldir) in qnx4_readdir() argument 25 struct inode *inode = filp->f_path.dentry->d_inode; in qnx4_readdir() 35 QNX4DEBUG(("filp->f_pos = %ld\n", (long) filp->f_pos)); in qnx4_readdir() 39 while (filp->f_pos < inode->i_size) { in qnx4_readdir() 40 blknum = qnx4_block_map( inode, filp->f_pos >> QNX4_BLOCK_SIZE_BITS ); in qnx4_readdir() 46 ix = (int)(filp->f_pos >> QNX4_DIR_ENTRY_SIZE_BITS) % QNX4_INODES_PER_BLOCK; in qnx4_readdir() 67 if (filldir(dirent, de->di_fname, size, filp->f_pos, ino, DT_UNKNOWN) < 0) { in qnx4_readdir() 74 filp->f_pos += QNX4_DIR_ENTRY_SIZE; in qnx4_readdir()
|
/fs/notify/inotify/ |
D | inotify_user.c | 597 struct file *filp; in SYSCALL_DEFINE1() local 611 filp = get_empty_filp(); in SYSCALL_DEFINE1() 612 if (!filp) { in SYSCALL_DEFINE1() 638 filp->f_op = &inotify_fops; in SYSCALL_DEFINE1() 639 filp->f_path.mnt = mntget(inotify_mnt); in SYSCALL_DEFINE1() 640 filp->f_path.dentry = dget(inotify_mnt->mnt_root); in SYSCALL_DEFINE1() 641 filp->f_mapping = filp->f_path.dentry->d_inode->i_mapping; in SYSCALL_DEFINE1() 642 filp->f_mode = FMODE_READ; in SYSCALL_DEFINE1() 643 filp->f_flags = O_RDONLY | (flags & O_NONBLOCK); in SYSCALL_DEFINE1() 644 filp->private_data = dev; in SYSCALL_DEFINE1() [all …]
|
/fs/efs/ |
D | dir.c | 22 static int efs_readdir(struct file *filp, void *dirent, filldir_t filldir) { in efs_readdir() argument 23 struct inode *inode = filp->f_path.dentry->d_inode; in efs_readdir() 39 block = filp->f_pos >> EFS_DIRBSIZE_BITS; in efs_readdir() 42 slot = filp->f_pos & 0xff; in efs_readdir() 79 filp->f_pos = (block << EFS_DIRBSIZE_BITS) | slot; in efs_readdir() 82 filldir(dirent, nameptr, namelen, filp->f_pos, inodenum, DT_UNKNOWN); in efs_readdir() 97 filp->f_pos = (block << EFS_DIRBSIZE_BITS) | slot; in efs_readdir() 108 filp->f_pos = (block << EFS_DIRBSIZE_BITS) | slot; in efs_readdir()
|
/fs/udf/ |
D | dir.c | 39 static int do_udf_readdir(struct inode *dir, struct file *filp, in do_udf_readdir() argument 46 loff_t nf_pos = (filp->f_pos - 1) << 2; in do_udf_readdir() 120 filp->f_pos = (nf_pos >> 2) + 1; in do_udf_readdir() 159 iblock = parent_ino(filp->f_path.dentry); in do_udf_readdir() 171 if (flen && filldir(dirent, fname, flen, filp->f_pos, in do_udf_readdir() 176 filp->f_pos = (nf_pos >> 2) + 1; in do_udf_readdir() 188 static int udf_readdir(struct file *filp, void *dirent, filldir_t filldir) in udf_readdir() argument 190 struct inode *dir = filp->f_path.dentry->d_inode; in udf_readdir() 195 if (filp->f_pos == 0) { in udf_readdir() 196 if (filldir(dirent, ".", 1, filp->f_pos, dir->i_ino, DT_DIR) < 0) { in udf_readdir() [all …]
|
/fs/notify/dnotify/ |
D | dnotify.c | 40 void dnotify_flush(struct file *filp, fl_owner_t id) in dnotify_flush() argument 46 inode = filp->f_path.dentry->d_inode; in dnotify_flush() 52 if ((dn->dn_owner == id) && (dn->dn_filp == filp)) { in dnotify_flush() 63 int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg) in fcntl_dirnotify() argument 74 dnotify_flush(filp, id); in fcntl_dirnotify() 79 inode = filp->f_path.dentry->d_inode; in fcntl_dirnotify() 88 if ((odn->dn_owner == id) && (odn->dn_filp == filp)) { in fcntl_dirnotify() 103 if (f != filp) in fcntl_dirnotify() 106 error = __f_setown(filp, task_pid(current), PIDTYPE_PID, 0); in fcntl_dirnotify() 112 dn->dn_filp = filp; in fcntl_dirnotify()
|
/fs/ext2/ |
D | ioctl.c | 21 long ext2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) in ext2_ioctl() argument 23 struct inode *inode = filp->f_dentry->d_inode; in ext2_ioctl() 39 ret = mnt_want_write(filp->f_path.mnt); in ext2_ioctl() 87 mnt_drop_write(filp->f_path.mnt); in ext2_ioctl() 95 ret = mnt_want_write(filp->f_path.mnt); in ext2_ioctl() 104 mnt_drop_write(filp->f_path.mnt); in ext2_ioctl() 125 ret = mnt_want_write(filp->f_path.mnt); in ext2_ioctl() 149 mnt_drop_write(filp->f_path.mnt); in ext2_ioctl()
|
/fs/reiserfs/ |
D | ioctl.c | 23 int reiserfs_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, in reiserfs_ioctl() argument 33 return reiserfs_unpack(inode, filp); in reiserfs_ioctl() 51 err = mnt_want_write(filp->f_path.mnt); in reiserfs_ioctl() 81 result = reiserfs_unpack(inode, filp); in reiserfs_ioctl() 92 mnt_drop_write(filp->f_path.mnt); in reiserfs_ioctl() 100 err = mnt_want_write(filp->f_path.mnt); in reiserfs_ioctl() 110 mnt_drop_write(filp->f_path.mnt); in reiserfs_ioctl() 160 int reiserfs_unpack(struct inode *inode, struct file *filp) in reiserfs_unpack() argument
|
/fs/adfs/ |
D | dir.c | 29 adfs_readdir(struct file *filp, void *dirent, filldir_t filldir) in adfs_readdir() argument 31 struct inode *inode = filp->f_path.dentry->d_inode; in adfs_readdir() 40 if (filp->f_pos >> 32) in adfs_readdir() 47 switch ((unsigned long)filp->f_pos) { in adfs_readdir() 51 filp->f_pos += 1; in adfs_readdir() 56 filp->f_pos += 1; in adfs_readdir() 64 ret = ops->setpos(&dir, filp->f_pos - 2); in adfs_readdir() 69 filp->f_pos, obj.file_id, DT_UNKNOWN) < 0) in adfs_readdir() 71 filp->f_pos += 1; in adfs_readdir()
|