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

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

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

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

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

kernel.org | git.kernel.org | LWN.net | Project Home | 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.

sflogo.php