plptools
Loading...
Searching...
No Matches
fuse.c File Reference
#include "config.h"
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/time.h>
#include <syslog.h>
#include "plpfuse.h"
#include "rfsv_api.h"
Include dependency graph for fuse.c:

Go to the source code of this file.

Macros

#define ENOATTR   ENODATA
 
#define XATTR_NAME   "user.epoc"
 
#define XATTR_MAXLEN   3
 
#define ENOMEDIUM   ENODEV
 

Functions

void debuglog (const char *fmt,...)
 
static void xattr2pattr (long *psisattr, long *psidattr, const char *oxattr, const char *nxattr)
 
static void attr2pattr (long oattr, long nattr, char *oxattr, char *nxattr, long *psisattr, long *psidattr)
 
static void pattr2xattr (long psiattr, char *xattr)
 
static void pattr2attr (long psiattr, long size, long ftime, struct stat *st, char *xattr)
 
static int query_devices (void)
 
static char * dirname (const char *dir)
 
static const char * filname (const char *dir)
 
static int dircount (const char *path, long *count)
 
static int getlinks (const char *path, struct stat *st)
 
static int plp_getattr (const char *path, struct stat *st)
 
static int plp_access (const char *path, int mask)
 
static int plp_readlink (const char *path, char *buf, size_t size)
 
static int plp_readdir (const char *path, void *buf, fuse_fill_dir_t filler, off_t offset, struct fuse_file_info *fi)
 
static int plp_mknod (const char *path, mode_t mode, dev_t dev)
 
static int plp_mkdir (const char *path, mode_t mode)
 
static int plp_unlink (const char *path)
 
static int plp_rmdir (const char *path)
 
static int plp_symlink (const char *from, const char *to)
 
static int plp_rename (const char *from, const char *to)
 
static int plp_link (const char *from, const char *to)
 
static int plp_chmod (const char *path, mode_t mode)
 
static int plp_getxattr (const char *path, const char *name, char *value, size_t size)
 
static int plp_setxattr (const char *path, const char *name, const char *value, size_t size, int flags)
 
static int plp_listxattr (const char *path, char *list, size_t size)
 
static int plp_removexattr (const char *path, const char *name)
 
static int plp_chown (const char *path, uid_t uid, gid_t gid)
 
static int plp_truncate (const char *path, off_t size)
 
static int plp_utimens (const char *path, const struct timespec ts[2])
 
static int plp_open (const char *path, struct fuse_file_info *fi)
 
static int plp_read (const char *path, char *buf, size_t size, off_t offset, struct fuse_file_info *fi)
 
static int plp_write (const char *path, const char *buf, size_t size, off_t offset, struct fuse_file_info *fi)
 
static int plp_statfs (const char *path, struct statvfs *stbuf)
 

Variables

int debug
 
static devicedevices
 
struct fuse_operations plp_oper
 

Macro Definition Documentation

◆ ENOATTR

#define ENOATTR   ENODATA

Definition at line 28 of file fuse.c.

◆ ENOMEDIUM

#define ENOMEDIUM   ENODEV

Definition at line 44 of file fuse.c.

◆ XATTR_MAXLEN

#define XATTR_MAXLEN   3

Definition at line 41 of file fuse.c.

◆ XATTR_NAME

#define XATTR_NAME   "user.epoc"

Definition at line 38 of file fuse.c.

Function Documentation

◆ attr2pattr()

static void attr2pattr ( long  oattr,
long  nattr,
char *  oxattr,
char *  nxattr,
long *  psisattr,
long *  psidattr 
)
static

Definition at line 91 of file fuse.c.

◆ debuglog()

void debuglog ( const char *  fmt,
  ... 
)

Definition at line 50 of file fuse.c.

◆ dircount()

static int dircount ( const char *  path,
long *  count 
)
static

Definition at line 192 of file fuse.c.

◆ dirname()

static char * dirname ( const char *  dir)
static

Definition at line 171 of file fuse.c.

◆ filname()

static const char * filname ( const char *  dir)
static

Definition at line 182 of file fuse.c.

◆ getlinks()

static int getlinks ( const char *  path,
struct stat *  st 
)
static

Definition at line 218 of file fuse.c.

◆ pattr2attr()

static void pattr2attr ( long  psiattr,
long  size,
long  ftime,
struct stat *  st,
char *  xattr 
)
static

Definition at line 123 of file fuse.c.

◆ pattr2xattr()

static void pattr2xattr ( long  psiattr,
char *  xattr 
)
static

Definition at line 110 of file fuse.c.

◆ plp_access()

static int plp_access ( const char *  path,
int  mask 
)
static

Definition at line 277 of file fuse.c.

◆ plp_chmod()

static int plp_chmod ( const char *  path,
mode_t  mode 
)
static

Definition at line 399 of file fuse.c.

◆ plp_chown()

static int plp_chown ( const char *  path,
uid_t  uid,
gid_t  gid 
)
static

Definition at line 502 of file fuse.c.

◆ plp_getattr()

static int plp_getattr ( const char *  path,
struct stat *  st 
)
static

Definition at line 227 of file fuse.c.

◆ plp_getxattr()

static int plp_getxattr ( const char *  path,
const char *  name,
char *  value,
size_t  size 
)
static

Definition at line 419 of file fuse.c.

◆ plp_link()

static int plp_link ( const char *  from,
const char *  to 
)
static

Definition at line 393 of file fuse.c.

◆ plp_listxattr()

static int plp_listxattr ( const char *  path,
char *  list,
size_t  size 
)
static

Definition at line 487 of file fuse.c.

◆ plp_mkdir()

static int plp_mkdir ( const char *  path,
mode_t  mode 
)
static

Definition at line 362 of file fuse.c.

◆ plp_mknod()

static int plp_mknod ( const char *  path,
mode_t  mode,
dev_t  dev 
)
static

Definition at line 347 of file fuse.c.

◆ plp_open()

static int plp_open ( const char *  path,
struct fuse_file_info *  fi 
)
static

Definition at line 522 of file fuse.c.

◆ plp_read()

static int plp_read ( const char *  path,
char *  buf,
size_t  size,
off_t  offset,
struct fuse_file_info *  fi 
)
static

Definition at line 529 of file fuse.c.

◆ plp_readdir()

static int plp_readdir ( const char *  path,
void *  buf,
fuse_fill_dir_t  filler,
off_t  offset,
struct fuse_file_info *  fi 
)
static

Definition at line 293 of file fuse.c.

◆ plp_readlink()

static int plp_readlink ( const char *  path,
char *  buf,
size_t  size 
)
static

Definition at line 284 of file fuse.c.

◆ plp_removexattr()

static int plp_removexattr ( const char *  path,
const char *  name 
)
static

Definition at line 495 of file fuse.c.

◆ plp_rename()

static int plp_rename ( const char *  from,
const char *  to 
)
static

Definition at line 386 of file fuse.c.

◆ plp_rmdir()

static int plp_rmdir ( const char *  path)
static

Definition at line 374 of file fuse.c.

◆ plp_setxattr()

static int plp_setxattr ( const char *  path,
const char *  name,
const char *  value,
size_t  size,
int  flags 
)
static

Definition at line 444 of file fuse.c.

◆ plp_statfs()

static int plp_statfs ( const char *  path,
struct statvfs *  stbuf 
)
static

Definition at line 553 of file fuse.c.

◆ plp_symlink()

static int plp_symlink ( const char *  from,
const char *  to 
)
static

Definition at line 380 of file fuse.c.

◆ plp_truncate()

static int plp_truncate ( const char *  path,
off_t  size 
)
static

Definition at line 510 of file fuse.c.

◆ plp_unlink()

static int plp_unlink ( const char *  path)
static

Definition at line 368 of file fuse.c.

◆ plp_utimens()

static int plp_utimens ( const char *  path,
const struct timespec  ts[2] 
)
static

Definition at line 516 of file fuse.c.

◆ plp_write()

static int plp_write ( const char *  path,
const char *  buf,
size_t  size,
off_t  offset,
struct fuse_file_info *  fi 
)
static

Definition at line 541 of file fuse.c.

◆ query_devices()

static int query_devices ( void  )
static

Definition at line 154 of file fuse.c.

◆ xattr2pattr()

static void xattr2pattr ( long *  psisattr,
long *  psidattr,
const char *  oxattr,
const char *  nxattr 
)
static

Definition at line 68 of file fuse.c.

Variable Documentation

◆ debug

int debug

Definition at line 47 of file fuse.c.

◆ devices

device* devices
static

Definition at line 151 of file fuse.c.

◆ plp_oper

struct fuse_operations plp_oper
Initial value:
= {
.getattr = plp_getattr,
.access = plp_access,
.readlink = plp_readlink,
.readdir = plp_readdir,
.mknod = plp_mknod,
.mkdir = plp_mkdir,
.symlink = plp_symlink,
.unlink = plp_unlink,
.rmdir = plp_rmdir,
.rename = plp_rename,
.link = plp_link,
.chmod = plp_chmod,
.setxattr = plp_setxattr,
.getxattr = plp_getxattr,
.listxattr = plp_listxattr,
.removexattr = plp_removexattr,
.chown = plp_chown,
.truncate = plp_truncate,
.utimens = plp_utimens,
.open = plp_open,
.read = plp_read,
.write = plp_write,
.statfs = plp_statfs,
}
static int plp_unlink(const char *path)
Definition: fuse.c:368
static int plp_link(const char *from, const char *to)
Definition: fuse.c:393
static int plp_utimens(const char *path, const struct timespec ts[2])
Definition: fuse.c:516
static int plp_removexattr(const char *path, const char *name)
Definition: fuse.c:495
static int plp_mknod(const char *path, mode_t mode, dev_t dev)
Definition: fuse.c:347
static int plp_read(const char *path, char *buf, size_t size, off_t offset, struct fuse_file_info *fi)
Definition: fuse.c:529
static int plp_open(const char *path, struct fuse_file_info *fi)
Definition: fuse.c:522
static int plp_readlink(const char *path, char *buf, size_t size)
Definition: fuse.c:284
static int plp_listxattr(const char *path, char *list, size_t size)
Definition: fuse.c:487
static int plp_rename(const char *from, const char *to)
Definition: fuse.c:386
static int plp_mkdir(const char *path, mode_t mode)
Definition: fuse.c:362
static int plp_access(const char *path, int mask)
Definition: fuse.c:277
static int plp_rmdir(const char *path)
Definition: fuse.c:374
static int plp_setxattr(const char *path, const char *name, const char *value, size_t size, int flags)
Definition: fuse.c:444
static int plp_getattr(const char *path, struct stat *st)
Definition: fuse.c:227
static int plp_readdir(const char *path, void *buf, fuse_fill_dir_t filler, off_t offset, struct fuse_file_info *fi)
Definition: fuse.c:293
static int plp_statfs(const char *path, struct statvfs *stbuf)
Definition: fuse.c:553
static int plp_symlink(const char *from, const char *to)
Definition: fuse.c:380
static int plp_write(const char *path, const char *buf, size_t size, off_t offset, struct fuse_file_info *fi)
Definition: fuse.c:541
static int plp_chown(const char *path, uid_t uid, gid_t gid)
Definition: fuse.c:502
static int plp_chmod(const char *path, mode_t mode)
Definition: fuse.c:399
static int plp_truncate(const char *path, off_t size)
Definition: fuse.c:510
static int plp_getxattr(const char *path, const char *name, char *value, size_t size)
Definition: fuse.c:419

Definition at line 581 of file fuse.c.