3535
3636static inline int is_dma_buf_file (struct file * );
3737
38- #if IS_ENABLED (CONFIG_DEBUG_FS )
39- static DEFINE_MUTEX (debugfs_list_mutex );
40- static LIST_HEAD (debugfs_list );
38+ static DEFINE_MUTEX (dmabuf_list_mutex );
39+ static LIST_HEAD (dmabuf_list );
4140
42- static void __dma_buf_debugfs_list_add (struct dma_buf * dmabuf )
41+ static void __dma_buf_list_add (struct dma_buf * dmabuf )
4342{
44- mutex_lock (& debugfs_list_mutex );
45- list_add (& dmabuf -> list_node , & debugfs_list );
46- mutex_unlock (& debugfs_list_mutex );
43+ mutex_lock (& dmabuf_list_mutex );
44+ list_add (& dmabuf -> list_node , & dmabuf_list );
45+ mutex_unlock (& dmabuf_list_mutex );
4746}
4847
49- static void __dma_buf_debugfs_list_del (struct dma_buf * dmabuf )
48+ static void __dma_buf_list_del (struct dma_buf * dmabuf )
5049{
5150 if (!dmabuf )
5251 return ;
5352
54- mutex_lock (& debugfs_list_mutex );
53+ mutex_lock (& dmabuf_list_mutex );
5554 list_del (& dmabuf -> list_node );
56- mutex_unlock (& debugfs_list_mutex );
55+ mutex_unlock (& dmabuf_list_mutex );
5756}
58- #else
59- static void __dma_buf_debugfs_list_add (struct dma_buf * dmabuf )
60- {
61- }
62-
63- static void __dma_buf_debugfs_list_del (struct dma_buf * dmabuf )
64- {
65- }
66- #endif
6757
6858static char * dmabuffs_dname (struct dentry * dentry , char * buffer , int buflen )
6959{
@@ -115,7 +105,7 @@ static int dma_buf_file_release(struct inode *inode, struct file *file)
115105 if (!is_dma_buf_file (file ))
116106 return - EINVAL ;
117107
118- __dma_buf_debugfs_list_del (file -> private_data );
108+ __dma_buf_list_del (file -> private_data );
119109
120110 return 0 ;
121111}
@@ -689,7 +679,7 @@ struct dma_buf *dma_buf_export(const struct dma_buf_export_info *exp_info)
689679 file -> f_path .dentry -> d_fsdata = dmabuf ;
690680 dmabuf -> file = file ;
691681
692- __dma_buf_debugfs_list_add (dmabuf );
682+ __dma_buf_list_add (dmabuf );
693683
694684 return dmabuf ;
695685
@@ -1630,7 +1620,7 @@ static int dma_buf_debug_show(struct seq_file *s, void *unused)
16301620 size_t size = 0 ;
16311621 int ret ;
16321622
1633- ret = mutex_lock_interruptible (& debugfs_list_mutex );
1623+ ret = mutex_lock_interruptible (& dmabuf_list_mutex );
16341624
16351625 if (ret )
16361626 return ret ;
@@ -1639,7 +1629,7 @@ static int dma_buf_debug_show(struct seq_file *s, void *unused)
16391629 seq_printf (s , "%-8s\t%-8s\t%-8s\t%-8s\texp_name\t%-8s\tname\n" ,
16401630 "size" , "flags" , "mode" , "count" , "ino" );
16411631
1642- list_for_each_entry (buf_obj , & debugfs_list , list_node ) {
1632+ list_for_each_entry (buf_obj , & dmabuf_list , list_node ) {
16431633
16441634 ret = dma_resv_lock_interruptible (buf_obj -> resv , NULL );
16451635 if (ret )
@@ -1676,11 +1666,11 @@ static int dma_buf_debug_show(struct seq_file *s, void *unused)
16761666
16771667 seq_printf (s , "\nTotal %d objects, %zu bytes\n" , count , size );
16781668
1679- mutex_unlock (& debugfs_list_mutex );
1669+ mutex_unlock (& dmabuf_list_mutex );
16801670 return 0 ;
16811671
16821672error_unlock :
1683- mutex_unlock (& debugfs_list_mutex );
1673+ mutex_unlock (& dmabuf_list_mutex );
16841674 return ret ;
16851675}
16861676
0 commit comments