struct sync_file *sync_file = container_of(kref, struct sync_file,
kref);
- if (test_bit(POLL_ENABLED, &sync_file->flags))
+ if (test_bit(POLL_ENABLED, &sync_file->fence->flags))
fence_remove_callback(sync_file->fence, &sync_file->cb);
fence_put(sync_file->fence);
kfree(sync_file);
poll_wait(file, &sync_file->wq, wait);
- if (list_empty(&sync_file->cb.node) &&
- !test_and_set_bit(POLL_ENABLED, &sync_file->flags)) {
+ if (!test_and_set_bit(POLL_ENABLED, &sync_file->fence->flags)) {
if (fence_add_callback(sync_file->fence, &sync_file->cb,
fence_check_cb_func) < 0)
wake_up_all(&sync_file->wq);
#endif
wait_queue_head_t wq;
- unsigned long flags;
struct fence *fence;
struct fence_cb cb;
};
-#define POLL_ENABLED 0
+#define POLL_ENABLED FENCE_FLAG_USER_BITS
struct sync_file *sync_file_create(struct fence *fence);
struct fence *sync_file_get_fence(int fd);