aboutsummaryrefslogtreecommitdiff
path: root/sshfs.c
diff options
context:
space:
mode:
authorJulio Merino <jmmv@meroh.net>2016-02-08 21:20:21 -0500
committerJulio Merino <jmmv@meroh.net>2016-02-08 21:20:21 -0500
commit30e90ae0800a16992d4a349d1fe9c3f5e3566f56 (patch)
treed8eaaf74b8f926339f58f70c3fe8ca8b4dce5b7e /sshfs.c
parent9b4ca1aadefbb75ab4051e0b0e9173709456f7fb (diff)
downloadsshfs-30e90ae0800a16992d4a349d1fe9c3f5e3566f56.tar
sshfs-30e90ae0800a16992d4a349d1fe9c3f5e3566f56.tar.gz
sshfs-30e90ae0800a16992d4a349d1fe9c3f5e3566f56.tar.bz2
sshfs-30e90ae0800a16992d4a349d1fe9c3f5e3566f56.zip
Remove apparently-unnecessary lock
Revision b4023a19dd7ec7a099d2e0df491547cf3bb6bec3, which imported the MacFUSE-specific sshfs fixes into osxfuse-sshfs, added a lock to handle the refs reference counter of the sshfs_file structure. However, this lock was only added for OS X, which is a very strange thing to do. One may think that this was only because MacFUSE 2.2 had some semantics that differed from regular FUSE, and that would have been quite stupid for compatibility reasons. A few simple tests show no issues after removing this lock, so let's keep it out for now. If things break, we know what to look at.
Diffstat (limited to 'sshfs.c')
-rw-r--r--sshfs.c24
1 files changed, 0 insertions, 24 deletions
diff --git a/sshfs.c b/sshfs.c
index 6d5e083..c97282e 100644
--- a/sshfs.c
+++ b/sshfs.c
@@ -204,9 +204,6 @@ struct sshfs_file {
int connver;
int modifver;
int refs;
-#ifdef __APPLE__
- pthread_mutex_t file_lock;
-#endif
};
struct sshfs {
@@ -2548,9 +2545,6 @@ static int sshfs_open_common(const char *path, mode_t mode,
sf = g_new0(struct sshfs_file, 1);
list_init(&sf->write_reqs);
pthread_cond_init(&sf->write_finished, NULL);
-#ifdef __APPLE__
- pthread_mutex_init(&sf->file_lock, NULL);
-#endif
/* Assume random read after open */
sf->is_seq = 0;
sf->refs = 1;
@@ -2644,32 +2638,14 @@ static int sshfs_fsync(const char *path, int isdatasync,
static void sshfs_file_put(struct sshfs_file *sf)
{
-#ifdef __APPLE__
- pthread_mutex_lock(&sf->file_lock);
-#endif
sf->refs--;
-#ifdef __APPLE__
- if (!sf->refs) {
- pthread_mutex_unlock(&sf->file_lock);
- g_free(sf);
- } else {
- pthread_mutex_unlock(&sf->file_lock);
- }
-#else /* !__APPLE__ */
if (!sf->refs)
g_free(sf);
-#endif /* __APPLE__ */
}
static void sshfs_file_get(struct sshfs_file *sf)
{
-#ifdef __APPLE__
- pthread_mutex_lock(&sf->file_lock);
-#endif
sf->refs++;
-#ifdef __APPLE__
- pthread_mutex_unlock(&sf->file_lock);
-#endif
}
static int sshfs_release(const char *path, struct fuse_file_info *fi)