Skip to content

Commit 2c6b6b1

Browse files
akaherrostedt
authored andcommitted
tracefs: Rename and export some tracefs functions
Export a few tracefs functions that will be needed by the eventfs dynamic file system. Rename them to start with "tracefs_" to keep with the name space. start_creating -> tracefs_start_creating failed_creating -> tracefs_failed_creating end_creating -> tracefs_end_creating Link: https://lkml.kernel.org/r/1690568452-46553-4-git-send-email-akaher@vmware.com Signed-off-by: Ajay Kaher <akaher@vmware.com> Co-developed-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Tested-by: Ching-lin Yu <chinglinyu@google.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 parent ba37ff7 commit 2c6b6b1

2 files changed

Lines changed: 15 additions & 10 deletions

File tree

fs/tracefs/inode.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ static const struct inode_operations tracefs_dir_inode_operations = {
147147
.rmdir = tracefs_syscall_rmdir,
148148
};
149149

150-
static struct inode *tracefs_get_inode(struct super_block *sb)
150+
struct inode *tracefs_get_inode(struct super_block *sb)
151151
{
152152
struct inode *inode = new_inode(sb);
153153
if (inode) {
@@ -422,7 +422,7 @@ static struct file_system_type trace_fs_type = {
422422
};
423423
MODULE_ALIAS_FS("tracefs");
424424

425-
static struct dentry *start_creating(const char *name, struct dentry *parent)
425+
struct dentry *tracefs_start_creating(const char *name, struct dentry *parent)
426426
{
427427
struct dentry *dentry;
428428
int error;
@@ -460,15 +460,15 @@ static struct dentry *start_creating(const char *name, struct dentry *parent)
460460
return dentry;
461461
}
462462

463-
static struct dentry *failed_creating(struct dentry *dentry)
463+
struct dentry *tracefs_failed_creating(struct dentry *dentry)
464464
{
465465
inode_unlock(d_inode(dentry->d_parent));
466466
dput(dentry);
467467
simple_release_fs(&tracefs_mount, &tracefs_mount_count);
468468
return NULL;
469469
}
470470

471-
static struct dentry *end_creating(struct dentry *dentry)
471+
struct dentry *tracefs_end_creating(struct dentry *dentry)
472472
{
473473
inode_unlock(d_inode(dentry->d_parent));
474474
return dentry;
@@ -513,14 +513,14 @@ struct dentry *tracefs_create_file(const char *name, umode_t mode,
513513
if (!(mode & S_IFMT))
514514
mode |= S_IFREG;
515515
BUG_ON(!S_ISREG(mode));
516-
dentry = start_creating(name, parent);
516+
dentry = tracefs_start_creating(name, parent);
517517

518518
if (IS_ERR(dentry))
519519
return NULL;
520520

521521
inode = tracefs_get_inode(dentry->d_sb);
522522
if (unlikely(!inode))
523-
return failed_creating(dentry);
523+
return tracefs_failed_creating(dentry);
524524

525525
inode->i_mode = mode;
526526
inode->i_fop = fops ? fops : &tracefs_file_operations;
@@ -529,21 +529,21 @@ struct dentry *tracefs_create_file(const char *name, umode_t mode,
529529
inode->i_gid = d_inode(dentry->d_parent)->i_gid;
530530
d_instantiate(dentry, inode);
531531
fsnotify_create(d_inode(dentry->d_parent), dentry);
532-
return end_creating(dentry);
532+
return tracefs_end_creating(dentry);
533533
}
534534

535535
static struct dentry *__create_dir(const char *name, struct dentry *parent,
536536
const struct inode_operations *ops)
537537
{
538-
struct dentry *dentry = start_creating(name, parent);
538+
struct dentry *dentry = tracefs_start_creating(name, parent);
539539
struct inode *inode;
540540

541541
if (IS_ERR(dentry))
542542
return NULL;
543543

544544
inode = tracefs_get_inode(dentry->d_sb);
545545
if (unlikely(!inode))
546-
return failed_creating(dentry);
546+
return tracefs_failed_creating(dentry);
547547

548548
/* Do not set bits for OTH */
549549
inode->i_mode = S_IFDIR | S_IRWXU | S_IRUSR| S_IRGRP | S_IXUSR | S_IXGRP;
@@ -557,7 +557,7 @@ static struct dentry *__create_dir(const char *name, struct dentry *parent,
557557
d_instantiate(dentry, inode);
558558
inc_nlink(d_inode(dentry->d_parent));
559559
fsnotify_mkdir(d_inode(dentry->d_parent), dentry);
560-
return end_creating(dentry);
560+
return tracefs_end_creating(dentry);
561561
}
562562

563563
/**

fs/tracefs/internal.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,9 @@ static inline struct tracefs_inode *get_tracefs(const struct inode *inode)
1212
{
1313
return container_of(inode, struct tracefs_inode, vfs_inode);
1414
}
15+
16+
struct dentry *tracefs_start_creating(const char *name, struct dentry *parent);
17+
struct dentry *tracefs_end_creating(struct dentry *dentry);
18+
struct dentry *tracefs_failed_creating(struct dentry *dentry);
19+
struct inode *tracefs_get_inode(struct super_block *sb);
1520
#endif /* _TRACEFS_INTERNAL_H */

0 commit comments

Comments
 (0)