You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

107 lines
3.2 KiB

  1. From e032ca7a88afe1a7cd028ca63e2993af9c0b91af Mon Sep 17 00:00:00 2001
  2. From: Rosen Penev <rosenp@gmail.com>
  3. Date: Wed, 28 Oct 2020 19:25:38 -0700
  4. Subject: [PATCH] remove fuse_mutex_init
  5. This seems to have been added before 2006 to fix a uclibc bug. It
  6. doesn't seem to be the case anymore so just get rid of it.
  7. Signed-off-by: Rosen Penev <rosenp@gmail.com>
  8. ---
  9. lib/fuse.c | 4 ++--
  10. lib/fuse_loop_mt.c | 4 ++--
  11. lib/fuse_lowlevel.c | 4 ++--
  12. lib/fuse_misc.h | 14 --------------
  13. 4 files changed, 6 insertions(+), 20 deletions(-)
  14. diff --git a/lib/fuse.c b/lib/fuse.c
  15. index 70299ef1..2125cdaa 100755
  16. --- a/lib/fuse.c
  17. +++ b/lib/fuse.c
  18. @@ -3390,7 +3390,7 @@ static void fuse_lib_opendir(fuse_req_t req, fuse_ino_t ino,
  19. dh->len = 0;
  20. dh->filled = 0;
  21. dh->nodeid = ino;
  22. - fuse_mutex_init(&dh->lock);
  23. + pthread_mutex_init(&dh->lock, NULL);
  24. llfi->fh = (uintptr_t) dh;
  25. @@ -4973,7 +4973,7 @@ struct fuse *fuse_new_31(struct fuse_args *args,
  26. if (node_table_init(&f->id_table) == -1)
  27. goto out_free_name_table;
  28. - fuse_mutex_init(&f->lock);
  29. + pthread_mutex_init(&f->lock, NULL);
  30. root = alloc_node(f);
  31. if (root == NULL) {
  32. diff --git a/lib/fuse_loop_mt.c b/lib/fuse_loop_mt.c
  33. index 0c6a5b79..71be15da 100644
  34. --- a/lib/fuse_loop_mt.c
  35. +++ b/lib/fuse_loop_mt.c
  36. @@ -65,7 +65,7 @@ static struct fuse_chan *fuse_chan_new(int fd)
  37. memset(ch, 0, sizeof(*ch));
  38. ch->fd = fd;
  39. ch->ctr = 1;
  40. - fuse_mutex_init(&ch->lock);
  41. + pthread_mutex_init(&ch->lock, NULL);
  42. return ch;
  43. }
  44. @@ -321,7 +321,7 @@ int fuse_session_loop_mt_32(struct fuse_session *se, struct fuse_loop_config *co
  45. mt.main.thread_id = pthread_self();
  46. mt.main.prev = mt.main.next = &mt.main;
  47. sem_init(&mt.finish, 0, 0);
  48. - fuse_mutex_init(&mt.lock);
  49. + pthread_mutex_init(&mt.lock, NULL);
  50. pthread_mutex_lock(&mt.lock);
  51. err = fuse_loop_start_thread(&mt);
  52. diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c
  53. index 83510b3c..d227688b 100644
  54. --- a/lib/fuse_lowlevel.c
  55. +++ b/lib/fuse_lowlevel.c
  56. @@ -155,7 +155,7 @@ static struct fuse_req *fuse_ll_alloc_req(struct fuse_session *se)
  57. req->se = se;
  58. req->ctr = 1;
  59. list_init_req(req);
  60. - fuse_mutex_init(&req->lock);
  61. + pthread_mutex_init(&req->lock, NULL);
  62. }
  63. return req;
  64. @@ -2958,7 +2958,7 @@ struct fuse_session *fuse_session_new(struct fuse_args *args,
  65. list_init_req(&se->interrupts);
  66. list_init_nreq(&se->notify_list);
  67. se->notify_ctr = 1;
  68. - fuse_mutex_init(&se->lock);
  69. + pthread_mutex_init(&se->lock, NULL);
  70. err = pthread_key_create(&se->pipe_key, fuse_ll_pipe_destructor);
  71. if (err) {
  72. diff --git a/lib/fuse_misc.h b/lib/fuse_misc.h
  73. index f384aeab..f956ab79 100644
  74. --- a/lib/fuse_misc.h
  75. +++ b/lib/fuse_misc.h
  76. @@ -22,20 +22,6 @@
  77. #define FUSE_SYMVER(sym1, sym2)
  78. #endif
  79. -#ifndef USE_UCLIBC
  80. -#define fuse_mutex_init(mut) pthread_mutex_init(mut, NULL)
  81. -#else
  82. -/* Is this hack still needed? */
  83. -static inline void fuse_mutex_init(pthread_mutex_t *mut)
  84. -{
  85. - pthread_mutexattr_t attr;
  86. - pthread_mutexattr_init(&attr);
  87. - pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ADAPTIVE_NP);
  88. - pthread_mutex_init(mut, &attr);
  89. - pthread_mutexattr_destroy(&attr);
  90. -}
  91. -#endif
  92. -
  93. #ifdef HAVE_STRUCT_STAT_ST_ATIM
  94. /* Linux */
  95. #define ST_ATIM_NSEC(stbuf) ((stbuf)->st_atim.tv_nsec)