Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
DEBIAN_FRONTEND: noninteractive
run: |
apt-get update
apt-get -y install build-essential g++ autoconf autoconf-archive automake libtool libtorrent-rasterbar-dev libfuse-dev libcurl4-openssl-dev
apt-get -y install build-essential g++ autoconf autoconf-archive automake libtool libtorrent-rasterbar-dev libfuse3-dev libcurl4-openssl-dev
- name: Build
run: |
autoreconf -i
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ Use [`brew`](https://brew.sh) to install on macOS.

## Dependencies (on Linux)

* fuse ("fuse" in Ubuntu 16.04)
* libtorrent ("libtorrent-rasterbar8" in Ubuntu 16.04)
* libcurl ("libcurl3" in Ubuntu 16.04)
* fuse3 ("fuse3" in Ubuntu 22.04)
* libtorrent ("libtorrent-rasterbar8" in Ubuntu 22.04)
* libcurl ("libcurl4" in Ubuntu 22.04)

## Building from git on a recent Debian/Ubuntu

$ sudo apt-get install autoconf automake libfuse-dev libtorrent-rasterbar-dev libcurl4-openssl-dev g++
$ sudo apt-get install autoconf automake libfuse3-dev libtorrent-rasterbar-dev libcurl4-openssl-dev g++
$ git clone https://github.com/johang/btfs.git btfs
$ cd btfs
$ autoreconf -i
Expand All @@ -68,7 +68,7 @@ And optionally, if you want to install it:

Use [`brew`](https://brew.sh) to get the dependencies.

$ brew install Caskroom/cask/osxfuse libtorrent-rasterbar autoconf automake pkg-config
$ brew install --cask macfuse libtorrent-rasterbar autoconf automake pkg-config
$ git clone https://github.com/johang/btfs.git btfs
$ cd btfs
$ autoreconf -i
Expand Down
7 changes: 4 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AC_PREREQ([2.69])
AC_INIT(btfs, 2.24, johan.gunnarsson@gmail.com, btfs, https://github.com/johang/btfs)
AC_INIT([btfs],[2.24],[johan.gunnarsson@gmail.com],[btfs],[https://github.com/johang/btfs])
AC_CONFIG_SRCDIR([src/btfs.cc])

AM_INIT_AUTOMAKE
Expand All @@ -8,7 +8,7 @@ AM_INIT_AUTOMAKE
AC_PROG_CXX

# Checks for libraries.
PKG_CHECK_MODULES(FUSE, fuse >= 2.8.0)
PKG_CHECK_MODULES(FUSE, fuse3 >= 3.0)
PKG_CHECK_MODULES(LIBTORRENT, libtorrent-rasterbar >= 1.0.0)
PKG_CHECK_MODULES(LIBCURL, libcurl >= 7.22.0)

Expand All @@ -25,4 +25,5 @@ AC_CHECK_LIB(pthread, pthread_setname_np)
# Check if -latomic is needed.
AC_SEARCH_LIBS(__atomic_load, atomic)

AC_OUTPUT(Makefile src/Makefile scripts/Makefile man/Makefile)
AC_CONFIG_FILES([Makefile src/Makefile scripts/Makefile man/Makefile])
AC_OUTPUT
22 changes: 14 additions & 8 deletions src/btfs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with BTFS. If not, see <http://www.gnu.org/licenses/>.
*/

#define FUSE_USE_VERSION 26
#define FUSE_USE_VERSION 31

#include <cstdlib>
#include <iostream>
Expand All @@ -27,7 +27,8 @@ along with BTFS. If not, see <http://www.gnu.org/licenses/>.
#include <sys/types.h>
#include <sys/stat.h>

#include <fuse.h>
#include <fuse3/fuse.h>
#include <fuse3/fuse_opt.h>

// The below pragma lines will silence lots of compiler warnings in the
// libtorrent headers file. Not btfs' fault.
Expand Down Expand Up @@ -420,7 +421,9 @@ is_file(const char *path) {
}

static int
btfs_getattr(const char *path, struct stat *stbuf) {
btfs_getattr(const char *path, struct stat *stbuf,
struct fuse_file_info *fi) {
(void) fi;
if (!is_dir(path) && !is_file(path) && !is_root(path))
return -ENOENT;

Expand Down Expand Up @@ -465,7 +468,9 @@ btfs_getattr(const char *path, struct stat *stbuf) {

static int
btfs_readdir(const char *path, void *buf, fuse_fill_dir_t filler,
off_t offset, struct fuse_file_info *fi) {
off_t offset, struct fuse_file_info *fi,
enum fuse_readdir_flags flags) {
(void)flags;
if (!is_dir(path) && !is_file(path) && !is_root(path))
return -ENOENT;

Expand All @@ -474,12 +479,12 @@ btfs_readdir(const char *path, void *buf, fuse_fill_dir_t filler,

pthread_mutex_lock(&lock);

filler(buf, ".", NULL, 0);
filler(buf, "..", NULL, 0);
filler(buf, ".", NULL, 0, (enum fuse_fill_dir_flags)0);
filler(buf, "..", NULL, 0, (enum fuse_fill_dir_flags)0);

for (std::set<std::string>::iterator i = dirs[path].begin();
i != dirs[path].end(); ++i) {
filler(buf, i->c_str(), NULL, 0);
filler(buf, i->c_str(), NULL, 0, (enum fuse_fill_dir_flags)0);
}

pthread_mutex_unlock(&lock);
Expand Down Expand Up @@ -555,7 +560,8 @@ btfs_statfs(const char *path, struct statvfs *stbuf) {
}

static void *
btfs_init(struct fuse_conn_info *conn) {
btfs_init(struct fuse_conn_info *conn,
struct fuse_config *cfg) {
pthread_mutex_lock(&lock);

time_of_mount = time(NULL);
Expand Down