Lines Matching full:file

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 const struct file_operations *debugfs_real_fops(const struct file *filp) in debugfs_real_fops()
68 * debugfs_file_get - mark the beginning of file data access
72 * into the file removing functions debugfs_remove() and
74 * file data may only get freed after a successful return of any of
78 * If -%EIO is returned, the file has already been removed and thus,
80 * it is allowed to access the file data, zero is returned.
89 * debugfs_file_get() on a dentry that isn't even a file, let in debugfs_file_get()
136 * debugfs_file_put - mark the end of file data access
155 * @file: the file being accessed
159 * When a debugfs file is removed it needs to wait for all active
175 void debugfs_enter_cancellation(struct file *file, in debugfs_enter_cancellation() argument
179 struct dentry *dentry = F_DENTRY(file); in debugfs_enter_cancellation()
206 * @file: the file being accessed
212 void debugfs_leave_cancellation(struct file *file, in debugfs_leave_cancellation() argument
216 struct dentry *dentry = F_DENTRY(file); in debugfs_leave_cancellation()
235 * We also need to exclude any file that has ways to write or alter it as root
239 struct file *filp, in debugfs_locked_down()
255 static int open_proxy_open(struct inode *inode, struct file *filp) in open_proxy_open()
281 WARN(1, "debugfs file owner did not clean up at exit: %pd", in open_proxy_open()
320 PROTO(struct file *filp, loff_t offset, int whence),
324 PROTO(struct file *filp, char __user *buf, size_t size,
329 PROTO(struct file *filp, const char __user *buf, size_t size,
334 PROTO(struct file *filp, unsigned int cmd, unsigned long arg),
337 static __poll_t full_proxy_poll(struct file *filp, in full_proxy_poll()
353 static int full_proxy_release(struct inode *inode, struct file *filp) in full_proxy_release()
391 static int full_proxy_open(struct inode *inode, struct file *filp) in full_proxy_open()
418 WARN(1, "debugfs file owner did not clean up at exit: %pd", in full_proxy_open()
438 /* No protection against file removal anymore. */ in full_proxy_open()
439 WARN(1, "debugfs file owner replaced proxy fops: %pd", in full_proxy_open()
458 ssize_t debugfs_attr_read(struct file *file, char __user *buf, in debugfs_attr_read() argument
461 struct dentry *dentry = F_DENTRY(file); in debugfs_attr_read()
467 ret = simple_attr_read(file, buf, len, ppos); in debugfs_attr_read()
473 static ssize_t debugfs_attr_write_xsigned(struct file *file, const char __user *buf, in debugfs_attr_write_xsigned() argument
476 struct dentry *dentry = F_DENTRY(file); in debugfs_attr_write_xsigned()
483 ret = simple_attr_write_signed(file, buf, len, ppos); in debugfs_attr_write_xsigned()
485 ret = simple_attr_write(file, buf, len, ppos); in debugfs_attr_write_xsigned()
490 ssize_t debugfs_attr_write(struct file *file, const char __user *buf, in debugfs_attr_write() argument
493 return debugfs_attr_write_xsigned(file, buf, len, ppos, false); in debugfs_attr_write()
497 ssize_t debugfs_attr_write_signed(struct file *file, const char __user *buf, in debugfs_attr_write_signed() argument
500 return debugfs_attr_write_xsigned(file, buf, len, ppos, true); in debugfs_attr_write_signed()
537 * debugfs_create_u8 - create a debugfs file that is used to read and write an unsigned 8-bit value
538 * @name: a pointer to a string containing the name of the file to create.
539 * @mode: the permission that the file should have
540 * @parent: a pointer to the parent dentry for this file. This should be a
542 * file will be created in the root of the debugfs filesystem.
543 * @value: a pointer to the variable that the file should read to and write
546 * This function creates a file in debugfs with the given name that
573 …* debugfs_create_u16 - create a debugfs file that is used to read and write an unsigned 16-bit val…
574 * @name: a pointer to a string containing the name of the file to create.
575 * @mode: the permission that the file should have
576 * @parent: a pointer to the parent dentry for this file. This should be a
578 * file will be created in the root of the debugfs filesystem.
579 * @value: a pointer to the variable that the file should read to and write
582 * This function creates a file in debugfs with the given name that
609 …* debugfs_create_u32 - create a debugfs file that is used to read and write an unsigned 32-bit val…
610 * @name: a pointer to a string containing the name of the file to create.
611 * @mode: the permission that the file should have
612 * @parent: a pointer to the parent dentry for this file. This should be a
614 * file will be created in the root of the debugfs filesystem.
615 * @value: a pointer to the variable that the file should read to and write
618 * This function creates a file in debugfs with the given name that
646 …* debugfs_create_u64 - create a debugfs file that is used to read and write an unsigned 64-bit val…
647 * @name: a pointer to a string containing the name of the file to create.
648 * @mode: the permission that the file should have
649 * @parent: a pointer to the parent dentry for this file. This should be a
651 * file will be created in the root of the debugfs filesystem.
652 * @value: a pointer to the variable that the file should read to and write
655 * This function creates a file in debugfs with the given name that
684 * debugfs_create_ulong - create a debugfs file that is used to read and write
686 * @name: a pointer to a string containing the name of the file to create.
687 * @mode: the permission that the file should have
688 * @parent: a pointer to the parent dentry for this file. This should be a
690 * file will be created in the root of the debugfs filesystem.
691 * @value: a pointer to the variable that the file should read to and write
694 * This function creates a file in debugfs with the given name that
726 …* debugfs_create_x{8,16,32,64} - create a debugfs file that is used to read and write an unsigned …
734 * debugfs_create_x8 - create a debugfs file that is used to read and write an unsigned 8-bit value
735 * @name: a pointer to a string containing the name of the file to create.
736 * @mode: the permission that the file should have
737 * @parent: a pointer to the parent dentry for this file. This should be a
739 * file will be created in the root of the debugfs filesystem.
740 * @value: a pointer to the variable that the file should read to and write
752 …* debugfs_create_x16 - create a debugfs file that is used to read and write an unsigned 16-bit val…
753 * @name: a pointer to a string containing the name of the file to create.
754 * @mode: the permission that the file should have
755 * @parent: a pointer to the parent dentry for this file. This should be a
757 * file will be created in the root of the debugfs filesystem.
758 * @value: a pointer to the variable that the file should read to and write
770 …* debugfs_create_x32 - create a debugfs file that is used to read and write an unsigned 32-bit val…
771 * @name: a pointer to a string containing the name of the file to create.
772 * @mode: the permission that the file should have
773 * @parent: a pointer to the parent dentry for this file. This should be a
775 * file will be created in the root of the debugfs filesystem.
776 * @value: a pointer to the variable that the file should read to and write
788 …* debugfs_create_x64 - create a debugfs file that is used to read and write an unsigned 64-bit val…
789 * @name: a pointer to a string containing the name of the file to create.
790 * @mode: the permission that the file should have
791 * @parent: a pointer to the parent dentry for this file. This should be a
793 * file will be created in the root of the debugfs filesystem.
794 * @value: a pointer to the variable that the file should read to and write
822 * debugfs_create_size_t - create a debugfs file that is used to read and write an size_t value
823 * @name: a pointer to a string containing the name of the file to create.
824 * @mode: the permission that the file should have
825 * @parent: a pointer to the parent dentry for this file. This should be a
827 * file will be created in the root of the debugfs filesystem.
828 * @value: a pointer to the variable that the file should read to and write
857 * debugfs_create_atomic_t - create a debugfs file that is used to read and
859 * @name: a pointer to a string containing the name of the file to create.
860 * @mode: the permission that the file should have
861 * @parent: a pointer to the parent dentry for this file. This should be a
863 * file will be created in the root of the debugfs filesystem.
864 * @value: a pointer to the variable that the file should read to and write
875 ssize_t debugfs_read_file_bool(struct file *file, char __user *user_buf, in debugfs_read_file_bool() argument
881 struct dentry *dentry = F_DENTRY(file); in debugfs_read_file_bool()
886 val = *(bool *)file->private_data; in debugfs_read_file_bool()
898 ssize_t debugfs_write_file_bool(struct file *file, const char __user *user_buf, in debugfs_write_file_bool() argument
903 bool *val = file->private_data; in debugfs_write_file_bool()
904 struct dentry *dentry = F_DENTRY(file); in debugfs_write_file_bool()
939 * debugfs_create_bool - create a debugfs file that is used to read and write a boolean value
940 * @name: a pointer to a string containing the name of the file to create.
941 * @mode: the permission that the file should have
942 * @parent: a pointer to the parent dentry for this file. This should be a
944 * file will be created in the root of the debugfs filesystem.
945 * @value: a pointer to the variable that the file should read to and write
948 * This function creates a file in debugfs with the given name that
960 ssize_t debugfs_read_file_str(struct file *file, char __user *user_buf, in debugfs_read_file_str() argument
963 struct dentry *dentry = F_DENTRY(file); in debugfs_read_file_str()
972 str = *(char **)file->private_data; in debugfs_read_file_str()
996 static ssize_t debugfs_write_file_str(struct file *file, const char __user *user_buf, in debugfs_write_file_str() argument
999 struct dentry *dentry = F_DENTRY(file); in debugfs_write_file_str()
1008 old = *(char **)file->private_data; in debugfs_write_file_str()
1034 rcu_assign_pointer(*(char __rcu **)file->private_data, new); in debugfs_write_file_str()
1067 * debugfs_create_str - create a debugfs file that is used to read and write a string value
1068 * @name: a pointer to a string containing the name of the file to create.
1069 * @mode: the permission that the file should have
1070 * @parent: a pointer to the parent dentry for this file. This should be a
1072 * file will be created in the root of the debugfs filesystem.
1073 * @value: a pointer to the variable that the file should read to and write
1076 * This function creates a file in debugfs with the given name that
1087 static ssize_t read_file_blob(struct file *file, char __user *user_buf, in read_file_blob() argument
1090 struct debugfs_blob_wrapper *blob = file->private_data; in read_file_blob()
1091 struct dentry *dentry = F_DENTRY(file); in read_file_blob()
1103 static ssize_t write_file_blob(struct file *file, const char __user *user_buf, in write_file_blob() argument
1106 struct debugfs_blob_wrapper *blob = file->private_data; in write_file_blob()
1107 struct dentry *dentry = F_DENTRY(file); in write_file_blob()
1128 * debugfs_create_blob - create a debugfs file that is used to read and write
1130 * @name: a pointer to a string containing the name of the file to create.
1131 * @mode: the permission that the file should have
1132 * @parent: a pointer to the parent dentry for this file. This should be a
1134 * file will be created in the root of the debugfs filesystem.
1138 * This function creates a file in debugfs with the given name that exports
1143 * pointer must be passed to the debugfs_remove() function when the file is
1177 static int u32_array_open(struct inode *inode, struct file *file) in u32_array_open() argument
1194 file->private_data = buf; in u32_array_open()
1197 return nonseekable_open(inode, file); in u32_array_open()
1200 static ssize_t u32_array_read(struct file *file, char __user *buf, size_t len, in u32_array_read() argument
1203 size_t size = strlen(file->private_data); in u32_array_read()
1206 file->private_data, size); in u32_array_read()
1209 static int u32_array_release(struct inode *inode, struct file *file) in u32_array_release() argument
1211 kfree(file->private_data); in u32_array_release()
1224 * debugfs_create_u32_array - create a debugfs file that is used to read u32
1226 * @name: a pointer to a string containing the name of the file to create.
1227 * @mode: the permission that the file should have.
1228 * @parent: a pointer to the parent dentry for this file. This should be a
1230 * file will be created in the root of the debugfs filesystem.
1233 * This function creates a file in debugfs with the given name that exports
1235 * Writing is not supported. Seek within the file is also not supported.
1251 * sequential file or create a debugfs file that only prints a regset32.
1303 * debugfs_create_regset32 - create a debugfs file that returns register values
1304 * @name: a pointer to a string containing the name of the file to create.
1305 * @mode: the permission that the file should have
1306 * @parent: a pointer to the parent dentry for this file. This should be a
1308 * file will be created in the root of the debugfs filesystem.
1313 * This function creates a file in debugfs with the given name that reports
1332 static int debugfs_devm_entry_open(struct inode *inode, struct file *f) in debugfs_devm_entry_open()
1348 * debugfs_create_devm_seqfile - create a debugfs file that is bound to device.
1350 * @dev: device related to this debugfs file.
1351 * @name: name of the debugfs file.
1352 * @parent: a pointer to the parent dentry for this file. This should be a
1354 * file will be created in the root of the debugfs filesystem.