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

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

Version: ~ [ linux-5.17-rc1 ] ~ [ linux-5.16.2 ] ~ [ linux-5.15.16 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.93 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.173 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.225 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.262 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.297 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.299 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.18.140 ] ~ [ linux-3.16.85 ] ~ [ linux-3.14.79 ] ~ [ linux-3.12.74 ] ~ [ 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.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* AFS common types
  2  *
  3  * Copyright (C) 2002, 2007 Red Hat, Inc. All Rights Reserved.
  4  * Written by David Howells (dhowells@redhat.com)
  5  *
  6  * This program is free software; you can redistribute it and/or
  7  * modify it under the terms of the GNU General Public License
  8  * as published by the Free Software Foundation; either version
  9  * 2 of the License, or (at your option) any later version.
 10  */
 11 
 12 #ifndef AFS_H
 13 #define AFS_H
 14 
 15 #include <linux/in.h>
 16 
 17 #define AFS_MAXCELLNAME 64              /* maximum length of a cell name */
 18 #define AFS_MAXVOLNAME  64              /* maximum length of a volume name */
 19 #define AFSNAMEMAX      256             /* maximum length of a filename plus NUL */
 20 #define AFSPATHMAX      1024            /* maximum length of a pathname plus NUL */
 21 #define AFSOPAQUEMAX    1024            /* maximum length of an opaque field */
 22 
 23 typedef unsigned                        afs_volid_t;
 24 typedef unsigned                        afs_vnodeid_t;
 25 typedef unsigned long long              afs_dataversion_t;
 26 
 27 typedef enum {
 28         AFSVL_RWVOL,                    /* read/write volume */
 29         AFSVL_ROVOL,                    /* read-only volume */
 30         AFSVL_BACKVOL,                  /* backup volume */
 31 } __attribute__((packed)) afs_voltype_t;
 32 
 33 typedef enum {
 34         AFS_FTYPE_INVALID       = 0,
 35         AFS_FTYPE_FILE          = 1,
 36         AFS_FTYPE_DIR           = 2,
 37         AFS_FTYPE_SYMLINK       = 3,
 38 } afs_file_type_t;
 39 
 40 typedef enum {
 41         AFS_LOCK_READ           = 0,    /* read lock request */
 42         AFS_LOCK_WRITE          = 1,    /* write lock request */
 43 } afs_lock_type_t;
 44 
 45 #define AFS_LOCKWAIT            (5 * 60) /* time until a lock times out (seconds) */
 46 
 47 /*
 48  * AFS file identifier
 49  */
 50 struct afs_fid {
 51         afs_volid_t     vid;            /* volume ID */
 52         afs_vnodeid_t   vnode;          /* file index within volume */
 53         unsigned        unique;         /* unique ID number (file index version) */
 54 };
 55 
 56 /*
 57  * AFS callback notification
 58  */
 59 typedef enum {
 60         AFSCM_CB_UNTYPED        = 0,    /* no type set on CB break */
 61         AFSCM_CB_EXCLUSIVE      = 1,    /* CB exclusive to CM [not implemented] */
 62         AFSCM_CB_SHARED         = 2,    /* CB shared by other CM's */
 63         AFSCM_CB_DROPPED        = 3,    /* CB promise cancelled by file server */
 64 } afs_callback_type_t;
 65 
 66 struct afs_callback {
 67         struct afs_fid          fid;            /* file identifier */
 68         unsigned                version;        /* callback version */
 69         unsigned                expiry;         /* time at which expires */
 70         afs_callback_type_t     type;           /* type of callback */
 71 };
 72 
 73 #define AFSCBMAX 50     /* maximum callbacks transferred per bulk op */
 74 
 75 /*
 76  * AFS volume information
 77  */
 78 struct afs_volume_info {
 79         afs_volid_t             vid;            /* volume ID */
 80         afs_voltype_t           type;           /* type of this volume */
 81         afs_volid_t             type_vids[5];   /* volume ID's for possible types for this vol */
 82 
 83         /* list of fileservers serving this volume */
 84         size_t                  nservers;       /* number of entries used in servers[] */
 85         struct {
 86                 struct in_addr  addr;           /* fileserver address */
 87         } servers[8];
 88 };
 89 
 90 /*
 91  * AFS security ACE access mask
 92  */
 93 typedef u32 afs_access_t;
 94 #define AFS_ACE_READ            0x00000001U     /* - permission to read a file/dir */
 95 #define AFS_ACE_WRITE           0x00000002U     /* - permission to write/chmod a file */
 96 #define AFS_ACE_INSERT          0x00000004U     /* - permission to create dirent in a dir */
 97 #define AFS_ACE_LOOKUP          0x00000008U     /* - permission to lookup a file/dir in a dir */
 98 #define AFS_ACE_DELETE          0x00000010U     /* - permission to delete a dirent from a dir */
 99 #define AFS_ACE_LOCK            0x00000020U     /* - permission to lock a file */
100 #define AFS_ACE_ADMINISTER      0x00000040U     /* - permission to change ACL */
101 #define AFS_ACE_USER_A          0x01000000U     /* - 'A' user-defined permission */
102 #define AFS_ACE_USER_B          0x02000000U     /* - 'B' user-defined permission */
103 #define AFS_ACE_USER_C          0x04000000U     /* - 'C' user-defined permission */
104 #define AFS_ACE_USER_D          0x08000000U     /* - 'D' user-defined permission */
105 #define AFS_ACE_USER_E          0x10000000U     /* - 'E' user-defined permission */
106 #define AFS_ACE_USER_F          0x20000000U     /* - 'F' user-defined permission */
107 #define AFS_ACE_USER_G          0x40000000U     /* - 'G' user-defined permission */
108 #define AFS_ACE_USER_H          0x80000000U     /* - 'H' user-defined permission */
109 
110 /*
111  * AFS file status information
112  */
113 struct afs_file_status {
114         unsigned                if_version;     /* interface version */
115 #define AFS_FSTATUS_VERSION     1
116 
117         afs_file_type_t         type;           /* file type */
118         unsigned                nlink;          /* link count */
119         u64                     size;           /* file size */
120         afs_dataversion_t       data_version;   /* current data version */
121         u32                     author;         /* author ID */
122         kuid_t                  owner;          /* owner ID */
123         kgid_t                  group;          /* group ID */
124         afs_access_t            caller_access;  /* access rights for authenticated caller */
125         afs_access_t            anon_access;    /* access rights for unauthenticated caller */
126         umode_t                 mode;           /* UNIX mode */
127         struct afs_fid          parent;         /* parent dir ID for non-dirs only */
128         time_t                  mtime_client;   /* last time client changed data */
129         time_t                  mtime_server;   /* last time server changed data */
130         s32                     lock_count;     /* file lock count (0=UNLK -1=WRLCK +ve=#RDLCK */
131 };
132 
133 /*
134  * AFS file status change request
135  */
136 
137 #define AFS_SET_MTIME           0x01            /* set the mtime */
138 #define AFS_SET_OWNER           0x02            /* set the owner ID */
139 #define AFS_SET_GROUP           0x04            /* set the group ID (unsupported?) */
140 #define AFS_SET_MODE            0x08            /* set the UNIX mode */
141 #define AFS_SET_SEG_SIZE        0x10            /* set the segment size (unsupported) */
142 
143 /*
144  * AFS volume synchronisation information
145  */
146 struct afs_volsync {
147         time_t                  creation;       /* volume creation time */
148 };
149 
150 /*
151  * AFS volume status record
152  */
153 struct afs_volume_status {
154         u32                     vid;            /* volume ID */
155         u32                     parent_id;      /* parent volume ID */
156         u8                      online;         /* true if volume currently online and available */
157         u8                      in_service;     /* true if volume currently in service */
158         u8                      blessed;        /* same as in_service */
159         u8                      needs_salvage;  /* true if consistency checking required */
160         u32                     type;           /* volume type (afs_voltype_t) */
161         u32                     min_quota;      /* minimum space set aside (blocks) */
162         u32                     max_quota;      /* maximum space this volume may occupy (blocks) */
163         u32                     blocks_in_use;  /* space this volume currently occupies (blocks) */
164         u32                     part_blocks_avail; /* space available in volume's partition */
165         u32                     part_max_blocks; /* size of volume's partition */
166 };
167 
168 #define AFS_BLOCK_SIZE  1024
169 
170 #endif /* AFS_H */
171 

~ [ 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