~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/fs/hostfs/hostfs.h

Version: ~ [ linux-5.4-rc3 ] ~ [ linux-5.3.6 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.79 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.149 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.196 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.196 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.75 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 #ifndef __UM_FS_HOSTFS
  2 #define __UM_FS_HOSTFS
  3 
  4 #include <os.h>
  5 
  6 /*
  7  * These are exactly the same definitions as in fs.h, but the names are
  8  * changed so that this file can be included in both kernel and user files.
  9  */
 10 
 11 #define HOSTFS_ATTR_MODE        1
 12 #define HOSTFS_ATTR_UID         2
 13 #define HOSTFS_ATTR_GID         4
 14 #define HOSTFS_ATTR_SIZE        8
 15 #define HOSTFS_ATTR_ATIME       16
 16 #define HOSTFS_ATTR_MTIME       32
 17 #define HOSTFS_ATTR_CTIME       64
 18 #define HOSTFS_ATTR_ATIME_SET   128
 19 #define HOSTFS_ATTR_MTIME_SET   256
 20 
 21 /* These two are unused by hostfs. */
 22 #define HOSTFS_ATTR_FORCE       512     /* Not a change, but a change it */
 23 #define HOSTFS_ATTR_ATTR_FLAG   1024
 24 
 25 /*
 26  * If you are very careful, you'll notice that these two are missing:
 27  *
 28  * #define ATTR_KILL_SUID       2048
 29  * #define ATTR_KILL_SGID       4096
 30  *
 31  * and this is because they were added in 2.5 development.
 32  * Actually, they are not needed by most ->setattr() methods - they are set by
 33  * callers of notify_change() to notify that the setuid/setgid bits must be
 34  * dropped.
 35  * notify_change() will delete those flags, make sure attr->ia_valid & ATTR_MODE
 36  * is on, and remove the appropriate bits from attr->ia_mode (attr is a
 37  * "struct iattr *"). -BlaisorBlade
 38  */
 39 
 40 struct hostfs_iattr {
 41         unsigned int    ia_valid;
 42         unsigned short  ia_mode;
 43         uid_t           ia_uid;
 44         gid_t           ia_gid;
 45         loff_t          ia_size;
 46         struct timespec ia_atime;
 47         struct timespec ia_mtime;
 48         struct timespec ia_ctime;
 49 };
 50 
 51 struct hostfs_stat {
 52         unsigned long long ino;
 53         unsigned int mode;
 54         unsigned int nlink;
 55         unsigned int uid;
 56         unsigned int gid;
 57         unsigned long long size;
 58         struct timespec atime, mtime, ctime;
 59         unsigned int blksize;
 60         unsigned long long blocks;
 61         unsigned int maj;
 62         unsigned int min;
 63 };
 64 
 65 extern int stat_file(const char *path, struct hostfs_stat *p, int fd);
 66 extern int access_file(char *path, int r, int w, int x);
 67 extern int open_file(char *path, int r, int w, int append);
 68 extern void *open_dir(char *path, int *err_out);
 69 extern char *read_dir(void *stream, unsigned long long *pos,
 70                       unsigned long long *ino_out, int *len_out,
 71                       unsigned int *type_out);
 72 extern void close_file(void *stream);
 73 extern int replace_file(int oldfd, int fd);
 74 extern void close_dir(void *stream);
 75 extern int read_file(int fd, unsigned long long *offset, char *buf, int len);
 76 extern int write_file(int fd, unsigned long long *offset, const char *buf,
 77                       int len);
 78 extern int lseek_file(int fd, long long offset, int whence);
 79 extern int fsync_file(int fd, int datasync);
 80 extern int file_create(char *name, int ur, int uw, int ux, int gr,
 81                        int gw, int gx, int or, int ow, int ox);
 82 extern int set_attr(const char *file, struct hostfs_iattr *attrs, int fd);
 83 extern int make_symlink(const char *from, const char *to);
 84 extern int unlink_file(const char *file);
 85 extern int do_mkdir(const char *file, int mode);
 86 extern int do_rmdir(const char *file);
 87 extern int do_mknod(const char *file, int mode, unsigned int major,
 88                     unsigned int minor);
 89 extern int link_file(const char *from, const char *to);
 90 extern int hostfs_do_readlink(char *file, char *buf, int size);
 91 extern int rename_file(char *from, char *to);
 92 extern int do_statfs(char *root, long *bsize_out, long long *blocks_out,
 93                      long long *bfree_out, long long *bavail_out,
 94                      long long *files_out, long long *ffree_out,
 95                      void *fsid_out, int fsid_size, long *namelen_out);
 96 
 97 #endif
 98 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp