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 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,
158 * it is allowed to access the file data, zero is returned.
167 * debugfs_file_put - mark the end of file data access
186 * @file: the file being accessed
190 * When a debugfs file is removed it needs to wait for all active
206 void debugfs_enter_cancellation(struct file *file, in debugfs_enter_cancellation() argument
210 struct dentry *dentry = F_DENTRY(file); in debugfs_enter_cancellation()
236 * @file: the file being accessed
242 void debugfs_leave_cancellation(struct file *file, in debugfs_leave_cancellation() argument
246 struct dentry *dentry = F_DENTRY(file); in debugfs_leave_cancellation()
264 * We also need to exclude any file that has ways to write or alter it as root
268 struct file *filp, in debugfs_locked_down()
285 static int open_proxy_open(struct inode *inode, struct file *filp) in open_proxy_open()
309 WARN(1, "debugfs file owner did not clean up at exit: %pd", in open_proxy_open()
366 PROTO(struct file *filp, loff_t offset, int whence),
370 PROTO(struct file *filp, loff_t offset, int whence),
374 PROTO(struct file *filp, char __user *buf, size_t size,
379 PROTO(struct file *filp, char __user *buf, size_t size,
384 PROTO(struct file *filp, const char __user *buf,
389 PROTO(struct file *filp, const char __user *buf,
394 PROTO(struct file *filp, unsigned int cmd, unsigned long arg),
397 static __poll_t full_proxy_poll(struct file *filp, in full_proxy_poll()
414 static int full_proxy_release(struct inode *inode, struct file *file) in full_proxy_release() argument
416 struct debugfs_fsdata *fsd = F_DENTRY(file)->d_fsdata; in full_proxy_release()
427 r = real_fops->release(inode, file); in full_proxy_release()
433 static int full_proxy_open_regular(struct inode *inode, struct file *filp) in full_proxy_open_regular()
460 WARN(1, "debugfs file owner did not clean up at exit: %pd", in full_proxy_open_regular()
471 /* No protection against file removal anymore. */ in full_proxy_open_regular()
472 WARN(1, "debugfs file owner replaced proxy fops: %pd", in full_proxy_open_regular()
492 static int full_proxy_open_short(struct inode *inode, struct file *filp) in full_proxy_open_short()
514 ssize_t debugfs_attr_read(struct file *file, char __user *buf, in debugfs_attr_read() argument
517 struct dentry *dentry = F_DENTRY(file); in debugfs_attr_read()
523 ret = simple_attr_read(file, buf, len, ppos); in debugfs_attr_read()
529 static ssize_t debugfs_attr_write_xsigned(struct file *file, const char __user *buf, in debugfs_attr_write_xsigned() argument
532 struct dentry *dentry = F_DENTRY(file); in debugfs_attr_write_xsigned()
539 ret = simple_attr_write_signed(file, buf, len, ppos); in debugfs_attr_write_xsigned()
541 ret = simple_attr_write(file, buf, len, ppos); in debugfs_attr_write_xsigned()
546 ssize_t debugfs_attr_write(struct file *file, const char __user *buf, in debugfs_attr_write() argument
549 return debugfs_attr_write_xsigned(file, buf, len, ppos, false); in debugfs_attr_write()
553 ssize_t debugfs_attr_write_signed(struct file *file, const char __user *buf, in debugfs_attr_write_signed() argument
556 return debugfs_attr_write_xsigned(file, buf, len, ppos, true); in debugfs_attr_write_signed()
593 * debugfs_create_u8 - create a debugfs file that is used to read and write an unsigned 8-bit value
594 * @name: a pointer to a string containing the name of the file to create.
595 * @mode: the permission that the file should have
596 * @parent: a pointer to the parent dentry for this file. This should be a
598 * file will be created in the root of the debugfs filesystem.
599 * @value: a pointer to the variable that the file should read to and write
602 * This function creates a file in debugfs with the given name that
629 …* debugfs_create_u16 - create a debugfs file that is used to read and write an unsigned 16-bit val…
630 * @name: a pointer to a string containing the name of the file to create.
631 * @mode: the permission that the file should have
632 * @parent: a pointer to the parent dentry for this file. This should be a
634 * file will be created in the root of the debugfs filesystem.
635 * @value: a pointer to the variable that the file should read to and write
638 * This function creates a file in debugfs with the given name that
665 …* debugfs_create_u32 - create a debugfs file that is used to read and write an unsigned 32-bit val…
666 * @name: a pointer to a string containing the name of the file to create.
667 * @mode: the permission that the file should have
668 * @parent: a pointer to the parent dentry for this file. This should be a
670 * file will be created in the root of the debugfs filesystem.
671 * @value: a pointer to the variable that the file should read to and write
674 * This function creates a file in debugfs with the given name that
702 …* debugfs_create_u64 - create a debugfs file that is used to read and write an unsigned 64-bit val…
703 * @name: a pointer to a string containing the name of the file to create.
704 * @mode: the permission that the file should have
705 * @parent: a pointer to the parent dentry for this file. This should be a
707 * file will be created in the root of the debugfs filesystem.
708 * @value: a pointer to the variable that the file should read to and write
711 * This function creates a file in debugfs with the given name that
740 * debugfs_create_ulong - create a debugfs file that is used to read and write
742 * @name: a pointer to a string containing the name of the file to create.
743 * @mode: the permission that the file should have
744 * @parent: a pointer to the parent dentry for this file. This should be a
746 * file will be created in the root of the debugfs filesystem.
747 * @value: a pointer to the variable that the file should read to and write
750 * This function creates a file in debugfs with the given name that
782 …* debugfs_create_x{8,16,32,64} - create a debugfs file that is used to read and write an unsigned …
790 * debugfs_create_x8 - create a debugfs file that is used to read and write an unsigned 8-bit value
791 * @name: a pointer to a string containing the name of the file to create.
792 * @mode: the permission that the file should have
793 * @parent: a pointer to the parent dentry for this file. This should be a
795 * file will be created in the root of the debugfs filesystem.
796 * @value: a pointer to the variable that the file should read to and write
808 …* debugfs_create_x16 - create a debugfs file that is used to read and write an unsigned 16-bit val…
809 * @name: a pointer to a string containing the name of the file to create.
810 * @mode: the permission that the file should have
811 * @parent: a pointer to the parent dentry for this file. This should be a
813 * file will be created in the root of the debugfs filesystem.
814 * @value: a pointer to the variable that the file should read to and write
826 …* debugfs_create_x32 - create a debugfs file that is used to read and write an unsigned 32-bit val…
827 * @name: a pointer to a string containing the name of the file to create.
828 * @mode: the permission that the file should have
829 * @parent: a pointer to the parent dentry for this file. This should be a
831 * file will be created in the root of the debugfs filesystem.
832 * @value: a pointer to the variable that the file should read to and write
844 …* debugfs_create_x64 - create a debugfs file that is used to read and write an unsigned 64-bit val…
845 * @name: a pointer to a string containing the name of the file to create.
846 * @mode: the permission that the file should have
847 * @parent: a pointer to the parent dentry for this file. This should be a
849 * file will be created in the root of the debugfs filesystem.
850 * @value: a pointer to the variable that the file should read to and write
878 * debugfs_create_size_t - create a debugfs file that is used to read and write an size_t value
879 * @name: a pointer to a string containing the name of the file to create.
880 * @mode: the permission that the file should have
881 * @parent: a pointer to the parent dentry for this file. This should be a
883 * file will be created in the root of the debugfs filesystem.
884 * @value: a pointer to the variable that the file should read to and write
913 * debugfs_create_atomic_t - create a debugfs file that is used to read and
915 * @name: a pointer to a string containing the name of the file to create.
916 * @mode: the permission that the file should have
917 * @parent: a pointer to the parent dentry for this file. This should be a
919 * file will be created in the root of the debugfs filesystem.
920 * @value: a pointer to the variable that the file should read to and write
931 ssize_t debugfs_read_file_bool(struct file *file, char __user *user_buf, in debugfs_read_file_bool() argument
937 struct dentry *dentry = F_DENTRY(file); in debugfs_read_file_bool()
942 val = *(bool *)file->private_data; in debugfs_read_file_bool()
954 ssize_t debugfs_write_file_bool(struct file *file, const char __user *user_buf, in debugfs_write_file_bool() argument
959 bool *val = file->private_data; in debugfs_write_file_bool()
960 struct dentry *dentry = F_DENTRY(file); in debugfs_write_file_bool()
995 * debugfs_create_bool - create a debugfs file that is used to read and write a boolean value
996 * @name: a pointer to a string containing the name of the file to create.
997 * @mode: the permission that the file should have
998 * @parent: a pointer to the parent dentry for this file. This should be a
1000 * file will be created in the root of the debugfs filesystem.
1001 * @value: a pointer to the variable that the file should read to and write
1004 * This function creates a file in debugfs with the given name that
1016 ssize_t debugfs_read_file_str(struct file *file, char __user *user_buf, in debugfs_read_file_str() argument
1019 struct dentry *dentry = F_DENTRY(file); in debugfs_read_file_str()
1028 str = *(char **)file->private_data; in debugfs_read_file_str()
1052 static ssize_t debugfs_write_file_str(struct file *file, const char __user *user_buf, in debugfs_write_file_str() argument
1055 struct dentry *dentry = F_DENTRY(file); in debugfs_write_file_str()
1064 old = *(char **)file->private_data; in debugfs_write_file_str()
1090 rcu_assign_pointer(*(char __rcu **)file->private_data, new); in debugfs_write_file_str()
1123 * debugfs_create_str - create a debugfs file that is used to read and write a string value
1124 * @name: a pointer to a string containing the name of the file to create.
1125 * @mode: the permission that the file should have
1126 * @parent: a pointer to the parent dentry for this file. This should be a
1128 * file will be created in the root of the debugfs filesystem.
1129 * @value: a pointer to the variable that the file should read to and write
1132 * This function creates a file in debugfs with the given name that
1143 static ssize_t read_file_blob(struct file *file, char __user *user_buf, in read_file_blob() argument
1146 struct debugfs_blob_wrapper *blob = file->private_data; in read_file_blob()
1147 struct dentry *dentry = F_DENTRY(file); in read_file_blob()
1159 static ssize_t write_file_blob(struct file *file, const char __user *user_buf, in write_file_blob() argument
1162 struct debugfs_blob_wrapper *blob = file->private_data; in write_file_blob()
1163 struct dentry *dentry = F_DENTRY(file); in write_file_blob()
1184 * debugfs_create_blob - create a debugfs file that is used to read and write
1186 * @name: a pointer to a string containing the name of the file to create.
1187 * @mode: the permission that the file should have
1188 * @parent: a pointer to the parent dentry for this file. This should be a
1190 * file will be created in the root of the debugfs filesystem.
1194 * This function creates a file in debugfs with the given name that exports
1199 * pointer must be passed to the debugfs_remove() function when the file is
1233 static int u32_array_open(struct inode *inode, struct file *file) in u32_array_open() argument
1250 file->private_data = buf; in u32_array_open()
1253 return nonseekable_open(inode, file); in u32_array_open()
1256 static ssize_t u32_array_read(struct file *file, char __user *buf, size_t len, in u32_array_read() argument
1259 size_t size = strlen(file->private_data); in u32_array_read()
1262 file->private_data, size); in u32_array_read()
1265 static int u32_array_release(struct inode *inode, struct file *file) in u32_array_release() argument
1267 kfree(file->private_data); in u32_array_release()
1280 * debugfs_create_u32_array - create a debugfs file that is used to read u32
1282 * @name: a pointer to a string containing the name of the file to create.
1283 * @mode: the permission that the file should have.
1284 * @parent: a pointer to the parent dentry for this file. This should be a
1286 * file will be created in the root of the debugfs filesystem.
1289 * This function creates a file in debugfs with the given name that exports
1291 * Writing is not supported. Seek within the file is also not supported.
1307 * sequential file or create a debugfs file that only prints a regset32.
1359 * debugfs_create_regset32 - create a debugfs file that returns register values
1360 * @name: a pointer to a string containing the name of the file to create.
1361 * @mode: the permission that the file should have
1362 * @parent: a pointer to the parent dentry for this file. This should be a
1364 * file will be created in the root of the debugfs filesystem.
1369 * This function creates a file in debugfs with the given name that reports
1388 static int debugfs_devm_entry_open(struct inode *inode, struct file *f) in debugfs_devm_entry_open()
1404 * debugfs_create_devm_seqfile - create a debugfs file that is bound to device.
1406 * @dev: device related to this debugfs file.
1407 * @name: name of the debugfs file.
1408 * @parent: a pointer to the parent dentry for this file. This should be a
1410 * file will be created in the root of the debugfs filesystem.