Skip to content

Commit

Permalink
* Released 1.19.8
Browse files Browse the repository at this point in the history
* Disabled automatic switch to direct I/O mode.

* Tweaked some of the more fine grained "hacks" to improve
  support for compressed archives.

* Now supports 'flag_nullpath_ok' and 'flag_nopath'
  (FUSE >= 2.9) in fuse ops.

* The race condition in the I/O buffer has been identified and
  the lock utilization has been redesigned accordingly to
  minimize lock contention.

* Added check for __sync_synchronize()

* Changed use of the FUSE 'keep_cache' flag
  • Loading branch information
Hans Beckerus committed Feb 18, 2014
1 parent a37173c commit feb1436
Show file tree
Hide file tree
Showing 25 changed files with 233 additions and 124 deletions.
31 changes: 31 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
rar2fs ChangeLog file.

2014-02-14 Hans Beckerus <hans.beckerus#AT#gmail.com>

* Released 1.19.8

2014-02-07 Hans Beckerus <hans.beckerus#AT#gmail.com>

* Disabled automatic switch to direct I/O mode.

* Tweaked some of the more fine grained "hacks" to improve
support for compressed archives.

* Now supports 'flag_nullpath_ok' and 'flag_nopath'
(FUSE >= 2.9) in fuse ops.

2014-02-04 Hans Beckerus <hans.beckerus#AT#gmail.com>

* The race condition in the I/O buffer has been identified and
the lock utilization has been redesigned accordingly to
minimize lock contention.

* Added check for __sync_synchronize()

2014-02-03 Hans Beckerus <hans.beckerus#AT#gmail.com>

* Changed use of the FUSE 'keep_cache' flag

* Removed the attempt to optimize the lock contention level
in the I/O buffer. Seems to have opened up for additional
race conditions. When CPU is really needed lock contention
should be close to none anyway.

2014-02-02 Hans Beckerus <hans.beckerus#AT#gmail.com>

* Released 1.19.5
Expand Down
2 changes: 1 addition & 1 deletion compat.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2009-2013 Hans Beckerus (hans.beckerus#AT#gmail.com)
Copyright (C) 2009-2014 Hans Beckerus (hans.beckerus#AT#gmail.com)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
18 changes: 18 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,24 @@ AC_TRY_LINK([],[return 0;],
ac_c_werror_flag=
AC_LANG_POP

AC_LANG_PUSH(C)
ac_c_werror_flag=yes
AC_MSG_CHECKING([for __sync_synchronize])
AC_TRY_COMPILE([],[int main (int argc, char** argv) {__sync_synchronize();}],
[AC_MSG_RESULT([yes])
has_synchronize=yes
],
[AC_MSG_RESULT([no])
has_synchronize=no
]
)
ac_c_werror_flag=
AC_LANG_POP

if test x"$has_synchronize" = x"yes"; then
AC_DEFINE(HAVE_SYNC_SYNCHRONIZE, 1, [Define if __sync_synchronize() is available])
fi

AC_PROG_LN_S
AC_PROG_MKDIR_P

Expand Down
2 changes: 1 addition & 1 deletion debug.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2009-2013 Hans Beckerus (hans.beckerus#AT#gmail.com)
Copyright (C) 2009-2014 Hans Beckerus (hans.beckerus#AT#gmail.com)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
8 changes: 3 additions & 5 deletions dirlist.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2009-2013 Hans Beckerus (hans.beckerus#AT#gmail.com)
Copyright (C) 2009-2014 Hans Beckerus (hans.beckerus#AT#gmail.com)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -36,14 +36,14 @@
*****************************************************************************
*
****************************************************************************/
static inline int swap(struct dir_entry_list *A, struct dir_entry_list *B) {
static inline int swap(struct dir_entry_list *A, struct dir_entry_list *B)
{
int swap = strcmp(A->entry.name, B->entry.name);
swap = !swap ? A->entry.type > B->entry.type : swap;
if (swap > 0) {
const struct dir_entry TMP = B->entry;
B->entry = A->entry;
A->entry = TMP;

return 1;
}
return 0;
Expand Down Expand Up @@ -163,5 +163,3 @@ struct dir_entry_list *dir_entry_add(struct dir_entry_list *l, const char *key,
return l;
}



2 changes: 1 addition & 1 deletion dirlist.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2009-2013 Hans Beckerus (hans.beckerus#AT#gmail.com)
Copyright (C) 2009-2014 Hans Beckerus (hans.beckerus#AT#gmail.com)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion dllext.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2009-2013 Hans Beckerus (hans.beckerus#AT#gmail.com)
Copyright (C) 2009-2014 Hans Beckerus (hans.beckerus#AT#gmail.com)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion dllext.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2009-2013 Hans Beckerus (hans.beckerus#AT#gmail.com)
Copyright (C) 2009-2014 Hans Beckerus (hans.beckerus#AT#gmail.com)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion dllwrapper.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2009-2013 Hans Beckerus (hans.beckerus#AT#gmail.com)
Copyright (C) 2009-2014 Hans Beckerus (hans.beckerus#AT#gmail.com)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion filecache.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2009-2013 Hans Beckerus ([email protected])
Copyright (C) 2009-2014 Hans Beckerus ([email protected])
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion filecache.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2009-2013 Hans Beckerus ([email protected])
Copyright (C) 2009-2014 Hans Beckerus ([email protected])
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion fileext.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2009-2013 Hans Beckerus (hans.beckerus#AT#gmail.com)
Copyright (C) 2009-2014 Hans Beckerus (hans.beckerus#AT#gmail.com)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion hash.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2009-2013 Hans Beckerus (hans.beckerus#AT#gmail.com)
Copyright (C) 2009-2014 Hans Beckerus (hans.beckerus#AT#gmail.com)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion index.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2009-2013 Hans Beckerus (hans.beckerus#AT#gmail.com)
Copyright (C) 2009-2014 Hans Beckerus (hans.beckerus#AT#gmail.com)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
15 changes: 8 additions & 7 deletions iobuffer.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2009-2013 Hans Beckerus (hans.beckerus#AT#gmail.com)
Copyright (C) 2009-2014 Hans Beckerus (hans.beckerus#AT#gmail.com)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -49,13 +49,13 @@ size_t readTo(struct io_buf *dest, FILE *fp, int hist)
{
unsigned tot = 0;
pthread_mutex_lock(&io_mutex);
unsigned int lri = dest->ri; /* read once */
unsigned int lwi = dest->wi; /* read once */
unsigned int lri = dest->ri;
pthread_mutex_unlock(&io_mutex);
size_t left = SPACE_LEFT(lri, lwi) - 1; /* -1 to avoid wi = ri */
if (IOB_HIST_SZ && hist == IOB_SAVE_HIST) {
left = left > IOB_HIST_SZ ? left - IOB_HIST_SZ : 0;
if (!left) {
pthread_mutex_unlock(&io_mutex);
return 0; /* quick exit */
}
}
Expand All @@ -77,10 +77,12 @@ size_t readTo(struct io_buf *dest, FILE *fp, int hist)
chunk -= n;
chunk = !chunk ? left : chunk;
}
dest->offset += tot;
pthread_mutex_lock(&io_mutex);
dest->wi = lwi;
dest->used = SPACE_USED(lri, lwi);
dest->used = SPACE_USED(dest->ri, lwi); /* dest->ri might have changed */
pthread_mutex_unlock(&io_mutex);
MB();
dest->offset += tot;

return tot;
}
Expand All @@ -107,7 +109,6 @@ size_t readFrom(char *dest, struct io_buf *src, size_t size, size_t off)
chunk = chunk < size ? chunk : size; /* reconsider assumption */
while (size) {
memcpy(dest, src->data_p + lri, chunk);
used -= chunk;
lri = (lri + chunk) & (IOB_SZ - 1);
tot += chunk;
size -= chunk;
Expand All @@ -116,7 +117,7 @@ size_t readFrom(char *dest, struct io_buf *src, size_t size, size_t off)
}
pthread_mutex_lock(&io_mutex);
src->ri = lri;
src->used = used;
src->used -= tot; /* src->used might have changed */
pthread_mutex_unlock(&io_mutex);

return tot;
Expand Down
2 changes: 1 addition & 1 deletion iobuffer.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2009-2013 Hans Beckerus (hans.beckerus#AT#gmail.com)
Copyright (C) 2009-2014 Hans Beckerus (hans.beckerus#AT#gmail.com)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion mkr2i.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2009-2013 Hans Beckerus (hans.beckerus#AT#gmail.com)
Copyright (C) 2009-2014 Hans Beckerus (hans.beckerus#AT#gmail.com)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion optdb.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2009-2013 Hans Beckerus (hans.beckerus#AT#gmail.com)
Copyright (C) 2009-2014 Hans Beckerus (hans.beckerus#AT#gmail.com)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion optdb.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2009-2013 Hans Beckerus (hans.beckerus#AT#gmail.com)
Copyright (C) 2009-2014 Hans Beckerus (hans.beckerus#AT#gmail.com)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
6 changes: 5 additions & 1 deletion platform.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2009-2013 Hans Beckerus (hans.beckerus#AT#gmail.com)
Copyright (C) 2009-2014 Hans Beckerus (hans.beckerus#AT#gmail.com)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -95,7 +95,11 @@
#endif

#ifdef __GNUC__
#ifdef HAVE_SYNC_SYNCHRONIZE
#define MB() __sync_synchronize()
#else
#define MB() do{ __asm__ __volatile__ ("" ::: "memory"); } while(0)
#endif
#else
#warning Check code for MB() on current platform
#define MB()
Expand Down
2 changes: 1 addition & 1 deletion rar2fs.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH RAR2FS 1 "v\ " "Wed, May 22, 2013" "User Commands"
.TH RAR2FS 1 "v\ " "Wed, May 22, 2014" "User Commands"
.SH NAME
.B rar2fs
\- FUSE file system for reading RAR archives
Expand Down
Loading

0 comments on commit feb1436

Please sign in to comment.