~ubuntu-branches/ubuntu/vivid/virtualbox/vivid

« back to all changes in this revision

Viewing changes to src/VBox/Additions/solaris/SharedFolders/vboxfs_prov.h

  • Committer: Package Import Robot
  • Author(s): Felix Geyer
  • Date: 2011-12-29 12:29:25 UTC
  • mfrom: (3.1.8 sid)
  • Revision ID: package-import@ubuntu.com-20111229122925-8ota2o33fuk0bkf8
Tags: 4.1.8-dfsg-1
* New upstream release.
* Move all transitional packages to section oldlibs and priority extra.
* Refresh 16-no-update.patch.
* Drop 36-kernel-3.2.patch, applied upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
/*
72
72
 * query information about a mounted file system
73
73
 */
74
 
extern int sfprov_get_blksize(sfp_mount_t *, uint64_t *);
75
 
extern int sfprov_get_blksused(sfp_mount_t *, uint64_t *);
76
 
extern int sfprov_get_blksavail(sfp_mount_t *, uint64_t *);
77
 
extern int sfprov_get_maxnamesize(sfp_mount_t *, uint32_t *);
78
 
extern int sfprov_get_readonly(sfp_mount_t *, uint32_t *);
 
74
typedef struct sffs_fsinfo {
 
75
        uint64_t blksize;
 
76
        uint64_t blksused;
 
77
        uint64_t blksavail;
 
78
        uint32_t maxnamesize;
 
79
        uint32_t readonly;
 
80
} sffs_fsinfo_t;
 
81
 
 
82
extern int sfprov_get_fsinfo(sfp_mount_t *, sffs_fsinfo_t *);
79
83
 
80
84
/*
81
85
 * File operations: open/close/read/write/etc.
83
87
 * open/create can return any relevant errno, however ENOENT
84
88
 * generally means that the host file didn't exist.
85
89
 */
 
90
typedef struct sffs_stat {
 
91
        mode_t          sf_mode;
 
92
        off_t           sf_size;
 
93
        off_t           sf_alloc;
 
94
        timestruc_t     sf_atime;
 
95
        timestruc_t     sf_mtime;
 
96
        timestruc_t     sf_ctime;
 
97
} sffs_stat_t;
 
98
 
86
99
typedef struct sfp_file sfp_file_t;
87
100
 
88
 
extern int sfprov_create(sfp_mount_t *, char *path, sfp_file_t **fp);
 
101
extern int sfprov_create(sfp_mount_t *, char *path, mode_t mode,
 
102
    sfp_file_t **fp, sffs_stat_t *stat);
89
103
extern int sfprov_open(sfp_mount_t *, char *path, sfp_file_t **fp);
90
104
extern int sfprov_close(sfp_file_t *fp);
91
105
extern int sfprov_read(sfp_file_t *, char * buffer, uint64_t offset,
103
117
extern int sfprov_get_atime(sfp_mount_t *, char *, timestruc_t *);
104
118
extern int sfprov_get_mtime(sfp_mount_t *, char *, timestruc_t *);
105
119
extern int sfprov_get_ctime(sfp_mount_t *, char *, timestruc_t *);
106
 
extern int sfprov_get_attr(sfp_mount_t *, char *, mode_t *, uint64_t *,
107
 
   timestruc_t *, timestruc_t *, timestruc_t *);
 
120
extern int sfprov_get_attr(sfp_mount_t *, char *, sffs_stat_t *);
108
121
extern int sfprov_set_attr(sfp_mount_t *, char *, uint_t, mode_t,
109
122
   timestruc_t, timestruc_t, timestruc_t);
110
123
extern int sfprov_set_size(sfp_mount_t *, char *, uint64_t);
114
127
 * File/Directory operations
115
128
 */
116
129
extern int sfprov_trunc(sfp_mount_t *, char *);
117
 
extern int sfprov_remove(sfp_mount_t *, char *path);
118
 
extern int sfprov_mkdir(sfp_mount_t *, char *path, sfp_file_t **fp);
 
130
extern int sfprov_remove(sfp_mount_t *, char *path, uint_t is_link);
 
131
extern int sfprov_mkdir(sfp_mount_t *, char *path, mode_t mode,
 
132
    sfp_file_t **fp, sffs_stat_t *stat);
119
133
extern int sfprov_rmdir(sfp_mount_t *, char *path);
120
134
extern int sfprov_rename(sfp_mount_t *, char *from, char *to, uint_t is_dir);
121
135
 
 
136
 
 
137
/*
 
138
 * Symbolic link operations
 
139
 */
 
140
extern int sfprov_set_show_symlinks(void);
 
141
extern int sfprov_readlink(sfp_mount_t *, char *path, char *target,
 
142
    size_t tgt_size);
 
143
extern int sfprov_symlink(sfp_mount_t *, char *linkname, char *target,
 
144
    sffs_stat_t *stat);
 
145
 
 
146
 
122
147
/*
123
148
 * Read directory entries.
124
149
 */
125
150
/*
126
 
 * a singly linked list of buffers, each containing an array of dirent's.
 
151
 * a singly linked list of buffers, each containing an array of stat's+dirent's.
127
152
 * sf_len is length of the sf_entries array, in bytes.
128
153
 */
129
154
typedef struct sffs_dirents {
130
155
        struct sffs_dirents     *sf_next;
131
156
        len_t                   sf_len;
132
 
        dirent64_t              sf_entries[1];
 
157
        struct sffs_dirent {
 
158
                sffs_stat_t     sf_stat;
 
159
                dirent64_t      sf_entry;       /* this is variable length */
 
160
        }                       sf_entries[1];
133
161
} sffs_dirents_t;
134
162
 
135
163
#define SFFS_DIRENTS_SIZE       8192
136
164
#define SFFS_DIRENTS_OFF        (offsetof(sffs_dirents_t, sf_entries[0]))
137
 
#define SFFS_STATS_LEN          100
138
 
 
139
 
typedef struct sffs_stat {
140
 
        mode_t          sf_mode;
141
 
        off_t           sf_size;
142
 
        timestruc_t     sf_atime;
143
 
        timestruc_t     sf_mtime;
144
 
        timestruc_t     sf_ctime;
145
 
} sffs_stat_t;
146
 
 
147
 
typedef struct sffs_stats {
148
 
        struct sffs_stats       *sf_next;
149
 
        len_t                   sf_num;
150
 
        sffs_stat_t             sf_stats[SFFS_STATS_LEN];
151
 
} sffs_stats_t;
152
 
 
153
 
extern int sfprov_readdir(sfp_mount_t *mnt, char *path, sffs_dirents_t **dirents,
154
 
    sffs_stats_t **stats);
 
165
 
 
166
extern int sfprov_readdir(sfp_mount_t *mnt, char *path,
 
167
        sffs_dirents_t **dirents);
155
168
 
156
169
#ifdef  __cplusplus
157
170
}