fstat: Add skeleton implmentations of fstat() in all file systems.
This commit is contained in:
parent
c5a8e96dbc
commit
7d91fabf01
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* fs/binfs/fs_binfs.c
|
||||
*
|
||||
* Copyright (C) 2011-2013, 2015 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2011-2013, 2015, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -70,6 +70,7 @@ static ssize_t binfs_read(FAR struct file *filep, char *buffer, size_t buflen);
|
||||
static int binfs_ioctl(FAR struct file *filep, int cmd, unsigned long arg);
|
||||
|
||||
static int binfs_dup(FAR const struct file *oldp, FAR struct file *newp);
|
||||
static int binfs_fstat(FAR const struct file *filep, FAR struct stat *buf);
|
||||
|
||||
static int binfs_opendir(struct inode *mountpt, const char *relpath,
|
||||
struct fs_dirent_s *dir);
|
||||
@ -108,6 +109,7 @@ const struct mountpt_operations binfs_operations =
|
||||
|
||||
NULL, /* sync */
|
||||
binfs_dup, /* dup */
|
||||
binfs_fstat, /* fstat */
|
||||
|
||||
binfs_opendir, /* opendir */
|
||||
NULL, /* closedir */
|
||||
@ -245,6 +247,21 @@ static int binfs_dup(FAR const struct file *oldp, FAR struct file *newp)
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: binfs_fstat
|
||||
*
|
||||
* Description:
|
||||
* Obtain information about an open file associated with the file
|
||||
* descriptor 'fd', and will write it to the area pointed to by 'buf'.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int binfs_fstat(FAR const struct file *filep, FAR struct stat *buf)
|
||||
{
|
||||
#warning Missing logic
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: binfs_opendir
|
||||
*
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* fs/fat/fs_fat32.c
|
||||
*
|
||||
* Copyright (C) 2007-2009, 2011-2015 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007-2009, 2011-2015, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* References:
|
||||
@ -84,6 +84,8 @@ static int fat_ioctl(FAR struct file *filep, int cmd,
|
||||
|
||||
static int fat_sync(FAR struct file *filep);
|
||||
static int fat_dup(FAR const struct file *oldp, FAR struct file *newp);
|
||||
static int fat_fstat(FAR const struct file *filep,
|
||||
FAR struct stat *buf);
|
||||
|
||||
static int fat_opendir(FAR struct inode *mountpt,
|
||||
FAR const char *relpath, FAR struct fs_dirent_s *dir);
|
||||
@ -129,6 +131,7 @@ const struct mountpt_operations fat_operations =
|
||||
|
||||
fat_sync, /* sync */
|
||||
fat_dup, /* dup */
|
||||
fat_fstat, /* fstat */
|
||||
|
||||
fat_opendir, /* opendir */
|
||||
NULL, /* closedir */
|
||||
@ -1606,6 +1609,21 @@ errout_with_semaphore:
|
||||
return ret;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: fat_fstat
|
||||
*
|
||||
* Description:
|
||||
* Obtain information about an open file associated with the file
|
||||
* descriptor 'fd', and will write it to the area pointed to by 'buf'.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int fat_fstat(FAR const struct file *filep, FAR struct stat *buf)
|
||||
{
|
||||
#warning Missing logic
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: fat_readdir
|
||||
*
|
||||
|
@ -80,6 +80,8 @@ static int hostfs_ioctl(FAR struct file *filep, int cmd,
|
||||
static int hostfs_sync(FAR struct file *filep);
|
||||
static int hostfs_dup(FAR const struct file *oldp,
|
||||
FAR struct file *newp);
|
||||
static int hostfs_fstat(FAR const struct file *filep,
|
||||
FAR struct stat *buf);
|
||||
|
||||
static int hostfs_opendir(FAR struct inode *mountpt,
|
||||
FAR const char *relpath,
|
||||
@ -136,6 +138,7 @@ const struct mountpt_operations hostfs_operations =
|
||||
|
||||
hostfs_sync, /* sync */
|
||||
hostfs_dup, /* dup */
|
||||
hostfs_fstat, /* fstat */
|
||||
|
||||
hostfs_opendir, /* opendir */
|
||||
hostfs_closedir, /* closedir */
|
||||
@ -644,6 +647,21 @@ static int hostfs_dup(FAR const struct file *oldp, FAR struct file *newp)
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: hostfs_fstat
|
||||
*
|
||||
* Description:
|
||||
* Obtain information about an open file associated with the file
|
||||
* descriptor 'fd', and will write it to the area pointed to by 'buf'.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int hostfs_fstat(FAR const struct file *filep, FAR struct stat *buf)
|
||||
{
|
||||
#warning Missing logic
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: hostfs_opendir
|
||||
*
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* fs/nfs/nfs_vfsops.c
|
||||
*
|
||||
* Copyright (C) 2012-2013, 2015 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2012-2013, 2015, 2017 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2012 Jose Pablo Rojas Vargas. All rights reserved.
|
||||
* Author: Jose Pablo Rojas Vargas <jrojas@nx-engineering.com>
|
||||
* Gregory Nutt <gnutt@nuttx.org>
|
||||
@ -131,6 +131,7 @@ static ssize_t nfs_read(FAR struct file *filep, char *buffer, size_t buflen);
|
||||
static ssize_t nfs_write(FAR struct file *filep, const char *buffer,
|
||||
size_t buflen);
|
||||
static int nfs_dup(FAR const struct file *oldp, FAR struct file *newp);
|
||||
static int nfs_fstat(FAR const struct file *filep, FAR struct stat *buf);
|
||||
static int nfs_opendir(struct inode *mountpt, const char *relpath,
|
||||
struct fs_dirent_s *dir);
|
||||
static int nfs_readdir(struct inode *mountpt, struct fs_dirent_s *dir);
|
||||
@ -168,6 +169,7 @@ const struct mountpt_operations nfs_operations =
|
||||
|
||||
NULL, /* sync */
|
||||
nfs_dup, /* dup */
|
||||
nfs_fstat, /* fstat */
|
||||
|
||||
nfs_opendir, /* opendir */
|
||||
NULL, /* closedir */
|
||||
@ -1114,7 +1116,7 @@ errout_with_semaphore:
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: binfs_dup
|
||||
* Name: nfs_dup
|
||||
*
|
||||
* Description:
|
||||
* Duplicate open file data in the new file structure.
|
||||
@ -1173,6 +1175,21 @@ static int nfs_dup(FAR const struct file *oldp, FAR struct file *newp)
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: nfs_fstat
|
||||
*
|
||||
* Description:
|
||||
* Obtain information about an open file associated with the file
|
||||
* descriptor 'fd', and will write it to the area pointed to by 'buf'.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int nfs_fstat(FAR const struct file *filep, FAR struct stat *buf)
|
||||
{
|
||||
#warning Missing logic
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: nfs_opendir
|
||||
*
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* fs/nxffs/nxffs.h
|
||||
*
|
||||
* Copyright (C) 2011, 2013, 2015 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2011, 2013, 2015, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* References: Linux/Documentation/filesystems/romfs.txt
|
||||
@ -1092,6 +1092,7 @@ ssize_t nxffs_write(FAR struct file *filep, FAR const char *buffer,
|
||||
size_t buflen);
|
||||
int nxffs_ioctl(FAR struct file *filep, int cmd, unsigned long arg);
|
||||
int nxffs_dup(FAR const struct file *oldp, FAR struct file *newp);
|
||||
int nxffs_fstat(FAR const struct file *filep, FAR struct stat *buf);
|
||||
int nxffs_opendir(FAR struct inode *mountpt, FAR const char *relpath,
|
||||
FAR struct fs_dirent_s *dir);
|
||||
int nxffs_readdir(FAR struct inode *mountpt, FAR struct fs_dirent_s *dir);
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* fs/nxffs/nxffs_initialize.c
|
||||
*
|
||||
* Copyright (C) 2011, 2013, 2015 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2011, 2013, 2015, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* References: Linux/Documentation/filesystems/romfs.txt
|
||||
@ -73,6 +73,7 @@ const struct mountpt_operations nxffs_operations =
|
||||
|
||||
NULL, /* sync -- No buffered data */
|
||||
nxffs_dup, /* dup */
|
||||
nxffs_fstat, /* fstat */
|
||||
|
||||
nxffs_opendir, /* opendir */
|
||||
NULL, /* closedir */
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* fs/nxffs/nxffs_stat.c
|
||||
*
|
||||
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2011, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* References: Linux/Documentation/filesystems/romfs.txt
|
||||
@ -175,3 +175,19 @@ errout_with_semaphore:
|
||||
errout:
|
||||
return ret;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: nxffs_fstat
|
||||
*
|
||||
* Description:
|
||||
* Obtain information about an open file associated with the file
|
||||
* descriptor 'fd', and will write it to the area pointed to by 'buf'.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int nxffs_fstat(FAR const struct file *filep, FAR struct stat *buf)
|
||||
{
|
||||
#warning Missing logic
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* fs/procfs/fs_procfs.c
|
||||
*
|
||||
* Copyright (C) 2013-2016 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2013-2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -183,6 +183,8 @@ static int procfs_ioctl(FAR struct file *filep, int cmd,
|
||||
|
||||
static int procfs_dup(FAR const struct file *oldp,
|
||||
FAR struct file *newp);
|
||||
static int procfs_fstat(FAR const struct file *filep,
|
||||
FAR struct stat *buf);
|
||||
|
||||
static int procfs_opendir(FAR struct inode *mountpt, const char *relpath,
|
||||
FAR struct fs_dirent_s *dir);
|
||||
@ -235,6 +237,7 @@ const struct mountpt_operations procfs_operations =
|
||||
|
||||
NULL, /* sync */
|
||||
procfs_dup, /* dup */
|
||||
procfs_fstat, /* fstat */
|
||||
|
||||
procfs_opendir, /* opendir */
|
||||
procfs_closedir, /* closedir */
|
||||
@ -460,6 +463,21 @@ static int procfs_dup(FAR const struct file *oldp, FAR struct file *newp)
|
||||
return oldattr->procfsentry->ops->dup(oldp, newp);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: procfs_fstat
|
||||
*
|
||||
* Description:
|
||||
* Obtain information about an open file associated with the file
|
||||
* descriptor 'fd', and will write it to the area pointed to by 'buf'.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int procfs_fstat(FAR const struct file *filep, FAR struct stat *buf)
|
||||
{
|
||||
#warning Missing logic
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: procfs_opendir
|
||||
*
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* rm/romfs/fs_romfs.h
|
||||
*
|
||||
* Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2008-2009, 2011, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* References: Linux/Documentation/filesystems/romfs.txt
|
||||
@ -76,7 +76,10 @@ static off_t romfs_seek(FAR struct file *filep, off_t offset, int whence);
|
||||
static int romfs_ioctl(FAR struct file *filep, int cmd,
|
||||
unsigned long arg);
|
||||
|
||||
static int romfs_dup(FAR const struct file *oldp, FAR struct file *newp);
|
||||
static int romfs_dup(FAR const struct file *oldp,
|
||||
FAR struct file *newp);
|
||||
static int romfs_fstat(FAR const struct file *filep,
|
||||
FAR struct stat *buf);
|
||||
|
||||
static int romfs_opendir(FAR struct inode *mountpt,
|
||||
FAR const char *relpath,
|
||||
@ -116,6 +119,7 @@ const struct mountpt_operations romfs_operations =
|
||||
|
||||
NULL, /* sync */
|
||||
romfs_dup, /* dup */
|
||||
romfs_fstat, /* fstat */
|
||||
|
||||
romfs_opendir, /* opendir */
|
||||
NULL, /* closedir */
|
||||
@ -676,6 +680,21 @@ errout_with_semaphore:
|
||||
return ret;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: romfs_fstat
|
||||
*
|
||||
* Description:
|
||||
* Obtain information about an open file associated with the file
|
||||
* descriptor 'fd', and will write it to the area pointed to by 'buf'.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int romfs_fstat(FAR const struct file *filep, FAR struct stat *buf)
|
||||
{
|
||||
#warning Missing logic
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: romfs_opendir
|
||||
*
|
||||
|
@ -69,33 +69,50 @@
|
||||
static int smartfs_open(FAR struct file *filep, const char *relpath,
|
||||
int oflags, mode_t mode);
|
||||
static int smartfs_close(FAR struct file *filep);
|
||||
static ssize_t smartfs_read(FAR struct file *filep, char *buffer, size_t buflen);
|
||||
static ssize_t smartfs_read(FAR struct file *filep, char *buffer,
|
||||
size_t buflen);
|
||||
static ssize_t smartfs_write(FAR struct file *filep, const char *buffer,
|
||||
size_t buflen);
|
||||
static off_t smartfs_seek(FAR struct file *filep, off_t offset, int whence);
|
||||
static int smartfs_ioctl(FAR struct file *filep, int cmd, unsigned long arg);
|
||||
static off_t smartfs_seek(FAR struct file *filep, off_t offset,
|
||||
int whence);
|
||||
static int smartfs_ioctl(FAR struct file *filep, int cmd,
|
||||
unsigned long arg);
|
||||
|
||||
static int smartfs_sync(FAR struct file *filep);
|
||||
static int smartfs_dup(FAR const struct file *oldp, FAR struct file *newp);
|
||||
static int smartfs_dup(FAR const struct file *oldp,
|
||||
FAR struct file *newp);
|
||||
static int smartfs_fstat(FAR const struct file *filep,
|
||||
FAR struct stat *buf);
|
||||
|
||||
static int smartfs_opendir(struct inode *mountpt, const char *relpath,
|
||||
struct fs_dirent_s *dir);
|
||||
static int smartfs_readdir(struct inode *mountpt, struct fs_dirent_s *dir);
|
||||
static int smartfs_rewinddir(struct inode *mountpt, struct fs_dirent_s *dir);
|
||||
static int smartfs_opendir(FAR struct inode *mountpt,
|
||||
FAR const char *relpath,
|
||||
FAR struct fs_dirent_s *dir);
|
||||
static int smartfs_readdir(FAR struct inode *mountpt,
|
||||
FAR struct fs_dirent_s *dir);
|
||||
static int smartfs_rewinddir(FAR struct inode *mountpt,
|
||||
FAR struct fs_dirent_s *dir);
|
||||
|
||||
static int smartfs_bind(FAR struct inode *blkdriver, const void *data,
|
||||
void **handle);
|
||||
static int smartfs_bind(FAR struct inode *blkdriver,
|
||||
FAR const void *data,
|
||||
FAR void **handle);
|
||||
static int smartfs_unbind(void *handle, FAR struct inode **blkdriver,
|
||||
unsigned int flags);
|
||||
static int smartfs_statfs(struct inode *mountpt, struct statfs *buf);
|
||||
static int smartfs_statfs(FAR struct inode *mountpt,
|
||||
FAR struct statfs *buf);
|
||||
|
||||
static int smartfs_unlink(struct inode *mountpt, const char *relpath);
|
||||
static int smartfs_mkdir(struct inode *mountpt, const char *relpath,
|
||||
static int smartfs_unlink(FAR struct inode *mountpt,
|
||||
FAR const char *relpath);
|
||||
static int smartfs_mkdir(FAR struct inode *mountpt,
|
||||
FAR const char *relpath,
|
||||
mode_t mode);
|
||||
static int smartfs_rmdir(struct inode *mountpt, const char *relpath);
|
||||
static int smartfs_rename(struct inode *mountpt, const char *oldrelpath,
|
||||
static int smartfs_rmdir(FAR struct inode *mountpt,
|
||||
FAR const char *relpath);
|
||||
static int smartfs_rename(FAR struct inode *mountpt,
|
||||
FAR const char *oldrelpath,
|
||||
const char *newrelpath);
|
||||
static int smartfs_stat(struct inode *mountpt, const char *relpath, struct stat *buf);
|
||||
static int smartfs_stat(FAR struct inode *mountpt,
|
||||
FAR const char *relpath,
|
||||
FAR struct stat *buf);
|
||||
|
||||
static off_t smartfs_seek_internal(struct smartfs_mountpt_s *fs,
|
||||
struct smartfs_ofile_s *sf,
|
||||
@ -128,6 +145,7 @@ const struct mountpt_operations smartfs_operations =
|
||||
|
||||
smartfs_sync, /* sync */
|
||||
smartfs_dup, /* dup */
|
||||
smartfs_fstat, /* fstat */
|
||||
|
||||
smartfs_opendir, /* opendir */
|
||||
NULL, /* closedir */
|
||||
@ -1249,6 +1267,21 @@ static int smartfs_dup(FAR const struct file *oldp, FAR struct file *newp)
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: smartfs_fstat
|
||||
*
|
||||
* Description:
|
||||
* Obtain information about an open file associated with the file
|
||||
* descriptor 'fd', and will write it to the area pointed to by 'buf'.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int smartfs_fstat(FAR const struct file *filep, FAR struct stat *buf)
|
||||
{
|
||||
#warning Missing logic
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: smartfs_opendir
|
||||
*
|
||||
@ -1256,7 +1289,8 @@ static int smartfs_dup(FAR const struct file *oldp, FAR struct file *newp)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int smartfs_opendir(struct inode *mountpt, const char *relpath, struct fs_dirent_s *dir)
|
||||
static int smartfs_opendir(FAR struct inode *mountpt, FAR const char *relpath,
|
||||
FAR struct fs_dirent_s *dir)
|
||||
{
|
||||
struct smartfs_mountpt_s *fs;
|
||||
int ret;
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* fs/tmpfs/fs_tmpfs.c
|
||||
*
|
||||
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -91,75 +91,77 @@ static void tmpfs_unlock_reentrant(FAR struct tmpfs_sem_s *sem);
|
||||
static void tmpfs_unlock(FAR struct tmpfs_s *fs);
|
||||
static void tmpfs_lock_object(FAR struct tmpfs_object_s *to);
|
||||
static void tmpfs_unlock_object(FAR struct tmpfs_object_s *to);
|
||||
static int tmpfs_realloc_directory(FAR struct tmpfs_directory_s **tdo,
|
||||
unsigned int nentries);
|
||||
static int tmpfs_realloc_file(FAR struct tmpfs_file_s **tfo,
|
||||
size_t newsize);
|
||||
static int tmpfs_realloc_directory(FAR struct tmpfs_directory_s **tdo,
|
||||
unsigned int nentries);
|
||||
static int tmpfs_realloc_file(FAR struct tmpfs_file_s **tfo,
|
||||
size_t newsize);
|
||||
static void tmpfs_release_lockedobject(FAR struct tmpfs_object_s *to);
|
||||
static void tmpfs_release_lockedfile(FAR struct tmpfs_file_s *tfo);
|
||||
static int tmpfs_find_dirent(FAR struct tmpfs_directory_s *tdo,
|
||||
FAR const char *name);
|
||||
static int tmpfs_remove_dirent(FAR struct tmpfs_directory_s *tdo,
|
||||
FAR const char *name);
|
||||
static int tmpfs_add_dirent(FAR struct tmpfs_directory_s **tdo,
|
||||
FAR struct tmpfs_object_s *to, FAR const char *name);
|
||||
static int tmpfs_find_dirent(FAR struct tmpfs_directory_s *tdo,
|
||||
FAR const char *name);
|
||||
static int tmpfs_remove_dirent(FAR struct tmpfs_directory_s *tdo,
|
||||
FAR const char *name);
|
||||
static int tmpfs_add_dirent(FAR struct tmpfs_directory_s **tdo,
|
||||
FAR struct tmpfs_object_s *to, FAR const char *name);
|
||||
static FAR struct tmpfs_file_s *tmpfs_alloc_file(void);
|
||||
static int tmpfs_create_file(FAR struct tmpfs_s *fs,
|
||||
FAR const char *relpath, FAR struct tmpfs_file_s **tfo);
|
||||
static int tmpfs_create_file(FAR struct tmpfs_s *fs,
|
||||
FAR const char *relpath, FAR struct tmpfs_file_s **tfo);
|
||||
static FAR struct tmpfs_directory_s *tmpfs_alloc_directory(void);
|
||||
static int tmpfs_create_directory(FAR struct tmpfs_s *fs,
|
||||
FAR const char *relpath, FAR struct tmpfs_directory_s **tdo);
|
||||
static int tmpfs_find_object(FAR struct tmpfs_s *fs,
|
||||
FAR const char *relpath, FAR struct tmpfs_object_s **object,
|
||||
FAR struct tmpfs_directory_s **parent);
|
||||
static int tmpfs_find_file(FAR struct tmpfs_s *fs,
|
||||
FAR const char *relpath,
|
||||
FAR struct tmpfs_file_s **tfo,
|
||||
FAR struct tmpfs_directory_s **parent);
|
||||
static int tmpfs_find_directory(FAR struct tmpfs_s *fs,
|
||||
FAR const char *relpath,
|
||||
FAR struct tmpfs_directory_s **tdo,
|
||||
FAR struct tmpfs_directory_s **parent);
|
||||
static int tmpfs_statfs_callout(FAR struct tmpfs_directory_s *tdo,
|
||||
unsigned int index, FAR void *arg);
|
||||
static int tmpfs_free_callout(FAR struct tmpfs_directory_s *tdo,
|
||||
unsigned int index, FAR void *arg);
|
||||
static int tmpfs_foreach(FAR struct tmpfs_directory_s *tdo,
|
||||
tmpfs_foreach_t callout, FAR void *arg);
|
||||
static int tmpfs_create_directory(FAR struct tmpfs_s *fs,
|
||||
FAR const char *relpath, FAR struct tmpfs_directory_s **tdo);
|
||||
static int tmpfs_find_object(FAR struct tmpfs_s *fs,
|
||||
FAR const char *relpath, FAR struct tmpfs_object_s **object,
|
||||
FAR struct tmpfs_directory_s **parent);
|
||||
static int tmpfs_find_file(FAR struct tmpfs_s *fs,
|
||||
FAR const char *relpath,
|
||||
FAR struct tmpfs_file_s **tfo,
|
||||
FAR struct tmpfs_directory_s **parent);
|
||||
static int tmpfs_find_directory(FAR struct tmpfs_s *fs,
|
||||
FAR const char *relpath,
|
||||
FAR struct tmpfs_directory_s **tdo,
|
||||
FAR struct tmpfs_directory_s **parent);
|
||||
static int tmpfs_statfs_callout(FAR struct tmpfs_directory_s *tdo,
|
||||
unsigned int index, FAR void *arg);
|
||||
static int tmpfs_free_callout(FAR struct tmpfs_directory_s *tdo,
|
||||
unsigned int index, FAR void *arg);
|
||||
static int tmpfs_foreach(FAR struct tmpfs_directory_s *tdo,
|
||||
tmpfs_foreach_t callout, FAR void *arg);
|
||||
|
||||
/* File system operations */
|
||||
|
||||
static int tmpfs_open(FAR struct file *filep, FAR const char *relpath,
|
||||
int oflags, mode_t mode);
|
||||
static int tmpfs_close(FAR struct file *filep);
|
||||
static int tmpfs_open(FAR struct file *filep, FAR const char *relpath,
|
||||
int oflags, mode_t mode);
|
||||
static int tmpfs_close(FAR struct file *filep);
|
||||
static ssize_t tmpfs_read(FAR struct file *filep, FAR char *buffer,
|
||||
size_t buflen);
|
||||
size_t buflen);
|
||||
static ssize_t tmpfs_write(FAR struct file *filep, FAR const char *buffer,
|
||||
size_t buflen);
|
||||
size_t buflen);
|
||||
static off_t tmpfs_seek(FAR struct file *filep, off_t offset, int whence);
|
||||
static int tmpfs_ioctl(FAR struct file *filep, int cmd, unsigned long arg);
|
||||
static int tmpfs_dup(FAR const struct file *oldp, FAR struct file *newp);
|
||||
static int tmpfs_opendir(FAR struct inode *mountpt, FAR const char *relpath,
|
||||
FAR struct fs_dirent_s *dir);
|
||||
static int tmpfs_closedir(FAR struct inode *mountpt,
|
||||
FAR struct fs_dirent_s *dir);
|
||||
static int tmpfs_readdir(FAR struct inode *mountpt,
|
||||
FAR struct fs_dirent_s *dir);
|
||||
static int tmpfs_rewinddir(FAR struct inode *mountpt,
|
||||
FAR struct fs_dirent_s *dir);
|
||||
static int tmpfs_bind(FAR struct inode *blkdriver, FAR const void *data,
|
||||
FAR void **handle);
|
||||
static int tmpfs_unbind(FAR void *handle, FAR struct inode **blkdriver,
|
||||
unsigned int flags);
|
||||
static int tmpfs_statfs(FAR struct inode *mountpt, FAR struct statfs *buf);
|
||||
static int tmpfs_unlink(FAR struct inode *mountpt, FAR const char *relpath);
|
||||
static int tmpfs_mkdir(FAR struct inode *mountpt, FAR const char *relpath,
|
||||
mode_t mode);
|
||||
static int tmpfs_rmdir(FAR struct inode *mountpt, FAR const char *relpath);
|
||||
static int tmpfs_rename(FAR struct inode *mountpt, FAR const char *oldrelpath,
|
||||
FAR const char *newrelpath);
|
||||
static int tmpfs_stat(FAR struct inode *mountpt, FAR const char *relpath,
|
||||
FAR struct stat *buf);
|
||||
static int tmpfs_ioctl(FAR struct file *filep, int cmd, unsigned long arg);
|
||||
static int tmpfs_dup(FAR const struct file *oldp, FAR struct file *newp);
|
||||
static int tmpfs_fstat(FAR const struct file *filep, FAR struct stat *buf);
|
||||
|
||||
static int tmpfs_opendir(FAR struct inode *mountpt, FAR const char *relpath,
|
||||
FAR struct fs_dirent_s *dir);
|
||||
static int tmpfs_closedir(FAR struct inode *mountpt,
|
||||
FAR struct fs_dirent_s *dir);
|
||||
static int tmpfs_readdir(FAR struct inode *mountpt,
|
||||
FAR struct fs_dirent_s *dir);
|
||||
static int tmpfs_rewinddir(FAR struct inode *mountpt,
|
||||
FAR struct fs_dirent_s *dir);
|
||||
static int tmpfs_bind(FAR struct inode *blkdriver, FAR const void *data,
|
||||
FAR void **handle);
|
||||
static int tmpfs_unbind(FAR void *handle, FAR struct inode **blkdriver,
|
||||
unsigned int flags);
|
||||
static int tmpfs_statfs(FAR struct inode *mountpt, FAR struct statfs *buf);
|
||||
static int tmpfs_unlink(FAR struct inode *mountpt, FAR const char *relpath);
|
||||
static int tmpfs_mkdir(FAR struct inode *mountpt, FAR const char *relpath,
|
||||
mode_t mode);
|
||||
static int tmpfs_rmdir(FAR struct inode *mountpt, FAR const char *relpath);
|
||||
static int tmpfs_rename(FAR struct inode *mountpt, FAR const char *oldrelpath,
|
||||
FAR const char *newrelpath);
|
||||
static int tmpfs_stat(FAR struct inode *mountpt, FAR const char *relpath,
|
||||
FAR struct stat *buf);
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
@ -175,6 +177,7 @@ const struct mountpt_operations tmpfs_operations =
|
||||
tmpfs_ioctl, /* ioctl */
|
||||
NULL, /* sync */
|
||||
tmpfs_dup, /* dup */
|
||||
tmpfs_fstat, /* fstat */
|
||||
tmpfs_opendir, /* opendir */
|
||||
tmpfs_closedir, /* closedir */
|
||||
tmpfs_readdir, /* readdir */
|
||||
@ -1769,6 +1772,21 @@ static int tmpfs_dup(FAR const struct file *oldp, FAR struct file *newp)
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: tmpfs_fstat
|
||||
*
|
||||
* Description:
|
||||
* Obtain information about an open file associated with the file
|
||||
* descriptor 'fd', and will write it to the area pointed to by 'buf'.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int tmpfs_fstat(FAR const struct file *filep, FAR struct stat *buf)
|
||||
{
|
||||
#warning Missing logic
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: tmpfs_opendir
|
||||
****************************************************************************/
|
||||
|
@ -160,6 +160,8 @@ static int unionfs_ioctl(FAR struct file *filep, int cmd,
|
||||
static int unionfs_sync(FAR struct file *filep);
|
||||
static int unionfs_dup(FAR const struct file *oldp,
|
||||
FAR struct file *newp);
|
||||
static int unionfs_fstat(FAR const struct file *filep,
|
||||
FAR struct stat *buf);
|
||||
|
||||
/* Operations on directories */
|
||||
|
||||
@ -215,6 +217,7 @@ static const struct mountpt_operations g_unionfs_mops =
|
||||
|
||||
unionfs_sync, /* sync */
|
||||
unionfs_dup, /* dup */
|
||||
unionfs_fstat, /* fstat */
|
||||
|
||||
unionfs_opendir, /* opendir */
|
||||
unionfs_closedir, /* closedir */
|
||||
@ -1309,6 +1312,21 @@ static int unionfs_dup(FAR const struct file *oldp, FAR struct file *newp)
|
||||
return ret;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: unionfs_fstat
|
||||
*
|
||||
* Description:
|
||||
* Obtain information about an open file associated with the file
|
||||
* descriptor 'fd', and will write it to the area pointed to by 'buf'.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int unionfs_fstat(FAR const struct file *filep, FAR struct stat *buf)
|
||||
{
|
||||
#warning Missing logic
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: unionfs_opendir
|
||||
****************************************************************************/
|
||||
|
@ -265,7 +265,7 @@ struct mountpt_operations
|
||||
|
||||
int (*sync)(FAR struct file *filep);
|
||||
int (*dup)(FAR const struct file *oldp, FAR struct file *newp);
|
||||
int (*fstat)(FAR const struct file *filep, FAR struct stat *buf);
|
||||
int (*fstat)(FAR const struct file *filep, FAR struct stat *buf);
|
||||
|
||||
/* Directory operations */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user