* @brief Make a file * * @param name fullpath based on _proc_root or parent * @param mode permission configuration * @param parent can be empty * @param fops * @param data * * @return dentry */
| 376 | * @return dentry |
| 377 | */ |
| 378 | struct proc_dentry *proc_create_data(const char *name, mode_t mode, struct proc_dentry *parent, |
| 379 | const struct dfs_file_ops *fops, void *data) |
| 380 | { |
| 381 | struct proc_dentry *dentry, *_parent = parent; |
| 382 | |
| 383 | dentry = proc_create_reg(name, mode, &_parent); |
| 384 | if (dentry) |
| 385 | { |
| 386 | dentry->fops = fops ? fops : &proc_file_ops; |
| 387 | dentry->data = data; |
| 388 | |
| 389 | dentry = proc_register(_parent, dentry); |
| 390 | } |
| 391 | proc_release(_parent); |
| 392 | |
| 393 | return dentry; |
| 394 | } |
| 395 | |
| 396 | /** |
| 397 | * @brief Make a file |
no test coverage detected