cctools
chirp_types.h
Go to the documentation of this file.
1 /*
2 Copyright (C) 2003-2004 Douglas Thain and the University of Wisconsin
3 Copyright (C) 2005- The University of Notre Dame
4 This software is distributed under the GNU General Public License.
5 See the file COPYING for details.
6 */
7 
12 #ifndef CHIRP_TYPES_H
13 #define CHIRP_TYPES_H
14 
15 #include "int_sizes.h"
16 #include "chirp_protocol.h"
17 
18 #include <sys/types.h>
19 #include <time.h>
20 #include <fcntl.h>
21 
29 struct chirp_stat {
30  INT64_T cst_dev;
31  INT64_T cst_ino;
32  INT64_T cst_mode;
33  INT64_T cst_nlink;
34  INT64_T cst_uid;
35  INT64_T cst_gid;
36  INT64_T cst_rdev;
37  INT64_T cst_size;
38  INT64_T cst_blksize;
39  INT64_T cst_blocks;
40  INT64_T cst_atime;
41  INT64_T cst_mtime;
42  INT64_T cst_ctime;
43 };
44 
49 struct chirp_statfs {
50  INT64_T f_type;
51  INT64_T f_blocks;
52  INT64_T f_bavail;
53  INT64_T f_bsize;
54  INT64_T f_bfree;
55  INT64_T f_files;
56  INT64_T f_ffree;
57 };
58 
61 struct chirp_dirent {
62  char *name;
63  struct chirp_stat info;
64  struct chirp_dirent *next;
65 };
66 
69 typedef enum {
77 
82 struct chirp_bulkio {
84  struct chirp_file *file;
85  struct chirp_stat *info;
86  void *buffer;
87  INT64_T length;
88  INT64_T stride_length;
89  INT64_T stride_skip;
90  INT64_T offset;
91  INT64_T result;
92  INT64_T errnum;
93 };
94 
99 struct chirp_audit {
101  INT64_T nfiles;
102  INT64_T ndirs;
103  INT64_T nbytes;
104 };
105 
114 typedef void (*chirp_dir_t) (const char *path, void *arg);
115 
125 typedef void (*chirp_longdir_t) (const char *path, struct chirp_stat * info, void *arg);
126 
135 typedef void (*chirp_loc_t) (const char *location, void *arg);
136 
137 #endif
INT64_T cst_dev
The device number on which the file is stored.
Definition: chirp_types.h:30
void * buffer
Pointer to data buffer for PREAD, PWRITE, SREAD, and SWRITE.
Definition: chirp_types.h:86
struct chirp_file * file
The file to access for all operations.
Definition: chirp_types.h:84
INT64_T f_bsize
The size in bytes of a block.
Definition: chirp_types.h:53
INT64_T f_blocks
The total number of blocks in the filesystem.
Definition: chirp_types.h:51
INT64_T ndirs
The number of directories owned by that user.
Definition: chirp_types.h:102
void(* chirp_loc_t)(const char *location, void *arg)
A callback function typedef used to display a file's location(s).
Definition: chirp_types.h:135
void(* chirp_dir_t)(const char *path, void *arg)
A callback function typedef used to display a directory or access control list.
Definition: chirp_types.h:114
INT64_T cst_nlink
The number of hard links to this file.
Definition: chirp_types.h:33
INT64_T cst_size
The size of the file, in bytes.
Definition: chirp_types.h:37
INT64_T errnum
On failure, contains the errno for the call.
Definition: chirp_types.h:92
#define CHIRP_PATH_MAX
The maximum length of a full path in any Chirp operation.
Definition: chirp_protocol.h:20
struct chirp_stat info
The properties of the directory entry.
Definition: chirp_types.h:63
void(* chirp_longdir_t)(const char *path, struct chirp_stat *info, void *arg)
A callback function typedef used to display a detailed directory.
Definition: chirp_types.h:125
Perform a chirp_reli_fsync.
Definition: chirp_types.h:75
INT64_T length
Length of the data, in bytes, for PREAD, WRITE, SREAD, and SWRITE.
Definition: chirp_types.h:87
char name[CHIRP_PATH_MAX]
The identity of the user.
Definition: chirp_types.h:100
INT64_T nfiles
The number of files owned by that user.
Definition: chirp_types.h:101
INT64_T f_bfree
The number of blocks free.
Definition: chirp_types.h:54
Describes a bulk I/O operation.
Definition: chirp_types.h:82
INT64_T cst_blksize
The recommended transfer block size for accessing this file.
Definition: chirp_types.h:38
INT64_T cst_uid
The Unix UID of the file's owner.
Definition: chirp_types.h:34
INT64_T cst_atime
The last time the file was accessed, in time_t format.
Definition: chirp_types.h:40
INT64_T stride_skip
Distance between start of each stride for SREAD and SWRITE.
Definition: chirp_types.h:89
char * name
The name of the directory entry.
Definition: chirp_types.h:62
Perform a chirp_reli_pwrite.
Definition: chirp_types.h:71
Describes the properties of a file, much like the Unix stat structure.
Definition: chirp_types.h:29
Descibes the space consumed by a single user on a Chirp server.
Definition: chirp_types.h:99
INT64_T stride_length
Length of each stride for SREAD and SWRITE.
Definition: chirp_types.h:88
INT64_T cst_ino
The inode number of the file.
Definition: chirp_types.h:31
INT64_T cst_gid
The Unix GID of the file's group varship.
Definition: chirp_types.h:35
chirp_bulkio_t
Describes the type of a bulk I/O operation.
Definition: chirp_types.h:69
INT64_T f_files
The maximum number of files (inodes) on the filesystem.
Definition: chirp_types.h:55
INT64_T f_ffree
The number of files (inodes) currently in use.
Definition: chirp_types.h:56
INT64_T cst_rdev
The device number, if this represents a device.
Definition: chirp_types.h:36
Perform a chirp_reli_fstat.
Definition: chirp_types.h:74
This file defines the binary values mandated by the Chirp Protocol specification, used by both the cl...
INT64_T cst_mode
The Unix mode bits of the file.
Definition: chirp_types.h:32
INT64_T cst_ctime
The last time the inode was changed, in time_t format.
Definition: chirp_types.h:42
Perform a chirp_reli_pread.
Definition: chirp_types.h:70
Describes the properties of a file system, much like the Unix statfs structure.
Definition: chirp_types.h:49
chirp_bulkio_t type
The type of I/O to perform.
Definition: chirp_types.h:83
INT64_T nbytes
The total bytes consumed by that user.
Definition: chirp_types.h:103
INT64_T f_bavail
The number of blocks available to an ordinary user.
Definition: chirp_types.h:52
INT64_T cst_mtime
The last time the file data was modified, time_t format.
Definition: chirp_types.h:41
INT64_T offset
Starting offset in file for PREAD, PWRITE, SREAD, and SWRITE.
Definition: chirp_types.h:90
INT64_T f_type
The integer type of the filesystem.
Definition: chirp_types.h:50
struct chirp_stat * info
Pointer to a data buffer for FSTAT.
Definition: chirp_types.h:85
Describes a directory entry returned by chirp_reli_readdir.
Definition: chirp_types.h:61
Perform a chirp_reli_swrite.
Definition: chirp_types.h:73
INT64_T result
On completion, contains result of operation.
Definition: chirp_types.h:91
Perform a chirp_reli_sread.
Definition: chirp_types.h:72
INT64_T cst_blocks
The number of blocks consumed by this file in the file system.
Definition: chirp_types.h:39