}
-#if 0
-static int remote_cache_lock(const char *path, struct fuse_file_info *ffi, int cmd, struct flock *fl)
-{
-return 0;
- int fd;
- int ret;
-
- if (!read_write) {
- return -EROFS;
- }
-
- DEBUG(DEBUG_DEBUG, ("LOCK %s cmd:%s(%d)\n", path, cmd==F_GETLK?"F_GETLK":cmd==F_SETLKW?"F_SETLKW":cmd==F_SETLK?"F_SETLK":"unknown", cmd));
-
- ret = switch_to_real_user();
- if (ret != 0) {
- DEBUG(DEBUG_ERR, (__location__ " SETEUID failed\n"));
- goto finished;
- }
-
- fd = *((int *)(&ffi->fh));
- if (fd == -1) {
- DEBUG(DEBUG_ERR,(__location__ " ERROR file to lock is not open %s\n", path));
- ret = -errno;
- goto finished;
- }
-
- ret = fcntl(fd, cmd, fl);
- if (ret == -1) {
- DEBUG(DEBUG_ERR,(__location__ " FCNTL lock failed with errno:%d for fd:%d for file %s\n", errno, fd, path));
- ret = -errno;
- goto finished;
- }
-
-finished:
- switch_back_to_root();
- return ret;
-}
-#endif
static int remote_cache_open(const char *path, struct fuse_file_info *ffi)