/linux/fs/ |
H A D | file_table.c | 11 #include <linux/file.h> 40 /* SLAB cache for file structures */ 46 /* Container for backing file with optional user path */ 48 struct file file; member 55 #define backing_file(f) container_of(f, struct backing_file, file) 57 const struct path *backing_file_user_path(const struct file *f) in backing_file_user_path() 63 void backing_file_set_user_path(struct file *f, const struct path *path) in backing_file_set_user_path() 69 static inline void file_free(struct file *f) in file_free() 114 .procname = "file-nr", 121 .procname = "file-max", [all …]
|
H A D | read_write.c | 12 #include <linux/file.h> 37 static inline bool unsigned_offsets(struct file *file) in unsigned_offsets() argument 39 return file->f_op->fop_flags & FOP_UNSIGNED_OFFSET; in unsigned_offsets() 43 * vfs_setpos_cookie - update the file offset for lseek and reset cookie 44 * @file: file structure in question 45 * @offset: file offset to seek to 46 * @maxsize: maximum file size 49 * Update the file offset to the value specified by @offset if the given 50 * offset is valid and it is not equal to the current file offset and 55 static loff_t vfs_setpos_cookie(struct file *file, loff_t offset, in vfs_setpos_cookie() argument [all …]
|
H A D | file.c | 3 * linux/fs/file.c 17 #include <linux/file.h> 36 if (WARN_ONCE(cnt >= FILE_REF_RELEASED, "imbalanced put on file reference count")) { in __file_ref_put_badval() 121 * space if any. This does not copy the file pointers. Called with the files 138 * Copy all file descriptors from the old table to the new, expanded table and 147 cpy = ofdt->max_fds * sizeof(struct file *); in copy_fdtable() 148 set = (nfdt->max_fds - ofdt->max_fds) * sizeof(struct file *); in copy_fdtable() 206 * a process tries to use a file descriptor near that limit. For example, in alloc_fdtable() 208 * systemd typically sets it to - then trying to use a file descriptor in alloc_fdtable() 209 * close to that value will require allocating a file descriptor table in alloc_fdtable() [all …]
|
H A D | anon_inodes.c | 13 #include <linux/file.h> 33 * User space expects anonymous inodes to have no file type in st_mode. 134 static struct file *__anon_inode_getfile(const char *name, in __anon_inode_getfile() 141 struct file *file; in __anon_inode_getfile() local 150 file = ERR_CAST(inode); in __anon_inode_getfile() 156 file = ERR_PTR(-ENODEV); in __anon_inode_getfile() 166 file = alloc_file_pseudo(inode, anon_inode_mnt, name, in __anon_inode_getfile() 168 if (IS_ERR(file)) in __anon_inode_getfile() 171 file->f_mapping = inode->i_mapping; in __anon_inode_getfile() 173 file->private_data = priv; in __anon_inode_getfile() [all …]
|
H A D | kernel_read_file.c | 9 * kernel_read_file() - read file contents into a kernel buffer 11 * @file: file to read from 18 * @file_size: if non-NULL, the full size of @file will be 21 * file contents being read (for LSMs to examine) 24 * (i.e. the caller must be expecting to read partial file contents 26 * will be able to determine when the entire file was read by 28 * file, though, since it is possible that the contents might 35 ssize_t kernel_read_file(struct file *file, loff_t offset, void **buf, in kernel_read_file() argument 48 if (!S_ISREG(file_inode(file)->i_mode)) in kernel_read_file() 51 ret = deny_write_access(file); in kernel_read_file() [all …]
|
/linux/fs/overlayfs/ |
H A D | file.c | 7 #include <linux/file.h> 14 #include <linux/backing-file.h> 27 static struct file *ovl_open_realfile(const struct file *file, in ovl_open_realfile() argument 31 struct inode *inode = file_inode(file); in ovl_open_realfile() 33 struct file *realfile; in ovl_open_realfile() 35 int flags = file->f_flags | OVL_OPEN_FLAGS; in ovl_open_realfile() 51 realfile = backing_file_open(file_user_path(file), in ovl_open_realfile() 57 file, file, ovl_whatisit(inode, realinode), file->f_flags, in ovl_open_realfile() 65 static int ovl_change_flags(struct file *file, unsigned int flags) in ovl_change_flags() argument 67 struct inode *inode = file_inode(file); in ovl_change_flags() [all …]
|
/linux/fs/lockd/ |
H A D | svcsubs.c | 28 * Global file hash table 46 static inline void nlm_debug_print_file(char *msg, struct nlm_file *file) in nlm_debug_print_file() argument 48 struct inode *inode = nlmsvc_file_inode(file); in nlm_debug_print_file() 59 static inline void nlm_debug_print_file(char *msg, struct nlm_file *file) in nlm_debug_print_file() argument 80 * Open the file. Note that if we're reexporting, for example, 84 * the file. 87 struct nlm_file *file, int mode) in nlm_do_fopen() argument 89 struct file **fp = &file->f_file[mode]; in nlm_do_fopen() 94 nfserr = nlmsvc_ops->fopen(rqstp, &file->f_handle, fp, mode); in nlm_do_fopen() 101 * Lookup file info. If it doesn't exist, create a file info struct [all …]
|
/linux/rust/kernel/fs/ |
H A D | file.rs | 5 //! Files and file descriptors. 8 //! [`include/linux/file.h`](srctree/include/linux/file.h) 20 /// Flags associated with a [`File`]. 22 /// File is opened in append mode. 31 /// File was created if it didn't already exist. 34 /// Direct I/O is enabled for this file. 37 /// File must be a directory. 43 /// Ensure that this file is created with the `open(2)` call. 46 /// Large file siz 180 pub struct File { global() struct 186 unsafe impl Send for File {} global() implementation 190 unsafe impl Sync for File {} global() implementation 194 unsafe impl AlwaysRefCounted for File { global() implementation 202 dec_ref(obj: ptr::NonNull<File>) dec_ref() argument 300 assume_no_fdget_pos(me: ARef<LocalFile>) -> ARef<File> assume_no_fdget_pos() argument 311 as_ptr(&self) -> *mut bindings::file as_ptr() argument 341 impl File { global() implementation 351 from_raw_file<'a>(ptr: *const bindings::file) -> &'a File from_raw_file() argument 361 impl core::ops::Deref for File { global() implementation 421 fd_install(self, file: ARef<File>) fd_install() argument [all...] |
/linux/fs/ecryptfs/ |
H A D | file.c | 12 #include <linux/file.h> 29 * returns without any errors. This is to be used only for file reads. 36 struct file *file = iocb->ki_filp; in ecryptfs_read_update_atime() local 40 struct path path = ecryptfs_lower_path(file->f_path.dentry); in ecryptfs_read_update_atime() 53 * to be used only for file reads. The function to be used for directory reads 56 static ssize_t ecryptfs_splice_read_update_atime(struct file *in, loff_t *ppos, in ecryptfs_splice_read_update_atime() 121 * @file: The eCryptfs directory file 124 static int ecryptfs_readdir(struct file *file, struct dir_context *ctx) in ecryptfs_readdir() argument 127 struct file *lower_file; in ecryptfs_readdir() 128 struct inode *inode = file_inode(file); in ecryptfs_readdir() [all …]
|
/linux/drivers/scsi/fnic/ |
H A D | fnic_debugfs.c | 38 * file system. If not already created, this routine will create the 68 * When Debugfs is configured this routine removes debugfs file system 85 * or fc_trace_clear debugfs file 86 * @filp: The file pointer to read from. 89 * @ppos: The position in the file to start reading from. 95 * It will start reading file at @ppos and 101 static ssize_t fnic_trace_ctrl_read(struct file *filp, in fnic_trace_ctrl_read() 117 pr_err("fnic: Cannot read to any debugfs file\n"); in fnic_trace_ctrl_read() 125 * fc_trace_clear debugfs file 126 * @filp: The file pointer to write from. [all …]
|
/linux/rust/kernel/ |
H A D | miscdevice.rs | 16 fs::{File, Kiocb}, 121 /// The returned pointer will be stored as the private data for the file. in open() argument 122 fn open(_file: &File, _misc: &MiscDeviceRegistration<Self>) -> Result<Self::Ptr>; 125 fn release(device: Self::Ptr, _file: &File) { in release() 132 /// `file`. The function is a callback that is part of the VMA initializer. The kernel will do 139 _file: &File, in mmap() 162 _file: &File, 179 _file: &File, in show_fdinfo() argument 190 _file: &File, 196 /// A vtable for the file operation in open() 124 release(device: Self::Ptr, _file: &File) release() argument 138 mmap( _device: <Self::Ptr as ForeignOwnable>::Borrowed<'_>, _file: &File, _vma: &VmaNew, ) -> Result mmap() argument 151 ioctl( _device: <Self::Ptr as ForeignOwnable>::Borrowed<'_>, _file: &File, _cmd: u32, _arg: usize, ) -> Result<isize> ioctl() argument 168 compat_ioctl( _device: <Self::Ptr as ForeignOwnable>::Borrowed<'_>, _file: &File, _cmd: u32, _arg: usize, ) -> Result<isize> compat_ioctl() argument 212 let file = unsafe { File::from_raw_file(raw_file) }; open() localVariable 253 mmap( file: *mut bindings::file, vma: *mut bindings::vm_area_struct, ) -> c_int mmap() argument 267 let file = unsafe { File::from_raw_file(file) }; mmap() localVariable 278 ioctl(file: *mut bindings::file, cmd: c_uint, arg: c_ulong) -> c_long ioctl() argument 287 let file = unsafe { File::from_raw_file(file) }; ioctl() localVariable 300 compat_ioctl( file: *mut bindings::file, cmd: c_uint, arg: c_ulong, ) -> c_long compat_ioctl() argument 312 let file = unsafe { File::from_raw_file(file) }; compat_ioctl() localVariable 324 show_fdinfo(seq_file: *mut bindings::seq_file, file: *mut bindings::file) show_fdinfo() argument 332 let file = unsafe { File::from_raw_file(file) }; show_fdinfo() localVariable [all...] |
/linux/fs/debugfs/ |
H A D | file.c | 3 * file.c - part of debugfs, a tiny little debug file system 29 static ssize_t default_read_file(struct file *file, char __user *buf, in default_read_file() argument 35 static ssize_t default_write_file(struct file *file, const char __user *buf, in default_write_file() argument 50 void *debugfs_get_aux(const struct file *file) in debugfs_get_aux() argument 52 return DEBUGFS_I(file_inode(file))->aux; in debugfs_get_aux() 69 * debugfs_file_get() on a dentry that isn't even a file, let in __debugfs_file_get() 146 * debugfs_file_get - mark the beginning of file data access 150 * into the file removing functions debugfs_remove() and 152 * file data may only get freed after a successful return of any of 156 * If -%EIO is returned, the file has already been removed and thus, [all …]
|
/linux/drivers/infiniband/core/ |
H A D | user_mad.c | 9 * General Public License (GPL) Version 2, available from the file 81 * device special file is opened, we take a reference on the 174 static int hdr_size(struct ib_umad_file *file) in hdr_size() argument 176 return file->use_pkey_index ? sizeof(struct ib_user_mad_hdr) : in hdr_size() 180 /* caller must hold file->mutex */ 181 static struct ib_mad_agent *__get_agent(struct ib_umad_file *file, int id) in __get_agent() argument 183 return file->agents_dead ? NULL : file->agent[id]; in __get_agent() 186 static int queue_packet(struct ib_umad_file *file, struct ib_mad_agent *agent, in queue_packet() argument 191 mutex_lock(&file->mutex); in queue_packet() 194 atomic_read(&file->recv_list_size) > MAX_UMAD_RECV_LIST_SIZE) in queue_packet() [all …]
|
/linux/tools/testing/selftests/rcutorture/bin/ |
H A D | parse-console.sh | 5 # The "file" is a pathname on the local system, and "title" is 8 # Usage: parse-console.sh file title 15 file="$1" 22 # Check for presence and readability of console output file 23 if test -f "$file" -a -r "$file" 27 echo $title unreadable console output file: $file 30 if grep -Pq '\x00' < $file 34 cat /dev/null > $file [all...] |
/linux/fs/ceph/ |
H A D | ioctl.c | 16 * get and set the file layout 18 static long ceph_ioctl_get_layout(struct file *file, void __user *arg) in ceph_ioctl_get_layout() argument 20 struct ceph_inode_info *ci = ceph_inode(file_inode(file)); in ceph_ioctl_get_layout() 24 err = ceph_do_getattr(file_inode(file), CEPH_STAT_CAP_LAYOUT, false); in ceph_ioctl_get_layout() 65 static long ceph_ioctl_set_layout(struct file *file, void __user *arg) in ceph_ioctl_set_layout() argument 67 struct inode *inode = file_inode(file); in ceph_ioctl_set_layout() 71 struct ceph_inode_info *ci = ceph_inode(file_inode(file)); in ceph_ioctl_set_layout() 79 err = ceph_do_getattr(file_inode(file), CEPH_STAT_CAP_LAYOUT, false); in ceph_ioctl_set_layout() 137 static long ceph_ioctl_set_layout_policy (struct file *file, void __user *arg) in ceph_ioctl_set_layout_policy() argument 139 struct inode *inode = file_inode(file); in ceph_ioctl_set_layout_policy() [all …]
|
/linux/fs/proc/ |
H A D | inode.c | 19 #include <linux/file.h> 226 * "struct file" needs to be available at the right moment. in close_pdeo() 235 struct file *file; in close_pdeo() local 241 file = pdeo->file; in close_pdeo() 242 pde->proc_ops->proc_release(file_inode(file), file); in close_pdeo() 275 static loff_t proc_reg_llseek(struct file *file, loff_t offset, int whence) in proc_reg_llseek() argument 277 struct proc_dir_entry *pde = PDE(file_inode(file)); in proc_reg_llseek() 281 return pde->proc_ops->proc_lseek(file, offset, whence); in proc_reg_llseek() 283 rv = pde->proc_ops->proc_lseek(file, offset, whence); in proc_reg_llseek() 304 static ssize_t pde_read(struct proc_dir_entry *pde, struct file *file, char __user *buf, size_t cou… in pde_read() argument [all …]
|
/linux/Documentation/ABI/testing/ |
H A D | sysfs-driver-ufs | 5 This file contains the auto-hibernate idle timer setting of a 19 Description: This file shows the device type. This is one of the UFS 23 The file is read only. 29 Description: This file shows the device class. This is one of the UFS 33 The file is read only. 39 Description: This file shows the UFS storage subclass. This is one of 43 The file is read only. 49 Description: This file shows the protocol supported by an UFS device. 54 The file is read only. 60 Description: This file shows number of logical units. This is one of [all …]
|
H A D | sysfs-kernel-mm-damon | 17 Description: Writing a number 'N' to this file creates the number of 24 Description: Writing 'on' or 'off' to this file makes the kdamond starts or 25 stops, respectively. Reading the file returns the keywords 26 based on the current status. Writing 'commit' to this file 29 this file makes the kdamond reads the quota goal files again. 30 Writing 'update_schemes_stats' to the file updates contents of 32 'update_schemes_tried_regions' to the file updates contents of 34 kdamond. Writing 'update_schemes_tried_bytes' to the file 36 kdamond. Writing 'clear_schemes_tried_regions' to the file 38 'update_schemes_effective_quotas' to the file updates [all …]
|
/linux/mm/ |
H A D | memfd.c | 2 * memfd_create system call and file sealing support 7 * This file is released under the GPL. 13 #include <linux/file.h> 68 struct folio *memfd_alloc_folio(struct file *memfd, pgoff_t idx) in memfd_alloc_folio() 184 static unsigned int *memfd_file_seals_ptr(struct file *file) in memfd_file_seals_ptr() argument 186 if (shmem_file(file)) in memfd_file_seals_ptr() 187 return &SHMEM_I(file_inode(file))->seals; in memfd_file_seals_ptr() 190 if (is_file_hugepages(file)) in memfd_file_seals_ptr() 191 return &HUGETLBFS_I(file_inode(file))->seals; in memfd_file_seals_ptr() 204 static int memfd_add_seals(struct file *file, unsigned int seals) in memfd_add_seals() argument [all …]
|
/linux/drivers/net/wireless/marvell/libertas/ |
H A D | debugfs.c | 25 static ssize_t write_file_dummy(struct file *file, const char __user *buf, in write_file_dummy() argument 33 static ssize_t lbs_dev_info(struct file *file, char __user *userbuf, in lbs_dev_info() argument 36 struct lbs_private *priv = file->private_data; in lbs_dev_info() 55 static ssize_t lbs_sleepparams_write(struct file *file, in lbs_sleepparams_write() argument 59 struct lbs_private *priv = file->private_data; in lbs_sleepparams_write() 92 static ssize_t lbs_sleepparams_read(struct file *file, char __user *userbuf, in lbs_sleepparams_read() argument 95 struct lbs_private *priv = file->private_data; in lbs_sleepparams_read() 120 static ssize_t lbs_host_sleep_write(struct file *file, in lbs_host_sleep_write() argument 124 struct lbs_private *priv = file->private_data; in lbs_host_sleep_write() 162 static ssize_t lbs_host_sleep_read(struct file *file, char __user *userbuf, in lbs_host_sleep_read() argument [all …]
|
/linux/tools/perf/util/ |
H A D | data.c | 51 struct perf_data_file *file = &files[i]; in perf_data__create_dir() local 53 ret = asprintf(&file->path, "%s/data.%d", data->path, i); in perf_data__create_dir() 60 ret = open(file->path, O_RDWR|O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR); in perf_data__create_dir() 75 file->fd = ret; in perf_data__create_dir() 97 * Directory containing a single regular perf data file which is already in perf_data__open_dir() 115 struct perf_data_file *file; in perf_data__open_dir() local 128 file = realloc(files, (nr + 1) * sizeof(*files)); in perf_data__open_dir() 129 if (!file) in perf_data__open_dir() 132 files = file; in perf_data__open_dir() 133 file in perf_data__open_dir() 169 struct perf_data_file *file = &data->dir.files[i]; perf_data__update_dir() local 414 perf_data_file__write(struct perf_data_file * file,void * buf,size_t size) perf_data_file__write() argument 478 struct perf_data_file *file = &data->dir.files[i]; perf_data__size() local 560 FILE *file; is_perf_data() local [all...] |
/linux/fs/fuse/ |
H A D | passthrough.c | 3 * FUSE passthrough to backing file. 10 #include <linux/file.h> 11 #include <linux/backing-file.h> 14 static void fuse_file_accessed(struct file *file) in fuse_file_accessed() argument 16 struct inode *inode = file_inode(file); in fuse_file_accessed() 30 struct file *file = iocb->ki_filp; in fuse_passthrough_read_iter() local 31 struct fuse_file *ff = file->private_data; in fuse_passthrough_read_iter() 32 struct file *backing_file = fuse_file_passthrough(ff); in fuse_passthrough_read_iter() 56 struct file *file = iocb->ki_filp; in fuse_passthrough_write_iter() local 57 struct inode *inode = file_inode(file); in fuse_passthrough_write_iter() [all …]
|
/linux/fs/ocfs2/ |
H A D | locks.c | 5 * Userspace file locking support 19 #include "file.h" 23 static int ocfs2_do_flock(struct file *file, struct inode *inode, in ocfs2_do_flock() argument 27 struct ocfs2_file_private *fp = file->private_data; in ocfs2_do_flock() 58 locks_lock_file_wait(file, &request); in ocfs2_do_flock() 60 ocfs2_file_unlock(file); in ocfs2_do_flock() 63 ret = ocfs2_file_lock(file, level, trylock); in ocfs2_do_flock() 72 ret = locks_lock_file_wait(file, fl); in ocfs2_do_flock() 74 ocfs2_file_unlock(file); in ocfs2_do_flock() 82 static int ocfs2_do_funlock(struct file *file, int cmd, struct file_lock *fl) in ocfs2_do_funlock() argument [all …]
|
/linux/virt/kvm/ |
H A D | guest_memfd.c | 227 static long kvm_gmem_fallocate(struct file *file, int mode, loff_t offset, in kvm_gmem_fallocate() argument 242 ret = kvm_gmem_punch_hole(file_inode(file), offset, len); in kvm_gmem_fallocate() 244 ret = kvm_gmem_allocate(file_inode(file), offset, len); in kvm_gmem_fallocate() 247 file_modified(file); in kvm_gmem_fallocate() 251 static int kvm_gmem_release(struct inode *inode, struct file *file) in kvm_gmem_release() argument 253 struct kvm_gmem *gmem = file->private_data; in kvm_gmem_release() 260 * reference to the file and thus no new bindings can be created, but in kvm_gmem_release() 267 * kvm_gmem_get_pfn() cannot be using the file concurrently. in kvm_gmem_release() 276 WRITE_ONCE(slot->gmem.file, NULL); in kvm_gmem_release() 280 * Zap all SPTEs pointed at by this file. Do not free the backing in kvm_gmem_release() [all …]
|
/linux/drivers/net/wireless/mediatek/mt76/ |
H A D | mt76x02_debugfs.c | 10 mt76x02_ampdu_stat_show(struct seq_file *file, void *data) in mt76x02_ampdu_stat_show() argument 12 struct mt76x02_dev *dev = file->private; in mt76x02_ampdu_stat_show() 16 seq_puts(file, "Length: "); in mt76x02_ampdu_stat_show() 18 seq_printf(file, "%8d | ", i * 8 + j + 1); in mt76x02_ampdu_stat_show() 19 seq_puts(file, "\n"); in mt76x02_ampdu_stat_show() 20 seq_puts(file, "Count: "); in mt76x02_ampdu_stat_show() 22 seq_printf(file, "%8d | ", in mt76x02_ampdu_stat_show() 24 seq_puts(file, "\n"); in mt76x02_ampdu_stat_show() 25 seq_puts(file, "--------"); in mt76x02_ampdu_stat_show() 27 seq_puts(file, "-----------"); in mt76x02_ampdu_stat_show() [all …]
|