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 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()
56 const struct file_operations *debugfs_real_fops(const struct file *filp) in debugfs_real_fops()
86 * debugfs_file_get() on a dentry that isn't even a file, let in __debugfs_file_get()
163 * debugfs_file_get - mark the beginning of file data access
167 * into the file removing functions debugfs_remove() and
169 * file data may only get freed after a successful return of any of
173 * If -%EIO is returned, the file has already been removed and thus,
175 * it is allowed to access the file data, zero is returned.
184 * debugfs_file_put - mark the end of file data access
203 * @file: the file being accessed
207 * When a debugfs file is removed it needs to wait for all active
223 void debugfs_enter_cancellation(struct file *file, in debugfs_enter_cancellation() argument
227 struct dentry *dentry = F_DENTRY(file); in debugfs_enter_cancellation()
253 * @file: the file being accessed
259 void debugfs_leave_cancellation(struct file *file, in debugfs_leave_cancellation() argument
263 struct dentry *dentry = F_DENTRY(file); in debugfs_leave_cancellation()
281 * We also need to exclude any file that has ways to write or alter it as root
285 struct file *filp, in debugfs_locked_down()
302 static int open_proxy_open(struct inode *inode, struct file *filp) in open_proxy_open()
328 WARN(1, "debugfs file owner did not clean up at exit: %pd", in open_proxy_open()
390 PROTO(struct file *filp, loff_t offset, int whence),
394 PROTO(struct file *filp, char __user *buf, size_t size,
399 PROTO(struct file *filp, const char __user *buf,
404 PROTO(struct file *filp, unsigned int cmd, unsigned long arg),
407 static __poll_t full_proxy_poll(struct file *filp, in full_proxy_poll()
426 static int full_proxy_release(struct inode *inode, struct file *filp) in full_proxy_release()
444 static int full_proxy_open_regular(struct inode *inode, struct file *filp) in full_proxy_open_regular()
471 WARN(1, "debugfs file owner did not clean up at exit: %pd", in full_proxy_open_regular()
482 /* No protection against file removal anymore. */ in full_proxy_open_regular()
483 WARN(1, "debugfs file owner replaced proxy fops: %pd", in full_proxy_open_regular()
503 static int full_proxy_open_short(struct inode *inode, struct file *filp) in full_proxy_open_short()
525 ssize_t debugfs_attr_read(struct file *file, char __user *buf, in debugfs_attr_read() argument
528 struct dentry *dentry = F_DENTRY(file); in debugfs_attr_read()
534 ret = simple_attr_read(file, buf, len, ppos); in debugfs_attr_read()
540 static ssize_t debugfs_attr_write_xsigned(struct file *file, const char __user *buf, in debugfs_attr_write_xsigned() argument
543 struct dentry *dentry = F_DENTRY(file); in debugfs_attr_write_xsigned()
550 ret = simple_attr_write_signed(file, buf, len, ppos); in debugfs_attr_write_xsigned()
552 ret = simple_attr_write(file, buf, len, ppos); in debugfs_attr_write_xsigned()
557 ssize_t debugfs_attr_write(struct file *file, const char __user *buf, in debugfs_attr_write() argument
560 return debugfs_attr_write_xsigned(file, buf, len, ppos, false); in debugfs_attr_write()
564 ssize_t debugfs_attr_write_signed(struct file *file, const char __user *buf, in debugfs_attr_write_signed() argument
567 return debugfs_attr_write_xsigned(file, buf, len, ppos, true); in debugfs_attr_write_signed()
604 * debugfs_create_u8 - create a debugfs file that is used to read and write an unsigned 8-bit value
605 * @name: a pointer to a string containing the name of the file to create.
606 * @mode: the permission that the file should have
607 * @parent: a pointer to the parent dentry for this file. This should be a
609 * file will be created in the root of the debugfs filesystem.
610 * @value: a pointer to the variable that the file should read to and write
613 * This function creates a file in debugfs with the given name that
640 …* debugfs_create_u16 - create a debugfs file that is used to read and write an unsigned 16-bit val…
641 * @name: a pointer to a string containing the name of the file to create.
642 * @mode: the permission that the file should have
643 * @parent: a pointer to the parent dentry for this file. This should be a
645 * file will be created in the root of the debugfs filesystem.
646 * @value: a pointer to the variable that the file should read to and write
649 * This function creates a file in debugfs with the given name that
676 …* debugfs_create_u32 - create a debugfs file that is used to read and write an unsigned 32-bit val…
677 * @name: a pointer to a string containing the name of the file to create.
678 * @mode: the permission that the file should have
679 * @parent: a pointer to the parent dentry for this file. This should be a
681 * file will be created in the root of the debugfs filesystem.
682 * @value: a pointer to the variable that the file should read to and write
685 * This function creates a file in debugfs with the given name that
713 …* debugfs_create_u64 - create a debugfs file that is used to read and write an unsigned 64-bit val…
714 * @name: a pointer to a string containing the name of the file to create.
715 * @mode: the permission that the file should have
716 * @parent: a pointer to the parent dentry for this file. This should be a
718 * file will be created in the root of the debugfs filesystem.
719 * @value: a pointer to the variable that the file should read to and write
722 * This function creates a file in debugfs with the given name that
751 * debugfs_create_ulong - create a debugfs file that is used to read and write
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
761 * This function creates a file in debugfs with the given name that
793 …* debugfs_create_x{8,16,32,64} - create a debugfs file that is used to read and write an unsigned …
801 * debugfs_create_x8 - create a debugfs file that is used to read and write an unsigned 8-bit value
802 * @name: a pointer to a string containing the name of the file to create.
803 * @mode: the permission that the file should have
804 * @parent: a pointer to the parent dentry for this file. This should be a
806 * file will be created in the root of the debugfs filesystem.
807 * @value: a pointer to the variable that the file should read to and write
819 …* debugfs_create_x16 - create a debugfs file that is used to read and write an unsigned 16-bit val…
820 * @name: a pointer to a string containing the name of the file to create.
821 * @mode: the permission that the file should have
822 * @parent: a pointer to the parent dentry for this file. This should be a
824 * file will be created in the root of the debugfs filesystem.
825 * @value: a pointer to the variable that the file should read to and write
837 …* debugfs_create_x32 - create a debugfs file that is used to read and write an unsigned 32-bit val…
838 * @name: a pointer to a string containing the name of the file to create.
839 * @mode: the permission that the file should have
840 * @parent: a pointer to the parent dentry for this file. This should be a
842 * file will be created in the root of the debugfs filesystem.
843 * @value: a pointer to the variable that the file should read to and write
855 …* debugfs_create_x64 - create a debugfs file that is used to read and write an unsigned 64-bit val…
856 * @name: a pointer to a string containing the name of the file to create.
857 * @mode: the permission that the file should have
858 * @parent: a pointer to the parent dentry for this file. This should be a
860 * file will be created in the root of the debugfs filesystem.
861 * @value: a pointer to the variable that the file should read to and write
889 * debugfs_create_size_t - create a debugfs file that is used to read and write an size_t value
890 * @name: a pointer to a string containing the name of the file to create.
891 * @mode: the permission that the file should have
892 * @parent: a pointer to the parent dentry for this file. This should be a
894 * file will be created in the root of the debugfs filesystem.
895 * @value: a pointer to the variable that the file should read to and write
924 * debugfs_create_atomic_t - create a debugfs file that is used to read and
926 * @name: a pointer to a string containing the name of the file to create.
927 * @mode: the permission that the file should have
928 * @parent: a pointer to the parent dentry for this file. This should be a
930 * file will be created in the root of the debugfs filesystem.
931 * @value: a pointer to the variable that the file should read to and write
942 ssize_t debugfs_read_file_bool(struct file *file, char __user *user_buf, in debugfs_read_file_bool() argument
948 struct dentry *dentry = F_DENTRY(file); in debugfs_read_file_bool()
953 val = *(bool *)file->private_data; in debugfs_read_file_bool()
965 ssize_t debugfs_write_file_bool(struct file *file, const char __user *user_buf, in debugfs_write_file_bool() argument
970 bool *val = file->private_data; in debugfs_write_file_bool()
971 struct dentry *dentry = F_DENTRY(file); in debugfs_write_file_bool()
1006 * debugfs_create_bool - create a debugfs file that is used to read and write a boolean value
1007 * @name: a pointer to a string containing the name of the file to create.
1008 * @mode: the permission that the file should have
1009 * @parent: a pointer to the parent dentry for this file. This should be a
1011 * file will be created in the root of the debugfs filesystem.
1012 * @value: a pointer to the variable that the file should read to and write
1015 * This function creates a file in debugfs with the given name that
1027 ssize_t debugfs_read_file_str(struct file *file, char __user *user_buf, in debugfs_read_file_str() argument
1030 struct dentry *dentry = F_DENTRY(file); in debugfs_read_file_str()
1039 str = *(char **)file->private_data; in debugfs_read_file_str()
1063 static ssize_t debugfs_write_file_str(struct file *file, const char __user *user_buf, in debugfs_write_file_str() argument
1066 struct dentry *dentry = F_DENTRY(file); in debugfs_write_file_str()
1075 old = *(char **)file->private_data; in debugfs_write_file_str()
1101 rcu_assign_pointer(*(char __rcu **)file->private_data, new); in debugfs_write_file_str()
1134 * debugfs_create_str - create a debugfs file that is used to read and write a string value
1135 * @name: a pointer to a string containing the name of the file to create.
1136 * @mode: the permission that the file should have
1137 * @parent: a pointer to the parent dentry for this file. This should be a
1139 * file will be created in the root of the debugfs filesystem.
1140 * @value: a pointer to the variable that the file should read to and write
1143 * This function creates a file in debugfs with the given name that
1154 static ssize_t read_file_blob(struct file *file, char __user *user_buf, in read_file_blob() argument
1157 struct debugfs_blob_wrapper *blob = file->private_data; in read_file_blob()
1158 struct dentry *dentry = F_DENTRY(file); in read_file_blob()
1170 static ssize_t write_file_blob(struct file *file, const char __user *user_buf, in write_file_blob() argument
1173 struct debugfs_blob_wrapper *blob = file->private_data; in write_file_blob()
1174 struct dentry *dentry = F_DENTRY(file); in write_file_blob()
1195 * debugfs_create_blob - create a debugfs file that is used to read and write
1197 * @name: a pointer to a string containing the name of the file to create.
1198 * @mode: the permission that the file should have
1199 * @parent: a pointer to the parent dentry for this file. This should be a
1201 * file will be created in the root of the debugfs filesystem.
1205 * This function creates a file in debugfs with the given name that exports
1210 * pointer must be passed to the debugfs_remove() function when the file is
1244 static int u32_array_open(struct inode *inode, struct file *file) in u32_array_open() argument
1261 file->private_data = buf; in u32_array_open()
1264 return nonseekable_open(inode, file); in u32_array_open()
1267 static ssize_t u32_array_read(struct file *file, char __user *buf, size_t len, in u32_array_read() argument
1270 size_t size = strlen(file->private_data); in u32_array_read()
1273 file->private_data, size); in u32_array_read()
1276 static int u32_array_release(struct inode *inode, struct file *file) in u32_array_release() argument
1278 kfree(file->private_data); in u32_array_release()
1291 * debugfs_create_u32_array - create a debugfs file that is used to read u32
1293 * @name: a pointer to a string containing the name of the file to create.
1294 * @mode: the permission that the file should have.
1295 * @parent: a pointer to the parent dentry for this file. This should be a
1297 * file will be created in the root of the debugfs filesystem.
1300 * This function creates a file in debugfs with the given name that exports
1302 * Writing is not supported. Seek within the file is also not supported.
1318 * sequential file or create a debugfs file that only prints a regset32.
1370 * debugfs_create_regset32 - create a debugfs file that returns register values
1371 * @name: a pointer to a string containing the name of the file to create.
1372 * @mode: the permission that the file should have
1373 * @parent: a pointer to the parent dentry for this file. This should be a
1375 * file will be created in the root of the debugfs filesystem.
1380 * This function creates a file in debugfs with the given name that reports
1399 static int debugfs_devm_entry_open(struct inode *inode, struct file *f) in debugfs_devm_entry_open()
1415 * debugfs_create_devm_seqfile - create a debugfs file that is bound to device.
1417 * @dev: device related to this debugfs file.
1418 * @name: name of the debugfs file.
1419 * @parent: a pointer to the parent dentry for this file. This should be a
1421 * file will be created in the root of the debugfs filesystem.