~ubuntu-branches/ubuntu/quantal/zfs-fuse/quantal

« back to all changes in this revision

Viewing changes to src/lib/libzpool/include/sys/zfs_context.h

  • Committer: Bazaar Package Importer
  • Author(s): Mike Hommey, Mike Hommey, Seth Heeren
  • Date: 2010-06-30 18:03:52 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20100630180352-d3jq25ytbcl23q3y
Tags: 0.6.9-1
* New upstream release.

[ Mike Hommey ]
* debian/control:
  - Build depend on libssl-dev and libattr1-dev, now required to build.
  - Build depend on docbook-xml to avoid xsltproc I/O error loading
    docbook DTD.
  - Add suggestions for a NFS server and kpartx.
* debian/man/*, debian/copyright, debian/rules: Remove manual pages, they
  are now shipped upstream.
* debian/copyright: Change download link.
* src/SConstruct:
  - Add an optim option to the build system.
  - Add support for DESTDIR.
  - Force debug=1 to mean optim, no strip, no debug.
  - Use -ffunction-sections, -fdata-sections, and --gc-sections flags to
    reduce the binary sizes.
* src/lib/libumem/SConscript: Cleanup src/lib/libumem when cleaning up
  build directory.
* src/cmd/*/SConscript: Don't link zfs, zpool and zdb against libssl.
* src/lib/libumem/SConscript: Only build static libumem.
* src/lib/libumem/sol_compat.h:
  - Add atomic cas support for sparc.
  - Use atomic functions from libsolcompat in libumem on unsupported
    platforms.
* debian/rules:
  - Set optimization level in build system according to DEB_BUILD_OPTIONS.
  - Build with debug=1 to have unstripped binaries ; dh_strip will do the
    right thing.
  - Don't depend on the local location of the docbook XSLT stylesheets.
    Use the catalogged url in place of the full path.
  - Don't clean src/.sconsign.dblite and src/path.pyc.
  - Set all destination directories when installing with scons.
  - Install bash completion and zfsrc files.
  - Don't use scons cache when building.
* debian/prerm: Remove /var/lib/zfs/zpool.cache in prerm.
* debian/dirs: Create /etc/bash_completion.d.
* debian/watch: Fix watch file.
* debian/rules, debian/control, debian/compat: Switch to dh.
* debian/README.Debian: Update README.Debian.
* debian/zfs-fuse.man.xml: Update zfs-fuse manual page.
* debian/zfs-fuse.init: Start sharing datasets marked as such at daemon
  startup.
* debian/rules, debian/control: Use config.guess and config.sub from
  autotools-dev.

[ Seth Heeren ]
* debian/zfs-fuse.man.xml:
  Added notes on the precedence, zfsrc, commandline, initscript vs.
  /etc/default/zfs-fuse on some systems.
* debian/zfs-fuse.init, debian/zfs-fuse.default: Deprecating DAEMON_OPTS.
* debian/zfs-fuse.init:
  - Removing import -a -f.
  - Removing the now unnecessary 'sleep 2'.
  - Extended shutdown wait to allow for zfs-fuse daemon's own shutdown
    timeouts.
  - Re-ordered dubious PATH setting.
* debian/zfs-fuse.init: Move existing zpool.cache to new location if
  possible.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 * CDDL HEADER END
20
20
 */
21
21
/*
22
 
 * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 
22
 * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
23
23
 * Use is subject to license terms.
24
24
 */
25
25
 
59
59
#include <atomic.h>
60
60
#include <dirent.h>
61
61
#include <time.h>
 
62
// #include <libsysevent.h>
62
63
#include <sys/note.h>
63
64
#include <sys/types.h>
64
65
#include <sys/cred.h>
73
74
#include <sys/kstat.h>
74
75
#include <sys/u8_textprep.h>
75
76
#include <sys/sysevent/eventdefs.h>
 
77
// #include <sys/sysevent/dev.h>
 
78
#include <sys/sunddi.h>
76
79
 
77
80
/*
78
81
 * Debugging
105
108
 
106
109
#define fm_panic        panic
107
110
 
108
 
#define ASSERT_FAIL(EX) \
109
 
        do { \
110
 
                fprintf(stderr, __FILE__ ":%i: %s: Assertion `" #EX "` failed.\n", __LINE__, __PRETTY_FUNCTION__); \
111
 
                abort(); \
112
 
        } while(0)
113
 
 
114
 
#define VERIFY(EX) do { if(!(EX)) ASSERT_FAIL(EX); } while(0)
115
 
 
116
 
#define ASSERT  assert
 
111
extern int aok;
 
112
 
 
113
/* This definition is copied from assert.h. */
 
114
#if defined(__STDC__)
 
115
// we don't seem to have this __assert_c99 macro in linux...
 
116
#if 0 // __STDC_VERSION__ - 0 >= 199901L
 
117
#define zverify(EX) (void)((EX) || (aok) || \
 
118
        (__assert_c99(#EX, __FILE__, __LINE__, __func__), 0))
 
119
#else
 
120
#define zverify(EX) (void)((EX) || (aok) || \
 
121
        (__assert(#EX, __FILE__, __LINE__), 0))
 
122
#endif /* __STDC_VERSION__ - 0 >= 199901L */
 
123
#else
 
124
#define zverify(EX) (void)((EX) || (aok) || \
 
125
        (_assert("EX", __FILE__, __LINE__), 0))
 
126
#endif  /* __STDC__ */
 
127
 
 
128
 
 
129
#define VERIFY  zverify
 
130
#if DEBUG
 
131
#define ASSERT  zverify
 
132
#undef  assert
 
133
#define assert  zverify
 
134
#else
 
135
#define ASSERT(x)  ((void)0)
 
136
#undef assert
 
137
#define assert(x)  ((void)0)
 
138
#endif
117
139
 
118
140
extern void __assert(const char *, const char *, int);
119
141
 
124
146
#define VERIFY3_IMPL(LEFT, OP, RIGHT, TYPE) do { \
125
147
        const TYPE __left = (TYPE)(LEFT); \
126
148
        const TYPE __right = (TYPE)(RIGHT); \
127
 
        if (!(__left OP __right)) { \
 
149
        if (!(__left OP __right) && (!aok)) { \
128
150
                char *__buf = alloca(256); \
129
151
                (void) snprintf(__buf, 256, "%s %s %s (0x%llx %s 0x%llx)", \
130
152
                        #LEFT, #OP, #RIGHT, \
218
240
extern void mutex_exit(kmutex_t *mp);
219
241
extern int mutex_tryenter(kmutex_t *mp);
220
242
extern void *mutex_owner(kmutex_t *mp);
 
243
extern int _mutex_held(pthread_mutex_t *a);
221
244
 
222
245
/*
223
246
 * RW locks
321
344
extern void     taskq_wait(taskq_t *);
322
345
extern int      taskq_member(taskq_t *, kthread_t *);
323
346
extern void     system_taskq_init(void);
 
347
extern void     system_taskq_fini(void);
324
348
 
325
349
#define XVA_MAPSIZE     3
326
350
#define XVA_MAGIC       0x78766174
396
420
 
397
421
#define CRCREAT         0
398
422
 
 
423
extern int fop_getattr(vnode_t *vp, vattr_t *vap);
 
424
 
399
425
#define VOP_CLOSE(vp, f, c, o, cr, ct)  0
400
426
#define VOP_PUTPAGE(vp, of, sz, fl, cr, ct)     0
401
 
#define VOP_GETATTR(vp, vap, fl, cr, ct)  ((vap)->va_size = (vp)->v_size, 0)
 
427
#define VOP_GETATTR(vp, vap, fl, cr, ct)  fop_getattr((vp), (vap));
402
428
 
403
429
#define VOP_FSYNC(vp, f, cr, ct)        fsync((vp)->v_fd)
404
430
 
424
450
 * Random stuff
425
451
 */
426
452
#define lbolt   (gethrtime() >> 23)
 
453
#define ddi_get_lbolt() (lbolt)
427
454
#define lbolt64 (gethrtime() >> 23)
428
455
#define hz      119     /* frequency when using gethrtime() >> 23 for lbolt */
429
456
 
430
457
extern void delay(clock_t ticks);
431
458
 
432
459
#define gethrestime_sec() time(NULL)
 
460
#define gethrestime(t) \
 
461
        do {\
 
462
                (t)->tv_sec = gethrestime_sec();\
 
463
                (t)->tv_nsec = 0;\
 
464
        } while (0);
433
465
 
434
466
#define max_ncpus       64
435
467
 
480
512
#define zone_dataset_visible(x, y)      (1)
481
513
#define INGLOBALZONE(z)                 (1)
482
514
 
 
515
extern char *kmem_asprintf(const char *fmt, ...);
 
516
#define strfree(str) kmem_free((str), strlen(str)+1)
 
517
 
483
518
/*
484
519
 * Hostname information
485
520
 */
533
568
ksiddomain_t *ksid_lookupdomain(const char *);
534
569
void ksiddomain_rele(ksiddomain_t *);
535
570
 
 
571
#define DDI_SLEEP       KM_SLEEP
 
572
#define ddi_log_sysevent(_a, _b, _c, _d, _e, _f, _g) \
 
573
        sysevent_post_event(_c, _d, _b, "libzpool", _e, _f)
 
574
 
536
575
#ifdef  __cplusplus
537
576
}
538
577
#endif