Lines Matching refs: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,
35 static ssize_t default_write_file(struct file *file, const char __user *buf,
50 const struct file_operations *debugfs_real_fops(const struct file *filp)
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
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,
179 struct dentry *dentry = F_DENTRY(file);
206 * @file: the file being accessed
212 void debugfs_leave_cancellation(struct file *file,
216 struct dentry *dentry = F_DENTRY(file);
235 * We also need to exclude any file that has ways to write or alter it as root
239 struct file *filp,
255 static int open_proxy_open(struct inode *inode, struct file *filp)
281 WARN(1, "debugfs file owner did not clean up at exit: %pd",
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,
353 static int full_proxy_release(struct inode *inode, struct file *filp)
391 static int full_proxy_open(struct inode *inode, struct file *filp)
418 WARN(1, "debugfs file owner did not clean up at exit: %pd",
438 /* No protection against file removal anymore. */
439 WARN(1, "debugfs file owner replaced proxy fops: %pd",
458 ssize_t debugfs_attr_read(struct file *file, char __user *buf,
461 struct dentry *dentry = F_DENTRY(file);
467 ret = simple_attr_read(file, buf, len, ppos);
473 static ssize_t debugfs_attr_write_xsigned(struct file *file, const char __user *buf,
476 struct dentry *dentry = F_DENTRY(file);
483 ret = simple_attr_write_signed(file, buf, len, ppos);
485 ret = simple_attr_write(file, buf, len, ppos);
490 ssize_t debugfs_attr_write(struct file *file, const char __user *buf,
493 return debugfs_attr_write_xsigned(file, buf, len, ppos, false);
497 ssize_t debugfs_attr_write_signed(struct file *file, const char __user *buf,
500 return debugfs_attr_write_xsigned(file, buf, len, ppos, true);
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 value
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 value
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 value
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 {8,16,32,64}-bit value
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 value
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 value
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 value
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,
881 struct dentry *dentry = F_DENTRY(file);
886 val = *(bool *)file->private_data;
898 ssize_t debugfs_write_file_bool(struct file *file, const char __user *user_buf,
903 bool *val = file->private_data;
904 struct dentry *dentry = F_DENTRY(file);
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,
963 struct dentry *dentry = F_DENTRY(file);
972 str = *(char **)file->private_data;
996 static ssize_t debugfs_write_file_str(struct file *file, const char __user *user_buf,
999 struct dentry *dentry = F_DENTRY(file);
1008 old = *(char **)file->private_data;
1034 rcu_assign_pointer(*(char __rcu **)file->private_data, new);
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,
1090 struct debugfs_blob_wrapper *blob = file->private_data;
1091 struct dentry *dentry = F_DENTRY(file);
1103 static ssize_t write_file_blob(struct file *file, const char __user *user_buf,
1106 struct debugfs_blob_wrapper *blob = file->private_data;
1107 struct dentry *dentry = F_DENTRY(file);
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)
1194 file->private_data = buf;
1197 return nonseekable_open(inode, file);
1200 static ssize_t u32_array_read(struct file *file, char __user *buf, size_t len,
1203 size_t size = strlen(file->private_data);
1206 file->private_data, size);
1209 static int u32_array_release(struct inode *inode, struct file *file)
1211 kfree(file->private_data);
1225 * debugfs_create_u32_array - create a debugfs file that is used to read u32
1227 * @name: a pointer to a string containing the name of the file to create.
1228 * @mode: the permission that the file should have.
1229 * @parent: a pointer to the parent dentry for this file. This should be a
1231 * file will be created in the root of the debugfs filesystem.
1234 * This function creates a file in debugfs with the given name that exports
1236 * Writing is not supported. Seek within the file is also not supported.
1252 * sequential file or create a debugfs file that only prints a regset32.
1304 * debugfs_create_regset32 - create a debugfs file that returns register values
1305 * @name: a pointer to a string containing the name of the file to create.
1306 * @mode: the permission that the file should have
1307 * @parent: a pointer to the parent dentry for this file. This should be a
1309 * file will be created in the root of the debugfs filesystem.
1314 * This function creates a file in debugfs with the given name that reports
1333 static int debugfs_devm_entry_open(struct inode *inode, struct file *f)
1349 * debugfs_create_devm_seqfile - create a debugfs file that is bound to device.
1351 * @dev: device related to this debugfs file.
1352 * @name: name of the debugfs file.
1353 * @parent: a pointer to the parent dentry for this file. This should be a
1355 * file will be created in the root of the debugfs filesystem.