~ubuntu-branches/ubuntu/utopic/dovecot/utopic-proposed

« back to all changes in this revision

Viewing changes to src/lib-fs/fs-api-private.h

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-01-08 09:35:49 UTC
  • mfrom: (4.1.35 sid)
  • Revision ID: package-import@ubuntu.com-20140108093549-i72o93pux8p0dlaf
Tags: 1:2.2.9-1ubuntu1
* Merge from Debian unstable, remaining changes:
  + Add mail-stack-delivery package:
    - Update d/rules
    - d/control: convert existing dovecot-postfix package to a dummy
      package and add new mail-stack-delivery package.
    - Update maintainer scripts.
    - Rename d/dovecot-postfix.* to debian/mail-stack-delivery.*
    - d/mail-stack-delivery.preinst: Move previously installed backups and
      config files to a new package namespace.
    - d/mail-stack-delivery.prerm: Added to handle downgrades.
  + Use Snakeoil SSL certificates by default:
    - d/control: Depend on ssl-cert.
    - d/dovecot-core.postinst: Relax grep for SSL_* a bit.
  + Add autopkgtest to debian/tests/*.
  + Add ufw integration:
    - d/dovecot-core.ufw.profile: new ufw profile.
    - d/rules: install profile in dovecot-core.
    - d/control: dovecot-core - suggest ufw.
  + d/dovecot-core.dirs: Added usr/share/doc/dovecot-core
  + Add apport hook:
    - d/rules, d/source_dovecot.py
  + Add upstart job:
    - d/rules, d/dovecot-core.dovecot.upstart, d/control,
      d/dovecot-core.dirs, dovecot-imapd.{postrm, postinst, prerm},
      d/dovecot-pop3d.{postinst, postrm, prerm}.
      d/mail-stack-deliver.postinst: Convert init script to upstart.
  + Use the autotools-dev dh addon to update config.guess/config.sub for
    arm64.
* Dropped changes, included in Debian:
  - Update Dovecot name to reflect distribution in login greeting.
  - Update Drac plugin for >= 2.0.0 support.
* d/control: Drop dovecot-postfix package as its no longer required.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
#include "fs-api.h"
5
5
 
6
6
struct fs_vfuncs {
7
 
        struct fs *(*init)(const char *args, const struct fs_settings *set);
 
7
        struct fs *(*alloc)(void);
 
8
        int (*init)(struct fs *fs, const char *args,
 
9
                    const struct fs_settings *set);
8
10
        void (*deinit)(struct fs *fs);
9
11
 
10
 
        int (*open)(struct fs *fs, const char *path, enum fs_open_mode mode,
11
 
                    enum fs_open_flags flags, struct fs_file **file_r);
12
 
        void (*close)(struct fs_file *file);
13
 
 
 
12
        enum fs_properties (*get_properties)(struct fs *fs);
 
13
 
 
14
        struct fs_file *(*file_init)(struct fs *fs, const char *path,
 
15
                                     enum fs_open_mode mode,
 
16
                                     enum fs_open_flags flags);
 
17
        void (*file_deinit)(struct fs_file *file);
 
18
        void (*file_close)(struct fs_file *file);
 
19
        const char *(*get_path)(struct fs_file *file);
 
20
 
 
21
        void (*set_async_callback)(struct fs_file *file,
 
22
                                   fs_file_async_callback_t *callback,
 
23
                                   void *context);
 
24
        int (*wait_async)(struct fs *fs);
 
25
 
 
26
        void (*set_metadata)(struct fs_file *file, const char *key,
 
27
                             const char *value);
 
28
        int (*get_metadata)(struct fs_file *file,
 
29
                            const ARRAY_TYPE(fs_metadata) **metadata_r);
 
30
 
 
31
        bool (*prefetch)(struct fs_file *file, uoff_t length);
14
32
        ssize_t (*read)(struct fs_file *file, void *buf, size_t size);
15
33
        struct istream *(*read_stream)(struct fs_file *file,
16
34
                                       size_t max_buffer_size);
22
40
        int (*lock)(struct fs_file *file, unsigned int secs,
23
41
                    struct fs_lock **lock_r);
24
42
        void (*unlock)(struct fs_lock *lock);
25
 
        int (*fdatasync)(struct fs_file *file);
26
 
 
27
 
        int (*exists)(struct fs *fs, const char *path);
28
 
        int (*stat)(struct fs *fs, const char *path, struct stat *st_r);
29
 
        int (*link)(struct fs *fs, const char *src, const char *dest);
30
 
        int (*rename)(struct fs *fs, const char *src, const char *dest);
31
 
        int (*unlink)(struct fs *fs, const char *path);
32
 
        int (*rmdir)(struct fs *fs, const char *path);
 
43
 
 
44
        int (*exists)(struct fs_file *file);
 
45
        int (*stat)(struct fs_file *file, struct stat *st_r);
 
46
        int (*copy)(struct fs_file *src, struct fs_file *dest);
 
47
        int (*rename)(struct fs_file *src, struct fs_file *dest);
 
48
        int (*delete_file)(struct fs_file *file);
 
49
 
 
50
        struct fs_iter *(*iter_init)(struct fs *fs, const char *path,
 
51
                                     enum fs_iter_flags flags);
 
52
        const char *(*iter_next)(struct fs_iter *iter);
 
53
        int (*iter_deinit)(struct fs_iter *iter);
33
54
};
34
55
 
35
56
struct fs {
 
57
        struct fs *parent; /* for wrapper filesystems */
36
58
        const char *name;
37
59
        struct fs_vfuncs v;
 
60
        char *temp_path_prefix;
38
61
 
39
62
        struct fs_settings set;
40
63
        string_t *last_error;
46
69
        struct fs *fs;
47
70
        struct ostream *output;
48
71
        char *path;
 
72
        enum fs_open_flags flags;
 
73
 
 
74
        struct istream *seekable_input;
 
75
        struct istream *pending_read_input;
 
76
        bool write_pending;
 
77
 
 
78
        const struct hash_method *write_digest_method;
 
79
        void *write_digest;
 
80
 
 
81
        pool_t metadata_pool;
 
82
        ARRAY_TYPE(fs_metadata) metadata;
 
83
 
 
84
        struct fs_file *copy_src;
 
85
        struct istream *copy_input;
 
86
        struct ostream *copy_output;
49
87
};
50
88
 
51
89
struct fs_lock {
52
90
        struct fs_file *file;
53
91
};
54
92
 
55
 
extern struct fs fs_class_posix;
56
 
extern struct fs fs_class_sis;
57
 
extern struct fs fs_class_sis_queue;
 
93
struct fs_iter {
 
94
        struct fs *fs;
 
95
        enum fs_iter_flags flags;
 
96
 
 
97
        bool async_have_more;
 
98
        fs_file_async_callback_t *async_callback;
 
99
        void *async_context;
 
100
};
 
101
 
 
102
extern const struct fs fs_class_posix;
 
103
extern const struct fs fs_class_metawrap;
 
104
extern const struct fs fs_class_sis;
 
105
extern const struct fs fs_class_sis_queue;
58
106
 
59
107
void fs_set_error(struct fs *fs, const char *fmt, ...) ATTR_FORMAT(2, 3);
60
108
void fs_set_critical(struct fs *fs, const char *fmt, ...) ATTR_FORMAT(2, 3);
61
109
 
 
110
void fs_set_error_async(struct fs *fs);
 
111
 
 
112
ssize_t fs_read_via_stream(struct fs_file *file, void *buf, size_t size);
 
113
int fs_write_via_stream(struct fs_file *file, const void *data, size_t size);
 
114
void fs_metadata_init(struct fs_file *file);
 
115
void fs_default_set_metadata(struct fs_file *file,
 
116
                             const char *key, const char *value);
 
117
int fs_default_copy(struct fs_file *src, struct fs_file *dest);
 
118
 
62
119
#endif