35
35
36
36
static inline int is_dma_buf_file (struct file * );
37
37
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 );
41
40
42
- static void __dma_buf_debugfs_list_add (struct dma_buf * dmabuf )
41
+ static void __dma_buf_list_add (struct dma_buf * dmabuf )
43
42
{
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 );
47
46
}
48
47
49
- static void __dma_buf_debugfs_list_del (struct dma_buf * dmabuf )
48
+ static void __dma_buf_list_del (struct dma_buf * dmabuf )
50
49
{
51
50
if (!dmabuf )
52
51
return ;
53
52
54
- mutex_lock (& debugfs_list_mutex );
53
+ mutex_lock (& dmabuf_list_mutex );
55
54
list_del (& dmabuf -> list_node );
56
- mutex_unlock (& debugfs_list_mutex );
55
+ mutex_unlock (& dmabuf_list_mutex );
57
56
}
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
67
57
68
58
static char * dmabuffs_dname (struct dentry * dentry , char * buffer , int buflen )
69
59
{
@@ -115,7 +105,7 @@ static int dma_buf_file_release(struct inode *inode, struct file *file)
115
105
if (!is_dma_buf_file (file ))
116
106
return - EINVAL ;
117
107
118
- __dma_buf_debugfs_list_del (file -> private_data );
108
+ __dma_buf_list_del (file -> private_data );
119
109
120
110
return 0 ;
121
111
}
@@ -689,7 +679,7 @@ struct dma_buf *dma_buf_export(const struct dma_buf_export_info *exp_info)
689
679
file -> f_path .dentry -> d_fsdata = dmabuf ;
690
680
dmabuf -> file = file ;
691
681
692
- __dma_buf_debugfs_list_add (dmabuf );
682
+ __dma_buf_list_add (dmabuf );
693
683
694
684
return dmabuf ;
695
685
@@ -1630,7 +1620,7 @@ static int dma_buf_debug_show(struct seq_file *s, void *unused)
1630
1620
size_t size = 0 ;
1631
1621
int ret ;
1632
1622
1633
- ret = mutex_lock_interruptible (& debugfs_list_mutex );
1623
+ ret = mutex_lock_interruptible (& dmabuf_list_mutex );
1634
1624
1635
1625
if (ret )
1636
1626
return ret ;
@@ -1639,7 +1629,7 @@ static int dma_buf_debug_show(struct seq_file *s, void *unused)
1639
1629
seq_printf (s , "%-8s\t%-8s\t%-8s\t%-8s\texp_name\t%-8s\tname\n" ,
1640
1630
"size" , "flags" , "mode" , "count" , "ino" );
1641
1631
1642
- list_for_each_entry (buf_obj , & debugfs_list , list_node ) {
1632
+ list_for_each_entry (buf_obj , & dmabuf_list , list_node ) {
1643
1633
1644
1634
ret = dma_resv_lock_interruptible (buf_obj -> resv , NULL );
1645
1635
if (ret )
@@ -1676,11 +1666,11 @@ static int dma_buf_debug_show(struct seq_file *s, void *unused)
1676
1666
1677
1667
seq_printf (s , "\nTotal %d objects, %zu bytes\n" , count , size );
1678
1668
1679
- mutex_unlock (& debugfs_list_mutex );
1669
+ mutex_unlock (& dmabuf_list_mutex );
1680
1670
return 0 ;
1681
1671
1682
1672
error_unlock :
1683
- mutex_unlock (& debugfs_list_mutex );
1673
+ mutex_unlock (& dmabuf_list_mutex );
1684
1674
return ret ;
1685
1675
}
1686
1676
0 commit comments