2525#include <drm/drmP.h>
2626#include <drm/drm_mm.h>
2727#include <drm/drm_vma_manager.h>
28- #include <linux/fs.h>
2928#include <linux/mm.h>
3029#include <linux/module.h>
3130#include <linux/rbtree.h>
@@ -252,9 +251,9 @@ EXPORT_SYMBOL(drm_vma_offset_remove);
252251/**
253252 * drm_vma_node_allow - Add open-file to list of allowed users
254253 * @node: Node to modify
255- * @filp: Open file to add
254+ * @tag: Tag of file to remove
256255 *
257- * Add @filp to the list of allowed open-files for this node. If @filp is
256+ * Add @tag to the list of allowed open-files for this node. If @tag is
258257 * already on this list, the ref-count is incremented.
259258 *
260259 * The list of allowed-users is preserved across drm_vma_offset_add() and
@@ -269,7 +268,7 @@ EXPORT_SYMBOL(drm_vma_offset_remove);
269268 * RETURNS:
270269 * 0 on success, negative error code on internal failure (out-of-mem)
271270 */
272- int drm_vma_node_allow (struct drm_vma_offset_node * node , struct file * filp )
271+ int drm_vma_node_allow (struct drm_vma_offset_node * node , struct drm_file * tag )
273272{
274273 struct rb_node * * iter ;
275274 struct rb_node * parent = NULL ;
@@ -290,10 +289,10 @@ int drm_vma_node_allow(struct drm_vma_offset_node *node, struct file *filp)
290289 parent = * iter ;
291290 entry = rb_entry (* iter , struct drm_vma_offset_file , vm_rb );
292291
293- if (filp == entry -> vm_filp ) {
292+ if (tag == entry -> vm_tag ) {
294293 entry -> vm_count ++ ;
295294 goto unlock ;
296- } else if (filp > entry -> vm_filp ) {
295+ } else if (tag > entry -> vm_tag ) {
297296 iter = & (* iter )-> rb_right ;
298297 } else {
299298 iter = & (* iter )-> rb_left ;
@@ -305,7 +304,7 @@ int drm_vma_node_allow(struct drm_vma_offset_node *node, struct file *filp)
305304 goto unlock ;
306305 }
307306
308- new -> vm_filp = filp ;
307+ new -> vm_tag = tag ;
309308 new -> vm_count = 1 ;
310309 rb_link_node (& new -> vm_rb , parent , iter );
311310 rb_insert_color (& new -> vm_rb , & node -> vm_files );
@@ -321,17 +320,18 @@ EXPORT_SYMBOL(drm_vma_node_allow);
321320/**
322321 * drm_vma_node_revoke - Remove open-file from list of allowed users
323322 * @node: Node to modify
324- * @filp: Open file to remove
323+ * @tag: Tag of file to remove
325324 *
326- * Decrement the ref-count of @filp in the list of allowed open-files on @node.
327- * If the ref-count drops to zero, remove @filp from the list. You must call
328- * this once for every drm_vma_node_allow() on @filp .
325+ * Decrement the ref-count of @tag in the list of allowed open-files on @node.
326+ * If the ref-count drops to zero, remove @tag from the list. You must call
327+ * this once for every drm_vma_node_allow() on @tag .
329328 *
330329 * This is locked against concurrent access internally.
331330 *
332- * If @filp is not on the list, nothing is done.
331+ * If @tag is not on the list, nothing is done.
333332 */
334- void drm_vma_node_revoke (struct drm_vma_offset_node * node , struct file * filp )
333+ void drm_vma_node_revoke (struct drm_vma_offset_node * node ,
334+ struct drm_file * tag )
335335{
336336 struct drm_vma_offset_file * entry ;
337337 struct rb_node * iter ;
@@ -341,13 +341,13 @@ void drm_vma_node_revoke(struct drm_vma_offset_node *node, struct file *filp)
341341 iter = node -> vm_files .rb_node ;
342342 while (likely (iter )) {
343343 entry = rb_entry (iter , struct drm_vma_offset_file , vm_rb );
344- if (filp == entry -> vm_filp ) {
344+ if (tag == entry -> vm_tag ) {
345345 if (!-- entry -> vm_count ) {
346346 rb_erase (& entry -> vm_rb , & node -> vm_files );
347347 kfree (entry );
348348 }
349349 break ;
350- } else if (filp > entry -> vm_filp ) {
350+ } else if (tag > entry -> vm_tag ) {
351351 iter = iter -> rb_right ;
352352 } else {
353353 iter = iter -> rb_left ;
@@ -361,9 +361,9 @@ EXPORT_SYMBOL(drm_vma_node_revoke);
361361/**
362362 * drm_vma_node_is_allowed - Check whether an open-file is granted access
363363 * @node: Node to check
364- * @filp: Open- file to check for
364+ * @tag: Tag of file to remove
365365 *
366- * Search the list in @node whether @filp is currently on the list of allowed
366+ * Search the list in @node whether @tag is currently on the list of allowed
367367 * open-files (see drm_vma_node_allow()).
368368 *
369369 * This is locked against concurrent access internally.
@@ -372,7 +372,7 @@ EXPORT_SYMBOL(drm_vma_node_revoke);
372372 * true iff @filp is on the list
373373 */
374374bool drm_vma_node_is_allowed (struct drm_vma_offset_node * node ,
375- struct file * filp )
375+ struct drm_file * tag )
376376{
377377 struct drm_vma_offset_file * entry ;
378378 struct rb_node * iter ;
@@ -382,9 +382,9 @@ bool drm_vma_node_is_allowed(struct drm_vma_offset_node *node,
382382 iter = node -> vm_files .rb_node ;
383383 while (likely (iter )) {
384384 entry = rb_entry (iter , struct drm_vma_offset_file , vm_rb );
385- if (filp == entry -> vm_filp )
385+ if (tag == entry -> vm_tag )
386386 break ;
387- else if (filp > entry -> vm_filp )
387+ else if (tag > entry -> vm_tag )
388388 iter = iter -> rb_right ;
389389 else
390390 iter = iter -> rb_left ;
0 commit comments