summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--api/src/gfapi-messages.h83
-rw-r--r--api/src/glfs-handles.h290
-rw-r--r--api/src/glfs-internal.h772
-rw-r--r--api/src/glfs-mem-types.h30
-rw-r--r--api/src/glfs.h567
-rw-r--r--cli/src/cli-cmd.h151
-rw-r--r--cli/src/cli-mem-types.h20
-rw-r--r--cli/src/cli-quotad-client.h16
-rw-r--r--cli/src/cli.h527
-rw-r--r--geo-replication/src/procdiggy.h9
-rw-r--r--glusterfsd/src/glusterfsd-mem-types.h14
-rw-r--r--glusterfsd/src/glusterfsd-messages.h54
-rw-r--r--glusterfsd/src/glusterfsd.h205
-rw-r--r--libglusterfs/src/atomic.h525
-rw-r--r--libglusterfs/src/byte-order.h376
-rw-r--r--libglusterfs/src/call-stub.h958
-rw-r--r--libglusterfs/src/changelog.h101
-rw-r--r--libglusterfs/src/checksum.h6
-rw-r--r--libglusterfs/src/circ-buff.h45
-rw-r--r--libglusterfs/src/client_t.h118
-rw-r--r--libglusterfs/src/cluster-syncop.h276
-rw-r--r--libglusterfs/src/common-utils.h1323
-rw-r--r--libglusterfs/src/compat-errno.h361
-rw-r--r--libglusterfs/src/compat-uuid.h28
-rw-r--r--libglusterfs/src/compat.h300
-rw-r--r--libglusterfs/src/compound-fop-utils.h21
-rw-r--r--libglusterfs/src/daemon.h6
-rw-r--r--libglusterfs/src/default-args.h485
-rw-r--r--libglusterfs/src/defaults.h1692
-rw-r--r--libglusterfs/src/dict.h573
-rw-r--r--libglusterfs/src/event-history.h19
-rw-r--r--libglusterfs/src/events.h21
-rw-r--r--libglusterfs/src/fd-lk.h38
-rw-r--r--libglusterfs/src/fd.h142
-rw-r--r--libglusterfs/src/gf-dirent.h69
-rw-r--r--libglusterfs/src/gf-event.h161
-rw-r--r--libglusterfs/src/gfdb/gfdb_data_store.h230
-rw-r--r--libglusterfs/src/gfdb/gfdb_data_store_helper.h73
-rw-r--r--libglusterfs/src/gfdb/gfdb_data_store_types.h554
-rw-r--r--libglusterfs/src/gfdb/gfdb_mem-types.h7
-rw-r--r--libglusterfs/src/gfdb/gfdb_sqlite3.h423
-rw-r--r--libglusterfs/src/gfdb/gfdb_sqlite3_helper.h32
-rw-r--r--libglusterfs/src/gidcache.h41
-rw-r--r--libglusterfs/src/glfs-message-id.h125
-rw-r--r--libglusterfs/src/globals.h129
-rw-r--r--libglusterfs/src/glusterfs-acl.h150
-rw-r--r--libglusterfs/src/glusterfs.h867
-rw-r--r--libglusterfs/src/graph-utils.h12
-rw-r--r--libglusterfs/src/hashfn.h9
-rw-r--r--libglusterfs/src/iatt.h632
-rw-r--r--libglusterfs/src/inode.h251
-rw-r--r--libglusterfs/src/iobuf.h209
-rw-r--r--libglusterfs/src/latency.h8
-rw-r--r--libglusterfs/src/libglusterfs-messages.h303
-rw-r--r--libglusterfs/src/list.h276
-rw-r--r--libglusterfs/src/lkowner.h88
-rw-r--r--libglusterfs/src/locking.h49
-rw-r--r--libglusterfs/src/logging.h520
-rw-r--r--libglusterfs/src/mem-pool.h316
-rw-r--r--libglusterfs/src/mem-types.h331
-rw-r--r--libglusterfs/src/monitoring.h2
-rw-r--r--libglusterfs/src/options.h487
-rw-r--r--libglusterfs/src/parse-utils.h20
-rw-r--r--libglusterfs/src/quota-common-utils.h44
-rw-r--r--libglusterfs/src/rbthash.h62
-rw-r--r--libglusterfs/src/refcount.h28
-rw-r--r--libglusterfs/src/rot-buffs.h122
-rw-r--r--libglusterfs/src/run.h55
-rw-r--r--libglusterfs/src/stack.h833
-rw-r--r--libglusterfs/src/statedump.h133
-rw-r--r--libglusterfs/src/store.h78
-rw-r--r--libglusterfs/src/strfd.h22
-rw-r--r--libglusterfs/src/syncop-utils.h49
-rw-r--r--libglusterfs/src/syncop.h913
-rw-r--r--libglusterfs/src/syscall.h121
-rw-r--r--libglusterfs/src/template-component-messages.h6
-rw-r--r--libglusterfs/src/throttle-tbf.h42
-rw-r--r--libglusterfs/src/tier-ctr-interface.h12
-rw-r--r--libglusterfs/src/timer.h43
-rw-r--r--libglusterfs/src/timespec.h14
-rw-r--r--libglusterfs/src/trie.h34
-rw-r--r--libglusterfs/src/unittest/unittest.h16
-rw-r--r--libglusterfs/src/upcall-utils.h110
-rw-r--r--libglusterfs/src/xlator.h1799
-rw-r--r--rpc/rpc-lib/src/protocol-common.h567
-rw-r--r--rpc/rpc-lib/src/rpc-clnt-ping.h5
-rw-r--r--rpc/rpc-lib/src/rpc-clnt.h277
-rw-r--r--rpc/rpc-lib/src/rpc-drc.h96
-rw-r--r--rpc/rpc-lib/src/rpc-lib-messages.h23
-rw-r--r--rpc/rpc-lib/src/rpc-transport.h313
-rw-r--r--rpc/rpc-lib/src/rpcsvc-common.h119
-rw-r--r--rpc/rpc-lib/src/rpcsvc.h734
-rw-r--r--rpc/rpc-lib/src/xdr-common.h41
-rw-r--r--rpc/rpc-lib/src/xdr-rpc.h86
-rw-r--r--rpc/rpc-lib/src/xdr-rpcclnt.h21
-rw-r--r--rpc/rpc-transport/rdma/src/name.h19
-rw-r--r--rpc/rpc-transport/rdma/src/rdma.h506
-rw-r--r--rpc/rpc-transport/rdma/src/rpc-trans-rdma-messages.h119
-rw-r--r--rpc/rpc-transport/socket/src/name.h20
-rw-r--r--rpc/rpc-transport/socket/src/socket-mem-types.h8
-rw-r--r--rpc/rpc-transport/socket/src/socket.h385
-rw-r--r--rpc/xdr/src/glusterfs3.h1408
-rw-r--r--rpc/xdr/src/msg-nfs3.h134
-rw-r--r--rpc/xdr/src/xdr-generic.h31
-rw-r--r--rpc/xdr/src/xdr-nfs3.h1431
-rw-r--r--tests/basic/logchecks-messages.h84
-rw-r--r--tests/utils/changelog/changelog.h107
-rw-r--r--xlators/cluster/afr/src/afr-dir-read.h21
-rw-r--r--xlators/cluster/afr/src/afr-dir-write.h33
-rw-r--r--xlators/cluster/afr/src/afr-inode-read.h29
-rw-r--r--xlators/cluster/afr/src/afr-inode-write.h78
-rw-r--r--xlators/cluster/afr/src/afr-mem-types.h68
-rw-r--r--xlators/cluster/afr/src/afr-messages.h66
-rw-r--r--xlators/cluster/afr/src/afr-self-heal.h444
-rw-r--r--xlators/cluster/afr/src/afr-self-heald.h85
-rw-r--r--xlators/cluster/afr/src/afr-transaction.h50
-rw-r--r--xlators/cluster/afr/src/afr.h1755
-rw-r--r--xlators/cluster/dht/src/dht-common.h2215
-rw-r--r--xlators/cluster/dht/src/dht-lock.h55
-rw-r--r--xlators/cluster/dht/src/dht-mem-types.h53
-rw-r--r--xlators/cluster/dht/src/dht-messages.h189
-rw-r--r--xlators/cluster/dht/src/tier-common.h59
-rw-r--r--xlators/cluster/dht/src/tier.h102
-rw-r--r--xlators/cluster/ec/src/ec-code-c.h13
-rw-r--r--xlators/cluster/ec/src/ec-code-intel.h167
-rw-r--r--xlators/cluster/ec/src/ec-combine.h38
-rw-r--r--xlators/cluster/ec/src/ec-common.h239
-rw-r--r--xlators/cluster/ec/src/ec-data.h29
-rw-r--r--xlators/cluster/ec/src/ec-fops.h424
-rw-r--r--xlators/cluster/ec/src/ec-galois.h18
-rw-r--r--xlators/cluster/ec/src/ec-heald.h4
-rw-r--r--xlators/cluster/ec/src/ec-helpers.h234
-rw-r--r--xlators/cluster/ec/src/ec-mem-types.h3
-rw-r--r--xlators/cluster/ec/src/ec-messages.h111
-rw-r--r--xlators/cluster/ec/src/ec-method.h5
-rw-r--r--xlators/cluster/ec/src/ec-types.h773
-rw-r--r--xlators/cluster/ec/src/ec.h16
-rw-r--r--xlators/cluster/stripe/src/stripe-mem-types.h24
-rw-r--r--xlators/cluster/stripe/src/stripe.h402
-rw-r--r--xlators/debug/delay-gen/src/delay-gen-mem-types.h5
-rw-r--r--xlators/debug/delay-gen/src/delay-gen.h9
-rw-r--r--xlators/debug/error-gen/src/error-gen-mem-types.h4
-rw-r--r--xlators/debug/error-gen/src/error-gen.h34
-rw-r--r--xlators/debug/io-stats/src/io-stats-mem-types.h15
-rw-r--r--xlators/debug/trace/src/trace-mem-types.h5
-rw-r--r--xlators/debug/trace/src/trace.h49
-rw-r--r--xlators/encryption/crypt/src/crypt-common.h120
-rw-r--r--xlators/encryption/crypt/src/crypt-mem-types.h26
-rw-r--r--xlators/encryption/crypt/src/crypt.h1170
-rw-r--r--xlators/encryption/crypt/src/metadata.h53
-rw-r--r--xlators/encryption/rot-13/src/rot-13.h4
-rw-r--r--xlators/experimental/fdl/src/fdl.h18
-rw-r--r--xlators/experimental/jbr-client/src/jbr-messages.h15
-rw-r--r--xlators/experimental/jbr-client/src/jbrc.h14
-rw-r--r--xlators/experimental/jbr-server/src/jbr-internal.h147
-rw-r--r--xlators/features/arbiter/src/arbiter-mem-types.h4
-rw-r--r--xlators/features/arbiter/src/arbiter.h2
-rw-r--r--xlators/features/barrier/src/barrier-mem-types.h4
-rw-r--r--xlators/features/barrier/src/barrier.h122
-rw-r--r--xlators/features/bit-rot/src/bitd/bit-rot-bitd-messages.h82
-rw-r--r--xlators/features/bit-rot/src/bitd/bit-rot-scrub-status.h26
-rw-r--r--xlators/features/bit-rot/src/bitd/bit-rot-scrub.h31
-rw-r--r--xlators/features/bit-rot/src/bitd/bit-rot-ssm.h25
-rw-r--r--xlators/features/bit-rot/src/bitd/bit-rot.h313
-rw-r--r--xlators/features/bit-rot/src/stub/bit-rot-common.h179
-rw-r--r--xlators/features/bit-rot/src/stub/bit-rot-object-version.h12
-rw-r--r--xlators/features/bit-rot/src/stub/bit-rot-stub-mem-types.h32
-rw-r--r--xlators/features/bit-rot/src/stub/bit-rot-stub-messages.h52
-rw-r--r--xlators/features/bit-rot/src/stub/bit-rot-stub.h577
-rw-r--r--xlators/features/changelog/lib/src/changelog-lib-messages.h55
-rw-r--r--xlators/features/changelog/lib/src/gf-changelog-helpers.h239
-rw-r--r--xlators/features/changelog/lib/src/gf-changelog-journal.h94
-rw-r--r--xlators/features/changelog/lib/src/gf-changelog-rpc.h8
-rw-r--r--xlators/features/changelog/src/changelog-encoders.h40
-rw-r--r--xlators/features/changelog/src/changelog-ev-handle.h90
-rw-r--r--xlators/features/changelog/src/changelog-helpers.h876
-rw-r--r--xlators/features/changelog/src/changelog-mem-types.h30
-rw-r--r--xlators/features/changelog/src/changelog-messages.h88
-rw-r--r--xlators/features/changelog/src/changelog-misc.h157
-rw-r--r--xlators/features/changelog/src/changelog-rpc-common.h55
-rw-r--r--xlators/features/changelog/src/changelog-rpc.h8
-rw-r--r--xlators/features/changelog/src/changelog-rt.h10
-rw-r--r--xlators/features/changetimerecorder/src/ctr-helper.h1189
-rw-r--r--xlators/features/changetimerecorder/src/ctr-messages.h93
-rw-r--r--xlators/features/changetimerecorder/src/ctr-xlator-ctx.h68
-rw-r--r--xlators/features/changetimerecorder/src/ctr_mem_types.h10
-rw-r--r--xlators/features/cloudsync/src/cloudsync-common.h116
-rw-r--r--xlators/features/cloudsync/src/cloudsync-mem-types.h10
-rw-r--r--xlators/features/cloudsync/src/cloudsync-messages.h3
-rw-r--r--xlators/features/cloudsync/src/cloudsync-plugins/src/cloudsyncs3/src/libcloudsyncs3-mem-types.h6
-rw-r--r--xlators/features/cloudsync/src/cloudsync-plugins/src/cloudsyncs3/src/libcloudsyncs3.h21
-rw-r--r--xlators/features/cloudsync/src/cloudsync.h77
-rw-r--r--xlators/features/compress/src/cdc-mem-types.h8
-rw-r--r--xlators/features/compress/src/cdc.h74
-rw-r--r--xlators/features/gfid-access/src/gfid-access-mem-types.h7
-rw-r--r--xlators/features/gfid-access/src/gfid-access.h122
-rw-r--r--xlators/features/glupy/src/glupy.h62
-rw-r--r--xlators/features/index/src/index-mem-types.h10
-rw-r--r--xlators/features/index/src/index-messages.h18
-rw-r--r--xlators/features/index/src/index.h94
-rw-r--r--xlators/features/leases/src/leases-mem-types.h20
-rw-r--r--xlators/features/leases/src/leases-messages.h19
-rw-r--r--xlators/features/leases/src/leases.h231
-rw-r--r--xlators/features/locks/src/clear.h58
-rw-r--r--xlators/features/locks/src/common.h174
-rw-r--r--xlators/features/locks/src/locks-mem-types.h23
-rw-r--r--xlators/features/locks/src/locks.h297
-rw-r--r--xlators/features/locks/src/pl-messages.h7
-rw-r--r--xlators/features/marker/src/marker-common.h4
-rw-r--r--xlators/features/marker/src/marker-mem-types.h20
-rw-r--r--xlators/features/marker/src/marker-quota-helper.h76
-rw-r--r--xlators/features/marker/src/marker-quota.h203
-rw-r--r--xlators/features/marker/src/marker.h219
-rw-r--r--xlators/features/namespace/src/namespace.h6
-rw-r--r--xlators/features/quiesce/src/quiesce-mem-types.h6
-rw-r--r--xlators/features/quiesce/src/quiesce-messages.h5
-rw-r--r--xlators/features/quiesce/src/quiesce.h70
-rw-r--r--xlators/features/quota/src/quota-mem-types.h25
-rw-r--r--xlators/features/quota/src/quota-messages.h40
-rw-r--r--xlators/features/quota/src/quota.h389
-rw-r--r--xlators/features/quota/src/quotad-aggregator.h23
-rw-r--r--xlators/features/quota/src/quotad-helpers.h4
-rw-r--r--xlators/features/read-only/src/read-only-common.h108
-rw-r--r--xlators/features/read-only/src/read-only-mem-types.h4
-rw-r--r--xlators/features/read-only/src/read-only.h28
-rw-r--r--xlators/features/read-only/src/worm-helper.h43
-rw-r--r--xlators/features/sdfs/src/sdfs-messages.h14
-rw-r--r--xlators/features/sdfs/src/sdfs.h48
-rw-r--r--xlators/features/selinux/src/selinux-mem-types.h5
-rw-r--r--xlators/features/selinux/src/selinux-messages.h11
-rw-r--r--xlators/features/selinux/src/selinux.h2
-rw-r--r--xlators/features/shard/src/shard-mem-types.h14
-rw-r--r--xlators/features/shard/src/shard-messages.h36
-rw-r--r--xlators/features/shard/src/shard.h572
-rw-r--r--xlators/features/snapview-client/src/snapview-client-mem-types.h10
-rw-r--r--xlators/features/snapview-client/src/snapview-client.h139
-rw-r--r--xlators/features/snapview-server/src/snapview-server-mem-types.h13
-rw-r--r--xlators/features/snapview-server/src/snapview-server.h279
-rw-r--r--xlators/features/thin-arbiter/src/thin-arbiter-mem-types.h6
-rw-r--r--xlators/features/thin-arbiter/src/thin-arbiter-messages.h4
-rw-r--r--xlators/features/thin-arbiter/src/thin-arbiter.h54
-rw-r--r--xlators/features/trash/src/trash-mem-types.h11
-rw-r--r--xlators/features/trash/src/trash.h101
-rw-r--r--xlators/features/upcall/src/upcall-cache-invalidation.h6
-rw-r--r--xlators/features/upcall/src/upcall-mem-types.h11
-rw-r--r--xlators/features/upcall/src/upcall-messages.h7
-rw-r--r--xlators/features/upcall/src/upcall.h214
-rw-r--r--xlators/features/utime/src/utime-helpers.h2
-rw-r--r--xlators/lib/src/libxlator.h98
-rw-r--r--xlators/meta/src/meta-hooks.h4
-rw-r--r--xlators/meta/src/meta-mem-types.h15
-rw-r--r--xlators/meta/src/meta.h179
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-bitd-svc.h16
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-conn-helper.h2
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-conn-mgmt.h34
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-errno.h34
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-geo-rep.h33
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-gfproxyd-svc-helper.h34
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-gfproxyd-svc.h22
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-hooks.h86
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-locks.h36
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-mem-types.h119
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-messages.h892
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-mgmt.h71
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-mountbroker.h37
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-nfs-svc.h6
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-op-sm.h304
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-peer-utils.h66
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-pmap.h47
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-proc-mgmt.h34
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-quota.h4
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-quotad-svc.h10
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-rcu.h4
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-scrub-svc.h22
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-server-quorum.h26
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-shd-svc.h10
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-sm.h240
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-snapd-svc-helper.h16
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-snapd-svc.h20
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-snapshot-utils.h141
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-statedump.h2
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-store.h240
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-svc-helper.h26
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-svc-mgmt.h57
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-syncop.h100
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-tierd-svc-helper.h20
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-tierd-svc.h17
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.h850
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volgen.h325
-rw-r--r--xlators/mgmt/glusterd/src/glusterd.h2030
-rw-r--r--xlators/mount/fuse/src/fuse-bridge.h711
-rw-r--r--xlators/mount/fuse/src/fuse-mem-types.h23
-rw-r--r--xlators/nfs/server/src/acl3.h16
-rw-r--r--xlators/nfs/server/src/auth-cache.h23
-rw-r--r--xlators/nfs/server/src/exports.h68
-rw-r--r--xlators/nfs/server/src/mount3-auth.h28
-rw-r--r--xlators/nfs/server/src/mount3.h198
-rw-r--r--xlators/nfs/server/src/netgroups.h25
-rw-r--r--xlators/nfs/server/src/nfs-common.h43
-rw-r--r--xlators/nfs/server/src/nfs-fops.h296
-rw-r--r--xlators/nfs/server/src/nfs-generics.h144
-rw-r--r--xlators/nfs/server/src/nfs-inodes.h51
-rw-r--r--xlators/nfs/server/src/nfs-mem-types.h76
-rw-r--r--xlators/nfs/server/src/nfs-messages.h281
-rw-r--r--xlators/nfs/server/src/nfs.h167
-rw-r--r--xlators/nfs/server/src/nfs3-fh.h99
-rw-r--r--xlators/nfs/server/src/nfs3-helpers.h278
-rw-r--r--xlators/nfs/server/src/nfs3.h376
-rw-r--r--xlators/nfs/server/src/nlm4.h112
-rw-r--r--xlators/performance/decompounder/src/decompounder-mem-types.h5
-rw-r--r--xlators/performance/decompounder/src/decompounder-messages.h5
-rw-r--r--xlators/performance/decompounder/src/decompounder.h97
-rw-r--r--xlators/performance/io-cache/src/io-cache-messages.h17
-rw-r--r--xlators/performance/io-cache/src/io-cache.h383
-rw-r--r--xlators/performance/io-cache/src/ioc-mem-types.h22
-rw-r--r--xlators/performance/io-threads/src/io-threads-messages.h10
-rw-r--r--xlators/performance/io-threads/src/io-threads.h92
-rw-r--r--xlators/performance/io-threads/src/iot-mem-types.h8
-rw-r--r--xlators/performance/md-cache/src/md-cache-mem-types.h12
-rw-r--r--xlators/performance/md-cache/src/md-cache-messages.h10
-rw-r--r--xlators/performance/nl-cache/src/nl-cache-mem-types.h19
-rw-r--r--xlators/performance/nl-cache/src/nl-cache-messages.h8
-rw-r--r--xlators/performance/nl-cache/src/nl-cache.h162
-rw-r--r--xlators/performance/open-behind/src/open-behind-mem-types.h8
-rw-r--r--xlators/performance/open-behind/src/open-behind-messages.h7
-rw-r--r--xlators/performance/quick-read/src/quick-read-mem-types.h18
-rw-r--r--xlators/performance/quick-read/src/quick-read-messages.h15
-rw-r--r--xlators/performance/quick-read/src/quick-read.h75
-rw-r--r--xlators/performance/read-ahead/src/read-ahead-mem-types.h15
-rw-r--r--xlators/performance/read-ahead/src/read-ahead-messages.h13
-rw-r--r--xlators/performance/read-ahead/src/read-ahead.h168
-rw-r--r--xlators/performance/readdir-ahead/src/readdir-ahead-mem-types.h11
-rw-r--r--xlators/performance/readdir-ahead/src/readdir-ahead-messages.h12
-rw-r--r--xlators/performance/readdir-ahead/src/readdir-ahead.h127
-rw-r--r--xlators/performance/symlink-cache/src/symlink-cache-messages.h11
-rw-r--r--xlators/performance/write-behind/src/write-behind-mem-types.h14
-rw-r--r--xlators/performance/write-behind/src/write-behind-messages.h14
-rw-r--r--xlators/playground/template/src/template.h13
-rw-r--r--xlators/protocol/client/src/client-common.h636
-rw-r--r--xlators/protocol/client/src/client-mem-types.h19
-rw-r--r--xlators/protocol/client/src/client-messages.h96
-rw-r--r--xlators/protocol/client/src/client.h771
-rw-r--r--xlators/protocol/server/src/authenticate.h24
-rw-r--r--xlators/protocol/server/src/server-common.h202
-rw-r--r--xlators/protocol/server/src/server-helpers.h124
-rw-r--r--xlators/protocol/server/src/server-mem-types.h31
-rw-r--r--xlators/protocol/server/src/server-messages.h134
-rw-r--r--xlators/protocol/server/src/server.h377
-rw-r--r--xlators/storage/bd/src/bd-aio.h22
-rw-r--r--xlators/storage/bd/src/bd-mem-types.h15
-rw-r--r--xlators/storage/bd/src/bd.h191
-rw-r--r--xlators/storage/posix/src/posix-aio.h23
-rw-r--r--xlators/storage/posix/src/posix-gfid-path.h12
-rw-r--r--xlators/storage/posix/src/posix-handle.h343
-rw-r--r--xlators/storage/posix/src/posix-inode-handle.h141
-rw-r--r--xlators/storage/posix/src/posix-mem-types.h23
-rw-r--r--xlators/storage/posix/src/posix-messages.h165
-rw-r--r--xlators/storage/posix/src/posix-metadata-disk.h20
-rw-r--r--xlators/storage/posix/src/posix-metadata.h42
-rw-r--r--xlators/storage/posix/src/posix.h788
-rw-r--r--xlators/system/posix-acl/src/posix-acl-mem-types.h11
-rw-r--r--xlators/system/posix-acl/src/posix-acl-messages.h4
-rw-r--r--xlators/system/posix-acl/src/posix-acl-xattr.h11
-rw-r--r--xlators/system/posix-acl/src/posix-acl.h26
364 files changed, 29701 insertions, 31211 deletions
diff --git a/api/src/gfapi-messages.h b/api/src/gfapi-messages.h
index 15f9945c5ed..20418627690 100644
--- a/api/src/gfapi-messages.h
+++ b/api/src/gfapi-messages.h
@@ -23,61 +23,32 @@
* glfs-message-id.h.
*/
-GLFS_MSGID(API,
- API_MSG_MEM_ACCT_INIT_FAILED,
- API_MSG_MASTER_XLATOR_INIT_FAILED,
- API_MSG_GFAPI_XLATOR_INIT_FAILED,
- API_MSG_VOLFILE_OPEN_FAILED,
- API_MSG_VOL_SPEC_FILE_ERROR,
- API_MSG_GLFS_FSOBJ_NULL,
- API_MSG_INVALID_ENTRY,
- API_MSG_FSMUTEX_LOCK_FAILED,
- API_MSG_COND_WAIT_FAILED,
- API_MSG_FSMUTEX_UNLOCK_FAILED,
- API_MSG_INODE_REFRESH_FAILED,
- API_MSG_GRAPH_CONSTRUCT_FAILED,
- API_MSG_API_XLATOR_ERROR,
- API_MSG_XDR_PAYLOAD_FAILED,
- API_MSG_GET_VOLINFO_CBK_FAILED,
- API_MSG_FETCH_VOLUUID_FAILED,
- API_MSG_INSUFF_SIZE,
- API_MSG_FRAME_CREAT_FAILED,
- API_MSG_DICT_SET_FAILED,
- API_MSG_XDR_DECODE_FAILED,
- API_MSG_GET_VOLFILE_FAILED,
- API_MSG_WRONG_OPVERSION,
- API_MSG_DICT_SERIALIZE_FAILED,
- API_MSG_REMOTE_HOST_CONN_FAILED,
- API_MSG_VOLFILE_SERVER_EXHAUST,
- API_MSG_CREATE_RPC_CLIENT_FAILED,
- API_MSG_REG_NOTIFY_FUNC_FAILED,
- API_MSG_REG_CBK_FUNC_FAILED,
- API_MSG_GET_CWD_FAILED,
- API_MSG_FGETXATTR_FAILED,
- API_MSG_LOCKINFO_KEY_MISSING,
- API_MSG_FSETXATTR_FAILED,
- API_MSG_FSYNC_FAILED,
- API_MSG_FDCREATE_FAILED,
- API_MSG_INODE_PATH_FAILED,
- API_MSG_SYNCOP_OPEN_FAILED,
- API_MSG_LOCK_MIGRATE_FAILED,
- API_MSG_OPENFD_SKIPPED,
- API_MSG_FIRST_LOOKUP_GRAPH_FAILED,
- API_MSG_CWD_GRAPH_REF_FAILED,
- API_MSG_SWITCHED_GRAPH,
- API_MSG_XDR_RESPONSE_DECODE_FAILED,
- API_MSG_VOLFILE_INFO,
- API_MSG_VOLFILE_CONNECTING,
- API_MSG_NEW_GRAPH,
- API_MSG_ALLOC_FAILED,
- API_MSG_CREATE_HANDLE_FAILED,
- API_MSG_INODE_LINK_FAILED,
- API_MSG_STATEDUMP_FAILED,
- API_MSG_XREADDIRP_R_FAILED,
- API_MSG_LOCK_INSERT_MERGE_FAILED,
- API_MSG_SETTING_LOCK_TYPE_FAILED,
- API_MSG_INODE_FIND_FAILED,
- API_MSG_FDCTX_SET_FAILED
-);
+GLFS_MSGID(API, API_MSG_MEM_ACCT_INIT_FAILED, API_MSG_MASTER_XLATOR_INIT_FAILED,
+ API_MSG_GFAPI_XLATOR_INIT_FAILED, API_MSG_VOLFILE_OPEN_FAILED,
+ API_MSG_VOL_SPEC_FILE_ERROR, API_MSG_GLFS_FSOBJ_NULL,
+ API_MSG_INVALID_ENTRY, API_MSG_FSMUTEX_LOCK_FAILED,
+ API_MSG_COND_WAIT_FAILED, API_MSG_FSMUTEX_UNLOCK_FAILED,
+ API_MSG_INODE_REFRESH_FAILED, API_MSG_GRAPH_CONSTRUCT_FAILED,
+ API_MSG_API_XLATOR_ERROR, API_MSG_XDR_PAYLOAD_FAILED,
+ API_MSG_GET_VOLINFO_CBK_FAILED, API_MSG_FETCH_VOLUUID_FAILED,
+ API_MSG_INSUFF_SIZE, API_MSG_FRAME_CREAT_FAILED,
+ API_MSG_DICT_SET_FAILED, API_MSG_XDR_DECODE_FAILED,
+ API_MSG_GET_VOLFILE_FAILED, API_MSG_WRONG_OPVERSION,
+ API_MSG_DICT_SERIALIZE_FAILED, API_MSG_REMOTE_HOST_CONN_FAILED,
+ API_MSG_VOLFILE_SERVER_EXHAUST, API_MSG_CREATE_RPC_CLIENT_FAILED,
+ API_MSG_REG_NOTIFY_FUNC_FAILED, API_MSG_REG_CBK_FUNC_FAILED,
+ API_MSG_GET_CWD_FAILED, API_MSG_FGETXATTR_FAILED,
+ API_MSG_LOCKINFO_KEY_MISSING, API_MSG_FSETXATTR_FAILED,
+ API_MSG_FSYNC_FAILED, API_MSG_FDCREATE_FAILED,
+ API_MSG_INODE_PATH_FAILED, API_MSG_SYNCOP_OPEN_FAILED,
+ API_MSG_LOCK_MIGRATE_FAILED, API_MSG_OPENFD_SKIPPED,
+ API_MSG_FIRST_LOOKUP_GRAPH_FAILED, API_MSG_CWD_GRAPH_REF_FAILED,
+ API_MSG_SWITCHED_GRAPH, API_MSG_XDR_RESPONSE_DECODE_FAILED,
+ API_MSG_VOLFILE_INFO, API_MSG_VOLFILE_CONNECTING, API_MSG_NEW_GRAPH,
+ API_MSG_ALLOC_FAILED, API_MSG_CREATE_HANDLE_FAILED,
+ API_MSG_INODE_LINK_FAILED, API_MSG_STATEDUMP_FAILED,
+ API_MSG_XREADDIRP_R_FAILED, API_MSG_LOCK_INSERT_MERGE_FAILED,
+ API_MSG_SETTING_LOCK_TYPE_FAILED, API_MSG_INODE_FIND_FAILED,
+ API_MSG_FDCTX_SET_FAILED);
#endif /* !_GFAPI_MESSAGES_H__ */
diff --git a/api/src/glfs-handles.h b/api/src/glfs-handles.h
index 4b336909b57..97d90a138ac 100644
--- a/api/src/glfs-handles.h
+++ b/api/src/glfs-handles.h
@@ -50,10 +50,10 @@
/* Values for valid flags to be used when using XXXsetattr, to set multiple
attribute values passed via the related stat structure.
*/
-#define GFAPI_SET_ATTR_MODE 0x1
-#define GFAPI_SET_ATTR_UID 0x2
-#define GFAPI_SET_ATTR_GID 0x4
-#define GFAPI_SET_ATTR_SIZE 0x8
+#define GFAPI_SET_ATTR_MODE 0x1
+#define GFAPI_SET_ATTR_UID 0x2
+#define GFAPI_SET_ATTR_GID 0x4
+#define GFAPI_SET_ATTR_SIZE 0x8
#define GFAPI_SET_ATTR_ATIME 0x10
#define GFAPI_SET_ATTR_MTIME 0x20
@@ -62,31 +62,34 @@
#define GFAPI_HANDLE_LENGTH 16
/* These flags should be in sync to the ones defined in upcall.h */
-#define GFAPI_UP_NLINK 0x00000001 /* update nlink */
-#define GFAPI_UP_MODE 0x00000002 /* update mode and ctime */
-#define GFAPI_UP_OWN 0x00000004 /* update mode,uid,gid and ctime */
-#define GFAPI_UP_SIZE 0x00000008 /* update fsize */
-#define GFAPI_UP_TIMES 0x00000010 /* update all times */
-#define GFAPI_UP_ATIME 0x00000020 /* update atime only */
-#define GFAPI_UP_PERM 0x00000040 /* update fields needed for
- permission checking */
-#define GFAPI_UP_RENAME 0x00000080 /* this is a rename op -
- delete the cache entry */
-#define GFAPI_UP_FORGET 0x00000100 /* inode_forget on server side -
- invalidate the cache entry */
-#define GFAPI_UP_PARENT_TIMES 0x00000200 /* update parent dir times */
-
-#define GFAPI_INODE_UPDATE_FLAGS (GFAPI_UP_NLINK | GFAPI_UP_MODE | \
- GFAPI_UP_OWN | GFAPI_UP_SIZE | \
- GFAPI_UP_TIMES | GFAPI_UP_ATIME)
+#define GFAPI_UP_NLINK 0x00000001 /* update nlink */
+#define GFAPI_UP_MODE 0x00000002 /* update mode and ctime */
+#define GFAPI_UP_OWN 0x00000004 /* update mode,uid,gid and ctime */
+#define GFAPI_UP_SIZE 0x00000008 /* update fsize */
+#define GFAPI_UP_TIMES 0x00000010 /* update all times */
+#define GFAPI_UP_ATIME 0x00000020 /* update atime only */
+#define GFAPI_UP_PERM \
+ 0x00000040 /* update fields needed for \
+ permission checking */
+#define GFAPI_UP_RENAME \
+ 0x00000080 /* this is a rename op - \
+ delete the cache entry */
+#define GFAPI_UP_FORGET \
+ 0x00000100 /* inode_forget on server side - \
+ invalidate the cache entry */
+#define GFAPI_UP_PARENT_TIMES 0x00000200 /* update parent dir times */
+
+#define GFAPI_INODE_UPDATE_FLAGS \
+ (GFAPI_UP_NLINK | GFAPI_UP_MODE | GFAPI_UP_OWN | GFAPI_UP_SIZE | \
+ GFAPI_UP_TIMES | GFAPI_UP_ATIME)
/* Portability non glibc c++ build systems */
#ifndef __THROW
-# if defined __cplusplus
-# define __THROW throw ()
-# else
-# define __THROW
-# endif
+#if defined __cplusplus
+#define __THROW throw()
+#else
+#define __THROW
+#endif
#endif
__BEGIN_DECLS
@@ -113,158 +116,150 @@ typedef struct glfs_object glfs_object_t;
struct glfs_upcall_inode;
typedef struct glfs_upcall_inode glfs_upcall_inode_t;
-glfs_object_t*
-glfs_upcall_inode_get_object (glfs_upcall_inode_t *arg) __THROW
- GFAPI_PUBLIC(glfs_upcall_inode_get_object, 3.7.16);
+glfs_object_t *
+glfs_upcall_inode_get_object(glfs_upcall_inode_t *arg) __THROW
+ GFAPI_PUBLIC(glfs_upcall_inode_get_object, 3.7.16);
uint64_t
-glfs_upcall_inode_get_flags (glfs_upcall_inode_t *arg) __THROW
- GFAPI_PUBLIC(glfs_upcall_inode_get_flags, 3.7.16);
+glfs_upcall_inode_get_flags(glfs_upcall_inode_t *arg) __THROW
+ GFAPI_PUBLIC(glfs_upcall_inode_get_flags, 3.7.16);
-struct stat*
-glfs_upcall_inode_get_stat (glfs_upcall_inode_t *arg) __THROW
- GFAPI_PUBLIC(glfs_upcall_inode_get_stat, 3.7.16);
+struct stat *
+glfs_upcall_inode_get_stat(glfs_upcall_inode_t *arg) __THROW
+ GFAPI_PUBLIC(glfs_upcall_inode_get_stat, 3.7.16);
uint64_t
-glfs_upcall_inode_get_expire (glfs_upcall_inode_t *arg) __THROW
- GFAPI_PUBLIC(glfs_upcall_inode_get_expire, 3.7.16);
-
-glfs_object_t*
-glfs_upcall_inode_get_pobject (glfs_upcall_inode_t *arg) __THROW
- GFAPI_PUBLIC(glfs_upcall_inode_get_pobject, 3.7.16);
+glfs_upcall_inode_get_expire(glfs_upcall_inode_t *arg) __THROW
+ GFAPI_PUBLIC(glfs_upcall_inode_get_expire, 3.7.16);
-struct stat*
-glfs_upcall_inode_get_pstat (glfs_upcall_inode_t *arg) __THROW
- GFAPI_PUBLIC(glfs_upcall_inode_get_pstat, 3.7.16);
+glfs_object_t *
+glfs_upcall_inode_get_pobject(glfs_upcall_inode_t *arg) __THROW
+ GFAPI_PUBLIC(glfs_upcall_inode_get_pobject, 3.7.16);
-glfs_object_t*
-glfs_upcall_inode_get_oldpobject (glfs_upcall_inode_t *arg) __THROW
- GFAPI_PUBLIC(glfs_upcall_inode_get_oldpobject, 3.7.16);
+struct stat *
+glfs_upcall_inode_get_pstat(glfs_upcall_inode_t *arg) __THROW
+ GFAPI_PUBLIC(glfs_upcall_inode_get_pstat, 3.7.16);
-struct stat*
-glfs_upcall_inode_get_oldpstat (glfs_upcall_inode_t *arg) __THROW
- GFAPI_PUBLIC(glfs_upcall_inode_get_oldpstat, 3.7.16);
+glfs_object_t *
+glfs_upcall_inode_get_oldpobject(glfs_upcall_inode_t *arg) __THROW
+ GFAPI_PUBLIC(glfs_upcall_inode_get_oldpobject, 3.7.16);
+struct stat *
+glfs_upcall_inode_get_oldpstat(glfs_upcall_inode_t *arg) __THROW
+ GFAPI_PUBLIC(glfs_upcall_inode_get_oldpstat, 3.7.16);
/* Handle based operations */
/* Operations that generate handles */
-glfs_object_t*
-glfs_h_lookupat (glfs_t *fs, glfs_object_t *parent, const char *path,
- struct stat *stat, int follow) __THROW
- GFAPI_PUBLIC(glfs_h_lookupat, 3.7.4);
-
-glfs_object_t*
-glfs_h_creat (glfs_t *fs, glfs_object_t *parent, const char *path,
- int flags, mode_t mode, struct stat *sb) __THROW
- GFAPI_PUBLIC(glfs_h_creat, 3.4.2);
-
-glfs_object_t*
-glfs_h_mkdir (glfs_t *fs, glfs_object_t *parent, const char *path,
- mode_t flags, struct stat *sb) __THROW
- GFAPI_PUBLIC(glfs_h_mkdir, 3.4.2);
-
-glfs_object_t*
-glfs_h_mknod (glfs_t *fs, glfs_object_t *parent, const char *path,
- mode_t mode, dev_t dev, struct stat *sb) __THROW
- GFAPI_PUBLIC(glfs_h_mknod, 3.4.2);
-
-glfs_object_t*
-glfs_h_symlink (glfs_t *fs, glfs_object_t *parent, const char *name,
- const char *data, struct stat *stat) __THROW
- GFAPI_PUBLIC(glfs_h_symlink, 3.4.2);
+glfs_object_t *
+glfs_h_lookupat(glfs_t *fs, glfs_object_t *parent, const char *path,
+ struct stat *stat, int follow) __THROW
+ GFAPI_PUBLIC(glfs_h_lookupat, 3.7.4);
+
+glfs_object_t *
+glfs_h_creat(glfs_t *fs, glfs_object_t *parent, const char *path, int flags,
+ mode_t mode, struct stat *sb) __THROW
+ GFAPI_PUBLIC(glfs_h_creat, 3.4.2);
+
+glfs_object_t *
+glfs_h_mkdir(glfs_t *fs, glfs_object_t *parent, const char *path, mode_t flags,
+ struct stat *sb) __THROW GFAPI_PUBLIC(glfs_h_mkdir, 3.4.2);
+
+glfs_object_t *
+glfs_h_mknod(glfs_t *fs, glfs_object_t *parent, const char *path, mode_t mode,
+ dev_t dev, struct stat *sb) __THROW
+ GFAPI_PUBLIC(glfs_h_mknod, 3.4.2);
+
+glfs_object_t *
+glfs_h_symlink(glfs_t *fs, glfs_object_t *parent, const char *name,
+ const char *data, struct stat *stat) __THROW
+ GFAPI_PUBLIC(glfs_h_symlink, 3.4.2);
/* Operations on the actual objects */
int
-glfs_h_unlink (glfs_t *fs, glfs_object_t *parent, const char *path) __THROW
- GFAPI_PUBLIC(glfs_h_unlink, 3.4.2);
+glfs_h_unlink(glfs_t *fs, glfs_object_t *parent, const char *path) __THROW
+ GFAPI_PUBLIC(glfs_h_unlink, 3.4.2);
int
-glfs_h_close (glfs_object_t *object) __THROW
- GFAPI_PUBLIC(glfs_h_close, 3.4.2);
+glfs_h_close(glfs_object_t *object) __THROW GFAPI_PUBLIC(glfs_h_close, 3.4.2);
int
-glfs_caller_specific_init (void *uid_caller_key, void *gid_caller_key,
- void *future) __THROW
- GFAPI_PUBLIC(glfs_caller_specific_init, 3.5.0);
+glfs_caller_specific_init(void *uid_caller_key, void *gid_caller_key,
+ void *future) __THROW
+ GFAPI_PUBLIC(glfs_caller_specific_init, 3.5.0);
int
-glfs_h_truncate (glfs_t *fs, glfs_object_t *object,
- off_t offset) __THROW
- GFAPI_PUBLIC(glfs_h_truncate, 3.4.2);
+glfs_h_truncate(glfs_t *fs, glfs_object_t *object, off_t offset) __THROW
+ GFAPI_PUBLIC(glfs_h_truncate, 3.4.2);
int
glfs_h_stat(glfs_t *fs, glfs_object_t *object, struct stat *stat) __THROW
- GFAPI_PUBLIC(glfs_h_stat, 3.4.2);
+ GFAPI_PUBLIC(glfs_h_stat, 3.4.2);
int
glfs_h_statfs(glfs_t *fs, glfs_object_t *object, struct statvfs *stat) __THROW
- GFAPI_PUBLIC(glfs_h_statfs, 3.7.0);
+ GFAPI_PUBLIC(glfs_h_statfs, 3.7.0);
int
-glfs_h_getattrs (glfs_t *fs, glfs_object_t *object, struct stat *stat) __THROW
- GFAPI_PUBLIC(glfs_h_getattrs, 3.4.2);
+glfs_h_getattrs(glfs_t *fs, glfs_object_t *object, struct stat *stat) __THROW
+ GFAPI_PUBLIC(glfs_h_getattrs, 3.4.2);
int
-glfs_h_getxattrs (glfs_t *fs, glfs_object_t *object, const char *name,
- void *value, size_t size) __THROW
- GFAPI_PUBLIC(glfs_h_getxattrs, 3.5.1);
+glfs_h_getxattrs(glfs_t *fs, glfs_object_t *object, const char *name,
+ void *value, size_t size) __THROW
+ GFAPI_PUBLIC(glfs_h_getxattrs, 3.5.1);
int
-glfs_h_setattrs (glfs_t *fs, glfs_object_t *object, struct stat *sb,
- int valid) __THROW
- GFAPI_PUBLIC(glfs_h_setattrs, 3.4.2);
+glfs_h_setattrs(glfs_t *fs, glfs_object_t *object, struct stat *sb,
+ int valid) __THROW GFAPI_PUBLIC(glfs_h_setattrs, 3.4.2);
int
-glfs_h_setxattrs (glfs_t *fs, glfs_object_t *object, const char *name,
- const void *value, size_t size, int flags) __THROW
- GFAPI_PUBLIC(glfs_h_setxattrs, 3.5.0);
+glfs_h_setxattrs(glfs_t *fs, glfs_object_t *object, const char *name,
+ const void *value, size_t size, int flags) __THROW
+ GFAPI_PUBLIC(glfs_h_setxattrs, 3.5.0);
int
-glfs_h_readlink (glfs_t *fs, glfs_object_t *object, char *buf,
- size_t bufsiz) __THROW
- GFAPI_PUBLIC(glfs_h_readlink, 3.4.2);
+glfs_h_readlink(glfs_t *fs, glfs_object_t *object, char *buf,
+ size_t bufsiz) __THROW GFAPI_PUBLIC(glfs_h_readlink, 3.4.2);
int
-glfs_h_link (glfs_t *fs, glfs_object_t *linktgt, glfs_object_t *parent,
- const char *name) __THROW
- GFAPI_PUBLIC(glfs_h_link, 3.4.2);
+glfs_h_link(glfs_t *fs, glfs_object_t *linktgt, glfs_object_t *parent,
+ const char *name) __THROW GFAPI_PUBLIC(glfs_h_link, 3.4.2);
int
-glfs_h_rename (glfs_t *fs, glfs_object_t *olddir, const char *oldname,
- glfs_object_t *newdir, const char *newname) __THROW
- GFAPI_PUBLIC(glfs_h_rename, 3.4.2);
+glfs_h_rename(glfs_t *fs, glfs_object_t *olddir, const char *oldname,
+ glfs_object_t *newdir, const char *newname) __THROW
+ GFAPI_PUBLIC(glfs_h_rename, 3.4.2);
int
-glfs_h_removexattrs (glfs_t *fs, glfs_object_t *object,
- const char *name) __THROW
- GFAPI_PUBLIC(glfs_h_removexattrs, 3.5.1);
+glfs_h_removexattrs(glfs_t *fs, glfs_object_t *object, const char *name) __THROW
+ GFAPI_PUBLIC(glfs_h_removexattrs, 3.5.1);
/* Operations enabling opaque invariant handle to object transitions */
ssize_t
-glfs_h_extract_handle (glfs_object_t *object, unsigned char *handle,
- int len) __THROW
- GFAPI_PUBLIC(glfs_h_extract_handle, 3.4.2);
+glfs_h_extract_handle(glfs_object_t *object, unsigned char *handle,
+ int len) __THROW
+ GFAPI_PUBLIC(glfs_h_extract_handle, 3.4.2);
/* Given a handle, looks up the inode and creates glfs_object.
* In addition, if provided 'stat', copies the inode attributes
*/
-glfs_object_t*
-glfs_h_create_from_handle (glfs_t *fs, unsigned char *handle, int len,
- struct stat *stat) __THROW
- GFAPI_PUBLIC(glfs_h_create_from_handle, 3.4.2);
+glfs_object_t *
+glfs_h_create_from_handle(glfs_t *fs, unsigned char *handle, int len,
+ struct stat *stat) __THROW
+ GFAPI_PUBLIC(glfs_h_create_from_handle, 3.4.2);
/* Operations enabling object handles to fd transitions */
-glfs_fd_t*
-glfs_h_opendir (glfs_t *fs, glfs_object_t *object) __THROW
- GFAPI_PUBLIC(glfs_h_opendir, 3.4.2);
+glfs_fd_t *
+glfs_h_opendir(glfs_t *fs, glfs_object_t *object) __THROW
+ GFAPI_PUBLIC(glfs_h_opendir, 3.4.2);
-glfs_fd_t*
-glfs_h_open (glfs_t *fs, glfs_object_t *object, int flags) __THROW
- GFAPI_PUBLIC(glfs_h_open, 3.4.2);
+glfs_fd_t *
+glfs_h_open(glfs_t *fs, glfs_object_t *object, int flags) __THROW
+ GFAPI_PUBLIC(glfs_h_open, 3.4.2);
int
-glfs_h_access (glfs_t *fs, glfs_object_t *object, int mask) __THROW
- GFAPI_PUBLIC(glfs_h_access, 3.6.0);
+glfs_h_access(glfs_t *fs, glfs_object_t *object, int mask) __THROW
+ GFAPI_PUBLIC(glfs_h_access, 3.6.0);
/*
SYNOPSIS
@@ -297,53 +292,50 @@ glfs_h_access (glfs_t *fs, glfs_object_t *object, int mask) __THROW
*/
int
-glfs_h_poll_upcall (glfs_t *fs, glfs_upcall_t **cbk) __THROW
- GFAPI_PUBLIC(glfs_h_poll_upcall, 3.7.16);
+glfs_h_poll_upcall(glfs_t *fs, glfs_upcall_t **cbk) __THROW
+ GFAPI_PUBLIC(glfs_h_poll_upcall, 3.7.16);
int
-glfs_h_acl_set (glfs_t *fs, glfs_object_t *object, const acl_type_t type,
- const acl_t acl) __THROW
- GFAPI_PUBLIC(glfs_h_acl_set, 3.7.0);
+glfs_h_acl_set(glfs_t *fs, glfs_object_t *object, const acl_type_t type,
+ const acl_t acl) __THROW GFAPI_PUBLIC(glfs_h_acl_set, 3.7.0);
acl_t
-glfs_h_acl_get (glfs_t *fs, glfs_object_t *object,
- const acl_type_t type) __THROW
- GFAPI_PUBLIC(glfs_h_acl_get, 3.7.0);
+glfs_h_acl_get(glfs_t *fs, glfs_object_t *object, const acl_type_t type) __THROW
+ GFAPI_PUBLIC(glfs_h_acl_get, 3.7.0);
size_t
-glfs_h_anonymous_write (glfs_t *fs, glfs_object_t *object, const void *buf,
- size_t count, off_t offset) __THROW
- GFAPI_PUBLIC(glfs_h_anonymous_write, 3.7.0);
+glfs_h_anonymous_write(glfs_t *fs, glfs_object_t *object, const void *buf,
+ size_t count, off_t offset) __THROW
+ GFAPI_PUBLIC(glfs_h_anonymous_write, 3.7.0);
ssize_t
-glfs_h_anonymous_read (glfs_t *fs, glfs_object_t *object,
- const void *buf, size_t count, off_t offset) __THROW
- GFAPI_PUBLIC(glfs_h_anonymous_read, 3.7.0);
+glfs_h_anonymous_read(glfs_t *fs, glfs_object_t *object, const void *buf,
+ size_t count, off_t offset) __THROW
+ GFAPI_PUBLIC(glfs_h_anonymous_read, 3.7.0);
/*
* Caution: The object returned by this object gets freed as part
* of 'glfs_free(xstat)'. Make sure to have a copy using 'glfs_object_copy()'
* to use post that.
*/
-glfs_object_t*
-glfs_xreaddirplus_get_object (struct glfs_xreaddirp_stat *xstat) __THROW
- GFAPI_PUBLIC(glfs_xreaddirplus_get_object, 3.11.0);
+glfs_object_t *
+glfs_xreaddirplus_get_object(struct glfs_xreaddirp_stat *xstat) __THROW
+ GFAPI_PUBLIC(glfs_xreaddirplus_get_object, 3.11.0);
/* Applications should close the object returned by this routine
* explicitly using 'glfs_h_close()'
*/
-glfs_object_t*
-glfs_object_copy (glfs_object_t *src) __THROW
- GFAPI_PUBLIC(glfs_object_copy, 3.11.0);
+glfs_object_t *
+glfs_object_copy(glfs_object_t *src) __THROW
+ GFAPI_PUBLIC(glfs_object_copy, 3.11.0);
int
-glfs_h_lease (glfs_t *fs, glfs_object_t *object, glfs_lease_t *lease) __THROW
- GFAPI_PUBLIC(glfs_h_lease, 4.0.0);
+glfs_h_lease(glfs_t *fs, glfs_object_t *object, glfs_lease_t *lease) __THROW
+ GFAPI_PUBLIC(glfs_h_lease, 4.0.0);
-glfs_object_t*
-glfs_h_find_handle (glfs_t *fs, unsigned char *handle,
- int len) __THROW
- GFAPI_PUBLIC(glfs_h_lease, 4.0.0);
+glfs_object_t *
+glfs_h_find_handle(glfs_t *fs, unsigned char *handle, int len) __THROW
+ GFAPI_PUBLIC(glfs_h_lease, 4.0.0);
__END_DECLS
#endif /* !_GLFS_HANDLES_H */
diff --git a/api/src/glfs-internal.h b/api/src/glfs-internal.h
index 52048f4592d..200148e3774 100644
--- a/api/src/glfs-internal.h
+++ b/api/src/glfs-internal.h
@@ -8,7 +8,6 @@
cases as published by the Free Software Foundation.
*/
-
#ifndef _GLFS_INTERNAL_H
#define _GLFS_INTERNAL_H
@@ -23,10 +22,10 @@
#define DEFAULT_REVAL_COUNT 1
/*
- * According to pthread mutex and conditional variable ( cond, child_down_count,
- * upcall mutex and mutex) initialization of struct glfs members,
- * below GLFS_INIT_* flags are set in 'pthread_flags' member of struct glfs.
- * The flags are set from glfs_init() and glfs_new_from_ctx() functions
+ * According to pthread mutex and conditional variable ( cond,
+ * child_down_count, upcall mutex and mutex) initialization of struct glfs
+ * members, below GLFS_INIT_* flags are set in 'pthread_flags' member of struct
+ * glfs. The flags are set from glfs_init() and glfs_new_from_ctx() functions
* as part of fs inititialization.
*
* These flag bits are validated in glfs_fini() to destroy all or partially
@@ -37,39 +36,42 @@
*
*/
-#define PTHREAD_MUTEX_INIT(mutex, attr, flags, mask, label) do { \
- int __ret = -1; \
- __ret = pthread_mutex_init (mutex, attr); \
- if (__ret == 0) \
- flags |= mask; \
- else \
- goto label; \
-} while (0)
-
-#define PTHREAD_MUTEX_DESTROY(mutex, flags, mask) do { \
- if (flags & mask) \
- (void) pthread_mutex_destroy (mutex); \
-} while (0)
-
-#define PTHREAD_COND_INIT(cond, attr, flags, mask, label) do { \
- int __ret = -1; \
- __ret = pthread_cond_init (cond, attr); \
- if (__ret == 0) \
- flags |= mask; \
- else \
- goto label; \
-} while (0)
-
-#define PTHREAD_COND_DESTROY(cond, flags, mask) do { \
- if (flags & mask) \
- (void) pthread_cond_destroy (cond); \
-} while (0)
-
-#define GLFS_INIT_MUTEX 0x00000001 /* pthread_mutex_flag */
-#define GLFS_INIT_COND 0x00000002 /* pthread_cond_flag */
-#define GLFS_INIT_COND_CHILD 0x00000004 /* pthread_cond_child_down_flag */
-#define GLFS_INIT_MUTEX_UPCALL 0x00000008 /* pthread_mutex_upcall_flag */
-
+#define PTHREAD_MUTEX_INIT(mutex, attr, flags, mask, label) \
+ do { \
+ int __ret = -1; \
+ __ret = pthread_mutex_init(mutex, attr); \
+ if (__ret == 0) \
+ flags |= mask; \
+ else \
+ goto label; \
+ } while (0)
+
+#define PTHREAD_MUTEX_DESTROY(mutex, flags, mask) \
+ do { \
+ if (flags & mask) \
+ (void)pthread_mutex_destroy(mutex); \
+ } while (0)
+
+#define PTHREAD_COND_INIT(cond, attr, flags, mask, label) \
+ do { \
+ int __ret = -1; \
+ __ret = pthread_cond_init(cond, attr); \
+ if (__ret == 0) \
+ flags |= mask; \
+ else \
+ goto label; \
+ } while (0)
+
+#define PTHREAD_COND_DESTROY(cond, flags, mask) \
+ do { \
+ if (flags & mask) \
+ (void)pthread_cond_destroy(cond); \
+ } while (0)
+
+#define GLFS_INIT_MUTEX 0x00000001 /* pthread_mutex_flag */
+#define GLFS_INIT_COND 0x00000002 /* pthread_cond_flag */
+#define GLFS_INIT_COND_CHILD 0x00000004 /* pthread_cond_child_down_flag */
+#define GLFS_INIT_MUTEX_UPCALL 0x00000008 /* pthread_mutex_upcall_flag */
#ifndef GF_DARWIN_HOST_OS
#ifndef GFAPI_PUBLIC
@@ -78,362 +80,367 @@
#ifndef GFAPI_PRIVATE
#define GFAPI_PRIVATE(sym, ver) /**/
#endif
-#define GFAPI_SYMVER_PUBLIC_DEFAULT(fn, ver) \
- asm(".symver pub_"STR(fn)", "STR(fn)"@@GFAPI_"STR(ver))
+#define GFAPI_SYMVER_PUBLIC_DEFAULT(fn, ver) \
+ asm(".symver pub_" STR(fn) ", " STR(fn) "@@GFAPI_" STR(ver))
-#define GFAPI_SYMVER_PRIVATE_DEFAULT(fn, ver) \
- asm(".symver priv_"STR(fn)", "STR(fn)"@@GFAPI_PRIVATE_"STR(ver))
+#define GFAPI_SYMVER_PRIVATE_DEFAULT(fn, ver) \
+ asm(".symver priv_" STR(fn) ", " STR(fn) "@@GFAPI_PRIVATE_" STR(ver))
-#define GFAPI_SYMVER_PUBLIC(fn1, fn2, ver) \
- asm(".symver pub_"STR(fn1)", "STR(fn2)"@GFAPI_"STR(ver))
+#define GFAPI_SYMVER_PUBLIC(fn1, fn2, ver) \
+ asm(".symver pub_" STR(fn1) ", " STR(fn2) "@GFAPI_" STR(ver))
-#define GFAPI_SYMVER_PRIVATE(fn1, fn2, ver) \
- asm(".symver priv_"STR(fn1)", "STR(fn2)"@GFAPI_PRIVATE_"STR(ver))
+#define GFAPI_SYMVER_PRIVATE(fn1, fn2, ver) \
+ asm(".symver priv_" STR(fn1) ", " STR(fn2) "@GFAPI_PRIVATE_" STR(ver))
#define STR(str) #str
#else
#ifndef GFAPI_PUBLIC
#define GFAPI_PUBLIC(sym, ver) __asm("_" __STRING(sym) "$GFAPI_" __STRING(ver))
#endif
#ifndef GFAPI_PRIVATE
-#define GFAPI_PRIVATE(sym, ver) __asm("_" __STRING(sym) "$GFAPI_PRIVATE_" __STRING(ver))
+#define GFAPI_PRIVATE(sym, ver) \
+ __asm("_" __STRING(sym) "$GFAPI_PRIVATE_" __STRING(ver))
#endif
-#define GFAPI_SYMVER_PUBLIC_DEFAULT(fn, dotver) /**/
+#define GFAPI_SYMVER_PUBLIC_DEFAULT(fn, dotver) /**/
#define GFAPI_SYMVER_PRIVATE_DEFAULT(fn, dotver) /**/
-#define GFAPI_SYMVER_PUBLIC(fn1, fn2, dotver) /**/
-#define GFAPI_SYMVER_PRIVATE(fn1, fn2, dotver) /**/
+#define GFAPI_SYMVER_PUBLIC(fn1, fn2, dotver) /**/
+#define GFAPI_SYMVER_PRIVATE(fn1, fn2, dotver) /**/
#endif
-#define ESTALE_RETRY(ret,errno,reval,loc,label) do { \
- if (ret == -1 && errno == ESTALE) { \
- if (reval < DEFAULT_REVAL_COUNT) { \
- reval++; \
- loc_wipe (loc); \
- goto label; \
- } \
- } \
- } while (0)
-
-#define GLFS_LOC_FILL_INODE(oinode, loc, label) do { \
- loc.inode = inode_ref (oinode); \
- gf_uuid_copy (loc.gfid, oinode->gfid); \
- ret = glfs_loc_touchup (&loc); \
- if (ret != 0) { \
- errno = EINVAL; \
- goto label; \
- } \
- } while (0)
-
-#define GLFS_LOC_FILL_PINODE(pinode, loc, ret, errno, label, path) do { \
- loc.inode = inode_new (pinode->table); \
- if (!loc.inode) { \
- ret = -1; \
- errno = ENOMEM; \
- goto label; \
- } \
- loc.parent = inode_ref (pinode); \
- loc.name = path; \
- ret = glfs_loc_touchup (&loc); \
- if (ret != 0) { \
- errno = EINVAL; \
- goto label; \
- } \
- } while (0)
+#define ESTALE_RETRY(ret, errno, reval, loc, label) \
+ do { \
+ if (ret == -1 && errno == ESTALE) { \
+ if (reval < DEFAULT_REVAL_COUNT) { \
+ reval++; \
+ loc_wipe(loc); \
+ goto label; \
+ } \
+ } \
+ } while (0)
+
+#define GLFS_LOC_FILL_INODE(oinode, loc, label) \
+ do { \
+ loc.inode = inode_ref(oinode); \
+ gf_uuid_copy(loc.gfid, oinode->gfid); \
+ ret = glfs_loc_touchup(&loc); \
+ if (ret != 0) { \
+ errno = EINVAL; \
+ goto label; \
+ } \
+ } while (0)
+
+#define GLFS_LOC_FILL_PINODE(pinode, loc, ret, errno, label, path) \
+ do { \
+ loc.inode = inode_new(pinode->table); \
+ if (!loc.inode) { \
+ ret = -1; \
+ errno = ENOMEM; \
+ goto label; \
+ } \
+ loc.parent = inode_ref(pinode); \
+ loc.name = path; \
+ ret = glfs_loc_touchup(&loc); \
+ if (ret != 0) { \
+ errno = EINVAL; \
+ goto label; \
+ } \
+ } while (0)
struct glfs;
struct _upcall_entry {
- struct list_head upcall_list;
- struct gf_upcall upcall_data;
+ struct list_head upcall_list;
+ struct gf_upcall upcall_data;
};
typedef struct _upcall_entry upcall_entry;
-typedef int (*glfs_init_cbk) (struct glfs *fs, int ret);
+typedef int (*glfs_init_cbk)(struct glfs *fs, int ret);
struct glfs {
- char *volname;
- uuid_t vol_uuid;
+ char *volname;
+ uuid_t vol_uuid;
- glusterfs_ctx_t *ctx;
+ glusterfs_ctx_t *ctx;
- pthread_t poller;
+ pthread_t poller;
- glfs_init_cbk init_cbk;
- pthread_mutex_t mutex;
- pthread_cond_t cond;
- pthread_cond_t child_down_cond; /* for broadcasting CHILD_DOWN */
- int init;
- int ret;
- int err;
+ glfs_init_cbk init_cbk;
+ pthread_mutex_t mutex;
+ pthread_cond_t cond;
+ pthread_cond_t child_down_cond; /* for broadcasting CHILD_DOWN */
+ int init;
+ int ret;
+ int err;
- xlator_t *active_subvol; /* active graph */
- xlator_t *mip_subvol; /* graph for which migration is in
- * progress */
- xlator_t *next_subvol; /* Any new graph is put to
- * next_subvol, the graph in
- * next_subvol can either be moved
- * to mip_subvol (if any IO picks it
- * up for migration), or be
- * destroyed (if there is a new
- * graph, and this was never picked
- * for migration) */
- xlator_t *old_subvol;
+ xlator_t *active_subvol; /* active graph */
+ xlator_t *mip_subvol; /* graph for which migration is in
+ * progress */
+ xlator_t *next_subvol; /* Any new graph is put to
+ * next_subvol, the graph in
+ * next_subvol can either be moved
+ * to mip_subvol (if any IO picks it
+ * up for migration), or be
+ * destroyed (if there is a new
+ * graph, and this was never picked
+ * for migration) */
+ xlator_t *old_subvol;
- char *oldvolfile;
- ssize_t oldvollen;
+ char *oldvolfile;
+ ssize_t oldvollen;
- inode_t *cwd;
+ inode_t *cwd;
- uint32_t dev_id; /* Used to fill st_dev in struct stat */
+ uint32_t dev_id; /* Used to fill st_dev in struct stat */
- struct list_head openfds;
+ struct list_head openfds;
- gf_boolean_t migration_in_progress;
+ gf_boolean_t migration_in_progress;
- gf_boolean_t cache_upcalls; /* add upcalls to the upcall_list? */
- struct list_head upcall_list;
- pthread_mutex_t upcall_list_mutex; /* mutex for upcall entry list */
+ gf_boolean_t cache_upcalls; /* add upcalls to the upcall_list? */
+ struct list_head upcall_list;
+ pthread_mutex_t upcall_list_mutex; /* mutex for upcall entry list */
- uint32_t pin_refcnt;
- uint32_t pthread_flags; /* GLFS_INIT_* # defines set this flag */
+ uint32_t pin_refcnt;
+ uint32_t pthread_flags; /* GLFS_INIT_* # defines set this flag */
- uint32_t upcall_events; /* Mask of upcall events application
- * is interested in */
- glfs_upcall_cbk up_cbk; /* upcall cbk function to be registered */
- void *up_data; /* Opaque data provided by application
- * during upcall registration */
+ uint32_t upcall_events; /* Mask of upcall events application
+ * is interested in */
+ glfs_upcall_cbk up_cbk; /* upcall cbk function to be registered */
+ void *up_data; /* Opaque data provided by application
+ * during upcall registration */
};
/* This enum is used to maintain the state of glfd. In case of async fops
* fd might be closed before the actual fop is complete. Therefore we need
* to track whether the fd is closed or not, instead actually closing it.*/
-enum glfs_fd_state {
- GLFD_INIT,
- GLFD_OPEN,
- GLFD_CLOSE
-};
+enum glfs_fd_state { GLFD_INIT, GLFD_OPEN, GLFD_CLOSE };
struct glfs_fd {
- struct list_head openfds;
- struct list_head list;
- GF_REF_DECL;
- struct glfs *fs;
- enum glfs_fd_state state;
- off_t offset;
- fd_t *fd; /* Currently guared by @fs->mutex. TODO: per-glfd lock */
- struct list_head entries;
- gf_dirent_t *next;
- struct dirent *readdirbuf;
- gf_lkowner_t lk_owner;
- glfs_leaseid_t lease_id; /* Stores lease_id of client in glfd */
- gf_lock_t lock; /* lock taken before updating fd state */
- glfs_recall_cbk cbk;
- void *cookie;
+ struct list_head openfds;
+ struct list_head list;
+ GF_REF_DECL;
+ struct glfs *fs;
+ enum glfs_fd_state state;
+ off_t offset;
+ fd_t *fd; /* Currently guared by @fs->mutex. TODO: per-glfd lock */
+ struct list_head entries;
+ gf_dirent_t *next;
+ struct dirent *readdirbuf;
+ gf_lkowner_t lk_owner;
+ glfs_leaseid_t lease_id; /* Stores lease_id of client in glfd */
+ gf_lock_t lock; /* lock taken before updating fd state */
+ glfs_recall_cbk cbk;
+ void *cookie;
};
/* glfs object handle introduced for the alternate gfapi implementation based
on glfs handles/gfid/inode
*/
struct glfs_object {
- inode_t *inode;
- uuid_t gfid;
+ inode_t *inode;
+ uuid_t gfid;
};
struct glfs_upcall {
- struct glfs *fs; /* glfs object */
- enum glfs_upcall_reason reason; /* Upcall event type */
- void *event; /* changes based in the event type */
- void (*free_event)(void *); /* free event after the usage */
+ struct glfs *fs; /* glfs object */
+ enum glfs_upcall_reason reason; /* Upcall event type */
+ void *event; /* changes based in the event type */
+ void (*free_event)(void *); /* free event after the usage */
};
struct glfs_upcall_inode {
- struct glfs_object *object; /* Object which need to be acted upon */
- int flags; /* Cache UPDATE/INVALIDATE flags */
- struct stat buf; /* Latest stat of this entry */
- unsigned int expire_time_attr; /* the amount of time for which
- * the application need to cache
- * this entry */
- struct glfs_object *p_object; /* parent Object to be updated */
- struct stat p_buf; /* Latest stat of parent dir handle */
- struct glfs_object *oldp_object; /* Old parent Object to be updated */
- struct stat oldp_buf; /* Latest stat of old parent dir handle */
+ struct glfs_object *object; /* Object which need to be acted upon */
+ int flags; /* Cache UPDATE/INVALIDATE flags */
+ struct stat buf; /* Latest stat of this entry */
+ unsigned int expire_time_attr; /* the amount of time for which
+ * the application need to cache
+ * this entry */
+ struct glfs_object *p_object; /* parent Object to be updated */
+ struct stat p_buf; /* Latest stat of parent dir handle */
+ struct glfs_object *oldp_object; /* Old parent Object to be updated */
+ struct stat oldp_buf; /* Latest stat of old parent dir handle */
};
struct glfs_upcall_lease {
- struct glfs_object *object; /* Object which need to be acted upon */
- uint32_t lease_type; /* Lease type to which client can downgrade to*/
+ struct glfs_object *object; /* Object which need to be acted upon */
+ uint32_t lease_type; /* Lease type to which client can downgrade to*/
};
struct glfs_upcall_lease_fd {
- uint32_t lease_type; /* Lease type to which client can downgrade to*/
- void *fd_cookie; /* Object which need to be acted upon */
+ uint32_t lease_type; /* Lease type to which client can downgrade to*/
+ void *fd_cookie; /* Object which need to be acted upon */
};
struct glfs_xreaddirp_stat {
- struct stat st; /* Stat for that dirent - corresponds to GFAPI_XREADDIRP_STAT */
- struct glfs_object *object; /* handled for GFAPI_XREADDIRP_HANDLE */
- uint32_t flags_handled; /* final set of flags successfulyy handled */
+ struct stat
+ st; /* Stat for that dirent - corresponds to GFAPI_XREADDIRP_STAT */
+ struct glfs_object *object; /* handled for GFAPI_XREADDIRP_HANDLE */
+ uint32_t flags_handled; /* final set of flags successfulyy handled */
};
-#define DEFAULT_EVENT_POOL_SIZE 16384
-#define GF_MEMPOOL_COUNT_OF_DICT_T 4096
-#define GF_MEMPOOL_COUNT_OF_DATA_T (GF_MEMPOOL_COUNT_OF_DICT_T * 4)
-#define GF_MEMPOOL_COUNT_OF_DATA_PAIR_T (GF_MEMPOOL_COUNT_OF_DICT_T * 4)
+#define DEFAULT_EVENT_POOL_SIZE 16384
+#define GF_MEMPOOL_COUNT_OF_DICT_T 4096
+#define GF_MEMPOOL_COUNT_OF_DATA_T (GF_MEMPOOL_COUNT_OF_DICT_T * 4)
+#define GF_MEMPOOL_COUNT_OF_DATA_PAIR_T (GF_MEMPOOL_COUNT_OF_DICT_T * 4)
-#define GF_MEMPOOL_COUNT_OF_LRU_BUF_T 256
+#define GF_MEMPOOL_COUNT_OF_LRU_BUF_T 256
-typedef void (glfs_mem_release_t) (void *ptr);
+typedef void(glfs_mem_release_t)(void *ptr);
struct glfs_mem_header {
- uint32_t magic;
- size_t nmemb;
- size_t size;
- glfs_mem_release_t *release;
+ uint32_t magic;
+ size_t nmemb;
+ size_t size;
+ glfs_mem_release_t *release;
};
-#define GLFS_MEM_HEADER_SIZE (sizeof (struct glfs_mem_header))
+#define GLFS_MEM_HEADER_SIZE (sizeof(struct glfs_mem_header))
#define GLFS_MEM_HEADER_MAGIC 0x20170830
static inline void *
-__glfs_calloc (size_t nmemb, size_t size, glfs_mem_release_t release,
- uint32_t type, const char *typestr)
+__glfs_calloc(size_t nmemb, size_t size, glfs_mem_release_t release,
+ uint32_t type, const char *typestr)
{
- struct glfs_mem_header *header = NULL;
+ struct glfs_mem_header *header = NULL;
- header = __gf_calloc(nmemb, (size + GLFS_MEM_HEADER_SIZE),
- type, typestr);
- if (!header)
- return NULL;
+ header = __gf_calloc(nmemb, (size + GLFS_MEM_HEADER_SIZE), type, typestr);
+ if (!header)
+ return NULL;
- header->magic = GLFS_MEM_HEADER_MAGIC;
- header->nmemb = nmemb;
- header->size = size;
- header->release = release;
+ header->magic = GLFS_MEM_HEADER_MAGIC;
+ header->nmemb = nmemb;
+ header->size = size;
+ header->release = release;
- return header + 1;
+ return header + 1;
}
static inline void *
-__glfs_malloc (size_t size, glfs_mem_release_t release,
- uint32_t type, const char *typestr)
+__glfs_malloc(size_t size, glfs_mem_release_t release, uint32_t type,
+ const char *typestr)
{
- struct glfs_mem_header *header = NULL;
+ struct glfs_mem_header *header = NULL;
- header = __gf_malloc((size + GLFS_MEM_HEADER_SIZE), type, typestr);
- if (!header)
- return NULL;
+ header = __gf_malloc((size + GLFS_MEM_HEADER_SIZE), type, typestr);
+ if (!header)
+ return NULL;
- header->magic = GLFS_MEM_HEADER_MAGIC;
- header->nmemb = 1;
- header->size = size;
- header->release = release;
+ header->magic = GLFS_MEM_HEADER_MAGIC;
+ header->nmemb = 1;
+ header->size = size;
+ header->release = release;
- return header + 1;
+ return header + 1;
}
static inline void *
-__glfs_realloc (void *ptr, size_t size)
+__glfs_realloc(void *ptr, size_t size)
{
- struct glfs_mem_header *old_header = NULL;
- struct glfs_mem_header *new_header = NULL;
- struct glfs_mem_header tmp_header;
- void *new_ptr = NULL;
+ struct glfs_mem_header *old_header = NULL;
+ struct glfs_mem_header *new_header = NULL;
+ struct glfs_mem_header tmp_header;
+ void *new_ptr = NULL;
- GF_ASSERT (NULL != ptr);
+ GF_ASSERT(NULL != ptr);
- old_header = (struct glfs_mem_header *) (ptr - GLFS_MEM_HEADER_SIZE);
- GF_ASSERT (old_header->magic == GLFS_MEM_HEADER_MAGIC);
- tmp_header = *old_header;
+ old_header = (struct glfs_mem_header *)(ptr - GLFS_MEM_HEADER_SIZE);
+ GF_ASSERT(old_header->magic == GLFS_MEM_HEADER_MAGIC);
+ tmp_header = *old_header;
- new_ptr = __gf_realloc (old_header, (size + GLFS_MEM_HEADER_SIZE));
- if (!new_ptr)
- return NULL;
+ new_ptr = __gf_realloc(old_header, (size + GLFS_MEM_HEADER_SIZE));
+ if (!new_ptr)
+ return NULL;
- new_header = (struct glfs_mem_header *) new_ptr;
- *new_header = tmp_header;
- new_header->size = size;
+ new_header = (struct glfs_mem_header *)new_ptr;
+ *new_header = tmp_header;
+ new_header->size = size;
- return new_header + 1;
+ return new_header + 1;
}
static inline void
-__glfs_free (void *free_ptr)
+__glfs_free(void *free_ptr)
{
- struct glfs_mem_header *header = NULL;
- void *release_ptr = NULL;
- int i = 0;
-
- if (!free_ptr)
- return;
-
- header = (struct glfs_mem_header *) (free_ptr - GLFS_MEM_HEADER_SIZE);
- GF_ASSERT (header->magic == GLFS_MEM_HEADER_MAGIC);
-
- if (header->release) {
- release_ptr = free_ptr;
- for (i = 0; i < header->nmemb; i++) {
- header->release (release_ptr);
- release_ptr += header->size;
- }
+ struct glfs_mem_header *header = NULL;
+ void *release_ptr = NULL;
+ int i = 0;
+
+ if (!free_ptr)
+ return;
+
+ header = (struct glfs_mem_header *)(free_ptr - GLFS_MEM_HEADER_SIZE);
+ GF_ASSERT(header->magic == GLFS_MEM_HEADER_MAGIC);
+
+ if (header->release) {
+ release_ptr = free_ptr;
+ for (i = 0; i < header->nmemb; i++) {
+ header->release(release_ptr);
+ release_ptr += header->size;
}
+ }
- __gf_free (header);
+ __gf_free(header);
}
-#define GLFS_CALLOC(nmemb, size, release, type) \
- __glfs_calloc (nmemb, size, release, type, #type)
+#define GLFS_CALLOC(nmemb, size, release, type) \
+ __glfs_calloc(nmemb, size, release, type, #type)
-#define GLFS_MALLOC(size, release, type) \
- __glfs_malloc (size, release, type, #type)
+#define GLFS_MALLOC(size, release, type) \
+ __glfs_malloc(size, release, type, #type)
#define GLFS_REALLOC(ptr, size) __glfs_realloc(ptr, size)
#define GLFS_FREE(free_ptr) __glfs_free(free_ptr)
-int glfs_mgmt_init (struct glfs *fs);
-void glfs_init_done (struct glfs *fs, int ret)
- GFAPI_PRIVATE(glfs_init_done, 3.4.0);
-int glfs_process_volfp (struct glfs *fs, FILE *fp);
-int glfs_resolve (struct glfs *fs, xlator_t *subvol, const char *path,
- loc_t *loc, struct iatt *iatt, int reval)
- GFAPI_PRIVATE(glfs_resolve, 3.7.0);
-int glfs_lresolve (struct glfs *fs, xlator_t *subvol, const char *path, loc_t *loc,
- struct iatt *iatt, int reval);
-fd_t *glfs_resolve_fd (struct glfs *fs, xlator_t *subvol, struct glfs_fd *glfd);
-
-fd_t *__glfs_migrate_fd (struct glfs *fs, xlator_t *subvol, struct glfs_fd *glfd);
-
-int glfs_first_lookup (xlator_t *subvol);
-
-void glfs_process_upcall_event (struct glfs *fs, void *data)
- GFAPI_PRIVATE(glfs_process_upcall_event, 3.7.0);
-
-
-#define __GLFS_ENTRY_VALIDATE_FS(fs, label) \
-do { \
- if (!fs) { \
- errno = EINVAL; \
- goto label; \
- } \
- old_THIS = THIS; \
- THIS = fs->ctx->master; \
-} while (0)
-
-#define __GLFS_EXIT_FS \
-do { \
- THIS = old_THIS; \
-} while (0)
-
-#define __GLFS_ENTRY_VALIDATE_FD(glfd, label) \
-do { \
- if (!glfd || !glfd->fd || !glfd->fd->inode || \
- glfd->state != GLFD_OPEN) { \
- errno = EBADF; \
- goto label; \
- } \
- old_THIS = THIS; \
- THIS = glfd->fd->inode->table->xl->ctx->master; \
-} while (0)
+int
+glfs_mgmt_init(struct glfs *fs);
+void
+glfs_init_done(struct glfs *fs, int ret) GFAPI_PRIVATE(glfs_init_done, 3.4.0);
+int
+glfs_process_volfp(struct glfs *fs, FILE *fp);
+int
+glfs_resolve(struct glfs *fs, xlator_t *subvol, const char *path, loc_t *loc,
+ struct iatt *iatt, int reval) GFAPI_PRIVATE(glfs_resolve, 3.7.0);
+int
+glfs_lresolve(struct glfs *fs, xlator_t *subvol, const char *path, loc_t *loc,
+ struct iatt *iatt, int reval);
+fd_t *
+glfs_resolve_fd(struct glfs *fs, xlator_t *subvol, struct glfs_fd *glfd);
+
+fd_t *
+__glfs_migrate_fd(struct glfs *fs, xlator_t *subvol, struct glfs_fd *glfd);
+int
+glfs_first_lookup(xlator_t *subvol);
+
+void
+glfs_process_upcall_event(struct glfs *fs, void *data)
+ GFAPI_PRIVATE(glfs_process_upcall_event, 3.7.0);
+
+#define __GLFS_ENTRY_VALIDATE_FS(fs, label) \
+ do { \
+ if (!fs) { \
+ errno = EINVAL; \
+ goto label; \
+ } \
+ old_THIS = THIS; \
+ THIS = fs->ctx->master; \
+ } while (0)
+
+#define __GLFS_EXIT_FS \
+ do { \
+ THIS = old_THIS; \
+ } while (0)
+
+#define __GLFS_ENTRY_VALIDATE_FD(glfd, label) \
+ do { \
+ if (!glfd || !glfd->fd || !glfd->fd->inode || \
+ glfd->state != GLFD_OPEN) { \
+ errno = EBADF; \
+ goto label; \
+ } \
+ old_THIS = THIS; \
+ THIS = glfd->fd->inode->table->xl->ctx->master; \
+ } while (0)
/*
By default all lock attempts from user context must
@@ -454,62 +461,78 @@ do { \
rpc replies.
*/
static inline int
-glfs_lock (struct glfs *fs, gf_boolean_t wait_for_migration)
+glfs_lock(struct glfs *fs, gf_boolean_t wait_for_migration)
{
- pthread_mutex_lock (&fs->mutex);
+ pthread_mutex_lock(&fs->mutex);
- while (!fs->init)
- pthread_cond_wait (&fs->cond, &fs->mutex);
+ while (!fs->init)
+ pthread_cond_wait(&fs->cond, &fs->mutex);
- while (wait_for_migration && fs->migration_in_progress)
- pthread_cond_wait (&fs->cond, &fs->mutex);
+ while (wait_for_migration && fs->migration_in_progress)
+ pthread_cond_wait(&fs->cond, &fs->mutex);
- return 0;
+ return 0;
}
-
static inline void
-glfs_unlock (struct glfs *fs)
+glfs_unlock(struct glfs *fs)
{
- pthread_mutex_unlock (&fs->mutex);
+ pthread_mutex_unlock(&fs->mutex);
}
-struct glfs_fd *glfs_fd_new (struct glfs *fs);
-void glfs_fd_bind (struct glfs_fd *glfd);
-void glfd_set_state_bind (struct glfs_fd *glfd);
-
-xlator_t *glfs_active_subvol (struct glfs *fs)
- GFAPI_PRIVATE(glfs_active_subvol, 3.4.0);
-xlator_t *__glfs_active_subvol (struct glfs *fs);
-void glfs_subvol_done (struct glfs *fs, xlator_t *subvol)
- GFAPI_PRIVATE(glfs_subvol_done, 3.4.0);
-
-inode_t *glfs_refresh_inode (xlator_t *subvol, inode_t *inode);
-
-inode_t *glfs_cwd_get (struct glfs *fs);
-int glfs_cwd_set (struct glfs *fs, inode_t *inode);
-inode_t *glfs_resolve_inode (struct glfs *fs, xlator_t *subvol,
- struct glfs_object *object);
-int glfs_create_object (loc_t *loc, struct glfs_object **retobject);
-int __glfs_cwd_set (struct glfs *fs, inode_t *inode);
-
-int glfs_resolve_base (struct glfs *fs, xlator_t *subvol, inode_t *inode,
- struct iatt *iatt);
-
-int glfs_resolve_at (struct glfs *fs, xlator_t *subvol, inode_t *at,
- const char *origpath, loc_t *loc, struct iatt *iatt,
- int follow, int reval)
- GFAPI_PRIVATE(glfs_resolve_at, 3.4.0);
-int glfs_loc_touchup (loc_t *loc)
- GFAPI_PRIVATE(glfs_loc_touchup, 3.4.0);
-void glfs_iatt_to_stat (struct glfs *fs, struct iatt *iatt, struct stat *stat);
-int glfs_loc_link (loc_t *loc, struct iatt *iatt);
-int glfs_loc_unlink (loc_t *loc);
-int glfs_getxattr_process (void *value, size_t size, dict_t *xattr,
- const char *name);
+struct glfs_fd *
+glfs_fd_new(struct glfs *fs);
+void
+glfs_fd_bind(struct glfs_fd *glfd);
+void
+glfd_set_state_bind(struct glfs_fd *glfd);
+
+xlator_t *
+glfs_active_subvol(struct glfs *fs) GFAPI_PRIVATE(glfs_active_subvol, 3.4.0);
+xlator_t *
+__glfs_active_subvol(struct glfs *fs);
+void
+glfs_subvol_done(struct glfs *fs, xlator_t *subvol)
+ GFAPI_PRIVATE(glfs_subvol_done, 3.4.0);
+
+inode_t *
+glfs_refresh_inode(xlator_t *subvol, inode_t *inode);
+
+inode_t *
+glfs_cwd_get(struct glfs *fs);
+int
+glfs_cwd_set(struct glfs *fs, inode_t *inode);
+inode_t *
+glfs_resolve_inode(struct glfs *fs, xlator_t *subvol,
+ struct glfs_object *object);
+int
+glfs_create_object(loc_t *loc, struct glfs_object **retobject);
+int
+__glfs_cwd_set(struct glfs *fs, inode_t *inode);
+
+int
+glfs_resolve_base(struct glfs *fs, xlator_t *subvol, inode_t *inode,
+ struct iatt *iatt);
+
+int
+glfs_resolve_at(struct glfs *fs, xlator_t *subvol, inode_t *at,
+ const char *origpath, loc_t *loc, struct iatt *iatt, int follow,
+ int reval) GFAPI_PRIVATE(glfs_resolve_at, 3.4.0);
+int
+glfs_loc_touchup(loc_t *loc) GFAPI_PRIVATE(glfs_loc_touchup, 3.4.0);
+void
+glfs_iatt_to_stat(struct glfs *fs, struct iatt *iatt, struct stat *stat);
+int
+glfs_loc_link(loc_t *loc, struct iatt *iatt);
+int
+glfs_loc_unlink(loc_t *loc);
+int
+glfs_getxattr_process(void *value, size_t size, dict_t *xattr,
+ const char *name);
/* Sends RPC call to glusterd to fetch required volume info */
-int glfs_get_volume_info (struct glfs *fs);
+int
+glfs_get_volume_info(struct glfs *fs);
/*
SYNOPSIS
@@ -535,8 +558,8 @@ int glfs_get_volume_info (struct glfs *fs);
NULL : Otherwise.
*/
-struct glfs *glfs_new_from_ctx (glusterfs_ctx_t *ctx)
- GFAPI_PRIVATE(glfs_new_from_ctx, 3.7.0);
+struct glfs *
+glfs_new_from_ctx(glusterfs_ctx_t *ctx) GFAPI_PRIVATE(glfs_new_from_ctx, 3.7.0);
/*
SYNOPSIS
@@ -562,35 +585,33 @@ struct glfs *glfs_new_from_ctx (glusterfs_ctx_t *ctx)
*/
void
-glfs_free_from_ctx (struct glfs *fs)
- GFAPI_PRIVATE(glfs_free_from_ctx, 3.7.0);
+glfs_free_from_ctx(struct glfs *fs) GFAPI_PRIVATE(glfs_free_from_ctx, 3.7.0);
int
-glfs_recall_lease_fd (struct glfs *fs, struct gf_upcall *up_data);
+glfs_recall_lease_fd(struct glfs *fs, struct gf_upcall *up_data);
int
-glfs_recall_lease_upcall (struct glfs *fs, struct glfs_upcall *up_arg,
- struct gf_upcall *up_data);
+glfs_recall_lease_upcall(struct glfs *fs, struct glfs_upcall *up_arg,
+ struct gf_upcall *up_data);
int
-glfs_get_upcall_cache_invalidation (struct gf_upcall *to_up_data,
- struct gf_upcall *from_up_data);
+glfs_get_upcall_cache_invalidation(struct gf_upcall *to_up_data,
+ struct gf_upcall *from_up_data);
int
-glfs_h_poll_cache_invalidation (struct glfs *fs,
- struct glfs_upcall *up_arg,
- struct gf_upcall *upcall_data);
+glfs_h_poll_cache_invalidation(struct glfs *fs, struct glfs_upcall *up_arg,
+ struct gf_upcall *upcall_data);
ssize_t
-glfs_anonymous_preadv (struct glfs *fs, struct glfs_object *object,
- const struct iovec *iovec, int iovcnt,
- off_t offset, int flags);
+glfs_anonymous_preadv(struct glfs *fs, struct glfs_object *object,
+ const struct iovec *iovec, int iovcnt, off_t offset,
+ int flags);
ssize_t
-glfs_anonymous_pwritev (struct glfs *fs, struct glfs_object *object,
- const struct iovec *iovec, int iovcnt,
- off_t offset, int flags);
+glfs_anonymous_pwritev(struct glfs *fs, struct glfs_object *object,
+ const struct iovec *iovec, int iovcnt, off_t offset,
+ int flags);
struct glfs_object *
-glfs_h_resolve_symlink (struct glfs *fs, struct glfs_object *object);
+glfs_h_resolve_symlink(struct glfs *fs, struct glfs_object *object);
/* Deprecated structures that were passed to client applications, replaced by
* accessor functions. Do not use these in new applications, and update older
@@ -601,52 +622,53 @@ glfs_h_resolve_symlink (struct glfs *fs, struct glfs_object *object);
* WARNING: These structures will be removed in the future.
*/
struct glfs_callback_arg {
- struct glfs *fs;
- enum glfs_upcall_reason reason;
- void *event_arg;
+ struct glfs *fs;
+ enum glfs_upcall_reason reason;
+ void *event_arg;
};
struct glfs_callback_inode_arg {
- struct glfs_object *object; /* Object which need to be acted upon */
- int flags; /* Cache UPDATE/INVALIDATE flags */
- struct stat buf; /* Latest stat of this entry */
- unsigned int expire_time_attr; /* the amount of time for which
- * the application need to cache
- * this entry
- */
- struct glfs_object *p_object; /* parent Object to be updated */
- struct stat p_buf; /* Latest stat of parent dir handle */
- struct glfs_object *oldp_object; /* Old parent Object
- * to be updated */
- struct stat oldp_buf; /* Latest stat of old parent
- * dir handle */
+ struct glfs_object *object; /* Object which need to be acted upon */
+ int flags; /* Cache UPDATE/INVALIDATE flags */
+ struct stat buf; /* Latest stat of this entry */
+ unsigned int expire_time_attr; /* the amount of time for which
+ * the application need to cache
+ * this entry
+ */
+ struct glfs_object *p_object; /* parent Object to be updated */
+ struct stat p_buf; /* Latest stat of parent dir handle */
+ struct glfs_object *oldp_object; /* Old parent Object
+ * to be updated */
+ struct stat oldp_buf; /* Latest stat of old parent
+ * dir handle */
};
struct dirent *
-glfs_readdirbuf_get (struct glfs_fd *glfd);
+glfs_readdirbuf_get(struct glfs_fd *glfd);
gf_dirent_t *
-glfd_entry_next (struct glfs_fd *glfd, int plus);
+glfd_entry_next(struct glfs_fd *glfd, int plus);
void
-gf_dirent_to_dirent (gf_dirent_t *gf_dirent, struct dirent *dirent);
+gf_dirent_to_dirent(gf_dirent_t *gf_dirent, struct dirent *dirent);
void
-gf_lease_to_glfs_lease (struct gf_lease *gf_lease, struct glfs_lease *lease);
+gf_lease_to_glfs_lease(struct gf_lease *gf_lease, struct glfs_lease *lease);
void
-glfs_lease_to_gf_lease (struct glfs_lease *lease, struct gf_lease *gf_lease);
+glfs_lease_to_gf_lease(struct glfs_lease *lease, struct gf_lease *gf_lease);
-void glfs_release_upcall (void *ptr);
+void
+glfs_release_upcall(void *ptr);
int
-get_fop_attr_glfd (dict_t **fop_attr, struct glfs_fd *glfd);
+get_fop_attr_glfd(dict_t **fop_attr, struct glfs_fd *glfd);
int
-set_fop_attr_glfd (struct glfs_fd *glfd);
+set_fop_attr_glfd(struct glfs_fd *glfd);
int
-get_fop_attr_thrd_key (dict_t **fop_attr);
+get_fop_attr_thrd_key(dict_t **fop_attr);
void
-unset_fop_attr (dict_t **fop_attr);
+unset_fop_attr(dict_t **fop_attr);
#endif /* !_GLFS_INTERNAL_H */
diff --git a/api/src/glfs-mem-types.h b/api/src/glfs-mem-types.h
index 7bfa8c98c0f..e1316d128af 100644
--- a/api/src/glfs-mem-types.h
+++ b/api/src/glfs-mem-types.h
@@ -16,20 +16,20 @@
#define GF_MEM_TYPE_START (gf_common_mt_end + 1)
enum glfs_mem_types_ {
- glfs_mt_call_pool_t = GF_MEM_TYPE_START,
- glfs_mt_xlator_t,
- glfs_mt_glfs_fd_t,
- glfs_mt_glfs_io_t,
- glfs_mt_volfile_t,
- glfs_mt_xlator_cmdline_option_t,
- glfs_mt_server_cmdline_t,
- glfs_mt_glfs_object_t,
- glfs_mt_readdirbuf_t,
- glfs_mt_upcall_entry_t,
- glfs_mt_acl_t,
- glfs_mt_upcall_inode_t,
- glfs_mt_realpath_t,
- glfs_mt_xreaddirp_stat_t,
- glfs_mt_end
+ glfs_mt_call_pool_t = GF_MEM_TYPE_START,
+ glfs_mt_xlator_t,
+ glfs_mt_glfs_fd_t,
+ glfs_mt_glfs_io_t,
+ glfs_mt_volfile_t,
+ glfs_mt_xlator_cmdline_option_t,
+ glfs_mt_server_cmdline_t,
+ glfs_mt_glfs_object_t,
+ glfs_mt_readdirbuf_t,
+ glfs_mt_upcall_entry_t,
+ glfs_mt_acl_t,
+ glfs_mt_upcall_inode_t,
+ glfs_mt_realpath_t,
+ glfs_mt_xreaddirp_stat_t,
+ glfs_mt_end
};
#endif
diff --git a/api/src/glfs.h b/api/src/glfs.h
index 3681cd11450..a007602fc8d 100644
--- a/api/src/glfs.h
+++ b/api/src/glfs.h
@@ -8,7 +8,6 @@
cases as published by the Free Software Foundation.
*/
-
#ifndef _GLFS_H
#define _GLFS_H
@@ -52,19 +51,20 @@ typedef int acl_type_t;
/* Portability non glibc c++ build systems */
#ifndef __THROW
-# if defined __cplusplus
-# define __THROW throw ()
-# else
-# define __THROW
-# endif
+#if defined __cplusplus
+#define __THROW throw()
+#else
+#define __THROW
+#endif
#endif
#ifndef GF_DARWIN_HOST_OS
-#define GFAPI_PUBLIC(sym, ver) /**/
+#define GFAPI_PUBLIC(sym, ver) /**/
#define GFAPI_PRIVATE(sym, ver) /**/
#else
#define GFAPI_PUBLIC(sym, ver) __asm("_" __STRING(sym) "$GFAPI_" __STRING(ver))
-#define GFAPI_PRIVATE(sym, ver) __asm("_" __STRING(sym) "$GFAPI_PRIVATE_" __STRING(ver))
+#define GFAPI_PRIVATE(sym, ver) \
+ __asm("_" __STRING(sym) "$GFAPI_PRIVATE_" __STRING(ver))
#endif
__BEGIN_DECLS
@@ -103,9 +103,8 @@ typedef struct glfs glfs_t;
*/
-glfs_t *glfs_new (const char *volname) __THROW
- GFAPI_PUBLIC(glfs_new, 3.4.0);
-
+glfs_t *
+glfs_new(const char *volname) __THROW GFAPI_PUBLIC(glfs_new, 3.4.0);
/*
SYNOPSIS
@@ -134,9 +133,9 @@ glfs_t *glfs_new (const char *volname) __THROW
*/
-int glfs_set_volfile (glfs_t *fs, const char *volfile) __THROW
- GFAPI_PUBLIC(glfs_set_volfile, 3.4.0);
-
+int
+glfs_set_volfile(glfs_t *fs, const char *volfile) __THROW
+ GFAPI_PUBLIC(glfs_set_volfile, 3.4.0);
/*
SYNOPSIS
@@ -188,14 +187,14 @@ int glfs_set_volfile (glfs_t *fs, const char *volfile) __THROW
*/
int
-glfs_set_volfile_server (glfs_t *fs, const char *transport,
- const char *host, int port) __THROW
- GFAPI_PUBLIC(glfs_set_volfile_server, 3.4.0);
+glfs_set_volfile_server(glfs_t *fs, const char *transport, const char *host,
+ int port) __THROW
+ GFAPI_PUBLIC(glfs_set_volfile_server, 3.4.0);
int
-glfs_unset_volfile_server (glfs_t *fs, const char *transport,
- const char *host, int port) __THROW
- GFAPI_PUBLIC(glfs_unset_volfile_server, 3.5.1);
+glfs_unset_volfile_server(glfs_t *fs, const char *transport, const char *host,
+ int port) __THROW
+ GFAPI_PUBLIC(glfs_unset_volfile_server, 3.5.1);
/*
SYNOPSIS
@@ -226,8 +225,8 @@ glfs_unset_volfile_server (glfs_t *fs, const char *transport,
*/
int
-glfs_set_logging (glfs_t *fs, const char *logfile, int loglevel) __THROW
- GFAPI_PUBLIC(glfs_set_logging, 3.4.0);
+glfs_set_logging(glfs_t *fs, const char *logfile, int loglevel) __THROW
+ GFAPI_PUBLIC(glfs_set_logging, 3.4.0);
/*
SYNOPSIS
@@ -254,9 +253,7 @@ glfs_set_logging (glfs_t *fs, const char *logfile, int loglevel) __THROW
*/
int
-glfs_init (glfs_t *fs) __THROW
- GFAPI_PUBLIC(glfs_init, 3.4.0);
-
+glfs_init(glfs_t *fs) __THROW GFAPI_PUBLIC(glfs_init, 3.4.0);
/*
SYNOPSIS
@@ -289,8 +286,7 @@ glfs_init (glfs_t *fs) __THROW
*/
int
-glfs_fini (glfs_t *fs) __THROW
- GFAPI_PUBLIC(glfs_fini, 3.4.0);
+glfs_fini(glfs_t *fs) __THROW GFAPI_PUBLIC(glfs_fini, 3.4.0);
/*
SYNOPSIS
@@ -321,9 +317,8 @@ glfs_fini (glfs_t *fs) __THROW
*/
ssize_t
-glfs_get_volfile (glfs_t *fs, void *buf, size_t len) __THROW
- GFAPI_PUBLIC(glfs_get_volfile, 3.6.0);
-
+glfs_get_volfile(glfs_t *fs, void *buf, size_t len) __THROW
+ GFAPI_PUBLIC(glfs_get_volfile, 3.6.0);
/*
SYNOPSIS
@@ -337,8 +332,8 @@ glfs_get_volfile (glfs_t *fs, void *buf, size_t len) __THROW
in the glusterfs_context linked to the glfs object fs which can be used
in the subsequent calls. Later it parses that UUID to convert it from
canonical string format into an opaque byte array and copy it into
- the volid array. In case if either of the input parameters, volid or size,
- is NULL, number of bytes required to copy the volume UUID is returned.
+ the volid array. In case if either of the input parameters, volid or
+ size, is NULL, number of bytes required to copy the volume UUID is returned.
PARAMETERS
@@ -354,9 +349,8 @@ glfs_get_volfile (glfs_t *fs, void *buf, size_t len) __THROW
*/
int
-glfs_get_volumeid (glfs_t *fs, char *volid, size_t size) __THROW
- GFAPI_PUBLIC(glfs_get_volumeid, 3.5.0);
-
+glfs_get_volumeid(glfs_t *fs, char *volid, size_t size) __THROW
+ GFAPI_PUBLIC(glfs_get_volumeid, 3.5.0);
/*
* FILE OPERATION
@@ -406,20 +400,18 @@ typedef char glfs_leaseid_t[GLFS_LEASE_ID_SIZE];
*
*/
int
-glfs_setfsuid (uid_t fsuid) __THROW
- GFAPI_PUBLIC(glfs_setfsuid, 3.4.2);
+glfs_setfsuid(uid_t fsuid) __THROW GFAPI_PUBLIC(glfs_setfsuid, 3.4.2);
int
-glfs_setfsgid (gid_t fsgid) __THROW
- GFAPI_PUBLIC(glfs_setfsgid, 3.4.2);
+glfs_setfsgid(gid_t fsgid) __THROW GFAPI_PUBLIC(glfs_setfsgid, 3.4.2);
int
-glfs_setfsgroups (size_t size, const gid_t *list) __THROW
- GFAPI_PUBLIC(glfs_setfsgroups, 3.4.2);
+glfs_setfsgroups(size_t size, const gid_t *list) __THROW
+ GFAPI_PUBLIC(glfs_setfsgroups, 3.4.2);
int
-glfs_setfsleaseid (glfs_leaseid_t leaseid) __THROW
- GFAPI_PUBLIC(glfs_setfsleaseid, 4.0.0);
+glfs_setfsleaseid(glfs_leaseid_t leaseid) __THROW
+ GFAPI_PUBLIC(glfs_setfsleaseid, 4.0.0);
/*
SYNOPSIS
@@ -446,9 +438,9 @@ glfs_setfsleaseid (glfs_leaseid_t leaseid) __THROW
*/
-glfs_fd_t*
-glfs_open (glfs_t *fs, const char *path, int flags) __THROW
- GFAPI_PUBLIC(glfs_open, 3.4.0);
+glfs_fd_t *
+glfs_open(glfs_t *fs, const char *path, int flags) __THROW
+ GFAPI_PUBLIC(glfs_open, 3.4.0);
/*
SYNOPSIS
@@ -476,22 +468,20 @@ glfs_open (glfs_t *fs, const char *path, int flags) __THROW
*/
-glfs_fd_t*
-glfs_creat (glfs_t *fs, const char *path, int flags, mode_t mode) __THROW
- GFAPI_PUBLIC(glfs_creat, 3.4.0);
+glfs_fd_t *
+glfs_creat(glfs_t *fs, const char *path, int flags, mode_t mode) __THROW
+ GFAPI_PUBLIC(glfs_creat, 3.4.0);
int
-glfs_close (glfs_fd_t *fd) __THROW
- GFAPI_PUBLIC(glfs_close, 3.4.0);
+glfs_close(glfs_fd_t *fd) __THROW GFAPI_PUBLIC(glfs_close, 3.4.0);
-glfs_t*
-glfs_from_glfd (glfs_fd_t *fd) __THROW
- GFAPI_PUBLIC(glfs_from_glfd, 3.4.0);
+glfs_t *
+glfs_from_glfd(glfs_fd_t *fd) __THROW GFAPI_PUBLIC(glfs_from_glfd, 3.4.0);
int
-glfs_set_xlator_option (glfs_t *fs, const char *xlator, const char *key,
- const char *value) __THROW
- GFAPI_PUBLIC(glfs_set_xlator_option, 3.4.0);
+glfs_set_xlator_option(glfs_t *fs, const char *xlator, const char *key,
+ const char *value) __THROW
+ GFAPI_PUBLIC(glfs_set_xlator_option, 3.4.0);
/*
@@ -516,181 +506,176 @@ glfs_set_xlator_option (glfs_t *fs, const char *xlator, const char *key,
in a common callback function.
*/
-typedef void (*glfs_io_cbk) (glfs_fd_t *fd, ssize_t ret, struct stat *prestat,
- struct stat *poststat, void *data);
+typedef void (*glfs_io_cbk)(glfs_fd_t *fd, ssize_t ret, struct stat *prestat,
+ struct stat *poststat, void *data);
// glfs_{read,write}[_async]
ssize_t
-glfs_read (glfs_fd_t *fd, void *buf, size_t count, int flags) __THROW
- GFAPI_PUBLIC(glfs_read, 3.4.0);
+glfs_read(glfs_fd_t *fd, void *buf, size_t count, int flags) __THROW
+ GFAPI_PUBLIC(glfs_read, 3.4.0);
ssize_t
-glfs_write (glfs_fd_t *fd, const void *buf, size_t count, int flags) __THROW
- GFAPI_PUBLIC(glfs_write, 3.4.0);
+glfs_write(glfs_fd_t *fd, const void *buf, size_t count, int flags) __THROW
+ GFAPI_PUBLIC(glfs_write, 3.4.0);
int
-glfs_read_async (glfs_fd_t *fd, void *buf, size_t count, int flags,
- glfs_io_cbk fn, void *data) __THROW
- GFAPI_PUBLIC(glfs_read_async, future);
+glfs_read_async(glfs_fd_t *fd, void *buf, size_t count, int flags,
+ glfs_io_cbk fn, void *data) __THROW
+ GFAPI_PUBLIC(glfs_read_async, future);
int
-glfs_write_async (glfs_fd_t *fd, const void *buf, size_t count, int flags,
- glfs_io_cbk fn, void *data) __THROW
- GFAPI_PUBLIC(glfs_write_async, future);
+glfs_write_async(glfs_fd_t *fd, const void *buf, size_t count, int flags,
+ glfs_io_cbk fn, void *data) __THROW
+ GFAPI_PUBLIC(glfs_write_async, future);
// glfs_{read,write}v[_async]
ssize_t
-glfs_readv (glfs_fd_t *fd, const struct iovec *iov, int iovcnt,
- int flags) __THROW
- GFAPI_PUBLIC(glfs_readv, 3.4.0);
+glfs_readv(glfs_fd_t *fd, const struct iovec *iov, int iovcnt,
+ int flags) __THROW GFAPI_PUBLIC(glfs_readv, 3.4.0);
ssize_t
-glfs_writev (glfs_fd_t *fd, const struct iovec *iov, int iovcnt,
- int flags) __THROW
- GFAPI_PUBLIC(glfs_writev, 3.4.0);
+glfs_writev(glfs_fd_t *fd, const struct iovec *iov, int iovcnt,
+ int flags) __THROW GFAPI_PUBLIC(glfs_writev, 3.4.0);
int
-glfs_readv_async (glfs_fd_t *fd, const struct iovec *iov, int count,
- int flags, glfs_io_cbk fn, void *data) __THROW
- GFAPI_PUBLIC(glfs_readv_async, future);
+glfs_readv_async(glfs_fd_t *fd, const struct iovec *iov, int count, int flags,
+ glfs_io_cbk fn, void *data) __THROW
+ GFAPI_PUBLIC(glfs_readv_async, future);
int
-glfs_writev_async (glfs_fd_t *fd, const struct iovec *iov, int count,
- int flags, glfs_io_cbk fn, void *data) __THROW
- GFAPI_PUBLIC(glfs_writev_async, future);
+glfs_writev_async(glfs_fd_t *fd, const struct iovec *iov, int count, int flags,
+ glfs_io_cbk fn, void *data) __THROW
+ GFAPI_PUBLIC(glfs_writev_async, future);
// glfs_p{read,write}[_async]
ssize_t
-glfs_pread (glfs_fd_t *fd, void *buf, size_t count, off_t offset, int flags,
- struct stat *poststat) __THROW
- GFAPI_PUBLIC(glfs_pread, future);
+glfs_pread(glfs_fd_t *fd, void *buf, size_t count, off_t offset, int flags,
+ struct stat *poststat) __THROW GFAPI_PUBLIC(glfs_pread, future);
ssize_t
-glfs_pwrite (glfs_fd_t *fd, const void *buf, size_t count, off_t offset,
- int flags, struct stat *prestat, struct stat *poststat) __THROW
- GFAPI_PUBLIC(glfs_pwrite, future);
+glfs_pwrite(glfs_fd_t *fd, const void *buf, size_t count, off_t offset,
+ int flags, struct stat *prestat, struct stat *poststat) __THROW
+ GFAPI_PUBLIC(glfs_pwrite, future);
int
-glfs_pread_async (glfs_fd_t *fd, void *buf, size_t count, off_t offset,
- int flags, glfs_io_cbk fn, void *data) __THROW
- GFAPI_PUBLIC(glfs_pread_async, future);
+glfs_pread_async(glfs_fd_t *fd, void *buf, size_t count, off_t offset,
+ int flags, glfs_io_cbk fn, void *data) __THROW
+ GFAPI_PUBLIC(glfs_pread_async, future);
int
-glfs_pwrite_async (glfs_fd_t *fd, const void *buf, int count, off_t offset,
- int flags, glfs_io_cbk fn, void *data) __THROW
- GFAPI_PUBLIC(glfs_pwrite_async, future);
+glfs_pwrite_async(glfs_fd_t *fd, const void *buf, int count, off_t offset,
+ int flags, glfs_io_cbk fn, void *data) __THROW
+ GFAPI_PUBLIC(glfs_pwrite_async, future);
// glfs_p{read,write}v[_async]
ssize_t
-glfs_preadv (glfs_fd_t *fd, const struct iovec *iov, int iovcnt,
- off_t offset, int flags) __THROW
- GFAPI_PUBLIC(glfs_preadv, 3.4.0);
+glfs_preadv(glfs_fd_t *fd, const struct iovec *iov, int iovcnt, off_t offset,
+ int flags) __THROW GFAPI_PUBLIC(glfs_preadv, 3.4.0);
ssize_t
-glfs_pwritev (glfs_fd_t *fd, const struct iovec *iov, int iovcnt,
- off_t offset, int flags) __THROW
- GFAPI_PUBLIC(glfs_pwritev, 3.4.0);
+glfs_pwritev(glfs_fd_t *fd, const struct iovec *iov, int iovcnt, off_t offset,
+ int flags) __THROW GFAPI_PUBLIC(glfs_pwritev, 3.4.0);
int
-glfs_preadv_async (glfs_fd_t *fd, const struct iovec *iov, int count,
- off_t offset, int flags, glfs_io_cbk fn, void *data) __THROW
- GFAPI_PUBLIC(glfs_preadv_async, future);
+glfs_preadv_async(glfs_fd_t *fd, const struct iovec *iov, int count,
+ off_t offset, int flags, glfs_io_cbk fn, void *data) __THROW
+ GFAPI_PUBLIC(glfs_preadv_async, future);
int
-glfs_pwritev_async (glfs_fd_t *fd, const struct iovec *iov, int count,
- off_t offset, int flags, glfs_io_cbk fn, void *data) __THROW
- GFAPI_PUBLIC(glfs_pwritev_async, future);
+glfs_pwritev_async(glfs_fd_t *fd, const struct iovec *iov, int count,
+ off_t offset, int flags, glfs_io_cbk fn, void *data) __THROW
+ GFAPI_PUBLIC(glfs_pwritev_async, future);
off_t
-glfs_lseek (glfs_fd_t *fd, off_t offset, int whence) __THROW
- GFAPI_PUBLIC(glfs_lseek, 3.4.0);
+glfs_lseek(glfs_fd_t *fd, off_t offset, int whence) __THROW
+ GFAPI_PUBLIC(glfs_lseek, 3.4.0);
int
-glfs_truncate (glfs_t *fs, const char *path, off_t length) __THROW
- GFAPI_PUBLIC(glfs_truncate, 3.7.15);
+glfs_truncate(glfs_t *fs, const char *path, off_t length) __THROW
+ GFAPI_PUBLIC(glfs_truncate, 3.7.15);
int
-glfs_ftruncate (glfs_fd_t *fd, off_t length, struct stat *prestat,
- struct stat *poststat) __THROW
- GFAPI_PUBLIC(glfs_ftruncate, future);
+glfs_ftruncate(glfs_fd_t *fd, off_t length, struct stat *prestat,
+ struct stat *poststat) __THROW
+ GFAPI_PUBLIC(glfs_ftruncate, future);
int
-glfs_ftruncate_async (glfs_fd_t *fd, off_t length, glfs_io_cbk fn,
- void *data) __THROW
- GFAPI_PUBLIC(glfs_ftruncate_async, future);
+glfs_ftruncate_async(glfs_fd_t *fd, off_t length, glfs_io_cbk fn,
+ void *data) __THROW
+ GFAPI_PUBLIC(glfs_ftruncate_async, future);
int
-glfs_lstat (glfs_t *fs, const char *path, struct stat *buf) __THROW
- GFAPI_PUBLIC(glfs_lstat, 3.4.0);
+glfs_lstat(glfs_t *fs, const char *path, struct stat *buf) __THROW
+ GFAPI_PUBLIC(glfs_lstat, 3.4.0);
int
-glfs_stat (glfs_t *fs, const char *path, struct stat *buf) __THROW
- GFAPI_PUBLIC(glfs_stat, 3.4.0);
+glfs_stat(glfs_t *fs, const char *path, struct stat *buf) __THROW
+ GFAPI_PUBLIC(glfs_stat, 3.4.0);
int
-glfs_fstat (glfs_fd_t *fd, struct stat *buf) __THROW
- GFAPI_PUBLIC(glfs_fstat, 3.4.0);
+glfs_fstat(glfs_fd_t *fd, struct stat *buf) __THROW
+ GFAPI_PUBLIC(glfs_fstat, 3.4.0);
int
-glfs_fsync (glfs_fd_t *fd, struct stat *prestat, struct stat *poststat) __THROW
- GFAPI_PUBLIC(glfs_fsync, future);
+glfs_fsync(glfs_fd_t *fd, struct stat *prestat, struct stat *poststat) __THROW
+ GFAPI_PUBLIC(glfs_fsync, future);
int
-glfs_fsync_async (glfs_fd_t *fd, glfs_io_cbk fn, void *data) __THROW
- GFAPI_PUBLIC(glfs_fsync_async, future);
+glfs_fsync_async(glfs_fd_t *fd, glfs_io_cbk fn, void *data) __THROW
+ GFAPI_PUBLIC(glfs_fsync_async, future);
int
-glfs_fdatasync (glfs_fd_t *fd, struct stat *prestat,
- struct stat *poststat) __THROW
- GFAPI_PUBLIC(glfs_fdatasync, future);
+glfs_fdatasync(glfs_fd_t *fd, struct stat *prestat,
+ struct stat *poststat) __THROW
+ GFAPI_PUBLIC(glfs_fdatasync, future);
int
-glfs_fdatasync_async (glfs_fd_t *fd, glfs_io_cbk fn, void *data) __THROW
- GFAPI_PUBLIC(glfs_fdatasync_async, future);
+glfs_fdatasync_async(glfs_fd_t *fd, glfs_io_cbk fn, void *data) __THROW
+ GFAPI_PUBLIC(glfs_fdatasync_async, future);
int
-glfs_access (glfs_t *fs, const char *path, int mode) __THROW
- GFAPI_PUBLIC(glfs_access, 3.4.0);
+glfs_access(glfs_t *fs, const char *path, int mode) __THROW
+ GFAPI_PUBLIC(glfs_access, 3.4.0);
int
-glfs_symlink (glfs_t *fs, const char *oldpath, const char *newpath) __THROW
- GFAPI_PUBLIC(glfs_symlink, 3.4.0);
+glfs_symlink(glfs_t *fs, const char *oldpath, const char *newpath) __THROW
+ GFAPI_PUBLIC(glfs_symlink, 3.4.0);
int
-glfs_readlink (glfs_t *fs, const char *path, char *buf, size_t bufsiz) __THROW
- GFAPI_PUBLIC(glfs_readlink, 3.4.0);
+glfs_readlink(glfs_t *fs, const char *path, char *buf, size_t bufsiz) __THROW
+ GFAPI_PUBLIC(glfs_readlink, 3.4.0);
int
-glfs_mknod (glfs_t *fs, const char *path, mode_t mode, dev_t dev) __THROW
- GFAPI_PUBLIC(glfs_mknod, 3.4.0);
+glfs_mknod(glfs_t *fs, const char *path, mode_t mode, dev_t dev) __THROW
+ GFAPI_PUBLIC(glfs_mknod, 3.4.0);
int
-glfs_mkdir (glfs_t *fs, const char *path, mode_t mode) __THROW
- GFAPI_PUBLIC(glfs_mkdir, 3.4.0);
+glfs_mkdir(glfs_t *fs, const char *path, mode_t mode) __THROW
+ GFAPI_PUBLIC(glfs_mkdir, 3.4.0);
int
-glfs_unlink (glfs_t *fs, const char *path) __THROW
- GFAPI_PUBLIC(glfs_unlink, 3.4.0);
+glfs_unlink(glfs_t *fs, const char *path) __THROW
+ GFAPI_PUBLIC(glfs_unlink, 3.4.0);
int
-glfs_rmdir (glfs_t *fs, const char *path) __THROW
- GFAPI_PUBLIC(glfs_rmdir, 3.4.0);
+glfs_rmdir(glfs_t *fs, const char *path) __THROW
+ GFAPI_PUBLIC(glfs_rmdir, 3.4.0);
int
-glfs_rename (glfs_t *fs, const char *oldpath, const char *newpath) __THROW
- GFAPI_PUBLIC(glfs_rename, 3.4.0);
+glfs_rename(glfs_t *fs, const char *oldpath, const char *newpath) __THROW
+ GFAPI_PUBLIC(glfs_rename, 3.4.0);
int
-glfs_link (glfs_t *fs, const char *oldpath, const char *newpath) __THROW
- GFAPI_PUBLIC(glfs_link, 3.4.0);
+glfs_link(glfs_t *fs, const char *oldpath, const char *newpath) __THROW
+ GFAPI_PUBLIC(glfs_link, 3.4.0);
-glfs_fd_t*
-glfs_opendir (glfs_t *fs, const char *path) __THROW
- GFAPI_PUBLIC(glfs_opendir, 3.4.0);
+glfs_fd_t *
+glfs_opendir(glfs_t *fs, const char *path) __THROW
+ GFAPI_PUBLIC(glfs_opendir, 3.4.0);
/*
* @glfs_readdir_r and @glfs_readdirplus_r ARE thread safe AND re-entrant,
@@ -701,14 +686,14 @@ glfs_opendir (glfs_t *fs, const char *path) __THROW
*/
int
-glfs_readdir_r (glfs_fd_t *fd, struct dirent *dirent,
- struct dirent **result) __THROW
- GFAPI_PUBLIC(glfs_readdir_r, 3.4.0);
+glfs_readdir_r(glfs_fd_t *fd, struct dirent *dirent,
+ struct dirent **result) __THROW
+ GFAPI_PUBLIC(glfs_readdir_r, 3.4.0);
int
-glfs_readdirplus_r (glfs_fd_t *fd, struct stat *stat, struct dirent *dirent,
- struct dirent **result) __THROW
- GFAPI_PUBLIC(glfs_readdirplus_r, 3.4.0);
+glfs_readdirplus_r(glfs_fd_t *fd, struct stat *stat, struct dirent *dirent,
+ struct dirent **result) __THROW
+ GFAPI_PUBLIC(glfs_readdirplus_r, 3.4.0);
/*
* @glfs_readdir and @glfs_readdirplus are NEITHER thread safe NOR re-entrant
@@ -717,162 +702,153 @@ glfs_readdirplus_r (glfs_fd_t *fd, struct stat *stat, struct dirent *dirent,
* referring to the same directory too.)
*/
-struct dirent*
-glfs_readdir (glfs_fd_t *fd) __THROW
- GFAPI_PUBLIC(glfs_readdir, 3.5.0);
+struct dirent *
+glfs_readdir(glfs_fd_t *fd) __THROW GFAPI_PUBLIC(glfs_readdir, 3.5.0);
-struct dirent*
-glfs_readdirplus (glfs_fd_t *fd, struct stat *stat) __THROW
- GFAPI_PUBLIC(glfs_readdirplus, 3.5.0);
+struct dirent *
+glfs_readdirplus(glfs_fd_t *fd, struct stat *stat) __THROW
+ GFAPI_PUBLIC(glfs_readdirplus, 3.5.0);
long
-glfs_telldir (glfs_fd_t *fd) __THROW
- GFAPI_PUBLIC(glfs_telldir, 3.4.0);
+glfs_telldir(glfs_fd_t *fd) __THROW GFAPI_PUBLIC(glfs_telldir, 3.4.0);
void
-glfs_seekdir (glfs_fd_t *fd, long offset) __THROW
- GFAPI_PUBLIC(glfs_seekdir, 3.4.0);
+glfs_seekdir(glfs_fd_t *fd, long offset) __THROW
+ GFAPI_PUBLIC(glfs_seekdir, 3.4.0);
int
-glfs_closedir (glfs_fd_t *fd) __THROW
- GFAPI_PUBLIC(glfs_closedir, 3.4.0);
+glfs_closedir(glfs_fd_t *fd) __THROW GFAPI_PUBLIC(glfs_closedir, 3.4.0);
int
-glfs_statvfs (glfs_t *fs, const char *path, struct statvfs *buf) __THROW
- GFAPI_PUBLIC(glfs_statvfs, 3.4.0);
+glfs_statvfs(glfs_t *fs, const char *path, struct statvfs *buf) __THROW
+ GFAPI_PUBLIC(glfs_statvfs, 3.4.0);
int
-glfs_chmod (glfs_t *fs, const char *path, mode_t mode) __THROW
- GFAPI_PUBLIC(glfs_chmod, 3.4.0);
+glfs_chmod(glfs_t *fs, const char *path, mode_t mode) __THROW
+ GFAPI_PUBLIC(glfs_chmod, 3.4.0);
int
-glfs_fchmod (glfs_fd_t *fd, mode_t mode) __THROW
- GFAPI_PUBLIC(glfs_fchmod, 3.4.0);
+glfs_fchmod(glfs_fd_t *fd, mode_t mode) __THROW
+ GFAPI_PUBLIC(glfs_fchmod, 3.4.0);
int
-glfs_chown (glfs_t *fs, const char *path, uid_t uid, gid_t gid) __THROW
- GFAPI_PUBLIC(glfs_chown, 3.4.0);
+glfs_chown(glfs_t *fs, const char *path, uid_t uid, gid_t gid) __THROW
+ GFAPI_PUBLIC(glfs_chown, 3.4.0);
int
-glfs_lchown (glfs_t *fs, const char *path, uid_t uid, gid_t gid) __THROW
- GFAPI_PUBLIC(glfs_lchown, 3.4.0);
+glfs_lchown(glfs_t *fs, const char *path, uid_t uid, gid_t gid) __THROW
+ GFAPI_PUBLIC(glfs_lchown, 3.4.0);
int
-glfs_fchown (glfs_fd_t *fd, uid_t uid, gid_t gid) __THROW
- GFAPI_PUBLIC(glfs_fchown, 3.4.0);
+glfs_fchown(glfs_fd_t *fd, uid_t uid, gid_t gid) __THROW
+ GFAPI_PUBLIC(glfs_fchown, 3.4.0);
int
-glfs_utimens (glfs_t *fs, const char *path,
- const struct timespec times[2]) __THROW
- GFAPI_PUBLIC(glfs_utimens, 3.4.0);
+glfs_utimens(glfs_t *fs, const char *path,
+ const struct timespec times[2]) __THROW
+ GFAPI_PUBLIC(glfs_utimens, 3.4.0);
int
-glfs_lutimens (glfs_t *fs, const char *path,
- const struct timespec times[2]) __THROW
- GFAPI_PUBLIC(glfs_lutimens, 3.4.0);
+glfs_lutimens(glfs_t *fs, const char *path,
+ const struct timespec times[2]) __THROW
+ GFAPI_PUBLIC(glfs_lutimens, 3.4.0);
int
-glfs_futimens (glfs_fd_t *fd, const struct timespec times[2]) __THROW
- GFAPI_PUBLIC(glfs_futimens, 3.4.0);
+glfs_futimens(glfs_fd_t *fd, const struct timespec times[2]) __THROW
+ GFAPI_PUBLIC(glfs_futimens, 3.4.0);
ssize_t
-glfs_getxattr (glfs_t *fs, const char *path, const char *name, void *value,
- size_t size) __THROW
- GFAPI_PUBLIC(glfs_getxattr, 3.4.0);
+glfs_getxattr(glfs_t *fs, const char *path, const char *name, void *value,
+ size_t size) __THROW GFAPI_PUBLIC(glfs_getxattr, 3.4.0);
ssize_t
-glfs_lgetxattr (glfs_t *fs, const char *path, const char *name, void *value,
- size_t size) __THROW
- GFAPI_PUBLIC(glfs_lgetxattr, 3.4.0);
+glfs_lgetxattr(glfs_t *fs, const char *path, const char *name, void *value,
+ size_t size) __THROW GFAPI_PUBLIC(glfs_lgetxattr, 3.4.0);
ssize_t
-glfs_fgetxattr (glfs_fd_t *fd, const char *name, void *value,
- size_t size) __THROW
- GFAPI_PUBLIC(glfs_fgetxattr, 3.4.0);
+glfs_fgetxattr(glfs_fd_t *fd, const char *name, void *value,
+ size_t size) __THROW GFAPI_PUBLIC(glfs_fgetxattr, 3.4.0);
ssize_t
-glfs_listxattr (glfs_t *fs, const char *path, void *value, size_t size) __THROW
- GFAPI_PUBLIC(glfs_listxattr, 3.4.0);
+glfs_listxattr(glfs_t *fs, const char *path, void *value, size_t size) __THROW
+ GFAPI_PUBLIC(glfs_listxattr, 3.4.0);
ssize_t
-glfs_llistxattr (glfs_t *fs, const char *path, void *value, size_t size) __THROW
- GFAPI_PUBLIC(glfs_llistxattr, 3.4.0);
+glfs_llistxattr(glfs_t *fs, const char *path, void *value, size_t size) __THROW
+ GFAPI_PUBLIC(glfs_llistxattr, 3.4.0);
ssize_t
-glfs_flistxattr (glfs_fd_t *fd, void *value, size_t size) __THROW
- GFAPI_PUBLIC(glfs_flistxattr, 3.4.0);
+glfs_flistxattr(glfs_fd_t *fd, void *value, size_t size) __THROW
+ GFAPI_PUBLIC(glfs_flistxattr, 3.4.0);
int
-glfs_setxattr (glfs_t *fs, const char *path, const char *name,
- const void *value, size_t size, int flags) __THROW
- GFAPI_PUBLIC(glfs_setxattr, 3.4.0);
+glfs_setxattr(glfs_t *fs, const char *path, const char *name, const void *value,
+ size_t size, int flags) __THROW
+ GFAPI_PUBLIC(glfs_setxattr, 3.4.0);
int
-glfs_lsetxattr (glfs_t *fs, const char *path, const char *name,
- const void *value, size_t size, int flags) __THROW
- GFAPI_PUBLIC(glfs_lsetxattr, 3.4.0);
+glfs_lsetxattr(glfs_t *fs, const char *path, const char *name,
+ const void *value, size_t size, int flags) __THROW
+ GFAPI_PUBLIC(glfs_lsetxattr, 3.4.0);
int
-glfs_fsetxattr (glfs_fd_t *fd, const char *name, const void *value,
- size_t size, int flags) __THROW
- GFAPI_PUBLIC(glfs_fsetxattr, 3.4.0);
+glfs_fsetxattr(glfs_fd_t *fd, const char *name, const void *value, size_t size,
+ int flags) __THROW GFAPI_PUBLIC(glfs_fsetxattr, 3.4.0);
int
-glfs_removexattr (glfs_t *fs, const char *path, const char *name) __THROW
- GFAPI_PUBLIC(glfs_removexattr, 3.4.0);
+glfs_removexattr(glfs_t *fs, const char *path, const char *name) __THROW
+ GFAPI_PUBLIC(glfs_removexattr, 3.4.0);
int
-glfs_lremovexattr (glfs_t *fs, const char *path, const char *name) __THROW
- GFAPI_PUBLIC(glfs_lremovexattr, 3.4.0);
+glfs_lremovexattr(glfs_t *fs, const char *path, const char *name) __THROW
+ GFAPI_PUBLIC(glfs_lremovexattr, 3.4.0);
int
-glfs_fremovexattr (glfs_fd_t *fd, const char *name) __THROW
- GFAPI_PUBLIC(glfs_fremovexattr, 3.4.0);
+glfs_fremovexattr(glfs_fd_t *fd, const char *name) __THROW
+ GFAPI_PUBLIC(glfs_fremovexattr, 3.4.0);
int
glfs_fallocate(glfs_fd_t *fd, int keep_size, off_t offset, size_t len) __THROW
- GFAPI_PUBLIC(glfs_fallocate, 3.5.0);
+ GFAPI_PUBLIC(glfs_fallocate, 3.5.0);
int
glfs_discard(glfs_fd_t *fd, off_t offset, size_t len) __THROW
- GFAPI_PUBLIC(glfs_discard, 3.5.0);
+ GFAPI_PUBLIC(glfs_discard, 3.5.0);
int
-glfs_discard_async (glfs_fd_t *fd, off_t length, size_t lent, glfs_io_cbk fn,
- void *data) __THROW
- GFAPI_PUBLIC(glfs_discard_async, future);
+glfs_discard_async(glfs_fd_t *fd, off_t length, size_t lent, glfs_io_cbk fn,
+ void *data) __THROW GFAPI_PUBLIC(glfs_discard_async, future);
int
glfs_zerofill(glfs_fd_t *fd, off_t offset, off_t len) __THROW
- GFAPI_PUBLIC(glfs_zerofill, 3.5.0);
+ GFAPI_PUBLIC(glfs_zerofill, 3.5.0);
int
-glfs_zerofill_async (glfs_fd_t *fd, off_t length, off_t len, glfs_io_cbk fn,
- void *data) __THROW
- GFAPI_PUBLIC(glfs_zerofill_async, future);
+glfs_zerofill_async(glfs_fd_t *fd, off_t length, off_t len, glfs_io_cbk fn,
+ void *data) __THROW
+ GFAPI_PUBLIC(glfs_zerofill_async, future);
-char*
-glfs_getcwd (glfs_t *fs, char *buf, size_t size) __THROW
- GFAPI_PUBLIC(glfs_getcwd, 3.4.0);
+char *
+glfs_getcwd(glfs_t *fs, char *buf, size_t size) __THROW
+ GFAPI_PUBLIC(glfs_getcwd, 3.4.0);
int
-glfs_chdir (glfs_t *fs, const char *path) __THROW
- GFAPI_PUBLIC(glfs_chdir, 3.4.0);
+glfs_chdir(glfs_t *fs, const char *path) __THROW
+ GFAPI_PUBLIC(glfs_chdir, 3.4.0);
int
-glfs_fchdir (glfs_fd_t *fd) __THROW
- GFAPI_PUBLIC(glfs_fchdir, 3.4.0);
+glfs_fchdir(glfs_fd_t *fd) __THROW GFAPI_PUBLIC(glfs_fchdir, 3.4.0);
-char*
-glfs_realpath (glfs_t *fs, const char *path, char *resolved_path) __THROW
- GFAPI_PUBLIC(glfs_realpath, 3.7.17);
+char *
+glfs_realpath(glfs_t *fs, const char *path, char *resolved_path) __THROW
+ GFAPI_PUBLIC(glfs_realpath, 3.7.17);
/*
* @cmd and @flock are as specified in man fcntl(2).
*/
int
-glfs_posix_lock (glfs_fd_t *fd, int cmd, struct flock *flock) __THROW
- GFAPI_PUBLIC(glfs_posix_lock, 3.4.0);
+glfs_posix_lock(glfs_fd_t *fd, int cmd, struct flock *flock) __THROW
+ GFAPI_PUBLIC(glfs_posix_lock, 3.4.0);
/*
SYNOPSIS
@@ -909,24 +885,19 @@ glfs_posix_lock (glfs_fd_t *fd, int cmd, struct flock *flock) __THROW
*/
/* Lock modes used by glfs_file_lock() */
-enum glfs_lock_mode {
- GLFS_LK_ADVISORY = 0,
- GLFS_LK_MANDATORY
-};
+enum glfs_lock_mode { GLFS_LK_ADVISORY = 0, GLFS_LK_MANDATORY };
typedef enum glfs_lock_mode glfs_lock_mode_t;
int
-glfs_file_lock (glfs_fd_t *fd, int cmd, struct flock *flock,
- glfs_lock_mode_t lk_mode) __THROW
- GFAPI_PUBLIC(glfs_file_lock, 3.13.0);
+glfs_file_lock(glfs_fd_t *fd, int cmd, struct flock *flock,
+ glfs_lock_mode_t lk_mode) __THROW
+ GFAPI_PUBLIC(glfs_file_lock, 3.13.0);
-glfs_fd_t*
-glfs_dup (glfs_fd_t *fd) __THROW
- GFAPI_PUBLIC(glfs_dup, 3.4.0);
+glfs_fd_t *
+glfs_dup(glfs_fd_t *fd) __THROW GFAPI_PUBLIC(glfs_dup, 3.4.0);
void
-glfs_free (void *ptr) __THROW
- GFAPI_PUBLIC(glfs_free, 3.7.16);
+glfs_free(void *ptr) __THROW GFAPI_PUBLIC(glfs_free, 3.7.16);
/*
* glfs_sysrq: send a system request to the @fs instance
@@ -939,13 +910,11 @@ glfs_free (void *ptr) __THROW
* @sysrq command will be able to return a success/failure status.
*/
int
-glfs_sysrq (glfs_t *fs, char sysrq) __THROW
- GFAPI_PUBLIC(glfs_sysrq, 3.10.0);
+glfs_sysrq(glfs_t *fs, char sysrq) __THROW GFAPI_PUBLIC(glfs_sysrq, 3.10.0);
#define GLFS_SYSRQ_HELP 'h' /* log a message with supported sysrq commands */
#define GLFS_SYSRQ_STATEDUMP 's' /* create a statedump */
-
/*
* Structure returned as part of xreaddirplus
*/
@@ -953,16 +922,17 @@ struct glfs_xreaddirp_stat;
typedef struct glfs_xreaddirp_stat glfs_xreaddirp_stat_t;
/* Request flags to be used in XREADDIRP operation */
-#define GFAPI_XREADDIRP_NULL 0x00000000 /* by default, no stat will be fetched */
-#define GFAPI_XREADDIRP_STAT 0x00000001 /* Get stat */
-#define GFAPI_XREADDIRP_HANDLE 0x00000002 /* Get object handle */
+#define GFAPI_XREADDIRP_NULL \
+ 0x00000000 /* by default, no stat will be fetched */
+#define GFAPI_XREADDIRP_STAT 0x00000001 /* Get stat */
+#define GFAPI_XREADDIRP_HANDLE 0x00000002 /* Get object handle */
/*
* This stat structure returned gets freed as part of glfs_free(xstat)
*/
-struct stat*
-glfs_xreaddirplus_get_stat (glfs_xreaddirp_stat_t *xstat) __THROW
- GFAPI_PUBLIC(glfs_xreaddirplus_get_stat, 3.11.0);
+struct stat *
+glfs_xreaddirplus_get_stat(glfs_xreaddirp_stat_t *xstat) __THROW
+ GFAPI_PUBLIC(glfs_xreaddirplus_get_stat, 3.11.0);
/*
* SYNOPSIS
@@ -1007,10 +977,10 @@ glfs_xreaddirplus_get_stat (glfs_xreaddirp_stat_t *xstat) __THROW
* -1: FAILURE
*/
int
-glfs_xreaddirplus_r (glfs_fd_t *glfd, uint32_t flags,
- glfs_xreaddirp_stat_t **xstat_p, struct dirent *ext,
- struct dirent **res) __THROW
- GFAPI_PUBLIC(glfs_xreaddirplus_r, 3.11.0);
+glfs_xreaddirplus_r(glfs_fd_t *glfd, uint32_t flags,
+ glfs_xreaddirp_stat_t **xstat_p, struct dirent *ext,
+ struct dirent **res) __THROW
+ GFAPI_PUBLIC(glfs_xreaddirplus_r, 3.11.0);
#define GFAPI_MAX_LOCK_OWNER_LEN 255
@@ -1039,8 +1009,8 @@ glfs_xreaddirplus_r (glfs_fd_t *glfd, uint32_t flags,
* -1: FAILURE
*/
int
-glfs_fd_set_lkowner (glfs_fd_t *glfd, void *data, int len) __THROW
- GFAPI_PUBLIC(glfs_fd_set_lkowner, 3.10.7);
+glfs_fd_set_lkowner(glfs_fd_t *glfd, void *data, int len) __THROW
+ GFAPI_PUBLIC(glfs_fd_set_lkowner, 3.10.7);
/*
* Applications (currently NFS-Ganesha) can make use of this
@@ -1065,20 +1035,19 @@ glfs_fd_set_lkowner (glfs_fd_t *glfd, void *data, int len) __THROW
struct glfs_upcall;
typedef struct glfs_upcall glfs_upcall_t;
-glfs_t*
-glfs_upcall_get_fs (glfs_upcall_t *arg) __THROW
- GFAPI_PUBLIC(glfs_upcall_get_fs, 3.7.16);
+glfs_t *
+glfs_upcall_get_fs(glfs_upcall_t *arg) __THROW
+ GFAPI_PUBLIC(glfs_upcall_get_fs, 3.7.16);
enum glfs_upcall_reason {
- GLFS_UPCALL_EVENT_NULL = 0,
- GLFS_UPCALL_INODE_INVALIDATE, /* invalidate cache entry */
+ GLFS_UPCALL_EVENT_NULL = 0,
+ GLFS_UPCALL_INODE_INVALIDATE, /* invalidate cache entry */
};
typedef enum glfs_upcall_reason glfs_upcall_reason_t;
glfs_upcall_reason_t
-glfs_upcall_get_reason (glfs_upcall_t *arg) __THROW
- GFAPI_PUBLIC(glfs_upcall_get_reason, 3.7.16);
-
+glfs_upcall_get_reason(glfs_upcall_t *arg) __THROW
+ GFAPI_PUBLIC(glfs_upcall_get_reason, 3.7.16);
/*
* Applications first need to make use of above API i.e,
@@ -1096,9 +1065,9 @@ glfs_upcall_get_reason (glfs_upcall_t *arg) __THROW
* After processing upcall event, glfs_free() should be called on the
* glfs_upcall.
*/
-void*
-glfs_upcall_get_event (glfs_upcall_t *arg) __THROW
- GFAPI_PUBLIC(glfs_upcall_get_event, 3.7.16);
+void *
+glfs_upcall_get_event(glfs_upcall_t *arg) __THROW
+ GFAPI_PUBLIC(glfs_upcall_get_event, 3.7.16);
/*
* SYNOPSIS
@@ -1119,13 +1088,13 @@ glfs_upcall_get_event (glfs_upcall_t *arg) __THROW
* registering of upcall events. This may be used by the caller for any
* of its internal use while processing upcalls.
*/
-typedef void (*glfs_upcall_cbk) (glfs_upcall_t *up_arg, void *data);
+typedef void (*glfs_upcall_cbk)(glfs_upcall_t *up_arg, void *data);
/*
* List of upcall events supported by gluster/gfapi
*/
-#define GLFS_EVENT_INODE_INVALIDATE 0x00000001 /* invalidate cache entry */
-#define GLFS_EVENT_ANY 0xffffffff /* for all the above events */
+#define GLFS_EVENT_INODE_INVALIDATE 0x00000001 /* invalidate cache entry */
+#define GLFS_EVENT_ANY 0xffffffff /* for all the above events */
/*
* SYNOPSIS
@@ -1161,9 +1130,9 @@ typedef void (*glfs_upcall_cbk) (glfs_upcall_t *up_arg, void *data);
* -1: FAILURE
*/
int
-glfs_upcall_register (glfs_t *fs, uint32_t event_list, glfs_upcall_cbk cbk,
- void *data) __THROW
- GFAPI_PUBLIC(glfs_upcall_register, 3.13.0);
+glfs_upcall_register(glfs_t *fs, uint32_t event_list, glfs_upcall_cbk cbk,
+ void *data) __THROW
+ GFAPI_PUBLIC(glfs_upcall_register, 3.13.0);
/*
* SYNOPSIS
@@ -1189,33 +1158,33 @@ glfs_upcall_register (glfs_t *fs, uint32_t event_list, glfs_upcall_cbk cbk,
* -1: FAILURE
*/
int
-glfs_upcall_unregister (glfs_t *fs, uint32_t event_list) __THROW
- GFAPI_PUBLIC(glfs_upcall_unregister, 3.13.0);
+glfs_upcall_unregister(glfs_t *fs, uint32_t event_list) __THROW
+ GFAPI_PUBLIC(glfs_upcall_unregister, 3.13.0);
/* Lease Types */
enum glfs_lease_types {
- GLFS_RD_LEASE = 1,
- GLFS_RW_LEASE = 2,
+ GLFS_RD_LEASE = 1,
+ GLFS_RW_LEASE = 2,
};
typedef enum glfs_lease_types glfs_lease_types_t;
/* Lease cmds */
enum glfs_lease_cmds {
- GLFS_GET_LEASE = 1,
- GLFS_SET_LEASE = 2,
- GLFS_UNLK_LEASE = 3,
+ GLFS_GET_LEASE = 1,
+ GLFS_SET_LEASE = 2,
+ GLFS_UNLK_LEASE = 3,
};
typedef enum glfs_lease_cmds glfs_lease_cmds_t;
struct glfs_lease {
- glfs_lease_cmds_t cmd;
- glfs_lease_types_t lease_type;
- glfs_leaseid_t lease_id;
- unsigned int lease_flags;
+ glfs_lease_cmds_t cmd;
+ glfs_lease_types_t lease_type;
+ glfs_leaseid_t lease_id;
+ unsigned int lease_flags;
};
typedef struct glfs_lease glfs_lease_t;
-typedef void (*glfs_recall_cbk) (glfs_lease_t lease, void *data);
+typedef void (*glfs_recall_cbk)(glfs_lease_t lease, void *data);
/*
SYNOPSIS
@@ -1260,9 +1229,9 @@ typedef void (*glfs_recall_cbk) (glfs_lease_t lease, void *data);
<0: Failure. @errno will be set with the type of failure
*/
-int glfs_lease (glfs_fd_t *glfd, glfs_lease_t *lease, glfs_recall_cbk fn,
- void *data) __THROW
- GFAPI_PUBLIC(glfs_lease, 4.0.0);
+int
+glfs_lease(glfs_fd_t *glfd, glfs_lease_t *lease, glfs_recall_cbk fn,
+ void *data) __THROW GFAPI_PUBLIC(glfs_lease, 4.0.0);
__END_DECLS
#endif /* !_GLFS_H */
diff --git a/cli/src/cli-cmd.h b/cli/src/cli-cmd.h
index 54e3686c9e1..70c864eae30 100644
--- a/cli/src/cli-cmd.h
+++ b/cli/src/cli-cmd.h
@@ -15,105 +15,118 @@
#include "cli.h"
#include "list.h"
-#define GLUSTER_SHARED_STORAGE "gluster_shared_storage"
-
-#define CLI_LOCAL_INIT(local, words, frame, dictionary) \
- do { \
- local = cli_local_get (); \
- \
- if (local) { \
- local->words = words; \
- if (dictionary) \
- local->dict = dictionary; \
- if (frame) \
- frame->local = local; \
- } \
- } while (0)
-
-#define CLI_STACK_DESTROY(_frame) \
- do { \
- if (_frame) { \
- if (_frame->local) { \
- gf_log ("cli", GF_LOG_DEBUG, "frame->local " \
- "is not NULL (%p)", _frame->local); \
- cli_local_wipe (_frame->local); \
- _frame->local = NULL; \
- } \
- STACK_DESTROY (_frame->root); \
- } \
- } while (0);
-
-typedef enum {
- GF_ANSWER_YES = 1,
- GF_ANSWER_NO = 2
-} gf_answer_t;
+#define GLUSTER_SHARED_STORAGE "gluster_shared_storage"
+
+#define CLI_LOCAL_INIT(local, words, frame, dictionary) \
+ do { \
+ local = cli_local_get(); \
+ \
+ if (local) { \
+ local->words = words; \
+ if (dictionary) \
+ local->dict = dictionary; \
+ if (frame) \
+ frame->local = local; \
+ } \
+ } while (0)
+
+#define CLI_STACK_DESTROY(_frame) \
+ do { \
+ if (_frame) { \
+ if (_frame->local) { \
+ gf_log("cli", GF_LOG_DEBUG, \
+ "frame->local " \
+ "is not NULL (%p)", \
+ _frame->local); \
+ cli_local_wipe(_frame->local); \
+ _frame->local = NULL; \
+ } \
+ STACK_DESTROY(_frame->root); \
+ } \
+ } while (0);
+
+typedef enum { GF_ANSWER_YES = 1, GF_ANSWER_NO = 2 } gf_answer_t;
struct cli_cmd {
- const char *pattern;
- cli_cmd_cbk_t *cbk;
- const char *desc;
- cli_cmd_reg_cbk_t *reg_cbk; /* callback to check in runtime if the *
- * command should be enabled or disabled */
- gf_boolean_t disable;
+ const char *pattern;
+ cli_cmd_cbk_t *cbk;
+ const char *desc;
+ cli_cmd_reg_cbk_t *reg_cbk; /* callback to check in runtime if the *
+ * command should be enabled or disabled */
+ gf_boolean_t disable;
};
struct cli_cmd_volume_get_ctx_ {
- char *volname;
- int flags;
+ char *volname;
+ int flags;
};
typedef struct cli_profile_info_ {
- uint64_t fop_hits;
- double min_latency;
- double max_latency;
- double avg_latency;
- char *fop_name;
- double percentage_avg_latency;
+ uint64_t fop_hits;
+ double min_latency;
+ double max_latency;
+ double avg_latency;
+ char *fop_name;
+ double percentage_avg_latency;
} cli_profile_info_t;
typedef struct cli_cmd_volume_get_ctx_ cli_cmd_volume_get_ctx_t;
-int cli_cmd_volume_register (struct cli_state *state);
+int
+cli_cmd_volume_register(struct cli_state *state);
-int cli_cmd_probe_register (struct cli_state *state);
+int
+cli_cmd_probe_register(struct cli_state *state);
-int cli_cmd_system_register (struct cli_state *state);
+int
+cli_cmd_system_register(struct cli_state *state);
-int cli_cmd_snapshot_register (struct cli_state *state);
+int
+cli_cmd_snapshot_register(struct cli_state *state);
-int cli_cmd_global_register (struct cli_state *state);
+int
+cli_cmd_global_register(struct cli_state *state);
-int cli_cmd_misc_register (struct cli_state *state);
+int
+cli_cmd_misc_register(struct cli_state *state);
-struct cli_cmd_word *cli_cmd_nextword (struct cli_cmd_word *word,
- const char *text);
-void cli_cmd_tokens_destroy (char **tokens);
+struct cli_cmd_word *
+cli_cmd_nextword(struct cli_cmd_word *word, const char *text);
+void
+cli_cmd_tokens_destroy(char **tokens);
-int cli_cmd_await_response (unsigned time);
+int
+cli_cmd_await_response(unsigned time);
-int cli_cmd_broadcast_response (int32_t status);
+int
+cli_cmd_broadcast_response(int32_t status);
-int cli_cmd_cond_init ();
+int
+cli_cmd_cond_init();
-int cli_cmd_lock ();
+int
+cli_cmd_lock();
-int cli_cmd_unlock ();
+int
+cli_cmd_unlock();
int
-cli_cmd_submit (struct rpc_clnt *rpc, void *req, call_frame_t *frame,
- rpc_clnt_prog_t *prog,
- int procnum, struct iobref *iobref,
- xlator_t *this, fop_cbk_fn_t cbkfn, xdrproc_t xdrproc);
+cli_cmd_submit(struct rpc_clnt *rpc, void *req, call_frame_t *frame,
+ rpc_clnt_prog_t *prog, int procnum, struct iobref *iobref,
+ xlator_t *this, fop_cbk_fn_t cbkfn, xdrproc_t xdrproc);
-int cli_cmd_pattern_cmp (void *a, void *b);
+int
+cli_cmd_pattern_cmp(void *a, void *b);
-void cli_cmd_sort (struct cli_cmd *cmd, int count);
+void
+cli_cmd_sort(struct cli_cmd *cmd, int count);
gf_answer_t
-cli_cmd_get_confirmation (struct cli_state *state, const char *question);
-int cli_cmd_sent_status_get (int *status);
+cli_cmd_get_confirmation(struct cli_state *state, const char *question);
+int
+cli_cmd_sent_status_get(int *status);
gf_boolean_t
-_limits_set_on_volume (char *volname, int type);
+_limits_set_on_volume(char *volname, int type);
#endif /* __CLI_CMD_H__ */
diff --git a/cli/src/cli-mem-types.h b/cli/src/cli-mem-types.h
index 5468b25cc0c..a762b685f0a 100644
--- a/cli/src/cli-mem-types.h
+++ b/cli/src/cli-mem-types.h
@@ -15,16 +15,16 @@
#define CLI_MEM_TYPE_START (gf_common_mt_end + 1)
enum cli_mem_types_ {
- cli_mt_xlator_list_t = CLI_MEM_TYPE_START,
- cli_mt_xlator_t,
- cli_mt_xlator_cmdline_option_t,
- cli_mt_char,
- cli_mt_call_pool_t,
- cli_mt_cli_local_t,
- cli_mt_cli_get_vol_ctx_t,
- cli_mt_append_str,
- cli_mt_cli_cmd,
- cli_mt_end
+ cli_mt_xlator_list_t = CLI_MEM_TYPE_START,
+ cli_mt_xlator_t,
+ cli_mt_xlator_cmdline_option_t,
+ cli_mt_char,
+ cli_mt_call_pool_t,
+ cli_mt_cli_local_t,
+ cli_mt_cli_get_vol_ctx_t,
+ cli_mt_append_str,
+ cli_mt_cli_cmd,
+ cli_mt_end
};
diff --git a/cli/src/cli-quotad-client.h b/cli/src/cli-quotad-client.h
index aa0b42af38d..57a998c913c 100644
--- a/cli/src/cli-quotad-client.h
+++ b/cli/src/cli-quotad-client.h
@@ -16,18 +16,14 @@
#include "protocol-common.h"
#include "cli-mem-types.h"
-
int
-cli_quotad_submit_request (void *req, call_frame_t *frame,
- rpc_clnt_prog_t *prog,
- int procnum, struct iobref *iobref,
- xlator_t *this, fop_cbk_fn_t cbkfn,
- xdrproc_t xdrproc);
+cli_quotad_submit_request(void *req, call_frame_t *frame, rpc_clnt_prog_t *prog,
+ int procnum, struct iobref *iobref, xlator_t *this,
+ fop_cbk_fn_t cbkfn, xdrproc_t xdrproc);
struct rpc_clnt *
-cli_quotad_clnt_init (xlator_t *this, dict_t *options);
+cli_quotad_clnt_init(xlator_t *this, dict_t *options);
int
-cli_quotad_notify (struct rpc_clnt *rpc, void *mydata,
- rpc_clnt_event_t event, void *data);
-
+cli_quotad_notify(struct rpc_clnt *rpc, void *mydata, rpc_clnt_event_t event,
+ void *data);
diff --git a/cli/src/cli.h b/cli/src/cli.h
index 9a392e4ec1d..bf51402dc17 100644
--- a/cli/src/cli.h
+++ b/cli/src/cli.h
@@ -23,50 +23,50 @@
#include <libxml/xmlwriter.h>
#endif
-#define DEFAULT_EVENT_POOL_SIZE 16384
-#define CLI_GLUSTERD_PORT 24007
-#define DEFAULT_CLI_LOG_FILE_DIRECTORY DATADIR "/log/glusterfs"
-#define CLI_VOL_STATUS_BRICK_LEN 43
-#define CLI_TAB_LENGTH 8
-#define CLI_BRICK_STATUS_LINE_LEN 78
+#define DEFAULT_EVENT_POOL_SIZE 16384
+#define CLI_GLUSTERD_PORT 24007
+#define DEFAULT_CLI_LOG_FILE_DIRECTORY DATADIR "/log/glusterfs"
+#define CLI_VOL_STATUS_BRICK_LEN 43
+#define CLI_TAB_LENGTH 8
+#define CLI_BRICK_STATUS_LINE_LEN 78
/* Geo-rep command positional arguments' index */
-#define GEO_REP_CMD_INDEX 1
-#define GEO_REP_CMD_CONFIG_INDEX 4
+#define GEO_REP_CMD_INDEX 1
+#define GEO_REP_CMD_CONFIG_INDEX 4
enum argp_option_keys {
- ARGP_DEBUG_KEY = 133,
- ARGP_PORT_KEY = 'p',
+ ARGP_DEBUG_KEY = 133,
+ ARGP_PORT_KEY = 'p',
};
int cli_default_conn_timeout;
int cli_ten_minutes_timeout;
typedef enum {
- COLD_BRICK_COUNT,
- COLD_TYPE,
- COLD_DIST_COUNT,
- COLD_REPLICA_COUNT,
- COLD_ARBITER_COUNT,
- COLD_DISPERSE_COUNT,
- COLD_REDUNDANCY_COUNT,
- HOT_BRICK_COUNT,
- HOT_TYPE,
- HOT_REPLICA_COUNT,
- MAX
+ COLD_BRICK_COUNT,
+ COLD_TYPE,
+ COLD_DIST_COUNT,
+ COLD_REPLICA_COUNT,
+ COLD_ARBITER_COUNT,
+ COLD_DISPERSE_COUNT,
+ COLD_REDUNDANCY_COUNT,
+ HOT_BRICK_COUNT,
+ HOT_TYPE,
+ HOT_REPLICA_COUNT,
+ MAX
} values;
-#define GLUSTER_MODE_SCRIPT (1 << 0)
-#define GLUSTER_MODE_ERR_FATAL (1 << 1)
-#define GLUSTER_MODE_XML (1 << 2)
-#define GLUSTER_MODE_WIGNORE (1 << 3)
-#define GLUSTER_MODE_WIGNORE_PARTITION (1 << 4)
+#define GLUSTER_MODE_SCRIPT (1 << 0)
+#define GLUSTER_MODE_ERR_FATAL (1 << 1)
+#define GLUSTER_MODE_XML (1 << 2)
+#define GLUSTER_MODE_WIGNORE (1 << 3)
+#define GLUSTER_MODE_WIGNORE_PARTITION (1 << 4)
-
-#define GLUSTERD_GET_QUOTA_LIST_MOUNT_PATH(abspath, volname, path) do { \
- snprintf (abspath, sizeof (abspath)-1, \
- DEFAULT_VAR_RUN_DIRECTORY"/%s_quota_list%s", volname, path);\
- } while (0)
+#define GLUSTERD_GET_QUOTA_LIST_MOUNT_PATH(abspath, volname, path) \
+ do { \
+ snprintf(abspath, sizeof(abspath) - 1, \
+ DEFAULT_VAR_RUN_DIRECTORY "/%s_quota_list%s", volname, path); \
+ } while (0)
struct cli_state;
struct cli_cmd_word;
@@ -76,421 +76,426 @@ struct cli_cmd;
extern char *cli_vol_status_str[];
extern char *cli_vol_task_status_str[];
-typedef int (cli_cmd_cbk_t)(struct cli_state *state,
- struct cli_cmd_word *word,
- const char **words,
- int wordcount);
-typedef void (cli_cmd_reg_cbk_t)( struct cli_cmd *this);
+typedef int(cli_cmd_cbk_t)(struct cli_state *state, struct cli_cmd_word *word,
+ const char **words, int wordcount);
+typedef void(cli_cmd_reg_cbk_t)(struct cli_cmd *this);
-typedef int (cli_cmd_match_t)(struct cli_cmd_word *word);
-typedef int (cli_cmd_filler_t)(struct cli_cmd_word *word);
+typedef int(cli_cmd_match_t)(struct cli_cmd_word *word);
+typedef int(cli_cmd_filler_t)(struct cli_cmd_word *word);
struct cli_cmd_word {
- struct cli_cmd_tree *tree;
- const char *word;
- cli_cmd_filler_t *filler;
- cli_cmd_match_t *match;
- cli_cmd_cbk_t *cbkfn;
- const char *desc;
- const char *pattern;
- int nextwords_cnt;
- struct cli_cmd_word **nextwords;
+ struct cli_cmd_tree *tree;
+ const char *word;
+ cli_cmd_filler_t *filler;
+ cli_cmd_match_t *match;
+ cli_cmd_cbk_t *cbkfn;
+ const char *desc;
+ const char *pattern;
+ int nextwords_cnt;
+ struct cli_cmd_word **nextwords;
};
-
struct cli_cmd_tree {
- struct cli_state *state;
- struct cli_cmd_word root;
+ struct cli_state *state;
+ struct cli_cmd_word root;
};
-
struct cli_state {
- int argc;
- char **argv;
+ int argc;
+ char **argv;
- char debug;
+ char debug;
- /* for events dispatching */
- glusterfs_ctx_t *ctx;
+ /* for events dispatching */
+ glusterfs_ctx_t *ctx;
- /* registry of known commands */
- struct cli_cmd_tree tree;
+ /* registry of known commands */
+ struct cli_cmd_tree tree;
- /* the thread which "executes" the command in non-interactive mode */
- /* also the thread which reads from stdin in non-readline mode */
- pthread_t input;
+ /* the thread which "executes" the command in non-interactive mode */
+ /* also the thread which reads from stdin in non-readline mode */
+ pthread_t input;
- /* terminal I/O */
- const char *prompt;
- int rl_enabled;
- int rl_async;
- int rl_processing;
+ /* terminal I/O */
+ const char *prompt;
+ int rl_enabled;
+ int rl_async;
+ int rl_processing;
- /* autocompletion state */
- char **matches;
- char **matchesp;
+ /* autocompletion state */
+ char **matches;
+ char **matchesp;
- char *remote_host;
- int remote_port;
- int mode;
- int await_connected;
+ char *remote_host;
+ int remote_port;
+ int mode;
+ int await_connected;
- char *log_file;
- gf_loglevel_t log_level;
+ char *log_file;
+ gf_loglevel_t log_level;
- char *glusterd_sock;
+ char *glusterd_sock;
};
struct cli_local {
- struct {
- char *volname;
- int flags;
- } get_vol;
-
- dict_t *dict;
- const char **words;
- /* Marker for volume status all */
- gf_boolean_t all;
+ struct {
+ char *volname;
+ int flags;
+ } get_vol;
+
+ dict_t *dict;
+ const char **words;
+ /* Marker for volume status all */
+ gf_boolean_t all;
#if (HAVE_LIB_XML)
- xmlTextWriterPtr writer;
- xmlDocPtr doc;
- int vol_count;
+ xmlTextWriterPtr writer;
+ xmlDocPtr doc;
+ int vol_count;
#endif
- gf_lock_t lock;
- struct list_head dict_list;
+ gf_lock_t lock;
+ struct list_head dict_list;
};
struct cli_volume_status {
- int port;
- int rdma_port;
- int online;
- uint64_t block_size;
- uint64_t total_inodes;
- uint64_t free_inodes;
- char *brick;
- char *pid_str;
- char *free;
- char *total;
- char *fs_name;
- char *mount_options;
- char *device;
- char *inode_size;
+ int port;
+ int rdma_port;
+ int online;
+ uint64_t block_size;
+ uint64_t total_inodes;
+ uint64_t free_inodes;
+ char *brick;
+ char *pid_str;
+ char *free;
+ char *total;
+ char *fs_name;
+ char *mount_options;
+ char *device;
+ char *inode_size;
};
struct snap_config_opt_vals_ {
- char *op_name;
- char *question;
+ char *op_name;
+ char *question;
};
typedef struct cli_volume_status cli_volume_status_t;
typedef struct cli_local cli_local_t;
-typedef ssize_t (*cli_serialize_t) (struct iovec outmsg, void *args);
+typedef ssize_t (*cli_serialize_t)(struct iovec outmsg, void *args);
extern struct cli_state *global_state; /* use only in readline callback */
-typedef const char *(*cli_selector_t) (void *wcon);
+typedef const char *(*cli_selector_t)(void *wcon);
-char *get_struct_variable (int mem_num, gf_gsync_status_t *sts_val);
+char *
+get_struct_variable(int mem_num, gf_gsync_status_t *sts_val);
-void *cli_getunamb (const char *tok, void **choices, cli_selector_t sel);
+void *
+cli_getunamb(const char *tok, void **choices, cli_selector_t sel);
-int cli_cmd_register (struct cli_cmd_tree *tree, struct cli_cmd *cmd);
-int cli_cmds_register (struct cli_state *state);
+int
+cli_cmd_register(struct cli_cmd_tree *tree, struct cli_cmd *cmd);
+int
+cli_cmds_register(struct cli_state *state);
-int cli_input_init (struct cli_state *state);
+int
+cli_input_init(struct cli_state *state);
-int cli_cmd_process (struct cli_state *state, int argc, char *argv[]);
-int cli_cmd_process_line (struct cli_state *state, const char *line);
+int
+cli_cmd_process(struct cli_state *state, int argc, char *argv[]);
+int
+cli_cmd_process_line(struct cli_state *state, const char *line);
-int cli_rl_enable (struct cli_state *state);
-int cli_rl_out (struct cli_state *state, const char *fmt, va_list ap);
-int cli_rl_err (struct cli_state *state, const char *fmt, va_list ap);
+int
+cli_rl_enable(struct cli_state *state);
+int
+cli_rl_out(struct cli_state *state, const char *fmt, va_list ap);
+int
+cli_rl_err(struct cli_state *state, const char *fmt, va_list ap);
-int cli_usage_out (const char *usage);
+int
+cli_usage_out(const char *usage);
-int _cli_out (const char *fmt, ...);
-int _cli_err (const char *fmt, ...);
+int
+_cli_out(const char *fmt, ...);
+int
+_cli_err(const char *fmt, ...);
-#define cli_out(fmt...) do { \
- FMT_WARN (fmt); \
- \
- _cli_out(fmt); \
- \
- } while (0)
+#define cli_out(fmt...) \
+ do { \
+ FMT_WARN(fmt); \
+ \
+ _cli_out(fmt); \
+ \
+ } while (0)
-#define cli_err(fmt...) do { \
- FMT_WARN (fmt); \
- \
- _cli_err(fmt); \
- \
- } while (0)
+#define cli_err(fmt...) \
+ do { \
+ FMT_WARN(fmt); \
+ \
+ _cli_err(fmt); \
+ \
+ } while (0)
int
-cli_submit_request (struct rpc_clnt *rpc, void *req, call_frame_t *frame,
- rpc_clnt_prog_t *prog,
- int procnum, struct iobref *iobref,
- xlator_t *this, fop_cbk_fn_t cbkfn, xdrproc_t xdrproc);
+cli_submit_request(struct rpc_clnt *rpc, void *req, call_frame_t *frame,
+ rpc_clnt_prog_t *prog, int procnum, struct iobref *iobref,
+ xlator_t *this, fop_cbk_fn_t cbkfn, xdrproc_t xdrproc);
int32_t
-cli_cmd_volume_create_parse (struct cli_state *state, const char **words,
- int wordcount, dict_t **options, char **bricks);
+cli_cmd_volume_create_parse(struct cli_state *state, const char **words,
+ int wordcount, dict_t **options, char **bricks);
int32_t
-cli_cmd_volume_reset_parse (const char **words, int wordcount, dict_t **opt);
+cli_cmd_volume_reset_parse(const char **words, int wordcount, dict_t **opt);
int32_t
-cli_cmd_gsync_set_parse (const char **words, int wordcount, dict_t **opt);
+cli_cmd_gsync_set_parse(const char **words, int wordcount, dict_t **opt);
int32_t
-cli_cmd_quota_parse (const char **words, int wordcount, dict_t **opt);
+cli_cmd_quota_parse(const char **words, int wordcount, dict_t **opt);
int32_t
-cli_cmd_inode_quota_parse (const char **words, int wordcount, dict_t **opt);
+cli_cmd_inode_quota_parse(const char **words, int wordcount, dict_t **opt);
int32_t
-cli_cmd_bitrot_parse (const char **words, int wordcount, dict_t **opt);
+cli_cmd_bitrot_parse(const char **words, int wordcount, dict_t **opt);
int32_t
-cli_cmd_volume_set_parse (struct cli_state *state, const char **words,
- int wordcount, dict_t **options, char **op_errstr);
+cli_cmd_volume_set_parse(struct cli_state *state, const char **words,
+ int wordcount, dict_t **options, char **op_errstr);
int32_t
-cli_cmd_get_state_parse (struct cli_state *state, const char **words,
- int wordcount, dict_t **options, char **op_errstr);
+cli_cmd_get_state_parse(struct cli_state *state, const char **words,
+ int wordcount, dict_t **options, char **op_errstr);
int32_t
-cli_cmd_volume_add_brick_parse (struct cli_state *state, const char **words,
- int wordcount, dict_t **options, int *type);
+cli_cmd_volume_add_brick_parse(struct cli_state *state, const char **words,
+ int wordcount, dict_t **options, int *type);
int32_t
-cli_cmd_volume_detach_tier_parse (const char **words, int wordcount,
- dict_t **options, int *question);
+cli_cmd_volume_detach_tier_parse(const char **words, int wordcount,
+ dict_t **options, int *question);
int32_t
-cli_cmd_volume_tier_parse (const char **words, int wordcount,
- dict_t **options);
+cli_cmd_volume_tier_parse(const char **words, int wordcount, dict_t **options);
int32_t
-cli_cmd_volume_old_tier_parse (const char **words, int wordcount,
- dict_t **options);
+cli_cmd_volume_old_tier_parse(const char **words, int wordcount,
+ dict_t **options);
int32_t
-cli_cmd_volume_remove_brick_parse (struct cli_state *state, const char **words,
- int wordcount, dict_t **options,
- int *question, int *brick_count,
- int32_t *command);
+cli_cmd_volume_remove_brick_parse(struct cli_state *state, const char **words,
+ int wordcount, dict_t **options,
+ int *question, int *brick_count,
+ int32_t *command);
int32_t
-cli_cmd_volume_replace_brick_parse (const char **words, int wordcount,
+cli_cmd_volume_replace_brick_parse(const char **words, int wordcount,
dict_t **options);
int32_t
-cli_cmd_volume_reset_brick_parse (const char **words, int wordcount,
- dict_t **options);
+cli_cmd_volume_reset_brick_parse(const char **words, int wordcount,
+ dict_t **options);
int32_t
-cli_cmd_log_rotate_parse (const char **words, int wordcount, dict_t **options);
+cli_cmd_log_rotate_parse(const char **words, int wordcount, dict_t **options);
int32_t
-cli_cmd_log_locate_parse (const char **words, int wordcount, dict_t **options);
+cli_cmd_log_locate_parse(const char **words, int wordcount, dict_t **options);
int32_t
-cli_cmd_log_filename_parse (const char **words, int wordcount, dict_t **options);
+cli_cmd_log_filename_parse(const char **words, int wordcount, dict_t **options);
int32_t
-cli_cmd_volume_statedump_options_parse (const char **words, int wordcount,
- dict_t **options);
+cli_cmd_volume_statedump_options_parse(const char **words, int wordcount,
+ dict_t **options);
int32_t
-cli_cmd_volume_clrlks_opts_parse (const char **words, int wordcount,
- dict_t **options);
+cli_cmd_volume_clrlks_opts_parse(const char **words, int wordcount,
+ dict_t **options);
-cli_local_t * cli_local_get ();
+cli_local_t *
+cli_local_get();
void
-cli_local_wipe (cli_local_t *local);
+cli_local_wipe(cli_local_t *local);
int32_t
-cli_cmd_await_connected ();
+cli_cmd_await_connected();
int32_t
-cli_cmd_broadcast_connected ();
+cli_cmd_broadcast_connected();
int
-cli_rpc_notify (struct rpc_clnt *rpc, void *mydata, rpc_clnt_event_t event,
- void *data);
+cli_rpc_notify(struct rpc_clnt *rpc, void *mydata, rpc_clnt_event_t event,
+ void *data);
int32_t
-cli_cmd_volume_profile_parse (const char **words, int wordcount,
- dict_t **options);
+cli_cmd_volume_profile_parse(const char **words, int wordcount,
+ dict_t **options);
int32_t
-cli_cmd_volume_top_parse (const char **words, int wordcount,
- dict_t **options);
+cli_cmd_volume_top_parse(const char **words, int wordcount, dict_t **options);
int32_t
-cli_cmd_log_level_parse (const char **words, int wordcount,
- dict_t **options);
+cli_cmd_log_level_parse(const char **words, int wordcount, dict_t **options);
int32_t
-cli_cmd_volume_status_parse (const char **words, int wordcount,
- dict_t **options);
+cli_cmd_volume_status_parse(const char **words, int wordcount,
+ dict_t **options);
int
-cli_cmd_volume_heal_options_parse (const char **words, int wordcount,
- dict_t **options);
+cli_cmd_volume_heal_options_parse(const char **words, int wordcount,
+ dict_t **options);
int
-cli_cmd_volume_defrag_parse (const char **words, int wordcount,
- dict_t **options);
+cli_cmd_volume_defrag_parse(const char **words, int wordcount,
+ dict_t **options);
int
-cli_print_brick_status (cli_volume_status_t *status);
+cli_print_brick_status(cli_volume_status_t *status);
void
-cli_print_detailed_status (cli_volume_status_t *status);
+cli_print_detailed_status(cli_volume_status_t *status);
int
-cli_get_detail_status (dict_t *dict, int i, cli_volume_status_t *status);
+cli_get_detail_status(dict_t *dict, int i, cli_volume_status_t *status);
void
-cli_print_line (int len);
+cli_print_line(int len);
int
-cli_xml_output_str (char *op, char *str, int op_ret, int op_errno,
- char *op_errstr);
+cli_xml_output_str(char *op, char *str, int op_ret, int op_errno,
+ char *op_errstr);
int
-cli_xml_output_dict (char *op, dict_t *dict, int op_ret, int op_errno,
- char *op_errstr);
+cli_xml_output_dict(char *op, dict_t *dict, int op_ret, int op_errno,
+ char *op_errstr);
int
-cli_xml_output_vol_top (dict_t *dict, int op_ret, int op_errno,
- char *op_errstr);
+cli_xml_output_vol_top(dict_t *dict, int op_ret, int op_errno, char *op_errstr);
int
-cli_xml_output_vol_profile (dict_t *dict, int op_ret, int op_errno,
- char *op_errstr);
+cli_xml_output_vol_profile(dict_t *dict, int op_ret, int op_errno,
+ char *op_errstr);
int
-cli_xml_output_vol_status_begin (cli_local_t *local, int op_ret, int op_errno,
- char *op_errstr);
+cli_xml_output_vol_status_begin(cli_local_t *local, int op_ret, int op_errno,
+ char *op_errstr);
int
-cli_xml_output_vol_status_end (cli_local_t *local);
+cli_xml_output_vol_status_end(cli_local_t *local);
int
-cli_xml_output_vol_status (cli_local_t *local, dict_t *dict);
+cli_xml_output_vol_status(cli_local_t *local, dict_t *dict);
int
-cli_xml_output_vol_list (dict_t *dict, int op_ret, int op_errno,
- char *op_errstr);
+cli_xml_output_vol_list(dict_t *dict, int op_ret, int op_errno,
+ char *op_errstr);
int
-cli_xml_output_vol_info_begin (cli_local_t *local, int op_ret, int op_errno,
- char *op_errstr);
+cli_xml_output_vol_info_begin(cli_local_t *local, int op_ret, int op_errno,
+ char *op_errstr);
int
-cli_xml_output_vol_info_end (cli_local_t *local);
+cli_xml_output_vol_info_end(cli_local_t *local);
int
-cli_xml_output_vol_info (cli_local_t *local, dict_t *dict);
+cli_xml_output_vol_info(cli_local_t *local, dict_t *dict);
int
-cli_xml_output_vol_quota_limit_list_begin (cli_local_t *local, int op_ret,
- int op_errno, char *op_errstr);
+cli_xml_output_vol_quota_limit_list_begin(cli_local_t *local, int op_ret,
+ int op_errno, char *op_errstr);
int
-cli_xml_output_vol_quota_limit_list_end (cli_local_t *local);
+cli_xml_output_vol_quota_limit_list_end(cli_local_t *local);
int
-cli_quota_list_xml_error (cli_local_t *local, char *path,
- char *errstr);
+cli_quota_list_xml_error(cli_local_t *local, char *path, char *errstr);
int
-cli_quota_xml_output (cli_local_t *local, char *path, int64_t hl_str,
- char *sl_final, int64_t sl_num, int64_t used,
- int64_t avail, char *sl, char *hl,
- gf_boolean_t limit_set);
+cli_quota_xml_output(cli_local_t *local, char *path, int64_t hl_str,
+ char *sl_final, int64_t sl_num, int64_t used,
+ int64_t avail, char *sl, char *hl, gf_boolean_t limit_set);
int
-cli_quota_object_xml_output (cli_local_t *local, char *path, char *sl_str,
- int64_t sl_val, quota_limits_t *limits,
- quota_meta_t *used_space, int64_t avail,
- char *sl, char *hl, gf_boolean_t limit_set);
+cli_quota_object_xml_output(cli_local_t *local, char *path, char *sl_str,
+ int64_t sl_val, quota_limits_t *limits,
+ quota_meta_t *used_space, int64_t avail, char *sl,
+ char *hl, gf_boolean_t limit_set);
int
-cli_xml_output_peer_status (dict_t *dict, int op_ret, int op_errno,
- char *op_errstr);
+cli_xml_output_peer_status(dict_t *dict, int op_ret, int op_errno,
+ char *op_errstr);
int
-cli_xml_output_vol_rebalance (gf_cli_defrag_type op, dict_t *dict, int op_ret,
- int op_errno, char *op_errstr);
+cli_xml_output_vol_rebalance(gf_cli_defrag_type op, dict_t *dict, int op_ret,
+ int op_errno, char *op_errstr);
int
-cli_xml_output_vol_remove_brick_detach_tier (gf_boolean_t status_op,
- dict_t *dict, int op_ret,
- int op_errno, char *op_errstr,
- const char *op);
+cli_xml_output_vol_remove_brick_detach_tier(gf_boolean_t status_op,
+ dict_t *dict, int op_ret,
+ int op_errno, char *op_errstr,
+ const char *op);
int
-cli_xml_output_vol_replace_brick (dict_t *dict, int op_ret,
- int op_errno, char *op_errstr);
+cli_xml_output_vol_replace_brick(dict_t *dict, int op_ret, int op_errno,
+ char *op_errstr);
int
-cli_xml_output_vol_create (dict_t *dict, int op_ret, int op_errno,
- char *op_errstr);
+cli_xml_output_vol_create(dict_t *dict, int op_ret, int op_errno,
+ char *op_errstr);
int
-cli_xml_output_generic_volume (char *op, dict_t *dict, int op_ret, int op_errno,
- char *op_errstr);
+cli_xml_output_generic_volume(char *op, dict_t *dict, int op_ret, int op_errno,
+ char *op_errstr);
int
-cli_xml_output_vol_gsync (dict_t *dict, int op_ret, int op_errno,
- char *op_errstr);
+cli_xml_output_vol_gsync(dict_t *dict, int op_ret, int op_errno,
+ char *op_errstr);
int
-cli_xml_output_vol_status_tasks_detail (cli_local_t *local, dict_t *dict);
+cli_xml_output_vol_status_tasks_detail(cli_local_t *local, dict_t *dict);
int
-cli_xml_snapshot_delete (cli_local_t *local, dict_t *dict, gf_cli_rsp *rsp);
+cli_xml_snapshot_delete(cli_local_t *local, dict_t *dict, gf_cli_rsp *rsp);
int
-cli_xml_snapshot_begin_composite_op (cli_local_t *local);
+cli_xml_snapshot_begin_composite_op(cli_local_t *local);
int
-cli_xml_snapshot_end_composite_op (cli_local_t *local);
+cli_xml_snapshot_end_composite_op(cli_local_t *local);
int
-cli_xml_output_snap_delete_begin (cli_local_t *local, int op_ret, int op_errno,
- char *op_errstr);
+cli_xml_output_snap_delete_begin(cli_local_t *local, int op_ret, int op_errno,
+ char *op_errstr);
int
-cli_xml_output_snap_delete_end (cli_local_t *local);
+cli_xml_output_snap_delete_end(cli_local_t *local);
int
-cli_xml_output_snap_status_begin (cli_local_t *local, int op_ret, int op_errno,
- char *op_errstr);
+cli_xml_output_snap_status_begin(cli_local_t *local, int op_ret, int op_errno,
+ char *op_errstr);
int
-cli_xml_output_snap_status_end (cli_local_t *local);
+cli_xml_output_snap_status_end(cli_local_t *local);
int
-cli_xml_output_snapshot (int cmd_type, dict_t *dict, int op_ret,
- int op_errno, char *op_errstr);
+cli_xml_output_snapshot(int cmd_type, dict_t *dict, int op_ret, int op_errno,
+ char *op_errstr);
int
-cli_xml_snapshot_status_single_snap (cli_local_t *local, dict_t *dict,
- char *key);
+cli_xml_snapshot_status_single_snap(cli_local_t *local, dict_t *dict,
+ char *key);
char *
-is_server_debug_xlator (void *myframe);
+is_server_debug_xlator(void *myframe);
int32_t
-cli_cmd_snapshot_parse (const char **words, int wordcount, dict_t **options,
- struct cli_state *state);
+cli_cmd_snapshot_parse(const char **words, int wordcount, dict_t **options,
+ struct cli_state *state);
int
-cli_xml_output_vol_getopts (dict_t *dict, int op_ret, int op_errno,
- char *op_errstr);
+cli_xml_output_vol_getopts(dict_t *dict, int op_ret, int op_errno,
+ char *op_errstr);
void
-print_quota_list_header (int type);
+print_quota_list_header(int type);
void
-print_quota_list_empty (char *path, int type);
+print_quota_list_empty(char *path, int type);
int
-gf_gsync_status_t_comparator (const void *p, const void *q);
+gf_gsync_status_t_comparator(const void *p, const void *q);
#endif /* __CLI_H__ */
diff --git a/geo-replication/src/procdiggy.h b/geo-replication/src/procdiggy.h
index 56dfc4eb213..e17ccd31c89 100644
--- a/geo-replication/src/procdiggy.h
+++ b/geo-replication/src/procdiggy.h
@@ -13,8 +13,9 @@
#define PROC "/proc"
-pid_t pidinfo (pid_t pid, char **name);
-
-int prociter (int (*proch) (pid_t pid, pid_t ppid, char *name, void *data),
- void *data);
+pid_t
+pidinfo(pid_t pid, char **name);
+int
+prociter(int (*proch)(pid_t pid, pid_t ppid, char *name, void *data),
+ void *data);
diff --git a/glusterfsd/src/glusterfsd-mem-types.h b/glusterfsd/src/glusterfsd-mem-types.h
index 7135c0ada9e..8df01c475cb 100644
--- a/glusterfsd/src/glusterfsd-mem-types.h
+++ b/glusterfsd/src/glusterfsd-mem-types.h
@@ -15,13 +15,13 @@
#define GF_MEM_TYPE_START (gf_common_mt_end + 1)
enum gfd_mem_types_ {
- gfd_mt_xlator_list_t = GF_MEM_TYPE_START,
- gfd_mt_xlator_t,
- gfd_mt_server_cmdline_t,
- gfd_mt_xlator_cmdline_option_t,
- gfd_mt_char,
- gfd_mt_call_pool_t,
- gfd_mt_end
+ gfd_mt_xlator_list_t = GF_MEM_TYPE_START,
+ gfd_mt_xlator_t,
+ gfd_mt_server_cmdline_t,
+ gfd_mt_xlator_cmdline_option_t,
+ gfd_mt_char,
+ gfd_mt_call_pool_t,
+ gfd_mt_end
};
#endif
diff --git a/glusterfsd/src/glusterfsd-messages.h b/glusterfsd/src/glusterfsd-messages.h
index e7df714064a..4adc9fd030a 100644
--- a/glusterfsd/src/glusterfsd-messages.h
+++ b/glusterfsd/src/glusterfsd-messages.h
@@ -23,46 +23,18 @@
* glfs-message-id.h.
*/
-GLFS_MSGID(GLUSTERFSD,
- glusterfsd_msg_1,
- glusterfsd_msg_2,
- glusterfsd_msg_3,
- glusterfsd_msg_4,
- glusterfsd_msg_5,
- glusterfsd_msg_6,
- glusterfsd_msg_7,
- glusterfsd_msg_8,
- glusterfsd_msg_9,
- glusterfsd_msg_10,
- glusterfsd_msg_11,
- glusterfsd_msg_12,
- glusterfsd_msg_13,
- glusterfsd_msg_14,
- glusterfsd_msg_15,
- glusterfsd_msg_16,
- glusterfsd_msg_17,
- glusterfsd_msg_18,
- glusterfsd_msg_19,
- glusterfsd_msg_20,
- glusterfsd_msg_21,
- glusterfsd_msg_22,
- glusterfsd_msg_23,
- glusterfsd_msg_24,
- glusterfsd_msg_25,
- glusterfsd_msg_26,
- glusterfsd_msg_27,
- glusterfsd_msg_28,
- glusterfsd_msg_29,
- glusterfsd_msg_30,
- glusterfsd_msg_31,
- glusterfsd_msg_32,
- glusterfsd_msg_33,
- glusterfsd_msg_34,
- glusterfsd_msg_35,
- glusterfsd_msg_36,
- glusterfsd_msg_37,
- glusterfsd_msg_38,
- glusterfsd_msg_39
-);
+GLFS_MSGID(GLUSTERFSD, glusterfsd_msg_1, glusterfsd_msg_2, glusterfsd_msg_3,
+ glusterfsd_msg_4, glusterfsd_msg_5, glusterfsd_msg_6,
+ glusterfsd_msg_7, glusterfsd_msg_8, glusterfsd_msg_9,
+ glusterfsd_msg_10, glusterfsd_msg_11, glusterfsd_msg_12,
+ glusterfsd_msg_13, glusterfsd_msg_14, glusterfsd_msg_15,
+ glusterfsd_msg_16, glusterfsd_msg_17, glusterfsd_msg_18,
+ glusterfsd_msg_19, glusterfsd_msg_20, glusterfsd_msg_21,
+ glusterfsd_msg_22, glusterfsd_msg_23, glusterfsd_msg_24,
+ glusterfsd_msg_25, glusterfsd_msg_26, glusterfsd_msg_27,
+ glusterfsd_msg_28, glusterfsd_msg_29, glusterfsd_msg_30,
+ glusterfsd_msg_31, glusterfsd_msg_32, glusterfsd_msg_33,
+ glusterfsd_msg_34, glusterfsd_msg_35, glusterfsd_msg_36,
+ glusterfsd_msg_37, glusterfsd_msg_38, glusterfsd_msg_39);
#endif /* !_GLUSTERFSD_MESSAGES_H_ */
diff --git a/glusterfsd/src/glusterfsd.h b/glusterfsd/src/glusterfsd.h
index 72936371a55..28d46fc68b9 100644
--- a/glusterfsd/src/glusterfsd.h
+++ b/glusterfsd/src/glusterfsd.h
@@ -13,126 +13,131 @@
#include "rpcsvc.h"
#include "glusterd1-xdr.h"
-#define DEFAULT_GLUSTERD_VOLFILE CONFDIR "/glusterd.vol"
-#define DEFAULT_CLIENT_VOLFILE CONFDIR "/glusterfs.vol"
-#define DEFAULT_SERVER_VOLFILE CONFDIR "/glusterfsd.vol"
+#define DEFAULT_GLUSTERD_VOLFILE CONFDIR "/glusterd.vol"
+#define DEFAULT_CLIENT_VOLFILE CONFDIR "/glusterfs.vol"
+#define DEFAULT_SERVER_VOLFILE CONFDIR "/glusterfsd.vol"
-#define DEFAULT_EVENT_POOL_SIZE 16384
+#define DEFAULT_EVENT_POOL_SIZE 16384
-#define ARGP_LOG_LEVEL_NONE_OPTION "NONE"
-#define ARGP_LOG_LEVEL_TRACE_OPTION "TRACE"
-#define ARGP_LOG_LEVEL_CRITICAL_OPTION "CRITICAL"
-#define ARGP_LOG_LEVEL_ERROR_OPTION "ERROR"
-#define ARGP_LOG_LEVEL_WARNING_OPTION "WARNING"
-#define ARGP_LOG_LEVEL_INFO_OPTION "INFO"
-#define ARGP_LOG_LEVEL_DEBUG_OPTION "DEBUG"
+#define ARGP_LOG_LEVEL_NONE_OPTION "NONE"
+#define ARGP_LOG_LEVEL_TRACE_OPTION "TRACE"
+#define ARGP_LOG_LEVEL_CRITICAL_OPTION "CRITICAL"
+#define ARGP_LOG_LEVEL_ERROR_OPTION "ERROR"
+#define ARGP_LOG_LEVEL_WARNING_OPTION "WARNING"
+#define ARGP_LOG_LEVEL_INFO_OPTION "INFO"
+#define ARGP_LOG_LEVEL_DEBUG_OPTION "DEBUG"
-#define ENABLE_NO_DAEMON_MODE 1
-#define ENABLE_DEBUG_MODE 1
+#define ENABLE_NO_DAEMON_MODE 1
+#define ENABLE_DEBUG_MODE 1
-#define GF_MEMPOOL_COUNT_OF_DICT_T 4096
+#define GF_MEMPOOL_COUNT_OF_DICT_T 4096
/* Considering 4 key/value pairs in a dictionary on an average */
-#define GF_MEMPOOL_COUNT_OF_DATA_T (GF_MEMPOOL_COUNT_OF_DICT_T * 4)
-#define GF_MEMPOOL_COUNT_OF_DATA_PAIR_T (GF_MEMPOOL_COUNT_OF_DICT_T * 4)
+#define GF_MEMPOOL_COUNT_OF_DATA_T (GF_MEMPOOL_COUNT_OF_DICT_T * 4)
+#define GF_MEMPOOL_COUNT_OF_DATA_PAIR_T (GF_MEMPOOL_COUNT_OF_DICT_T * 4)
-#define GF_MEMPOOL_COUNT_OF_LRU_BUF_T 256
+#define GF_MEMPOOL_COUNT_OF_LRU_BUF_T 256
enum argp_option_keys {
- ARGP_VOLFILE_SERVER_KEY = 's',
- ARGP_VOLUME_FILE_KEY = 'f',
- ARGP_LOG_LEVEL_KEY = 'L',
- ARGP_LOG_FILE_KEY = 'l',
- ARGP_VOLFILE_SERVER_PORT_KEY = 131,
- ARGP_VOLFILE_SERVER_TRANSPORT_KEY = 132,
- ARGP_PID_FILE_KEY = 'p',
- ARGP_SOCK_FILE_KEY = 'S',
- ARGP_NO_DAEMON_KEY = 'N',
- ARGP_RUN_ID_KEY = 'r',
- ARGP_PRINT_NETGROUPS = 'n',
- ARGP_PRINT_EXPORTS = 'e',
- ARGP_DEBUG_KEY = 133,
- ARGP_NEGATIVE_TIMEOUT_KEY = 134,
- ARGP_ENTRY_TIMEOUT_KEY = 135,
- ARGP_ATTRIBUTE_TIMEOUT_KEY = 136,
- ARGP_VOLUME_NAME_KEY = 137,
- ARGP_XLATOR_OPTION_KEY = 138,
- ARGP_DIRECT_IO_MODE_KEY = 139,
+ ARGP_VOLFILE_SERVER_KEY = 's',
+ ARGP_VOLUME_FILE_KEY = 'f',
+ ARGP_LOG_LEVEL_KEY = 'L',
+ ARGP_LOG_FILE_KEY = 'l',
+ ARGP_VOLFILE_SERVER_PORT_KEY = 131,
+ ARGP_VOLFILE_SERVER_TRANSPORT_KEY = 132,
+ ARGP_PID_FILE_KEY = 'p',
+ ARGP_SOCK_FILE_KEY = 'S',
+ ARGP_NO_DAEMON_KEY = 'N',
+ ARGP_RUN_ID_KEY = 'r',
+ ARGP_PRINT_NETGROUPS = 'n',
+ ARGP_PRINT_EXPORTS = 'e',
+ ARGP_DEBUG_KEY = 133,
+ ARGP_NEGATIVE_TIMEOUT_KEY = 134,
+ ARGP_ENTRY_TIMEOUT_KEY = 135,
+ ARGP_ATTRIBUTE_TIMEOUT_KEY = 136,
+ ARGP_VOLUME_NAME_KEY = 137,
+ ARGP_XLATOR_OPTION_KEY = 138,
+ ARGP_DIRECT_IO_MODE_KEY = 139,
#ifdef GF_DARWIN_HOST_OS
- ARGP_NON_LOCAL_KEY = 140,
+ ARGP_NON_LOCAL_KEY = 140,
#endif /* DARWIN */
- ARGP_VOLFILE_ID_KEY = 143,
- ARGP_VOLFILE_CHECK_KEY = 144,
- ARGP_VOLFILE_MAX_FETCH_ATTEMPTS = 145,
- ARGP_LOG_SERVER_KEY = 146,
- ARGP_LOG_SERVER_PORT_KEY = 147,
- ARGP_READ_ONLY_KEY = 148,
- ARGP_MAC_COMPAT_KEY = 149,
- ARGP_DUMP_FUSE_KEY = 150,
- ARGP_BRICK_NAME_KEY = 151,
- ARGP_BRICK_PORT_KEY = 152,
- ARGP_CLIENT_PID_KEY = 153,
- ARGP_ACL_KEY = 154,
- ARGP_WORM_KEY = 155,
- ARGP_USER_MAP_ROOT_KEY = 156,
- ARGP_MEM_ACCOUNTING_KEY = 157,
- ARGP_SELINUX_KEY = 158,
- ARGP_FOPEN_KEEP_CACHE_KEY = 159,
- ARGP_GID_TIMEOUT_KEY = 160,
- ARGP_FUSE_BACKGROUND_QLEN_KEY = 161,
- ARGP_FUSE_CONGESTION_THRESHOLD_KEY = 162,
- ARGP_INODE32_KEY = 163,
- ARGP_FUSE_MOUNTOPTS_KEY = 164,
- ARGP_FUSE_USE_READDIRP_KEY = 165,
- ARGP_AUX_GFID_MOUNT_KEY = 166,
- ARGP_FUSE_NO_ROOT_SQUASH_KEY = 167,
- ARGP_LOGGER = 168,
- ARGP_LOG_FORMAT = 169,
- ARGP_LOG_BUF_SIZE = 170,
- ARGP_LOG_FLUSH_TIMEOUT = 171,
- ARGP_SECURE_MGMT_KEY = 172,
- ARGP_GLOBAL_TIMER_WHEEL = 173,
- ARGP_RESOLVE_GIDS_KEY = 174,
- ARGP_CAPABILITY_KEY = 175,
+ ARGP_VOLFILE_ID_KEY = 143,
+ ARGP_VOLFILE_CHECK_KEY = 144,
+ ARGP_VOLFILE_MAX_FETCH_ATTEMPTS = 145,
+ ARGP_LOG_SERVER_KEY = 146,
+ ARGP_LOG_SERVER_PORT_KEY = 147,
+ ARGP_READ_ONLY_KEY = 148,
+ ARGP_MAC_COMPAT_KEY = 149,
+ ARGP_DUMP_FUSE_KEY = 150,
+ ARGP_BRICK_NAME_KEY = 151,
+ ARGP_BRICK_PORT_KEY = 152,
+ ARGP_CLIENT_PID_KEY = 153,
+ ARGP_ACL_KEY = 154,
+ ARGP_WORM_KEY = 155,
+ ARGP_USER_MAP_ROOT_KEY = 156,
+ ARGP_MEM_ACCOUNTING_KEY = 157,
+ ARGP_SELINUX_KEY = 158,
+ ARGP_FOPEN_KEEP_CACHE_KEY = 159,
+ ARGP_GID_TIMEOUT_KEY = 160,
+ ARGP_FUSE_BACKGROUND_QLEN_KEY = 161,
+ ARGP_FUSE_CONGESTION_THRESHOLD_KEY = 162,
+ ARGP_INODE32_KEY = 163,
+ ARGP_FUSE_MOUNTOPTS_KEY = 164,
+ ARGP_FUSE_USE_READDIRP_KEY = 165,
+ ARGP_AUX_GFID_MOUNT_KEY = 166,
+ ARGP_FUSE_NO_ROOT_SQUASH_KEY = 167,
+ ARGP_LOGGER = 168,
+ ARGP_LOG_FORMAT = 169,
+ ARGP_LOG_BUF_SIZE = 170,
+ ARGP_LOG_FLUSH_TIMEOUT = 171,
+ ARGP_SECURE_MGMT_KEY = 172,
+ ARGP_GLOBAL_TIMER_WHEEL = 173,
+ ARGP_RESOLVE_GIDS_KEY = 174,
+ ARGP_CAPABILITY_KEY = 175,
#ifdef GF_LINUX_HOST_OS
- ARGP_OOM_SCORE_ADJ_KEY = 176,
+ ARGP_OOM_SCORE_ADJ_KEY = 176,
#endif
- ARGP_LOCALTIME_LOGGING_KEY = 177,
- ARGP_SUBDIR_MOUNT_KEY = 178,
- ARGP_PROCESS_NAME_KEY = 179,
- ARGP_FUSE_EVENT_HISTORY_KEY = 180,
- ARGP_THIN_CLIENT_KEY = 181,
- ARGP_READER_THREAD_COUNT_KEY = 182,
- ARGP_PRINT_XLATORDIR_KEY = 183,
- ARGP_PRINT_STATEDUMPDIR_KEY = 184,
- ARGP_PRINT_LOGDIR_KEY = 185,
- ARGP_KERNEL_WRITEBACK_CACHE_KEY = 186,
- ARGP_ATTR_TIMES_GRANULARITY_KEY = 187,
- ARGP_PRINT_LIBEXECDIR_KEY = 188,
+ ARGP_LOCALTIME_LOGGING_KEY = 177,
+ ARGP_SUBDIR_MOUNT_KEY = 178,
+ ARGP_PROCESS_NAME_KEY = 179,
+ ARGP_FUSE_EVENT_HISTORY_KEY = 180,
+ ARGP_THIN_CLIENT_KEY = 181,
+ ARGP_READER_THREAD_COUNT_KEY = 182,
+ ARGP_PRINT_XLATORDIR_KEY = 183,
+ ARGP_PRINT_STATEDUMPDIR_KEY = 184,
+ ARGP_PRINT_LOGDIR_KEY = 185,
+ ARGP_KERNEL_WRITEBACK_CACHE_KEY = 186,
+ ARGP_ATTR_TIMES_GRANULARITY_KEY = 187,
+ ARGP_PRINT_LIBEXECDIR_KEY = 188,
};
struct _gfd_vol_top_priv {
- rpcsvc_request_t *req;
- gd1_mgmt_brick_op_req xlator_req;
- uint32_t blk_count;
- uint32_t blk_size;
- double throughput;
- double time;
- int32_t ret;
+ rpcsvc_request_t *req;
+ gd1_mgmt_brick_op_req xlator_req;
+ uint32_t blk_count;
+ uint32_t blk_size;
+ double throughput;
+ double time;
+ int32_t ret;
};
typedef struct _gfd_vol_top_priv gfd_vol_top_priv_t;
-int glusterfs_mgmt_pmap_signin (glusterfs_ctx_t *ctx);
-int glusterfs_volfile_fetch (glusterfs_ctx_t *ctx);
-void cleanup_and_exit (int signum);
+int
+glusterfs_mgmt_pmap_signin(glusterfs_ctx_t *ctx);
+int
+glusterfs_volfile_fetch(glusterfs_ctx_t *ctx);
+void
+cleanup_and_exit(int signum);
-int glusterfs_volume_top_write_perf (uint32_t blk_size, uint32_t blk_count,
- char *brick_path, double *throughput,
- double *time);
-int glusterfs_volume_top_read_perf (uint32_t blk_size, uint32_t blk_count,
- char *brick_path, double *throughput,
- double *time);
+int
+glusterfs_volume_top_write_perf(uint32_t blk_size, uint32_t blk_count,
+ char *brick_path, double *throughput,
+ double *time);
+int
+glusterfs_volume_top_read_perf(uint32_t blk_size, uint32_t blk_count,
+ char *brick_path, double *throughput,
+ double *time);
void
-xlator_mem_cleanup (xlator_t *this);
+xlator_mem_cleanup(xlator_t *this);
extern glusterfs_ctx_t *glusterfsd_ctx;
#endif /* __GLUSTERFSD_H__ */
diff --git a/libglusterfs/src/atomic.h b/libglusterfs/src/atomic.h
index ca7f919f0d1..3fd3a8764bf 100644
--- a/libglusterfs/src/atomic.h
+++ b/libglusterfs/src/atomic.h
@@ -89,11 +89,11 @@
/* This macro is used to define all atomic types supported. First field
* represents the size of the type in bytes, and the second one the name. */
-#define GF_ATOMIC_TYPE(_size, _name) \
- typedef struct _gf_atomic_##_name##_t { \
- GF_ATOMIC_MACRO(GF_ATOMIC_SIZE_, _size); \
- _name##_t value; \
- } gf_atomic_##_name##_t
+#define GF_ATOMIC_TYPE(_size, _name) \
+ typedef struct _gf_atomic_##_name##_t { \
+ GF_ATOMIC_MACRO(GF_ATOMIC_SIZE_, _size); \
+ _name##_t value; \
+ } gf_atomic_##_name##_t
/* The atomic types we support */
GF_ATOMIC_TYPE(1, int8); /* gf_atomic_int8_t */
@@ -112,253 +112,253 @@ GF_ATOMIC_TYPE(SIZEOF_LONG, uintptr); /* gf_atomic_uintptr_t */
/* This macro will choose between the mutex based version and the atomic
* builtin version depending on the size of the atomic structure. */
-#define GF_ATOMIC_CHOOSE(_atomic, _op, _args...) \
- ((sizeof(_atomic) > sizeof(uint64_t)) \
- ? ({ GF_ATOMIC_MACRO(GF_ATOMIC_LOCK_, _op)(_atomic, ## _args); }) \
- : ({ GF_ATOMIC_MACRO(GF_ATOMIC_BASE_, _op)(_atomic, ## _args); }))
+#define GF_ATOMIC_CHOOSE(_atomic, _op, _args...) \
+ ((sizeof(_atomic) > sizeof(uint64_t)) \
+ ? ({ GF_ATOMIC_MACRO(GF_ATOMIC_LOCK_, _op) \
+ (_atomic, ##_args); }) \
+ : ({ GF_ATOMIC_MACRO(GF_ATOMIC_BASE_, _op) \
+ (_atomic, ##_args); }))
/* Macros to implement the mutex-based atomics. */
-#define GF_ATOMIC_OP_PREPARE(_atomic, _name) \
- typeof(_atomic) *__atomic = &(_atomic); \
- gf_lock_t *__lock = (gf_lock_t *)&__atomic->lk; \
- LOCK(__lock); \
- typeof(__atomic->value) _name = __atomic->value
-
-#define GF_ATOMIC_OP_STORE(_value) \
- (__atomic->value = (_value))
-
-#define GF_ATOMIC_OP_RETURN(_value) \
- ({ \
- UNLOCK(__lock); \
- _value; \
- })
-
-#define GF_ATOMIC_LOCK_INIT(_atomic, _value) \
- do { \
- typeof(_atomic) *__atomic = &(_atomic); \
- LOCK_INIT((gf_lock_t *)&__atomic->lk); \
- __atomic->value = (_value); \
- } while (0)
-
-#define GF_ATOMIC_LOCK_GET(_atomic) \
- ({ \
- GF_ATOMIC_OP_PREPARE(_atomic, __value); \
- GF_ATOMIC_OP_RETURN(__value); \
- })
-
-#define GF_ATOMIC_LOCK_ADD(_atomic, _value) \
- ({ \
- GF_ATOMIC_OP_PREPARE(_atomic, __value); \
- GF_ATOMIC_OP_STORE(__value += (_value)); \
- GF_ATOMIC_OP_RETURN(__value); \
- })
-
-#define GF_ATOMIC_LOCK_SUB(_atomic, _value) \
- ({ \
- GF_ATOMIC_OP_PREPARE(_atomic, __value); \
- GF_ATOMIC_OP_STORE(__value -= (_value)); \
- GF_ATOMIC_OP_RETURN(__value); \
- })
-
-#define GF_ATOMIC_LOCK_AND(_atomic, _value) \
- ({ \
- GF_ATOMIC_OP_PREPARE(_atomic, __value); \
- GF_ATOMIC_OP_STORE(__value &= (_value)); \
- GF_ATOMIC_OP_RETURN(__value); \
- })
-
-#define GF_ATOMIC_LOCK_OR(_atomic, _value) \
- ({ \
- GF_ATOMIC_OP_PREPARE(_atomic, __value); \
- GF_ATOMIC_OP_STORE(__value |= (_value)); \
- GF_ATOMIC_OP_RETURN(__value); \
- })
-
-#define GF_ATOMIC_LOCK_XOR(_atomic, _value) \
- ({ \
- GF_ATOMIC_OP_PREPARE(_atomic, __value); \
- GF_ATOMIC_OP_STORE(__value ^= (_value)); \
- GF_ATOMIC_OP_RETURN(__value); \
- })
-
-#define GF_ATOMIC_LOCK_NAND(_atomic, _value) \
- ({ \
- GF_ATOMIC_OP_PREPARE(_atomic, __value); \
- GF_ATOMIC_OP_STORE(__value = ~(__value & (_value))); \
- GF_ATOMIC_OP_RETURN(__value); \
- })
-
-#define GF_ATOMIC_LOCK_FETCH_ADD(_atomic, _value) \
- ({ \
- GF_ATOMIC_OP_PREPARE(_atomic, __value); \
- GF_ATOMIC_OP_STORE(__value + (_value)); \
- GF_ATOMIC_OP_RETURN(__value); \
- })
-
-#define GF_ATOMIC_LOCK_FETCH_SUB(_atomic, _value) \
- ({ \
- GF_ATOMIC_OP_PREPARE(_atomic, __value); \
- GF_ATOMIC_OP_STORE(__value - (_value)); \
- GF_ATOMIC_OP_RETURN(__value); \
- })
-
-#define GF_ATOMIC_LOCK_FETCH_AND(_atomic, _value) \
- ({ \
- GF_ATOMIC_OP_PREPARE(_atomic, __value); \
- GF_ATOMIC_OP_STORE(__value & (_value)); \
- GF_ATOMIC_OP_RETURN(__value); \
- })
-
-#define GF_ATOMIC_LOCK_FETCH_OR(_atomic, _value) \
- ({ \
- GF_ATOMIC_OP_PREPARE(_atomic, __value); \
- GF_ATOMIC_OP_STORE(__value | (_value)); \
- GF_ATOMIC_OP_RETURN(__value); \
- })
-
-#define GF_ATOMIC_LOCK_FETCH_XOR(_atomic, _value) \
- ({ \
- GF_ATOMIC_OP_PREPARE(_atomic, __value); \
- GF_ATOMIC_OP_STORE(__value ^ (_value)); \
- GF_ATOMIC_OP_RETURN(__value); \
- })
-
-#define GF_ATOMIC_LOCK_FETCH_NAND(_atomic, _value) \
- ({ \
- GF_ATOMIC_OP_PREPARE(_atomic, __value); \
- GF_ATOMIC_OP_STORE(~(__value & (_value))); \
- GF_ATOMIC_OP_RETURN(__value); \
- })
-
-#define GF_ATOMIC_LOCK_SWAP(_atomic, _value) \
- ({ \
- GF_ATOMIC_OP_PREPARE(_atomic, __value); \
- GF_ATOMIC_OP_STORE(_value); \
- GF_ATOMIC_OP_RETURN(__value); \
- })
-
-#define GF_ATOMIC_LOCK_CMP_SWAP(_atomic, _expected, _value) \
- ({ \
- GF_ATOMIC_OP_PREPARE(_atomic, __value); \
- bool __ret = (__value == (_expected)); \
- if (__ret) { \
- GF_ATOMIC_OP_STORE(_value); \
- } \
- GF_ATOMIC_OP_RETURN(__ret); \
- })
+#define GF_ATOMIC_OP_PREPARE(_atomic, _name) \
+ typeof(_atomic) *__atomic = &(_atomic); \
+ gf_lock_t *__lock = (gf_lock_t *)&__atomic->lk; \
+ LOCK(__lock); \
+ typeof(__atomic->value) _name = __atomic->value
+
+#define GF_ATOMIC_OP_STORE(_value) (__atomic->value = (_value))
+
+#define GF_ATOMIC_OP_RETURN(_value) \
+ ({ \
+ UNLOCK(__lock); \
+ _value; \
+ })
+
+#define GF_ATOMIC_LOCK_INIT(_atomic, _value) \
+ do { \
+ typeof(_atomic) *__atomic = &(_atomic); \
+ LOCK_INIT((gf_lock_t *)&__atomic->lk); \
+ __atomic->value = (_value); \
+ } while (0)
+
+#define GF_ATOMIC_LOCK_GET(_atomic) \
+ ({ \
+ GF_ATOMIC_OP_PREPARE(_atomic, __value); \
+ GF_ATOMIC_OP_RETURN(__value); \
+ })
+
+#define GF_ATOMIC_LOCK_ADD(_atomic, _value) \
+ ({ \
+ GF_ATOMIC_OP_PREPARE(_atomic, __value); \
+ GF_ATOMIC_OP_STORE(__value += (_value)); \
+ GF_ATOMIC_OP_RETURN(__value); \
+ })
+
+#define GF_ATOMIC_LOCK_SUB(_atomic, _value) \
+ ({ \
+ GF_ATOMIC_OP_PREPARE(_atomic, __value); \
+ GF_ATOMIC_OP_STORE(__value -= (_value)); \
+ GF_ATOMIC_OP_RETURN(__value); \
+ })
+
+#define GF_ATOMIC_LOCK_AND(_atomic, _value) \
+ ({ \
+ GF_ATOMIC_OP_PREPARE(_atomic, __value); \
+ GF_ATOMIC_OP_STORE(__value &= (_value)); \
+ GF_ATOMIC_OP_RETURN(__value); \
+ })
+
+#define GF_ATOMIC_LOCK_OR(_atomic, _value) \
+ ({ \
+ GF_ATOMIC_OP_PREPARE(_atomic, __value); \
+ GF_ATOMIC_OP_STORE(__value |= (_value)); \
+ GF_ATOMIC_OP_RETURN(__value); \
+ })
+
+#define GF_ATOMIC_LOCK_XOR(_atomic, _value) \
+ ({ \
+ GF_ATOMIC_OP_PREPARE(_atomic, __value); \
+ GF_ATOMIC_OP_STORE(__value ^= (_value)); \
+ GF_ATOMIC_OP_RETURN(__value); \
+ })
+
+#define GF_ATOMIC_LOCK_NAND(_atomic, _value) \
+ ({ \
+ GF_ATOMIC_OP_PREPARE(_atomic, __value); \
+ GF_ATOMIC_OP_STORE(__value = ~(__value & (_value))); \
+ GF_ATOMIC_OP_RETURN(__value); \
+ })
+
+#define GF_ATOMIC_LOCK_FETCH_ADD(_atomic, _value) \
+ ({ \
+ GF_ATOMIC_OP_PREPARE(_atomic, __value); \
+ GF_ATOMIC_OP_STORE(__value + (_value)); \
+ GF_ATOMIC_OP_RETURN(__value); \
+ })
+
+#define GF_ATOMIC_LOCK_FETCH_SUB(_atomic, _value) \
+ ({ \
+ GF_ATOMIC_OP_PREPARE(_atomic, __value); \
+ GF_ATOMIC_OP_STORE(__value - (_value)); \
+ GF_ATOMIC_OP_RETURN(__value); \
+ })
+
+#define GF_ATOMIC_LOCK_FETCH_AND(_atomic, _value) \
+ ({ \
+ GF_ATOMIC_OP_PREPARE(_atomic, __value); \
+ GF_ATOMIC_OP_STORE(__value &(_value)); \
+ GF_ATOMIC_OP_RETURN(__value); \
+ })
+
+#define GF_ATOMIC_LOCK_FETCH_OR(_atomic, _value) \
+ ({ \
+ GF_ATOMIC_OP_PREPARE(_atomic, __value); \
+ GF_ATOMIC_OP_STORE(__value | (_value)); \
+ GF_ATOMIC_OP_RETURN(__value); \
+ })
+
+#define GF_ATOMIC_LOCK_FETCH_XOR(_atomic, _value) \
+ ({ \
+ GF_ATOMIC_OP_PREPARE(_atomic, __value); \
+ GF_ATOMIC_OP_STORE(__value ^ (_value)); \
+ GF_ATOMIC_OP_RETURN(__value); \
+ })
+
+#define GF_ATOMIC_LOCK_FETCH_NAND(_atomic, _value) \
+ ({ \
+ GF_ATOMIC_OP_PREPARE(_atomic, __value); \
+ GF_ATOMIC_OP_STORE(~(__value & (_value))); \
+ GF_ATOMIC_OP_RETURN(__value); \
+ })
+
+#define GF_ATOMIC_LOCK_SWAP(_atomic, _value) \
+ ({ \
+ GF_ATOMIC_OP_PREPARE(_atomic, __value); \
+ GF_ATOMIC_OP_STORE(_value); \
+ GF_ATOMIC_OP_RETURN(__value); \
+ })
+
+#define GF_ATOMIC_LOCK_CMP_SWAP(_atomic, _expected, _value) \
+ ({ \
+ GF_ATOMIC_OP_PREPARE(_atomic, __value); \
+ bool __ret = (__value == (_expected)); \
+ if (__ret) { \
+ GF_ATOMIC_OP_STORE(_value); \
+ } \
+ GF_ATOMIC_OP_RETURN(__ret); \
+ })
#if defined(HAVE_ATOMIC_BUILTINS)
/* If compiler supports __atomic builtins, we use them. */
-#define GF_ATOMIC_BASE_INIT(_atomic, _value) \
- __atomic_store_n(&(_atomic).value, (_value), __ATOMIC_RELEASE)
+#define GF_ATOMIC_BASE_INIT(_atomic, _value) \
+ __atomic_store_n(&(_atomic).value, (_value), __ATOMIC_RELEASE)
-#define GF_ATOMIC_BASE_GET(_atomic) \
- __atomic_load_n(&(_atomic).value, __ATOMIC_ACQUIRE)
+#define GF_ATOMIC_BASE_GET(_atomic) \
+ __atomic_load_n(&(_atomic).value, __ATOMIC_ACQUIRE)
-#define GF_ATOMIC_BASE_ADD(_atomic, _value) \
- __atomic_add_fetch(&(_atomic).value, (_value), __ATOMIC_ACQ_REL)
+#define GF_ATOMIC_BASE_ADD(_atomic, _value) \
+ __atomic_add_fetch(&(_atomic).value, (_value), __ATOMIC_ACQ_REL)
-#define GF_ATOMIC_BASE_SUB(_atomic, _value) \
- __atomic_sub_fetch(&(_atomic).value, (_value), __ATOMIC_ACQ_REL)
+#define GF_ATOMIC_BASE_SUB(_atomic, _value) \
+ __atomic_sub_fetch(&(_atomic).value, (_value), __ATOMIC_ACQ_REL)
-#define GF_ATOMIC_BASE_AND(_atomic, _value) \
- __atomic_and_fetch(&(_atomic).value, (_value), __ATOMIC_ACQ_REL)
+#define GF_ATOMIC_BASE_AND(_atomic, _value) \
+ __atomic_and_fetch(&(_atomic).value, (_value), __ATOMIC_ACQ_REL)
-#define GF_ATOMIC_BASE_OR(_atomic, _value) \
- __atomic_or_fetch(&(_atomic).value, (_value), __ATOMIC_ACQ_REL)
+#define GF_ATOMIC_BASE_OR(_atomic, _value) \
+ __atomic_or_fetch(&(_atomic).value, (_value), __ATOMIC_ACQ_REL)
-#define GF_ATOMIC_BASE_XOR(_atomic, _value) \
- __atomic_xor_fetch(&(_atomic).value, (_value), __ATOMIC_ACQ_REL)
+#define GF_ATOMIC_BASE_XOR(_atomic, _value) \
+ __atomic_xor_fetch(&(_atomic).value, (_value), __ATOMIC_ACQ_REL)
-#define GF_ATOMIC_BASE_NAND(_atomic, _value) \
- __atomic_nand_fetch(&(_atomic).value, (_value), __ATOMIC_ACQ_REL)
+#define GF_ATOMIC_BASE_NAND(_atomic, _value) \
+ __atomic_nand_fetch(&(_atomic).value, (_value), __ATOMIC_ACQ_REL)
-#define GF_ATOMIC_BASE_FETCH_ADD(_atomic, _value) \
- __atomic_fetch_add(&(_atomic).value, (_value), __ATOMIC_ACQ_REL)
+#define GF_ATOMIC_BASE_FETCH_ADD(_atomic, _value) \
+ __atomic_fetch_add(&(_atomic).value, (_value), __ATOMIC_ACQ_REL)
-#define GF_ATOMIC_BASE_FETCH_SUB(_atomic, _value) \
- __atomic_fetch_sub(&(_atomic).value, (_value), __ATOMIC_ACQ_REL)
+#define GF_ATOMIC_BASE_FETCH_SUB(_atomic, _value) \
+ __atomic_fetch_sub(&(_atomic).value, (_value), __ATOMIC_ACQ_REL)
-#define GF_ATOMIC_BASE_FETCH_AND(_atomic, _value) \
- __atomic_fetch_and(&(_atomic).value, (_value), __ATOMIC_ACQ_REL)
+#define GF_ATOMIC_BASE_FETCH_AND(_atomic, _value) \
+ __atomic_fetch_and(&(_atomic).value, (_value), __ATOMIC_ACQ_REL)
-#define GF_ATOMIC_BASE_FETCH_OR(_atomic, _value) \
- __atomic_fetch_or(&(_atomic).value, (_value), __ATOMIC_ACQ_REL)
+#define GF_ATOMIC_BASE_FETCH_OR(_atomic, _value) \
+ __atomic_fetch_or(&(_atomic).value, (_value), __ATOMIC_ACQ_REL)
-#define GF_ATOMIC_BASE_FETCH_XOR(_atomic, _value) \
- __atomic_fetch_xor(&(_atomic).value, (_value), __ATOMIC_ACQ_REL)
+#define GF_ATOMIC_BASE_FETCH_XOR(_atomic, _value) \
+ __atomic_fetch_xor(&(_atomic).value, (_value), __ATOMIC_ACQ_REL)
-#define GF_ATOMIC_BASE_FETCH_NAND(_atomic, _value) \
- __atomic_fetch_nand(&(_atomic).value, (_value), __ATOMIC_ACQ_REL)
+#define GF_ATOMIC_BASE_FETCH_NAND(_atomic, _value) \
+ __atomic_fetch_nand(&(_atomic).value, (_value), __ATOMIC_ACQ_REL)
-#define GF_ATOMIC_BASE_SWAP(_atomic, _value) \
- __atomic_exchange_n(&(_atomic).value, (_value), __ATOMIC_ACQ_REL)
+#define GF_ATOMIC_BASE_SWAP(_atomic, _value) \
+ __atomic_exchange_n(&(_atomic).value, (_value), __ATOMIC_ACQ_REL)
-#define GF_ATOMIC_BASE_CMP_SWAP(_atomic, _expected, _value) \
- ({ \
- typeof((_atomic).value) __expected = (_expected); \
- __atomic_compare_exchange_n(&(_atomic).value, &__expected, \
- (_value), 0, __ATOMIC_ACQ_REL, \
- __ATOMIC_ACQUIRE); \
- })
+#define GF_ATOMIC_BASE_CMP_SWAP(_atomic, _expected, _value) \
+ ({ \
+ typeof((_atomic).value) __expected = (_expected); \
+ __atomic_compare_exchange_n(&(_atomic).value, &__expected, (_value), \
+ 0, __ATOMIC_ACQ_REL, __ATOMIC_ACQUIRE); \
+ })
#elif defined(HAVE_SYNC_BUILTINS)
/* If compiler doesn't support __atomic builtins but supports __sync builtins,
* we use them. */
-#define GF_ATOMIC_BASE_INIT(_atomic, _value) \
- do { \
- (_atomic).value = (_value); \
- __sync_synchronize(); \
- } while (0)
+#define GF_ATOMIC_BASE_INIT(_atomic, _value) \
+ do { \
+ (_atomic).value = (_value); \
+ __sync_synchronize(); \
+ } while (0)
-#define GF_ATOMIC_BASE_ADD(_atomic, _value) \
- __sync_add_and_fetch(&(_atomic).value, (_value))
+#define GF_ATOMIC_BASE_ADD(_atomic, _value) \
+ __sync_add_and_fetch(&(_atomic).value, (_value))
-#define GF_ATOMIC_BASE_SUB(_atomic, _value) \
- __sync_sub_and_fetch(&(_atomic).value, (_value))
+#define GF_ATOMIC_BASE_SUB(_atomic, _value) \
+ __sync_sub_and_fetch(&(_atomic).value, (_value))
-#define GF_ATOMIC_BASE_AND(_atomic, _value) \
- __sync_and_and_fetch(&(_atomic).value, (_value))
+#define GF_ATOMIC_BASE_AND(_atomic, _value) \
+ __sync_and_and_fetch(&(_atomic).value, (_value))
-#define GF_ATOMIC_BASE_OR(_atomic, _value) \
- __sync_or_and_fetch(&(_atomic).value, (_value))
+#define GF_ATOMIC_BASE_OR(_atomic, _value) \
+ __sync_or_and_fetch(&(_atomic).value, (_value))
-#define GF_ATOMIC_BASE_XOR(_atomic, _value) \
- __sync_xor_and_fetch(&(_atomic).value, (_value))
+#define GF_ATOMIC_BASE_XOR(_atomic, _value) \
+ __sync_xor_and_fetch(&(_atomic).value, (_value))
-#define GF_ATOMIC_BASE_NAND(_atomic, _value) \
- __sync_nand_and_fetch(&(_atomic).value, (_value))
+#define GF_ATOMIC_BASE_NAND(_atomic, _value) \
+ __sync_nand_and_fetch(&(_atomic).value, (_value))
-#define GF_ATOMIC_BASE_FETCH_ADD(_atomic, _value) \
- __sync_fetch_and_add(&(_atomic).value, (_value))
+#define GF_ATOMIC_BASE_FETCH_ADD(_atomic, _value) \
+ __sync_fetch_and_add(&(_atomic).value, (_value))
-#define GF_ATOMIC_BASE_FETCH_SUB(_atomic, _value) \
- __sync_fetch_and_sub(&(_atomic).value, (_value))
+#define GF_ATOMIC_BASE_FETCH_SUB(_atomic, _value) \
+ __sync_fetch_and_sub(&(_atomic).value, (_value))
-#define GF_ATOMIC_BASE_FETCH_AND(_atomic, _value) \
- __sync_fetch_and_and(&(_atomic).value, (_value))
+#define GF_ATOMIC_BASE_FETCH_AND(_atomic, _value) \
+ __sync_fetch_and_and(&(_atomic).value, (_value))
-#define GF_ATOMIC_BASE_FETCH_OR(_atomic, _value) \
- __sync_fetch_and_or(&(_atomic).value, (_value))
+#define GF_ATOMIC_BASE_FETCH_OR(_atomic, _value) \
+ __sync_fetch_and_or(&(_atomic).value, (_value))
-#define GF_ATOMIC_BASE_FETCH_XOR(_atomic, _value) \
- __sync_fetch_and_xor(&(_atomic).value, (_value))
+#define GF_ATOMIC_BASE_FETCH_XOR(_atomic, _value) \
+ __sync_fetch_and_xor(&(_atomic).value, (_value))
-#define GF_ATOMIC_BASE_FETCH_NAND(_atomic, _value) \
- __sync_fetch_and_nand(&(_atomic).value, (_value))
+#define GF_ATOMIC_BASE_FETCH_NAND(_atomic, _value) \
+ __sync_fetch_and_nand(&(_atomic).value, (_value))
-#define GF_ATOMIC_BASE_SWAP(_atomic, _value) \
- ({ \
- __sync_synchronize(); \
- __sync_lock_test_and_set(&(_atomic).value, (_value)); \
- })
+#define GF_ATOMIC_BASE_SWAP(_atomic, _value) \
+ ({ \
+ __sync_synchronize(); \
+ __sync_lock_test_and_set(&(_atomic).value, (_value)); \
+ })
-#define GF_ATOMIC_BASE_CMP_SWAP(_atomic, _expected, _value) \
- __sync_bool_compare_and_swap(&(_atomic).value, (_expected), (_value))
+#define GF_ATOMIC_BASE_CMP_SWAP(_atomic, _expected, _value) \
+ __sync_bool_compare_and_swap(&(_atomic).value, (_expected), (_value))
#define GF_ATOMIC_BASE_GET(_atomic) GF_ATOMIC_BASE_ADD(_atomic, 0)
@@ -367,53 +367,47 @@ GF_ATOMIC_TYPE(SIZEOF_LONG, uintptr); /* gf_atomic_uintptr_t */
/* The compiler doesn't support any atomic builtin. We fallback to the
* mutex-based implementation. */
-#define GF_ATOMIC_BASE_INIT(_atomic, _value) \
- GF_ATOMIC_LOCK_INIT(_atomic, _value)
+#define GF_ATOMIC_BASE_INIT(_atomic, _value) \
+ GF_ATOMIC_LOCK_INIT(_atomic, _value)
-#define GF_ATOMIC_BASE_GET(_atomic) \
- GF_ATOMIC_LOCK_GET(_atomic)
+#define GF_ATOMIC_BASE_GET(_atomic) GF_ATOMIC_LOCK_GET(_atomic)
-#define GF_ATOMIC_BASE_ADD(_atomic, _value) \
- GF_ATOMIC_LOCK_ADD(_atomic, _value)
+#define GF_ATOMIC_BASE_ADD(_atomic, _value) GF_ATOMIC_LOCK_ADD(_atomic, _value)
-#define GF_ATOMIC_BASE_SUB(_atomic, _value) \
- GF_ATOMIC_LOCK_SUB(_atomic, _value)
+#define GF_ATOMIC_BASE_SUB(_atomic, _value) GF_ATOMIC_LOCK_SUB(_atomic, _value)
-#define GF_ATOMIC_BASE_AND(_atomic, _value) \
- GF_ATOMIC_LOCK_AND(_atomic, _value)
+#define GF_ATOMIC_BASE_AND(_atomic, _value) GF_ATOMIC_LOCK_AND(_atomic, _value)
-#define GF_ATOMIC_BASE_OR(_atomic, _value) \
- GF_ATOMIC_LOCK_OR(_atomic, _value)
+#define GF_ATOMIC_BASE_OR(_atomic, _value) GF_ATOMIC_LOCK_OR(_atomic, _value)
-#define GF_ATOMIC_BASE_XOR(_atomic, _value) \
- GF_ATOMIC_LOCK_XOR(_atomic, _value)
+#define GF_ATOMIC_BASE_XOR(_atomic, _value) GF_ATOMIC_LOCK_XOR(_atomic, _value)
-#define GF_ATOMIC_BASE_NAND(_atomic, _value) \
- GF_ATOMIC_LOCK_NAND(_atomic, _value)
+#define GF_ATOMIC_BASE_NAND(_atomic, _value) \
+ GF_ATOMIC_LOCK_NAND(_atomic, _value)
-#define GF_ATOMIC_BASE_FETCH_ADD(_atomic, _value) \
- GF_ATOMIC_LOCK_FETCH_ADD(_atomic, _value)
+#define GF_ATOMIC_BASE_FETCH_ADD(_atomic, _value) \
+ GF_ATOMIC_LOCK_FETCH_ADD(_atomic, _value)
-#define GF_ATOMIC_BASE_FETCH_SUB(_atomic, _value) \
- GF_ATOMIC_LOCK_FETCH_SUB(_atomic, _value)
+#define GF_ATOMIC_BASE_FETCH_SUB(_atomic, _value) \
+ GF_ATOMIC_LOCK_FETCH_SUB(_atomic, _value)
-#define GF_ATOMIC_BASE_FETCH_AND(_atomic, _value) \
- GF_ATOMIC_LOCK_FETCH_AND(_atomic, _value)
+#define GF_ATOMIC_BASE_FETCH_AND(_atomic, _value) \
+ GF_ATOMIC_LOCK_FETCH_AND(_atomic, _value)
-#define GF_ATOMIC_BASE_FETCH_OR(_atomic, _value) \
- GF_ATOMIC_LOCK_FETCH_OR(_atomic, _value)
+#define GF_ATOMIC_BASE_FETCH_OR(_atomic, _value) \
+ GF_ATOMIC_LOCK_FETCH_OR(_atomic, _value)
-#define GF_ATOMIC_BASE_FETCH_XOR(_atomic, _value) \
- GF_ATOMIC_LOCK_FETCH_XOR(_atomic, _value)
+#define GF_ATOMIC_BASE_FETCH_XOR(_atomic, _value) \
+ GF_ATOMIC_LOCK_FETCH_XOR(_atomic, _value)
-#define GF_ATOMIC_BASE_FETCH_NAND(_atomic, _value) \
- GF_ATOMIC_LOCK_FETCH_NAND(_atomic, _value)
+#define GF_ATOMIC_BASE_FETCH_NAND(_atomic, _value) \
+ GF_ATOMIC_LOCK_FETCH_NAND(_atomic, _value)
-#define GF_ATOMIC_BASE_SWAP(_atomic, _value) \
- GF_ATOMIC_LOCK_SWAP(_atomic, _value)
+#define GF_ATOMIC_BASE_SWAP(_atomic, _value) \
+ GF_ATOMIC_LOCK_SWAP(_atomic, _value)
-#define GF_ATOMIC_BASE_CMP_SWAP(_atomic, _expected, _value) \
- GF_ATOMIC_LOCK_CMP_SWAP(_atomic, _expected, _value)
+#define GF_ATOMIC_BASE_CMP_SWAP(_atomic, _expected, _value) \
+ GF_ATOMIC_LOCK_CMP_SWAP(_atomic, _expected, _value)
#endif /* HAVE_(ATOMIC|SYNC)_BUILTINS */
@@ -422,40 +416,39 @@ GF_ATOMIC_TYPE(SIZEOF_LONG, uintptr); /* gf_atomic_uintptr_t */
/* All macros have a 'gf_atomic_xxx' as 1st argument */
#define GF_ATOMIC_INIT(_atomic, _value) GF_ATOMIC_CHOOSE(_atomic, INIT, _value)
-#define GF_ATOMIC_GET(_atomic) GF_ATOMIC_CHOOSE(_atomic, GET)
-#define GF_ATOMIC_ADD(_atomic, _value) GF_ATOMIC_CHOOSE(_atomic, ADD, _value)
-#define GF_ATOMIC_SUB(_atomic, _value) GF_ATOMIC_CHOOSE(_atomic, SUB, _value)
-#define GF_ATOMIC_AND(_atomic, _value) GF_ATOMIC_CHOOSE(_atomic, AND, _value)
-#define GF_ATOMIC_OR(_atomic, _value) GF_ATOMIC_CHOOSE(_atomic, OR, _value)
-#define GF_ATOMIC_XOR(_atomic, _value) GF_ATOMIC_CHOOSE(_atomic, XOR, _value)
+#define GF_ATOMIC_GET(_atomic) GF_ATOMIC_CHOOSE(_atomic, GET)
+#define GF_ATOMIC_ADD(_atomic, _value) GF_ATOMIC_CHOOSE(_atomic, ADD, _value)
+#define GF_ATOMIC_SUB(_atomic, _value) GF_ATOMIC_CHOOSE(_atomic, SUB, _value)
+#define GF_ATOMIC_AND(_atomic, _value) GF_ATOMIC_CHOOSE(_atomic, AND, _value)
+#define GF_ATOMIC_OR(_atomic, _value) GF_ATOMIC_CHOOSE(_atomic, OR, _value)
+#define GF_ATOMIC_XOR(_atomic, _value) GF_ATOMIC_CHOOSE(_atomic, XOR, _value)
#define GF_ATOMIC_NAND(_atomic, _value) GF_ATOMIC_CHOOSE(_atomic, NAND, _value)
-#define GF_ATOMIC_FETCH_ADD(_atomic, _value) \
- GF_ATOMIC_CHOOSE(_atomic, FETCH_ADD, _value)
+#define GF_ATOMIC_FETCH_ADD(_atomic, _value) \
+ GF_ATOMIC_CHOOSE(_atomic, FETCH_ADD, _value)
-#define GF_ATOMIC_FETCH_SUB(_atomic, _value) \
- GF_ATOMIC_CHOOSE(_atomic, FETCH_SUB, _value)
+#define GF_ATOMIC_FETCH_SUB(_atomic, _value) \
+ GF_ATOMIC_CHOOSE(_atomic, FETCH_SUB, _value)
-#define GF_ATOMIC_FETCH_AND(_atomic, _value) \
- GF_ATOMIC_CHOOSE(_atomic, FETCH_AND, _value)
+#define GF_ATOMIC_FETCH_AND(_atomic, _value) \
+ GF_ATOMIC_CHOOSE(_atomic, FETCH_AND, _value)
-#define GF_ATOMIC_FETCH_OR(_atomic, _value) \
- GF_ATOMIC_CHOOSE(_atomic, FETCH_OR, _value)
+#define GF_ATOMIC_FETCH_OR(_atomic, _value) \
+ GF_ATOMIC_CHOOSE(_atomic, FETCH_OR, _value)
-#define GF_ATOMIC_FETCH_XOR(_atomic, _value) \
- GF_ATOMIC_CHOOSE(_atomic, FETCH_XOR, _value)
+#define GF_ATOMIC_FETCH_XOR(_atomic, _value) \
+ GF_ATOMIC_CHOOSE(_atomic, FETCH_XOR, _value)
-#define GF_ATOMIC_FETCH_NAND(_atomic, _value) \
- GF_ATOMIC_CHOOSE(_atomic, FETCH_NAND, _value)
+#define GF_ATOMIC_FETCH_NAND(_atomic, _value) \
+ GF_ATOMIC_CHOOSE(_atomic, FETCH_NAND, _value)
-#define GF_ATOMIC_SWAP(_atomic, _value) \
- GF_ATOMIC_CHOOSE(_atomic, SWAP, _value)
+#define GF_ATOMIC_SWAP(_atomic, _value) GF_ATOMIC_CHOOSE(_atomic, SWAP, _value)
-#define GF_ATOMIC_CMP_SWAP(_atomic, _expected, _value) \
- GF_ATOMIC_CHOOSE(_atomic, CMP_SWAP, _expected, _value)
+#define GF_ATOMIC_CMP_SWAP(_atomic, _expected, _value) \
+ GF_ATOMIC_CHOOSE(_atomic, CMP_SWAP, _expected, _value)
-#define GF_ATOMIC_INC(_atomic) GF_ATOMIC_ADD(_atomic, 1)
-#define GF_ATOMIC_DEC(_atomic) GF_ATOMIC_SUB(_atomic, 1)
+#define GF_ATOMIC_INC(_atomic) GF_ATOMIC_ADD(_atomic, 1)
+#define GF_ATOMIC_DEC(_atomic) GF_ATOMIC_SUB(_atomic, 1)
#define GF_ATOMIC_FETCH_INC(_atomic) GF_ATOMIC_FETCH_ADD(_atomic, 1)
#define GF_ATOMIC_FETCH_DEC(_atomic) GF_ATOMIC_FETCH_SUB(_atomic, 1)
diff --git a/libglusterfs/src/byte-order.h b/libglusterfs/src/byte-order.h
index 4101db2c71d..fd8cef9e58d 100644
--- a/libglusterfs/src/byte-order.h
+++ b/libglusterfs/src/byte-order.h
@@ -20,282 +20,260 @@
#define LS4 0x00000000ffffffffULL
#define MS4 0xffffffff00000000ULL
-
-static uint16_t (*hton16) (uint16_t);
-static uint32_t (*hton32) (uint32_t);
-static uint64_t (*hton64) (uint64_t);
+static uint16_t (*hton16)(uint16_t);
+static uint32_t (*hton32)(uint32_t);
+static uint64_t (*hton64)(uint64_t);
#define ntoh16 hton16
#define ntoh32 hton32
#define ntoh64 hton64
-static uint16_t (*htole16) (uint16_t);
-static uint32_t (*htole32) (uint32_t);
-static uint64_t (*htole64) (uint64_t);
+static uint16_t (*htole16)(uint16_t);
+static uint32_t (*htole32)(uint32_t);
+static uint64_t (*htole64)(uint64_t);
#define letoh16 htole16
#define letoh32 htole32
#define letoh64 htole64
-static uint16_t (*htobe16) (uint16_t);
-static uint32_t (*htobe32) (uint32_t);
-static uint64_t (*htobe64) (uint64_t);
+static uint16_t (*htobe16)(uint16_t);
+static uint32_t (*htobe32)(uint32_t);
+static uint64_t (*htobe64)(uint64_t);
#define betoh16 htobe16
#define betoh32 htobe32
#define betoh64 htobe64
-
-#define do_swap2(x) (((x&LS1) << 8)|(((x&MS1) >> 8)))
-#define do_swap4(x) ((do_swap2(x&LS2) << 16)|(do_swap2((x&MS2) >> 16)))
-#define do_swap8(x) ((do_swap4(x&LS4) << 32)|(do_swap4((x&MS4) >> 32)))
-
+#define do_swap2(x) (((x & LS1) << 8) | (((x & MS1) >> 8)))
+#define do_swap4(x) ((do_swap2(x & LS2) << 16) | (do_swap2((x & MS2) >> 16)))
+#define do_swap8(x) ((do_swap4(x & LS4) << 32) | (do_swap4((x & MS4) >> 32)))
static inline uint16_t
-__swap16 (uint16_t x)
+__swap16(uint16_t x)
{
- return do_swap2(x);
+ return do_swap2(x);
}
-
static inline uint32_t
-__swap32 (uint32_t x)
+__swap32(uint32_t x)
{
- return do_swap4(x);
+ return do_swap4(x);
}
-
static inline uint64_t
-__swap64 (uint64_t x)
+__swap64(uint64_t x)
{
- return do_swap8(x);
+ return do_swap8(x);
}
-
static inline uint16_t
-__noswap16 (uint16_t x)
+__noswap16(uint16_t x)
{
- return x;
+ return x;
}
-
static inline uint32_t
-__noswap32 (uint32_t x)
+__noswap32(uint32_t x)
{
- return x;
+ return x;
}
-
static inline uint64_t
-__noswap64 (uint64_t x)
+__noswap64(uint64_t x)
{
- return x;
+ return x;
}
-
static inline uint16_t
-__byte_order_n16 (uint16_t i)
+__byte_order_n16(uint16_t i)
{
- uint32_t num = 1;
-
- if (((char *)(&num))[0] == 1) {
- /* cpu is le */
- hton16 = __swap16;
- hton32 = __swap32;
- hton64 = __swap64;
- } else {
- /* cpu is be */
- hton16 = __noswap16;
- hton32 = __noswap32;
- hton64 = __noswap64;
- }
-
- return hton16 (i);
+ uint32_t num = 1;
+
+ if (((char *)(&num))[0] == 1) {
+ /* cpu is le */
+ hton16 = __swap16;
+ hton32 = __swap32;
+ hton64 = __swap64;
+ } else {
+ /* cpu is be */
+ hton16 = __noswap16;
+ hton32 = __noswap32;
+ hton64 = __noswap64;
+ }
+
+ return hton16(i);
}
-
static inline uint32_t
-__byte_order_n32 (uint32_t i)
+__byte_order_n32(uint32_t i)
{
- uint32_t num = 1;
-
- if (((char *)(&num))[0] == 1) {
- /* cpu is le */
- hton16 = __swap16;
- hton32 = __swap32;
- hton64 = __swap64;
- } else {
- /* cpu is be */
- hton16 = __noswap16;
- hton32 = __noswap32;
- hton64 = __noswap64;
- }
-
- return hton32 (i);
+ uint32_t num = 1;
+
+ if (((char *)(&num))[0] == 1) {
+ /* cpu is le */
+ hton16 = __swap16;
+ hton32 = __swap32;
+ hton64 = __swap64;
+ } else {
+ /* cpu is be */
+ hton16 = __noswap16;
+ hton32 = __noswap32;
+ hton64 = __noswap64;
+ }
+
+ return hton32(i);
}
-
static inline uint64_t
-__byte_order_n64 (uint64_t i)
+__byte_order_n64(uint64_t i)
{
- uint32_t num = 1;
-
- if (((char *)(&num))[0] == 1) {
- /* cpu is le */
- hton16 = __swap16;
- hton32 = __swap32;
- hton64 = __swap64;
- } else {
- /* cpu is be */
- hton16 = __noswap16;
- hton32 = __noswap32;
- hton64 = __noswap64;
- }
-
- return hton64 (i);
+ uint32_t num = 1;
+
+ if (((char *)(&num))[0] == 1) {
+ /* cpu is le */
+ hton16 = __swap16;
+ hton32 = __swap32;
+ hton64 = __swap64;
+ } else {
+ /* cpu is be */
+ hton16 = __noswap16;
+ hton32 = __noswap32;
+ hton64 = __noswap64;
+ }
+
+ return hton64(i);
}
-
-static uint16_t (*hton16) (uint16_t) = __byte_order_n16;
-static uint32_t (*hton32) (uint32_t) = __byte_order_n32;
-static uint64_t (*hton64) (uint64_t) = __byte_order_n64;
-
+static uint16_t (*hton16)(uint16_t) = __byte_order_n16;
+static uint32_t (*hton32)(uint32_t) = __byte_order_n32;
+static uint64_t (*hton64)(uint64_t) = __byte_order_n64;
static inline uint16_t
-__byte_order_le16 (uint16_t i)
+__byte_order_le16(uint16_t i)
{
- uint32_t num = 1;
-
- if (((char *)(&num))[0] == 1) {
- /* cpu is le */
- htole16 = __noswap16;
- htole32 = __noswap32;
- htole64 = __noswap64;
- } else {
- /* cpu is be */
- htole16 = __swap16;
- htole32 = __swap32;
- htole64 = __swap64;
- }
-
- return htole16 (i);
+ uint32_t num = 1;
+
+ if (((char *)(&num))[0] == 1) {
+ /* cpu is le */
+ htole16 = __noswap16;
+ htole32 = __noswap32;
+ htole64 = __noswap64;
+ } else {
+ /* cpu is be */
+ htole16 = __swap16;
+ htole32 = __swap32;
+ htole64 = __swap64;
+ }
+
+ return htole16(i);
}
-
static inline uint32_t
-__byte_order_le32 (uint32_t i)
+__byte_order_le32(uint32_t i)
{
- uint32_t num = 1;
-
- if (((char *)(&num))[0] == 1) {
- /* cpu is le */
- htole16 = __noswap16;
- htole32 = __noswap32;
- htole64 = __noswap64;
- } else {
- /* cpu is be */
- htole16 = __swap16;
- htole32 = __swap32;
- htole64 = __swap64;
- }
-
- return htole32 (i);
+ uint32_t num = 1;
+
+ if (((char *)(&num))[0] == 1) {
+ /* cpu is le */
+ htole16 = __noswap16;
+ htole32 = __noswap32;
+ htole64 = __noswap64;
+ } else {
+ /* cpu is be */
+ htole16 = __swap16;
+ htole32 = __swap32;
+ htole64 = __swap64;
+ }
+
+ return htole32(i);
}
-
static inline uint64_t
-__byte_order_le64 (uint64_t i)
+__byte_order_le64(uint64_t i)
{
- uint32_t num = 1;
-
- if (((char *)(&num))[0] == 1) {
- /* cpu is le */
- htole16 = __noswap16;
- htole32 = __noswap32;
- htole64 = __noswap64;
- } else {
- /* cpu is be */
- htole16 = __swap16;
- htole32 = __swap32;
- htole64 = __swap64;
- }
-
- return htole64 (i);
+ uint32_t num = 1;
+
+ if (((char *)(&num))[0] == 1) {
+ /* cpu is le */
+ htole16 = __noswap16;
+ htole32 = __noswap32;
+ htole64 = __noswap64;
+ } else {
+ /* cpu is be */
+ htole16 = __swap16;
+ htole32 = __swap32;
+ htole64 = __swap64;
+ }
+
+ return htole64(i);
}
-
-static uint16_t (*htole16) (uint16_t) = __byte_order_le16;
-static uint32_t (*htole32) (uint32_t) = __byte_order_le32;
-static uint64_t (*htole64) (uint64_t) = __byte_order_le64;
-
+static uint16_t (*htole16)(uint16_t) = __byte_order_le16;
+static uint32_t (*htole32)(uint32_t) = __byte_order_le32;
+static uint64_t (*htole64)(uint64_t) = __byte_order_le64;
static inline uint16_t
-__byte_order_be16 (uint16_t i)
+__byte_order_be16(uint16_t i)
{
- uint32_t num = 1;
-
- if (((char *)(&num))[0] == 1) {
- /* cpu is le */
- htobe16 = __swap16;
- htobe32 = __swap32;
- htobe64 = __swap64;
- } else {
- /* cpu is be */
- htobe16 = __noswap16;
- htobe32 = __noswap32;
- htobe64 = __noswap64;
- }
-
- return htobe16 (i);
+ uint32_t num = 1;
+
+ if (((char *)(&num))[0] == 1) {
+ /* cpu is le */
+ htobe16 = __swap16;
+ htobe32 = __swap32;
+ htobe64 = __swap64;
+ } else {
+ /* cpu is be */
+ htobe16 = __noswap16;
+ htobe32 = __noswap32;
+ htobe64 = __noswap64;
+ }
+
+ return htobe16(i);
}
-
static inline uint32_t
-__byte_order_be32 (uint32_t i)
+__byte_order_be32(uint32_t i)
{
- uint32_t num = 1;
-
- if (((char *)(&num))[0] == 1) {
- /* cpu is le */
- htobe16 = __swap16;
- htobe32 = __swap32;
- htobe64 = __swap64;
- } else {
- /* cpu is be */
- htobe16 = __noswap16;
- htobe32 = __noswap32;
- htobe64 = __noswap64;
- }
-
- return htobe32 (i);
+ uint32_t num = 1;
+
+ if (((char *)(&num))[0] == 1) {
+ /* cpu is le */
+ htobe16 = __swap16;
+ htobe32 = __swap32;
+ htobe64 = __swap64;
+ } else {
+ /* cpu is be */
+ htobe16 = __noswap16;
+ htobe32 = __noswap32;
+ htobe64 = __noswap64;
+ }
+
+ return htobe32(i);
}
-
static inline uint64_t
-__byte_order_be64 (uint64_t i)
+__byte_order_be64(uint64_t i)
{
- uint32_t num = 1;
-
- if (((char *)(&num))[0] == 1) {
- /* cpu is le */
- htobe16 = __swap16;
- htobe32 = __swap32;
- htobe64 = __swap64;
- } else {
- /* cpu is be */
- htobe16 = __noswap16;
- htobe32 = __noswap32;
- htobe64 = __noswap64;
- }
-
- return htobe64 (i);
+ uint32_t num = 1;
+
+ if (((char *)(&num))[0] == 1) {
+ /* cpu is le */
+ htobe16 = __swap16;
+ htobe32 = __swap32;
+ htobe64 = __swap64;
+ } else {
+ /* cpu is be */
+ htobe16 = __noswap16;
+ htobe32 = __noswap32;
+ htobe64 = __noswap64;
+ }
+
+ return htobe64(i);
}
-
-static uint16_t (*htobe16) (uint16_t) = __byte_order_be16;
-static uint32_t (*htobe32) (uint32_t) = __byte_order_be32;
-static uint64_t (*htobe64) (uint64_t) = __byte_order_be64;
-
-
+static uint16_t (*htobe16)(uint16_t) = __byte_order_be16;
+static uint32_t (*htobe32)(uint32_t) = __byte_order_be32;
+static uint64_t (*htobe64)(uint64_t) = __byte_order_be64;
#endif /* _BYTE_ORDER_H */
diff --git a/libglusterfs/src/call-stub.h b/libglusterfs/src/call-stub.h
index c3b63d4c758..815ea312c93 100644
--- a/libglusterfs/src/call-stub.h
+++ b/libglusterfs/src/call-stub.h
@@ -18,799 +18,593 @@
#include "list.h"
typedef struct _call_stub {
- struct list_head list;
- char wind;
- call_frame_t *frame;
- glusterfs_fop_t fop;
- gf_boolean_t poison;
- struct mem_pool *stub_mem_pool; /* pointer to stub mempool in ctx_t */
- uint32_t jnl_meta_len;
- uint32_t jnl_data_len;
- void (*serialize) (struct _call_stub *, char *, char *);
-
- union {
- fop_lookup_t lookup;
- fop_stat_t stat;
- fop_fstat_t fstat;
- fop_truncate_t truncate;
- fop_ftruncate_t ftruncate;
- fop_access_t access;
- fop_readlink_t readlink;
- fop_mknod_t mknod;
- fop_mkdir_t mkdir;
- fop_unlink_t unlink;
- fop_rmdir_t rmdir;
- fop_symlink_t symlink;
- fop_rename_t rename;
- fop_link_t link;
- fop_create_t create;
- fop_open_t open;
- fop_readv_t readv;
- fop_writev_t writev;
- fop_flush_t flush;
- fop_fsync_t fsync;
- fop_opendir_t opendir;
- fop_fsyncdir_t fsyncdir;
- fop_statfs_t statfs;
- fop_setxattr_t setxattr;
- fop_getxattr_t getxattr;
- fop_fgetxattr_t fgetxattr;
- fop_fsetxattr_t fsetxattr;
- fop_removexattr_t removexattr;
- fop_fremovexattr_t fremovexattr;
- fop_lk_t lk;
- fop_inodelk_t inodelk;
- fop_finodelk_t finodelk;
- fop_entrylk_t entrylk;
- fop_fentrylk_t fentrylk;
- fop_readdir_t readdir;
- fop_readdirp_t readdirp;
- fop_rchecksum_t rchecksum;
- fop_xattrop_t xattrop;
- fop_fxattrop_t fxattrop;
- fop_setattr_t setattr;
- fop_fsetattr_t fsetattr;
- fop_fallocate_t fallocate;
- fop_discard_t discard;
- fop_zerofill_t zerofill;
- fop_ipc_t ipc;
- fop_seek_t seek;
- fop_lease_t lease;
- fop_getactivelk_t getactivelk;
- fop_setactivelk_t setactivelk;
- fop_put_t put;
- fop_icreate_t icreate;
- fop_namelink_t namelink;
- } fn;
-
- union {
- fop_lookup_cbk_t lookup;
- fop_stat_cbk_t stat;
- fop_fstat_cbk_t fstat;
- fop_truncate_cbk_t truncate;
- fop_ftruncate_cbk_t ftruncate;
- fop_access_cbk_t access;
- fop_readlink_cbk_t readlink;
- fop_mknod_cbk_t mknod;
- fop_mkdir_cbk_t mkdir;
- fop_unlink_cbk_t unlink;
- fop_rmdir_cbk_t rmdir;
- fop_symlink_cbk_t symlink;
- fop_rename_cbk_t rename;
- fop_link_cbk_t link;
- fop_create_cbk_t create;
- fop_open_cbk_t open;
- fop_readv_cbk_t readv;
- fop_writev_cbk_t writev;
- fop_flush_cbk_t flush;
- fop_fsync_cbk_t fsync;
- fop_opendir_cbk_t opendir;
- fop_fsyncdir_cbk_t fsyncdir;
- fop_statfs_cbk_t statfs;
- fop_setxattr_cbk_t setxattr;
- fop_getxattr_cbk_t getxattr;
- fop_fgetxattr_cbk_t fgetxattr;
- fop_fsetxattr_cbk_t fsetxattr;
- fop_removexattr_cbk_t removexattr;
- fop_fremovexattr_cbk_t fremovexattr;
- fop_lk_cbk_t lk;
- fop_inodelk_cbk_t inodelk;
- fop_finodelk_cbk_t finodelk;
- fop_entrylk_cbk_t entrylk;
- fop_fentrylk_cbk_t fentrylk;
- fop_readdir_cbk_t readdir;
- fop_readdirp_cbk_t readdirp;
- fop_rchecksum_cbk_t rchecksum;
- fop_xattrop_cbk_t xattrop;
- fop_fxattrop_cbk_t fxattrop;
- fop_setattr_cbk_t setattr;
- fop_fsetattr_cbk_t fsetattr;
- fop_fallocate_cbk_t fallocate;
- fop_discard_cbk_t discard;
- fop_zerofill_cbk_t zerofill;
- fop_ipc_cbk_t ipc;
- fop_seek_cbk_t seek;
- fop_lease_cbk_t lease;
- fop_getactivelk_cbk_t getactivelk;
- fop_setactivelk_cbk_t setactivelk;
- fop_put_cbk_t put;
- fop_icreate_cbk_t icreate;
- fop_namelink_cbk_t namelink;
- } fn_cbk;
-
- default_args_t args;
- default_args_cbk_t args_cbk;
+ struct list_head list;
+ char wind;
+ call_frame_t *frame;
+ glusterfs_fop_t fop;
+ gf_boolean_t poison;
+ struct mem_pool *stub_mem_pool; /* pointer to stub mempool in ctx_t */
+ uint32_t jnl_meta_len;
+ uint32_t jnl_data_len;
+ void (*serialize)(struct _call_stub *, char *, char *);
+
+ union {
+ fop_lookup_t lookup;
+ fop_stat_t stat;
+ fop_fstat_t fstat;
+ fop_truncate_t truncate;
+ fop_ftruncate_t ftruncate;
+ fop_access_t access;
+ fop_readlink_t readlink;
+ fop_mknod_t mknod;
+ fop_mkdir_t mkdir;
+ fop_unlink_t unlink;
+ fop_rmdir_t rmdir;
+ fop_symlink_t symlink;
+ fop_rename_t rename;
+ fop_link_t link;
+ fop_create_t create;
+ fop_open_t open;
+ fop_readv_t readv;
+ fop_writev_t writev;
+ fop_flush_t flush;
+ fop_fsync_t fsync;
+ fop_opendir_t opendir;
+ fop_fsyncdir_t fsyncdir;
+ fop_statfs_t statfs;
+ fop_setxattr_t setxattr;
+ fop_getxattr_t getxattr;
+ fop_fgetxattr_t fgetxattr;
+ fop_fsetxattr_t fsetxattr;
+ fop_removexattr_t removexattr;
+ fop_fremovexattr_t fremovexattr;
+ fop_lk_t lk;
+ fop_inodelk_t inodelk;
+ fop_finodelk_t finodelk;
+ fop_entrylk_t entrylk;
+ fop_fentrylk_t fentrylk;
+ fop_readdir_t readdir;
+ fop_readdirp_t readdirp;
+ fop_rchecksum_t rchecksum;
+ fop_xattrop_t xattrop;
+ fop_fxattrop_t fxattrop;
+ fop_setattr_t setattr;
+ fop_fsetattr_t fsetattr;
+ fop_fallocate_t fallocate;
+ fop_discard_t discard;
+ fop_zerofill_t zerofill;
+ fop_ipc_t ipc;
+ fop_seek_t seek;
+ fop_lease_t lease;
+ fop_getactivelk_t getactivelk;
+ fop_setactivelk_t setactivelk;
+ fop_put_t put;
+ fop_icreate_t icreate;
+ fop_namelink_t namelink;
+ } fn;
+
+ union {
+ fop_lookup_cbk_t lookup;
+ fop_stat_cbk_t stat;
+ fop_fstat_cbk_t fstat;
+ fop_truncate_cbk_t truncate;
+ fop_ftruncate_cbk_t ftruncate;
+ fop_access_cbk_t access;
+ fop_readlink_cbk_t readlink;
+ fop_mknod_cbk_t mknod;
+ fop_mkdir_cbk_t mkdir;
+ fop_unlink_cbk_t unlink;
+ fop_rmdir_cbk_t rmdir;
+ fop_symlink_cbk_t symlink;
+ fop_rename_cbk_t rename;
+ fop_link_cbk_t link;
+ fop_create_cbk_t create;
+ fop_open_cbk_t open;
+ fop_readv_cbk_t readv;
+ fop_writev_cbk_t writev;
+ fop_flush_cbk_t flush;
+ fop_fsync_cbk_t fsync;
+ fop_opendir_cbk_t opendir;
+ fop_fsyncdir_cbk_t fsyncdir;
+ fop_statfs_cbk_t statfs;
+ fop_setxattr_cbk_t setxattr;
+ fop_getxattr_cbk_t getxattr;
+ fop_fgetxattr_cbk_t fgetxattr;
+ fop_fsetxattr_cbk_t fsetxattr;
+ fop_removexattr_cbk_t removexattr;
+ fop_fremovexattr_cbk_t fremovexattr;
+ fop_lk_cbk_t lk;
+ fop_inodelk_cbk_t inodelk;
+ fop_finodelk_cbk_t finodelk;
+ fop_entrylk_cbk_t entrylk;
+ fop_fentrylk_cbk_t fentrylk;
+ fop_readdir_cbk_t readdir;
+ fop_readdirp_cbk_t readdirp;
+ fop_rchecksum_cbk_t rchecksum;
+ fop_xattrop_cbk_t xattrop;
+ fop_fxattrop_cbk_t fxattrop;
+ fop_setattr_cbk_t setattr;
+ fop_fsetattr_cbk_t fsetattr;
+ fop_fallocate_cbk_t fallocate;
+ fop_discard_cbk_t discard;
+ fop_zerofill_cbk_t zerofill;
+ fop_ipc_cbk_t ipc;
+ fop_seek_cbk_t seek;
+ fop_lease_cbk_t lease;
+ fop_getactivelk_cbk_t getactivelk;
+ fop_setactivelk_cbk_t setactivelk;
+ fop_put_cbk_t put;
+ fop_icreate_cbk_t icreate;
+ fop_namelink_cbk_t namelink;
+ } fn_cbk;
+
+ default_args_t args;
+ default_args_cbk_t args_cbk;
} call_stub_t;
-
call_stub_t *
-fop_lookup_stub (call_frame_t *frame,
- fop_lookup_t fn,
- loc_t *loc,
- dict_t *xdata);
+fop_lookup_stub(call_frame_t *frame, fop_lookup_t fn, loc_t *loc,
+ dict_t *xdata);
call_stub_t *
-fop_lookup_cbk_stub (call_frame_t *frame,
- fop_lookup_cbk_t fn,
- int32_t op_ret,
- int32_t op_errno,
- inode_t *inode,
- struct iatt *buf,
- dict_t *xdata,
- struct iatt *postparent);
+fop_lookup_cbk_stub(call_frame_t *frame, fop_lookup_cbk_t fn, int32_t op_ret,
+ int32_t op_errno, inode_t *inode, struct iatt *buf,
+ dict_t *xdata, struct iatt *postparent);
+call_stub_t *
+fop_stat_stub(call_frame_t *frame, fop_stat_t fn, loc_t *loc, dict_t *xdata);
call_stub_t *
-fop_stat_stub (call_frame_t *frame,
- fop_stat_t fn,
- loc_t *loc, dict_t *xdata);
+fop_stat_cbk_stub(call_frame_t *frame, fop_stat_cbk_t fn, int32_t op_ret,
+ int32_t op_errno, struct iatt *buf, dict_t *xdata);
call_stub_t *
-fop_stat_cbk_stub (call_frame_t *frame,
- fop_stat_cbk_t fn,
- int32_t op_ret,
- int32_t op_errno,
- struct iatt *buf, dict_t *xdata);
+fop_fstat_stub(call_frame_t *frame, fop_fstat_t fn, fd_t *fd, dict_t *xdata);
call_stub_t *
-fop_fstat_stub (call_frame_t *frame,
- fop_fstat_t fn,
- fd_t *fd, dict_t *xdata);
+fop_fstat_cbk_stub(call_frame_t *frame, fop_fstat_cbk_t fn, int32_t op_ret,
+ int32_t op_errno, struct iatt *buf, dict_t *xdata);
+
+call_stub_t *
+fop_truncate_stub(call_frame_t *frame, fop_truncate_t fn, loc_t *loc, off_t off,
+ dict_t *xdata);
+
call_stub_t *
-fop_fstat_cbk_stub (call_frame_t *frame,
- fop_fstat_cbk_t fn,
- int32_t op_ret,
- int32_t op_errno,
- struct iatt *buf, dict_t *xdata);
+fop_truncate_cbk_stub(call_frame_t *frame, fop_truncate_cbk_t fn,
+ int32_t op_ret, int32_t op_errno, struct iatt *prebuf,
+ struct iatt *postbuf, dict_t *xdata);
call_stub_t *
-fop_truncate_stub (call_frame_t *frame,
- fop_truncate_t fn,
- loc_t *loc,
- off_t off, dict_t *xdata);
+fop_ftruncate_stub(call_frame_t *frame, fop_ftruncate_t fn, fd_t *fd, off_t off,
+ dict_t *xdata);
call_stub_t *
-fop_truncate_cbk_stub (call_frame_t *frame,
- fop_truncate_cbk_t fn,
- int32_t op_ret,
- int32_t op_errno,
- struct iatt *prebuf,
+fop_ftruncate_cbk_stub(call_frame_t *frame, fop_ftruncate_cbk_t fn,
+ int32_t op_ret, int32_t op_errno, struct iatt *prebuf,
struct iatt *postbuf, dict_t *xdata);
call_stub_t *
-fop_ftruncate_stub (call_frame_t *frame,
- fop_ftruncate_t fn,
- fd_t *fd,
- off_t off, dict_t *xdata);
+fop_access_stub(call_frame_t *frame, fop_access_t fn, loc_t *loc, int32_t mask,
+ dict_t *xdata);
call_stub_t *
-fop_ftruncate_cbk_stub (call_frame_t *frame,
- fop_ftruncate_cbk_t fn,
- int32_t op_ret,
- int32_t op_errno,
- struct iatt *prebuf,
- struct iatt *postbuf, dict_t *xdata);
+fop_access_cbk_stub(call_frame_t *frame, fop_access_cbk_t fn, int32_t op_ret,
+ int32_t op_errno, dict_t *xdata);
call_stub_t *
-fop_access_stub (call_frame_t *frame,
- fop_access_t fn,
- loc_t *loc,
- int32_t mask, dict_t *xdata);
+fop_readlink_stub(call_frame_t *frame, fop_readlink_t fn, loc_t *loc,
+ size_t size, dict_t *xdata);
call_stub_t *
-fop_access_cbk_stub (call_frame_t *frame,
- fop_access_cbk_t fn,
- int32_t op_ret,
- int32_t op_errno, dict_t *xdata);
+fop_readlink_cbk_stub(call_frame_t *frame, fop_readlink_cbk_t fn,
+ int32_t op_ret, int32_t op_errno, const char *path,
+ struct iatt *buf, dict_t *xdata);
call_stub_t *
-fop_readlink_stub (call_frame_t *frame,
- fop_readlink_t fn,
- loc_t *loc,
- size_t size, dict_t *xdata);
+fop_mknod_stub(call_frame_t *frame, fop_mknod_t fn, loc_t *loc, mode_t mode,
+ dev_t rdev, mode_t umask, dict_t *xdata);
call_stub_t *
-fop_readlink_cbk_stub (call_frame_t *frame,
- fop_readlink_cbk_t fn,
- int32_t op_ret,
- int32_t op_errno,
- const char *path,
- struct iatt *buf, dict_t *xdata);
+fop_mknod_cbk_stub(call_frame_t *frame, fop_mknod_cbk_t fn, int32_t op_ret,
+ int32_t op_errno, inode_t *inode, struct iatt *buf,
+ struct iatt *preparent, struct iatt *postparent,
+ dict_t *xdata);
call_stub_t *
-fop_mknod_stub (call_frame_t *frame, fop_mknod_t fn, loc_t *loc, mode_t mode,
- dev_t rdev, mode_t umask, dict_t *xdata);
+fop_mkdir_stub(call_frame_t *frame, fop_mkdir_t fn, loc_t *loc, mode_t mode,
+ mode_t umask, dict_t *xdata);
call_stub_t *
-fop_mknod_cbk_stub (call_frame_t *frame,
- fop_mknod_cbk_t fn,
- int32_t op_ret,
- int32_t op_errno,
- inode_t *inode,
- struct iatt *buf,
- struct iatt *preparent,
- struct iatt *postparent, dict_t *xdata);
+fop_mkdir_cbk_stub(call_frame_t *frame, fop_mkdir_cbk_t fn, int32_t op_ret,
+ int32_t op_errno, inode_t *inode, struct iatt *buf,
+ struct iatt *preparent, struct iatt *postparent,
+ dict_t *xdata);
call_stub_t *
-fop_mkdir_stub (call_frame_t *frame, fop_mkdir_t fn, loc_t *loc, mode_t mode,
- mode_t umask, dict_t *xdata);
+fop_unlink_stub(call_frame_t *frame, fop_unlink_t fn, loc_t *loc, int xflag,
+ dict_t *xdata);
call_stub_t *
-fop_mkdir_cbk_stub (call_frame_t *frame,
- fop_mkdir_cbk_t fn,
- int32_t op_ret,
- int32_t op_errno,
- inode_t *inode,
- struct iatt *buf,
- struct iatt *preparent,
+fop_unlink_cbk_stub(call_frame_t *frame, fop_unlink_cbk_t fn, int32_t op_ret,
+ int32_t op_errno, struct iatt *preparent,
struct iatt *postparent, dict_t *xdata);
call_stub_t *
-fop_unlink_stub (call_frame_t *frame, fop_unlink_t fn,
- loc_t *loc, int xflag, dict_t *xdata);
+fop_rmdir_stub(call_frame_t *frame, fop_rmdir_t fn, loc_t *loc, int flags,
+ dict_t *xdata);
call_stub_t *
-fop_unlink_cbk_stub (call_frame_t *frame,
- fop_unlink_cbk_t fn,
- int32_t op_ret,
- int32_t op_errno,
- struct iatt *preparent,
- struct iatt *postparent, dict_t *xdata);
+fop_rmdir_cbk_stub(call_frame_t *frame, fop_rmdir_cbk_t fn, int32_t op_ret,
+ int32_t op_errno, struct iatt *preparent,
+ struct iatt *postparent, dict_t *xdata);
call_stub_t *
-fop_rmdir_stub (call_frame_t *frame, fop_rmdir_t fn,
- loc_t *loc, int flags, dict_t *xdata);
+fop_symlink_stub(call_frame_t *frame, fop_symlink_t fn, const char *linkname,
+ loc_t *loc, mode_t umask, dict_t *xdata);
call_stub_t *
-fop_rmdir_cbk_stub (call_frame_t *frame,
- fop_rmdir_cbk_t fn,
- int32_t op_ret,
- int32_t op_errno,
- struct iatt *preparent,
- struct iatt *postparent, dict_t *xdata);
+fop_symlink_cbk_stub(call_frame_t *frame, fop_symlink_cbk_t fn, int32_t op_ret,
+ int32_t op_errno, inode_t *inode, struct iatt *buf,
+ struct iatt *preparent, struct iatt *postparent,
+ dict_t *xdata);
call_stub_t *
-fop_symlink_stub (call_frame_t *frame, fop_symlink_t fn,
- const char *linkname, loc_t *loc, mode_t umask, dict_t *xdata);
+fop_rename_stub(call_frame_t *frame, fop_rename_t fn, loc_t *oldloc,
+ loc_t *newloc, dict_t *xdata);
call_stub_t *
-fop_symlink_cbk_stub (call_frame_t *frame,
- fop_symlink_cbk_t fn,
- int32_t op_ret,
- int32_t op_errno,
- inode_t *inode,
- struct iatt *buf,
- struct iatt *preparent,
- struct iatt *postparent, dict_t *xdata);
+fop_rename_cbk_stub(call_frame_t *frame, fop_rename_cbk_t fn, int32_t op_ret,
+ int32_t op_errno, struct iatt *buf,
+ struct iatt *preoldparent, struct iatt *postoldparent,
+ struct iatt *prenewparent, struct iatt *postnewparent,
+ dict_t *xdata);
call_stub_t *
-fop_rename_stub (call_frame_t *frame,
- fop_rename_t fn,
- loc_t *oldloc,
- loc_t *newloc, dict_t *xdata);
+fop_link_stub(call_frame_t *frame, fop_link_t fn, loc_t *oldloc, loc_t *newloc,
+ dict_t *xdata);
call_stub_t *
-fop_rename_cbk_stub (call_frame_t *frame,
- fop_rename_cbk_t fn,
- int32_t op_ret,
- int32_t op_errno,
- struct iatt *buf,
- struct iatt *preoldparent,
- struct iatt *postoldparent,
- struct iatt *prenewparent,
- struct iatt *postnewparent, dict_t *xdata);
+fop_link_cbk_stub(call_frame_t *frame, fop_link_cbk_t fn, int32_t op_ret,
+ int32_t op_errno, inode_t *inode, struct iatt *buf,
+ struct iatt *preparent, struct iatt *postparent,
+ dict_t *xdata);
call_stub_t *
-fop_link_stub (call_frame_t *frame,
- fop_link_t fn,
- loc_t *oldloc,
- loc_t *newloc, dict_t *xdata);
+fop_create_stub(call_frame_t *frame, fop_create_t fn, loc_t *loc, int32_t flags,
+ mode_t mode, mode_t umask, fd_t *fd, dict_t *xdata);
call_stub_t *
-fop_link_cbk_stub (call_frame_t *frame,
- fop_link_cbk_t fn,
- int32_t op_ret,
- int32_t op_errno,
- inode_t *inode,
- struct iatt *buf,
- struct iatt *preparent,
- struct iatt *postparent, dict_t *xdata);
+fop_create_cbk_stub(call_frame_t *frame, fop_create_cbk_t fn, int32_t op_ret,
+ int32_t op_errno, fd_t *fd, inode_t *inode,
+ struct iatt *buf, struct iatt *preparent,
+ struct iatt *postparent, dict_t *xdata);
call_stub_t *
-fop_create_stub (call_frame_t *frame, fop_create_t fn,
- loc_t *loc, int32_t flags, mode_t mode,
- mode_t umask, fd_t *fd, dict_t *xdata);
+fop_open_stub(call_frame_t *frame, fop_open_t fn, loc_t *loc, int32_t flags,
+ fd_t *fd, dict_t *xdata);
call_stub_t *
-fop_create_cbk_stub (call_frame_t *frame,
- fop_create_cbk_t fn,
- int32_t op_ret,
- int32_t op_errno,
- fd_t *fd,
- inode_t *inode,
- struct iatt *buf,
- struct iatt *preparent,
- struct iatt *postparent, dict_t *xdata);
+fop_open_cbk_stub(call_frame_t *frame, fop_open_cbk_t fn, int32_t op_ret,
+ int32_t op_errno, fd_t *fd, dict_t *xdata);
call_stub_t *
-fop_open_stub (call_frame_t *frame,
- fop_open_t fn,
- loc_t *loc,
- int32_t flags,
- fd_t *fd,
- dict_t *xdata);
+fop_readv_stub(call_frame_t *frame, fop_readv_t fn, fd_t *fd, size_t size,
+ off_t off, uint32_t flags, dict_t *xdata);
call_stub_t *
-fop_open_cbk_stub (call_frame_t *frame,
- fop_open_cbk_t fn,
- int32_t op_ret,
- int32_t op_errno,
- fd_t *fd, dict_t *xdata);
+fop_readv_cbk_stub(call_frame_t *frame, fop_readv_cbk_t fn, int32_t op_ret,
+ int32_t op_errno, struct iovec *vector, int32_t count,
+ struct iatt *stbuf, struct iobref *iobref, dict_t *xdata);
call_stub_t *
-fop_readv_stub (call_frame_t *frame,
- fop_readv_t fn,
- fd_t *fd,
- size_t size,
- off_t off, uint32_t flags, dict_t *xdata);
+fop_writev_stub(call_frame_t *frame, fop_writev_t fn, fd_t *fd,
+ struct iovec *vector, int32_t count, off_t off, uint32_t flags,
+ struct iobref *iobref, dict_t *xdata);
call_stub_t *
-fop_readv_cbk_stub (call_frame_t *frame,
- fop_readv_cbk_t fn,
- int32_t op_ret,
- int32_t op_errno,
- struct iovec *vector,
- int32_t count,
- struct iatt *stbuf,
- struct iobref *iobref, dict_t *xdata);
+fop_writev_cbk_stub(call_frame_t *frame, fop_writev_cbk_t fn, int32_t op_ret,
+ int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf,
+ dict_t *xdata);
call_stub_t *
-fop_writev_stub (call_frame_t *frame,
- fop_writev_t fn,
- fd_t *fd,
- struct iovec *vector,
- int32_t count,
- off_t off, uint32_t flags,
- struct iobref *iobref, dict_t *xdata);
+fop_flush_stub(call_frame_t *frame, fop_flush_t fn, fd_t *fd, dict_t *xdata);
call_stub_t *
-fop_writev_cbk_stub (call_frame_t *frame,
- fop_writev_cbk_t fn,
- int32_t op_ret,
- int32_t op_errno,
- struct iatt *prebuf,
- struct iatt *postbuf, dict_t *xdata);
+fop_flush_cbk_stub(call_frame_t *frame, fop_flush_cbk_t fn, int32_t op_ret,
+ int32_t op_errno, dict_t *xdata);
call_stub_t *
-fop_flush_stub (call_frame_t *frame,
- fop_flush_t fn,
- fd_t *fd, dict_t *xdata);
+fop_fsync_stub(call_frame_t *frame, fop_fsync_t fn, fd_t *fd, int32_t datasync,
+ dict_t *xdata);
call_stub_t *
-fop_flush_cbk_stub (call_frame_t *frame,
- fop_flush_cbk_t fn,
- int32_t op_ret,
- int32_t op_errno, dict_t *xdata);
+fop_fsync_cbk_stub(call_frame_t *frame, fop_fsync_cbk_t fn, int32_t op_ret,
+ int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf,
+ dict_t *xdata);
call_stub_t *
-fop_fsync_stub (call_frame_t *frame,
- fop_fsync_t fn,
- fd_t *fd,
- int32_t datasync, dict_t *xdata);
+fop_opendir_stub(call_frame_t *frame, fop_opendir_t fn, loc_t *loc, fd_t *fd,
+ dict_t *xdata);
call_stub_t *
-fop_fsync_cbk_stub (call_frame_t *frame,
- fop_fsync_cbk_t fn,
- int32_t op_ret,
- int32_t op_errno,
- struct iatt *prebuf,
- struct iatt *postbuf, dict_t *xdata);
+fop_opendir_cbk_stub(call_frame_t *frame, fop_opendir_cbk_t fn, int32_t op_ret,
+ int32_t op_errno, fd_t *fd, dict_t *xdata);
call_stub_t *
-fop_opendir_stub (call_frame_t *frame,
- fop_opendir_t fn,
- loc_t *loc, fd_t *fd, dict_t *xdata);
+fop_fsyncdir_stub(call_frame_t *frame, fop_fsyncdir_t fn, fd_t *fd,
+ int32_t datasync, dict_t *xdata);
call_stub_t *
-fop_opendir_cbk_stub (call_frame_t *frame,
- fop_opendir_cbk_t fn,
- int32_t op_ret,
- int32_t op_errno,
- fd_t *fd, dict_t *xdata);
+fop_fsyncdir_cbk_stub(call_frame_t *frame, fop_fsyncdir_cbk_t fn,
+ int32_t op_ret, int32_t op_errno, dict_t *xdata);
call_stub_t *
-fop_fsyncdir_stub (call_frame_t *frame,
- fop_fsyncdir_t fn,
- fd_t *fd,
- int32_t datasync, dict_t *xdata);
+fop_statfs_stub(call_frame_t *frame, fop_statfs_t fn, loc_t *loc,
+ dict_t *xdata);
call_stub_t *
-fop_fsyncdir_cbk_stub (call_frame_t *frame,
- fop_fsyncdir_cbk_t fn,
- int32_t op_ret,
- int32_t op_errno, dict_t *xdata);
+fop_statfs_cbk_stub(call_frame_t *frame, fop_statfs_cbk_t fn, int32_t op_ret,
+ int32_t op_errno, struct statvfs *buf, dict_t *xdata);
call_stub_t *
-fop_statfs_stub (call_frame_t *frame,
- fop_statfs_t fn,
- loc_t *loc, dict_t *xdata);
+fop_setxattr_stub(call_frame_t *frame, fop_setxattr_t fn, loc_t *loc,
+ dict_t *dict, int32_t flags, dict_t *xdata);
call_stub_t *
-fop_statfs_cbk_stub (call_frame_t *frame,
- fop_statfs_cbk_t fn,
- int32_t op_ret,
- int32_t op_errno,
- struct statvfs *buf, dict_t *xdata);
+fop_setxattr_cbk_stub(call_frame_t *frame, fop_setxattr_cbk_t fn,
+ int32_t op_ret, int32_t op_errno, dict_t *xdata);
call_stub_t *
-fop_setxattr_stub (call_frame_t *frame,
- fop_setxattr_t fn,
- loc_t *loc,
- dict_t *dict,
- int32_t flags, dict_t *xdata);
+fop_getxattr_stub(call_frame_t *frame, fop_getxattr_t fn, loc_t *loc,
+ const char *name, dict_t *xdata);
call_stub_t *
-fop_setxattr_cbk_stub (call_frame_t *frame,
- fop_setxattr_cbk_t fn,
- int32_t op_ret,
- int32_t op_errno, dict_t *xdata);
+fop_getxattr_cbk_stub(call_frame_t *frame, fop_getxattr_cbk_t fn,
+ int32_t op_ret, int32_t op_errno, dict_t *value,
+ dict_t *xdata);
call_stub_t *
-fop_getxattr_stub (call_frame_t *frame,
- fop_getxattr_t fn,
- loc_t *loc,
- const char *name, dict_t *xdata);
+fop_fsetxattr_stub(call_frame_t *frame, fop_fsetxattr_t fn, fd_t *fd,
+ dict_t *dict, int32_t flags, dict_t *xdata);
call_stub_t *
-fop_getxattr_cbk_stub (call_frame_t *frame,
- fop_getxattr_cbk_t fn,
- int32_t op_ret,
- int32_t op_errno,
- dict_t *value, dict_t *xdata);
+fop_fsetxattr_cbk_stub(call_frame_t *frame, fop_fsetxattr_cbk_t fn,
+ int32_t op_ret, int32_t op_errno, dict_t *xdata);
call_stub_t *
-fop_fsetxattr_stub (call_frame_t *frame,
- fop_fsetxattr_t fn,
- fd_t *fd,
- dict_t *dict,
- int32_t flags, dict_t *xdata);
+fop_fgetxattr_stub(call_frame_t *frame, fop_fgetxattr_t fn, fd_t *fd,
+ const char *name, dict_t *xdata);
call_stub_t *
-fop_fsetxattr_cbk_stub (call_frame_t *frame,
- fop_fsetxattr_cbk_t fn,
- int32_t op_ret,
- int32_t op_errno, dict_t *xdata);
+fop_fgetxattr_cbk_stub(call_frame_t *frame, fop_fgetxattr_cbk_t fn,
+ int32_t op_ret, int32_t op_errno, dict_t *value,
+ dict_t *xdata);
call_stub_t *
-fop_fgetxattr_stub (call_frame_t *frame,
- fop_fgetxattr_t fn,
- fd_t *fd,
- const char *name, dict_t *xdata);
+fop_removexattr_stub(call_frame_t *frame, fop_removexattr_t fn, loc_t *loc,
+ const char *name, dict_t *xdata);
call_stub_t *
-fop_fgetxattr_cbk_stub (call_frame_t *frame,
- fop_fgetxattr_cbk_t fn,
- int32_t op_ret,
- int32_t op_errno,
- dict_t *value, dict_t *xdata);
+fop_removexattr_cbk_stub(call_frame_t *frame, fop_removexattr_cbk_t fn,
+ int32_t op_ret, int32_t op_errno, dict_t *xdata);
call_stub_t *
-fop_removexattr_stub (call_frame_t *frame,
- fop_removexattr_t fn,
- loc_t *loc,
- const char *name, dict_t *xdata);
+fop_fremovexattr_stub(call_frame_t *frame, fop_fremovexattr_t fn, fd_t *fd,
+ const char *name, dict_t *xdata);
call_stub_t *
-fop_removexattr_cbk_stub (call_frame_t *frame,
- fop_removexattr_cbk_t fn,
- int32_t op_ret,
- int32_t op_errno, dict_t *xdata);
-
+fop_fremovexattr_cbk_stub(call_frame_t *frame, fop_fremovexattr_cbk_t fn,
+ int32_t op_ret, int32_t op_errno, dict_t *xdata);
call_stub_t *
-fop_fremovexattr_stub (call_frame_t *frame,
- fop_fremovexattr_t fn,
- fd_t *fd,
- const char *name, dict_t *xdata);
+fop_lk_stub(call_frame_t *frame, fop_lk_t fn, fd_t *fd, int32_t cmd,
+ struct gf_flock *lock, dict_t *xdata);
call_stub_t *
-fop_fremovexattr_cbk_stub (call_frame_t *frame,
- fop_fremovexattr_cbk_t fn,
- int32_t op_ret,
- int32_t op_errno, dict_t *xdata);
+fop_lk_cbk_stub(call_frame_t *frame, fop_lk_cbk_t fn, int32_t op_ret,
+ int32_t op_errno, struct gf_flock *lock, dict_t *xdata);
call_stub_t *
-fop_lk_stub (call_frame_t *frame,
- fop_lk_t fn,
- fd_t *fd,
- int32_t cmd,
- struct gf_flock *lock, dict_t *xdata);
+fop_inodelk_stub(call_frame_t *frame, fop_inodelk_t fn, const char *volume,
+ loc_t *loc, int32_t cmd, struct gf_flock *lock, dict_t *xdata);
call_stub_t *
-fop_lk_cbk_stub (call_frame_t *frame,
- fop_lk_cbk_t fn,
- int32_t op_ret,
- int32_t op_errno,
- struct gf_flock *lock, dict_t *xdata);
+fop_finodelk_stub(call_frame_t *frame, fop_finodelk_t fn, const char *volume,
+ fd_t *fd, int32_t cmd, struct gf_flock *lock, dict_t *xdata);
call_stub_t *
-fop_inodelk_stub (call_frame_t *frame, fop_inodelk_t fn,
- const char *volume, loc_t *loc, int32_t cmd,
- struct gf_flock *lock, dict_t *xdata);
+fop_entrylk_stub(call_frame_t *frame, fop_entrylk_t fn, const char *volume,
+ loc_t *loc, const char *basename, entrylk_cmd cmd,
+ entrylk_type type, dict_t *xdata);
call_stub_t *
-fop_finodelk_stub (call_frame_t *frame, fop_finodelk_t fn,
- const char *volume, fd_t *fd, int32_t cmd,
- struct gf_flock *lock, dict_t *xdata);
+fop_fentrylk_stub(call_frame_t *frame, fop_fentrylk_t fn, const char *volume,
+ fd_t *fd, const char *basename, entrylk_cmd cmd,
+ entrylk_type type, dict_t *xdata);
call_stub_t *
-fop_entrylk_stub (call_frame_t *frame, fop_entrylk_t fn,
- const char *volume, loc_t *loc, const char *basename,
- entrylk_cmd cmd, entrylk_type type, dict_t *xdata);
+fop_inodelk_cbk_stub(call_frame_t *frame, fop_inodelk_cbk_t fn, int32_t op_ret,
+ int32_t op_errno, dict_t *xdata);
call_stub_t *
-fop_fentrylk_stub (call_frame_t *frame, fop_fentrylk_t fn,
- const char *volume, fd_t *fd, const char *basename,
- entrylk_cmd cmd, entrylk_type type, dict_t *xdata);
+fop_finodelk_cbk_stub(call_frame_t *frame, fop_inodelk_cbk_t fn, int32_t op_ret,
+ int32_t op_errno, dict_t *xdata);
call_stub_t *
-fop_inodelk_cbk_stub (call_frame_t *frame, fop_inodelk_cbk_t fn,
- int32_t op_ret, int32_t op_errno, dict_t *xdata);
+fop_entrylk_cbk_stub(call_frame_t *frame, fop_entrylk_cbk_t fn, int32_t op_ret,
+ int32_t op_errno, dict_t *xdata);
call_stub_t *
-fop_finodelk_cbk_stub (call_frame_t *frame, fop_inodelk_cbk_t fn,
- int32_t op_ret, int32_t op_errno, dict_t *xdata);
+fop_fentrylk_cbk_stub(call_frame_t *frame, fop_entrylk_cbk_t fn, int32_t op_ret,
+ int32_t op_errno, dict_t *xdata);
call_stub_t *
-fop_entrylk_cbk_stub (call_frame_t *frame, fop_entrylk_cbk_t fn,
- int32_t op_ret, int32_t op_errno, dict_t *xdata);
+fop_readdir_stub(call_frame_t *frame, fop_readdir_t fn, fd_t *fd, size_t size,
+ off_t off, dict_t *xdata);
call_stub_t *
-fop_fentrylk_cbk_stub (call_frame_t *frame, fop_entrylk_cbk_t fn,
- int32_t op_ret, int32_t op_errno, dict_t *xdata);
+fop_readdirp_stub(call_frame_t *frame, fop_readdirp_t fn, fd_t *fd, size_t size,
+ off_t off, dict_t *xdata);
call_stub_t *
-fop_readdir_stub (call_frame_t *frame,
- fop_readdir_t fn,
- fd_t *fd,
- size_t size,
- off_t off, dict_t *xdata);
+fop_readdirp_cbk_stub(call_frame_t *frame, fop_readdir_cbk_t fn, int32_t op_ret,
+ int32_t op_errno, gf_dirent_t *entries, dict_t *xdata);
call_stub_t *
-fop_readdirp_stub (call_frame_t *frame,
- fop_readdirp_t fn,
- fd_t *fd,
- size_t size,
- off_t off,
- dict_t *xdata);
+fop_readdir_cbk_stub(call_frame_t *frame, fop_readdir_cbk_t fn, int32_t op_ret,
+ int32_t op_errno, gf_dirent_t *entries, dict_t *xdata);
call_stub_t *
-fop_readdirp_cbk_stub (call_frame_t *frame,
- fop_readdir_cbk_t fn,
- int32_t op_ret,
- int32_t op_errno,
- gf_dirent_t *entries, dict_t *xdata);
+fop_rchecksum_stub(call_frame_t *frame, fop_rchecksum_t fn, fd_t *fd,
+ off_t offset, int32_t len, dict_t *xdata);
call_stub_t *
-fop_readdir_cbk_stub (call_frame_t *frame,
- fop_readdir_cbk_t fn,
- int32_t op_ret,
- int32_t op_errno,
- gf_dirent_t *entries, dict_t *xdata);
+fop_rchecksum_cbk_stub(call_frame_t *frame, fop_rchecksum_cbk_t fn,
+ int32_t op_ret, int32_t op_errno, uint32_t weak_checksum,
+ uint8_t *strong_checksum, dict_t *xdata);
call_stub_t *
-fop_rchecksum_stub (call_frame_t *frame,
- fop_rchecksum_t fn,
- fd_t *fd, off_t offset,
- int32_t len, dict_t *xdata);
+fop_xattrop_stub(call_frame_t *frame, fop_xattrop_t fn, loc_t *loc,
+ gf_xattrop_flags_t optype, dict_t *xattr, dict_t *xdata);
call_stub_t *
-fop_rchecksum_cbk_stub (call_frame_t *frame,
- fop_rchecksum_cbk_t fn,
- int32_t op_ret,
- int32_t op_errno,
- uint32_t weak_checksum,
- uint8_t *strong_checksum, dict_t *xdata);
+fop_xattrop_stub_cbk_stub(call_frame_t *frame, fop_xattrop_cbk_t fn,
+ int32_t op_ret, int32_t op_errno, dict_t *xdata);
call_stub_t *
-fop_xattrop_stub (call_frame_t *frame,
- fop_xattrop_t fn,
- loc_t *loc,
- gf_xattrop_flags_t optype,
- dict_t *xattr, dict_t *xdata);
+fop_fxattrop_stub(call_frame_t *frame, fop_fxattrop_t fn, fd_t *fd,
+ gf_xattrop_flags_t optype, dict_t *xattr, dict_t *xdata);
call_stub_t *
-fop_xattrop_stub_cbk_stub (call_frame_t *frame,
- fop_xattrop_cbk_t fn,
- int32_t op_ret,
- int32_t op_errno, dict_t *xdata);
+fop_fxattrop_stub_cbk_stub(call_frame_t *frame, fop_xattrop_cbk_t fn,
+ int32_t op_ret, int32_t op_errno, dict_t *xdata);
call_stub_t *
-fop_fxattrop_stub (call_frame_t *frame,
- fop_fxattrop_t fn,
- fd_t *fd,
- gf_xattrop_flags_t optype,
- dict_t *xattr, dict_t *xdata);
+fop_setattr_stub(call_frame_t *frame, fop_setattr_t fn, loc_t *loc,
+ struct iatt *stbuf, int32_t valid, dict_t *xdata);
call_stub_t *
-fop_fxattrop_stub_cbk_stub (call_frame_t *frame,
- fop_xattrop_cbk_t fn,
- int32_t op_ret,
- int32_t op_errno, dict_t *xdata);
+fop_setattr_cbk_stub(call_frame_t *frame, fop_setattr_cbk_t fn, int32_t op_ret,
+ int32_t op_errno, struct iatt *statpre,
+ struct iatt *statpost, dict_t *xdata);
call_stub_t *
-fop_setattr_stub (call_frame_t *frame,
- fop_setattr_t fn,
- loc_t *loc,
- struct iatt *stbuf,
- int32_t valid, dict_t *xdata);
+fop_fsetattr_stub(call_frame_t *frame, fop_fsetattr_t fn, fd_t *fd,
+ struct iatt *stbuf, int32_t valid, dict_t *xdata);
call_stub_t *
-fop_setattr_cbk_stub (call_frame_t *frame,
- fop_setattr_cbk_t fn,
- int32_t op_ret,
- int32_t op_errno,
- struct iatt *statpre,
+fop_fsetattr_cbk_stub(call_frame_t *frame, fop_setattr_cbk_t fn, int32_t op_ret,
+ int32_t op_errno, struct iatt *statpre,
struct iatt *statpost, dict_t *xdata);
call_stub_t *
-fop_fsetattr_stub (call_frame_t *frame,
- fop_fsetattr_t fn,
- fd_t *fd,
- struct iatt *stbuf,
- int32_t valid, dict_t *xdata);
+fop_fallocate_stub(call_frame_t *frame, fop_fallocate_t fn, fd_t *fd,
+ int32_t mode, off_t offset, size_t len, dict_t *xdata);
call_stub_t *
-fop_fsetattr_cbk_stub (call_frame_t *frame,
- fop_setattr_cbk_t fn,
- int32_t op_ret,
- int32_t op_errno,
- struct iatt *statpre,
+fop_fallocate_cbk_stub(call_frame_t *frame, fop_fallocate_cbk_t fn,
+ int32_t op_ret, int32_t op_errno, struct iatt *statpre,
struct iatt *statpost, dict_t *xdata);
call_stub_t *
-fop_fallocate_stub(call_frame_t *frame,
- fop_fallocate_t fn,
- fd_t *fd,
- int32_t mode, off_t offset,
- size_t len, dict_t *xdata);
+fop_discard_stub(call_frame_t *frame, fop_discard_t fn, fd_t *fd, off_t offset,
+ size_t len, dict_t *xdata);
call_stub_t *
-fop_fallocate_cbk_stub(call_frame_t *frame,
- fop_fallocate_cbk_t fn,
- int32_t op_ret, int32_t op_errno,
- struct iatt *statpre, struct iatt *statpost,
- dict_t *xdata);
+fop_discard_cbk_stub(call_frame_t *frame, fop_discard_cbk_t fn, int32_t op_ret,
+ int32_t op_errno, struct iatt *statpre,
+ struct iatt *statpost, dict_t *xdata);
call_stub_t *
-fop_discard_stub(call_frame_t *frame,
- fop_discard_t fn,
- fd_t *fd,
- off_t offset,
- size_t len, dict_t *xdata);
+fop_zerofill_stub(call_frame_t *frame, fop_zerofill_t fn, fd_t *fd,
+ off_t offset, off_t len, dict_t *xdata);
call_stub_t *
-fop_discard_cbk_stub(call_frame_t *frame,
- fop_discard_cbk_t fn,
- int32_t op_ret, int32_t op_errno,
- struct iatt *statpre, struct iatt *statpost,
- dict_t *xdata);
+fop_zerofill_cbk_stub(call_frame_t *frame, fop_zerofill_cbk_t fn,
+ int32_t op_ret, int32_t op_errno, struct iatt *statpre,
+ struct iatt *statpost, dict_t *xdata);
call_stub_t *
-fop_zerofill_stub(call_frame_t *frame,
- fop_zerofill_t fn,
- fd_t *fd,
- off_t offset,
- off_t len, dict_t *xdata);
+fop_ipc_stub(call_frame_t *frame, fop_ipc_t fn, int32_t op, dict_t *xdata);
call_stub_t *
-fop_zerofill_cbk_stub(call_frame_t *frame,
- fop_zerofill_cbk_t fn,
- int32_t op_ret, int32_t op_errno,
- struct iatt *statpre, struct iatt *statpost,
- dict_t *xdata);
+fop_ipc_cbk_stub(call_frame_t *frame, fop_ipc_cbk_t fn, int32_t op_ret,
+ int32_t op_errno, dict_t *xdata);
call_stub_t *
-fop_ipc_stub (call_frame_t *frame, fop_ipc_t fn, int32_t op, dict_t *xdata);
+fop_seek_stub(call_frame_t *frame, fop_seek_t fn, fd_t *fd, off_t offset,
+ gf_seek_what_t what, dict_t *xdata);
call_stub_t *
-fop_ipc_cbk_stub (call_frame_t *frame, fop_ipc_cbk_t fn,
- int32_t op_ret, int32_t op_errno, dict_t *xdata);
+fop_seek_cbk_stub(call_frame_t *frame, fop_seek_cbk_t fn, int32_t op_ret,
+ int32_t op_errno, off_t offset, dict_t *xdata);
call_stub_t *
-fop_seek_stub (call_frame_t *frame, fop_seek_t fn, fd_t *fd, off_t offset,
- gf_seek_what_t what, dict_t *xdata);
+fop_lease_stub(call_frame_t *frame, fop_lease_t fn, loc_t *loc,
+ struct gf_lease *lease, dict_t *xdata);
call_stub_t *
-fop_seek_cbk_stub (call_frame_t *frame, fop_seek_cbk_t fn,
- int32_t op_ret, int32_t op_errno, off_t offset,
- dict_t *xdata);
+fop_lease_cbk_stub(call_frame_t *frame, fop_lease_cbk_t fn, int32_t op_ret,
+ int32_t op_errno, struct gf_lease *lease, dict_t *xdata);
call_stub_t *
-fop_lease_stub (call_frame_t *frame, fop_lease_t fn, loc_t *loc,
- struct gf_lease *lease, dict_t *xdata);
+fop_getactivelk_stub(call_frame_t *frame, fop_getactivelk_t fn, loc_t *loc,
+ dict_t *xdata);
call_stub_t *
-fop_lease_cbk_stub (call_frame_t *frame, fop_lease_cbk_t fn,
- int32_t op_ret, int32_t op_errno,
- struct gf_lease *lease, dict_t *xdata);
+fop_getactivelk_cbk_stub(call_frame_t *frame, fop_getactivelk_cbk_t fn,
+ int32_t op_ret, int32_t op_errno,
+ lock_migration_info_t *lmi, dict_t *xdata);
call_stub_t *
-fop_getactivelk_stub (call_frame_t *frame, fop_getactivelk_t fn,
- loc_t *loc, dict_t *xdata);
+fop_setactivelk_stub(call_frame_t *frame, fop_setactivelk_t fn, loc_t *loc,
+ lock_migration_info_t *locklist, dict_t *xdata);
call_stub_t *
-fop_getactivelk_cbk_stub (call_frame_t *frame, fop_getactivelk_cbk_t fn,
- int32_t op_ret, int32_t op_errno,
- lock_migration_info_t *lmi, dict_t *xdata);
+fop_setactivelk_cbk_stub(call_frame_t *frame, fop_setactivelk_cbk_t fn,
+ int32_t op_ret, int32_t op_errno, dict_t *xdata);
call_stub_t *
-fop_setactivelk_stub (call_frame_t *frame, fop_setactivelk_t fn,
- loc_t *loc, lock_migration_info_t *locklist,
- dict_t *xdata);
+fop_put_stub(call_frame_t *frame, fop_put_t fn, loc_t *loc, mode_t mode,
+ mode_t umask, uint32_t flags, struct iovec *vector, int32_t count,
+ off_t offset, struct iobref *iobref, dict_t *xattr, dict_t *xdata);
call_stub_t *
-fop_setactivelk_cbk_stub (call_frame_t *frame, fop_setactivelk_cbk_t fn,
- int32_t op_ret, int32_t op_errno, dict_t *xdata);
+fop_put_cbk_stub(call_frame_t *frame, fop_put_cbk_t fn, int32_t op_ret,
+ int32_t op_errno, inode_t *inode, struct iatt *buf,
+ struct iatt *preparent, struct iatt *postparent,
+ dict_t *xdata);
call_stub_t *
-fop_put_stub (call_frame_t *frame, fop_put_t fn, loc_t *loc,
- mode_t mode, mode_t umask, uint32_t flags,
- struct iovec *vector, int32_t count, off_t offset,
- struct iobref *iobref, dict_t *xattr, dict_t *xdata);
+fop_icreate_stub(call_frame_t *frame, fop_icreate_t fn, loc_t *loc, mode_t mode,
+ dict_t *xdata);
call_stub_t *
-fop_put_cbk_stub (call_frame_t *frame, fop_put_cbk_t fn, int32_t op_ret,
- int32_t op_errno, inode_t *inode, struct iatt *buf,
- struct iatt *preparent, struct iatt *postparent,
+fop_namelink_stub(call_frame_t *frame, fop_namelink_t fn, loc_t *loc,
dict_t *xdata);
call_stub_t *
-fop_icreate_stub (call_frame_t *frame, fop_icreate_t fn,
- loc_t *loc, mode_t mode, dict_t *xdata);
-
-call_stub_t *
-fop_namelink_stub (call_frame_t *frame,
- fop_namelink_t fn, loc_t *loc, dict_t *xdata);
-
-call_stub_t *
-fop_icreate_cbk_stub (call_frame_t *frame,
- fop_icreate_cbk_t fn,
- int32_t op_ret, int32_t op_errno,
- inode_t *inode, struct iatt *buf, dict_t *xdata);
+fop_icreate_cbk_stub(call_frame_t *frame, fop_icreate_cbk_t fn, int32_t op_ret,
+ int32_t op_errno, inode_t *inode, struct iatt *buf,
+ dict_t *xdata);
call_stub_t *
-fop_namelink_cbk_stub (call_frame_t *frame,
- fop_namelink_cbk_t fn,
- int32_t op_ret, int32_t op_errno,
- struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata);
+fop_namelink_cbk_stub(call_frame_t *frame, fop_namelink_cbk_t fn,
+ int32_t op_ret, int32_t op_errno, struct iatt *prebuf,
+ struct iatt *postbuf, dict_t *xdata);
-void call_resume (call_stub_t *stub);
-void call_resume_keep_stub (call_stub_t *stub);
-void call_stub_destroy (call_stub_t *stub);
-void call_unwind_error (call_stub_t *stub, int op_ret, int op_errno);
-void call_unwind_error_keep_stub (call_stub_t *stub, int op_ret, int op_errno);
+void
+call_resume(call_stub_t *stub);
+void
+call_resume_keep_stub(call_stub_t *stub);
+void
+call_stub_destroy(call_stub_t *stub);
+void
+call_unwind_error(call_stub_t *stub, int op_ret, int op_errno);
+void
+call_unwind_error_keep_stub(call_stub_t *stub, int op_ret, int op_errno);
/*
* Sometimes we might want to call just this, perhaps repeatedly, without
* having (or being able) to destroy and recreate it.
*/
-void call_resume_wind (call_stub_t *stub);
+void
+call_resume_wind(call_stub_t *stub);
#endif
diff --git a/libglusterfs/src/changelog.h b/libglusterfs/src/changelog.h
index 6f86e5a54cd..a09d9f25287 100644
--- a/libglusterfs/src/changelog.h
+++ b/libglusterfs/src/changelog.h
@@ -16,101 +16,100 @@ struct gf_brick_spec;
/**
* Max bit shiter for event selection
*/
-#define CHANGELOG_EV_SELECTION_RANGE 5
-
-#define CHANGELOG_OP_TYPE_JOURNAL (1<<0)
-#define CHANGELOG_OP_TYPE_OPEN (1<<1)
-#define CHANGELOG_OP_TYPE_CREATE (1<<2)
-#define CHANGELOG_OP_TYPE_RELEASE (1<<3)
-#define CHANGELOG_OP_TYPE_BR_RELEASE (1<<4) /* logical release (last close()),
- sent by bitrot stub */
-#define CHANGELOG_OP_TYPE_MAX (1<<CHANGELOG_EV_SELECTION_RANGE)
+#define CHANGELOG_EV_SELECTION_RANGE 5
+#define CHANGELOG_OP_TYPE_JOURNAL (1 << 0)
+#define CHANGELOG_OP_TYPE_OPEN (1 << 1)
+#define CHANGELOG_OP_TYPE_CREATE (1 << 2)
+#define CHANGELOG_OP_TYPE_RELEASE (1 << 3)
+#define CHANGELOG_OP_TYPE_BR_RELEASE \
+ (1 << 4) /* logical release (last close()), \
+ sent by bitrot stub */
+#define CHANGELOG_OP_TYPE_MAX (1 << CHANGELOG_EV_SELECTION_RANGE)
struct ev_open {
- unsigned char gfid[16];
- int32_t flags;
+ unsigned char gfid[16];
+ int32_t flags;
};
struct ev_creat {
- unsigned char gfid[16];
- int32_t flags;
+ unsigned char gfid[16];
+ int32_t flags;
};
struct ev_release {
- unsigned char gfid[16];
+ unsigned char gfid[16];
};
struct ev_release_br {
- unsigned long version;
- unsigned char gfid[16];
- int32_t sign_info;
+ unsigned long version;
+ unsigned char gfid[16];
+ int32_t sign_info;
};
struct ev_changelog {
- char path[PATH_MAX];
+ char path[PATH_MAX];
};
typedef struct changelog_event {
- unsigned int ev_type;
-
- union {
- struct ev_open open;
- struct ev_creat create;
- struct ev_release release;
- struct ev_changelog journal;
- struct ev_release_br releasebr;
- } u;
+ unsigned int ev_type;
+
+ union {
+ struct ev_open open;
+ struct ev_creat create;
+ struct ev_release release;
+ struct ev_changelog journal;
+ struct ev_release_br releasebr;
+ } u;
} changelog_event_t;
-#define CHANGELOG_EV_SIZE (sizeof (changelog_event_t))
+#define CHANGELOG_EV_SIZE (sizeof(changelog_event_t))
/**
* event callback, connected & disconnection defs
*/
-typedef void (CALLBACK) (void *, char *,
- void *, changelog_event_t *);
-typedef void *(INIT) (void *, struct gf_brick_spec *);
-typedef void (FINI) (void *, char *, void *);
-typedef void (CONNECT) (void *, char *, void *);
-typedef void (DISCONNECT) (void *, char *, void *);
+typedef void(CALLBACK)(void *, char *, void *, changelog_event_t *);
+typedef void *(INIT)(void *, struct gf_brick_spec *);
+typedef void(FINI)(void *, char *, void *);
+typedef void(CONNECT)(void *, char *, void *);
+typedef void(DISCONNECT)(void *, char *, void *);
struct gf_brick_spec {
- char *brick_path;
- unsigned int filter;
+ char *brick_path;
+ unsigned int filter;
- INIT *init;
- FINI *fini;
- CALLBACK *callback;
- CONNECT *connected;
- DISCONNECT *disconnected;
+ INIT *init;
+ FINI *fini;
+ CALLBACK *callback;
+ CONNECT *connected;
+ DISCONNECT *disconnected;
- void *ptr;
+ void *ptr;
};
/* API set */
int
-gf_changelog_register (char *brick_path, char *scratch_dir,
- char *log_file, int log_levl, int max_reconnects);
+gf_changelog_register(char *brick_path, char *scratch_dir, char *log_file,
+ int log_levl, int max_reconnects);
ssize_t
-gf_changelog_scan ();
+gf_changelog_scan();
int
-gf_changelog_start_fresh ();
+gf_changelog_start_fresh();
ssize_t
-gf_changelog_next_change (char *bufptr, size_t maxlen);
+gf_changelog_next_change(char *bufptr, size_t maxlen);
int
-gf_changelog_done (char *file);
+gf_changelog_done(char *file);
/* newer flexible API */
int
-gf_changelog_init (void *xl);
+gf_changelog_init(void *xl);
int
-gf_changelog_register_generic (struct gf_brick_spec *bricks, int count,
- int ordered, char *logfile, int lvl, void *xl);
+gf_changelog_register_generic(struct gf_brick_spec *bricks, int count,
+ int ordered, char *logfile, int lvl, void *xl);
#endif
diff --git a/libglusterfs/src/checksum.h b/libglusterfs/src/checksum.h
index 677a59aa91e..019bb14df71 100644
--- a/libglusterfs/src/checksum.h
+++ b/libglusterfs/src/checksum.h
@@ -12,11 +12,11 @@
#define __CHECKSUM_H__
uint32_t
-gf_rsync_weak_checksum (unsigned char *buf, size_t len);
+gf_rsync_weak_checksum(unsigned char *buf, size_t len);
void
-gf_rsync_strong_checksum (unsigned char *buf, size_t len, unsigned char *sum);
+gf_rsync_strong_checksum(unsigned char *buf, size_t len, unsigned char *sum);
void
-gf_rsync_md5_checksum (unsigned char *data, size_t len, unsigned char *md5);
+gf_rsync_md5_checksum(unsigned char *data, size_t len, unsigned char *md5);
#endif /* __CHECKSUM_H__ */
diff --git a/libglusterfs/src/circ-buff.h b/libglusterfs/src/circ-buff.h
index e3459f5e3d0..a839cd03c67 100644
--- a/libglusterfs/src/circ-buff.h
+++ b/libglusterfs/src/circ-buff.h
@@ -18,47 +18,46 @@
#define BUFFER_SIZE 10
#define TOTAL_SIZE BUFFER_SIZE + 1
-
struct _circular_buffer {
- struct timeval tv;
- void *data;
+ struct timeval tv;
+ void *data;
};
typedef struct _circular_buffer circular_buffer_t;
struct _buffer {
- unsigned int w_index;
- size_t size_buffer;
- gf_boolean_t use_once;
- /* This variable is assigned the proper value at the time of initing */
- /* the buffer. It indicates, whether the buffer should be used once */
- /* it becomes full. */
-
- int used_len;
- /* indicates the amount of circular buffer used. */
-
- circular_buffer_t **cb;
- void (*destroy_buffer_data) (void *data);
- pthread_mutex_t lock;
+ unsigned int w_index;
+ size_t size_buffer;
+ gf_boolean_t use_once;
+ /* This variable is assigned the proper value at the time of initing */
+ /* the buffer. It indicates, whether the buffer should be used once */
+ /* it becomes full. */
+
+ int used_len;
+ /* indicates the amount of circular buffer used. */
+
+ circular_buffer_t **cb;
+ void (*destroy_buffer_data)(void *data);
+ pthread_mutex_t lock;
};
typedef struct _buffer buffer_t;
int
-cb_add_entry_buffer (buffer_t *buffer, void *item);
+cb_add_entry_buffer(buffer_t *buffer, void *item);
void
-cb_buffer_show (buffer_t *buffer);
+cb_buffer_show(buffer_t *buffer);
buffer_t *
-cb_buffer_new (size_t buffer_size,gf_boolean_t use_buffer_once,
- void (*destroy_data) (void *data));
+cb_buffer_new(size_t buffer_size, gf_boolean_t use_buffer_once,
+ void (*destroy_data)(void *data));
void
-cb_buffer_destroy (buffer_t *buffer);
+cb_buffer_destroy(buffer_t *buffer);
void
-cb_buffer_dump (buffer_t *buffer, void *data,
- int (fn) (circular_buffer_t *buffer, void *data));
+cb_buffer_dump(buffer_t *buffer, void *data,
+ int(fn)(circular_buffer_t *buffer, void *data));
#endif /* _CB_H */
diff --git a/libglusterfs/src/client_t.h b/libglusterfs/src/client_t.h
index 66db3e86499..57241a00d5f 100644
--- a/libglusterfs/src/client_t.h
+++ b/libglusterfs/src/client_t.h
@@ -12,128 +12,128 @@
#define _CLIENT_T_H
#include "glusterfs.h"
-#include "locking.h" /* for gf_lock_t, not included by glusterfs.h */
-#include "atomic.h" /* for gf_atomic_t */
+#include "locking.h" /* for gf_lock_t, not included by glusterfs.h */
+#include "atomic.h" /* for gf_atomic_t */
struct client_ctx {
- void *ctx_key;
- void *ctx_value;
+ void *ctx_key;
+ void *ctx_value;
};
typedef struct _client {
- struct {
- /* e.g. protocol/server stashes its ctx here */
- gf_lock_t lock;
- unsigned short count;
- struct client_ctx *ctx;
- } scratch_ctx;
- gf_atomic_t bind;
- gf_atomic_t count;
- xlator_t *bound_xl;
- xlator_t *this;
- int tbl_index;
- char *client_uid;
- char *client_name;
- struct {
- int flavour;
- size_t len;
- char *data;
- char *username;
- char *passwd;
- } auth;
-
- /* subdir_mount */
- char *subdir_mount;
- inode_t *subdir_inode;
- uuid_t subdir_gfid;
- int32_t opversion;
+ struct {
+ /* e.g. protocol/server stashes its ctx here */
+ gf_lock_t lock;
+ unsigned short count;
+ struct client_ctx *ctx;
+ } scratch_ctx;
+ gf_atomic_t bind;
+ gf_atomic_t count;
+ xlator_t *bound_xl;
+ xlator_t *this;
+ int tbl_index;
+ char *client_uid;
+ char *client_name;
+ struct {
+ int flavour;
+ size_t len;
+ char *data;
+ char *username;
+ char *passwd;
+ } auth;
+
+ /* subdir_mount */
+ char *subdir_mount;
+ inode_t *subdir_inode;
+ uuid_t subdir_gfid;
+ int32_t opversion;
} client_t;
#define GF_CLIENTCTX_INITIAL_SIZE 8
struct client_table_entry {
- client_t *client;
- int next_free;
+ client_t *client;
+ int next_free;
};
typedef struct client_table_entry cliententry_t;
struct clienttable {
- unsigned int max_clients;
- gf_lock_t lock;
- cliententry_t *cliententries;
- int first_free;
- client_t *local;
+ unsigned int max_clients;
+ gf_lock_t lock;
+ cliententry_t *cliententries;
+ int first_free;
+ client_t *local;
};
typedef struct clienttable clienttable_t;
#define GF_CLIENTTABLE_INITIAL_SIZE 128
/* Signifies no more entries in the client table. */
-#define GF_CLIENTTABLE_END -1
+#define GF_CLIENTTABLE_END -1
/* This is used to invalidate
* the next_free value in an cliententry that has been allocated
*/
-#define GF_CLIENTENTRY_ALLOCATED -2
+#define GF_CLIENTENTRY_ALLOCATED -2
struct rpcsvc_auth_data;
client_t *
-gf_client_get (xlator_t *this, struct rpcsvc_auth_data *cred,
- char *client_uid, char *subdir_mount);
+gf_client_get(xlator_t *this, struct rpcsvc_auth_data *cred, char *client_uid,
+ char *subdir_mount);
void
-gf_client_put (client_t *client, gf_boolean_t *detached);
+gf_client_put(client_t *client, gf_boolean_t *detached);
clienttable_t *
-gf_clienttable_alloc (void);
+gf_clienttable_alloc(void);
void
-gf_client_clienttable_destroy (clienttable_t *clienttable);
+gf_client_clienttable_destroy(clienttable_t *clienttable);
client_t *
-gf_client_ref (client_t *client);
+gf_client_ref(client_t *client);
void
-gf_client_unref (client_t *client);
+gf_client_unref(client_t *client);
int
-gf_client_dump_fdtable_to_dict (xlator_t *this, dict_t *dict);
+gf_client_dump_fdtable_to_dict(xlator_t *this, dict_t *dict);
int
-gf_client_dump_fdtable (xlator_t *this);
+gf_client_dump_fdtable(xlator_t *this);
int
-gf_client_dump_inodes_to_dict (xlator_t *this, dict_t *dict);
+gf_client_dump_inodes_to_dict(xlator_t *this, dict_t *dict);
int
-gf_client_dump_inodes (xlator_t *this);
+gf_client_dump_inodes(xlator_t *this);
void *
-client_ctx_set (client_t *client, void *key, void *value);
+client_ctx_set(client_t *client, void *key, void *value);
int
-client_ctx_get (client_t *client, void *key, void **value);
+client_ctx_get(client_t *client, void *key, void **value);
int
-client_ctx_del (client_t *client, void *key, void **value);
+client_ctx_del(client_t *client, void *key, void **value);
void
-client_ctx_dump (client_t *client, char *prefix);
+client_ctx_dump(client_t *client, char *prefix);
int
-gf_client_dump_fdtables_to_dict (xlator_t *this, dict_t *dict);
+gf_client_dump_fdtables_to_dict(xlator_t *this, dict_t *dict);
int
-gf_client_dump_fdtables (xlator_t *this);
+gf_client_dump_fdtables(xlator_t *this);
int
-gf_client_dump_inodes_to_dict (xlator_t *this, dict_t *dict);
+gf_client_dump_inodes_to_dict(xlator_t *this, dict_t *dict);
int
-gf_client_dump_inodes (xlator_t *this);
+gf_client_dump_inodes(xlator_t *this);
int
-gf_client_disconnect (client_t *client);
+gf_client_disconnect(client_t *client);
#endif /* _CLIENT_T_H */
diff --git a/libglusterfs/src/cluster-syncop.h b/libglusterfs/src/cluster-syncop.h
index 9127dde6dfb..10388db74cc 100644
--- a/libglusterfs/src/cluster-syncop.h
+++ b/libglusterfs/src/cluster-syncop.h
@@ -8,7 +8,6 @@
cases as published by the Free Software Foundation.
*/
-
#ifndef _CLUSTER_SYNCOP_H
#define _CLUSTER_SYNCOP_H
@@ -28,200 +27,201 @@
* functionality.
*
********************************************************************/
-#define PARALLEL_FOP_ONLIST(subvols, on, numsubvols, replies, frame, \
- func, args ...) \
-do { \
- int __i = 0; \
- int __count = 0; \
- cluster_local_t __local = {0,}; \
- void *__old_local = frame->local; \
- \
- __local.replies = replies; \
- cluster_replies_wipe (replies, numsubvols); \
- for (__i = 0; __i < numsubvols; __i++) \
- INIT_LIST_HEAD (&replies[__i].entries.list); \
- if (syncbarrier_init (&__local.barrier)) \
- break; \
- frame->local = &__local; \
- for (__i = 0; __i < numsubvols; __i++) { \
- if (on[__i]) { \
- __count++; \
- } \
- } \
- __local.barrier.waitfor = __count; \
- for (__i = 0; __i < numsubvols; __i++) { \
- if (on[__i]) { \
- func (frame, subvols[__i], __i, ## args); \
- } \
- } \
- syncbarrier_wait (&__local.barrier, __count); \
- syncbarrier_destroy (&__local.barrier); \
- frame->local = __old_local; \
- STACK_RESET (frame->root); \
-} while (0)
+#define PARALLEL_FOP_ONLIST(subvols, on, numsubvols, replies, frame, func, \
+ args...) \
+ do { \
+ int __i = 0; \
+ int __count = 0; \
+ cluster_local_t __local = { \
+ 0, \
+ }; \
+ void *__old_local = frame->local; \
+ \
+ __local.replies = replies; \
+ cluster_replies_wipe(replies, numsubvols); \
+ for (__i = 0; __i < numsubvols; __i++) \
+ INIT_LIST_HEAD(&replies[__i].entries.list); \
+ if (syncbarrier_init(&__local.barrier)) \
+ break; \
+ frame->local = &__local; \
+ for (__i = 0; __i < numsubvols; __i++) { \
+ if (on[__i]) { \
+ __count++; \
+ } \
+ } \
+ __local.barrier.waitfor = __count; \
+ for (__i = 0; __i < numsubvols; __i++) { \
+ if (on[__i]) { \
+ func(frame, subvols[__i], __i, ##args); \
+ } \
+ } \
+ syncbarrier_wait(&__local.barrier, __count); \
+ syncbarrier_destroy(&__local.barrier); \
+ frame->local = __old_local; \
+ STACK_RESET(frame->root); \
+ } while (0)
typedef struct cluster_local_ {
- default_args_cbk_t *replies;
- syncbarrier_t barrier;
+ default_args_cbk_t *replies;
+ syncbarrier_t barrier;
} cluster_local_t;
int32_t
-cluster_lookup (xlator_t **subvols, unsigned char *on, int numsubvols,
+cluster_lookup(xlator_t **subvols, unsigned char *on, int numsubvols,
+ default_args_cbk_t *replies, unsigned char *output,
+ call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata);
+int32_t
+cluster_setattr(xlator_t **subvols, unsigned char *on, int numsubvols,
default_args_cbk_t *replies, unsigned char *output,
- call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata);
+ call_frame_t *frame, xlator_t *this, loc_t *loc,
+ struct iatt *stbuf, int32_t valid, dict_t *xdata);
int32_t
-cluster_setattr (xlator_t **subvols, unsigned char *on, int numsubvols,
+cluster_getxattr(xlator_t **subvols, unsigned char *on, int numsubvols,
default_args_cbk_t *replies, unsigned char *output,
call_frame_t *frame, xlator_t *this, loc_t *loc,
- struct iatt *stbuf, int32_t valid, dict_t *xdata);
+ const char *name, dict_t *xdata);
int32_t
-cluster_getxattr (xlator_t **subvols, unsigned char *on, int numsubvols,
- default_args_cbk_t *replies, unsigned char *output,
- call_frame_t *frame, xlator_t *this, loc_t *loc,
- const char *name, dict_t *xdata);
-int32_t
-cluster_setxattr (xlator_t **subvols, unsigned char *on, int numsubvols,
- default_args_cbk_t *replies, unsigned char *output,
- call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict,
- int32_t flags, dict_t *xdata);
+cluster_setxattr(xlator_t **subvols, unsigned char *on, int numsubvols,
+ default_args_cbk_t *replies, unsigned char *output,
+ call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict,
+ int32_t flags, dict_t *xdata);
int
-cluster_inodelk (xlator_t **subvols, unsigned char *on, int numsubvols,
- default_args_cbk_t *replies, unsigned char *locked_on,
- call_frame_t *frame, xlator_t *this, char *dom,
- inode_t *inode, off_t off, size_t size);
+cluster_inodelk(xlator_t **subvols, unsigned char *on, int numsubvols,
+ default_args_cbk_t *replies, unsigned char *locked_on,
+ call_frame_t *frame, xlator_t *this, char *dom, inode_t *inode,
+ off_t off, size_t size);
int
-cluster_uninodelk (xlator_t **subvols, unsigned char *locked_on, int numsubvols,
- default_args_cbk_t *replies, unsigned char *output,
- call_frame_t *frame, xlator_t *this, char *dom,
- inode_t *inode, off_t off, size_t size);
+cluster_uninodelk(xlator_t **subvols, unsigned char *locked_on, int numsubvols,
+ default_args_cbk_t *replies, unsigned char *output,
+ call_frame_t *frame, xlator_t *this, char *dom,
+ inode_t *inode, off_t off, size_t size);
int
-cluster_entrylk (xlator_t **subvols, unsigned char *on, int numsubvols,
- default_args_cbk_t *replies, unsigned char *locked_on,
- call_frame_t *frame, xlator_t *this, char *dom,
- inode_t *inode, const char *name);
+cluster_entrylk(xlator_t **subvols, unsigned char *on, int numsubvols,
+ default_args_cbk_t *replies, unsigned char *locked_on,
+ call_frame_t *frame, xlator_t *this, char *dom, inode_t *inode,
+ const char *name);
int32_t
-cluster_rmdir (xlator_t **subvols, unsigned char *on, int numsubvols,
- default_args_cbk_t *replies, unsigned char *output,
- call_frame_t *frame, xlator_t *this, loc_t *loc, int flags,
- dict_t *xdata);
+cluster_rmdir(xlator_t **subvols, unsigned char *on, int numsubvols,
+ default_args_cbk_t *replies, unsigned char *output,
+ call_frame_t *frame, xlator_t *this, loc_t *loc, int flags,
+ dict_t *xdata);
int32_t
-cluster_unlink (xlator_t **subvols, unsigned char *on, int numsubvols,
- default_args_cbk_t *replies, unsigned char *output,
- call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag,
- dict_t *xdata);
+cluster_unlink(xlator_t **subvols, unsigned char *on, int numsubvols,
+ default_args_cbk_t *replies, unsigned char *output,
+ call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag,
+ dict_t *xdata);
int
-cluster_mkdir (xlator_t **subvols, unsigned char *on, int numsubvols,
- default_args_cbk_t *replies, unsigned char *output,
- call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode,
- mode_t umask, dict_t *xdata);
+cluster_mkdir(xlator_t **subvols, unsigned char *on, int numsubvols,
+ default_args_cbk_t *replies, unsigned char *output,
+ call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode,
+ mode_t umask, dict_t *xdata);
int32_t
-cluster_readlink (xlator_t **subvols, unsigned char *on, int numsubvols,
- default_args_cbk_t *replies, unsigned char *output,
- call_frame_t *frame, xlator_t *this, loc_t *loc, size_t size,
- dict_t *xdata);
+cluster_readlink(xlator_t **subvols, unsigned char *on, int numsubvols,
+ default_args_cbk_t *replies, unsigned char *output,
+ call_frame_t *frame, xlator_t *this, loc_t *loc, size_t size,
+ dict_t *xdata);
int
-cluster_symlink (xlator_t **subvols, unsigned char *on, int numsubvols,
- default_args_cbk_t *replies, unsigned char *output,
- call_frame_t *frame, xlator_t *this, const char *linkpath,
- loc_t *loc, mode_t umask, dict_t *xdata);
+cluster_symlink(xlator_t **subvols, unsigned char *on, int numsubvols,
+ default_args_cbk_t *replies, unsigned char *output,
+ call_frame_t *frame, xlator_t *this, const char *linkpath,
+ loc_t *loc, mode_t umask, dict_t *xdata);
int32_t
-cluster_link (xlator_t **subvols, unsigned char *on, int numsubvols,
+cluster_link(xlator_t **subvols, unsigned char *on, int numsubvols,
+ default_args_cbk_t *replies, unsigned char *output,
+ call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc,
+ dict_t *xdata);
+
+int
+cluster_mknod(xlator_t **subvols, unsigned char *on, int numsubvols,
default_args_cbk_t *replies, unsigned char *output,
- call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc,
- dict_t *xdata);
+ call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode,
+ dev_t rdev, mode_t umask, dict_t *xdata);
int
-cluster_mknod (xlator_t **subvols, unsigned char *on, int numsubvols,
- default_args_cbk_t *replies, unsigned char *output,
- call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode,
- dev_t rdev, mode_t umask, dict_t *xdata);
+cluster_unentrylk(xlator_t **subvols, unsigned char *locked_on, int numsubvols,
+ default_args_cbk_t *replies, unsigned char *output,
+ call_frame_t *frame, xlator_t *this, char *dom,
+ inode_t *inode, const char *name);
int
-cluster_unentrylk (xlator_t **subvols, unsigned char *locked_on, int numsubvols,
- default_args_cbk_t *replies, unsigned char *output,
+cluster_tryentrylk(xlator_t **subvols, unsigned char *on, int numsubvols,
+ default_args_cbk_t *replies, unsigned char *locked_on,
call_frame_t *frame, xlator_t *this, char *dom,
inode_t *inode, const char *name);
-int
-cluster_tryentrylk (xlator_t **subvols, unsigned char *on, int numsubvols,
- default_args_cbk_t *replies, unsigned char *locked_on,
- call_frame_t *frame, xlator_t *this, char *dom,
- inode_t *inode, const char *name);
-
int32_t
-cluster_fxattrop (xlator_t **subvols, unsigned char *on, int numsubvols,
- default_args_cbk_t *replies, unsigned char *output,
- call_frame_t *frame, xlator_t *this, fd_t *fd,
- gf_xattrop_flags_t flags, dict_t *dict, dict_t *xdata);
-
-int32_t
-cluster_xattrop (xlator_t **subvols, unsigned char *on, int numsubvols,
+cluster_fxattrop(xlator_t **subvols, unsigned char *on, int numsubvols,
default_args_cbk_t *replies, unsigned char *output,
- call_frame_t *frame, xlator_t *this, loc_t *loc,
+ call_frame_t *frame, xlator_t *this, fd_t *fd,
gf_xattrop_flags_t flags, dict_t *dict, dict_t *xdata);
int32_t
-cluster_fstat (xlator_t **subvols, unsigned char *on, int numsubvols,
- default_args_cbk_t *replies, unsigned char *output,
- call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata);
+cluster_xattrop(xlator_t **subvols, unsigned char *on, int numsubvols,
+ default_args_cbk_t *replies, unsigned char *output,
+ call_frame_t *frame, xlator_t *this, loc_t *loc,
+ gf_xattrop_flags_t flags, dict_t *dict, dict_t *xdata);
int32_t
-cluster_ftruncate (xlator_t **subvols, unsigned char *on, int numsubvols,
- default_args_cbk_t *replies, unsigned char *output,
- call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
- dict_t *xdata);
+cluster_fstat(xlator_t **subvols, unsigned char *on, int numsubvols,
+ default_args_cbk_t *replies, unsigned char *output,
+ call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata);
int32_t
-cluster_open (xlator_t **subvols, unsigned char *on, int numsubvols,
- default_args_cbk_t *replies, unsigned char *output,
- call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags,
- fd_t *fd, dict_t *xdata);
+cluster_ftruncate(xlator_t **subvols, unsigned char *on, int numsubvols,
+ default_args_cbk_t *replies, unsigned char *output,
+ call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
+ dict_t *xdata);
+
+int32_t
+cluster_open(xlator_t **subvols, unsigned char *on, int numsubvols,
+ default_args_cbk_t *replies, unsigned char *output,
+ call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags,
+ fd_t *fd, dict_t *xdata);
int
-cluster_tryinodelk (xlator_t **subvols, unsigned char *on, int numsubvols,
- default_args_cbk_t *replies, unsigned char *locked_on,
- call_frame_t *frame, xlator_t *this, char *dom,
- inode_t *inode, off_t off, size_t size);
+cluster_tryinodelk(xlator_t **subvols, unsigned char *on, int numsubvols,
+ default_args_cbk_t *replies, unsigned char *locked_on,
+ call_frame_t *frame, xlator_t *this, char *dom,
+ inode_t *inode, off_t off, size_t size);
int32_t
-cluster_fsetattr (xlator_t **subvols, unsigned char *on, int numsubvols,
- default_args_cbk_t *replies, unsigned char *output,
- call_frame_t *frame, xlator_t *this, fd_t *fd,
- struct iatt *stbuf, int32_t valid, dict_t *xdata);
+cluster_fsetattr(xlator_t **subvols, unsigned char *on, int numsubvols,
+ default_args_cbk_t *replies, unsigned char *output,
+ call_frame_t *frame, xlator_t *this, fd_t *fd,
+ struct iatt *stbuf, int32_t valid, dict_t *xdata);
int32_t
-cluster_put (xlator_t **subvols, unsigned char *on, int numsubvols,
- default_args_cbk_t *replies, unsigned char *output,
- call_frame_t *frame, xlator_t *this, loc_t *loc,
- mode_t mode, mode_t umask, uint32_t flags, struct iovec *vector,
- int32_t count, off_t offset, struct iobref *iobref, dict_t *xattr,
- dict_t *xdata);
+cluster_put(xlator_t **subvols, unsigned char *on, int numsubvols,
+ default_args_cbk_t *replies, unsigned char *output,
+ call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode,
+ mode_t umask, uint32_t flags, struct iovec *vector, int32_t count,
+ off_t offset, struct iobref *iobref, dict_t *xattr, dict_t *xdata);
void
-cluster_replies_wipe (default_args_cbk_t *replies, int num_subvols);
+cluster_replies_wipe(default_args_cbk_t *replies, int num_subvols);
int32_t
-cluster_fop_success_fill (default_args_cbk_t *replies, int numsubvols,
- unsigned char *success);
+cluster_fop_success_fill(default_args_cbk_t *replies, int numsubvols,
+ unsigned char *success);
int32_t
-cluster_xattrop_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, dict_t *dict,
- dict_t *xdata);
+cluster_xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *dict,
+ dict_t *xdata);
int
-cluster_tiebreaker_inodelk (xlator_t **subvols, unsigned char *on,
- int numsubvols, default_args_cbk_t *replies,
- unsigned char *locked_on, call_frame_t *frame,
- xlator_t *this, char *dom, inode_t *inode,
- off_t off, size_t size);
+cluster_tiebreaker_inodelk(xlator_t **subvols, unsigned char *on,
+ int numsubvols, default_args_cbk_t *replies,
+ unsigned char *locked_on, call_frame_t *frame,
+ xlator_t *this, char *dom, inode_t *inode, off_t off,
+ size_t size);
#endif /* !_CLUSTER_SYNCOP_H */
diff --git a/libglusterfs/src/common-utils.h b/libglusterfs/src/common-utils.h
index ef09ca5a337..84733dffa85 100644
--- a/libglusterfs/src/common-utils.h
+++ b/libglusterfs/src/common-utils.h
@@ -29,12 +29,13 @@
#define ffsll(x) __builtin_ffsll(x)
#endif
-void trap (void);
+void
+trap(void);
-#define GF_UNIVERSAL_ANSWER 42 /* :O */
+#define GF_UNIVERSAL_ANSWER 42 /* :O */
/* To solve type punned error */
-#define VOID(ptr) ((void **) ((void *) ptr))
+#define VOID(ptr) ((void **)((void *)ptr))
#include "logging.h"
#include "glusterfs.h"
@@ -47,34 +48,38 @@ void trap (void);
#include "protocol-common.h"
#include "iobuf.h"
-
#define STRINGIFY(val) #val
#define TOSTRING(val) STRINGIFY(val)
-#define alloca0(size) ({void *__ptr; __ptr = alloca(size); memset(__ptr, 0, size); __ptr; })
+#define alloca0(size) \
+ ({ \
+ void *__ptr; \
+ __ptr = alloca(size); \
+ memset(__ptr, 0, size); \
+ __ptr; \
+ })
-#define min(a,b) ((a)<(b)?(a):(b))
-#define max(a,b) ((a)>(b)?(a):(b))
-#define roof(a,b) ((((a)+(b)-1)/((b!=0)?(b):1))*(b))
-#define floor(a,b) (((a)/((b!=0)?(b):1))*(b))
+#define min(a, b) ((a) < (b) ? (a) : (b))
+#define max(a, b) ((a) > (b) ? (a) : (b))
+#define roof(a, b) ((((a) + (b)-1) / ((b != 0) ? (b) : 1)) * (b))
+#define floor(a, b) (((a) / ((b != 0) ? (b) : 1)) * (b))
#define IPv4_ADDR_SIZE 32
+#define GF_UNIT_KB 1024ULL
+#define GF_UNIT_MB 1048576ULL
+#define GF_UNIT_GB 1073741824ULL
+#define GF_UNIT_TB 1099511627776ULL
+#define GF_UNIT_PB 1125899906842624ULL
-#define GF_UNIT_KB 1024ULL
-#define GF_UNIT_MB 1048576ULL
-#define GF_UNIT_GB 1073741824ULL
-#define GF_UNIT_TB 1099511627776ULL
-#define GF_UNIT_PB 1125899906842624ULL
-
-#define GF_UNIT_B_STRING "B"
-#define GF_UNIT_KB_STRING "KB"
-#define GF_UNIT_MB_STRING "MB"
-#define GF_UNIT_GB_STRING "GB"
-#define GF_UNIT_TB_STRING "TB"
-#define GF_UNIT_PB_STRING "PB"
+#define GF_UNIT_B_STRING "B"
+#define GF_UNIT_KB_STRING "KB"
+#define GF_UNIT_MB_STRING "MB"
+#define GF_UNIT_GB_STRING "GB"
+#define GF_UNIT_TB_STRING "TB"
+#define GF_UNIT_PB_STRING "PB"
-#define GF_UNIT_PERCENT_STRING "%"
+#define GF_UNIT_PERCENT_STRING "%"
#define GEOREP "geo-replication"
#define GHADOOP "glusterfs-hadoop"
@@ -82,22 +87,28 @@ void trap (void);
#define GF_SELINUX_XATTR_KEY "security.selinux"
-#define WIPE(statp) do { typeof(*statp) z = {0,}; if (statp) *statp = z; } while (0)
+#define WIPE(statp) \
+ do { \
+ typeof(*statp) z = { \
+ 0, \
+ }; \
+ if (statp) \
+ *statp = z; \
+ } while (0)
-#define IS_EXT_FS(fs_name) \
- (!strcmp (fs_name, "ext2") || \
- !strcmp (fs_name, "ext3") || \
- !strcmp (fs_name, "ext4"))
+#define IS_EXT_FS(fs_name) \
+ (!strcmp(fs_name, "ext2") || !strcmp(fs_name, "ext3") || \
+ !strcmp(fs_name, "ext4"))
/* process mode definitions */
-#define GF_SERVER_PROCESS 0
-#define GF_CLIENT_PROCESS 1
+#define GF_SERVER_PROCESS 0
+#define GF_CLIENT_PROCESS 1
#define GF_GLUSTERD_PROCESS 2
/* Defining this here as it is needed by glusterd for setting
* nfs port in volume status.
*/
-#define GF_NFS3_PORT 2049
+#define GF_NFS3_PORT 2049
#define GF_CLIENT_PORT_CEILING 1024
#define GF_IANA_PRIV_PORTS_START 49152 /* RFC 6335 */
@@ -106,9 +117,9 @@ void trap (void);
#define GF_PORT_ARRAY_SIZE ((GF_PORT_MAX + 7) / 8)
#define GF_LOCK_TIMER 180
#define GF_MINUTE_IN_SECONDS 60
-#define GF_HOUR_IN_SECONDS (60*60)
-#define GF_DAY_IN_SECONDS (24*60*60)
-#define GF_WEEK_IN_SECONDS (7*24*60*60)
+#define GF_HOUR_IN_SECONDS (60 * 60)
+#define GF_DAY_IN_SECONDS (24 * 60 * 60)
+#define GF_WEEK_IN_SECONDS (7 * 24 * 60 * 60)
/* Default timeout for both barrier and changelog translator */
#define BARRIER_TIMEOUT "120"
@@ -121,7 +132,7 @@ void trap (void);
#define GF_XXHSUM64_DEFAULT_SEED 0
/* Shard */
-#define GF_XATTR_SHARD_FILE_SIZE "trusted.glusterfs.shard.file-size"
+#define GF_XATTR_SHARD_FILE_SIZE "trusted.glusterfs.shard.file-size"
#define SHARD_ROOT_GFID "be318638-e8a0-4c6d-977d-7a937aa84806"
#define DOT_SHARD_REMOVE_ME_GFID "77dd5a45-dbf5-4592-b31b-b440382302e9"
@@ -129,10 +140,9 @@ void trap (void);
* Format: 4hexnum-4hexnum-4hexnum-4hexnum-4hexnum-4hexnum-4hexnum-4hexnum
* Eg:6c69-6431-2d63-6c6e-7431-0000-0000-0000
*/
-#define GF_LEASE_ID_BUF_SIZE ((LEASE_ID_SIZE * 2) + \
- (LEASE_ID_SIZE / 2))
+#define GF_LEASE_ID_BUF_SIZE ((LEASE_ID_SIZE * 2) + (LEASE_ID_SIZE / 2))
-#define GF_PERCENTAGE(val, total) (((val)*100)/(total))
+#define GF_PERCENTAGE(val, total) (((val)*100) / (total))
/* pthread related */
/* as per the man page, thread-name should be at max 16 bytes */
@@ -142,9 +152,9 @@ void trap (void);
#define GF_THREAD_NAME_PREFIX_LEN 5
#include <stdbool.h>
-#define gf_boolean_t bool
-#define _gf_false false
-#define _gf_true true
+#define gf_boolean_t bool
+#define _gf_false false
+#define _gf_true true
/*
* we could have initialized these as +ve values and treated
@@ -152,26 +162,25 @@ void trap (void);
* saved us with the pain of assigning values), but since we
* only have a few clients that use this feature, it's okay.
*/
-enum _gf_special_pid
-{
- GF_CLIENT_PID_MAX = 0,
- GF_CLIENT_PID_GSYNCD = -1,
- GF_CLIENT_PID_HADOOP = -2,
- GF_CLIENT_PID_DEFRAG = -3,
- GF_CLIENT_PID_NO_ROOT_SQUASH = -4,
- GF_CLIENT_PID_QUOTA_MOUNT = -5,
- GF_CLIENT_PID_SELF_HEALD = -6,
- GF_CLIENT_PID_GLFS_HEAL = -7,
- GF_CLIENT_PID_BITD = -8,
- GF_CLIENT_PID_SCRUB = -9,
- GF_CLIENT_PID_TIER_DEFRAG = -10,
- GF_SERVER_PID_TRASH = -11
+enum _gf_special_pid {
+ GF_CLIENT_PID_MAX = 0,
+ GF_CLIENT_PID_GSYNCD = -1,
+ GF_CLIENT_PID_HADOOP = -2,
+ GF_CLIENT_PID_DEFRAG = -3,
+ GF_CLIENT_PID_NO_ROOT_SQUASH = -4,
+ GF_CLIENT_PID_QUOTA_MOUNT = -5,
+ GF_CLIENT_PID_SELF_HEALD = -6,
+ GF_CLIENT_PID_GLFS_HEAL = -7,
+ GF_CLIENT_PID_BITD = -8,
+ GF_CLIENT_PID_SCRUB = -9,
+ GF_CLIENT_PID_TIER_DEFRAG = -10,
+ GF_SERVER_PID_TRASH = -11
};
enum _gf_xlator_ipc_targets {
- GF_IPC_TARGET_CHANGELOG = 0,
- GF_IPC_TARGET_CTR = 1,
- GF_IPC_TARGET_UPCALL = 2
+ GF_IPC_TARGET_CHANGELOG = 0,
+ GF_IPC_TARGET_CTR = 1,
+ GF_IPC_TARGET_UPCALL = 2
};
typedef enum _gf_special_pid gf_special_pid_t;
@@ -193,785 +202,861 @@ typedef enum _gf_xlator_ipc_targets _gf_xlator_ipc_targets_t;
* not have such restrictions
*/
typedef struct dht_changelog_rename_info {
- uuid_t old_pargfid;
- uuid_t new_pargfid;
- int32_t oldname_len;
- int32_t newname_len;
- char buffer[1];
- } dht_changelog_rename_info_t;
-
+ uuid_t old_pargfid;
+ uuid_t new_pargfid;
+ int32_t oldname_len;
+ int32_t newname_len;
+ char buffer[1];
+} dht_changelog_rename_info_t;
-typedef int (*gf_cmp) (void *, void *);
+typedef int (*gf_cmp)(void *, void *);
struct _dict;
struct dnscache {
- struct _dict *cache_dict;
- time_t ttl;
+ struct _dict *cache_dict;
+ time_t ttl;
};
struct dnscache_entry {
- char *ip;
- char *fqdn;
- time_t timestamp;
+ char *ip;
+ char *fqdn;
+ time_t timestamp;
};
struct dnscache6 {
- struct addrinfo *first;
- struct addrinfo *next;
+ struct addrinfo *first;
+ struct addrinfo *next;
};
struct list_node {
- void *ptr;
- struct list_head list;
+ void *ptr;
+ struct list_head list;
};
extern char *vol_type_str[];
-struct list_node *list_node_add (void *ptr, struct list_head *list);
-struct list_node *list_node_add_order (void *ptr, struct list_head *list,
- int (*compare)(struct list_head *,
- struct list_head *));
-void list_node_del (struct list_node *node);
+struct list_node *
+list_node_add(void *ptr, struct list_head *list);
+struct list_node *
+list_node_add_order(void *ptr, struct list_head *list,
+ int (*compare)(struct list_head *, struct list_head *));
+void
+list_node_del(struct list_node *node);
-struct dnscache *gf_dnscache_init (time_t ttl);
-struct dnscache_entry *gf_dnscache_entry_init (void);
-void gf_dnscache_entry_deinit (struct dnscache_entry *entry);
-char *gf_rev_dns_lookup_cached (const char *ip, struct dnscache *dnscache);
+struct dnscache *
+gf_dnscache_init(time_t ttl);
+struct dnscache_entry *
+gf_dnscache_entry_init(void);
+void
+gf_dnscache_entry_deinit(struct dnscache_entry *entry);
+char *
+gf_rev_dns_lookup_cached(const char *ip, struct dnscache *dnscache);
-char *gf_resolve_path_parent (const char *path);
+char *
+gf_resolve_path_parent(const char *path);
-void gf_global_variable_init(void);
+void
+gf_global_variable_init(void);
-int32_t gf_resolve_ip6 (const char *hostname, uint16_t port, int family,
- void **dnscache, struct addrinfo **addr_info);
+int32_t
+gf_resolve_ip6(const char *hostname, uint16_t port, int family, void **dnscache,
+ struct addrinfo **addr_info);
-void gf_log_dump_graph (FILE *specfp, glusterfs_graph_t *graph);
-void gf_print_trace (int32_t signal, glusterfs_ctx_t *ctx);
-int gf_set_log_file_path (cmd_args_t *cmd_args, glusterfs_ctx_t *ctx);
-int gf_set_log_ident (cmd_args_t *cmd_args);
+void
+gf_log_dump_graph(FILE *specfp, glusterfs_graph_t *graph);
+void
+gf_print_trace(int32_t signal, glusterfs_ctx_t *ctx);
+int
+gf_set_log_file_path(cmd_args_t *cmd_args, glusterfs_ctx_t *ctx);
+int
+gf_set_log_ident(cmd_args_t *cmd_args);
-int gf_process_getspec_servers_list(cmd_args_t *cmd_args,
- const char *servers_list);
-int gf_set_volfile_server_common (cmd_args_t *cmd_args, const char *host,
- const char *transport, int port);
+int
+gf_process_getspec_servers_list(cmd_args_t *cmd_args, const char *servers_list);
+int
+gf_set_volfile_server_common(cmd_args_t *cmd_args, const char *host,
+ const char *transport, int port);
static inline void
-BIT_SET (unsigned char *array, unsigned int index)
+BIT_SET(unsigned char *array, unsigned int index)
{
- unsigned int offset = index / 8;
- unsigned int shift = index % 8;
+ unsigned int offset = index / 8;
+ unsigned int shift = index % 8;
- array[offset] |= (1 << shift);
+ array[offset] |= (1 << shift);
}
static inline void
-BIT_CLEAR (unsigned char *array, unsigned int index)
+BIT_CLEAR(unsigned char *array, unsigned int index)
{
- unsigned int offset = index / 8;
- unsigned int shift = index % 8;
+ unsigned int offset = index / 8;
+ unsigned int shift = index % 8;
- array[offset] &= ~(1 << shift);
+ array[offset] &= ~(1 << shift);
}
static inline unsigned int
-BIT_VALUE (unsigned char *array, unsigned int index)
+BIT_VALUE(unsigned char *array, unsigned int index)
{
- unsigned int offset = index / 8;
- unsigned int shift = index % 8;
+ unsigned int offset = index / 8;
+ unsigned int shift = index % 8;
- return (array[offset] >> shift) & 0x1;
+ return (array[offset] >> shift) & 0x1;
}
-#define VECTORSIZE(count) (count * (sizeof (struct iovec)))
+#define VECTORSIZE(count) (count * (sizeof(struct iovec)))
#define STRLEN_0(str) (strlen(str) + 1)
-#define VALIDATE_OR_GOTO(arg,label) do { \
- if (!arg) { \
- errno = EINVAL; \
- gf_msg_callingfn ((this ? (this->name) : \
- "(Govinda! Govinda!)"), \
- GF_LOG_WARNING, EINVAL, \
- LG_MSG_INVALID_ARG, \
- "invalid argument: " #arg); \
- goto label; \
- } \
- } while (0)
-
-#define GF_VALIDATE_OR_GOTO(name,arg,label) do { \
- if (!arg) { \
- errno = EINVAL; \
- gf_msg_callingfn (name, GF_LOG_ERROR, errno, \
- LG_MSG_INVALID_ARG, \
- "invalid argument: " #arg); \
- goto label; \
- } \
- } while (0)
-
-#define GF_VALIDATE_OR_GOTO_WITH_ERROR(name, arg, label, errno, error) do { \
- if (!arg) { \
- errno = error; \
- gf_msg_callingfn (name, GF_LOG_ERROR, EINVAL, \
- LG_MSG_INVALID_ARG, \
- "invalid argument: " #arg); \
- goto label; \
- } \
- }while (0)
-
-#define GF_CHECK_ALLOC(arg, retval, label) do { \
- if (!(arg)) { \
- retval = -ENOMEM; \
- goto label; \
- } \
- } while (0) \
-
-#define GF_CHECK_ALLOC_AND_LOG(name, item, retval, msg, errlabel) do { \
- if (!(item)) { \
- (retval) = -ENOMEM; \
- gf_msg (name, GF_LOG_CRITICAL, ENOMEM, \
- LG_MSG_NO_MEMORY, (msg)); \
- goto errlabel; \
- } \
- } while (0)
-
-#define GF_ASSERT_AND_GOTO_WITH_ERROR(name, arg, label, errno, error) do { \
- if (!arg) { \
- GF_ASSERT (0); \
- errno = error; \
- goto label; \
- } \
- }while (0)
-
-#define GF_VALIDATE_ABSOLUTE_PATH_OR_GOTO(name,arg,label) \
- do { \
- GF_VALIDATE_OR_GOTO (name, arg, label); \
- if ((arg[0]) != '/') { \
- errno = EINVAL; \
- gf_msg_callingfn (name, GF_LOG_ERROR, EINVAL, \
- LG_MSG_INVALID_ARG, \
- "invalid argument: " #arg); \
- goto label; \
- } \
- } while (0)
-
-#define GF_REMOVE_SLASH_FROM_PATH(path, string) \
- do { \
- int i = 0; \
- for (i = 1; i < strlen (path); i++) { \
- string[i-1] = path[i]; \
- if (string[i-1] == '/') \
- string[i-1] = '-'; \
- } \
- } while (0)
-
-#define GF_REMOVE_INTERNAL_XATTR(pattern, dict) \
- do { \
- if (!dict) { \
- gf_msg (this->name, GF_LOG_ERROR, 0, \
- LG_MSG_DICT_NULL, "dict is null"); \
- break; \
- } \
- dict_foreach_fnmatch (dict, pattern, \
- dict_remove_foreach_fn, \
- NULL); \
- } while (0)
-
-#define GF_IF_INTERNAL_XATTR_GOTO(pattern, dict, op_errno, label) \
- do { \
- if (!dict) { \
- gf_msg (this->name, GF_LOG_ERROR, 0, \
- LG_MSG_DICT_NULL, \
- "setxattr dict is null"); \
- goto label; \
- } \
- if (dict_foreach_fnmatch (dict, pattern, \
- dict_null_foreach_fn, \
- NULL) > 0) { \
- op_errno = EPERM; \
- gf_msg (this->name, GF_LOG_ERROR, op_errno, \
- LG_MSG_NO_PERM, \
- "attempt to set internal" \
- " xattr: %s", pattern); \
- goto label; \
- } \
- } while (0)
-
-#define GF_IF_NATIVE_XATTR_GOTO(pattern, key, op_errno, label) \
- do { \
- if (!key) { \
- gf_msg (this->name, GF_LOG_ERROR, 0, \
- LG_MSG_NO_KEY, \
- "no key for removexattr"); \
- goto label; \
- } \
- if (!fnmatch (pattern, key, 0)) { \
- op_errno = EPERM; \
- gf_msg (this->name, GF_LOG_ERROR, op_errno, \
- LG_MSG_NO_PERM, \
- "attempt to remove internal " \
- "xattr: %s", key); \
- goto label; \
- } \
- } while (0)
-
-
-#define GF_FILE_CONTENT_REQUESTED(_xattr_req,_content_limit) \
- (dict_get_uint64 (_xattr_req, "glusterfs.content", _content_limit) == 0)
+#define VALIDATE_OR_GOTO(arg, label) \
+ do { \
+ if (!arg) { \
+ errno = EINVAL; \
+ gf_msg_callingfn((this ? (this->name) : "(Govinda! Govinda!)"), \
+ GF_LOG_WARNING, EINVAL, LG_MSG_INVALID_ARG, \
+ "invalid argument: " #arg); \
+ goto label; \
+ } \
+ } while (0)
+
+#define GF_VALIDATE_OR_GOTO(name, arg, label) \
+ do { \
+ if (!arg) { \
+ errno = EINVAL; \
+ gf_msg_callingfn(name, GF_LOG_ERROR, errno, LG_MSG_INVALID_ARG, \
+ "invalid argument: " #arg); \
+ goto label; \
+ } \
+ } while (0)
+
+#define GF_VALIDATE_OR_GOTO_WITH_ERROR(name, arg, label, errno, error) \
+ do { \
+ if (!arg) { \
+ errno = error; \
+ gf_msg_callingfn(name, GF_LOG_ERROR, EINVAL, LG_MSG_INVALID_ARG, \
+ "invalid argument: " #arg); \
+ goto label; \
+ } \
+ } while (0)
+
+#define GF_CHECK_ALLOC(arg, retval, label) \
+ do { \
+ if (!(arg)) { \
+ retval = -ENOMEM; \
+ goto label; \
+ } \
+ } while (0)
+
+#define GF_CHECK_ALLOC_AND_LOG(name, item, retval, msg, errlabel) \
+ do { \
+ if (!(item)) { \
+ (retval) = -ENOMEM; \
+ gf_msg(name, GF_LOG_CRITICAL, ENOMEM, LG_MSG_NO_MEMORY, (msg)); \
+ goto errlabel; \
+ } \
+ } while (0)
+
+#define GF_ASSERT_AND_GOTO_WITH_ERROR(name, arg, label, errno, error) \
+ do { \
+ if (!arg) { \
+ GF_ASSERT(0); \
+ errno = error; \
+ goto label; \
+ } \
+ } while (0)
+
+#define GF_VALIDATE_ABSOLUTE_PATH_OR_GOTO(name, arg, label) \
+ do { \
+ GF_VALIDATE_OR_GOTO(name, arg, label); \
+ if ((arg[0]) != '/') { \
+ errno = EINVAL; \
+ gf_msg_callingfn(name, GF_LOG_ERROR, EINVAL, LG_MSG_INVALID_ARG, \
+ "invalid argument: " #arg); \
+ goto label; \
+ } \
+ } while (0)
+
+#define GF_REMOVE_SLASH_FROM_PATH(path, string) \
+ do { \
+ int i = 0; \
+ for (i = 1; i < strlen(path); i++) { \
+ string[i - 1] = path[i]; \
+ if (string[i - 1] == '/') \
+ string[i - 1] = '-'; \
+ } \
+ } while (0)
+
+#define GF_REMOVE_INTERNAL_XATTR(pattern, dict) \
+ do { \
+ if (!dict) { \
+ gf_msg(this->name, GF_LOG_ERROR, 0, LG_MSG_DICT_NULL, \
+ "dict is null"); \
+ break; \
+ } \
+ dict_foreach_fnmatch(dict, pattern, dict_remove_foreach_fn, NULL); \
+ } while (0)
+
+#define GF_IF_INTERNAL_XATTR_GOTO(pattern, dict, op_errno, label) \
+ do { \
+ if (!dict) { \
+ gf_msg(this->name, GF_LOG_ERROR, 0, LG_MSG_DICT_NULL, \
+ "setxattr dict is null"); \
+ goto label; \
+ } \
+ if (dict_foreach_fnmatch(dict, pattern, dict_null_foreach_fn, NULL) > \
+ 0) { \
+ op_errno = EPERM; \
+ gf_msg(this->name, GF_LOG_ERROR, op_errno, LG_MSG_NO_PERM, \
+ "attempt to set internal" \
+ " xattr: %s", \
+ pattern); \
+ goto label; \
+ } \
+ } while (0)
+
+#define GF_IF_NATIVE_XATTR_GOTO(pattern, key, op_errno, label) \
+ do { \
+ if (!key) { \
+ gf_msg(this->name, GF_LOG_ERROR, 0, LG_MSG_NO_KEY, \
+ "no key for removexattr"); \
+ goto label; \
+ } \
+ if (!fnmatch(pattern, key, 0)) { \
+ op_errno = EPERM; \
+ gf_msg(this->name, GF_LOG_ERROR, op_errno, LG_MSG_NO_PERM, \
+ "attempt to remove internal " \
+ "xattr: %s", \
+ key); \
+ goto label; \
+ } \
+ } while (0)
+
+#define GF_FILE_CONTENT_REQUESTED(_xattr_req, _content_limit) \
+ (dict_get_uint64(_xattr_req, "glusterfs.content", _content_limit) == 0)
#ifdef DEBUG
-#define GF_ASSERT(x) assert (x);
+#define GF_ASSERT(x) assert(x);
#else
-#define GF_ASSERT(x) \
- do { \
- if (!(x)) { \
- gf_msg_callingfn ("", GF_LOG_ERROR, 0, \
- LG_MSG_ASSERTION_FAILED, \
- "Assertion failed: " #x); \
- } \
- } while (0)
+#define GF_ASSERT(x) \
+ do { \
+ if (!(x)) { \
+ gf_msg_callingfn("", GF_LOG_ERROR, 0, LG_MSG_ASSERTION_FAILED, \
+ "Assertion failed: " #x); \
+ } \
+ } while (0)
#endif
-#define GF_ABORT(msg) \
- do { \
- gf_msg_callingfn ("", GF_LOG_CRITICAL, 0, \
- LG_MSG_ASSERTION_FAILED, \
- "Assertion failed: " msg); \
- abort(); \
- } while (0)
+#define GF_ABORT(msg) \
+ do { \
+ gf_msg_callingfn("", GF_LOG_CRITICAL, 0, LG_MSG_ASSERTION_FAILED, \
+ "Assertion failed: " msg); \
+ abort(); \
+ } while (0)
-#define GF_UUID_ASSERT(u) \
- if (gf_uuid_is_null (u))\
- GF_ASSERT (!"uuid null");
+#define GF_UUID_ASSERT(u) \
+ if (gf_uuid_is_null(u)) \
+ GF_ASSERT(!"uuid null");
-#define GF_IGNORE_IF_GSYNCD_SAFE_ERROR(frame, op_errno) \
- (((frame->root->pid == GF_CLIENT_PID_GSYNCD) && \
- (op_errno == EEXIST || op_errno == ENOENT))?0:1) \
+#define GF_IGNORE_IF_GSYNCD_SAFE_ERROR(frame, op_errno) \
+ (((frame->root->pid == GF_CLIENT_PID_GSYNCD) && \
+ (op_errno == EEXIST || op_errno == ENOENT)) \
+ ? 0 \
+ : 1)
union gf_sock_union {
- struct sockaddr_storage storage;
- struct sockaddr_in6 sin6;
- struct sockaddr_in sin;
- struct sockaddr sa;
+ struct sockaddr_storage storage;
+ struct sockaddr_in6 sin6;
+ struct sockaddr_in sin;
+ struct sockaddr sa;
};
#define GF_HIDDEN_PATH ".glusterfs"
-#define GF_UNLINK_PATH GF_HIDDEN_PATH"/unlink"
-#define GF_LANDFILL_PATH GF_HIDDEN_PATH"/landfill"
-
-#define IOV_MIN(n) min(IOV_MAX,n)
-
-#define GF_SKIP_IRRELEVANT_ENTRIES(entry, dir, scr) \
- do {\
- entry = NULL;\
- if (dir) { \
- entry = sys_readdir (dir, scr); \
- while (entry && (!strcmp (entry->d_name, ".") || \
- !fnmatch ("*.tmp", entry->d_name, 0) || \
- !strcmp (entry->d_name, ".."))) { \
- entry = sys_readdir (dir, scr); \
- } \
- } \
- } while (0)
+#define GF_UNLINK_PATH GF_HIDDEN_PATH "/unlink"
+#define GF_LANDFILL_PATH GF_HIDDEN_PATH "/landfill"
+
+#define IOV_MIN(n) min(IOV_MAX, n)
+
+#define GF_SKIP_IRRELEVANT_ENTRIES(entry, dir, scr) \
+ do { \
+ entry = NULL; \
+ if (dir) { \
+ entry = sys_readdir(dir, scr); \
+ while (entry && (!strcmp(entry->d_name, ".") || \
+ !fnmatch("*.tmp", entry->d_name, 0) || \
+ !strcmp(entry->d_name, ".."))) { \
+ entry = sys_readdir(dir, scr); \
+ } \
+ } \
+ } while (0)
static inline void
-iov_free (struct iovec *vector, int count)
+iov_free(struct iovec *vector, int count)
{
- int i;
+ int i;
- for (i = 0; i < count; i++)
- FREE (vector[i].iov_base);
+ for (i = 0; i < count; i++)
+ FREE(vector[i].iov_base);
- GF_FREE (vector);
+ GF_FREE(vector);
}
-
static inline int
-iov_length (const struct iovec *vector, int count)
+iov_length(const struct iovec *vector, int count)
{
- int i = 0;
- size_t size = 0;
+ int i = 0;
+ size_t size = 0;
- for (i = 0; i < count; i++)
- size += vector[i].iov_len;
+ for (i = 0; i < count; i++)
+ size += vector[i].iov_len;
- return size;
+ return size;
}
-
static inline struct iovec *
-iov_dup (const struct iovec *vector, int count)
+iov_dup(const struct iovec *vector, int count)
{
- int bytecount = 0;
- int i;
- struct iovec *newvec = NULL;
+ int bytecount = 0;
+ int i;
+ struct iovec *newvec = NULL;
- bytecount = (count * sizeof (struct iovec));
- newvec = GF_MALLOC (bytecount, gf_common_mt_iovec);
- if (!newvec)
- return NULL;
+ bytecount = (count * sizeof(struct iovec));
+ newvec = GF_MALLOC(bytecount, gf_common_mt_iovec);
+ if (!newvec)
+ return NULL;
- for (i = 0; i < count; i++) {
- newvec[i].iov_len = vector[i].iov_len;
- newvec[i].iov_base = vector[i].iov_base;
- }
+ for (i = 0; i < count; i++) {
+ newvec[i].iov_len = vector[i].iov_len;
+ newvec[i].iov_base = vector[i].iov_base;
+ }
- return newvec;
+ return newvec;
}
-
static inline int
-iov_subset (struct iovec *orig, int orig_count,
- off_t src_offset, off_t dst_offset,
- struct iovec *new)
+iov_subset(struct iovec *orig, int orig_count, off_t src_offset,
+ off_t dst_offset, struct iovec *new)
{
- int new_count = 0;
- int i;
- off_t offset = 0;
- size_t start_offset = 0;
- size_t end_offset = 0, origin_iov_len = 0;
-
+ int new_count = 0;
+ int i;
+ off_t offset = 0;
+ size_t start_offset = 0;
+ size_t end_offset = 0, origin_iov_len = 0;
- for (i = 0; i < orig_count; i++) {
- origin_iov_len = orig[i].iov_len;
+ for (i = 0; i < orig_count; i++) {
+ origin_iov_len = orig[i].iov_len;
- if ((offset + orig[i].iov_len < src_offset)
- || (offset > dst_offset)) {
- goto not_subset;
- }
+ if ((offset + orig[i].iov_len < src_offset) || (offset > dst_offset)) {
+ goto not_subset;
+ }
- if (!new) {
- goto count_only;
- }
+ if (!new) {
+ goto count_only;
+ }
- start_offset = 0;
- end_offset = orig[i].iov_len;
+ start_offset = 0;
+ end_offset = orig[i].iov_len;
- if (src_offset >= offset) {
- start_offset = (src_offset - offset);
- }
+ if (src_offset >= offset) {
+ start_offset = (src_offset - offset);
+ }
- if (dst_offset <= (offset + orig[i].iov_len)) {
- end_offset = (dst_offset - offset);
- }
+ if (dst_offset <= (offset + orig[i].iov_len)) {
+ end_offset = (dst_offset - offset);
+ }
- new[new_count].iov_base = orig[i].iov_base + start_offset;
- new[new_count].iov_len = end_offset - start_offset;
+ new[new_count].iov_base = orig[i].iov_base + start_offset;
+ new[new_count].iov_len = end_offset - start_offset;
- count_only:
- new_count++;
+ count_only:
+ new_count++;
- not_subset:
- offset += origin_iov_len;
- }
+ not_subset:
+ offset += origin_iov_len;
+ }
- return new_count;
+ return new_count;
}
-
static inline void
-iov_unload (char *buf, const struct iovec *vector, int count)
+iov_unload(char *buf, const struct iovec *vector, int count)
{
- int i;
- int copied = 0;
+ int i;
+ int copied = 0;
- for (i = 0; i < count; i++) {
- memcpy (buf + copied, vector[i].iov_base, vector[i].iov_len);
- copied += vector[i].iov_len;
- }
+ for (i = 0; i < count; i++) {
+ memcpy(buf + copied, vector[i].iov_base, vector[i].iov_len);
+ copied += vector[i].iov_len;
+ }
}
-
static inline size_t
-iov_load (const struct iovec *vector, int count, char *buf, int size)
+iov_load(const struct iovec *vector, int count, char *buf, int size)
{
- size_t left = size;
- size_t cp = 0;
- int ret = 0;
- int i = 0;
-
- while (left && i < count) {
- cp = min (vector[i].iov_len, left);
- if (vector[i].iov_base != buf + (size - left))
- memcpy (vector[i].iov_base, buf + (size - left), cp);
- ret += cp;
- left -= cp;
- if (left)
- i++;
- }
-
- return ret;
+ size_t left = size;
+ size_t cp = 0;
+ int ret = 0;
+ int i = 0;
+
+ while (left && i < count) {
+ cp = min(vector[i].iov_len, left);
+ if (vector[i].iov_base != buf + (size - left))
+ memcpy(vector[i].iov_base, buf + (size - left), cp);
+ ret += cp;
+ left -= cp;
+ if (left)
+ i++;
+ }
+
+ return ret;
}
-
static inline size_t
-iov_copy (const struct iovec *dst, int dcnt,
- const struct iovec *src, int scnt)
+iov_copy(const struct iovec *dst, int dcnt, const struct iovec *src, int scnt)
{
- size_t ret = 0;
- size_t left = 0;
- size_t min_i = 0;
- int s_i = 0, s_ii = 0;
- int d_i = 0, d_ii = 0;
-
- ret = min (iov_length (dst, dcnt), iov_length (src, scnt));
- left = ret;
-
- while (left) {
- min_i = min (dst[d_i].iov_len - d_ii, src[s_i].iov_len - s_ii);
- memcpy (dst[d_i].iov_base + d_ii, src[s_i].iov_base + s_ii,
- min_i);
-
- d_ii += min_i;
- if (d_ii == dst[d_i].iov_len) {
- d_ii = 0;
- d_i++;
- }
-
- s_ii += min_i;
- if (s_ii == src[s_i].iov_len) {
- s_ii = 0;
- s_i++;
- }
-
- left -= min_i;
- }
-
- return ret;
-}
+ size_t ret = 0;
+ size_t left = 0;
+ size_t min_i = 0;
+ int s_i = 0, s_ii = 0;
+ int d_i = 0, d_ii = 0;
+
+ ret = min(iov_length(dst, dcnt), iov_length(src, scnt));
+ left = ret;
+
+ while (left) {
+ min_i = min(dst[d_i].iov_len - d_ii, src[s_i].iov_len - s_ii);
+ memcpy(dst[d_i].iov_base + d_ii, src[s_i].iov_base + s_ii, min_i);
+
+ d_ii += min_i;
+ if (d_ii == dst[d_i].iov_len) {
+ d_ii = 0;
+ d_i++;
+ }
+
+ s_ii += min_i;
+ if (s_ii == src[s_i].iov_len) {
+ s_ii = 0;
+ s_i++;
+ }
+
+ left -= min_i;
+ }
+ return ret;
+}
static inline int
-mem_0filled (const char *buf, size_t size)
+mem_0filled(const char *buf, size_t size)
{
- int i = 0;
- int ret = 0;
+ int i = 0;
+ int ret = 0;
- for (i = 0; i < size; i++) {
- ret = buf[i];
- if (ret)
- break;
- }
+ for (i = 0; i < size; i++) {
+ ret = buf[i];
+ if (ret)
+ break;
+ }
- return ret;
+ return ret;
}
-
static inline int
-iov_0filled (struct iovec *vector, int count)
+iov_0filled(struct iovec *vector, int count)
{
- int i = 0;
- int ret = 0;
+ int i = 0;
+ int ret = 0;
- for (i = 0; i < count; i++) {
- ret = mem_0filled (vector[i].iov_base, vector[i].iov_len);
- if (ret)
- break;
- }
+ for (i = 0; i < count; i++) {
+ ret = mem_0filled(vector[i].iov_base, vector[i].iov_len);
+ if (ret)
+ break;
+ }
- return ret;
+ return ret;
}
-
static inline void *
-memdup (const void *ptr, size_t size)
+memdup(const void *ptr, size_t size)
{
- void *newptr = NULL;
+ void *newptr = NULL;
- newptr = GF_MALLOC (size, gf_common_mt_memdup);
- if (!newptr)
- return NULL;
+ newptr = GF_MALLOC(size, gf_common_mt_memdup);
+ if (!newptr)
+ return NULL;
- memcpy (newptr, ptr, size);
- return newptr;
+ memcpy(newptr, ptr, size);
+ return newptr;
}
typedef enum {
- gf_timefmt_default = 0,
- gf_timefmt_FT = 0, /* YYYY-MM-DD hh:mm:ss */
- gf_timefmt_Ymd_T, /* YYYY/MM-DD-hh:mm:ss */
- gf_timefmt_bdT, /* MMM DD hh:mm:ss */
- gf_timefmt_F_HMS, /* YYYY-MM-DD hhmmss */
- gf_timefmt_dirent,
- gf_timefmt_s,
- gf_timefmt_last
+ gf_timefmt_default = 0,
+ gf_timefmt_FT = 0, /* YYYY-MM-DD hh:mm:ss */
+ gf_timefmt_Ymd_T, /* YYYY/MM-DD-hh:mm:ss */
+ gf_timefmt_bdT, /* MMM DD hh:mm:ss */
+ gf_timefmt_F_HMS, /* YYYY-MM-DD hhmmss */
+ gf_timefmt_dirent,
+ gf_timefmt_s,
+ gf_timefmt_last
} gf_timefmts;
static inline char *
-gf_time_fmt (char *dst, size_t sz_dst, time_t utime, unsigned int fmt)
+gf_time_fmt(char *dst, size_t sz_dst, time_t utime, unsigned int fmt)
{
- extern void _gf_timestuff (const char ***, const char ***);
- static gf_timefmts timefmt_last = (gf_timefmts) - 1;
- static const char **fmts;
- static const char **zeros;
- struct tm tm, *res;
- int localtime = 0;
-
- if (timefmt_last == ((gf_timefmts)-1)) {
- _gf_timestuff (&fmts, &zeros);
- timefmt_last = gf_timefmt_last;
- }
- if (timefmt_last <= fmt) {
- fmt = gf_timefmt_default;
- }
- localtime = gf_log_get_localtime ();
- res = localtime ? localtime_r (&utime, &tm) : gmtime_r (&utime, &tm);
- if (utime && (res != NULL)) {
- strftime (dst, sz_dst, fmts[fmt], &tm);
- } else {
- strncpy (dst, "N/A", sz_dst);
- }
- return dst;
+ extern void _gf_timestuff(const char ***, const char ***);
+ static gf_timefmts timefmt_last = (gf_timefmts)-1;
+ static const char **fmts;
+ static const char **zeros;
+ struct tm tm, *res;
+ int localtime = 0;
+
+ if (timefmt_last == ((gf_timefmts)-1)) {
+ _gf_timestuff(&fmts, &zeros);
+ timefmt_last = gf_timefmt_last;
+ }
+ if (timefmt_last <= fmt) {
+ fmt = gf_timefmt_default;
+ }
+ localtime = gf_log_get_localtime();
+ res = localtime ? localtime_r(&utime, &tm) : gmtime_r(&utime, &tm);
+ if (utime && (res != NULL)) {
+ strftime(dst, sz_dst, fmts[fmt], &tm);
+ } else {
+ strncpy(dst, "N/A", sz_dst);
+ }
+ return dst;
}
/* This function helps us use gfid (unique identity) to generate inode's unique
* number in glusterfs.
*/
ino_t
-gfid_to_ino (uuid_t gfid);
+gfid_to_ino(uuid_t gfid);
int
-mkdir_p (char *path, mode_t mode, gf_boolean_t allow_symlinks);
+mkdir_p(char *path, mode_t mode, gf_boolean_t allow_symlinks);
/*
* rounds up nr to power of two. If nr is already a power of two, just returns
* nr
*/
int
-gf_lstat_dir (const char *path, struct stat *stbuf_in);
+gf_lstat_dir(const char *path, struct stat *stbuf_in);
-int32_t gf_roundup_power_of_two (int32_t nr);
+int32_t
+gf_roundup_power_of_two(int32_t nr);
/*
* rounds up nr to next power of two. If nr is already a power of two, next
* power of two is returned.
*/
-int32_t gf_roundup_next_power_of_two (int32_t nr);
-
-char *gf_trim (char *string);
-int gf_volume_name_validate (const char *volume_name);
-
-int gf_string2long (const char *str, long *n);
-int gf_string2ulong (const char *str, unsigned long *n);
-int gf_string2int (const char *str, int *n);
-int gf_string2uint (const char *str, unsigned int *n);
-int gf_string2double (const char *str, double *n);
-int gf_string2longlong (const char *str, long long *n);
-int gf_string2ulonglong (const char *str, unsigned long long *n);
-
-int gf_string2int8 (const char *str, int8_t *n);
-int gf_string2int16 (const char *str, int16_t *n);
-int gf_string2int32 (const char *str, int32_t *n);
-int gf_string2int64 (const char *str, int64_t *n);
-int gf_string2uint8 (const char *str, uint8_t *n);
-int gf_string2uint16 (const char *str, uint16_t *n);
-int gf_string2uint32 (const char *str, uint32_t *n);
-int gf_string2uint64 (const char *str, uint64_t *n);
-
-int gf_strstr (const char *str, const char *delim, const char *match);
-
-int gf_string2ulong_base10 (const char *str, unsigned long *n);
-int gf_string2uint_base10 (const char *str, unsigned int *n);
-int gf_string2uint8_base10 (const char *str, uint8_t *n);
-int gf_string2uint16_base10 (const char *str, uint16_t *n);
-int gf_string2uint32_base10 (const char *str, uint32_t *n);
-int gf_string2uint64_base10 (const char *str, uint64_t *n);
-int gf_string2bytesize (const char *str, uint64_t *n);
-int gf_string2bytesize_size (const char *str, size_t *n);
-int gf_string2bytesize_uint64 (const char *str, uint64_t *n);
-int gf_string2bytesize_int64 (const char *str, int64_t *n);
-int gf_string2percent_or_bytesize (const char *str, double *n,
- gf_boolean_t *is_percent);
-
-int gf_string2boolean (const char *str, gf_boolean_t *b);
-int gf_string2percent (const char *str, double *n);
-int gf_string2time (const char *str, uint32_t *n);
-
-int gf_lockfd (int fd);
-int gf_unlockfd (int fd);
-
-int get_checksum_for_file (int fd, uint32_t *checksum);
-int log_base2 (unsigned long x);
-
-int get_checksum_for_path (char *path, uint32_t *checksum);
-int get_file_mtime (const char *path, time_t *stamp);
-char *gf_resolve_path_parent (const char *path);
-
-char *strtail (char *str, const char *pattern);
-void skipwhite (char **s);
-char *nwstrtail (char *str, char *pattern);
+int32_t
+gf_roundup_next_power_of_two(int32_t nr);
+
+char *
+gf_trim(char *string);
+int
+gf_volume_name_validate(const char *volume_name);
+
+int
+gf_string2long(const char *str, long *n);
+int
+gf_string2ulong(const char *str, unsigned long *n);
+int
+gf_string2int(const char *str, int *n);
+int
+gf_string2uint(const char *str, unsigned int *n);
+int
+gf_string2double(const char *str, double *n);
+int
+gf_string2longlong(const char *str, long long *n);
+int
+gf_string2ulonglong(const char *str, unsigned long long *n);
+
+int
+gf_string2int8(const char *str, int8_t *n);
+int
+gf_string2int16(const char *str, int16_t *n);
+int
+gf_string2int32(const char *str, int32_t *n);
+int
+gf_string2int64(const char *str, int64_t *n);
+int
+gf_string2uint8(const char *str, uint8_t *n);
+int
+gf_string2uint16(const char *str, uint16_t *n);
+int
+gf_string2uint32(const char *str, uint32_t *n);
+int
+gf_string2uint64(const char *str, uint64_t *n);
+
+int
+gf_strstr(const char *str, const char *delim, const char *match);
+
+int
+gf_string2ulong_base10(const char *str, unsigned long *n);
+int
+gf_string2uint_base10(const char *str, unsigned int *n);
+int
+gf_string2uint8_base10(const char *str, uint8_t *n);
+int
+gf_string2uint16_base10(const char *str, uint16_t *n);
+int
+gf_string2uint32_base10(const char *str, uint32_t *n);
+int
+gf_string2uint64_base10(const char *str, uint64_t *n);
+int
+gf_string2bytesize(const char *str, uint64_t *n);
+int
+gf_string2bytesize_size(const char *str, size_t *n);
+int
+gf_string2bytesize_uint64(const char *str, uint64_t *n);
+int
+gf_string2bytesize_int64(const char *str, int64_t *n);
+int
+gf_string2percent_or_bytesize(const char *str, double *n,
+ gf_boolean_t *is_percent);
+
+int
+gf_string2boolean(const char *str, gf_boolean_t *b);
+int
+gf_string2percent(const char *str, double *n);
+int
+gf_string2time(const char *str, uint32_t *n);
+
+int
+gf_lockfd(int fd);
+int
+gf_unlockfd(int fd);
+
+int
+get_checksum_for_file(int fd, uint32_t *checksum);
+int
+log_base2(unsigned long x);
+
+int
+get_checksum_for_path(char *path, uint32_t *checksum);
+int
+get_file_mtime(const char *path, time_t *stamp);
+char *
+gf_resolve_path_parent(const char *path);
+
+char *
+strtail(char *str, const char *pattern);
+void
+skipwhite(char **s);
+char *
+nwstrtail(char *str, char *pattern);
/* returns a new string with nth word of given string. n>=1 */
typedef struct token_iter {
- char *end;
- char sep;
+ char *end;
+ char sep;
} token_iter_t;
-char *token_iter_init (char *str, char sep, token_iter_t *tit);
-gf_boolean_t next_token (char **tokenp, token_iter_t *tit);
-void drop_token (char *token, token_iter_t *tit);
-
-gf_boolean_t mask_match (const uint32_t a, const uint32_t b, const uint32_t m);
-gf_boolean_t gf_is_ip_in_net (const char *network, const char *ip_str);
-char valid_host_name (char *address, int length);
-char valid_ipv4_address (char *address, int length, gf_boolean_t wildcard_acc);
-char valid_ipv6_address (char *address, int length, gf_boolean_t wildcard_acc);
-char valid_internet_address (char *address, gf_boolean_t wildcard_acc);
-gf_boolean_t valid_mount_auth_address (char *address);
-gf_boolean_t valid_ipv4_subnetwork (const char *address);
-gf_boolean_t gf_sock_union_equal_addr (union gf_sock_union *a,
- union gf_sock_union *b);
-char *gf_rev_dns_lookup (const char *ip);
-
-char *uuid_utoa (uuid_t uuid);
-char *uuid_utoa_r (uuid_t uuid, char *dst);
-char *lkowner_utoa (gf_lkowner_t *lkowner);
-char *lkowner_utoa_r (gf_lkowner_t *lkowner, char *dst, int len);
-char *leaseid_utoa (const char *lease_id);
-gf_boolean_t is_valid_lease_id (const char *lease_id);
-char *gf_leaseid_get (void);
-char *gf_existing_leaseid (void);
-
-void gf_array_insertionsort (void *a, int l, int r, size_t elem_size,
- gf_cmp cmp);
-int gf_is_str_int (const char *value);
-
-char *gf_uint64_2human_readable (uint64_t);
-int get_vol_type (int type, int dist_count, int brick_count);
-int validate_brick_name (char *brick);
-char *get_host_name (char *word, char **host);
-char *get_path_name (char *word, char **path);
-void gf_path_strip_trailing_slashes (char *path);
-uint64_t get_mem_size (void);
-int gf_strip_whitespace (char *str, int len);
-int gf_canonicalize_path (char *path);
-char *generate_glusterfs_ctx_id (void);
-char *gf_get_reserved_ports(void);
-int gf_process_reserved_ports (unsigned char *ports, uint32_t ceiling);
+char *
+token_iter_init(char *str, char sep, token_iter_t *tit);
+gf_boolean_t
+next_token(char **tokenp, token_iter_t *tit);
+void
+drop_token(char *token, token_iter_t *tit);
+
+gf_boolean_t
+mask_match(const uint32_t a, const uint32_t b, const uint32_t m);
+gf_boolean_t
+gf_is_ip_in_net(const char *network, const char *ip_str);
+char
+valid_host_name(char *address, int length);
+char
+valid_ipv4_address(char *address, int length, gf_boolean_t wildcard_acc);
+char
+valid_ipv6_address(char *address, int length, gf_boolean_t wildcard_acc);
+char
+valid_internet_address(char *address, gf_boolean_t wildcard_acc);
+gf_boolean_t
+valid_mount_auth_address(char *address);
+gf_boolean_t
+valid_ipv4_subnetwork(const char *address);
+gf_boolean_t
+gf_sock_union_equal_addr(union gf_sock_union *a, union gf_sock_union *b);
+char *
+gf_rev_dns_lookup(const char *ip);
+
+char *
+uuid_utoa(uuid_t uuid);
+char *
+uuid_utoa_r(uuid_t uuid, char *dst);
+char *
+lkowner_utoa(gf_lkowner_t *lkowner);
+char *
+lkowner_utoa_r(gf_lkowner_t *lkowner, char *dst, int len);
+char *
+leaseid_utoa(const char *lease_id);
gf_boolean_t
-gf_ports_reserved (char *blocked_port, unsigned char *ports, uint32_t ceiling);
-int gf_get_hostname_from_ip (char *client_ip, char **hostname);
-gf_boolean_t gf_is_local_addr (char *hostname);
-gf_boolean_t gf_is_same_address (char *host1, char *host2);
-void gf_xxh64_wrapper(const unsigned char *data, size_t const len,
- unsigned long long const seed, char *xxh64);
-int gf_gfid_generate_from_xxh64 (uuid_t gfid, char *key);
-
-int gf_set_timestamp (const char *src, const char* dest);
-
-int gf_thread_create (pthread_t *thread, const pthread_attr_t *attr,
- void *(*start_routine)(void *), void *arg,
- const char *name);
-int gf_thread_create_detached (pthread_t *thread,
- void *(*start_routine)(void *), void *arg,
- const char *name);
+is_valid_lease_id(const char *lease_id);
+char *
+gf_leaseid_get(void);
+char *
+gf_existing_leaseid(void);
+
+void
+gf_array_insertionsort(void *a, int l, int r, size_t elem_size, gf_cmp cmp);
+int
+gf_is_str_int(const char *value);
+
+char *gf_uint64_2human_readable(uint64_t);
+int
+get_vol_type(int type, int dist_count, int brick_count);
+int
+validate_brick_name(char *brick);
+char *
+get_host_name(char *word, char **host);
+char *
+get_path_name(char *word, char **path);
+void
+gf_path_strip_trailing_slashes(char *path);
+uint64_t
+get_mem_size(void);
+int
+gf_strip_whitespace(char *str, int len);
+int
+gf_canonicalize_path(char *path);
+char *
+generate_glusterfs_ctx_id(void);
+char *
+gf_get_reserved_ports(void);
+int
+gf_process_reserved_ports(unsigned char *ports, uint32_t ceiling);
gf_boolean_t
-gf_is_pid_running (int pid);
+gf_ports_reserved(char *blocked_port, unsigned char *ports, uint32_t ceiling);
+int
+gf_get_hostname_from_ip(char *client_ip, char **hostname);
gf_boolean_t
-gf_is_service_running (char *pidfile, int *pid);
+gf_is_local_addr(char *hostname);
gf_boolean_t
-gf_valid_pid (const char *pid, int length);
+gf_is_same_address(char *host1, char *host2);
+void
+gf_xxh64_wrapper(const unsigned char *data, size_t const len,
+ unsigned long long const seed, char *xxh64);
int
-gf_skip_header_section (int fd, int header_len);
+gf_gfid_generate_from_xxh64(uuid_t gfid, char *key);
+
+int
+gf_set_timestamp(const char *src, const char *dest);
+
+int
+gf_thread_create(pthread_t *thread, const pthread_attr_t *attr,
+ void *(*start_routine)(void *), void *arg, const char *name);
+int
+gf_thread_create_detached(pthread_t *thread, void *(*start_routine)(void *),
+ void *arg, const char *name);
+gf_boolean_t
+gf_is_pid_running(int pid);
+gf_boolean_t
+gf_is_service_running(char *pidfile, int *pid);
+gf_boolean_t
+gf_valid_pid(const char *pid, int length);
+int
+gf_skip_header_section(int fd, int header_len);
struct iatt;
struct _dict;
gf_boolean_t
-dht_is_linkfile (struct iatt *buf, struct _dict *dict);
+dht_is_linkfile(struct iatt *buf, struct _dict *dict);
int
-gf_check_log_format (const char *value);
+gf_check_log_format(const char *value);
int
-gf_check_logger (const char *value);
+gf_check_logger(const char *value);
gf_boolean_t
-gf_compare_sockaddr (const struct sockaddr *addr1,
- const struct sockaddr *addr2);
+gf_compare_sockaddr(const struct sockaddr *addr1, const struct sockaddr *addr2);
char *
-gf_backtrace_save (char *buf);
+gf_backtrace_save(char *buf);
void
-gf_backtrace_done (char *buf);
+gf_backtrace_done(char *buf);
gf_loglevel_t
-fop_log_level (glusterfs_fop_t fop, int op_errno);
+fop_log_level(glusterfs_fop_t fop, int op_errno);
int32_t
-gf_build_absolute_path (char *current_path, char *relative_path, char **path);
+gf_build_absolute_path(char *current_path, char *relative_path, char **path);
int
-recursive_rmdir (const char *delete_path);
+recursive_rmdir(const char *delete_path);
int
-gf_get_index_by_elem (char **array, char *elem);
+gf_get_index_by_elem(char **array, char *elem);
int
-glusterfs_is_local_pathinfo (char *pathinfo, gf_boolean_t *local);
+glusterfs_is_local_pathinfo(char *pathinfo, gf_boolean_t *local);
int
-gf_thread_cleanup_xint (pthread_t thread);
+gf_thread_cleanup_xint(pthread_t thread);
ssize_t
-gf_nread (int fd, void *buf, size_t count);
+gf_nread(int fd, void *buf, size_t count);
ssize_t
-gf_nwrite (int fd, const void *buf, size_t count);
+gf_nwrite(int fd, const void *buf, size_t count);
-void _mask_cancellation (void);
-void _unmask_cancellation (void);
+void
+_mask_cancellation(void);
+void
+_unmask_cancellation(void);
gf_boolean_t
-gf_is_zero_filled_stat (struct iatt *buf);
+gf_is_zero_filled_stat(struct iatt *buf);
void
-gf_zero_fill_stat (struct iatt *buf);
+gf_zero_fill_stat(struct iatt *buf);
gf_boolean_t
-gf_is_valid_xattr_namespace (char *k);
+gf_is_valid_xattr_namespace(char *k);
const char *
-gf_inode_type_to_str (ia_type_t type);
+gf_inode_type_to_str(ia_type_t type);
int32_t
-gf_bits_count (uint64_t n);
+gf_bits_count(uint64_t n);
int32_t
-gf_bits_index (uint64_t n);
+gf_bits_index(uint64_t n);
-const char*
-gf_fop_string (glusterfs_fop_t fop);
+const char *
+gf_fop_string(glusterfs_fop_t fop);
int
-gf_fop_int (char *fop);
+gf_fop_int(char *fop);
char *
-get_ip_from_addrinfo (struct addrinfo *addr, char **ip);
+get_ip_from_addrinfo(struct addrinfo *addr, char **ip);
int
-close_fds_except (int *fdv, size_t count);
+close_fds_except(int *fdv, size_t count);
int
-gf_getgrouplist (const char *user, gid_t group, gid_t **groups);
+gf_getgrouplist(const char *user, gid_t group, gid_t **groups);
int
-glusterfs_compute_sha256 (const unsigned char *content, size_t size,
- char *sha256_hash);
-char*
-get_struct_variable (int mem_num, gf_gsync_status_t *sts_val);
+glusterfs_compute_sha256(const unsigned char *content, size_t size,
+ char *sha256_hash);
+char *
+get_struct_variable(int mem_num, gf_gsync_status_t *sts_val);
char *
-gf_strncpy (char *dest, const char *src, const size_t dest_size);
+gf_strncpy(char *dest, const char *src, const size_t dest_size);
void
-gf_strTrim (char **s);
+gf_strTrim(char **s);
int
-gf_replace_old_iatt_in_dict (struct _dict *);
+gf_replace_old_iatt_in_dict(struct _dict *);
int
-gf_replace_new_iatt_in_dict (struct _dict *);
+gf_replace_new_iatt_in_dict(struct _dict *);
#endif /* _COMMON_UTILS_H */
diff --git a/libglusterfs/src/compat-errno.h b/libglusterfs/src/compat-errno.h
index 5ee1d18f823..c4ab09ab0d5 100644
--- a/libglusterfs/src/compat-errno.h
+++ b/libglusterfs/src/compat-errno.h
@@ -13,196 +13,201 @@
#include <errno.h>
-#define GF_ERROR_CODE_SUCCESS 0
-#define GF_ERROR_CODE_UNKNOWN 1024
-#define GF_ERRNO_UNKNOWN 1024
-
-#define GF_ERROR_CODE_PERM 1 /* Operation not permitted */
-#define GF_ERROR_CODE_NOENT 2 /* No such file or directory */
-#define GF_ERROR_CODE_SRCH 3 /* No such process */
-#define GF_ERROR_CODE_INTR 4 /* Interrupted system call */
-#define GF_ERROR_CODE_IO 5 /* I/O error */
-#define GF_ERROR_CODE_NXIO 6 /* No such device or address */
-#define GF_ERROR_CODE_2BIG 7 /* Argument list too long */
-#define GF_ERROR_CODE_NOEXEC 8 /* Exec format error */
-#define GF_ERROR_CODE_BADF 9 /* Bad file number */
-#define GF_ERROR_CODE_CHILD 10 /* No child processes */
-#define GF_ERROR_CODE_AGAIN 11 /* Try again */
-#define GF_ERROR_CODE_NOMEM 12 /* Out of memory */
-#define GF_ERROR_CODE_ACCES 13 /* Permission denied */
-#define GF_ERROR_CODE_FAULT 14 /* Bad address */
-#define GF_ERROR_CODE_NOTBLK 15 /* Block device required */
-#define GF_ERROR_CODE_BUSY 16 /* Device or resource busy */
-#define GF_ERROR_CODE_EXIST 17 /* File exists */
-#define GF_ERROR_CODE_XDEV 18 /* Cross-device link */
-#define GF_ERROR_CODE_NODEV 19 /* No such device */
-#define GF_ERROR_CODE_NOTDIR 20 /* Not a directory */
-#define GF_ERROR_CODE_ISDIR 21 /* Is a directory */
-#define GF_ERROR_CODE_INVAL 22 /* Invalid argument */
-#define GF_ERROR_CODE_NFILE 23 /* File table overflow */
-#define GF_ERROR_CODE_MFILE 24 /* Too many open files */
-#define GF_ERROR_CODE_NOTTY 25 /* Not a typewriter */
-#define GF_ERROR_CODE_TXTBSY 26 /* Text file busy */
-#define GF_ERROR_CODE_FBIG 27 /* File too large */
-#define GF_ERROR_CODE_NOSPC 28 /* No space left on device */
-#define GF_ERROR_CODE_SPIPE 29 /* Illegal seek */
-#define GF_ERROR_CODE_ROFS 30 /* Read-only file system */
-#define GF_ERROR_CODE_MLINK 31 /* Too many links */
-#define GF_ERROR_CODE_PIPE 32 /* Broken pipe */
-#define GF_ERROR_CODE_DOM 33 /* Math argument out of domain of func */
-#define GF_ERROR_CODE_RANGE 34 /* Math result not representable */
-#define GF_ERROR_CODE_DEADLK 35 /* Resource deadlock would occur */
-#define GF_ERROR_CODE_NAMETOOLONG 36 /* File name too long */
-#define GF_ERROR_CODE_NOLCK 37 /* No record locks available */
-#define GF_ERROR_CODE_NOSYS 38 /* Function not implemented */
-#define GF_ERROR_CODE_NOTEMPTY 39 /* Directory not empty */
-#define GF_ERROR_CODE_LOOP 40 /* Too many symbolic links encountered */
-
-#define GF_ERROR_CODE_NOMSG 42 /* No message of desired type */
-#define GF_ERROR_CODE_IDRM 43 /* Identifier removed */
-#define GF_ERROR_CODE_CHRNG 44 /* Channel number out of range */
-#define GF_ERROR_CODE_L2NSYNC 45 /* Level 2 not synchronized */
-#define GF_ERROR_CODE_L3HLT 46 /* Level 3 halted */
-#define GF_ERROR_CODE_L3RST 47 /* Level 3 reset */
-#define GF_ERROR_CODE_LNRNG 48 /* Link number out of range */
-#define GF_ERROR_CODE_UNATCH 49 /* Protocol driver not attached */
-#define GF_ERROR_CODE_NOCSI 50 /* No CSI structure available */
-#define GF_ERROR_CODE_L2HLT 51 /* Level 2 halted */
-#define GF_ERROR_CODE_BADE 52 /* Invalid exchange */
-#define GF_ERROR_CODE_BADR 53 /* Invalid request descriptor */
-#define GF_ERROR_CODE_XFULL 54 /* Exchange full */
-#define GF_ERROR_CODE_NOANO 55 /* No anode */
-#define GF_ERROR_CODE_BADRQC 56 /* Invalid request code */
-#define GF_ERROR_CODE_BADSLT 57 /* Invalid slot */
-#define GF_ERROR_CODE_BFONT 59 /* Bad font file format */
-#define GF_ERROR_CODE_NOSTR 60 /* Device not a stream */
-#define GF_ERROR_CODE_NODATA 61 /* No data available */
-#define GF_ERROR_CODE_TIME 62 /* Timer expired */
-#define GF_ERROR_CODE_NOSR 63 /* Out of streams resources */
-#define GF_ERROR_CODE_NONET 64 /* Machine is not on the network */
-#define GF_ERROR_CODE_NOPKG 65 /* Package not installed */
-#define GF_ERROR_CODE_REMOTE 66 /* Object is remote */
-#define GF_ERROR_CODE_NOLINK 67 /* Link has been severed */
-#define GF_ERROR_CODE_ADV 68 /* Advertise error */
-#define GF_ERROR_CODE_SRMNT 69 /* Srmount error */
-#define GF_ERROR_CODE_COMM 70 /* Communication error on send */
-#define GF_ERROR_CODE_PROTO 71 /* Protocol error */
-#define GF_ERROR_CODE_MULTIHOP 72 /* Multihop attempted */
-#define GF_ERROR_CODE_DOTDOT 73 /* RFS specific error */
-#define GF_ERROR_CODE_BADMSG 74 /* Not a data message */
-#define GF_ERROR_CODE_OVERFLOW 75 /* Value too large for defined data type */
-#define GF_ERROR_CODE_NOTUNIQ 76 /* Name not unique on network */
-#define GF_ERROR_CODE_BADFD 77 /* File descriptor in bad state */
-#define GF_ERROR_CODE_REMCHG 78 /* Remote address changed */
-#define GF_ERROR_CODE_LIBACC 79 /* Can not access a needed shared library */
-#define GF_ERROR_CODE_LIBBAD 80 /* Accessing a corrupted shared library */
-#define GF_ERROR_CODE_LIBSCN 81 /* .lib section in a.out corrupted */
-#define GF_ERROR_CODE_LIBMAX 82 /* Attempting to link in too many shared libraries */
-#define GF_ERROR_CODE_LIBEXEC 83 /* Cannot exec a shared library directly */
-#define GF_ERROR_CODE_ILSEQ 84 /* Illegal byte sequence */
-#define GF_ERROR_CODE_RESTART 85 /* Interrupted system call should be restarted */
-#define GF_ERROR_CODE_STRPIPE 86 /* Streams pipe error */
-#define GF_ERROR_CODE_USERS 87 /* Too many users */
-#define GF_ERROR_CODE_NOTSOCK 88 /* Socket operation on non-socket */
-#define GF_ERROR_CODE_DESTADDRREQ 89 /* Destination address required */
-#define GF_ERROR_CODE_MSGSIZE 90 /* Message too long */
-#define GF_ERROR_CODE_PROTOTYPE 91 /* Protocol wrong type for socket */
-#define GF_ERROR_CODE_NOPROTOOPT 92 /* Protocol not available */
-#define GF_ERROR_CODE_PROTONOSUPPORT 93 /* Protocol not supported */
-#define GF_ERROR_CODE_SOCKTNOSUPPORT 94 /* Socket type not supported */
-#define GF_ERROR_CODE_OPNOTSUPP 95 /* Operation not supported on transport endpoint */
-#define GF_ERROR_CODE_PFNOSUPPORT 96 /* Protocol family not supported */
-#define GF_ERROR_CODE_AFNOSUPPORT 97 /* Address family not supported by protocol */
-#define GF_ERROR_CODE_ADDRINUSE 98 /* Address already in use */
-#define GF_ERROR_CODE_ADDRNOTAVAIL 99 /* Cannot assign requested address */
-#define GF_ERROR_CODE_NETDOWN 100 /* Network is down */
-#define GF_ERROR_CODE_NETUNREACH 101 /* Network is unreachable */
-#define GF_ERROR_CODE_NETRESET 102 /* Network dropped connection because of reset */
-#define GF_ERROR_CODE_CONNABORTED 103 /* Software caused connection abort */
-#define GF_ERROR_CODE_CONNRESET 104 /* Connection reset by peer */
-#define GF_ERROR_CODE_NOBUFS 105 /* No buffer space available */
-#define GF_ERROR_CODE_ISCONN 106 /* Transport endpoint is already connected */
-#define GF_ERROR_CODE_NOTCONN 107 /* Transport endpoint is not connected */
-#define GF_ERROR_CODE_SHUTDOWN 108 /* Cannot send after transport endpoint shutdown */
-#define GF_ERROR_CODE_TOOMANYREFS 109 /* Too many references: cannot splice */
-#define GF_ERROR_CODE_TIMEDOUT 110 /* Connection timed out */
-#define GF_ERROR_CODE_CONNREFUSED 111 /* Connection refused */
-#define GF_ERROR_CODE_HOSTDOWN 112 /* Host is down */
-#define GF_ERROR_CODE_HOSTUNREACH 113 /* No route to host */
-#define GF_ERROR_CODE_ALREADY 114 /* Operation already in progress */
-#define GF_ERROR_CODE_INPROGRESS 115 /* Operation now in progress */
-#define GF_ERROR_CODE_ALREADY 114 /* Operation already in progress */
-#define GF_ERROR_CODE_INPROGRESS 115 /* Operation now in progress */
-#define GF_ERROR_CODE_STALE 116 /* Stale NFS file handle */
-#define GF_ERROR_CODE_UCLEAN 117 /* Structure needs cleaning */
-#define GF_ERROR_CODE_NOTNAM 118 /* Not a XENIX named type file */
-#define GF_ERROR_CODE_NAVAIL 119 /* No XENIX semaphores available */
-#define GF_ERROR_CODE_ISNAM 120 /* Is a named type file */
-#define GF_ERROR_CODE_REMOTEIO 121 /* Remote I/O error */
-#define GF_ERROR_CODE_DQUOT 122 /* Quota exceeded */
-#define GF_ERROR_CODE_NOMEDIUM 123 /* No medium found */
-#define GF_ERROR_CODE_MEDIUMTYPE 124 /* Wrong medium type */
-#define GF_ERROR_CODE_CANCELED 125 /* Operation Canceled */
-#define GF_ERROR_CODE_NOKEY 126 /* Required key not available */
-#define GF_ERROR_CODE_KEYEXPIRED 127 /* Key has expired */
-#define GF_ERROR_CODE_KEYREVOKED 128 /* Key has been revoked */
-#define GF_ERROR_CODE_KEYREJECTED 129 /* Key was rejected by service */
+#define GF_ERROR_CODE_SUCCESS 0
+#define GF_ERROR_CODE_UNKNOWN 1024
+#define GF_ERRNO_UNKNOWN 1024
+
+#define GF_ERROR_CODE_PERM 1 /* Operation not permitted */
+#define GF_ERROR_CODE_NOENT 2 /* No such file or directory */
+#define GF_ERROR_CODE_SRCH 3 /* No such process */
+#define GF_ERROR_CODE_INTR 4 /* Interrupted system call */
+#define GF_ERROR_CODE_IO 5 /* I/O error */
+#define GF_ERROR_CODE_NXIO 6 /* No such device or address */
+#define GF_ERROR_CODE_2BIG 7 /* Argument list too long */
+#define GF_ERROR_CODE_NOEXEC 8 /* Exec format error */
+#define GF_ERROR_CODE_BADF 9 /* Bad file number */
+#define GF_ERROR_CODE_CHILD 10 /* No child processes */
+#define GF_ERROR_CODE_AGAIN 11 /* Try again */
+#define GF_ERROR_CODE_NOMEM 12 /* Out of memory */
+#define GF_ERROR_CODE_ACCES 13 /* Permission denied */
+#define GF_ERROR_CODE_FAULT 14 /* Bad address */
+#define GF_ERROR_CODE_NOTBLK 15 /* Block device required */
+#define GF_ERROR_CODE_BUSY 16 /* Device or resource busy */
+#define GF_ERROR_CODE_EXIST 17 /* File exists */
+#define GF_ERROR_CODE_XDEV 18 /* Cross-device link */
+#define GF_ERROR_CODE_NODEV 19 /* No such device */
+#define GF_ERROR_CODE_NOTDIR 20 /* Not a directory */
+#define GF_ERROR_CODE_ISDIR 21 /* Is a directory */
+#define GF_ERROR_CODE_INVAL 22 /* Invalid argument */
+#define GF_ERROR_CODE_NFILE 23 /* File table overflow */
+#define GF_ERROR_CODE_MFILE 24 /* Too many open files */
+#define GF_ERROR_CODE_NOTTY 25 /* Not a typewriter */
+#define GF_ERROR_CODE_TXTBSY 26 /* Text file busy */
+#define GF_ERROR_CODE_FBIG 27 /* File too large */
+#define GF_ERROR_CODE_NOSPC 28 /* No space left on device */
+#define GF_ERROR_CODE_SPIPE 29 /* Illegal seek */
+#define GF_ERROR_CODE_ROFS 30 /* Read-only file system */
+#define GF_ERROR_CODE_MLINK 31 /* Too many links */
+#define GF_ERROR_CODE_PIPE 32 /* Broken pipe */
+#define GF_ERROR_CODE_DOM 33 /* Math argument out of domain of func */
+#define GF_ERROR_CODE_RANGE 34 /* Math result not representable */
+#define GF_ERROR_CODE_DEADLK 35 /* Resource deadlock would occur */
+#define GF_ERROR_CODE_NAMETOOLONG 36 /* File name too long */
+#define GF_ERROR_CODE_NOLCK 37 /* No record locks available */
+#define GF_ERROR_CODE_NOSYS 38 /* Function not implemented */
+#define GF_ERROR_CODE_NOTEMPTY 39 /* Directory not empty */
+#define GF_ERROR_CODE_LOOP 40 /* Too many symbolic links encountered */
+
+#define GF_ERROR_CODE_NOMSG 42 /* No message of desired type */
+#define GF_ERROR_CODE_IDRM 43 /* Identifier removed */
+#define GF_ERROR_CODE_CHRNG 44 /* Channel number out of range */
+#define GF_ERROR_CODE_L2NSYNC 45 /* Level 2 not synchronized */
+#define GF_ERROR_CODE_L3HLT 46 /* Level 3 halted */
+#define GF_ERROR_CODE_L3RST 47 /* Level 3 reset */
+#define GF_ERROR_CODE_LNRNG 48 /* Link number out of range */
+#define GF_ERROR_CODE_UNATCH 49 /* Protocol driver not attached */
+#define GF_ERROR_CODE_NOCSI 50 /* No CSI structure available */
+#define GF_ERROR_CODE_L2HLT 51 /* Level 2 halted */
+#define GF_ERROR_CODE_BADE 52 /* Invalid exchange */
+#define GF_ERROR_CODE_BADR 53 /* Invalid request descriptor */
+#define GF_ERROR_CODE_XFULL 54 /* Exchange full */
+#define GF_ERROR_CODE_NOANO 55 /* No anode */
+#define GF_ERROR_CODE_BADRQC 56 /* Invalid request code */
+#define GF_ERROR_CODE_BADSLT 57 /* Invalid slot */
+#define GF_ERROR_CODE_BFONT 59 /* Bad font file format */
+#define GF_ERROR_CODE_NOSTR 60 /* Device not a stream */
+#define GF_ERROR_CODE_NODATA 61 /* No data available */
+#define GF_ERROR_CODE_TIME 62 /* Timer expired */
+#define GF_ERROR_CODE_NOSR 63 /* Out of streams resources */
+#define GF_ERROR_CODE_NONET 64 /* Machine is not on the network */
+#define GF_ERROR_CODE_NOPKG 65 /* Package not installed */
+#define GF_ERROR_CODE_REMOTE 66 /* Object is remote */
+#define GF_ERROR_CODE_NOLINK 67 /* Link has been severed */
+#define GF_ERROR_CODE_ADV 68 /* Advertise error */
+#define GF_ERROR_CODE_SRMNT 69 /* Srmount error */
+#define GF_ERROR_CODE_COMM 70 /* Communication error on send */
+#define GF_ERROR_CODE_PROTO 71 /* Protocol error */
+#define GF_ERROR_CODE_MULTIHOP 72 /* Multihop attempted */
+#define GF_ERROR_CODE_DOTDOT 73 /* RFS specific error */
+#define GF_ERROR_CODE_BADMSG 74 /* Not a data message */
+#define GF_ERROR_CODE_OVERFLOW 75 /* Value too large for defined data type */
+#define GF_ERROR_CODE_NOTUNIQ 76 /* Name not unique on network */
+#define GF_ERROR_CODE_BADFD 77 /* File descriptor in bad state */
+#define GF_ERROR_CODE_REMCHG 78 /* Remote address changed */
+#define GF_ERROR_CODE_LIBACC 79 /* Can not access a needed shared library */
+#define GF_ERROR_CODE_LIBBAD 80 /* Accessing a corrupted shared library */
+#define GF_ERROR_CODE_LIBSCN 81 /* .lib section in a.out corrupted */
+#define GF_ERROR_CODE_LIBMAX \
+ 82 /* Attempting to link in too many shared libraries */
+#define GF_ERROR_CODE_LIBEXEC 83 /* Cannot exec a shared library directly */
+#define GF_ERROR_CODE_ILSEQ 84 /* Illegal byte sequence */
+#define GF_ERROR_CODE_RESTART \
+ 85 /* Interrupted system call should be restarted */
+#define GF_ERROR_CODE_STRPIPE 86 /* Streams pipe error */
+#define GF_ERROR_CODE_USERS 87 /* Too many users */
+#define GF_ERROR_CODE_NOTSOCK 88 /* Socket operation on non-socket */
+#define GF_ERROR_CODE_DESTADDRREQ 89 /* Destination address required */
+#define GF_ERROR_CODE_MSGSIZE 90 /* Message too long */
+#define GF_ERROR_CODE_PROTOTYPE 91 /* Protocol wrong type for socket */
+#define GF_ERROR_CODE_NOPROTOOPT 92 /* Protocol not available */
+#define GF_ERROR_CODE_PROTONOSUPPORT 93 /* Protocol not supported */
+#define GF_ERROR_CODE_SOCKTNOSUPPORT 94 /* Socket type not supported */
+#define GF_ERROR_CODE_OPNOTSUPP \
+ 95 /* Operation not supported on transport endpoint */
+#define GF_ERROR_CODE_PFNOSUPPORT 96 /* Protocol family not supported */
+#define GF_ERROR_CODE_AFNOSUPPORT \
+ 97 /* Address family not supported by protocol */
+#define GF_ERROR_CODE_ADDRINUSE 98 /* Address already in use */
+#define GF_ERROR_CODE_ADDRNOTAVAIL 99 /* Cannot assign requested address */
+#define GF_ERROR_CODE_NETDOWN 100 /* Network is down */
+#define GF_ERROR_CODE_NETUNREACH 101 /* Network is unreachable */
+#define GF_ERROR_CODE_NETRESET \
+ 102 /* Network dropped connection because of reset */
+#define GF_ERROR_CODE_CONNABORTED 103 /* Software caused connection abort */
+#define GF_ERROR_CODE_CONNRESET 104 /* Connection reset by peer */
+#define GF_ERROR_CODE_NOBUFS 105 /* No buffer space available */
+#define GF_ERROR_CODE_ISCONN 106 /* Transport endpoint is already connected */
+#define GF_ERROR_CODE_NOTCONN 107 /* Transport endpoint is not connected */
+#define GF_ERROR_CODE_SHUTDOWN \
+ 108 /* Cannot send after transport endpoint shutdown */
+#define GF_ERROR_CODE_TOOMANYREFS 109 /* Too many references: cannot splice */
+#define GF_ERROR_CODE_TIMEDOUT 110 /* Connection timed out */
+#define GF_ERROR_CODE_CONNREFUSED 111 /* Connection refused */
+#define GF_ERROR_CODE_HOSTDOWN 112 /* Host is down */
+#define GF_ERROR_CODE_HOSTUNREACH 113 /* No route to host */
+#define GF_ERROR_CODE_ALREADY 114 /* Operation already in progress */
+#define GF_ERROR_CODE_INPROGRESS 115 /* Operation now in progress */
+#define GF_ERROR_CODE_ALREADY 114 /* Operation already in progress */
+#define GF_ERROR_CODE_INPROGRESS 115 /* Operation now in progress */
+#define GF_ERROR_CODE_STALE 116 /* Stale NFS file handle */
+#define GF_ERROR_CODE_UCLEAN 117 /* Structure needs cleaning */
+#define GF_ERROR_CODE_NOTNAM 118 /* Not a XENIX named type file */
+#define GF_ERROR_CODE_NAVAIL 119 /* No XENIX semaphores available */
+#define GF_ERROR_CODE_ISNAM 120 /* Is a named type file */
+#define GF_ERROR_CODE_REMOTEIO 121 /* Remote I/O error */
+#define GF_ERROR_CODE_DQUOT 122 /* Quota exceeded */
+#define GF_ERROR_CODE_NOMEDIUM 123 /* No medium found */
+#define GF_ERROR_CODE_MEDIUMTYPE 124 /* Wrong medium type */
+#define GF_ERROR_CODE_CANCELED 125 /* Operation Canceled */
+#define GF_ERROR_CODE_NOKEY 126 /* Required key not available */
+#define GF_ERROR_CODE_KEYEXPIRED 127 /* Key has expired */
+#define GF_ERROR_CODE_KEYREVOKED 128 /* Key has been revoked */
+#define GF_ERROR_CODE_KEYREJECTED 129 /* Key was rejected by service */
/* for robust mutexes */
-#define GF_ERROR_CODE_OWNERDEAD 130 /* Owner died */
-#define GF_ERROR_CODE_NOTRECOVERABLE 131 /* State not recoverable */
-
-
+#define GF_ERROR_CODE_OWNERDEAD 130 /* Owner died */
+#define GF_ERROR_CODE_NOTRECOVERABLE 131 /* State not recoverable */
/* Should never be seen by user programs */
-#define GF_ERROR_CODE_RESTARTSYS 512
-#define GF_ERROR_CODE_RESTARTNOINTR 513
-#define GF_ERROR_CODE_RESTARTNOHAND 514 /* restart if no handler.. */
-#define GF_ERROR_CODE_NOIOCTLCMD 515 /* No ioctl command */
-#define GF_ERROR_CODE_RESTART_RESTARTBLOCK 516 /* restart by calling sys_restart_syscall */
+#define GF_ERROR_CODE_RESTARTSYS 512
+#define GF_ERROR_CODE_RESTARTNOINTR 513
+#define GF_ERROR_CODE_RESTARTNOHAND 514 /* restart if no handler.. */
+#define GF_ERROR_CODE_NOIOCTLCMD 515 /* No ioctl command */
+#define GF_ERROR_CODE_RESTART_RESTARTBLOCK \
+ 516 /* restart by calling sys_restart_syscall */
/* Defined for the NFSv3 protocol */
-#define GF_ERROR_CODE_BADHANDLE 521 /* Illegal NFS file handle */
-#define GF_ERROR_CODE_NOTSYNC 522 /* Update synchronization mismatch */
-#define GF_ERROR_CODE_BADCOOKIE 523 /* Cookie is stale */
-#define GF_ERROR_CODE_NOTSUPP 524 /* Operation is not supported */
-#define GF_ERROR_CODE_TOOSMALL 525 /* Buffer or request is too small */
-#define GF_ERROR_CODE_SERVERFAULT 526 /* An untranslatable error occurred */
-#define GF_ERROR_CODE_BADTYPE 527 /* Type not supported by server */
-#define GF_ERROR_CODE_JUKEBOX 528 /* Request initiated, but will not complete before timeout */
-#define GF_ERROR_CODE_IOCBQUEUED 529 /* iocb queued, will get completion event */
-#define GF_ERROR_CODE_IOCBRETRY 530 /* iocb queued, will trigger a retry */
+#define GF_ERROR_CODE_BADHANDLE 521 /* Illegal NFS file handle */
+#define GF_ERROR_CODE_NOTSYNC 522 /* Update synchronization mismatch */
+#define GF_ERROR_CODE_BADCOOKIE 523 /* Cookie is stale */
+#define GF_ERROR_CODE_NOTSUPP 524 /* Operation is not supported */
+#define GF_ERROR_CODE_TOOSMALL 525 /* Buffer or request is too small */
+#define GF_ERROR_CODE_SERVERFAULT 526 /* An untranslatable error occurred */
+#define GF_ERROR_CODE_BADTYPE 527 /* Type not supported by server */
+#define GF_ERROR_CODE_JUKEBOX \
+ 528 /* Request initiated, but will not complete before timeout */
+#define GF_ERROR_CODE_IOCBQUEUED \
+ 529 /* iocb queued, will get completion event */
+#define GF_ERROR_CODE_IOCBRETRY 530 /* iocb queued, will trigger a retry */
/* Darwin OS X */
-#define GF_ERROR_CODE_NOPOLICY 701
-#define GF_ERROR_CODE_BADMACHO 702
-#define GF_ERROR_CODE_PWROFF 703
-#define GF_ERROR_CODE_DEVERR 704
-#define GF_ERROR_CODE_BADARCH 705
-#define GF_ERROR_CODE_BADEXEC 706
-#define GF_ERROR_CODE_SHLIBVERS 707
-
-
+#define GF_ERROR_CODE_NOPOLICY 701
+#define GF_ERROR_CODE_BADMACHO 702
+#define GF_ERROR_CODE_PWROFF 703
+#define GF_ERROR_CODE_DEVERR 704
+#define GF_ERROR_CODE_BADARCH 705
+#define GF_ERROR_CODE_BADEXEC 706
+#define GF_ERROR_CODE_SHLIBVERS 707
/* Solaris */
/* ENOTACTIVE 73 / * Facility is not active */
-#define GF_ERROR_CODE_NOTACTIVE 801
+#define GF_ERROR_CODE_NOTACTIVE 801
/* ELOCKUNMAPPED 72 / * locked lock was unmapped */
#define GF_ERROR_CODE_LOCKUNMAPPED 802
/* BSD system */
-#define GF_ERROR_CODE_PROCLIM 901 /* Too many processes */
-#define GF_ERROR_CODE_BADRPC 902 /* RPC struct is bad */
-#define GF_ERROR_CODE_RPCMISMATCH 903 /* RPC version wrong */
-#define GF_ERROR_CODE_PROGUNAVAIL 904 /* RPC prog. not avail */
-#define GF_ERROR_CODE_PROGMISMATCH 905 /* Program version wrong */
-#define GF_ERROR_CODE_PROCUNAVAIL 905 /* Bad procedure for program */
-#define GF_ERROR_CODE_FTYPE 906 /* Inappropriate file type or format */
-#define GF_ERROR_CODE_AUTH 907 /* Authentication error */
-#define GF_ERROR_CODE_NEEDAUTH 908 /* Need authenticator */
-#define GF_ERROR_CODE_DOOFUS 909 /* Programming error */
-
-#define GF_ERROR_CODE_NOATTR GF_ERROR_CODE_NODATA /* Attribute not found */
+#define GF_ERROR_CODE_PROCLIM 901 /* Too many processes */
+#define GF_ERROR_CODE_BADRPC 902 /* RPC struct is bad */
+#define GF_ERROR_CODE_RPCMISMATCH 903 /* RPC version wrong */
+#define GF_ERROR_CODE_PROGUNAVAIL 904 /* RPC prog. not avail */
+#define GF_ERROR_CODE_PROGMISMATCH 905 /* Program version wrong */
+#define GF_ERROR_CODE_PROCUNAVAIL 905 /* Bad procedure for program */
+#define GF_ERROR_CODE_FTYPE 906 /* Inappropriate file type or format */
+#define GF_ERROR_CODE_AUTH 907 /* Authentication error */
+#define GF_ERROR_CODE_NEEDAUTH 908 /* Need authenticator */
+#define GF_ERROR_CODE_DOOFUS 909 /* Programming error */
+
+#define GF_ERROR_CODE_NOATTR GF_ERROR_CODE_NODATA /* Attribute not found */
/* Either one of enodata or enoattr will be there in system */
#ifndef ENOATTR
@@ -225,7 +230,9 @@
/* These functions are defined for all the OS flags, but content will
* be different for each OS flag.
*/
-int32_t gf_errno_to_error (int32_t op_errno);
-int32_t gf_error_to_errno (int32_t error);
+int32_t
+gf_errno_to_error(int32_t op_errno);
+int32_t
+gf_error_to_errno(int32_t error);
#endif /* __COMPAT_ERRNO_H__ */
diff --git a/libglusterfs/src/compat-uuid.h b/libglusterfs/src/compat-uuid.h
index 2e66117ce1f..6bce6d033d0 100644
--- a/libglusterfs/src/compat-uuid.h
+++ b/libglusterfs/src/compat-uuid.h
@@ -16,45 +16,45 @@
#include <uuid.h>
static inline void
-gf_uuid_clear (uuid_t uuid)
+gf_uuid_clear(uuid_t uuid)
{
- uuid_clear (uuid);
+ uuid_clear(uuid);
}
static inline int
-gf_uuid_compare (uuid_t u1, uuid_t u2)
+gf_uuid_compare(uuid_t u1, uuid_t u2)
{
- return uuid_compare (u1, u2);
+ return uuid_compare(u1, u2);
}
static inline void
-gf_uuid_copy (uuid_t dst, const uuid_t src)
+gf_uuid_copy(uuid_t dst, const uuid_t src)
{
- uuid_copy (dst, src);
+ uuid_copy(dst, src);
}
static inline void
-gf_uuid_generate (uuid_t uuid)
+gf_uuid_generate(uuid_t uuid)
{
- uuid_generate (uuid);
+ uuid_generate(uuid);
}
static inline int
-gf_uuid_is_null (uuid_t uuid)
+gf_uuid_is_null(uuid_t uuid)
{
- return uuid_is_null (uuid);
+ return uuid_is_null(uuid);
}
static inline int
-gf_uuid_parse (const char *in, uuid_t uuid)
+gf_uuid_parse(const char *in, uuid_t uuid)
{
- return uuid_parse (in, uuid);
+ return uuid_parse(in, uuid);
}
static inline void
-gf_uuid_unparse (const uuid_t uuid, char *out)
+gf_uuid_unparse(const uuid_t uuid, char *out)
{
- uuid_unparse (uuid, out);
+ uuid_unparse(uuid, out);
}
#elif defined(__FreeBSD__)
diff --git a/libglusterfs/src/compat.h b/libglusterfs/src/compat.h
index e0ffe73926a..38c07b5ae7c 100644
--- a/libglusterfs/src/compat.h
+++ b/libglusterfs/src/compat.h
@@ -15,8 +15,7 @@
#ifndef LLONG_MAX
#define LLONG_MAX __LONG_LONG_MAX__ /* compat with old gcc */
-#endif /* LLONG_MAX */
-
+#endif /* LLONG_MAX */
#ifdef GF_LINUX_HOST_OS
@@ -38,7 +37,7 @@
#ifndef _PATH_UMOUNT
#define _PATH_UMOUNT "/bin/umount"
#endif
-#define GF_XATTR_NAME_MAX XATTR_NAME_MAX
+#define GF_XATTR_NAME_MAX XATTR_NAME_MAX
#endif /* GF_LINUX_HOST_OS */
#ifdef HAVE_XATTR_H
@@ -51,19 +50,19 @@
*/
#ifndef FALLOC_FL_KEEP_SIZE
-#define FALLOC_FL_KEEP_SIZE 0x01 /* default is extend size */
+#define FALLOC_FL_KEEP_SIZE 0x01 /* default is extend size */
#endif
#ifndef FALLOC_FL_PUNCH_HOLE
-#define FALLOC_FL_PUNCH_HOLE 0x02 /* de-allocates range */
+#define FALLOC_FL_PUNCH_HOLE 0x02 /* de-allocates range */
#endif
#ifndef FALLOC_FL_ZERO_RANGE
-#define FALLOC_FL_ZERO_RANGE 0x10 /* zeroes out range */
+#define FALLOC_FL_ZERO_RANGE 0x10 /* zeroes out range */
#endif
#ifndef FALLOC_FL_COLLAPSE_RANGE
-#define FALLOC_FL_COLLAPSE_RANGE 0x08 /* reduces the size */
+#define FALLOC_FL_COLLAPSE_RANGE 0x08 /* reduces the size */
#endif
#ifndef FALLOC_FL_INSERT_RANGE
-#define FALLOC_FL_INSERT_RANGE 0x20 /* expands the size */
+#define FALLOC_FL_INSERT_RANGE 0x20 /* expands the size */
#endif
#ifndef HAVE_LLISTXATTR
@@ -72,14 +71,14 @@
* 'llistxattr()' system calls.
*/
-#define lremovexattr(path,key) removexattr(path,key)
-#define llistxattr(path,key,size) listxattr(path,key,size)
-#define lgetxattr(path, key, value, size) getxattr(path,key,value,size)
-#define lsetxattr(path,key,value,size,flags) setxattr(path,key,value,size,flags)
+#define lremovexattr(path, key) removexattr(path, key)
+#define llistxattr(path, key, size) listxattr(path, key, size)
+#define lgetxattr(path, key, value, size) getxattr(path, key, value, size)
+#define lsetxattr(path, key, value, size, flags) \
+ setxattr(path, key, value, size, flags)
#endif /* HAVE_LLISTXATTR */
-
#ifdef GF_DARWIN_HOST_OS
#include <machine/endian.h>
#include <libkern/OSByteOrder.h>
@@ -102,7 +101,6 @@
#endif
-
#ifdef GF_BSD_HOST_OS
/* In case of FreeBSD and NetBSD */
@@ -121,14 +119,13 @@
#ifndef XATTR_CREATE
enum {
- ATTR_CREATE = 1,
+ ATTR_CREATE = 1,
#define XATTR_CREATE ATTR_CREATE
- ATTR_REPLACE = 2
+ ATTR_REPLACE = 2
#define XATTR_REPLACE ATTR_REPLACE
};
#endif /* XATTR_CREATE */
-
#ifndef sighandler_t
#define sighandler_t sig_t
#endif
@@ -141,11 +138,11 @@ enum {
/* Using NAME_MAX since EXTATTR_MAXNAMELEN is inside a preprocessor conditional
* for the kernel
*/
-#define GF_XATTR_NAME_MAX NAME_MAX
+#define GF_XATTR_NAME_MAX NAME_MAX
#endif /* __FreeBSD__ */
#ifdef __NetBSD__
-#define GF_XATTR_NAME_MAX XATTR_NAME_MAX
+#define GF_XATTR_NAME_MAX XATTR_NAME_MAX
#endif
#ifndef ino64_t
@@ -169,28 +166,29 @@ enum {
#endif
/* Posix dictates NAME_MAX to be used */
-# ifndef NAME_MAX
-# ifdef MAXNAMLEN
-# define NAME_MAX MAXNAMLEN
-# else
-# define NAME_MAX 255
-# endif
-# endif
-
-#define F_GETLK64 F_GETLK
-#define F_SETLK64 F_SETLK
-#define F_SETLKW64 F_SETLKW
-#define FALLOC_FL_KEEP_SIZE 0x01 /* default is extend size */
-#define FALLOC_FL_PUNCH_HOLE 0x02 /* de-allocates range */
-#define FALLOC_FL_ZERO_RANGE 0x10 /* zeroes out range */
-#define FALLOC_FL_INSERT_RANGE 0x20 /* Expands the size */
+#ifndef NAME_MAX
+#ifdef MAXNAMLEN
+#define NAME_MAX MAXNAMLEN
+#else
+#define NAME_MAX 255
+#endif
+#endif
+
+#define F_GETLK64 F_GETLK
+#define F_SETLK64 F_SETLK
+#define F_SETLKW64 F_SETLKW
+#define FALLOC_FL_KEEP_SIZE 0x01 /* default is extend size */
+#define FALLOC_FL_PUNCH_HOLE 0x02 /* de-allocates range */
+#define FALLOC_FL_ZERO_RANGE 0x10 /* zeroes out range */
+#define FALLOC_FL_INSERT_RANGE 0x20 /* Expands the size */
#define FALLOC_FL_COLLAPSE_RANGE 0x08 /* Reduces the size */
#ifndef _PATH_UMOUNT
- #define _PATH_UMOUNT "/sbin/umount"
+#define _PATH_UMOUNT "/sbin/umount"
#endif
-void gf_extattr_list_reshape(char *list, ssize_t size);
+void
+gf_extattr_list_reshape(char *list, ssize_t size);
#endif /* GF_BSD_HOST_OS */
@@ -226,14 +224,12 @@ void gf_extattr_list_reshape(char *list, ssize_t size);
#include <libgen.h>
-
#if __DARWIN_64_BIT_INO_T == 0
-# error '64 bit ino_t is must for GlusterFS to work, Compile with "CFLAGS=-D__DARWIN_64_BIT_INO_T"'
+#error '64 bit ino_t is must for GlusterFS to work, Compile with "CFLAGS=-D__DARWIN_64_BIT_INO_T"'
#endif /* __DARWIN_64_BIT_INO_T */
-
#if __DARWIN_64_BIT_INO_T == 0
-# error '64 bit ino_t is must for GlusterFS to work, Compile with "CFLAGS=-D__DARWIN_64_BIT_INO_T"'
+#error '64 bit ino_t is must for GlusterFS to work, Compile with "CFLAGS=-D__DARWIN_64_BIT_INO_T"'
#endif /* __DARWIN_64_BIT_INO_T */
#ifndef sighandler_t
@@ -253,24 +249,24 @@ void gf_extattr_list_reshape(char *list, ssize_t size);
#endif
/* Posix dictates NAME_MAX to be used */
-# ifndef NAME_MAX
-# ifdef MAXNAMLEN
-# define NAME_MAX MAXNAMLEN
-# else
-# define NAME_MAX 255
-# endif
-# endif
-
-#define F_GETLK64 F_GETLK
-#define F_SETLK64 F_SETLK
-#define F_SETLKW64 F_SETLKW
+#ifndef NAME_MAX
+#ifdef MAXNAMLEN
+#define NAME_MAX MAXNAMLEN
+#else
+#define NAME_MAX 255
+#endif
+#endif
+
+#define F_GETLK64 F_GETLK
+#define F_SETLK64 F_SETLK
+#define F_SETLKW64 F_SETLKW
#ifndef FTW_CONTINUE
- #define FTW_CONTINUE 0
+#define FTW_CONTINUE 0
#endif
#ifndef _PATH_UMOUNT
- #define _PATH_UMOUNT "/sbin/umount"
+#define _PATH_UMOUNT "/sbin/umount"
#endif
#endif /* GF_DARWIN_HOST_OS */
@@ -291,107 +287,120 @@ void gf_extattr_list_reshape(char *list, ssize_t size);
#define lchmod chmod
#endif
-#define lgetxattr(path, key, value, size) solaris_getxattr(path,key,value,size)
+#define lgetxattr(path, key, value, size) \
+ solaris_getxattr(path, key, value, size)
enum {
- ATTR_CREATE = 1,
+ ATTR_CREATE = 1,
#define XATTR_CREATE ATTR_CREATE
- ATTR_REPLACE = 2
+ ATTR_REPLACE = 2
#define XATTR_REPLACE ATTR_REPLACE
};
/* This patch is not present in Solaris 10 and before */
#ifndef dirfd
-#define dirfd(dirp) ((dirp)->dd_fd)
+#define dirfd(dirp) ((dirp)->dd_fd)
#endif
/* Posix dictates NAME_MAX to be used */
-# ifndef NAME_MAX
-# ifdef MAXNAMLEN
-# define NAME_MAX MAXNAMLEN
-# else
-# define NAME_MAX 255
-# endif
-# endif
+#ifndef NAME_MAX
+#ifdef MAXNAMLEN
+#define NAME_MAX MAXNAMLEN
+#else
+#define NAME_MAX 255
+#endif
+#endif
#include <netinet/in.h>
#ifndef s6_addr16
-#define S6_ADDR16(x) ((uint16_t*) ((char*)&(x).s6_addr))
+#define S6_ADDR16(x) ((uint16_t *)((char *)&(x).s6_addr))
#endif
#ifndef s6_addr32
-#define s6_addr32 _S6_un._S6_u32
+#define s6_addr32 _S6_un._S6_u32
#endif
-#define lutimes(filename,times) utimes(filename,times)
+#define lutimes(filename, times) utimes(filename, times)
#ifndef SEEK_SET
#define SEEK_SET 0
#endif
enum {
- DT_UNKNOWN = 0,
-# define DT_UNKNOWN DT_UNKNOWN
- DT_FIFO = 1,
-# define DT_FIFO DT_FIFO
- DT_CHR = 2,
-# define DT_CHR DT_CHR
- DT_DIR = 4,
-# define DT_DIR DT_DIR
- DT_BLK = 6,
-# define DT_BLK DT_BLK
- DT_REG = 8,
-# define DT_REG DT_REG
- DT_LNK = 10,
-# define DT_LNK DT_LNK
- DT_SOCK = 12,
-# define DT_SOCK DT_SOCK
- DT_WHT = 14
-# define DT_WHT DT_WHT
+ DT_UNKNOWN = 0,
+#define DT_UNKNOWN DT_UNKNOWN
+ DT_FIFO = 1,
+#define DT_FIFO DT_FIFO
+ DT_CHR = 2,
+#define DT_CHR DT_CHR
+ DT_DIR = 4,
+#define DT_DIR DT_DIR
+ DT_BLK = 6,
+#define DT_BLK DT_BLK
+ DT_REG = 8,
+#define DT_REG DT_REG
+ DT_LNK = 10,
+#define DT_LNK DT_LNK
+ DT_SOCK = 12,
+#define DT_SOCK DT_SOCK
+ DT_WHT = 14
+#define DT_WHT DT_WHT
};
#ifndef _PATH_MOUNTED
- #define _PATH_MOUNTED "/etc/mtab"
+#define _PATH_MOUNTED "/etc/mtab"
#endif
#ifndef _PATH_UMOUNT
- #define _PATH_UMOUNT "/sbin/umount"
+#define _PATH_UMOUNT "/sbin/umount"
#endif
#ifndef O_ASYNC
- #ifdef FASYNC
- #define O_ASYNC FASYNC
- #else
- #define O_ASYNC 0
- #endif
+#ifdef FASYNC
+#define O_ASYNC FASYNC
+#else
+#define O_ASYNC 0
#endif
-
-#ifndef FTW_CONTINUE
- #define FTW_CONTINUE 0
#endif
-int asprintf(char **string_ptr, const char *format, ...);
-
-int vasprintf (char **result, const char *format, va_list args);
-char* strsep(char** str, const char* delims);
-int solaris_listxattr(const char *path, char *list, size_t size);
-int solaris_removexattr(const char *path, const char* key);
-int solaris_getxattr(const char *path, const char* key,
- char *value, size_t size);
-int solaris_setxattr(const char *path, const char* key, const char *value,
- size_t size, int flags);
-int solaris_fgetxattr(int fd, const char* key,
- char *value, size_t size);
-int solaris_fsetxattr(int fd, const char* key, const char *value,
- size_t size, int flags);
-int solaris_flistxattr(int fd, char *list, size_t size);
-
-int solaris_rename (const char *oldpath, const char *newpath);
-
-int solaris_unlink (const char *pathname);
-
-char *mkdtemp (char *temp);
+#ifndef FTW_CONTINUE
+#define FTW_CONTINUE 0
+#endif
+
+int
+asprintf(char **string_ptr, const char *format, ...);
+
+int
+vasprintf(char **result, const char *format, va_list args);
+char *
+strsep(char **str, const char *delims);
+int
+solaris_listxattr(const char *path, char *list, size_t size);
+int
+solaris_removexattr(const char *path, const char *key);
+int
+solaris_getxattr(const char *path, const char *key, char *value, size_t size);
+int
+solaris_setxattr(const char *path, const char *key, const char *value,
+ size_t size, int flags);
+int
+solaris_fgetxattr(int fd, const char *key, char *value, size_t size);
+int
+solaris_fsetxattr(int fd, const char *key, const char *value, size_t size,
+ int flags);
+int
+solaris_flistxattr(int fd, char *list, size_t size);
+
+int
+solaris_rename(const char *oldpath, const char *newpath);
+
+int
+solaris_unlink(const char *pathname);
+
+char *
+mkdtemp(char *temp);
#define GF_SOLARIS_XATTR_DIR ".glusterfs_xattr_inode"
-int solaris_xattr_resolve_path (const char *real_path, char **path);
+int
+solaris_xattr_resolve_path(const char *real_path, char **path);
#endif /* GF_SOLARIS_HOST_OS */
@@ -402,52 +411,54 @@ int solaris_xattr_resolve_path (const char *real_path, char **path);
#endif /* HAVE_ARGP */
#ifndef HAVE_STRNLEN
-size_t strnlen(const char *string, size_t maxlen);
+size_t
+strnlen(const char *string, size_t maxlen);
#endif /* STRNLEN */
#ifndef strdupa
-#define strdupa(s) \
- (__extension__ \
- ({ \
- __const char *__old = (s); \
- size_t __len = strlen (__old) + 1; \
- char *__new = (char *) __builtin_alloca (__len); \
- (char *) memcpy (__new, __old, __len); \
- }))
+#define strdupa(s) \
+ (__extension__({ \
+ __const char *__old = (s); \
+ size_t __len = strlen(__old) + 1; \
+ char *__new = (char *)__builtin_alloca(__len); \
+ (char *)memcpy(__new, __old, __len); \
+ }))
#endif
-#define GF_DIR_ALIGN(x) (((x) + sizeof (uint64_t) - 1) & ~(sizeof (uint64_t) - 1))
+#define GF_DIR_ALIGN(x) (((x) + sizeof(uint64_t) - 1) & ~(sizeof(uint64_t) - 1))
#include <sys/types.h>
#include <dirent.h>
static inline int32_t
-dirent_size (struct dirent *entry)
+dirent_size(struct dirent *entry)
{
- int32_t size = -1;
+ int32_t size = -1;
#ifdef GF_BSD_HOST_OS
- size = GF_DIR_ALIGN (24 /* FIX MEEEE!!! */ + entry->d_namlen);
+ size = GF_DIR_ALIGN(24 /* FIX MEEEE!!! */ + entry->d_namlen);
#endif
#ifdef GF_DARWIN_HOST_OS
- size = GF_DIR_ALIGN (24 /* FIX MEEEE!!! */ + entry->d_namlen);
+ size = GF_DIR_ALIGN(24 /* FIX MEEEE!!! */ + entry->d_namlen);
#endif
#ifdef GF_LINUX_HOST_OS
- size = GF_DIR_ALIGN (24 /* FIX MEEEE!!! */ + entry->d_reclen);
+ size = GF_DIR_ALIGN(24 /* FIX MEEEE!!! */ + entry->d_reclen);
#endif
#ifdef GF_SOLARIS_HOST_OS
- size = GF_DIR_ALIGN (24 /* FIX MEEEE!!! */ + entry->d_reclen);
+ size = GF_DIR_ALIGN(24 /* FIX MEEEE!!! */ + entry->d_reclen);
#endif
- return size;
+ return size;
}
#ifdef THREAD_UNSAFE_BASENAME
-char *basename_r(const char *);
+char *
+basename_r(const char *);
#define basename(path) basename_r(path)
#endif /* THREAD_UNSAFE_BASENAME */
#ifdef THREAD_UNSAFE_DIRNAME
-char *dirname_r(char *path);
+char *
+dirname_r(char *path);
#define dirname(path) dirname_r(path)
#endif /* THREAD_UNSAFE_DIRNAME */
@@ -483,9 +494,15 @@ char *dirname_r(char *path);
#define ST_ATIM_NSEC(stbuf) (0)
#define ST_CTIM_NSEC(stbuf) (0)
#define ST_MTIM_NSEC(stbuf) (0)
-#define ST_ATIM_NSEC_SET(stbuf, val) do { } while (0);
-#define ST_MTIM_NSEC_SET(stbuf, val) do { } while (0);
-#define ST_CTIM_NSEC_SET(stbuf, val) do { } while (0);
+#define ST_ATIM_NSEC_SET(stbuf, val) \
+ do { \
+ } while (0);
+#define ST_MTIM_NSEC_SET(stbuf, val) \
+ do { \
+ } while (0);
+#define ST_CTIM_NSEC_SET(stbuf, val) \
+ do { \
+ } while (0);
#endif
#ifdef GF_BSD_HOST_OS
@@ -495,11 +512,12 @@ char *dirname_r(char *path);
#if defined(__GNUC__) && !defined(RELAX_POISONING)
/* Use run API, see run.h */
#include <stdlib.h> /* system(), mkostemp() */
-#include <stdio.h> /* popen() */
+#include <stdio.h> /* popen() */
#pragma GCC poison system mkostemp popen
#endif
-int gf_umount_lazy(char *xlname, char *path, int rmdir);
+int
+gf_umount_lazy(char *xlname, char *path, int rmdir);
#ifndef GF_XATTR_NAME_MAX
#error 'Please define GF_XATTR_NAME_MAX for your OS distribution.'
diff --git a/libglusterfs/src/compound-fop-utils.h b/libglusterfs/src/compound-fop-utils.h
index bfd0649aef2..23a2f0df3fd 100644
--- a/libglusterfs/src/compound-fop-utils.h
+++ b/libglusterfs/src/compound-fop-utils.h
@@ -16,20 +16,21 @@
#include "mem-types.h"
#include "dict.h"
-#define COMPOUND_PACK_ARGS(fop, fop_enum, args, counter, params ...) do { \
- args->enum_list[counter] = fop_enum; \
- args_##fop##_store (&args->req_list[counter], params); \
-} while (0)
+#define COMPOUND_PACK_ARGS(fop, fop_enum, args, counter, params...) \
+ do { \
+ args->enum_list[counter] = fop_enum; \
+ args_##fop##_store(&args->req_list[counter], params); \
+ } while (0)
-compound_args_t*
-compound_fop_alloc (int length, glusterfs_compound_fop_t fop, dict_t *xdata);
+compound_args_t *
+compound_fop_alloc(int length, glusterfs_compound_fop_t fop, dict_t *xdata);
void
-compound_args_cleanup (compound_args_t *args);
+compound_args_cleanup(compound_args_t *args);
void
-compound_args_cbk_cleanup (compound_args_cbk_t *args_cbk);
+compound_args_cbk_cleanup(compound_args_cbk_t *args_cbk);
-compound_args_cbk_t*
-compound_args_cbk_alloc (int length, dict_t *xdata);
+compound_args_cbk_t *
+compound_args_cbk_alloc(int length, dict_t *xdata);
#endif /* __COMPOUND_FOP_UTILS_H__ */
diff --git a/libglusterfs/src/daemon.h b/libglusterfs/src/daemon.h
index 95e134b78b0..48850800b5e 100644
--- a/libglusterfs/src/daemon.h
+++ b/libglusterfs/src/daemon.h
@@ -13,6 +13,8 @@
#define DEVNULLPATH "/dev/null"
-int os_daemon_return(int nochdir, int noclose);
-int os_daemon(int nochdir, int noclose);
+int
+os_daemon_return(int nochdir, int noclose);
+int
+os_daemon(int nochdir, int noclose);
#endif /*_DAEMON_H */
diff --git a/libglusterfs/src/default-args.h b/libglusterfs/src/default-args.h
index 7d46fefa663..e5915c4c05e 100644
--- a/libglusterfs/src/default-args.h
+++ b/libglusterfs/src/default-args.h
@@ -18,484 +18,427 @@
#include "xlator.h"
int
-args_lookup_cbk_store (default_args_cbk_t *args,
- int32_t op_ret, int32_t op_errno,
- inode_t *inode, struct iatt *buf,
- dict_t *xdata, struct iatt *postparent);
-
-
-int
-args_stat_cbk_store (default_args_cbk_t *args,
- int32_t op_ret, int32_t op_errno,
- struct iatt *buf, dict_t *xdata);
+args_lookup_cbk_store(default_args_cbk_t *args, int32_t op_ret,
+ int32_t op_errno, inode_t *inode, struct iatt *buf,
+ dict_t *xdata, struct iatt *postparent);
int
-args_fstat_cbk_store (default_args_cbk_t *args,
- int32_t op_ret, int32_t op_errno,
+args_stat_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno,
struct iatt *buf, dict_t *xdata);
int
-args_truncate_cbk_store (default_args_cbk_t *args,
- int32_t op_ret, int32_t op_errno, struct iatt *prebuf,
- struct iatt *postbuf, dict_t *xdata);
-
+args_fstat_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno,
+ struct iatt *buf, dict_t *xdata);
int
-args_ftruncate_cbk_store (default_args_cbk_t *args,
- int32_t op_ret, int32_t op_errno, struct iatt *prebuf,
+args_truncate_cbk_store(default_args_cbk_t *args, int32_t op_ret,
+ int32_t op_errno, struct iatt *prebuf,
struct iatt *postbuf, dict_t *xdata);
+int
+args_ftruncate_cbk_store(default_args_cbk_t *args, int32_t op_ret,
+ int32_t op_errno, struct iatt *prebuf,
+ struct iatt *postbuf, dict_t *xdata);
int
-args_access_cbk_store (default_args_cbk_t *args,
- int32_t op_ret, int32_t op_errno, dict_t *xdata);
+args_access_cbk_store(default_args_cbk_t *args, int32_t op_ret,
+ int32_t op_errno, dict_t *xdata);
+int
+args_readlink_cbk_store(default_args_cbk_t *args, int32_t op_ret,
+ int32_t op_errno, const char *path, struct iatt *stbuf,
+ dict_t *xdata);
int
-args_readlink_cbk_store (default_args_cbk_t *args,
- int32_t op_ret, int32_t op_errno,
- const char *path, struct iatt *stbuf, dict_t *xdata);
+args_mknod_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno,
+ inode_t *inode, struct iatt *buf, struct iatt *preparent,
+ struct iatt *postparent, dict_t *xdata);
int
-args_mknod_cbk_store (default_args_cbk_t *args, int32_t op_ret,
- int32_t op_errno, inode_t *inode, struct iatt *buf,
- struct iatt *preparent, struct iatt *postparent,
- dict_t *xdata);
+args_mkdir_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno,
+ inode_t *inode, struct iatt *buf, struct iatt *preparent,
+ struct iatt *postparent, dict_t *xdata);
int
-args_mkdir_cbk_store (default_args_cbk_t *args,
- int32_t op_ret, int32_t op_errno, inode_t *inode,
- struct iatt *buf, struct iatt *preparent,
- struct iatt *postparent, dict_t *xdata);
+args_unlink_cbk_store(default_args_cbk_t *args, int32_t op_ret,
+ int32_t op_errno, struct iatt *preparent,
+ struct iatt *postparent, dict_t *xdata);
int
-args_unlink_cbk_store (default_args_cbk_t *args,
- int32_t op_ret, int32_t op_errno,
+args_rmdir_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno,
struct iatt *preparent, struct iatt *postparent,
dict_t *xdata);
int
-args_rmdir_cbk_store (default_args_cbk_t *args,
- int32_t op_ret, int32_t op_errno,
- struct iatt *preparent, struct iatt *postparent,
- dict_t *xdata);
+args_symlink_cbk_store(default_args_cbk_t *args, int32_t op_ret,
+ int32_t op_errno, inode_t *inode, struct iatt *buf,
+ struct iatt *preparent, struct iatt *postparent,
+ dict_t *xdata);
int
-args_symlink_cbk_store (default_args_cbk_t *args,
- int32_t op_ret, int32_t op_errno,
- inode_t *inode, struct iatt *buf,
- struct iatt *preparent, struct iatt *postparent,
+args_rename_cbk_store(default_args_cbk_t *args, int32_t op_ret,
+ int32_t op_errno, struct iatt *buf,
+ struct iatt *preoldparent, struct iatt *postoldparent,
+ struct iatt *prenewparent, struct iatt *postnewparent,
dict_t *xdata);
-
int
-args_rename_cbk_store (default_args_cbk_t *args,
- int32_t op_ret, int32_t op_errno, struct iatt *buf,
- struct iatt *preoldparent, struct iatt *postoldparent,
- struct iatt *prenewparent, struct iatt *postnewparent,
- dict_t *xdata);
+args_link_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno,
+ inode_t *inode, struct iatt *buf, struct iatt *preparent,
+ struct iatt *postparent, dict_t *xdata);
int
-args_link_cbk_store (default_args_cbk_t *args,
- int32_t op_ret, int32_t op_errno,
- inode_t *inode, struct iatt *buf,
- struct iatt *preparent, struct iatt *postparent,
- dict_t *xdata);
+args_create_cbk_store(default_args_cbk_t *args, int32_t op_ret,
+ int32_t op_errno, fd_t *fd, inode_t *inode,
+ struct iatt *buf, struct iatt *preparent,
+ struct iatt *postparent, dict_t *xdata);
int
-args_create_cbk_store (default_args_cbk_t *args,
- int32_t op_ret, int32_t op_errno,
- fd_t *fd, inode_t *inode, struct iatt *buf,
- struct iatt *preparent, struct iatt *postparent,
- dict_t *xdata);
+args_open_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno,
+ fd_t *fd, dict_t *xdata);
int
-args_open_cbk_store (default_args_cbk_t *args,
- int32_t op_ret, int32_t op_errno,
- fd_t *fd, dict_t *xdata);
+args_readv_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno,
+ struct iovec *vector, int32_t count, struct iatt *stbuf,
+ struct iobref *iobref, dict_t *xdata);
int
-args_readv_cbk_store (default_args_cbk_t *args,
- int32_t op_ret, int32_t op_errno, struct iovec *vector,
- int32_t count, struct iatt *stbuf,
- struct iobref *iobref, dict_t *xdata);
+args_writev_cbk_store(default_args_cbk_t *args, int32_t op_ret,
+ int32_t op_errno, struct iatt *prebuf,
+ struct iatt *postbuf, dict_t *xdata);
int
-args_writev_cbk_store (default_args_cbk_t *args,
- int32_t op_ret, int32_t op_errno,
- struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata);
+args_put_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno,
+ inode_t *inode, struct iatt *buf, struct iatt *preparent,
+ struct iatt *postparent, dict_t *xdata);
int
-args_put_cbk_store (default_args_cbk_t *args, int32_t op_ret, int32_t op_errno,
- inode_t *inode, struct iatt *buf, struct iatt *preparent,
- struct iatt *postparent, dict_t *xdata);
+args_flush_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno,
+ dict_t *xdata);
int
-args_flush_cbk_store (default_args_cbk_t *args,
- int32_t op_ret, int32_t op_errno, dict_t *xdata);
-
+args_fsync_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno,
+ struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata);
int
-args_fsync_cbk_store (default_args_cbk_t *args,
- int32_t op_ret, int32_t op_errno,
- struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata);
+args_opendir_cbk_store(default_args_cbk_t *args, int32_t op_ret,
+ int32_t op_errno, fd_t *fd, dict_t *xdata);
int
-args_opendir_cbk_store (default_args_cbk_t *args,
- int32_t op_ret, int32_t op_errno,
- fd_t *fd, dict_t *xdata);
+args_fsyncdir_cbk_store(default_args_cbk_t *args, int32_t op_ret,
+ int32_t op_errno, dict_t *xdata);
int
-args_fsyncdir_cbk_store (default_args_cbk_t *args,
- int32_t op_ret, int32_t op_errno, dict_t *xdata);
+args_statfs_cbk_store(default_args_cbk_t *args, int32_t op_ret,
+ int32_t op_errno, struct statvfs *buf, dict_t *xdata);
int
-args_statfs_cbk_store (default_args_cbk_t *args,
- int32_t op_ret, int32_t op_errno,
- struct statvfs *buf, dict_t *xdata);
+args_setxattr_cbk_store(default_args_cbk_t *args, int32_t op_ret,
+ int32_t op_errno, dict_t *xdata);
int
-args_setxattr_cbk_store (default_args_cbk_t *args,
- int32_t op_ret,
- int32_t op_errno, dict_t *xdata);
+args_getxattr_cbk_store(default_args_cbk_t *args, int32_t op_ret,
+ int32_t op_errno, dict_t *dict, dict_t *xdata);
int
-args_getxattr_cbk_store (default_args_cbk_t *args,
- int32_t op_ret, int32_t op_errno,
- dict_t *dict, dict_t *xdata);
+args_fsetxattr_cbk_store(default_args_cbk_t *args, int32_t op_ret,
+ int32_t op_errno, dict_t *xdata);
int
-args_fsetxattr_cbk_store (default_args_cbk_t *args,
- int32_t op_ret, int32_t op_errno, dict_t *xdata);
+args_fgetxattr_cbk_store(default_args_cbk_t *args, int32_t op_ret,
+ int32_t op_errno, dict_t *dict, dict_t *xdata);
int
-args_fgetxattr_cbk_store (default_args_cbk_t *args,
- int32_t op_ret, int32_t op_errno,
- dict_t *dict, dict_t *xdata);
+args_removexattr_cbk_store(default_args_cbk_t *args, int32_t op_ret,
+ int32_t op_errno, dict_t *xdata);
int
-args_removexattr_cbk_store (default_args_cbk_t *args,
- int32_t op_ret, int32_t op_errno, dict_t *xdata);
+args_fremovexattr_cbk_store(default_args_cbk_t *args, int32_t op_ret,
+ int32_t op_errno, dict_t *xdata);
int
-args_fremovexattr_cbk_store (default_args_cbk_t *args,
- int32_t op_ret, int32_t op_errno, dict_t *xdata);
+args_lk_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno,
+ struct gf_flock *lock, dict_t *xdata);
int
-args_lk_cbk_store (default_args_cbk_t *args,
- int32_t op_ret, int32_t op_errno,
- struct gf_flock *lock, dict_t *xdata);
-
+args_inodelk_cbk_store(default_args_cbk_t *args, int32_t op_ret,
+ int32_t op_errno, dict_t *xdata);
int
-args_inodelk_cbk_store (default_args_cbk_t *args,
- int32_t op_ret, int32_t op_errno, dict_t *xdata);
+args_finodelk_cbk_store(default_args_cbk_t *args, int32_t op_ret,
+ int32_t op_errno, dict_t *xdata);
int
-args_finodelk_cbk_store (default_args_cbk_t *args,
- int32_t op_ret, int32_t op_errno, dict_t *xdata);
+args_entrylk_cbk_store(default_args_cbk_t *args, int32_t op_ret,
+ int32_t op_errno, dict_t *xdata);
int
-args_entrylk_cbk_store (default_args_cbk_t *args,
- int32_t op_ret, int32_t op_errno, dict_t *xdata);
+args_fentrylk_cbk_store(default_args_cbk_t *args, int32_t op_ret,
+ int32_t op_errno, dict_t *xdata);
int
-args_fentrylk_cbk_store (default_args_cbk_t *args,
- int32_t op_ret, int32_t op_errno, dict_t *xdata);
-
+args_readdirp_cbk_store(default_args_cbk_t *args, int32_t op_ret,
+ int32_t op_errno, gf_dirent_t *entries, dict_t *xdata);
int
-args_readdirp_cbk_store (default_args_cbk_t *args,
- int32_t op_ret, int32_t op_errno,
- gf_dirent_t *entries, dict_t *xdata);
-
+args_readdir_cbk_store(default_args_cbk_t *args, int32_t op_ret,
+ int32_t op_errno, gf_dirent_t *entries, dict_t *xdata);
int
-args_readdir_cbk_store (default_args_cbk_t *args,
- int32_t op_ret, int32_t op_errno,
- gf_dirent_t *entries, dict_t *xdata);
-
+args_rchecksum_cbk_store(default_args_cbk_t *args, int32_t op_ret,
+ int32_t op_errno, uint32_t weak_checksum,
+ uint8_t *strong_checksum, dict_t *xdata);
int
-args_rchecksum_cbk_store (default_args_cbk_t *args,
- int32_t op_ret, int32_t op_errno,
- uint32_t weak_checksum, uint8_t *strong_checksum,
- dict_t *xdata);
-
+args_xattrop_cbk_store(default_args_cbk_t *args, int32_t op_ret,
+ int32_t op_errno, dict_t *xattr, dict_t *xdata);
int
-args_xattrop_cbk_store (default_args_cbk_t *args, int32_t op_ret,
+args_fxattrop_cbk_store(default_args_cbk_t *args, int32_t op_ret,
int32_t op_errno, dict_t *xattr, dict_t *xdata);
-
int
-args_fxattrop_cbk_store (default_args_cbk_t *args,
- int32_t op_ret, int32_t op_errno,
- dict_t *xattr, dict_t *xdata);
+args_setattr_cbk_store(default_args_cbk_t *args, int32_t op_ret,
+ int32_t op_errno, struct iatt *statpre,
+ struct iatt *statpost, dict_t *xdata);
int
-args_setattr_cbk_store (default_args_cbk_t *args,
- int32_t op_ret, int32_t op_errno,
- struct iatt *statpre, struct iatt *statpost,
- dict_t *xdata);
-
-
-int
-args_fsetattr_cbk_store (default_args_cbk_t *args,
- int32_t op_ret, int32_t op_errno,
- struct iatt *statpre, struct iatt *statpost,
- dict_t *xdata);
+args_fsetattr_cbk_store(default_args_cbk_t *args, int32_t op_ret,
+ int32_t op_errno, struct iatt *statpre,
+ struct iatt *statpost, dict_t *xdata);
int
-args_fallocate_cbk_store(default_args_cbk_t *args,
- int32_t op_ret, int32_t op_errno,
- struct iatt *statpre, struct iatt *statpost,
- dict_t *xdata);
+args_fallocate_cbk_store(default_args_cbk_t *args, int32_t op_ret,
+ int32_t op_errno, struct iatt *statpre,
+ struct iatt *statpost, dict_t *xdata);
int
-args_discard_cbk_store(default_args_cbk_t *args,
- int32_t op_ret, int32_t op_errno,
- struct iatt *statpre, struct iatt *statpost,
- dict_t *xdata);
+args_discard_cbk_store(default_args_cbk_t *args, int32_t op_ret,
+ int32_t op_errno, struct iatt *statpre,
+ struct iatt *statpost, dict_t *xdata);
int
-args_zerofill_cbk_store(default_args_cbk_t *args,
- int32_t op_ret, int32_t op_errno,
- struct iatt *statpre, struct iatt *statpost,
- dict_t *xdata);
+args_zerofill_cbk_store(default_args_cbk_t *args, int32_t op_ret,
+ int32_t op_errno, struct iatt *statpre,
+ struct iatt *statpost, dict_t *xdata);
int
-args_ipc_cbk_store (default_args_cbk_t *args,
- int32_t op_ret, int32_t op_errno, dict_t *xdata);
+args_ipc_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno,
+ dict_t *xdata);
int
-args_seek_cbk_store (default_args_cbk_t *args, int32_t op_ret,
- int32_t op_errno, off_t offset, dict_t *xdata);
+args_seek_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno,
+ off_t offset, dict_t *xdata);
void
-args_lease_cbk_store (default_args_cbk_t *args,
- int32_t op_ret, int32_t op_errno,
+args_lease_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno,
struct gf_lease *lease, dict_t *xdata);
void
-args_cbk_wipe (default_args_cbk_t *args_cbk);
+args_cbk_wipe(default_args_cbk_t *args_cbk);
void
-args_wipe (default_args_t *args);
+args_wipe(default_args_t *args);
int
-args_lookup_store (default_args_t *args, loc_t *loc,
- dict_t *xdata);
+args_lookup_store(default_args_t *args, loc_t *loc, dict_t *xdata);
int
-args_stat_store (default_args_t *args, loc_t *loc, dict_t *xdata);
+args_stat_store(default_args_t *args, loc_t *loc, dict_t *xdata);
int
-args_fstat_store (default_args_t *args, fd_t *fd, dict_t *xdata);
+args_fstat_store(default_args_t *args, fd_t *fd, dict_t *xdata);
int
-args_truncate_store (default_args_t *args, loc_t *loc, off_t off,
- dict_t *xdata);
+args_truncate_store(default_args_t *args, loc_t *loc, off_t off, dict_t *xdata);
int
-args_ftruncate_store (default_args_t *args, fd_t *fd, off_t off,
- dict_t *xdata);
+args_ftruncate_store(default_args_t *args, fd_t *fd, off_t off, dict_t *xdata);
int
-args_access_store (default_args_t *args, loc_t *loc, int32_t mask,
- dict_t *xdata);
+args_access_store(default_args_t *args, loc_t *loc, int32_t mask,
+ dict_t *xdata);
int
-args_readlink_store (default_args_t *args, loc_t *loc, size_t size,
- dict_t *xdata);
+args_readlink_store(default_args_t *args, loc_t *loc, size_t size,
+ dict_t *xdata);
int
-args_mknod_store (default_args_t *args, loc_t *loc, mode_t mode,
- dev_t rdev, mode_t umask, dict_t *xdata);
+args_mknod_store(default_args_t *args, loc_t *loc, mode_t mode, dev_t rdev,
+ mode_t umask, dict_t *xdata);
int
-args_mkdir_store (default_args_t *args, loc_t *loc, mode_t mode,
- mode_t umask, dict_t *xdata);
+args_mkdir_store(default_args_t *args, loc_t *loc, mode_t mode, mode_t umask,
+ dict_t *xdata);
int
-args_unlink_store (default_args_t *args, loc_t *loc, int xflag, dict_t *xdata);
+args_unlink_store(default_args_t *args, loc_t *loc, int xflag, dict_t *xdata);
int
-args_rmdir_store (default_args_t *args, loc_t *loc, int flags, dict_t *xdata);
+args_rmdir_store(default_args_t *args, loc_t *loc, int flags, dict_t *xdata);
int
-args_symlink_store (default_args_t *args, const char *linkname, loc_t *loc,
+args_symlink_store(default_args_t *args, const char *linkname, loc_t *loc,
mode_t umask, dict_t *xdata);
int
-args_rename_store (default_args_t *args, loc_t *oldloc, loc_t *newloc,
- dict_t *xdata);
+args_rename_store(default_args_t *args, loc_t *oldloc, loc_t *newloc,
+ dict_t *xdata);
int
-args_link_store (default_args_t *args, loc_t *oldloc, loc_t *newloc,
- dict_t *xdata);
+args_link_store(default_args_t *args, loc_t *oldloc, loc_t *newloc,
+ dict_t *xdata);
int
-args_create_store (default_args_t *args,
- loc_t *loc, int32_t flags, mode_t mode,
+args_create_store(default_args_t *args, loc_t *loc, int32_t flags, mode_t mode,
mode_t umask, fd_t *fd, dict_t *xdata);
int
-args_open_store (default_args_t *args, loc_t *loc, int32_t flags,
- fd_t *fd, dict_t *xdata);
+args_open_store(default_args_t *args, loc_t *loc, int32_t flags, fd_t *fd,
+ dict_t *xdata);
int
-args_readv_store (default_args_t *args, fd_t *fd, size_t size, off_t off,
- uint32_t flags, dict_t *xdata);
+args_readv_store(default_args_t *args, fd_t *fd, size_t size, off_t off,
+ uint32_t flags, dict_t *xdata);
int
-args_writev_store (default_args_t *args, fd_t *fd, struct iovec *vector,
- int32_t count, off_t off, uint32_t flags,
- struct iobref *iobref, dict_t *xdata);
+args_writev_store(default_args_t *args, fd_t *fd, struct iovec *vector,
+ int32_t count, off_t off, uint32_t flags,
+ struct iobref *iobref, dict_t *xdata);
int
-args_put_store (default_args_t *args, loc_t *loc, mode_t mode, mode_t umask,
- uint32_t flags, struct iovec *vector, int32_t count, off_t off,
- struct iobref *iobref, dict_t *xattr, dict_t *xdata);
+args_put_store(default_args_t *args, loc_t *loc, mode_t mode, mode_t umask,
+ uint32_t flags, struct iovec *vector, int32_t count, off_t off,
+ struct iobref *iobref, dict_t *xattr, dict_t *xdata);
int
-args_flush_store (default_args_t *args, fd_t *fd, dict_t *xdata);
+args_flush_store(default_args_t *args, fd_t *fd, dict_t *xdata);
int
-args_fsync_store (default_args_t *args, fd_t *fd, int32_t datasync,
- dict_t *xdata);
+args_fsync_store(default_args_t *args, fd_t *fd, int32_t datasync,
+ dict_t *xdata);
int
-args_opendir_store (default_args_t *args, loc_t *loc, fd_t *fd, dict_t *xdata);
+args_opendir_store(default_args_t *args, loc_t *loc, fd_t *fd, dict_t *xdata);
int
-args_fsyncdir_store (default_args_t *args, fd_t *fd, int32_t datasync,
- dict_t *xdata);
+args_fsyncdir_store(default_args_t *args, fd_t *fd, int32_t datasync,
+ dict_t *xdata);
int
-args_statfs_store (default_args_t *args, loc_t *loc, dict_t *xdata);
+args_statfs_store(default_args_t *args, loc_t *loc, dict_t *xdata);
int
-args_setxattr_store (default_args_t *args,
- loc_t *loc, dict_t *dict,
- int32_t flags, dict_t *xdata);
+args_setxattr_store(default_args_t *args, loc_t *loc, dict_t *dict,
+ int32_t flags, dict_t *xdata);
int
-args_getxattr_store (default_args_t *args,
- loc_t *loc, const char *name, dict_t *xdata);
+args_getxattr_store(default_args_t *args, loc_t *loc, const char *name,
+ dict_t *xdata);
int
-args_fsetxattr_store (default_args_t *args,
- fd_t *fd, dict_t *dict, int32_t flags, dict_t *xdata);
+args_fsetxattr_store(default_args_t *args, fd_t *fd, dict_t *dict,
+ int32_t flags, dict_t *xdata);
int
-args_fgetxattr_store (default_args_t *args,
- fd_t *fd, const char *name, dict_t *xdata);
+args_fgetxattr_store(default_args_t *args, fd_t *fd, const char *name,
+ dict_t *xdata);
int
-args_removexattr_store (default_args_t *args,
- loc_t *loc, const char *name, dict_t *xdata);
+args_removexattr_store(default_args_t *args, loc_t *loc, const char *name,
+ dict_t *xdata);
int
-args_fremovexattr_store (default_args_t *args,
- fd_t *fd, const char *name, dict_t *xdata);
+args_fremovexattr_store(default_args_t *args, fd_t *fd, const char *name,
+ dict_t *xdata);
int
-args_lk_store (default_args_t *args,
- fd_t *fd, int32_t cmd,
- struct gf_flock *lock, dict_t *xdata);
+args_lk_store(default_args_t *args, fd_t *fd, int32_t cmd,
+ struct gf_flock *lock, dict_t *xdata);
int
-args_inodelk_store (default_args_t *args,
- const char *volume, loc_t *loc, int32_t cmd,
- struct gf_flock *lock, dict_t *xdata);
+args_inodelk_store(default_args_t *args, const char *volume, loc_t *loc,
+ int32_t cmd, struct gf_flock *lock, dict_t *xdata);
int
-args_finodelk_store (default_args_t *args,
- const char *volume, fd_t *fd, int32_t cmd,
- struct gf_flock *lock, dict_t *xdata);
+args_finodelk_store(default_args_t *args, const char *volume, fd_t *fd,
+ int32_t cmd, struct gf_flock *lock, dict_t *xdata);
int
-args_entrylk_store (default_args_t *args,
- const char *volume, loc_t *loc, const char *name,
- entrylk_cmd cmd, entrylk_type type, dict_t *xdata);
+args_entrylk_store(default_args_t *args, const char *volume, loc_t *loc,
+ const char *name, entrylk_cmd cmd, entrylk_type type,
+ dict_t *xdata);
int
-args_fentrylk_store (default_args_t *args,
- const char *volume, fd_t *fd, const char *name,
- entrylk_cmd cmd, entrylk_type type, dict_t *xdata);
+args_fentrylk_store(default_args_t *args, const char *volume, fd_t *fd,
+ const char *name, entrylk_cmd cmd, entrylk_type type,
+ dict_t *xdata);
int
-args_readdirp_store (default_args_t *args,
- fd_t *fd, size_t size, off_t off, dict_t *xdata);
+args_readdirp_store(default_args_t *args, fd_t *fd, size_t size, off_t off,
+ dict_t *xdata);
int
-args_readdir_store (default_args_t *args,
- fd_t *fd, size_t size,
- off_t off, dict_t *xdata);
+args_readdir_store(default_args_t *args, fd_t *fd, size_t size, off_t off,
+ dict_t *xdata);
int
-args_rchecksum_store (default_args_t *args,
- fd_t *fd, off_t offset, int32_t len, dict_t *xdata);
+args_rchecksum_store(default_args_t *args, fd_t *fd, off_t offset, int32_t len,
+ dict_t *xdata);
int
-args_xattrop_store (default_args_t *args,
- loc_t *loc, gf_xattrop_flags_t optype,
- dict_t *xattr, dict_t *xdata);
+args_xattrop_store(default_args_t *args, loc_t *loc, gf_xattrop_flags_t optype,
+ dict_t *xattr, dict_t *xdata);
int
-args_fxattrop_store (default_args_t *args,
- fd_t *fd, gf_xattrop_flags_t optype,
- dict_t *xattr, dict_t *xdata);
+args_fxattrop_store(default_args_t *args, fd_t *fd, gf_xattrop_flags_t optype,
+ dict_t *xattr, dict_t *xdata);
int
-args_setattr_store (default_args_t *args,
- loc_t *loc, struct iatt *stbuf,
- int32_t valid, dict_t *xdata);
+args_setattr_store(default_args_t *args, loc_t *loc, struct iatt *stbuf,
+ int32_t valid, dict_t *xdata);
int
-args_fsetattr_store (default_args_t *args,
- fd_t *fd, struct iatt *stbuf,
- int32_t valid, dict_t *xdata);
+args_fsetattr_store(default_args_t *args, fd_t *fd, struct iatt *stbuf,
+ int32_t valid, dict_t *xdata);
int
-args_fallocate_store (default_args_t *args, fd_t *fd,
- int32_t mode, off_t offset, size_t len, dict_t *xdata);
+args_fallocate_store(default_args_t *args, fd_t *fd, int32_t mode, off_t offset,
+ size_t len, dict_t *xdata);
int
-args_discard_store (default_args_t *args, fd_t *fd,
- off_t offset, size_t len, dict_t *xdata);
+args_discard_store(default_args_t *args, fd_t *fd, off_t offset, size_t len,
+ dict_t *xdata);
int
-args_zerofill_store (default_args_t *args, fd_t *fd,
- off_t offset, off_t len, dict_t *xdata);
+args_zerofill_store(default_args_t *args, fd_t *fd, off_t offset, off_t len,
+ dict_t *xdata);
int
-args_ipc_store (default_args_t *args,
- int32_t op, dict_t *xdata);
+args_ipc_store(default_args_t *args, int32_t op, dict_t *xdata);
int
-args_seek_store (default_args_t *args, fd_t *fd,
- off_t offset, gf_seek_what_t what, dict_t *xdata);
+args_seek_store(default_args_t *args, fd_t *fd, off_t offset,
+ gf_seek_what_t what, dict_t *xdata);
void
-args_lease_store (default_args_t *args, loc_t *loc, struct gf_lease *lease,
- dict_t *xdata);
+args_lease_store(default_args_t *args, loc_t *loc, struct gf_lease *lease,
+ dict_t *xdata);
int
-args_getactivelk_cbk_store (default_args_cbk_t *args,
- int32_t op_ret, int32_t op_errno,
- lock_migration_info_t *locklist, dict_t *xdata);
+args_getactivelk_cbk_store(default_args_cbk_t *args, int32_t op_ret,
+ int32_t op_errno, lock_migration_info_t *locklist,
+ dict_t *xdata);
int
-args_setactivelk_store (default_args_t *args, loc_t *loc,
- lock_migration_info_t *locklist, dict_t *xdata);
+args_setactivelk_store(default_args_t *args, loc_t *loc,
+ lock_migration_info_t *locklist, dict_t *xdata);
int
-args_icreate_store (default_args_t *args,
- loc_t *loc, mode_t mode, dict_t *xdata);
+args_icreate_store(default_args_t *args, loc_t *loc, mode_t mode,
+ dict_t *xdata);
int
-args_namelink_store (default_args_t *args, loc_t *loc, dict_t *xdata);
+args_namelink_store(default_args_t *args, loc_t *loc, dict_t *xdata);
void
-args_cbk_init (default_args_cbk_t *args_cbk);
+args_cbk_init(default_args_cbk_t *args_cbk);
#endif /* _DEFAULT_ARGS_H */
diff --git a/libglusterfs/src/defaults.h b/libglusterfs/src/defaults.h
index 5e56cc2c9f9..8583935e069 100644
--- a/libglusterfs/src/defaults.h
+++ b/libglusterfs/src/defaults.h
@@ -18,1344 +18,1222 @@
#include "xlator.h"
typedef struct {
- int op_ret;
- int op_errno;
- inode_t *inode;
- struct iatt stat;
- struct iatt prestat;
- struct iatt poststat;
- struct iatt preparent; /* @preoldparent in rename_cbk */
- struct iatt postparent; /* @postoldparent in rename_cbk */
- struct iatt preparent2; /* @prenewparent in rename_cbk */
- struct iatt postparent2; /* @postnewparent in rename_cbk */
- const char *buf;
- struct iovec *vector;
- int count;
- struct iobref *iobref;
- fd_t *fd;
- struct statvfs statvfs;
- dict_t *xattr;
- struct gf_flock lock;
- uint32_t weak_checksum;
- uint8_t *strong_checksum;
- dict_t *xdata;
- gf_dirent_t entries;
- off_t offset; /* seek hole/data */
- int valid; /* If the response is valid or not. For call-stub it is
- always valid irrespective of this */
- struct gf_lease lease;
- lock_migration_info_t locklist;
+ int op_ret;
+ int op_errno;
+ inode_t *inode;
+ struct iatt stat;
+ struct iatt prestat;
+ struct iatt poststat;
+ struct iatt preparent; /* @preoldparent in rename_cbk */
+ struct iatt postparent; /* @postoldparent in rename_cbk */
+ struct iatt preparent2; /* @prenewparent in rename_cbk */
+ struct iatt postparent2; /* @postnewparent in rename_cbk */
+ const char *buf;
+ struct iovec *vector;
+ int count;
+ struct iobref *iobref;
+ fd_t *fd;
+ struct statvfs statvfs;
+ dict_t *xattr;
+ struct gf_flock lock;
+ uint32_t weak_checksum;
+ uint8_t *strong_checksum;
+ dict_t *xdata;
+ gf_dirent_t entries;
+ off_t offset; /* seek hole/data */
+ int valid; /* If the response is valid or not. For call-stub it is
+ always valid irrespective of this */
+ struct gf_lease lease;
+ lock_migration_info_t locklist;
} default_args_cbk_t;
typedef struct {
- loc_t loc; /* @old in rename(), link() */
- loc_t loc2; /* @new in rename(), link() */
- fd_t *fd;
- off_t offset;
- int mask;
- size_t size;
- mode_t mode;
- dev_t rdev;
- mode_t umask;
- int xflag;
- int flags;
- const char *linkname;
- struct iovec *vector;
- int count;
- struct iobref *iobref;
- int datasync;
- dict_t *xattr;
- const char *name;
- int cmd;
- struct gf_flock lock;
- const char *volume;
- entrylk_cmd entrylkcmd;
- entrylk_type entrylktype;
- gf_xattrop_flags_t optype;
- int valid;
- struct iatt stat;
- gf_seek_what_t what;
- dict_t *xdata;
- struct gf_lease lease;
- lock_migration_info_t locklist;
+ loc_t loc; /* @old in rename(), link() */
+ loc_t loc2; /* @new in rename(), link() */
+ fd_t *fd;
+ off_t offset;
+ int mask;
+ size_t size;
+ mode_t mode;
+ dev_t rdev;
+ mode_t umask;
+ int xflag;
+ int flags;
+ const char *linkname;
+ struct iovec *vector;
+ int count;
+ struct iobref *iobref;
+ int datasync;
+ dict_t *xattr;
+ const char *name;
+ int cmd;
+ struct gf_flock lock;
+ const char *volume;
+ entrylk_cmd entrylkcmd;
+ entrylk_type entrylktype;
+ gf_xattrop_flags_t optype;
+ int valid;
+ struct iatt stat;
+ gf_seek_what_t what;
+ dict_t *xdata;
+ struct gf_lease lease;
+ lock_migration_info_t locklist;
} default_args_t;
typedef struct {
- int fop_enum;
- unsigned int fop_length;
- int *enum_list;
- default_args_t *req_list;
- dict_t *xdata;
+ int fop_enum;
+ unsigned int fop_length;
+ int *enum_list;
+ default_args_t *req_list;
+ dict_t *xdata;
} compound_args_t;
typedef struct {
- int fop_enum;
- unsigned int fop_length;
- int *enum_list;
- default_args_cbk_t *rsp_list;
- dict_t *xdata;
+ int fop_enum;
+ unsigned int fop_length;
+ int *enum_list;
+ default_args_cbk_t *rsp_list;
+ dict_t *xdata;
} compound_args_cbk_t;
-int32_t default_notify (xlator_t *this,
- int32_t event,
- void *data,
- ...);
-
-int32_t default_forget (xlator_t *this, inode_t *inode);
+int32_t
+default_notify(xlator_t *this, int32_t event, void *data, ...);
-int32_t default_release (xlator_t *this, fd_t *fd);
+int32_t
+default_forget(xlator_t *this, inode_t *inode);
-int32_t default_releasedir (xlator_t *this, fd_t *fd);
+int32_t
+default_release(xlator_t *this, fd_t *fd);
+int32_t
+default_releasedir(xlator_t *this, fd_t *fd);
extern struct xlator_fops *default_fops;
/* Management Operations */
-int32_t default_getspec (call_frame_t *frame,
- xlator_t *this,
- const char *key,
- int32_t flag);
+int32_t
+default_getspec(call_frame_t *frame, xlator_t *this, const char *key,
+ int32_t flag);
-int32_t default_rchecksum (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd, off_t offset,
- int32_t len, dict_t *xdata);
+int32_t
+default_rchecksum(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
+ int32_t len, dict_t *xdata);
/* FileSystem operations */
-int32_t default_lookup (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc,
- dict_t *xdata);
-
-int32_t default_stat (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc, dict_t *xdata);
-
-int32_t default_fstat (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd, dict_t *xdata);
-
-int32_t default_truncate (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc,
- off_t offset, dict_t *xdata);
+int32_t
+default_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata);
-int32_t default_ftruncate (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- off_t offset, dict_t *xdata);
+int32_t
+default_stat(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata);
-int32_t default_access (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc,
- int32_t mask, dict_t *xdata);
+int32_t
+default_fstat(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata);
-int32_t default_readlink (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc,
- size_t size, dict_t *xdata);
+int32_t
+default_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset,
+ dict_t *xdata);
-int32_t default_mknod (call_frame_t *frame, xlator_t *this, loc_t *loc,
- mode_t mode, dev_t rdev, mode_t umask, dict_t *xdata);
+int32_t
+default_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
+ dict_t *xdata);
-int32_t default_mkdir (call_frame_t *frame, xlator_t *this,
- loc_t *loc, mode_t mode, mode_t umask, dict_t *xdata);
+int32_t
+default_access(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t mask,
+ dict_t *xdata);
-int32_t default_unlink (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc, int xflag, dict_t *xdata);
+int32_t
+default_readlink(call_frame_t *frame, xlator_t *this, loc_t *loc, size_t size,
+ dict_t *xdata);
-int32_t default_rmdir (call_frame_t *frame, xlator_t *this,
- loc_t *loc, int xflag, dict_t *xdata);
+int32_t
+default_mknod(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode,
+ dev_t rdev, mode_t umask, dict_t *xdata);
-int32_t default_symlink (call_frame_t *frame, xlator_t *this,
- const char *linkpath, loc_t *loc, mode_t umask,
- dict_t *xdata);
+int32_t
+default_mkdir(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode,
+ mode_t umask, dict_t *xdata);
-int32_t default_rename (call_frame_t *frame,
- xlator_t *this,
- loc_t *oldloc,
- loc_t *newloc, dict_t *xdata);
+int32_t
+default_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag,
+ dict_t *xdata);
-int32_t default_link (call_frame_t *frame,
- xlator_t *this,
- loc_t *oldloc,
- loc_t *newloc, dict_t *xdata);
+int32_t
+default_rmdir(call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag,
+ dict_t *xdata);
-int32_t default_create (call_frame_t *frame, xlator_t *this,
- loc_t *loc, int32_t flags, mode_t mode,
- mode_t umask, fd_t *fd, dict_t *xdata);
+int32_t
+default_symlink(call_frame_t *frame, xlator_t *this, const char *linkpath,
+ loc_t *loc, mode_t umask, dict_t *xdata);
-int32_t default_open (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc,
- int32_t flags, fd_t *fd,
- dict_t *xdata);
+int32_t
+default_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc,
+ loc_t *newloc, dict_t *xdata);
-int32_t default_readv (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- size_t size,
- off_t offset,
- uint32_t flags, dict_t *xdata);
-
-int32_t default_writev (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- struct iovec *vector,
- int32_t count,
- off_t offset,
- uint32_t flags,
- struct iobref *iobref, dict_t *xdata);
-
-int32_t default_flush (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd, dict_t *xdata);
+int32_t
+default_link(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc,
+ dict_t *xdata);
-int32_t default_fsync (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- int32_t datasync, dict_t *xdata);
-
-int32_t default_opendir (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc, fd_t *fd, dict_t *xdata);
-
-int32_t default_fsyncdir (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- int32_t datasync, dict_t *xdata);
-
-int32_t default_statfs (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc, dict_t *xdata);
-
-int32_t default_setxattr (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc,
- dict_t *dict,
- int32_t flags, dict_t *xdata);
-
-int32_t default_getxattr (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc,
- const char *name, dict_t *xdata);
-
-int32_t default_fsetxattr (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- dict_t *dict,
- int32_t flags, dict_t *xdata);
-
-int32_t default_fgetxattr (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- const char *name, dict_t *xdata);
+int32_t
+default_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags,
+ mode_t mode, mode_t umask, fd_t *fd, dict_t *xdata);
-int32_t default_removexattr (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc,
- const char *name, dict_t *xdata);
-
-int32_t default_fremovexattr (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- const char *name, dict_t *xdata);
-
-int32_t default_lk (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- int32_t cmd,
- struct gf_flock *flock, dict_t *xdata);
-
-int32_t default_inodelk (call_frame_t *frame, xlator_t *this,
- const char *volume, loc_t *loc, int32_t cmd,
- struct gf_flock *flock, dict_t *xdata);
-
-int32_t default_finodelk (call_frame_t *frame, xlator_t *this,
- const char *volume, fd_t *fd, int32_t cmd,
- struct gf_flock *flock, dict_t *xdata);
-
-int32_t default_entrylk (call_frame_t *frame, xlator_t *this,
- const char *volume, loc_t *loc, const char *basename,
- entrylk_cmd cmd, entrylk_type type, dict_t *xdata);
-
-int32_t default_fentrylk (call_frame_t *frame, xlator_t *this,
- const char *volume, fd_t *fd, const char *basename,
- entrylk_cmd cmd, entrylk_type type, dict_t *xdata);
-
-int32_t default_readdir (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- size_t size, off_t off, dict_t *xdata);
-
-int32_t default_readdirp (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- size_t size, off_t off, dict_t *xdata);
-
-int32_t default_xattrop (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc,
- gf_xattrop_flags_t flags,
- dict_t *dict, dict_t *xdata);
-
-int32_t default_fxattrop (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- gf_xattrop_flags_t flags,
- dict_t *dict, dict_t *xdata);
-
-int32_t default_setattr (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc,
- struct iatt *stbuf,
- int32_t valid, dict_t *xdata);
-
-int32_t default_fsetattr (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- struct iatt *stbuf,
- int32_t valid, dict_t *xdata);
-
-int32_t default_fallocate(call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- int32_t keep_size, off_t offset,
- size_t len, dict_t *xdata);
-
-int32_t default_discard(call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- off_t offset,
- size_t len, dict_t *xdata);
-
-int32_t default_zerofill(call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- off_t offset,
- off_t len, dict_t *xdata);
-
-int32_t default_ipc (call_frame_t *frame, xlator_t *this, int32_t op,
- dict_t *xdata);
+int32_t
+default_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags,
+ fd_t *fd, dict_t *xdata);
-int32_t default_seek (call_frame_t *frame, xlator_t *this, fd_t *fd,
- off_t offset, gf_seek_what_t what, dict_t *xdata);
+int32_t
+default_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
+ off_t offset, uint32_t flags, dict_t *xdata);
-int32_t default_lease (call_frame_t *frame, xlator_t *this, loc_t *loc,
- struct gf_lease *lease, dict_t *xdata);
+int32_t
+default_writev(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ struct iovec *vector, int32_t count, off_t offset,
+ uint32_t flags, struct iobref *iobref, dict_t *xdata);
int32_t
-default_getactivelk (call_frame_t *frame, xlator_t *this, loc_t *loc,
- dict_t *xdata);
+default_flush(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata);
int32_t
-default_setactivelk (call_frame_t *frame, xlator_t *this, loc_t *loc,
- lock_migration_info_t *locklist, dict_t *xdata);
+default_fsync(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t datasync,
+ dict_t *xdata);
int32_t
-default_put (call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode,
- mode_t umask, uint32_t flags, struct iovec *vector, int32_t count,
- off_t off, struct iobref *iobref, dict_t *xattr, dict_t *xdata);
+default_opendir(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd,
+ dict_t *xdata);
-int32_t default_icreate (call_frame_t *frame, xlator_t *this,
- loc_t *loc, mode_t mode, dict_t *xdata);
+int32_t
+default_fsyncdir(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ int32_t datasync, dict_t *xdata);
-int32_t default_namelink (call_frame_t *frame,
- xlator_t *this, loc_t *loc, dict_t *xdata);
+int32_t
+default_statfs(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata);
-/* Resume */
-int32_t default_getspec_resume (call_frame_t *frame,
- xlator_t *this,
- const char *key,
- int32_t flag);
+int32_t
+default_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict,
+ int32_t flags, dict_t *xdata);
-int32_t default_rchecksum_resume (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd, off_t offset,
- int32_t len, dict_t *xdata);
+int32_t
+default_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ const char *name, dict_t *xdata);
-/* FileSystem operations */
-int32_t default_lookup_resume (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc,
- dict_t *xdata);
+int32_t
+default_fsetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict,
+ int32_t flags, dict_t *xdata);
-int32_t default_stat_resume (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc, dict_t *xdata);
+int32_t
+default_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ const char *name, dict_t *xdata);
-int32_t default_fstat_resume (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd, dict_t *xdata);
+int32_t
+default_removexattr(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ const char *name, dict_t *xdata);
-int32_t default_truncate_resume (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc,
- off_t offset, dict_t *xdata);
+int32_t
+default_fremovexattr(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ const char *name, dict_t *xdata);
-int32_t default_ftruncate_resume (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- off_t offset, dict_t *xdata);
+int32_t
+default_lk(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd,
+ struct gf_flock *flock, dict_t *xdata);
-int32_t default_access_resume (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc,
- int32_t mask, dict_t *xdata);
+int32_t
+default_inodelk(call_frame_t *frame, xlator_t *this, const char *volume,
+ loc_t *loc, int32_t cmd, struct gf_flock *flock, dict_t *xdata);
-int32_t default_readlink_resume (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc,
- size_t size, dict_t *xdata);
+int32_t
+default_finodelk(call_frame_t *frame, xlator_t *this, const char *volume,
+ fd_t *fd, int32_t cmd, struct gf_flock *flock, dict_t *xdata);
-int32_t default_mknod_resume (call_frame_t *frame, xlator_t *this, loc_t *loc,
- mode_t mode, dev_t rdev, mode_t umask,
- dict_t *xdata);
+int32_t
+default_entrylk(call_frame_t *frame, xlator_t *this, const char *volume,
+ loc_t *loc, const char *basename, entrylk_cmd cmd,
+ entrylk_type type, dict_t *xdata);
-int32_t default_mkdir_resume (call_frame_t *frame, xlator_t *this, loc_t *loc,
- mode_t mode, mode_t umask, dict_t *xdata);
+int32_t
+default_fentrylk(call_frame_t *frame, xlator_t *this, const char *volume,
+ fd_t *fd, const char *basename, entrylk_cmd cmd,
+ entrylk_type type, dict_t *xdata);
-int32_t default_unlink_resume (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc, int xflag, dict_t *xdata);
+int32_t
+default_readdir(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
+ off_t off, dict_t *xdata);
-int32_t default_rmdir_resume (call_frame_t *frame, xlator_t *this,
- loc_t *loc, int xflag, dict_t *xdata);
+int32_t
+default_readdirp(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
+ off_t off, dict_t *xdata);
-int32_t default_symlink_resume (call_frame_t *frame, xlator_t *this,
- const char *linkpath, loc_t *loc, mode_t umask,
- dict_t *xdata);
+int32_t
+default_xattrop(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ gf_xattrop_flags_t flags, dict_t *dict, dict_t *xdata);
-int32_t default_rename_resume (call_frame_t *frame,
- xlator_t *this,
- loc_t *oldloc,
- loc_t *newloc, dict_t *xdata);
+int32_t
+default_fxattrop(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ gf_xattrop_flags_t flags, dict_t *dict, dict_t *xdata);
-int32_t default_link_resume (call_frame_t *frame,
- xlator_t *this,
- loc_t *oldloc,
- loc_t *newloc, dict_t *xdata);
+int32_t
+default_setattr(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ struct iatt *stbuf, int32_t valid, dict_t *xdata);
-int32_t default_create_resume (call_frame_t *frame, xlator_t *this,
- loc_t *loc, int32_t flags, mode_t mode,
- mode_t umask, fd_t *fd, dict_t *xdata);
-
-int32_t default_open_resume (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc,
- int32_t flags, fd_t *fd, dict_t *xdata);
-
-int32_t default_readv_resume (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- size_t size,
- off_t offset, uint32_t flags, dict_t *xdata);
-
-int32_t default_writev_resume (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- struct iovec *vector,
- int32_t count,
- off_t offset, uint32_t flags,
- struct iobref *iobref, dict_t *xdata);
-
-int32_t default_flush_resume (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd, dict_t *xdata);
+int32_t
+default_fsetattr(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ struct iatt *stbuf, int32_t valid, dict_t *xdata);
-int32_t default_fsync_resume (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- int32_t datasync, dict_t *xdata);
-
-int32_t default_opendir_resume (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc, fd_t *fd, dict_t *xdata);
-
-int32_t default_fsyncdir_resume (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- int32_t datasync, dict_t *xdata);
-
-int32_t default_statfs_resume (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc, dict_t *xdata);
-
-int32_t default_setxattr_resume (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc,
- dict_t *dict,
- int32_t flags, dict_t *xdata);
-
-int32_t default_getxattr_resume (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc,
- const char *name, dict_t *xdata);
-
-int32_t default_fsetxattr_resume (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- dict_t *dict,
- int32_t flags, dict_t *xdata);
-
-int32_t default_fgetxattr_resume (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- const char *name, dict_t *xdata);
+int32_t
+default_fallocate(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ int32_t keep_size, off_t offset, size_t len, dict_t *xdata);
-int32_t default_removexattr_resume (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc,
- const char *name, dict_t *xdata);
-
-int32_t default_fremovexattr_resume (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- const char *name, dict_t *xdata);
-
-int32_t default_lk_resume (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- int32_t cmd,
- struct gf_flock *flock, dict_t *xdata);
-
-int32_t default_inodelk_resume (call_frame_t *frame, xlator_t *this,
- const char *volume, loc_t *loc, int32_t cmd,
- struct gf_flock *flock, dict_t *xdata);
-
-int32_t default_finodelk_resume (call_frame_t *frame, xlator_t *this,
- const char *volume, fd_t *fd, int32_t cmd,
- struct gf_flock *flock, dict_t *xdata);
-
-int32_t default_entrylk_resume (call_frame_t *frame, xlator_t *this,
- const char *volume, loc_t *loc, const char *basename,
- entrylk_cmd cmd, entrylk_type type, dict_t *xdata);
-
-int32_t default_fentrylk_resume (call_frame_t *frame, xlator_t *this,
- const char *volume, fd_t *fd, const char *basename,
- entrylk_cmd cmd, entrylk_type type, dict_t *xdata);
-
-int32_t default_readdir_resume (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- size_t size, off_t off, dict_t *xdata);
-
-int32_t default_readdirp_resume (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- size_t size, off_t off, dict_t *xdata);
-
-int32_t default_xattrop_resume (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc,
- gf_xattrop_flags_t flags,
- dict_t *dict, dict_t *xdata);
-
-int32_t default_fxattrop_resume (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- gf_xattrop_flags_t flags,
- dict_t *dict, dict_t *xdata);
-int32_t default_rchecksum_resume (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd, off_t offset,
- int32_t len, dict_t *xdata);
-
-int32_t default_setattr_resume (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc,
- struct iatt *stbuf,
- int32_t valid, dict_t *xdata);
-
-int32_t default_fsetattr_resume (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- struct iatt *stbuf,
- int32_t valid, dict_t *xdata);
-
-int32_t default_fallocate_resume(call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- int32_t keep_size, off_t offset,
- size_t len, dict_t *xdata);
-
-int32_t default_discard_resume(call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- off_t offset,
- size_t len, dict_t *xdata);
-
-int32_t default_zerofill_resume(call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- off_t offset,
- off_t len, dict_t *xdata);
-
-int32_t default_ipc_resume (call_frame_t *frame, xlator_t *this,
- int32_t op, dict_t *xdata);
-
-int32_t default_seek_resume (call_frame_t *frame, xlator_t *this, fd_t *fd,
- off_t offset, gf_seek_what_t what, dict_t *xdata);
-
-int32_t default_lease_resume (call_frame_t *frame, xlator_t *this, loc_t *loc,
- struct gf_lease *lease, dict_t *xdata);
-
-int32_t
-default_getactivelk_resume (call_frame_t *frame, xlator_t *this, loc_t *loc,
- dict_t *xdata);
+int32_t
+default_discard(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
+ size_t len, dict_t *xdata);
int32_t
-default_setactivelk_resume (call_frame_t *frame, xlator_t *this, loc_t *loc,
- lock_migration_info_t *locklist, dict_t *xdata);
+default_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
+ off_t len, dict_t *xdata);
int32_t
-default_put_resume (call_frame_t *frame, xlator_t *this, loc_t *loc,
- mode_t mode, mode_t umask, uint32_t flags,
- struct iovec *vector, int32_t count, off_t off,
- struct iobref *iobref, dict_t *xattr, dict_t *xdata);
+default_ipc(call_frame_t *frame, xlator_t *this, int32_t op, dict_t *xdata);
-/* _cbk_resume */
+int32_t
+default_seek(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
+ gf_seek_what_t what, dict_t *xdata);
int32_t
-default_lookup_cbk_resume (call_frame_t * frame, void *cookie,
- xlator_t * this, int32_t op_ret, int32_t op_errno,
- inode_t * inode, struct iatt *buf, dict_t * xdata,
- struct iatt *postparent);
+default_lease(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ struct gf_lease *lease, dict_t *xdata);
int32_t
-default_stat_cbk_resume (call_frame_t * frame, void *cookie, xlator_t * this,
- int32_t op_ret, int32_t op_errno, struct iatt *buf,
- dict_t * xdata);
+default_getactivelk(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ dict_t *xdata);
+int32_t
+default_setactivelk(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ lock_migration_info_t *locklist, dict_t *xdata);
int32_t
-default_truncate_cbk_resume (call_frame_t * frame, void *cookie,
- xlator_t * this, int32_t op_ret,
- int32_t op_errno, struct iatt *prebuf,
- struct iatt *postbuf, dict_t * xdata);
+default_put(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode,
+ mode_t umask, uint32_t flags, struct iovec *vector, int32_t count,
+ off_t off, struct iobref *iobref, dict_t *xattr, dict_t *xdata);
int32_t
-default_ftruncate_cbk_resume (call_frame_t * frame, void *cookie,
- xlator_t * this, int32_t op_ret,
- int32_t op_errno, struct iatt *prebuf,
- struct iatt *postbuf, dict_t * xdata);
+default_icreate(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode,
+ dict_t *xdata);
int32_t
-default_access_cbk_resume (call_frame_t * frame, void *cookie,
- xlator_t * this, int32_t op_ret, int32_t op_errno,
- dict_t * xdata);
+default_namelink(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ dict_t *xdata);
+/* Resume */
int32_t
-default_readlink_cbk_resume (call_frame_t * frame, void *cookie,
- xlator_t * this, int32_t op_ret,
- int32_t op_errno, const char *path,
- struct iatt *buf, dict_t * xdata);
+default_getspec_resume(call_frame_t *frame, xlator_t *this, const char *key,
+ int32_t flag);
+int32_t
+default_rchecksum_resume(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ off_t offset, int32_t len, dict_t *xdata);
+/* FileSystem operations */
int32_t
-default_mknod_cbk_resume (call_frame_t * frame, void *cookie, xlator_t * this,
- int32_t op_ret, int32_t op_errno, inode_t * inode,
- struct iatt *buf, struct iatt *preparent,
- struct iatt *postparent, dict_t * xdata);
+default_lookup_resume(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ dict_t *xdata);
int32_t
-default_mkdir_cbk_resume (call_frame_t * frame, void *cookie, xlator_t * this,
- int32_t op_ret, int32_t op_errno, inode_t * inode,
- struct iatt *buf, struct iatt *preparent,
- struct iatt *postparent, dict_t * xdata);
+default_stat_resume(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ dict_t *xdata);
int32_t
-default_unlink_cbk_resume (call_frame_t * frame, void *cookie,
- xlator_t * this, int32_t op_ret, int32_t op_errno,
- struct iatt *preparent, struct iatt *postparent,
- dict_t * xdata);
+default_fstat_resume(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ dict_t *xdata);
int32_t
-default_rmdir_cbk_resume (call_frame_t * frame, void *cookie, xlator_t * this,
- int32_t op_ret, int32_t op_errno,
- struct iatt *preparent, struct iatt *postparent,
- dict_t * xdata);
+default_truncate_resume(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ off_t offset, dict_t *xdata);
+int32_t
+default_ftruncate_resume(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ off_t offset, dict_t *xdata);
int32_t
-default_symlink_cbk_resume (call_frame_t * frame, void *cookie,
- xlator_t * this, int32_t op_ret, int32_t op_errno,
- inode_t * inode, struct iatt *buf,
- struct iatt *preparent, struct iatt *postparent,
- dict_t * xdata);
+default_access_resume(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ int32_t mask, dict_t *xdata);
+int32_t
+default_readlink_resume(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ size_t size, dict_t *xdata);
int32_t
-default_rename_cbk_resume (call_frame_t * frame, void *cookie,
- xlator_t * this, int32_t op_ret, int32_t op_errno,
- struct iatt *buf, struct iatt *preoldparent,
- struct iatt *postoldparent,
- struct iatt *prenewparent,
- struct iatt *postnewparent, dict_t * xdata);
+default_mknod_resume(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ mode_t mode, dev_t rdev, mode_t umask, dict_t *xdata);
+int32_t
+default_mkdir_resume(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ mode_t mode, mode_t umask, dict_t *xdata);
int32_t
-default_link_cbk_resume (call_frame_t * frame, void *cookie, xlator_t * this,
- int32_t op_ret, int32_t op_errno, inode_t * inode,
- struct iatt *buf, struct iatt *preparent,
- struct iatt *postparent, dict_t * xdata);
+default_unlink_resume(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ int xflag, dict_t *xdata);
+int32_t
+default_rmdir_resume(call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag,
+ dict_t *xdata);
int32_t
-default_create_cbk_resume (call_frame_t * frame, void *cookie,
- xlator_t * this, int32_t op_ret, int32_t op_errno,
- fd_t * fd, inode_t * inode, struct iatt *buf,
- struct iatt *preparent, struct iatt *postparent,
- dict_t * xdata);
+default_symlink_resume(call_frame_t *frame, xlator_t *this,
+ const char *linkpath, loc_t *loc, mode_t umask,
+ dict_t *xdata);
int32_t
-default_open_cbk_resume (call_frame_t * frame, void *cookie, xlator_t * this,
- int32_t op_ret, int32_t op_errno, fd_t * fd,
- dict_t * xdata);
+default_rename_resume(call_frame_t *frame, xlator_t *this, loc_t *oldloc,
+ loc_t *newloc, dict_t *xdata);
int32_t
-default_readv_cbk_resume (call_frame_t * frame, void *cookie, xlator_t * this,
- int32_t op_ret, int32_t op_errno,
- struct iovec *vector, int32_t count,
- struct iatt *stbuf, struct iobref *iobref,
- dict_t * xdata);
+default_link_resume(call_frame_t *frame, xlator_t *this, loc_t *oldloc,
+ loc_t *newloc, dict_t *xdata);
+int32_t
+default_create_resume(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ int32_t flags, mode_t mode, mode_t umask, fd_t *fd,
+ dict_t *xdata);
int32_t
-default_writev_cbk_resume (call_frame_t * frame, void *cookie,
- xlator_t * this, int32_t op_ret, int32_t op_errno,
- struct iatt *prebuf, struct iatt *postbuf,
- dict_t * xdata);
+default_open_resume(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ int32_t flags, fd_t *fd, dict_t *xdata);
+int32_t
+default_readv_resume(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
+ off_t offset, uint32_t flags, dict_t *xdata);
int32_t
-default_flush_cbk_resume (call_frame_t * frame, void *cookie, xlator_t * this,
- int32_t op_ret, int32_t op_errno, dict_t * xdata);
+default_writev_resume(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ struct iovec *vector, int32_t count, off_t offset,
+ uint32_t flags, struct iobref *iobref, dict_t *xdata);
+int32_t
+default_flush_resume(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ dict_t *xdata);
+int32_t
+default_fsync_resume(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ int32_t datasync, dict_t *xdata);
int32_t
-default_fsync_cbk_resume (call_frame_t * frame, void *cookie, xlator_t * this,
- int32_t op_ret, int32_t op_errno,
- struct iatt *prebuf, struct iatt *postbuf,
- dict_t * xdata);
+default_opendir_resume(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ fd_t *fd, dict_t *xdata);
int32_t
-default_fstat_cbk_resume (call_frame_t * frame, void *cookie, xlator_t * this,
- int32_t op_ret, int32_t op_errno, struct iatt *buf,
- dict_t * xdata);
+default_fsyncdir_resume(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ int32_t datasync, dict_t *xdata);
int32_t
-default_opendir_cbk_resume (call_frame_t * frame, void *cookie,
- xlator_t * this, int32_t op_ret, int32_t op_errno,
- fd_t * fd, dict_t * xdata);
+default_statfs_resume(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ dict_t *xdata);
int32_t
-default_fsyncdir_cbk_resume (call_frame_t * frame, void *cookie,
- xlator_t * this, int32_t op_ret,
- int32_t op_errno, dict_t * xdata);
+default_setxattr_resume(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ dict_t *dict, int32_t flags, dict_t *xdata);
int32_t
-default_statfs_cbk_resume (call_frame_t * frame, void *cookie,
- xlator_t * this, int32_t op_ret, int32_t op_errno,
- struct statvfs *buf, dict_t * xdata);
+default_getxattr_resume(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ const char *name, dict_t *xdata);
+int32_t
+default_fsetxattr_resume(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ dict_t *dict, int32_t flags, dict_t *xdata);
int32_t
-default_setxattr_cbk_resume (call_frame_t * frame, void *cookie,
- xlator_t * this, int32_t op_ret,
- int32_t op_errno, dict_t * xdata);
+default_fgetxattr_resume(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ const char *name, dict_t *xdata);
+int32_t
+default_removexattr_resume(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ const char *name, dict_t *xdata);
int32_t
-default_fsetxattr_cbk_resume (call_frame_t * frame, void *cookie,
- xlator_t * this, int32_t op_ret,
- int32_t op_errno, dict_t * xdata);
+default_fremovexattr_resume(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ const char *name, dict_t *xdata);
+int32_t
+default_lk_resume(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd,
+ struct gf_flock *flock, dict_t *xdata);
+int32_t
+default_inodelk_resume(call_frame_t *frame, xlator_t *this, const char *volume,
+ loc_t *loc, int32_t cmd, struct gf_flock *flock,
+ dict_t *xdata);
int32_t
-default_fgetxattr_cbk_resume (call_frame_t * frame, void *cookie,
- xlator_t * this, int32_t op_ret,
- int32_t op_errno, dict_t * dict,
- dict_t * xdata);
+default_finodelk_resume(call_frame_t *frame, xlator_t *this, const char *volume,
+ fd_t *fd, int32_t cmd, struct gf_flock *flock,
+ dict_t *xdata);
+int32_t
+default_entrylk_resume(call_frame_t *frame, xlator_t *this, const char *volume,
+ loc_t *loc, const char *basename, entrylk_cmd cmd,
+ entrylk_type type, dict_t *xdata);
int32_t
-default_getxattr_cbk_resume (call_frame_t * frame, void *cookie,
- xlator_t * this, int32_t op_ret,
- int32_t op_errno, dict_t * dict, dict_t * xdata);
+default_fentrylk_resume(call_frame_t *frame, xlator_t *this, const char *volume,
+ fd_t *fd, const char *basename, entrylk_cmd cmd,
+ entrylk_type type, dict_t *xdata);
int32_t
-default_xattrop_cbk_resume (call_frame_t * frame, void *cookie,
- xlator_t * this, int32_t op_ret, int32_t op_errno,
- dict_t * dict, dict_t * xdata);
+default_readdir_resume(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ size_t size, off_t off, dict_t *xdata);
int32_t
-default_fxattrop_cbk_resume (call_frame_t * frame, void *cookie,
- xlator_t * this, int32_t op_ret,
- int32_t op_errno, dict_t * dict, dict_t * xdata);
+default_readdirp_resume(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ size_t size, off_t off, dict_t *xdata);
+int32_t
+default_xattrop_resume(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ gf_xattrop_flags_t flags, dict_t *dict, dict_t *xdata);
int32_t
-default_removexattr_cbk_resume (call_frame_t * frame, void *cookie,
- xlator_t * this, int32_t op_ret,
- int32_t op_errno, dict_t * xdata);
+default_fxattrop_resume(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ gf_xattrop_flags_t flags, dict_t *dict, dict_t *xdata);
+int32_t
+default_rchecksum_resume(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ off_t offset, int32_t len, dict_t *xdata);
int32_t
-default_fremovexattr_cbk_resume (call_frame_t * frame, void *cookie,
- xlator_t * this, int32_t op_ret,
- int32_t op_errno, dict_t * xdata);
+default_setattr_resume(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ struct iatt *stbuf, int32_t valid, dict_t *xdata);
int32_t
-default_lk_cbk_resume (call_frame_t * frame, void *cookie, xlator_t * this,
- int32_t op_ret, int32_t op_errno,
- struct gf_flock *lock, dict_t * xdata);
+default_fsetattr_resume(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ struct iatt *stbuf, int32_t valid, dict_t *xdata);
int32_t
-default_inodelk_cbk_resume (call_frame_t * frame, void *cookie,
- xlator_t * this, int32_t op_ret, int32_t op_errno,
- dict_t * xdata);
+default_fallocate_resume(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ int32_t keep_size, off_t offset, size_t len,
+ dict_t *xdata);
+int32_t
+default_discard_resume(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ off_t offset, size_t len, dict_t *xdata);
int32_t
-default_finodelk_cbk_resume (call_frame_t * frame, void *cookie,
- xlator_t * this, int32_t op_ret,
- int32_t op_errno, dict_t * xdata);
+default_zerofill_resume(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ off_t offset, off_t len, dict_t *xdata);
int32_t
-default_entrylk_cbk_resume (call_frame_t * frame, void *cookie,
- xlator_t * this, int32_t op_ret, int32_t op_errno,
- dict_t * xdata);
+default_ipc_resume(call_frame_t *frame, xlator_t *this, int32_t op,
+ dict_t *xdata);
int32_t
-default_fentrylk_cbk_resume (call_frame_t * frame, void *cookie,
- xlator_t * this, int32_t op_ret,
- int32_t op_errno, dict_t * xdata);
+default_seek_resume(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
+ gf_seek_what_t what, dict_t *xdata);
+int32_t
+default_lease_resume(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ struct gf_lease *lease, dict_t *xdata);
int32_t
-default_rchecksum_cbk_resume (call_frame_t * frame, void *cookie,
- xlator_t * this, int32_t op_ret,
- int32_t op_errno, uint32_t weak_checksum,
- uint8_t * strong_checksum, dict_t * xdata);
+default_getactivelk_resume(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ dict_t *xdata);
+int32_t
+default_setactivelk_resume(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ lock_migration_info_t *locklist, dict_t *xdata);
int32_t
-default_readdir_cbk_resume (call_frame_t * frame, void *cookie,
- xlator_t * this, int32_t op_ret, int32_t op_errno,
- gf_dirent_t * entries, dict_t * xdata);
+default_put_resume(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode,
+ mode_t umask, uint32_t flags, struct iovec *vector,
+ int32_t count, off_t off, struct iobref *iobref,
+ dict_t *xattr, dict_t *xdata);
+/* _cbk_resume */
int32_t
-default_readdirp_cbk_resume (call_frame_t * frame, void *cookie,
- xlator_t * this, int32_t op_ret,
- int32_t op_errno, gf_dirent_t * entries,
- dict_t * xdata);
+default_lookup_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, inode_t *inode,
+ struct iatt *buf, dict_t *xdata,
+ struct iatt *postparent);
int32_t
-default_setattr_cbk_resume (call_frame_t * frame, void *cookie,
- xlator_t * this, int32_t op_ret, int32_t op_errno,
- struct iatt *statpre, struct iatt *statpost,
- dict_t * xdata);
+default_stat_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, struct iatt *buf,
+ dict_t *xdata);
int32_t
-default_fsetattr_cbk_resume (call_frame_t * frame, void *cookie,
- xlator_t * this, int32_t op_ret,
- int32_t op_errno, struct iatt *statpre,
- struct iatt *statpost, dict_t * xdata);
+default_truncate_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno,
+ struct iatt *prebuf, struct iatt *postbuf,
+ dict_t *xdata);
-int32_t default_fallocate_cbk_resume (call_frame_t * frame, void *cookie,
- xlator_t * this, int32_t op_ret,
- int32_t op_errno, struct iatt *pre,
- struct iatt *post, dict_t * xdata);
+int32_t
+default_ftruncate_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno,
+ struct iatt *prebuf, struct iatt *postbuf,
+ dict_t *xdata);
-int32_t default_discard_cbk_resume (call_frame_t * frame, void *cookie,
- xlator_t * this, int32_t op_ret,
- int32_t op_errno, struct iatt *pre,
- struct iatt *post, dict_t * xdata);
+int32_t
+default_access_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *xdata);
-int32_t default_zerofill_cbk_resume (call_frame_t * frame, void *cookie,
- xlator_t * this, int32_t op_ret,
- int32_t op_errno, struct iatt *pre,
- struct iatt *post, dict_t * xdata);
int32_t
-default_ipc_cbk_resume (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, dict_t *xdata);
+default_readlink_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, const char *path,
+ struct iatt *buf, dict_t *xdata);
int32_t
-default_seek_cbk_resume (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, off_t offset,
- dict_t *xdata);
+default_mknod_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, inode_t *inode,
+ struct iatt *buf, struct iatt *preparent,
+ struct iatt *postparent, dict_t *xdata);
int32_t
-default_getspec_cbk_resume (call_frame_t * frame, void *cookie,
- xlator_t * this, int32_t op_ret, int32_t op_errno,
- char *spec_data);
+default_mkdir_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, inode_t *inode,
+ struct iatt *buf, struct iatt *preparent,
+ struct iatt *postparent, dict_t *xdata);
int32_t
-default_lease_cbk_resume (call_frame_t *frame, void *cookie, xlator_t *this,
+default_unlink_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno,
- struct gf_lease *lease, dict_t *xdata);
+ struct iatt *preparent, struct iatt *postparent,
+ dict_t *xdata);
int32_t
-default_getactivelk_cbk_resume (call_frame_t *frame, void *cookie,
- xlator_t *this, int32_t op_ret,
- int32_t op_errno,
- lock_migration_info_t *locklist,
- dict_t *xdata);
+default_rmdir_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno,
+ struct iatt *preparent, struct iatt *postparent,
+ dict_t *xdata);
int32_t
-default_setactivelk_cbk_resume (call_frame_t *frame, void *cookie,
- xlator_t *this, int32_t op_ret,
- int32_t op_errno, dict_t *xdata);
+default_symlink_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, inode_t *inode,
+ struct iatt *buf, struct iatt *preparent,
+ struct iatt *postparent, dict_t *xdata);
+
+int32_t
+default_rename_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, struct iatt *buf,
+ struct iatt *preoldparent, struct iatt *postoldparent,
+ struct iatt *prenewparent, struct iatt *postnewparent,
+ dict_t *xdata);
int32_t
-default_put_cbk_resume (call_frame_t *frame, void *cookie, xlator_t *this,
+default_link_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno, inode_t *inode,
struct iatt *buf, struct iatt *preparent,
struct iatt *postparent, dict_t *xdata);
int32_t
-default_icreate_resume (call_frame_t *frame, xlator_t *this,
- loc_t *loc, mode_t mode, dict_t *xdata);
+default_create_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, fd_t *fd,
+ inode_t *inode, struct iatt *buf,
+ struct iatt *preparent, struct iatt *postparent,
+ dict_t *xdata);
int32_t
-default_namelink_resume (call_frame_t *frame,
- xlator_t *this, loc_t *loc, dict_t *xdata);
+default_open_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, fd_t *fd,
+ dict_t *xdata);
-/* _CBK */
int32_t
-default_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, inode_t *inode,
- struct iatt *buf, dict_t *xdata, struct iatt *postparent);
+default_readv_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, struct iovec *vector,
+ int32_t count, struct iatt *stbuf,
+ struct iobref *iobref, dict_t *xdata);
int32_t
-default_stat_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct iatt *buf, dict_t *xdata);
+default_writev_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, struct iatt *prebuf,
+ struct iatt *postbuf, dict_t *xdata);
+int32_t
+default_flush_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *xdata);
int32_t
-default_truncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct iatt *prebuf,
- struct iatt *postbuf, dict_t *xdata);
+default_fsync_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, struct iatt *prebuf,
+ struct iatt *postbuf, dict_t *xdata);
int32_t
-default_ftruncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct iatt *prebuf,
- struct iatt *postbuf, dict_t *xdata);
+default_fstat_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, struct iatt *buf,
+ dict_t *xdata);
int32_t
-default_access_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, dict_t *xdata);
+default_opendir_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, fd_t *fd,
+ dict_t *xdata);
int32_t
-default_readlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, const char *path,
- struct iatt *buf, dict_t *xdata);
+default_fsyncdir_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *xdata);
+int32_t
+default_statfs_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, struct statvfs *buf,
+ dict_t *xdata);
int32_t
-default_mknod_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, inode_t *inode,
- struct iatt *buf, struct iatt *preparent,
- struct iatt *postparent, dict_t *xdata);
+default_setxattr_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *xdata);
int32_t
-default_mkdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, inode_t *inode,
- struct iatt *buf, struct iatt *preparent,
- struct iatt *postparent, dict_t *xdata);
+default_fsetxattr_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *xdata);
int32_t
-default_unlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct iatt *preparent,
- struct iatt *postparent, dict_t *xdata);
+default_fgetxattr_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *dict,
+ dict_t *xdata);
int32_t
-default_rmdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct iatt *preparent,
- struct iatt *postparent, dict_t *xdata);
+default_getxattr_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *dict,
+ dict_t *xdata);
+int32_t
+default_xattrop_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *dict,
+ dict_t *xdata);
int32_t
-default_symlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, inode_t *inode,
- struct iatt *buf, struct iatt *preparent,
- struct iatt *postparent, dict_t *xdata);
+default_fxattrop_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *dict,
+ dict_t *xdata);
+int32_t
+default_removexattr_cbk_resume(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret, int32_t op_errno,
+ dict_t *xdata);
int32_t
-default_rename_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct iatt *buf,
- struct iatt *preoldparent, struct iatt *postoldparent,
- struct iatt *prenewparent, struct iatt *postnewparent, dict_t *xdata);
+default_fremovexattr_cbk_resume(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, dict_t *xdata);
+int32_t
+default_lk_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, struct gf_flock *lock,
+ dict_t *xdata);
int32_t
-default_link_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, inode_t *inode,
- struct iatt *buf, struct iatt *preparent,
- struct iatt *postparent, dict_t *xdata);
+default_inodelk_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *xdata);
+int32_t
+default_finodelk_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *xdata);
int32_t
-default_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode,
- struct iatt *buf, struct iatt *preparent,
- struct iatt *postparent, dict_t *xdata);
+default_entrylk_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *xdata);
int32_t
-default_open_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata);
+default_fentrylk_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *xdata);
int32_t
-default_readv_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct iovec *vector,
- int32_t count, struct iatt *stbuf, struct iobref *iobref, dict_t *xdata);
+default_rchecksum_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno,
+ uint32_t weak_checksum, uint8_t *strong_checksum,
+ dict_t *xdata);
+int32_t
+default_readdir_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno,
+ gf_dirent_t *entries, dict_t *xdata);
int32_t
-default_writev_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct iatt *prebuf,
- struct iatt *postbuf, dict_t *xdata);
+default_readdirp_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno,
+ gf_dirent_t *entries, dict_t *xdata);
+int32_t
+default_setattr_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno,
+ struct iatt *statpre, struct iatt *statpost,
+ dict_t *xdata);
int32_t
-default_flush_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, dict_t *xdata);
+default_fsetattr_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno,
+ struct iatt *statpre, struct iatt *statpost,
+ dict_t *xdata);
+int32_t
+default_fallocate_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, struct iatt *pre,
+ struct iatt *post, dict_t *xdata);
+int32_t
+default_discard_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, struct iatt *pre,
+ struct iatt *post, dict_t *xdata);
int32_t
-default_fsync_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct iatt *prebuf,
- struct iatt *postbuf, dict_t *xdata);
+default_zerofill_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, struct iatt *pre,
+ struct iatt *post, dict_t *xdata);
+int32_t
+default_ipc_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *xdata);
int32_t
-default_fstat_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct iatt *buf, dict_t *xdata);
+default_seek_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, off_t offset,
+ dict_t *xdata);
int32_t
-default_opendir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata);
+default_getspec_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, char *spec_data);
int32_t
-default_fsyncdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, dict_t *xdata);
+default_lease_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno,
+ struct gf_lease *lease, dict_t *xdata);
int32_t
-default_statfs_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct statvfs *buf, dict_t *xdata);
+default_getactivelk_cbk_resume(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret, int32_t op_errno,
+ lock_migration_info_t *locklist, dict_t *xdata);
+int32_t
+default_setactivelk_cbk_resume(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret, int32_t op_errno,
+ dict_t *xdata);
int32_t
-default_setxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, dict_t *xdata);
+default_put_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, inode_t *inode,
+ struct iatt *buf, struct iatt *preparent,
+ struct iatt *postparent, dict_t *xdata);
+int32_t
+default_icreate_resume(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ mode_t mode, dict_t *xdata);
int32_t
-default_fsetxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, dict_t *xdata);
+default_namelink_resume(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ dict_t *xdata);
+/* _CBK */
+int32_t
+default_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, inode_t *inode,
+ struct iatt *buf, dict_t *xdata, struct iatt *postparent);
+int32_t
+default_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, struct iatt *buf,
+ dict_t *xdata);
int32_t
-default_fgetxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata);
+default_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, struct iatt *prebuf,
+ struct iatt *postbuf, dict_t *xdata);
+int32_t
+default_ftruncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, struct iatt *prebuf,
+ struct iatt *postbuf, dict_t *xdata);
int32_t
-default_getxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata);
+default_access_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *xdata);
int32_t
-default_xattrop_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata);
+default_readlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, const char *path,
+ struct iatt *buf, dict_t *xdata);
int32_t
-default_fxattrop_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata);
+default_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, inode_t *inode,
+ struct iatt *buf, struct iatt *preparent,
+ struct iatt *postparent, dict_t *xdata);
+int32_t
+default_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, inode_t *inode,
+ struct iatt *buf, struct iatt *preparent,
+ struct iatt *postparent, dict_t *xdata);
int32_t
-default_removexattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, dict_t *xdata);
+default_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, struct iatt *preparent,
+ struct iatt *postparent, dict_t *xdata);
int32_t
-default_fremovexattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, dict_t *xdata);
+default_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, struct iatt *preparent,
+ struct iatt *postparent, dict_t *xdata);
int32_t
-default_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct gf_flock *lock, dict_t *xdata);
+default_symlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, inode_t *inode,
+ struct iatt *buf, struct iatt *preparent,
+ struct iatt *postparent, dict_t *xdata);
int32_t
-default_inodelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, dict_t *xdata);
+default_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, struct iatt *buf,
+ struct iatt *preoldparent, struct iatt *postoldparent,
+ struct iatt *prenewparent, struct iatt *postnewparent,
+ dict_t *xdata);
+int32_t
+default_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, inode_t *inode,
+ struct iatt *buf, struct iatt *preparent,
+ struct iatt *postparent, dict_t *xdata);
int32_t
-default_finodelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, dict_t *xdata);
+default_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode,
+ struct iatt *buf, struct iatt *preparent,
+ struct iatt *postparent, dict_t *xdata);
+
+int32_t
+default_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata);
+
+int32_t
+default_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, struct iovec *vector,
+ int32_t count, struct iatt *stbuf, struct iobref *iobref,
+ dict_t *xdata);
int32_t
-default_entrylk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
+default_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, struct iatt *prebuf,
+ struct iatt *postbuf, dict_t *xdata);
+
+int32_t
+default_flush_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *xdata);
+
+int32_t
+default_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, struct iatt *prebuf,
+ struct iatt *postbuf, dict_t *xdata);
+
+int32_t
+default_fstat_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, struct iatt *buf,
+ dict_t *xdata);
+
+int32_t
+default_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata);
+
+int32_t
+default_fsyncdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno, dict_t *xdata);
int32_t
-default_fentrylk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
+default_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, struct statvfs *buf,
+ dict_t *xdata);
+
+int32_t
+default_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *xdata);
+
+int32_t
+default_fsetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno, dict_t *xdata);
+int32_t
+default_fgetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *dict,
+ dict_t *xdata);
int32_t
-default_rchecksum_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, uint32_t weak_checksum,
- uint8_t *strong_checksum, dict_t *xdata);
+default_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *dict,
+ dict_t *xdata);
+int32_t
+default_xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *dict,
+ dict_t *xdata);
int32_t
-default_readdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, gf_dirent_t *entries, dict_t *xdata);
+default_fxattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *dict,
+ dict_t *xdata);
+int32_t
+default_removexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *xdata);
int32_t
-default_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, gf_dirent_t *entries, dict_t *xdata);
+default_fremovexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *xdata);
int32_t
-default_setattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct iatt *statpre,
- struct iatt *statpost, dict_t *xdata);
+default_lk_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, struct gf_flock *lock,
+ dict_t *xdata);
int32_t
-default_fsetattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct iatt *statpre,
- struct iatt *statpost, dict_t *xdata);
+default_inodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *xdata);
-int32_t default_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct iatt *pre,
- struct iatt *post, dict_t *xdata);
+int32_t
+default_finodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *xdata);
-int32_t default_discard_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct iatt *pre,
- struct iatt *post, dict_t *xdata);
+int32_t
+default_entrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *xdata);
-int32_t default_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct iatt *pre,
- struct iatt *post, dict_t *xdata);
+int32_t
+default_fentrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *xdata);
-int32_t default_ipc_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, dict_t *xdata);
+int32_t
+default_rchecksum_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, uint32_t weak_checksum,
+ uint8_t *strong_checksum, dict_t *xdata);
-int32_t default_seek_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, off_t offset,
- dict_t *xdata);
+int32_t
+default_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, gf_dirent_t *entries,
+ dict_t *xdata);
int32_t
-default_getspec_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, char *spec_data);
+default_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, gf_dirent_t *entries,
+ dict_t *xdata);
int32_t
-default_lease_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno,
- struct gf_lease *lease, dict_t *xdata);
+default_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, struct iatt *statpre,
+ struct iatt *statpost, dict_t *xdata);
int32_t
-default_getactivelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno,
- lock_migration_info_t *locklist,
- dict_t *xdata);
+default_fsetattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, struct iatt *statpre,
+ struct iatt *statpost, dict_t *xdata);
int32_t
-default_setactivelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, dict_t *xdata);
+default_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, struct iatt *pre,
+ struct iatt *post, dict_t *xdata);
int32_t
-default_put_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, inode_t *inode,
- struct iatt *buf, struct iatt *preparent,
- struct iatt *postparent, dict_t *xdata);
+default_discard_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, struct iatt *pre,
+ struct iatt *post, dict_t *xdata);
int32_t
-default_icreate_cbk (call_frame_t *frame,
- void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno,
- inode_t *inode, struct iatt *buf, dict_t *xdata);
+default_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, struct iatt *pre,
+ struct iatt *post, dict_t *xdata);
int32_t
-default_namelink_cbk (call_frame_t *frame, void *cookie,
- xlator_t *this, int32_t op_ret,
- int32_t op_errno, struct iatt *prebuf,
- struct iatt *postbuf, dict_t *xdata);
+default_ipc_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *xdata);
+
+int32_t
+default_seek_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, off_t offset, dict_t *xdata);
+
+int32_t
+default_getspec_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, char *spec_data);
+
+int32_t
+default_lease_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, struct gf_lease *lease,
+ dict_t *xdata);
+
+int32_t
+default_getactivelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno,
+ lock_migration_info_t *locklist, dict_t *xdata);
int32_t
-default_lookup_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_setactivelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *xdata);
int32_t
-default_stat_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_put_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, inode_t *inode,
+ struct iatt *buf, struct iatt *preparent,
+ struct iatt *postparent, dict_t *xdata);
+int32_t
+default_icreate_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, inode_t *inode,
+ struct iatt *buf, dict_t *xdata);
int32_t
-default_truncate_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_namelink_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, struct iatt *prebuf,
+ struct iatt *postbuf, dict_t *xdata);
int32_t
-default_ftruncate_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_lookup_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_access_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_stat_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_readlink_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_truncate_failure_cbk(call_frame_t *frame, int32_t op_errno);
+int32_t
+default_ftruncate_failure_cbk(call_frame_t *frame, int32_t op_errno);
+
+int32_t
+default_access_failure_cbk(call_frame_t *frame, int32_t op_errno);
+
+int32_t
+default_readlink_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_mknod_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_mknod_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_mkdir_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_mkdir_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_unlink_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_unlink_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_rmdir_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_rmdir_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_symlink_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_symlink_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_rename_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_rename_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_link_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_link_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_create_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_create_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_open_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_open_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_readv_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_readv_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_writev_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_writev_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_flush_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_flush_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_fsync_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_fsync_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_fstat_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_fstat_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_opendir_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_opendir_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_fsyncdir_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_fsyncdir_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_statfs_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_statfs_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_setxattr_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_setxattr_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_fsetxattr_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_fsetxattr_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_fgetxattr_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_fgetxattr_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_getxattr_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_getxattr_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_xattrop_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_xattrop_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_fxattrop_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_fxattrop_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_removexattr_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_removexattr_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_fremovexattr_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_fremovexattr_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_lk_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_lk_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_inodelk_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_inodelk_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_finodelk_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_finodelk_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_entrylk_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_entrylk_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_fentrylk_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_fentrylk_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_rchecksum_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_rchecksum_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_readdir_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_readdir_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_readdirp_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_readdirp_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_setattr_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_setattr_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_fsetattr_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_fsetattr_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_fallocate_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_fallocate_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_discard_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_discard_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_zerofill_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_zerofill_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_getspec_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_getspec_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_ipc_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_ipc_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_seek_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_seek_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_lease_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_lease_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_getactivelk_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_getactivelk_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_setactivelk_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_setactivelk_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_put_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_put_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_icreate_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_icreate_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_namelink_failure_cbk (call_frame_t *frame, int32_t op_errno);
+default_namelink_failure_cbk(call_frame_t *frame, int32_t op_errno);
int32_t
-default_mem_acct_init (xlator_t *this);
+default_mem_acct_init(xlator_t *this);
void
-default_fini (xlator_t *this);
+default_fini(xlator_t *this);
#endif /* _DEFAULTS_H */
diff --git a/libglusterfs/src/dict.h b/libglusterfs/src/dict.h
index a8945d017b7..45cdb33ec9e 100644
--- a/libglusterfs/src/dict.h
+++ b/libglusterfs/src/dict.h
@@ -22,286 +22,367 @@ typedef struct _data data_t;
typedef struct _dict dict_t;
typedef struct _data_pair data_pair_t;
-
-#define GF_PROTOCOL_DICT_SERIALIZE(this,from_dict,to,len,ope,labl) do { \
- int _ret = 0; \
- \
- if (!from_dict) \
- break; \
- \
- _ret = dict_allocate_and_serialize (from_dict, to, &len);\
- if (_ret < 0) { \
- gf_msg (this->name, GF_LOG_WARNING, 0, \
- LG_MSG_DICT_SERIAL_FAILED, \
- "failed to get serialized dict (%s)", \
- (#from_dict)); \
- ope = EINVAL; \
- goto labl; \
- } \
- } while (0)
-
-
-#define GF_PROTOCOL_DICT_UNSERIALIZE(xl,to,buff,len,ret,ope,labl) do { \
- if (!len) \
- break; \
- to = dict_new(); \
- GF_VALIDATE_OR_GOTO (xl->name, to, labl); \
- \
- ret = dict_unserialize (buff, len, &to); \
- if (ret < 0) { \
- gf_msg (xl->name, GF_LOG_WARNING, 0, \
- LG_MSG_DICT_UNSERIAL_FAILED, \
- "failed to unserialize dictionary (%s)", \
- (#to)); \
- \
- ope = EINVAL; \
- goto labl; \
- } \
- \
- } while (0)
+#define GF_PROTOCOL_DICT_SERIALIZE(this, from_dict, to, len, ope, labl) \
+ do { \
+ int _ret = 0; \
+ \
+ if (!from_dict) \
+ break; \
+ \
+ _ret = dict_allocate_and_serialize(from_dict, to, &len); \
+ if (_ret < 0) { \
+ gf_msg(this->name, GF_LOG_WARNING, 0, LG_MSG_DICT_SERIAL_FAILED, \
+ "failed to get serialized dict (%s)", (#from_dict)); \
+ ope = EINVAL; \
+ goto labl; \
+ } \
+ } while (0)
+
+#define GF_PROTOCOL_DICT_UNSERIALIZE(xl, to, buff, len, ret, ope, labl) \
+ do { \
+ if (!len) \
+ break; \
+ to = dict_new(); \
+ GF_VALIDATE_OR_GOTO(xl->name, to, labl); \
+ \
+ ret = dict_unserialize(buff, len, &to); \
+ if (ret < 0) { \
+ gf_msg(xl->name, GF_LOG_WARNING, 0, LG_MSG_DICT_UNSERIAL_FAILED, \
+ "failed to unserialize dictionary (%s)", (#to)); \
+ \
+ ope = EINVAL; \
+ goto labl; \
+ } \
+ \
+ } while (0)
#define dict_foreach_inline(d, c) for (c = d->members_list; c; c = c->next)
-#define DICT_KEY_VALUE_MAX_SIZE 1048576
-#define DICT_MAX_FLAGS 256
-#define DICT_FLAG_SET 1
-#define DICT_FLAG_CLEAR 0
+#define DICT_KEY_VALUE_MAX_SIZE 1048576
+#define DICT_MAX_FLAGS 256
+#define DICT_FLAG_SET 1
+#define DICT_FLAG_CLEAR 0
struct _data {
- char *data;
- gf_atomic_t refcount;
- gf_lock_t lock;
- gf_dict_data_type_t data_type;
- int32_t len;
- gf_boolean_t is_static;
+ char *data;
+ gf_atomic_t refcount;
+ gf_lock_t lock;
+ gf_dict_data_type_t data_type;
+ int32_t len;
+ gf_boolean_t is_static;
};
struct _data_pair {
- struct _data_pair *hash_next;
- struct _data_pair *prev;
- struct _data_pair *next;
- data_t *value;
- char *key;
- uint32_t key_hash;
+ struct _data_pair *hash_next;
+ struct _data_pair *prev;
+ struct _data_pair *next;
+ data_t *value;
+ char *key;
+ uint32_t key_hash;
};
struct _dict {
- uint64_t max_count;
- int32_t hash_size;
- int32_t count;
- gf_atomic_t refcount;
- data_pair_t **members;
- data_pair_t *members_list;
- char *extra_free;
- char *extra_stdfree;
- gf_lock_t lock;
- data_pair_t *members_internal;
- data_pair_t free_pair;
- gf_boolean_t free_pair_in_use;
+ uint64_t max_count;
+ int32_t hash_size;
+ int32_t count;
+ gf_atomic_t refcount;
+ data_pair_t **members;
+ data_pair_t *members_list;
+ char *extra_free;
+ char *extra_stdfree;
+ gf_lock_t lock;
+ data_pair_t *members_internal;
+ data_pair_t free_pair;
+ gf_boolean_t free_pair_in_use;
};
-typedef gf_boolean_t (*dict_match_t) (dict_t *d, char *k, data_t *v,
- void *data);
+typedef gf_boolean_t (*dict_match_t)(dict_t *d, char *k, data_t *v, void *data);
-int32_t is_data_equal (data_t *one, data_t *two);
-void data_destroy (data_t *data);
+int32_t
+is_data_equal(data_t *one, data_t *two);
+void
+data_destroy(data_t *data);
/* function to set a key/value pair (overwrite existing if matches the key */
-int32_t dict_set (dict_t *this, char *key, data_t *value);
-int32_t dict_setn (dict_t *this, char *key, const int keylen, data_t *value);
+int32_t
+dict_set(dict_t *this, char *key, data_t *value);
+int32_t
+dict_setn(dict_t *this, char *key, const int keylen, data_t *value);
/* function to set a new key/value pair (without checking for duplicate) */
-int32_t dict_add (dict_t *this, char *key, data_t *value);
-int32_t dict_addn (dict_t *this, char *key, const int keylen, data_t *value);
-int dict_get_with_ref (dict_t *this, char *key, data_t **data);
-int dict_get_with_refn (dict_t *this, char *key, const int keylen,
- data_t **data);
-data_t *dict_get (dict_t *this, char *key);
-data_t *dict_getn (dict_t *this, char *key, const int keylen);
-void dict_del (dict_t *this, char *key);
-void dict_deln (dict_t *this, char *key, const int keylen);
-int dict_reset (dict_t *dict);
-
-int dict_key_count (dict_t *this);
-
-int32_t dict_serialized_length (dict_t *dict);
-int32_t dict_serialize (dict_t *dict, char *buf);
-int32_t dict_unserialize (char *buf, int32_t size, dict_t **fill);
-
-int32_t dict_allocate_and_serialize (dict_t *this, char **buf, u_int *length);
-
-void dict_unref (dict_t *dict);
-dict_t *dict_ref (dict_t *dict);
-data_t *data_ref (data_t *data);
-void data_unref (data_t *data);
-
-int32_t dict_lookup (dict_t *this, char *key, data_t **data);
+int32_t
+dict_add(dict_t *this, char *key, data_t *value);
+int32_t
+dict_addn(dict_t *this, char *key, const int keylen, data_t *value);
+int
+dict_get_with_ref(dict_t *this, char *key, data_t **data);
+int
+dict_get_with_refn(dict_t *this, char *key, const int keylen, data_t **data);
+data_t *
+dict_get(dict_t *this, char *key);
+data_t *
+dict_getn(dict_t *this, char *key, const int keylen);
+void
+dict_del(dict_t *this, char *key);
+void
+dict_deln(dict_t *this, char *key, const int keylen);
+int
+dict_reset(dict_t *dict);
+
+int
+dict_key_count(dict_t *this);
+
+int32_t
+dict_serialized_length(dict_t *dict);
+int32_t
+dict_serialize(dict_t *dict, char *buf);
+int32_t
+dict_unserialize(char *buf, int32_t size, dict_t **fill);
+
+int32_t
+dict_allocate_and_serialize(dict_t *this, char **buf, u_int *length);
+
+void
+dict_unref(dict_t *dict);
+dict_t *
+dict_ref(dict_t *dict);
+data_t *
+data_ref(data_t *data);
+void
+data_unref(data_t *data);
+
+int32_t
+dict_lookup(dict_t *this, char *key, data_t **data);
/*
TODO: provide converts for different byte sizes, signedness, and void *
*/
-data_t *int_to_data (int64_t value);
-data_t *str_to_data (char *value);
-data_t *strn_to_data (char *value, const int vallen);
-data_t *data_from_dynptr (void *value, int32_t len);
-data_t *bin_to_data (void *value, int32_t len);
-data_t *static_str_to_data (char *value);
-data_t *static_bin_to_data (void *value);
-
-int64_t data_to_int64 (data_t *data);
-int32_t data_to_int32 (data_t *data);
-int16_t data_to_int16 (data_t *data);
-int8_t data_to_int8 (data_t *data);
-
-uint64_t data_to_uint64 (data_t *data);
-uint32_t data_to_uint32 (data_t *data);
-uint16_t data_to_uint16 (data_t *data);
-uint8_t data_to_uint8 (data_t *data);
-
-data_t *data_from_int64 (int64_t value);
-data_t *data_from_int32 (int32_t value);
-data_t *data_from_int16 (int16_t value);
-data_t *data_from_int8 (int8_t value);
-
-data_t *data_from_uint64 (uint64_t value);
-data_t *data_from_uint32 (uint32_t value);
-data_t *data_from_uint16 (uint16_t value);
-
-char *data_to_str (data_t *data);
-void *data_to_bin (data_t *data);
-void *data_to_ptr (data_t *data);
-data_t * data_copy (data_t *old);
-struct iatt *data_to_iatt (data_t *data, char *key);
-
-int dict_foreach (dict_t *this,
- int (*fn)(dict_t *this,
- char *key,
- data_t *value,
- void *data),
- void *data);
-
-int dict_foreach_fnmatch (dict_t *dict, char *pattern,
- int (*fn)(dict_t *this,
- char *key,
- data_t *value,
- void *data),
- void *data);
+data_t *
+int_to_data(int64_t value);
+data_t *
+str_to_data(char *value);
+data_t *
+strn_to_data(char *value, const int vallen);
+data_t *
+data_from_dynptr(void *value, int32_t len);
+data_t *
+bin_to_data(void *value, int32_t len);
+data_t *
+static_str_to_data(char *value);
+data_t *
+static_bin_to_data(void *value);
+
+int64_t
+data_to_int64(data_t *data);
+int32_t
+data_to_int32(data_t *data);
+int16_t
+data_to_int16(data_t *data);
+int8_t
+data_to_int8(data_t *data);
+
+uint64_t
+data_to_uint64(data_t *data);
+uint32_t
+data_to_uint32(data_t *data);
+uint16_t
+data_to_uint16(data_t *data);
+uint8_t
+data_to_uint8(data_t *data);
+
+data_t *
+data_from_int64(int64_t value);
+data_t *
+data_from_int32(int32_t value);
+data_t *
+data_from_int16(int16_t value);
+data_t *
+data_from_int8(int8_t value);
+
+data_t *
+data_from_uint64(uint64_t value);
+data_t *
+data_from_uint32(uint32_t value);
+data_t *
+data_from_uint16(uint16_t value);
+
+char *
+data_to_str(data_t *data);
+void *
+data_to_bin(data_t *data);
+void *
+data_to_ptr(data_t *data);
+data_t *
+data_copy(data_t *old);
+struct iatt *
+data_to_iatt(data_t *data, char *key);
+
+int
+dict_foreach(dict_t *this,
+ int (*fn)(dict_t *this, char *key, data_t *value, void *data),
+ void *data);
int
-dict_foreach_match (dict_t *dict,
- gf_boolean_t (*match)(dict_t *this,
- char *key,
- data_t *value,
- void *mdata),
- void *match_data,
- int (*action)(dict_t *this,
- char *key,
- data_t *value,
- void *adata),
- void *action_data);
-
-int dict_null_foreach_fn (dict_t *d, char *k,
- data_t *v, void *tmp);
-int dict_remove_foreach_fn (dict_t *d, char *k,
- data_t *v, void *tmp);
-dict_t *dict_copy (dict_t *this, dict_t *new);
-dict_t *get_new_dict (void);
-int dict_keys_join (void *value, int size, dict_t *dict,
- int (*filter_fn)(char *key));
+dict_foreach_fnmatch(dict_t *dict, char *pattern,
+ int (*fn)(dict_t *this, char *key, data_t *value,
+ void *data),
+ void *data);
+
+int
+dict_foreach_match(dict_t *dict,
+ gf_boolean_t (*match)(dict_t *this, char *key, data_t *value,
+ void *mdata),
+ void *match_data,
+ int (*action)(dict_t *this, char *key, data_t *value,
+ void *adata),
+ void *action_data);
+
+int
+dict_null_foreach_fn(dict_t *d, char *k, data_t *v, void *tmp);
+int
+dict_remove_foreach_fn(dict_t *d, char *k, data_t *v, void *tmp);
+dict_t *
+dict_copy(dict_t *this, dict_t *new);
+dict_t *
+get_new_dict(void);
+int
+dict_keys_join(void *value, int size, dict_t *dict,
+ int (*filter_fn)(char *key));
/* CLEANED UP FUNCTIONS DECLARATIONS */
-GF_MUST_CHECK dict_t *dict_new (void);
-dict_t *dict_copy_with_ref (dict_t *this, dict_t *new);
-
-GF_MUST_CHECK int dict_reset (dict_t *dict);
-
-GF_MUST_CHECK int dict_get_int8 (dict_t *this, char *key, int8_t *val);
-GF_MUST_CHECK int dict_set_int8 (dict_t *this, char *key, int8_t val);
-
-GF_MUST_CHECK int dict_get_int16 (dict_t *this, char *key, int16_t *val);
-GF_MUST_CHECK int dict_set_int16 (dict_t *this, char *key, int16_t val);
-
-GF_MUST_CHECK int dict_get_int32 (dict_t *this, char *key, int32_t *val);
-GF_MUST_CHECK int dict_get_int32n (dict_t *this, char *key, const int keylen,
- int32_t *val);
-GF_MUST_CHECK int dict_set_int32 (dict_t *this, char *key, int32_t val);
-GF_MUST_CHECK int dict_set_int32n (dict_t *this, char *key, const int keylen,
- int32_t val);
-
-GF_MUST_CHECK int dict_get_int64 (dict_t *this, char *key, int64_t *val);
-GF_MUST_CHECK int dict_set_int64 (dict_t *this, char *key, int64_t val);
-
-GF_MUST_CHECK int dict_get_uint16 (dict_t *this, char *key, uint16_t *val);
-GF_MUST_CHECK int dict_set_uint16 (dict_t *this, char *key, uint16_t val);
-
-GF_MUST_CHECK int dict_get_uint32 (dict_t *this, char *key, uint32_t *val);
-GF_MUST_CHECK int dict_set_uint32 (dict_t *this, char *key, uint32_t val);
-
-GF_MUST_CHECK int dict_get_uint64 (dict_t *this, char *key, uint64_t *val);
-GF_MUST_CHECK int dict_set_uint64 (dict_t *this, char *key, uint64_t val);
-
-GF_MUST_CHECK int dict_check_flag (dict_t *this, char *key, int flag);
-GF_MUST_CHECK int dict_set_flag (dict_t *this, char *key, int flag);
-GF_MUST_CHECK int dict_clear_flag (dict_t *this, char *key, int flag);
-
-GF_MUST_CHECK int dict_get_double (dict_t *this, char *key, double *val);
-GF_MUST_CHECK int dict_set_double (dict_t *this, char *key, double val);
-
-GF_MUST_CHECK int dict_set_static_ptr (dict_t *this, char *key, void *ptr);
-GF_MUST_CHECK int dict_get_ptr (dict_t *this, char *key, void **ptr);
-GF_MUST_CHECK int dict_get_ptr_and_len (dict_t *this, char *key, void **ptr, int *len);
-GF_MUST_CHECK int dict_set_dynptr (dict_t *this, char *key, void *ptr, size_t size);
-
-GF_MUST_CHECK int dict_get_bin (dict_t *this, char *key, void **ptr);
-GF_MUST_CHECK int dict_set_bin (dict_t *this, char *key, void *ptr, size_t size);
-GF_MUST_CHECK int dict_set_static_bin (dict_t *this, char *key, void *ptr, size_t size);
-
-GF_MUST_CHECK int dict_set_option (dict_t *this, char *key, char *str);
-GF_MUST_CHECK int dict_set_str (dict_t *this, char *key, char *str);
-GF_MUST_CHECK int dict_set_strn (dict_t *this, char *key, const int keylen,
- char *str);
-GF_MUST_CHECK int dict_set_nstrn (dict_t *this, char *key, const int keylen,
- char *str, const int vallen);
-GF_MUST_CHECK int dict_set_dynstr (dict_t *this, char *key, char *str);
-GF_MUST_CHECK int dict_set_dynstrn (dict_t *this, char *key, const int keylen,
- char *str);
-GF_MUST_CHECK int dict_set_dynstr_with_alloc (dict_t *this, char *key, const char *str);
-GF_MUST_CHECK int dict_add_dynstr_with_alloc (dict_t *this, char *key, char *str);
-GF_MUST_CHECK int dict_get_str (dict_t *this, char *key, char **str);
-GF_MUST_CHECK int dict_get_strn (dict_t *this, char *key, const int keylen,
- char **str);
-
-GF_MUST_CHECK int dict_get_str_boolean (dict_t *this, char *key, int default_val);
-GF_MUST_CHECK int dict_rename_key (dict_t *this, char *key, char *replace_key);
-GF_MUST_CHECK int dict_serialize_value_with_delim (dict_t *this, char *buf, int32_t *serz_len,
- char delimiter);
-
-GF_MUST_CHECK int dict_set_gfuuid (dict_t *this, char *key, uuid_t uuid,
- bool is_static);
-GF_MUST_CHECK int dict_get_gfuuid (dict_t *this, char *key, uuid_t *uuid);
-
-GF_MUST_CHECK int dict_set_iatt (dict_t *this, char *key, struct iatt *iatt,
- bool is_static);
-GF_MUST_CHECK int dict_get_iatt (dict_t *this, char *key, struct iatt *iatt);
+GF_MUST_CHECK dict_t *
+dict_new(void);
+dict_t *
+dict_copy_with_ref(dict_t *this, dict_t *new);
+
+GF_MUST_CHECK int
+dict_reset(dict_t *dict);
+
+GF_MUST_CHECK int
+dict_get_int8(dict_t *this, char *key, int8_t *val);
+GF_MUST_CHECK int
+dict_set_int8(dict_t *this, char *key, int8_t val);
+
+GF_MUST_CHECK int
+dict_get_int16(dict_t *this, char *key, int16_t *val);
+GF_MUST_CHECK int
+dict_set_int16(dict_t *this, char *key, int16_t val);
+
+GF_MUST_CHECK int
+dict_get_int32(dict_t *this, char *key, int32_t *val);
+GF_MUST_CHECK int
+dict_get_int32n(dict_t *this, char *key, const int keylen, int32_t *val);
+GF_MUST_CHECK int
+dict_set_int32(dict_t *this, char *key, int32_t val);
+GF_MUST_CHECK int
+dict_set_int32n(dict_t *this, char *key, const int keylen, int32_t val);
+
+GF_MUST_CHECK int
+dict_get_int64(dict_t *this, char *key, int64_t *val);
+GF_MUST_CHECK int
+dict_set_int64(dict_t *this, char *key, int64_t val);
+
+GF_MUST_CHECK int
+dict_get_uint16(dict_t *this, char *key, uint16_t *val);
+GF_MUST_CHECK int
+dict_set_uint16(dict_t *this, char *key, uint16_t val);
+
+GF_MUST_CHECK int
+dict_get_uint32(dict_t *this, char *key, uint32_t *val);
+GF_MUST_CHECK int
+dict_set_uint32(dict_t *this, char *key, uint32_t val);
+
+GF_MUST_CHECK int
+dict_get_uint64(dict_t *this, char *key, uint64_t *val);
+GF_MUST_CHECK int
+dict_set_uint64(dict_t *this, char *key, uint64_t val);
+
+GF_MUST_CHECK int
+dict_check_flag(dict_t *this, char *key, int flag);
+GF_MUST_CHECK int
+dict_set_flag(dict_t *this, char *key, int flag);
+GF_MUST_CHECK int
+dict_clear_flag(dict_t *this, char *key, int flag);
+
+GF_MUST_CHECK int
+dict_get_double(dict_t *this, char *key, double *val);
+GF_MUST_CHECK int
+dict_set_double(dict_t *this, char *key, double val);
+
+GF_MUST_CHECK int
+dict_set_static_ptr(dict_t *this, char *key, void *ptr);
+GF_MUST_CHECK int
+dict_get_ptr(dict_t *this, char *key, void **ptr);
+GF_MUST_CHECK int
+dict_get_ptr_and_len(dict_t *this, char *key, void **ptr, int *len);
+GF_MUST_CHECK int
+dict_set_dynptr(dict_t *this, char *key, void *ptr, size_t size);
+
+GF_MUST_CHECK int
+dict_get_bin(dict_t *this, char *key, void **ptr);
+GF_MUST_CHECK int
+dict_set_bin(dict_t *this, char *key, void *ptr, size_t size);
+GF_MUST_CHECK int
+dict_set_static_bin(dict_t *this, char *key, void *ptr, size_t size);
+
+GF_MUST_CHECK int
+dict_set_option(dict_t *this, char *key, char *str);
+GF_MUST_CHECK int
+dict_set_str(dict_t *this, char *key, char *str);
+GF_MUST_CHECK int
+dict_set_strn(dict_t *this, char *key, const int keylen, char *str);
+GF_MUST_CHECK int
+dict_set_nstrn(dict_t *this, char *key, const int keylen, char *str,
+ const int vallen);
+GF_MUST_CHECK int
+dict_set_dynstr(dict_t *this, char *key, char *str);
+GF_MUST_CHECK int
+dict_set_dynstrn(dict_t *this, char *key, const int keylen, char *str);
+GF_MUST_CHECK int
+dict_set_dynstr_with_alloc(dict_t *this, char *key, const char *str);
+GF_MUST_CHECK int
+dict_add_dynstr_with_alloc(dict_t *this, char *key, char *str);
+GF_MUST_CHECK int
+dict_get_str(dict_t *this, char *key, char **str);
+GF_MUST_CHECK int
+dict_get_strn(dict_t *this, char *key, const int keylen, char **str);
+
+GF_MUST_CHECK int
+dict_get_str_boolean(dict_t *this, char *key, int default_val);
+GF_MUST_CHECK int
+dict_rename_key(dict_t *this, char *key, char *replace_key);
+GF_MUST_CHECK int
+dict_serialize_value_with_delim(dict_t *this, char *buf, int32_t *serz_len,
+ char delimiter);
+
+GF_MUST_CHECK int
+dict_set_gfuuid(dict_t *this, char *key, uuid_t uuid, bool is_static);
+GF_MUST_CHECK int
+dict_get_gfuuid(dict_t *this, char *key, uuid_t *uuid);
+
+GF_MUST_CHECK int
+dict_set_iatt(dict_t *this, char *key, struct iatt *iatt, bool is_static);
+GF_MUST_CHECK int
+dict_get_iatt(dict_t *this, char *key, struct iatt *iatt);
void
-dict_dump_to_statedump (dict_t *dict, char *dict_name, char *domain);
+dict_dump_to_statedump(dict_t *dict, char *dict_name, char *domain);
void
-dict_dump_to_log (dict_t *dict);
+dict_dump_to_log(dict_t *dict);
int
-dict_dump_to_str (dict_t *dict, char *dump, int dumpsize, char *format);
+dict_dump_to_str(dict_t *dict, char *dump, int dumpsize, char *format);
gf_boolean_t
-dict_match_everything (dict_t *d, char *k, data_t *v, void *data);
+dict_match_everything(dict_t *d, char *k, data_t *v, void *data);
dict_t *
-dict_for_key_value (const char *name, const char *value, size_t size,
- gf_boolean_t is_static);
+dict_for_key_value(const char *name, const char *value, size_t size,
+ gf_boolean_t is_static);
gf_boolean_t
-are_dicts_equal (dict_t *one, dict_t *two,
- gf_boolean_t (*match) (dict_t *d, char *k, data_t *v,
- void *data),
- gf_boolean_t (*value_ignore) (char *k));
+are_dicts_equal(dict_t *one, dict_t *two,
+ gf_boolean_t (*match)(dict_t *d, char *k, data_t *v,
+ void *data),
+ gf_boolean_t (*value_ignore)(char *k));
int
-dict_has_key_from_array (dict_t *dict, char **strings, gf_boolean_t *result);
+dict_has_key_from_array(dict_t *dict, char **strings, gf_boolean_t *result);
#endif
diff --git a/libglusterfs/src/event-history.h b/libglusterfs/src/event-history.h
index de5d47cdfee..5f0776ba9b0 100644
--- a/libglusterfs/src/event-history.h
+++ b/libglusterfs/src/event-history.h
@@ -14,26 +14,25 @@
#include "mem-types.h"
#include "circ-buff.h"
-struct event_hist
-{
- buffer_t *buffer;
- pthread_mutex_t lock;
+struct event_hist {
+ buffer_t *buffer;
+ pthread_mutex_t lock;
};
typedef struct event_hist eh_t;
void
-eh_dump (eh_t *event , void *data,
- int (fn) (circular_buffer_t *buffer, void *data));
+eh_dump(eh_t *event, void *data,
+ int(fn)(circular_buffer_t *buffer, void *data));
eh_t *
-eh_new (size_t buffer_size, gf_boolean_t use_buffer_once,
- void (*destroy_data) (void *data));
+eh_new(size_t buffer_size, gf_boolean_t use_buffer_once,
+ void (*destroy_data)(void *data));
int
-eh_save_history (eh_t *history, void *string);
+eh_save_history(eh_t *history, void *string);
int
-eh_destroy (eh_t *history);
+eh_destroy(eh_t *history);
#endif /* _EH_H */
diff --git a/libglusterfs/src/events.h b/libglusterfs/src/events.h
index 19988b0e3d2..74c5326427b 100644
--- a/libglusterfs/src/events.h
+++ b/libglusterfs/src/events.h
@@ -15,21 +15,20 @@
#ifdef USE_EVENTS
int
-_gf_event (eventtypes_t event, const char *fmt, ...)
- __attribute__ ((__format__ (__printf__, 2, 3)));
+_gf_event(eventtypes_t event, const char *fmt, ...)
+ __attribute__((__format__(__printf__, 2, 3)));
#else
-__attribute__ ((__format__ (__printf__, 2, 3)))
-static inline int
-_gf_event (eventtypes_t event, const char *fmt, ...)
+__attribute__((__format__(__printf__, 2, 3))) static inline int
+_gf_event(eventtypes_t event, const char *fmt, ...)
{
- return 0;
+ return 0;
}
#endif /* USE_EVENTS */
-#define gf_event(event, fmt...) \
- do { \
- FMT_WARN(fmt); \
- _gf_event (event, ##fmt); \
- } while (0)
+#define gf_event(event, fmt...) \
+ do { \
+ FMT_WARN(fmt); \
+ _gf_event(event, ##fmt); \
+ } while (0)
#endif /* __EVENTS_H__ */
diff --git a/libglusterfs/src/fd-lk.h b/libglusterfs/src/fd-lk.h
index 11d864dc207..735f05ec46c 100644
--- a/libglusterfs/src/fd-lk.h
+++ b/libglusterfs/src/fd-lk.h
@@ -20,46 +20,44 @@
#include "glusterfs.h"
#include "common-utils.h"
-#define get_lk_type(type) \
- type == F_UNLCK ? "F_UNLCK" : (type == F_RDLCK ? "F_RDLCK" : "F_WRLCK")
+#define get_lk_type(type) \
+ type == F_UNLCK ? "F_UNLCK" : (type == F_RDLCK ? "F_RDLCK" : "F_WRLCK")
-#define get_lk_cmd(cmd) \
- cmd == F_SETLKW ? "F_SETLKW" : (cmd == F_SETLK ? "F_SETLK" : "F_GETLK")
+#define get_lk_cmd(cmd) \
+ cmd == F_SETLKW ? "F_SETLKW" : (cmd == F_SETLK ? "F_SETLK" : "F_GETLK")
struct _fd;
struct fd_lk_ctx {
- struct list_head lk_list;
- gf_atomic_t ref;
- gf_lock_t lock;
+ struct list_head lk_list;
+ gf_atomic_t ref;
+ gf_lock_t lock;
};
typedef struct fd_lk_ctx fd_lk_ctx_t;
struct fd_lk_ctx_node {
- int32_t cmd;
- struct gf_flock user_flock;
- off_t fl_start;
- off_t fl_end;
- short fl_type;
- struct list_head next;
+ int32_t cmd;
+ struct gf_flock user_flock;
+ off_t fl_start;
+ off_t fl_end;
+ short fl_type;
+ struct list_head next;
};
typedef struct fd_lk_ctx_node fd_lk_ctx_node_t;
-
fd_lk_ctx_t *
-fd_lk_ctx_ref (fd_lk_ctx_t *lk_ctx);
+fd_lk_ctx_ref(fd_lk_ctx_t *lk_ctx);
fd_lk_ctx_t *
-fd_lk_ctx_create (void);
+fd_lk_ctx_create(void);
int
-fd_lk_insert_and_merge (struct _fd *lk_ctx, int32_t cmd,
- struct gf_flock *flock);
+fd_lk_insert_and_merge(struct _fd *lk_ctx, int32_t cmd, struct gf_flock *flock);
int
-fd_lk_ctx_unref (fd_lk_ctx_t *lk_ctx);
+fd_lk_ctx_unref(fd_lk_ctx_t *lk_ctx);
gf_boolean_t
-fd_lk_ctx_empty (fd_lk_ctx_t *lk_ctx);
+fd_lk_ctx_empty(fd_lk_ctx_t *lk_ctx);
#endif /* _FD_LK_H */
diff --git a/libglusterfs/src/fd.h b/libglusterfs/src/fd.h
index 3f68b1c4997..e885ecb7786 100644
--- a/libglusterfs/src/fd.h
+++ b/libglusterfs/src/fd.h
@@ -20,170 +20,148 @@
#include "common-utils.h"
#define GF_ANON_FD_NO -2
-#define GF_ANON_FD_FLAGS (O_RDWR|O_LARGEFILE)
+#define GF_ANON_FD_FLAGS (O_RDWR | O_LARGEFILE)
struct _inode;
struct _dict;
struct fd_lk_ctx;
struct _fd_ctx {
- union {
- uint64_t key;
- void *xl_key;
- };
- union {
- uint64_t value1;
- void *ptr1;
- };
+ union {
+ uint64_t key;
+ void *xl_key;
+ };
+ union {
+ uint64_t value1;
+ void *ptr1;
+ };
};
struct _fd {
- uint64_t pid;
- int32_t flags;
- gf_atomic_t refcount;
- struct list_head inode_list;
- struct _inode *inode;
- gf_lock_t lock; /* used ONLY for manipulating
- 'struct _fd_ctx' array (_ctx).*/
- struct _fd_ctx *_ctx;
- int xl_count; /* Number of xl referred in this fd */
- struct fd_lk_ctx *lk_ctx;
- gf_boolean_t anonymous; /* fd which does not have counterpart open
- fd on backend (server for client, posix
- for server). */
+ uint64_t pid;
+ int32_t flags;
+ gf_atomic_t refcount;
+ struct list_head inode_list;
+ struct _inode *inode;
+ gf_lock_t lock; /* used ONLY for manipulating
+ 'struct _fd_ctx' array (_ctx).*/
+ struct _fd_ctx *_ctx;
+ int xl_count; /* Number of xl referred in this fd */
+ struct fd_lk_ctx *lk_ctx;
+ gf_boolean_t anonymous; /* fd which does not have counterpart open
+ fd on backend (server for client, posix
+ for server). */
};
typedef struct _fd fd_t;
-
struct fd_table_entry {
- fd_t *fd;
- int next_free;
+ fd_t *fd;
+ int next_free;
};
typedef struct fd_table_entry fdentry_t;
-
struct _fdtable {
- int refcount;
- uint32_t max_fds;
- pthread_rwlock_t lock;
- fdentry_t *fdentries;
- int first_free;
+ int refcount;
+ uint32_t max_fds;
+ pthread_rwlock_t lock;
+ fdentry_t *fdentries;
+ int first_free;
};
typedef struct _fdtable fdtable_t;
-
/* Signifies no more entries in the fd table. */
-#define GF_FDTABLE_END -1
+#define GF_FDTABLE_END -1
/* This is used to invalidated
* the next_free value in an fdentry that has been allocated
*/
-#define GF_FDENTRY_ALLOCATED -2
+#define GF_FDENTRY_ALLOCATED -2
#include "logging.h"
#include "xlator.h"
-
void
-gf_fd_put (fdtable_t *fdtable, int32_t fd);
-
+gf_fd_put(fdtable_t *fdtable, int32_t fd);
fd_t *
-gf_fd_fdptr_get (fdtable_t *fdtable, int64_t fd);
-
+gf_fd_fdptr_get(fdtable_t *fdtable, int64_t fd);
fdtable_t *
-gf_fd_fdtable_alloc (void);
-
+gf_fd_fdtable_alloc(void);
int
-gf_fd_unused_get (fdtable_t *fdtable, fd_t *fdptr);
-
+gf_fd_unused_get(fdtable_t *fdtable, fd_t *fdptr);
fdentry_t *
-gf_fd_fdtable_get_all_fds (fdtable_t *fdtable, uint32_t *count);
-
+gf_fd_fdtable_get_all_fds(fdtable_t *fdtable, uint32_t *count);
void
-gf_fd_fdtable_destroy (fdtable_t *fdtable);
-
+gf_fd_fdtable_destroy(fdtable_t *fdtable);
fd_t *
-__fd_ref (fd_t *fd);
-
+__fd_ref(fd_t *fd);
fd_t *
-fd_ref (fd_t *fd);
-
+fd_ref(fd_t *fd);
void
-fd_unref (fd_t *fd);
-
+fd_unref(fd_t *fd);
fd_t *
-fd_create (struct _inode *inode, pid_t pid);
+fd_create(struct _inode *inode, pid_t pid);
fd_t *
-fd_create_uint64 (struct _inode *inode, uint64_t pid);
+fd_create_uint64(struct _inode *inode, uint64_t pid);
fd_t *
-fd_lookup (struct _inode *inode, pid_t pid);
+fd_lookup(struct _inode *inode, pid_t pid);
fd_t *
-fd_lookup_uint64 (struct _inode *inode, uint64_t pid);
+fd_lookup_uint64(struct _inode *inode, uint64_t pid);
-fd_t*
-fd_lookup_anonymous (inode_t *inode, int32_t flags);
+fd_t *
+fd_lookup_anonymous(inode_t *inode, int32_t flags);
fd_t *
-fd_anonymous (inode_t *inode);
+fd_anonymous(inode_t *inode);
fd_t *
-fd_anonymous_with_flags (inode_t *inode, int32_t flags);
+fd_anonymous_with_flags(inode_t *inode, int32_t flags);
gf_boolean_t
-fd_is_anonymous (fd_t *fd);
-
+fd_is_anonymous(fd_t *fd);
uint8_t
-fd_list_empty (struct _inode *inode);
-
+fd_list_empty(struct _inode *inode);
fd_t *
-fd_bind (fd_t *fd);
-
+fd_bind(fd_t *fd);
int
-fd_ctx_set (fd_t *fd, xlator_t *xlator, uint64_t value);
-
+fd_ctx_set(fd_t *fd, xlator_t *xlator, uint64_t value);
int
-fd_ctx_get (fd_t *fd, xlator_t *xlator, uint64_t *value);
-
+fd_ctx_get(fd_t *fd, xlator_t *xlator, uint64_t *value);
int
-fd_ctx_del (fd_t *fd, xlator_t *xlator, uint64_t *value);
+fd_ctx_del(fd_t *fd, xlator_t *xlator, uint64_t *value);
int
-__fd_ctx_del (fd_t *fd, xlator_t *xlator, uint64_t *value);
-
+__fd_ctx_del(fd_t *fd, xlator_t *xlator, uint64_t *value);
int
-__fd_ctx_set (fd_t *fd, xlator_t *xlator, uint64_t value);
-
+__fd_ctx_set(fd_t *fd, xlator_t *xlator, uint64_t value);
int
-__fd_ctx_get (fd_t *fd, xlator_t *xlator, uint64_t *value);
-
+__fd_ctx_get(fd_t *fd, xlator_t *xlator, uint64_t *value);
void
-fd_ctx_dump (fd_t *fd, char *prefix);
+fd_ctx_dump(fd_t *fd, char *prefix);
fdentry_t *
-gf_fd_fdtable_copy_all_fds (fdtable_t *fdtable, uint32_t *count);
-
+gf_fd_fdtable_copy_all_fds(fdtable_t *fdtable, uint32_t *count);
void
-gf_fdptr_put (fdtable_t *fdtable, fd_t *fd);
+gf_fdptr_put(fdtable_t *fdtable, fd_t *fd);
#endif /* _FD_H */
diff --git a/libglusterfs/src/gf-dirent.h b/libglusterfs/src/gf-dirent.h
index fa323396e92..95403e9eabd 100644
--- a/libglusterfs/src/gf-dirent.h
+++ b/libglusterfs/src/gf-dirent.h
@@ -8,63 +8,64 @@
cases as published by the Free Software Foundation.
*/
-
#ifndef _GF_DIRENT_H
#define _GF_DIRENT_H
#include "iatt.h"
#include "inode.h"
-#define gf_dirent_size(name) (sizeof (gf_dirent_t) + strlen (name) + 1)
+#define gf_dirent_size(name) (sizeof(gf_dirent_t) + strlen(name) + 1)
int
gf_deitransform(xlator_t *this, uint64_t y);
int
-gf_itransform (xlator_t *this, uint64_t x, uint64_t *y_p, int client_id);
+gf_itransform(xlator_t *this, uint64_t x, uint64_t *y_p, int client_id);
uint64_t
-gf_dirent_orig_offset (xlator_t *this, uint64_t offset);
-
+gf_dirent_orig_offset(xlator_t *this, uint64_t offset);
struct _dir_entry {
- struct _dir_entry *next;
- char *name;
- char *link;
- struct iatt buf;
+ struct _dir_entry *next;
+ char *name;
+ char *link;
+ struct iatt buf;
};
-
struct _gf_dirent {
- union {
- struct list_head list;
- struct {
- struct _gf_dirent *next;
- struct _gf_dirent *prev;
- };
- };
- uint64_t d_ino;
- uint64_t d_off;
- uint32_t d_len;
- uint32_t d_type;
- struct iatt d_stat;
- dict_t *dict;
- inode_t *inode;
- char d_name[];
+ union {
+ struct list_head list;
+ struct {
+ struct _gf_dirent *next;
+ struct _gf_dirent *prev;
+ };
+ };
+ uint64_t d_ino;
+ uint64_t d_off;
+ uint32_t d_len;
+ uint32_t d_type;
+ struct iatt d_stat;
+ dict_t *dict;
+ inode_t *inode;
+ char d_name[];
};
#define DT_ISDIR(mode) (mode == DT_DIR)
-gf_dirent_t *gf_dirent_for_name (const char *name);
-gf_dirent_t *entry_copy (gf_dirent_t *source);
-void gf_dirent_entry_free (gf_dirent_t *entry);
-void gf_dirent_free (gf_dirent_t *entries);
-int gf_link_inodes_from_dirent (xlator_t *this, inode_t *parent,
- gf_dirent_t *entries);
+gf_dirent_t *
+gf_dirent_for_name(const char *name);
+gf_dirent_t *
+entry_copy(gf_dirent_t *source);
+void
+gf_dirent_entry_free(gf_dirent_t *entry);
+void
+gf_dirent_free(gf_dirent_t *entries);
+int
+gf_link_inodes_from_dirent(xlator_t *this, inode_t *parent,
+ gf_dirent_t *entries);
int
-gf_fill_iatt_for_dirent (gf_dirent_t *entry, inode_t *parent,
- xlator_t *subvol);
+gf_fill_iatt_for_dirent(gf_dirent_t *entry, inode_t *parent, xlator_t *subvol);
void
-gf_link_inode_from_dirent (xlator_t *this, inode_t *parent, gf_dirent_t *entry);
+gf_link_inode_from_dirent(xlator_t *this, inode_t *parent, gf_dirent_t *entry);
#endif /* _GF_DIRENT_H */
diff --git a/libglusterfs/src/gf-event.h b/libglusterfs/src/gf-event.h
index 55a74ed17c6..5c3724cc953 100644
--- a/libglusterfs/src/gf-event.h
+++ b/libglusterfs/src/gf-event.h
@@ -18,102 +18,109 @@ struct event_ops;
struct event_slot_poll;
struct event_slot_epoll;
struct event_data {
- int idx;
- int gen;
-} __attribute__ ((__packed__, __may_alias__));
+ int idx;
+ int gen;
+} __attribute__((__packed__, __may_alias__));
-
-typedef int (*event_handler_t) (int fd, int idx, int gen, void *data,
- int poll_in, int poll_out, int poll_err);
+typedef int (*event_handler_t)(int fd, int idx, int gen, void *data,
+ int poll_in, int poll_out, int poll_err);
#define EVENT_EPOLL_TABLES 1024
#define EVENT_EPOLL_SLOTS 1024
-#define EVENT_MAX_THREADS 1024
+#define EVENT_MAX_THREADS 1024
struct event_pool {
- struct event_ops *ops;
-
- int fd;
- int breaker[2];
-
- int count;
- struct event_slot_poll *reg;
- struct event_slot_epoll *ereg[EVENT_EPOLL_TABLES];
- int slots_used[EVENT_EPOLL_TABLES];
-
- int used;
- int changed;
-
- pthread_mutex_t mutex;
- pthread_cond_t cond;
-
- void *evcache;
- int evcache_size;
-
- /* NOTE: Currently used only when event processing is done using
- * epoll. */
- int eventthreadcount; /* number of event threads to execute. */
- pthread_t pollers[EVENT_MAX_THREADS]; /* poller thread_id store,
- * and live status */
- int destroy;
- int activethreadcount;
-
- /*
- * Number of threads created by auto-scaling, *in addition to* the
- * configured number of threads. This is only applicable on the
- * server, where we try to keep the number of threads around the number
- * of bricks. In that case, the configured number is just "extra"
- * threads to handle requests in excess of one per brick (including
- * requests on the GlusterD connection). For clients or GlusterD, this
- * number will always be zero, so the "extra" is all we have.
- *
- * TBD: consider auto-scaling for clients as well
- */
- int auto_thread_count;
-
+ struct event_ops *ops;
+
+ int fd;
+ int breaker[2];
+
+ int count;
+ struct event_slot_poll *reg;
+ struct event_slot_epoll *ereg[EVENT_EPOLL_TABLES];
+ int slots_used[EVENT_EPOLL_TABLES];
+
+ int used;
+ int changed;
+
+ pthread_mutex_t mutex;
+ pthread_cond_t cond;
+
+ void *evcache;
+ int evcache_size;
+
+ /* NOTE: Currently used only when event processing is done using
+ * epoll. */
+ int eventthreadcount; /* number of event threads to execute. */
+ pthread_t pollers[EVENT_MAX_THREADS]; /* poller thread_id store,
+ * and live status */
+ int destroy;
+ int activethreadcount;
+
+ /*
+ * Number of threads created by auto-scaling, *in addition to* the
+ * configured number of threads. This is only applicable on the
+ * server, where we try to keep the number of threads around the number
+ * of bricks. In that case, the configured number is just "extra"
+ * threads to handle requests in excess of one per brick (including
+ * requests on the GlusterD connection). For clients or GlusterD, this
+ * number will always be zero, so the "extra" is all we have.
+ *
+ * TBD: consider auto-scaling for clients as well
+ */
+ int auto_thread_count;
};
struct event_destroy_data {
- int readfd;
- struct event_pool *pool;
+ int readfd;
+ struct event_pool *pool;
};
struct event_ops {
- struct event_pool * (*new) (int count, int eventthreadcount);
+ struct event_pool *(*new)(int count, int eventthreadcount);
- int (*event_register) (struct event_pool *event_pool, int fd,
- event_handler_t handler,
- void *data, int poll_in, int poll_out);
+ int (*event_register)(struct event_pool *event_pool, int fd,
+ event_handler_t handler, void *data, int poll_in,
+ int poll_out);
- int (*event_select_on) (struct event_pool *event_pool, int fd, int idx,
- int poll_in, int poll_out);
+ int (*event_select_on)(struct event_pool *event_pool, int fd, int idx,
+ int poll_in, int poll_out);
- int (*event_unregister) (struct event_pool *event_pool, int fd, int idx);
+ int (*event_unregister)(struct event_pool *event_pool, int fd, int idx);
- int (*event_unregister_close) (struct event_pool *event_pool, int fd,
- int idx);
+ int (*event_unregister_close)(struct event_pool *event_pool, int fd,
+ int idx);
- int (*event_dispatch) (struct event_pool *event_pool);
+ int (*event_dispatch)(struct event_pool *event_pool);
- int (*event_reconfigure_threads) (struct event_pool *event_pool,
- int newcount);
- int (*event_pool_destroy) (struct event_pool *event_pool);
- int (*event_handled) (struct event_pool *event_pool, int fd, int idx,
- int gen);
+ int (*event_reconfigure_threads)(struct event_pool *event_pool,
+ int newcount);
+ int (*event_pool_destroy)(struct event_pool *event_pool);
+ int (*event_handled)(struct event_pool *event_pool, int fd, int idx,
+ int gen);
};
-struct event_pool *event_pool_new (int count, int eventthreadcount);
-int event_select_on (struct event_pool *event_pool, int fd, int idx,
- int poll_in, int poll_out);
-int event_register (struct event_pool *event_pool, int fd,
- event_handler_t handler,
- void *data, int poll_in, int poll_out);
-int event_unregister (struct event_pool *event_pool, int fd, int idx);
-int event_unregister_close (struct event_pool *event_pool, int fd, int idx);
-int event_dispatch (struct event_pool *event_pool);
-int event_reconfigure_threads (struct event_pool *event_pool, int value);
-int event_pool_destroy (struct event_pool *event_pool);
-int event_dispatch_destroy (struct event_pool *event_pool);
-int event_handled (struct event_pool *event_pool, int fd, int idx, int gen);
+struct event_pool *
+event_pool_new(int count, int eventthreadcount);
+int
+event_select_on(struct event_pool *event_pool, int fd, int idx, int poll_in,
+ int poll_out);
+int
+event_register(struct event_pool *event_pool, int fd, event_handler_t handler,
+ void *data, int poll_in, int poll_out);
+int
+event_unregister(struct event_pool *event_pool, int fd, int idx);
+int
+event_unregister_close(struct event_pool *event_pool, int fd, int idx);
+int
+event_dispatch(struct event_pool *event_pool);
+int
+event_reconfigure_threads(struct event_pool *event_pool, int value);
+int
+event_pool_destroy(struct event_pool *event_pool);
+int
+event_dispatch_destroy(struct event_pool *event_pool);
+int
+event_handled(struct event_pool *event_pool, int fd, int idx, int gen);
#endif /* _GF_EVENT_H_ */
diff --git a/libglusterfs/src/gfdb/gfdb_data_store.h b/libglusterfs/src/gfdb/gfdb_data_store.h
index 93bdda813a9..59f7bd01ab3 100644
--- a/libglusterfs/src/gfdb/gfdb_data_store.h
+++ b/libglusterfs/src/gfdb/gfdb_data_store.h
@@ -10,7 +10,6 @@
#ifndef __GFDB_DATA_STORE_H
#define __GFDB_DATA_STORE_H
-
#include "glusterfs.h"
#include "xlator.h"
#include "logging.h"
@@ -32,9 +31,6 @@
* */
typedef struct gfdb_conn_node_t gfdb_conn_node_t;
-
-
-
/*Libgfdb API Function: Used to initialize db connection
* Arguments:
* args : Dictionary containing database specific parameters
@@ -46,11 +42,8 @@ typedef struct gfdb_conn_node_t gfdb_conn_node_t;
gfdb_conn_node_t *
init_db(dict_t *arg, gfdb_db_type_t db_type);
-typedef gfdb_conn_node_t * (*init_db_t) (dict_t *args,
- gfdb_db_type_t gfdb_db_type);
-
-
-
+typedef gfdb_conn_node_t *(*init_db_t)(dict_t *args,
+ gfdb_db_type_t gfdb_db_type);
/*Libgfdb API Function: Used to terminate/de-initialize db connection
* (Destructor function for db connection object)
@@ -61,9 +54,7 @@ typedef gfdb_conn_node_t * (*init_db_t) (dict_t *args,
int
fini_db(gfdb_conn_node_t *);
-typedef int (*fini_db_t) (gfdb_conn_node_t *_conn_node);
-
-
+typedef int (*fini_db_t)(gfdb_conn_node_t *_conn_node);
/*Libgfdb API Function: Used to insert/updated records in the database
* NOTE: In current gfdb_sqlite plugin we use that
@@ -83,9 +74,6 @@ typedef int (*fini_db_t) (gfdb_conn_node_t *_conn_node);
int
insert_record(gfdb_conn_node_t *, gfdb_db_record_t *gfdb_db_record);
-
-
-
/*Libgfdb API Function: Used to delete record from the database
* NOTE: In the current gfdb_sqlite3 plugin
* implementation this function is dummy.
@@ -99,10 +87,6 @@ insert_record(gfdb_conn_node_t *, gfdb_db_record_t *gfdb_db_record);
int
delete_record(gfdb_conn_node_t *, gfdb_db_record_t *gfdb_db_record);
-
-
-
-
/*Libgfdb API Function: Query all the records from the database
* Arguments:
* _conn_node : GFDB Connection node
@@ -116,17 +100,13 @@ delete_record(gfdb_conn_node_t *, gfdb_db_record_t *gfdb_db_record);
*
* Returns : if successful return 0 or
* -ve value in case of failure*/
-int find_all(gfdb_conn_node_t *, gf_query_callback_t query_callback,
- void *_query_cbk_args,
- int query_limit);
-
-typedef int (*find_all_t) (gfdb_conn_node_t *,
- gf_query_callback_t query_callback,
- void *_query_cbk_args,
- int query_limit);
-
-
+int
+find_all(gfdb_conn_node_t *, gf_query_callback_t query_callback,
+ void *_query_cbk_args, int query_limit);
+typedef int (*find_all_t)(gfdb_conn_node_t *,
+ gf_query_callback_t query_callback,
+ void *_query_cbk_args, int query_limit);
/*Libgfdb API Function: Query records/files that have not changed/accessed
* from a time in past to current time
@@ -140,17 +120,14 @@ typedef int (*find_all_t) (gfdb_conn_node_t *,
* changed/accessed
* Returns : if successful return 0 or
* -ve value in case of failure*/
-int find_unchanged_for_time(gfdb_conn_node_t *,
- gf_query_callback_t query_callback,
+int
+find_unchanged_for_time(gfdb_conn_node_t *, gf_query_callback_t query_callback,
void *_query_cbk_args, gfdb_time_t *for_time);
-typedef int (*find_unchanged_for_time_t) (gfdb_conn_node_t *_conn_node,
- gf_query_callback_t query_callback,
- void *_query_cbk_args,
- gfdb_time_t *for_time);
-
-
-
+typedef int (*find_unchanged_for_time_t)(gfdb_conn_node_t *_conn_node,
+ gf_query_callback_t query_callback,
+ void *_query_cbk_args,
+ gfdb_time_t *for_time);
/*Libgfdb API Function: Query records/files that have changed/accessed from a
* time in past to current time
@@ -164,17 +141,15 @@ typedef int (*find_unchanged_for_time_t) (gfdb_conn_node_t *_conn_node,
* changed/accessed
* Returns : if successful return 0 or
* -ve value in case of failure*/
-int find_recently_changed_files(gfdb_conn_node_t *_conn,
- gf_query_callback_t query_callback, void *_query_cbk_args,
- gfdb_time_t *from_time);
-
-typedef int (*find_recently_changed_files_t) (gfdb_conn_node_t *_conn_node,
- gf_query_callback_t query_callback,
- void *_query_cbk_args,
- gfdb_time_t *from_time);
-
-
+int
+find_recently_changed_files(gfdb_conn_node_t *_conn,
+ gf_query_callback_t query_callback,
+ void *_query_cbk_args, gfdb_time_t *from_time);
+typedef int (*find_recently_changed_files_t)(gfdb_conn_node_t *_conn_node,
+ gf_query_callback_t query_callback,
+ void *_query_cbk_args,
+ gfdb_time_t *from_time);
/*Libgfdb API Function: Query records/files that have not changed/accessed
* from a time in past to current time, with
@@ -193,24 +168,17 @@ typedef int (*find_recently_changed_files_t) (gfdb_conn_node_t *_conn_node,
* all files.
* Returns : if successful return 0 or
* -ve value in case of failure*/
-int find_unchanged_for_time_freq(gfdb_conn_node_t *_conn,
- gf_query_callback_t query_callback,
- void *_query_cbk_args,
- gfdb_time_t *for_time,
- int write_freq_thresold,
- int read_freq_thresold,
- gf_boolean_t _clear_counters);
-
-typedef int (*find_unchanged_for_time_freq_t) (gfdb_conn_node_t *_conn_node,
- gf_query_callback_t query_callback,
- void *_query_cbk_args,
- gfdb_time_t *for_time,
- int write_freq_thresold,
- int read_freq_thresold,
- gf_boolean_t _clear_counters);
-
-
+int
+find_unchanged_for_time_freq(gfdb_conn_node_t *_conn,
+ gf_query_callback_t query_callback,
+ void *_query_cbk_args, gfdb_time_t *for_time,
+ int write_freq_thresold, int read_freq_thresold,
+ gf_boolean_t _clear_counters);
+typedef int (*find_unchanged_for_time_freq_t)(
+ gfdb_conn_node_t *_conn_node, gf_query_callback_t query_callback,
+ void *_query_cbk_args, gfdb_time_t *for_time, int write_freq_thresold,
+ int read_freq_thresold, gf_boolean_t _clear_counters);
/*Libgfdb API Function: Query records/files that have changed/accessed from a
* time in past to current time, with
@@ -229,24 +197,20 @@ typedef int (*find_unchanged_for_time_freq_t) (gfdb_conn_node_t *_conn_node,
* all files.
* Returns : if successful return 0 or
* -ve value in case of failure*/
-int find_recently_changed_files_freq(gfdb_conn_node_t *_conn,
- gf_query_callback_t query_callback,
- void *_query_cbk_args,
- gfdb_time_t *from_time,
- int write_freq_thresold,
- int read_freq_thresold,
- gf_boolean_t _clear_counters);
-
-typedef int (*find_recently_changed_files_freq_t) (gfdb_conn_node_t *_conn_node,
- gf_query_callback_t query_callback,
- void *_query_cbk_args,
- gfdb_time_t *from_time,
- int write_freq_thresold,
- int read_freq_thresold,
- gf_boolean_t _clear_counters);
-
-typedef const
-char *(*get_db_path_key_t)();
+int
+find_recently_changed_files_freq(gfdb_conn_node_t *_conn,
+ gf_query_callback_t query_callback,
+ void *_query_cbk_args, gfdb_time_t *from_time,
+ int write_freq_thresold,
+ int read_freq_thresold,
+ gf_boolean_t _clear_counters);
+
+typedef int (*find_recently_changed_files_freq_t)(
+ gfdb_conn_node_t *_conn_node, gf_query_callback_t query_callback,
+ void *_query_cbk_args, gfdb_time_t *from_time, int write_freq_thresold,
+ int read_freq_thresold, gf_boolean_t _clear_counters);
+
+typedef const char *(*get_db_path_key_t)();
/*Libgfdb API Function: Clear the heat for all the files
*
@@ -257,11 +221,9 @@ char *(*get_db_path_key_t)();
* -ve value in case of failure
**/
int
-clear_files_heat (gfdb_conn_node_t *_conn_node);
-
-typedef int (*clear_files_heat_t) (gfdb_conn_node_t *_conn_node);
-
+clear_files_heat(gfdb_conn_node_t *_conn_node);
+typedef int (*clear_files_heat_t)(gfdb_conn_node_t *_conn_node);
/* Libgfdb API Function: Function to extract version of the db
* Arguments:
@@ -275,11 +237,9 @@ typedef int (*clear_files_heat_t) (gfdb_conn_node_t *_conn_node);
* On failure return -1
* */
int
-get_db_version (gfdb_conn_node_t *_conn_node, char **version);
-
-typedef int (*get_db_version_t)(gfdb_conn_node_t *_conn_node,
- char **version);
+get_db_version(gfdb_conn_node_t *_conn_node, char **version);
+typedef int (*get_db_version_t)(gfdb_conn_node_t *_conn_node, char **version);
/* Libgfdb API Function: Function to extract param from the db
* Arguments:
@@ -294,14 +254,11 @@ typedef int (*get_db_version_t)(gfdb_conn_node_t *_conn_node,
* On failure return -1
* */
int
-get_db_params (gfdb_conn_node_t *_conn_node,
- char *param_key,
- char **param_value);
-
-typedef int (*get_db_params_t)(gfdb_conn_node_t *db_conn,
- char *param_key,
- char **param_value);
+get_db_params(gfdb_conn_node_t *_conn_node, char *param_key,
+ char **param_value);
+typedef int (*get_db_params_t)(gfdb_conn_node_t *db_conn, char *param_key,
+ char **param_value);
/* Libgfdb API Function: Function to set db params
* Arguments:
@@ -313,13 +270,10 @@ typedef int (*get_db_params_t)(gfdb_conn_node_t *db_conn,
* On failure return -1
* */
int
-set_db_params (gfdb_conn_node_t *_conn_node,
- char *param_key,
- char *param_value);
+set_db_params(gfdb_conn_node_t *_conn_node, char *param_key, char *param_value);
-typedef int (*set_db_params_t)(gfdb_conn_node_t *db_conn,
- char *param_key,
- char *param_value);
+typedef int (*set_db_params_t)(gfdb_conn_node_t *db_conn, char *param_key,
+ char *param_value);
/*Libgfdb API Function: Compact the database.
*
@@ -330,48 +284,48 @@ typedef int (*set_db_params_t)(gfdb_conn_node_t *db_conn,
* Returns : if successful return 0 or
* -ve value in case of failure*/
int
-compact_db (gfdb_conn_node_t *_conn_node, gf_boolean_t _compact_active,
- gf_boolean_t _compact_mode_switched);
+compact_db(gfdb_conn_node_t *_conn_node, gf_boolean_t _compact_active,
+ gf_boolean_t _compact_mode_switched);
typedef int (*compact_db_t)(gfdb_conn_node_t *db_conn,
gf_boolean_t compact_active,
gf_boolean_t compact_mode_switched);
-
typedef struct gfdb_methods_s {
- init_db_t init_db;
- fini_db_t fini_db;
- find_all_t find_all;
- find_unchanged_for_time_t find_unchanged_for_time;
- find_recently_changed_files_t find_recently_changed_files;
- find_unchanged_for_time_freq_t find_unchanged_for_time_freq;
- find_recently_changed_files_freq_t find_recently_changed_files_freq;
- clear_files_heat_t clear_files_heat;
- get_db_version_t get_db_version;
- get_db_params_t get_db_params;
- set_db_params_t set_db_params;
- /* Do not expose dbpath directly. Expose it via an */
- /* access function: get_db_path_key(). */
- char *dbpath;
- get_db_path_key_t get_db_path_key;
-
- /* Query Record related functions */
- gfdb_query_record_new_t gfdb_query_record_new;
- gfdb_query_record_free_t gfdb_query_record_free;
- gfdb_add_link_to_query_record_t gfdb_add_link_to_query_record;
- gfdb_write_query_record_t gfdb_write_query_record;
- gfdb_read_query_record_t gfdb_read_query_record;
-
- /* Link info related functions */
- gfdb_link_info_new_t gfdb_link_info_new;
- gfdb_link_info_free_t gfdb_link_info_free;
-
- /* Compaction related functions */
- compact_db_t compact_db;
+ init_db_t init_db;
+ fini_db_t fini_db;
+ find_all_t find_all;
+ find_unchanged_for_time_t find_unchanged_for_time;
+ find_recently_changed_files_t find_recently_changed_files;
+ find_unchanged_for_time_freq_t find_unchanged_for_time_freq;
+ find_recently_changed_files_freq_t find_recently_changed_files_freq;
+ clear_files_heat_t clear_files_heat;
+ get_db_version_t get_db_version;
+ get_db_params_t get_db_params;
+ set_db_params_t set_db_params;
+ /* Do not expose dbpath directly. Expose it via an */
+ /* access function: get_db_path_key(). */
+ char *dbpath;
+ get_db_path_key_t get_db_path_key;
+
+ /* Query Record related functions */
+ gfdb_query_record_new_t gfdb_query_record_new;
+ gfdb_query_record_free_t gfdb_query_record_free;
+ gfdb_add_link_to_query_record_t gfdb_add_link_to_query_record;
+ gfdb_write_query_record_t gfdb_write_query_record;
+ gfdb_read_query_record_t gfdb_read_query_record;
+
+ /* Link info related functions */
+ gfdb_link_info_new_t gfdb_link_info_new;
+ gfdb_link_info_free_t gfdb_link_info_free;
+
+ /* Compaction related functions */
+ compact_db_t compact_db;
} gfdb_methods_t;
-void get_gfdb_methods (gfdb_methods_t *methods);
+void
+get_gfdb_methods(gfdb_methods_t *methods);
-typedef void (*get_gfdb_methods_t) (gfdb_methods_t *methods);
+typedef void (*get_gfdb_methods_t)(gfdb_methods_t *methods);
#endif
diff --git a/libglusterfs/src/gfdb/gfdb_data_store_helper.h b/libglusterfs/src/gfdb/gfdb_data_store_helper.h
index 7e81aab08a6..7b4b0ae6aa1 100644
--- a/libglusterfs/src/gfdb/gfdb_data_store_helper.h
+++ b/libglusterfs/src/gfdb/gfdb_data_store_helper.h
@@ -22,8 +22,7 @@
#include "byte-order.h"
#include "libglusterfs-messages.h"
-
-#define GFDB_DATA_STORE "gfdbdatastore"
+#define GFDB_DATA_STORE "gfdbdatastore"
/*******************************************************************************
*
@@ -39,71 +38,50 @@
/*Structure to hold the link information*/
typedef struct gfdb_link_info {
- uuid_t pargfid;
- char file_name[GF_NAME_MAX];
- struct list_head list;
+ uuid_t pargfid;
+ char file_name[GF_NAME_MAX];
+ struct list_head list;
} gfdb_link_info_t;
-
/*Structure used for querying purpose*/
typedef struct gfdb_query_record {
- uuid_t gfid;
- /*This is the hardlink list*/
- struct list_head link_list;
- int link_count;
+ uuid_t gfid;
+ /*This is the hardlink list*/
+ struct list_head link_list;
+ int link_count;
} gfdb_query_record_t;
/*Create a single link info structure*/
-gfdb_link_info_t *gfdb_link_info_new ();
-typedef gfdb_link_info_t *(*gfdb_link_info_new_t) ();
+gfdb_link_info_t *
+gfdb_link_info_new();
+typedef gfdb_link_info_t *(*gfdb_link_info_new_t)();
/*Destroy a link info structure*/
void
-gfdb_link_info_free (gfdb_link_info_t *gfdb_link_info);
-typedef void
-(*gfdb_link_info_free_t) (gfdb_link_info_t *gfdb_link_info);
+gfdb_link_info_free(gfdb_link_info_t *gfdb_link_info);
+typedef void (*gfdb_link_info_free_t)(gfdb_link_info_t *gfdb_link_info);
/* Function to create the query_record */
gfdb_query_record_t *
gfdb_query_record_new();
-typedef gfdb_query_record_t *
-(*gfdb_query_record_new_t)();
-
-
-
+typedef gfdb_query_record_t *(*gfdb_query_record_new_t)();
/* Function to add linkinfo to query record */
int
-gfdb_add_link_to_query_record (gfdb_query_record_t *gfdb_query_record,
- uuid_t pgfid,
- char *base_name);
-typedef int
-(*gfdb_add_link_to_query_record_t) (gfdb_query_record_t *, uuid_t, char *);
-
-
-
+gfdb_add_link_to_query_record(gfdb_query_record_t *gfdb_query_record,
+ uuid_t pgfid, char *base_name);
+typedef int (*gfdb_add_link_to_query_record_t)(gfdb_query_record_t *, uuid_t,
+ char *);
/*Function to destroy query record*/
void
-gfdb_query_record_free (gfdb_query_record_t *gfdb_query_record);
-typedef void
-(*gfdb_query_record_free_t) (gfdb_query_record_t *);
-
-
-
-
-
+gfdb_query_record_free(gfdb_query_record_t *gfdb_query_record);
+typedef void (*gfdb_query_record_free_t)(gfdb_query_record_t *);
/* Function to write query record to file */
int
-gfdb_write_query_record (int fd,
- gfdb_query_record_t *gfdb_query_record);
-typedef int
-(*gfdb_write_query_record_t) (int, gfdb_query_record_t *);
-
-
-
-
+gfdb_write_query_record(int fd, gfdb_query_record_t *gfdb_query_record);
+typedef int (*gfdb_write_query_record_t)(int, gfdb_query_record_t *);
/* Function to read query record from file.
* Allocates memory to query record and return 0 when successful
@@ -111,10 +89,7 @@ typedef int
* Return 0 when EOF.
* */
int
-gfdb_read_query_record (int fd,
- gfdb_query_record_t **gfdb_query_record);
-typedef int
-(*gfdb_read_query_record_t) (int, gfdb_query_record_t **);
-
+gfdb_read_query_record(int fd, gfdb_query_record_t **gfdb_query_record);
+typedef int (*gfdb_read_query_record_t)(int, gfdb_query_record_t **);
#endif \ No newline at end of file
diff --git a/libglusterfs/src/gfdb/gfdb_data_store_types.h b/libglusterfs/src/gfdb/gfdb_data_store_types.h
index f20ae4ded78..5ee050d4fab 100644
--- a/libglusterfs/src/gfdb/gfdb_data_store_types.h
+++ b/libglusterfs/src/gfdb/gfdb_data_store_types.h
@@ -16,70 +16,67 @@
* Helps in dynamically choosing log level
* */
static inline gf_loglevel_t
-_gfdb_log_level (gf_loglevel_t given_level,
- gf_boolean_t ignore_level)
+_gfdb_log_level(gf_loglevel_t given_level, gf_boolean_t ignore_level)
{
- return (ignore_level) ? GF_LOG_DEBUG : given_level;
+ return (ignore_level) ? GF_LOG_DEBUG : given_level;
}
typedef enum gf_db_operation {
- GFDB_INVALID_DB_OP = -1,
- /* Query DB OPS : All the Query DB_OP should be added */
- /* in between START and END */
- GFDB_QUERY_DB_OP_START, /* Start of Query DB_OP */
- GFDB_QUERY_DB_OP,
- GF_FTABLE_EXISTS_DB_OP,
- GFDB_QUERY_DB_OP_END, /* End of Query DB_OP */
- /* Non-Query DB OPS */
- GFDB_DB_CREATE_DB_OP,
- GFDB_GFID_EXIST_DB_OP,
- GFDB_W_INSERT_DB_OP,
- GFDB_WU_INSERT_DB_OP,
- GFDB_W_UPDATE_DB_OP,
- GFDB_WU_UPDATE_DB_OP,
- GFDB_W_DELETE_DB_OP,
- GFDB_UW_DELETE_DB_OP,
- GFDB_WFC_UPDATE_DB_OP,
- GFDB_RFC_UPDATE_DB_OP,
- GFDB_DB_COMPACT_DB_OP /* Added for VACUUM/manual compaction support */
+ GFDB_INVALID_DB_OP = -1,
+ /* Query DB OPS : All the Query DB_OP should be added */
+ /* in between START and END */
+ GFDB_QUERY_DB_OP_START, /* Start of Query DB_OP */
+ GFDB_QUERY_DB_OP,
+ GF_FTABLE_EXISTS_DB_OP,
+ GFDB_QUERY_DB_OP_END, /* End of Query DB_OP */
+ /* Non-Query DB OPS */
+ GFDB_DB_CREATE_DB_OP,
+ GFDB_GFID_EXIST_DB_OP,
+ GFDB_W_INSERT_DB_OP,
+ GFDB_WU_INSERT_DB_OP,
+ GFDB_W_UPDATE_DB_OP,
+ GFDB_WU_UPDATE_DB_OP,
+ GFDB_W_DELETE_DB_OP,
+ GFDB_UW_DELETE_DB_OP,
+ GFDB_WFC_UPDATE_DB_OP,
+ GFDB_RFC_UPDATE_DB_OP,
+ GFDB_DB_COMPACT_DB_OP /* Added for VACUUM/manual compaction support */
} gf_db_operation_t;
-
-#define GF_COL_MAX_NUM 2
-#define GF_COL_ALL " * "
+#define GF_COL_MAX_NUM 2
+#define GF_COL_ALL " * "
/* Column/fields names used in the DB.
* If any new field is added should be updated here*/
-#define GF_COL_GF_ID "GF_ID"
-#define GF_COL_GF_PID "GF_PID"
-#define GF_COL_FILE_NAME "FNAME"
-#define GF_COL_WSEC "W_SEC"
-#define GF_COL_WMSEC "W_MSEC"
-#define GF_COL_UWSEC "UW_SEC"
-#define GF_COL_UWMSEC "UW_MSEC"
-#define GF_COL_WSEC_READ "W_READ_SEC"
-#define GF_COL_WMSEC_READ "W_READ_MSEC"
-#define GF_COL_UWSEC_READ "UW_READ_SEC"
-#define GF_COL_UWMSEC_READ "UW_READ_MSEC"
-#define GF_COL_WDEL_FLAG "W_DEL_FLAG"
-#define GF_COL_WRITE_FREQ_CNTR "WRITE_FREQ_CNTR"
-#define GF_COL_READ_FREQ_CNTR "READ_FREQ_CNTR"
-#define GF_COL_LINK_UPDATE "LINK_UPDATE"
-
+#define GF_COL_GF_ID "GF_ID"
+#define GF_COL_GF_PID "GF_PID"
+#define GF_COL_FILE_NAME "FNAME"
+#define GF_COL_WSEC "W_SEC"
+#define GF_COL_WMSEC "W_MSEC"
+#define GF_COL_UWSEC "UW_SEC"
+#define GF_COL_UWMSEC "UW_MSEC"
+#define GF_COL_WSEC_READ "W_READ_SEC"
+#define GF_COL_WMSEC_READ "W_READ_MSEC"
+#define GF_COL_UWSEC_READ "UW_READ_SEC"
+#define GF_COL_UWMSEC_READ "UW_READ_MSEC"
+#define GF_COL_WDEL_FLAG "W_DEL_FLAG"
+#define GF_COL_WRITE_FREQ_CNTR "WRITE_FREQ_CNTR"
+#define GF_COL_READ_FREQ_CNTR "READ_FREQ_CNTR"
+#define GF_COL_LINK_UPDATE "LINK_UPDATE"
/***********************Time related********************************/
/*1 sec = 1000000 microsec*/
-#define GFDB_MICROSEC 1000000
+#define GFDB_MICROSEC 1000000
/*All the gfdb times are represented using this structure*/
-typedef struct timeval gfdb_time_t;
+typedef struct timeval gfdb_time_t;
/*Convert time into seconds*/
static inline uint64_t
gfdb_time_2_usec(gfdb_time_t *gfdb_time)
{
- GF_ASSERT(gfdb_time);
- return ((uint64_t) gfdb_time->tv_sec * GFDB_MICROSEC) + gfdb_time->tv_usec;
+ GF_ASSERT(gfdb_time);
+ return ((uint64_t)gfdb_time->tv_sec * GFDB_MICROSEC) + gfdb_time->tv_usec;
}
/******************************************************************************
@@ -91,82 +88,82 @@ gfdb_time_2_usec(gfdb_time_t *gfdb_time)
/*Indicated a generic synchronous write to the db
* This may or may not be implemented*/
typedef enum gfdb_sync_type {
- GFDB_INVALID_SYNC = -1,
- GFDB_DB_ASYNC,
- GFDB_DB_SYNC
+ GFDB_INVALID_SYNC = -1,
+ GFDB_DB_ASYNC,
+ GFDB_DB_SYNC
} gfdb_sync_type_t;
/*Strings related to the abvove sync type*/
-#define GFDB_STR_DB_ASYNC "async"
-#define GFDB_STR_DB_SYNC "sync"
+#define GFDB_STR_DB_ASYNC "async"
+#define GFDB_STR_DB_SYNC "sync"
/*To convert sync type from string to gfdb_sync_type_t*/
static inline int
-gf_string2gfdbdbsync (char *sync_option)
+gf_string2gfdbdbsync(char *sync_option)
{
- int ret = -1;
-
- if (!sync_option)
- goto out;
- if (strcmp(sync_option, GFDB_STR_DB_ASYNC) == 0) {
- ret = GFDB_DB_ASYNC;
- } else if (strcmp(sync_option, GFDB_STR_DB_SYNC) == 0) {
- ret = GFDB_DB_SYNC;
- }
+ int ret = -1;
+
+ if (!sync_option)
+ goto out;
+ if (strcmp(sync_option, GFDB_STR_DB_ASYNC) == 0) {
+ ret = GFDB_DB_ASYNC;
+ } else if (strcmp(sync_option, GFDB_STR_DB_SYNC) == 0) {
+ ret = GFDB_DB_SYNC;
+ }
out:
- return ret;
+ return ret;
}
/*Indicated different types of db*/
typedef enum gfdb_db_type {
- GFDB_INVALID_DB = -1,
- GFDB_HASH_FILE_STORE,
- GFDB_ROCKS_DB,
- GFDB_SQLITE3,
- GFDB_HYPERDEX,
- GFDB_DB_END /*Add DB type Entries above this only*/
+ GFDB_INVALID_DB = -1,
+ GFDB_HASH_FILE_STORE,
+ GFDB_ROCKS_DB,
+ GFDB_SQLITE3,
+ GFDB_HYPERDEX,
+ GFDB_DB_END /*Add DB type Entries above this only*/
} gfdb_db_type_t;
/*String related to the db types*/
-#define GFDB_STR_HASH_FILE_STORE "hashfile"
-#define GFDB_STR_ROCKS_DB "rocksdb"
-#define GFDB_STR_SQLITE3 "sqlite3"
-#define GFDB_STR_HYPERDEX "hyperdex"
+#define GFDB_STR_HASH_FILE_STORE "hashfile"
+#define GFDB_STR_ROCKS_DB "rocksdb"
+#define GFDB_STR_SQLITE3 "sqlite3"
+#define GFDB_STR_HYPERDEX "hyperdex"
/*Convert db type in string to gfdb_db_type_t*/
static inline int
-gf_string2gfdbdbtype (char *db_option)
+gf_string2gfdbdbtype(char *db_option)
{
- int ret = -1;
-
- if (!db_option)
- goto out;
- if (strcmp(db_option, GFDB_STR_HASH_FILE_STORE) == 0) {
- ret = GFDB_HASH_FILE_STORE;
- } else if (strcmp(db_option, GFDB_STR_ROCKS_DB) == 0) {
- ret = GFDB_ROCKS_DB;
- } else if (strcmp(db_option, GFDB_STR_SQLITE3) == 0) {
- ret = GFDB_SQLITE3;
- } else if (strcmp(db_option, GFDB_STR_HYPERDEX) == 0) {
- ret = GFDB_HYPERDEX;
- }
+ int ret = -1;
+
+ if (!db_option)
+ goto out;
+ if (strcmp(db_option, GFDB_STR_HASH_FILE_STORE) == 0) {
+ ret = GFDB_HASH_FILE_STORE;
+ } else if (strcmp(db_option, GFDB_STR_ROCKS_DB) == 0) {
+ ret = GFDB_ROCKS_DB;
+ } else if (strcmp(db_option, GFDB_STR_SQLITE3) == 0) {
+ ret = GFDB_SQLITE3;
+ } else if (strcmp(db_option, GFDB_STR_HYPERDEX) == 0) {
+ ret = GFDB_HYPERDEX;
+ }
out:
- return ret;
+ return ret;
}
/*Tells the path of the fop*/
typedef enum gfdb_fop_path {
- GFDB_FOP_INVALID = -1,
- /*Filler value for zero*/
- GFDB_FOP_PATH_ZERO = 0,
- /*have wind path below this*/
- GFDB_FOP_WIND = 1,
- GFDB_FOP_WDEL = 2,
- /*have unwind path below this*/
- GFDB_FOP_UNWIND = 4,
- /*Delete unwind path*/
- GFDB_FOP_UNDEL = 8,
- GFDB_FOP_UNDEL_ALL = 16
+ GFDB_FOP_INVALID = -1,
+ /*Filler value for zero*/
+ GFDB_FOP_PATH_ZERO = 0,
+ /*have wind path below this*/
+ GFDB_FOP_WIND = 1,
+ GFDB_FOP_WDEL = 2,
+ /*have unwind path below this*/
+ GFDB_FOP_UNWIND = 4,
+ /*Delete unwind path*/
+ GFDB_FOP_UNDEL = 8,
+ GFDB_FOP_UNDEL_ALL = 16
} gfdb_fop_path_t;
/*Strings related to the above fop path*/
#define GFDB_STR_FOP_INVALID "INVALID"
@@ -178,107 +175,104 @@ typedef enum gfdb_fop_path {
static inline gf_boolean_t
iswindpath(gfdb_fop_path_t gfdb_fop_path)
{
- return ((gfdb_fop_path == GFDB_FOP_WIND) ||
- (gfdb_fop_path == GFDB_FOP_WDEL)) ?
- _gf_true : _gf_false;
+ return ((gfdb_fop_path == GFDB_FOP_WIND) ||
+ (gfdb_fop_path == GFDB_FOP_WDEL))
+ ? _gf_true
+ : _gf_false;
}
static inline gf_boolean_t
isunwindpath(gfdb_fop_path_t gfdb_fop_path)
{
- return (gfdb_fop_path >= GFDB_FOP_UNWIND) ? _gf_true : _gf_false;
+ return (gfdb_fop_path >= GFDB_FOP_UNWIND) ? _gf_true : _gf_false;
}
/*Tell what type of fop it was
* Like whether a dentry fop or a inode fop
* Read fop or a write fop etc*/
typedef enum gfdb_fop_type {
- GFDB_FOP_INVALID_OP = -1,
- /*Filler value for zero*/
- GFDB_FOP_TYPE_ZERO = 0,
- GFDB_FOP_DENTRY_OP = 1,
- GFDB_FOP_DENTRY_CREATE_OP = 2,
- GFDB_FOP_INODE_OP = 4,
- GFDB_FOP_WRITE_OP = 8,
- GFDB_FOP_READ_OP = 16
+ GFDB_FOP_INVALID_OP = -1,
+ /*Filler value for zero*/
+ GFDB_FOP_TYPE_ZERO = 0,
+ GFDB_FOP_DENTRY_OP = 1,
+ GFDB_FOP_DENTRY_CREATE_OP = 2,
+ GFDB_FOP_INODE_OP = 4,
+ GFDB_FOP_WRITE_OP = 8,
+ GFDB_FOP_READ_OP = 16
} gfdb_fop_type_t;
-#define GFDB_FOP_INODE_WRITE\
- (GFDB_FOP_INODE_OP | GFDB_FOP_WRITE_OP)
+#define GFDB_FOP_INODE_WRITE (GFDB_FOP_INODE_OP | GFDB_FOP_WRITE_OP)
-#define GFDB_FOP_DENTRY_WRITE\
- (GFDB_FOP_DENTRY_OP | GFDB_FOP_WRITE_OP)
+#define GFDB_FOP_DENTRY_WRITE (GFDB_FOP_DENTRY_OP | GFDB_FOP_WRITE_OP)
-#define GFDB_FOP_CREATE_WRITE\
- (GFDB_FOP_DENTRY_CREATE_OP | GFDB_FOP_WRITE_OP)
+#define GFDB_FOP_CREATE_WRITE (GFDB_FOP_DENTRY_CREATE_OP | GFDB_FOP_WRITE_OP)
-#define GFDB_FOP_INODE_READ\
- (GFDB_FOP_INODE_OP | GFDB_FOP_READ_OP)
+#define GFDB_FOP_INODE_READ (GFDB_FOP_INODE_OP | GFDB_FOP_READ_OP)
static inline gf_boolean_t
isreadfop(gfdb_fop_type_t fop_type)
{
- return (fop_type & GFDB_FOP_READ_OP) ? _gf_true : _gf_false;
+ return (fop_type & GFDB_FOP_READ_OP) ? _gf_true : _gf_false;
}
static inline gf_boolean_t
isdentryfop(gfdb_fop_type_t fop_type)
{
- return ((fop_type & GFDB_FOP_DENTRY_OP) ||
- (fop_type & GFDB_FOP_DENTRY_CREATE_OP)) ? _gf_true : _gf_false;
+ return ((fop_type & GFDB_FOP_DENTRY_OP) ||
+ (fop_type & GFDB_FOP_DENTRY_CREATE_OP))
+ ? _gf_true
+ : _gf_false;
}
static inline gf_boolean_t
isdentrycreatefop(gfdb_fop_type_t fop_type)
{
- return (fop_type & GFDB_FOP_DENTRY_CREATE_OP) ?
- _gf_true : _gf_false;
+ return (fop_type & GFDB_FOP_DENTRY_CREATE_OP) ? _gf_true : _gf_false;
}
/*The structure that is used to send insert/update the databases
* using insert_db api*/
typedef struct gfdb_db_record {
- /* GFID */
- uuid_t gfid;
- /* Used during a rename refer ctr_rename() in changetimerecorder
- * xlator*/
- uuid_t old_gfid;
- /* Parent GFID */
- uuid_t pargfid;
- uuid_t old_pargfid;
- /* File names */
- char file_name[GF_NAME_MAX + 1];
- char old_file_name[GF_NAME_MAX + 1];
- /* FOP type and FOP path*/
- gfdb_fop_type_t gfdb_fop_type;
- gfdb_fop_path_t gfdb_fop_path;
- /*Time of change or access*/
- gfdb_time_t gfdb_wind_change_time;
- gfdb_time_t gfdb_unwind_change_time;
- /* For crash consistency while inserting/updating hard links */
- gf_boolean_t islinkupdate;
- /* For link consistency we do a double update i.e mark the link
- * during the wind and during the unwind we update/delete the link.
- * This has a performance hit. We give a choice here whether we need
- * link consistency to be spoton or not using link_consistency flag.
- * This will have only one link update */
- gf_boolean_t link_consistency;
- /* For dentry fops we can choose to ignore recording of unwind time */
- /* For inode fops "record_exit" volume option does the trick, */
- /* but for dentry fops we update the LINK_UPDATE, so an extra */
- /* flag is provided to ignore the recording of the unwind time. */
- gf_boolean_t do_record_uwind_time;
- /* Global flag to record or not record counters */
- gf_boolean_t do_record_counters;
- /* Global flag to Record/Not Record wind or wind time.
- * This flag will overrule do_record_uwind_time*/
- gf_boolean_t do_record_times;
- /* Ignoring errors while inserting.
- * */
- gf_boolean_t ignore_errors;
+ /* GFID */
+ uuid_t gfid;
+ /* Used during a rename refer ctr_rename() in changetimerecorder
+ * xlator*/
+ uuid_t old_gfid;
+ /* Parent GFID */
+ uuid_t pargfid;
+ uuid_t old_pargfid;
+ /* File names */
+ char file_name[GF_NAME_MAX + 1];
+ char old_file_name[GF_NAME_MAX + 1];
+ /* FOP type and FOP path*/
+ gfdb_fop_type_t gfdb_fop_type;
+ gfdb_fop_path_t gfdb_fop_path;
+ /*Time of change or access*/
+ gfdb_time_t gfdb_wind_change_time;
+ gfdb_time_t gfdb_unwind_change_time;
+ /* For crash consistency while inserting/updating hard links */
+ gf_boolean_t islinkupdate;
+ /* For link consistency we do a double update i.e mark the link
+ * during the wind and during the unwind we update/delete the link.
+ * This has a performance hit. We give a choice here whether we need
+ * link consistency to be spoton or not using link_consistency flag.
+ * This will have only one link update */
+ gf_boolean_t link_consistency;
+ /* For dentry fops we can choose to ignore recording of unwind time */
+ /* For inode fops "record_exit" volume option does the trick, */
+ /* but for dentry fops we update the LINK_UPDATE, so an extra */
+ /* flag is provided to ignore the recording of the unwind time. */
+ gf_boolean_t do_record_uwind_time;
+ /* Global flag to record or not record counters */
+ gf_boolean_t do_record_counters;
+ /* Global flag to Record/Not Record wind or wind time.
+ * This flag will overrule do_record_uwind_time*/
+ gf_boolean_t do_record_times;
+ /* Ignoring errors while inserting.
+ * */
+ gf_boolean_t ignore_errors;
} gfdb_db_record_t;
-
/*******************************************************************************
*
* Signatures for the plugin functions
@@ -289,8 +283,7 @@ typedef struct gfdb_db_record {
* ****************************************************************************/
/*Call back function for querying the database*/
-typedef int
-(*gf_query_callback_t)(gfdb_query_record_t *, void *);
+typedef int (*gf_query_callback_t)(gfdb_query_record_t *, void *);
/* Used to initialize db connection
* Arguments:
@@ -301,11 +294,7 @@ typedef int
* If call is unsuccessful will have NULL.
* Returns : if successful return 0 or
* -ve value in case of failure*/
-typedef int
-(*gfdb_init_db_t)(dict_t *args, void **db_conn);
-
-
-
+typedef int (*gfdb_init_db_t)(dict_t *args, void **db_conn);
/* Used to terminate/de-initialize db connection
* (Destructor function for db connection object)
@@ -313,11 +302,7 @@ typedef int
* db_conn : plugin specific data base connection
* Returns : if successful return 0 or
* -ve value in case of failure*/
-typedef int
-(*gfdb_fini_db_t)(void **db_conn);
-
-
-
+typedef int (*gfdb_fini_db_t)(void **db_conn);
/*Used to insert/updated records in the database
* Arguments:
@@ -325,12 +310,7 @@ typedef int
* gfdb_db_record : Record to be inserted/updated
* Returns : if successful return 0 or
* -ve value in case of failure*/
-typedef int
-(*gfdb_insert_record_t)(void *db_conn,
- gfdb_db_record_t *db_record);
-
-
-
+typedef int (*gfdb_insert_record_t)(void *db_conn, gfdb_db_record_t *db_record);
/*Used to delete record from the database
* Arguments:
@@ -338,12 +318,7 @@ typedef int
* gfdb_db_record : Record to be deleted
* Returns : if successful return 0 or
* -ve value in case of failure*/
-typedef int
-(*gfdb_delete_record_t)(void *db_conn,
- gfdb_db_record_t *db_record);
-
-
-
+typedef int (*gfdb_delete_record_t)(void *db_conn, gfdb_db_record_t *db_record);
/*Used to compact the database
* Arguments:
@@ -352,12 +327,8 @@ typedef int
* compact_mode_switched : Was the compaction switch flipped?
* Returns : if successful return 0 or
* -ve value in case of failure*/
-typedef int
-(*gfdb_compact_db_t)(void *db_conn, gf_boolean_t compact_active,
- gf_boolean_t compact_mode_switched);
-
-
-
+typedef int (*gfdb_compact_db_t)(void *db_conn, gf_boolean_t compact_active,
+ gf_boolean_t compact_mode_switched);
/* Query all the records from the database
* Arguments:
@@ -373,14 +344,9 @@ typedef int
*
* Returns : if successful return 0 or
* -ve value in case of failure*/
-typedef int
-(*gfdb_find_all_t)(void *db_conn,
+typedef int (*gfdb_find_all_t)(void *db_conn,
gf_query_callback_t query_callback,
- void *_cbk_args,
- int query_limit);
-
-
-
+ void *_cbk_args, int query_limit);
/* Query records/files that have not changed/accessed
* from a time in past to current time
@@ -394,13 +360,9 @@ typedef int
* changed/accessed
* Returns : if successful return 0 or
* -ve value in case of failure*/
-typedef int
-(*gfdb_find_unchanged_for_time_t)(void *db_conn,
- gf_query_callback_t query_callback,
- void *_cbk_args,
- gfdb_time_t *_time);
-
-
+typedef int (*gfdb_find_unchanged_for_time_t)(
+ void *db_conn, gf_query_callback_t query_callback, void *_cbk_args,
+ gfdb_time_t *_time);
/* Query records/files that have changed/accessed from a
* time in past to current time
@@ -414,10 +376,9 @@ typedef int
* changed/accessed
* Returns : if successful return 0 or
* -ve value in case of failure*/
-typedef int
-(*gfdb_find_recently_changed_files_t)(void *db_conn,
- gf_query_callback_t query_callback,
- void *_cbk_args, gfdb_time_t *_time);
+typedef int (*gfdb_find_recently_changed_files_t)(
+ void *db_conn, gf_query_callback_t query_callback, void *_cbk_args,
+ gfdb_time_t *_time);
/* Query records/files that have not changed/accessed
* from a time in past to current time, with
@@ -437,16 +398,10 @@ typedef int
* all files.
* Returns : if successful return 0 or
* -ve value in case of failure*/
-typedef int
-(*gfdb_find_unchanged_for_time_freq_t)
- (void *db_conn,
- gf_query_callback_t query_callback,
- void *_cbk_args, gfdb_time_t *_time,
- int _write_freq, int _read_freq,
- gf_boolean_t _clear_counters);
-
-
-
+typedef int (*gfdb_find_unchanged_for_time_freq_t)(
+ void *db_conn, gf_query_callback_t query_callback, void *_cbk_args,
+ gfdb_time_t *_time, int _write_freq, int _read_freq,
+ gf_boolean_t _clear_counters);
/* Query records/files that have changed/accessed from a
* time in past to current time, with a desired frequency
@@ -464,47 +419,37 @@ typedef int
* all files.
* Returns : if successful return 0 or
* -ve value in case of failure*/
-typedef int
-(*gfdb_find_recently_changed_files_freq_t)(void *db_conn,
- gf_query_callback_t query_callback,
- void *_cbk_args, gfdb_time_t *_time,
- int _write_freq, int _read_freq,
- gf_boolean_t _clear_counters);
-
+typedef int (*gfdb_find_recently_changed_files_freq_t)(
+ void *db_conn, gf_query_callback_t query_callback, void *_cbk_args,
+ gfdb_time_t *_time, int _write_freq, int _read_freq,
+ gf_boolean_t _clear_counters);
typedef int (*gfdb_clear_files_heat_t)(void *db_conn);
-typedef int (*gfdb_get_db_version_t)(void *db_conn,
- char **version);
-
-typedef int (*gfdb_get_db_params_t)(void *db_conn,
- char *param_key,
- char **param_value);
-
-typedef int (*gfdb_set_db_params_t)(void *db_conn,
- char *param_key,
- char *param_value);
+typedef int (*gfdb_get_db_version_t)(void *db_conn, char **version);
+typedef int (*gfdb_get_db_params_t)(void *db_conn, char *param_key,
+ char **param_value);
+typedef int (*gfdb_set_db_params_t)(void *db_conn, char *param_key,
+ char *param_value);
/*Data structure holding all the above plugin function pointers*/
typedef struct gfdb_db_operations {
- gfdb_init_db_t init_db_op;
- gfdb_fini_db_t fini_db_op;
- gfdb_insert_record_t insert_record_op;
- gfdb_delete_record_t delete_record_op;
- gfdb_compact_db_t compact_db_op;
- gfdb_find_all_t find_all_op;
- gfdb_find_unchanged_for_time_t find_unchanged_for_time_op;
- gfdb_find_recently_changed_files_t find_recently_changed_files_op;
- gfdb_find_unchanged_for_time_freq_t
- find_unchanged_for_time_freq_op;
- gfdb_find_recently_changed_files_freq_t
- find_recently_changed_files_freq_op;
- gfdb_clear_files_heat_t clear_files_heat_op;
- gfdb_get_db_version_t get_db_version;
- gfdb_get_db_params_t get_db_params;
- gfdb_set_db_params_t set_db_params;
+ gfdb_init_db_t init_db_op;
+ gfdb_fini_db_t fini_db_op;
+ gfdb_insert_record_t insert_record_op;
+ gfdb_delete_record_t delete_record_op;
+ gfdb_compact_db_t compact_db_op;
+ gfdb_find_all_t find_all_op;
+ gfdb_find_unchanged_for_time_t find_unchanged_for_time_op;
+ gfdb_find_recently_changed_files_t find_recently_changed_files_op;
+ gfdb_find_unchanged_for_time_freq_t find_unchanged_for_time_freq_op;
+ gfdb_find_recently_changed_files_freq_t find_recently_changed_files_freq_op;
+ gfdb_clear_files_heat_t clear_files_heat_op;
+ gfdb_get_db_version_t get_db_version;
+ gfdb_get_db_params_t get_db_params;
+ gfdb_set_db_params_t set_db_params;
} gfdb_db_operations_t;
/*******************************************************************************
@@ -518,75 +463,70 @@ typedef struct gfdb_db_operations {
*
* ****************************************************************************/
-
typedef struct gfdb_connection {
- void *gf_db_connection;
- gfdb_db_operations_t gfdb_db_operations;
- gfdb_db_type_t gfdb_db_type;
+ void *gf_db_connection;
+ gfdb_db_operations_t gfdb_db_operations;
+ gfdb_db_type_t gfdb_db_type;
} gfdb_connection_t;
-
-
-
/*******************************************************************************
*
* Macros for get and set db options
*
* ****************************************************************************/
-
/*Set param_key : str_value into param_dict*/
-#define SET_DB_PARAM_TO_DICT(comp_name, params_dict, param_key,\
- str_value, ret, error)\
- do {\
- data_t *data = NULL;\
- data = str_to_data (str_value);\
- if (!data)\
- goto error;\
- ret = dict_add (params_dict, param_key, data);\
- if (ret) {\
- gf_msg (comp_name, GF_LOG_ERROR, 0,\
- LG_MSG_SET_PARAM_FAILED, "Failed setting %s "\
- "to params dictionary", param_key);\
- data_destroy (data);\
- goto error;\
- };\
- } while (0)
+#define SET_DB_PARAM_TO_DICT(comp_name, params_dict, param_key, str_value, \
+ ret, error) \
+ do { \
+ data_t *data = NULL; \
+ data = str_to_data(str_value); \
+ if (!data) \
+ goto error; \
+ ret = dict_add(params_dict, param_key, data); \
+ if (ret) { \
+ gf_msg(comp_name, GF_LOG_ERROR, 0, LG_MSG_SET_PARAM_FAILED, \
+ "Failed setting %s " \
+ "to params dictionary", \
+ param_key); \
+ data_destroy(data); \
+ goto error; \
+ }; \
+ } while (0)
/*get str_value of param_key from param_dict*/
-#define GET_DB_PARAM_FROM_DICT(comp_name, params_dict, param_key, str_value,\
- error)\
- do {\
- data_t *data = NULL;\
- data = dict_get (params_dict, param_key);\
- if (!data) {\
- gf_msg (comp_name, GF_LOG_ERROR, 0,\
- LG_MSG_GET_PARAM_FAILED, "Failed to retrieve "\
- "%s from params", param_key);\
- goto error;\
- } else {\
- str_value = data->data;\
- };\
- } while (0)
-
+#define GET_DB_PARAM_FROM_DICT(comp_name, params_dict, param_key, str_value, \
+ error) \
+ do { \
+ data_t *data = NULL; \
+ data = dict_get(params_dict, param_key); \
+ if (!data) { \
+ gf_msg(comp_name, GF_LOG_ERROR, 0, LG_MSG_GET_PARAM_FAILED, \
+ "Failed to retrieve " \
+ "%s from params", \
+ param_key); \
+ goto error; \
+ } else { \
+ str_value = data->data; \
+ }; \
+ } while (0)
/*get str_value of param_key from param_dict. if param_key is not present
* set _default_v to str_value */
-#define GET_DB_PARAM_FROM_DICT_DEFAULT(comp_name, params_dict, param_key,\
- str_value, _default_v)\
- do {\
- data_t *data = NULL;\
- data = dict_get (params_dict, param_key);\
- if (!data) {\
- str_value = _default_v;\
- gf_msg (comp_name, GF_LOG_TRACE, 0,\
- LG_MSG_GET_PARAM_FAILED, "Failed to retrieve "\
- "%s from params.Assigning default value: %s",\
- param_key, _default_v);\
- } else {\
- str_value = data->data;\
- };\
- } while (0)
-
+#define GET_DB_PARAM_FROM_DICT_DEFAULT(comp_name, params_dict, param_key, \
+ str_value, _default_v) \
+ do { \
+ data_t *data = NULL; \
+ data = dict_get(params_dict, param_key); \
+ if (!data) { \
+ str_value = _default_v; \
+ gf_msg(comp_name, GF_LOG_TRACE, 0, LG_MSG_GET_PARAM_FAILED, \
+ "Failed to retrieve " \
+ "%s from params.Assigning default value: %s", \
+ param_key, _default_v); \
+ } else { \
+ str_value = data->data; \
+ }; \
+ } while (0)
#endif
diff --git a/libglusterfs/src/gfdb/gfdb_mem-types.h b/libglusterfs/src/gfdb/gfdb_mem-types.h
index 2a84b47fcf5..0ea543b7ce1 100644
--- a/libglusterfs/src/gfdb/gfdb_mem-types.h
+++ b/libglusterfs/src/gfdb/gfdb_mem-types.h
@@ -8,15 +8,10 @@
cases as published by the Free Software Foundation.
*/
-
#ifndef __GFDB_MEM_TYPES_H__
#define __GFDB_MEM_TYPES_H__
#include "mem-types.h"
-enum gfdb_mem_types_ {
- gfdb_mtstart = gf_common_mt_end + 1,
- gfdb_mt_end
-};
+enum gfdb_mem_types_ { gfdb_mtstart = gf_common_mt_end + 1, gfdb_mt_end };
#endif
-
diff --git a/libglusterfs/src/gfdb/gfdb_sqlite3.h b/libglusterfs/src/gfdb/gfdb_sqlite3.h
index 11bf3e82707..d8af800db3c 100644
--- a/libglusterfs/src/gfdb/gfdb_sqlite3.h
+++ b/libglusterfs/src/gfdb/gfdb_sqlite3.h
@@ -10,7 +10,6 @@
#ifndef __GFDB_SQLITE3_H
#define __GFDB_SQLITE3_H
-
/*Sqlite3 header file*/
#include <sqlite3.h>
@@ -19,271 +18,255 @@
#include "gfdb_mem-types.h"
#include "libglusterfs-messages.h"
-#define GF_STMT_SIZE_MAX 2048
+#define GF_STMT_SIZE_MAX 2048
-#define GF_DB_NAME "gfdb.db"
-#define GF_FILE_TABLE "GF_FILE_TB"
-#define GF_FILE_LINK_TABLE "GF_FLINK_TB"
-#define GF_MASTER_TABLE "sqlite_master"
+#define GF_DB_NAME "gfdb.db"
+#define GF_FILE_TABLE "GF_FILE_TB"
+#define GF_FILE_LINK_TABLE "GF_FLINK_TB"
+#define GF_MASTER_TABLE "sqlite_master"
/*Since we have multiple tables to be created we put it in a transaction*/
-#define GF_CREATE_STMT(out_str)\
-do {\
- sprintf (out_str , "BEGIN; CREATE TABLE IF NOT EXISTS "\
- GF_FILE_TABLE\
- "(GF_ID TEXT PRIMARY KEY NOT NULL, "\
- "W_SEC INTEGER NOT NULL DEFAULT 0, "\
- "W_MSEC INTEGER NOT NULL DEFAULT 0, "\
- "UW_SEC INTEGER NOT NULL DEFAULT 0, "\
- "UW_MSEC INTEGER NOT NULL DEFAULT 0, "\
- "W_READ_SEC INTEGER NOT NULL DEFAULT 0, "\
- "W_READ_MSEC INTEGER NOT NULL DEFAULT 0, "\
- "UW_READ_SEC INTEGER NOT NULL DEFAULT 0, "\
- "UW_READ_MSEC INTEGER NOT NULL DEFAULT 0, "\
- "WRITE_FREQ_CNTR INTEGER NOT NULL DEFAULT 1, "\
- "READ_FREQ_CNTR INTEGER NOT NULL DEFAULT 1); "\
- "CREATE TABLE IF NOT EXISTS "\
- GF_FILE_LINK_TABLE\
- "(GF_ID TEXT NOT NULL, "\
- "GF_PID TEXT NOT NULL, "\
- "FNAME TEXT NOT NULL, "\
- "W_DEL_FLAG INTEGER NOT NULL DEFAULT 0, "\
- "LINK_UPDATE INTEGER NOT NULL DEFAULT 0, "\
- "PRIMARY KEY ( GF_ID, GF_PID, FNAME) "\
- ");"\
- "COMMIT;"\
- );;\
-} while (0)
-
-#define GF_COL_TB_WSEC GF_FILE_TABLE "." GF_COL_WSEC
-#define GF_COL_TB_WMSEC GF_FILE_TABLE "." GF_COL_WMSEC
-#define GF_COL_TB_UWSEC GF_FILE_TABLE "." GF_COL_UWSEC
-#define GF_COL_TB_UWMSEC GF_FILE_TABLE "." GF_COL_UWMSEC
-#define GF_COL_TB_RWSEC GF_FILE_TABLE "." GF_COL_WSEC_READ
-#define GF_COL_TB_RWMSEC GF_FILE_TABLE "." GF_COL_WMSEC_READ
-#define GF_COL_TB_RUWSEC GF_FILE_TABLE "." GF_COL_UWSEC_READ
-#define GF_COL_TB_RUWMSEC GF_FILE_TABLE "." GF_COL_UWMSEC_READ
-#define GF_COL_TB_WFC GF_FILE_TABLE "." GF_COL_WRITE_FREQ_CNTR
-#define GF_COL_TB_RFC GF_FILE_TABLE "." GF_COL_READ_FREQ_CNTR
-
+#define GF_CREATE_STMT(out_str) \
+ do { \
+ sprintf(out_str, "BEGIN; CREATE TABLE IF NOT EXISTS " GF_FILE_TABLE \
+ "(GF_ID TEXT PRIMARY KEY NOT NULL, " \
+ "W_SEC INTEGER NOT NULL DEFAULT 0, " \
+ "W_MSEC INTEGER NOT NULL DEFAULT 0, " \
+ "UW_SEC INTEGER NOT NULL DEFAULT 0, " \
+ "UW_MSEC INTEGER NOT NULL DEFAULT 0, " \
+ "W_READ_SEC INTEGER NOT NULL DEFAULT 0, " \
+ "W_READ_MSEC INTEGER NOT NULL DEFAULT 0, " \
+ "UW_READ_SEC INTEGER NOT NULL DEFAULT 0, " \
+ "UW_READ_MSEC INTEGER NOT NULL DEFAULT 0, " \
+ "WRITE_FREQ_CNTR INTEGER NOT NULL DEFAULT 1, " \
+ "READ_FREQ_CNTR INTEGER NOT NULL DEFAULT 1); " \
+ "CREATE TABLE IF NOT EXISTS " GF_FILE_LINK_TABLE \
+ "(GF_ID TEXT NOT NULL, " \
+ "GF_PID TEXT NOT NULL, " \
+ "FNAME TEXT NOT NULL, " \
+ "W_DEL_FLAG INTEGER NOT NULL DEFAULT 0, " \
+ "LINK_UPDATE INTEGER NOT NULL DEFAULT 0, " \
+ "PRIMARY KEY ( GF_ID, GF_PID, FNAME) " \
+ ");" \
+ "COMMIT;"); \
+ ; \
+ } while (0)
+
+#define GF_COL_TB_WSEC GF_FILE_TABLE "." GF_COL_WSEC
+#define GF_COL_TB_WMSEC GF_FILE_TABLE "." GF_COL_WMSEC
+#define GF_COL_TB_UWSEC GF_FILE_TABLE "." GF_COL_UWSEC
+#define GF_COL_TB_UWMSEC GF_FILE_TABLE "." GF_COL_UWMSEC
+#define GF_COL_TB_RWSEC GF_FILE_TABLE "." GF_COL_WSEC_READ
+#define GF_COL_TB_RWMSEC GF_FILE_TABLE "." GF_COL_WMSEC_READ
+#define GF_COL_TB_RUWSEC GF_FILE_TABLE "." GF_COL_UWSEC_READ
+#define GF_COL_TB_RUWMSEC GF_FILE_TABLE "." GF_COL_UWMSEC_READ
+#define GF_COL_TB_WFC GF_FILE_TABLE "." GF_COL_WRITE_FREQ_CNTR
+#define GF_COL_TB_RFC GF_FILE_TABLE "." GF_COL_READ_FREQ_CNTR
/*******************************************************************************
-* SQLITE3 Connection details and PRAGMA
-* ****************************************************************************/
-
-#define GF_SQL_AV_NONE "none"
-#define GF_SQL_AV_FULL "full"
-#define GF_SQL_AV_INCR "incremental"
-
-#define GF_SQL_SYNC_OFF "off"
-#define GF_SQL_SYNC_NORMAL "normal"
-#define GF_SQL_SYNC_FULL "full"
-
-#define GF_SQL_JM_DELETE "delete"
-#define GF_SQL_JM_TRUNCATE "truncate"
-#define GF_SQL_JM_PERSIST "persist"
-#define GF_SQL_JM_MEMORY "memory"
-#define GF_SQL_JM_WAL "wal"
-#define GF_SQL_JM_OFF "off"
-
-#define GF_SQL_COMPACT_NONE 0
-#define GF_SQL_COMPACT_FULL 1
-#define GF_SQL_COMPACT_INCR 2
+ * SQLITE3 Connection details and PRAGMA
+ * ****************************************************************************/
+
+#define GF_SQL_AV_NONE "none"
+#define GF_SQL_AV_FULL "full"
+#define GF_SQL_AV_INCR "incremental"
+
+#define GF_SQL_SYNC_OFF "off"
+#define GF_SQL_SYNC_NORMAL "normal"
+#define GF_SQL_SYNC_FULL "full"
+
+#define GF_SQL_JM_DELETE "delete"
+#define GF_SQL_JM_TRUNCATE "truncate"
+#define GF_SQL_JM_PERSIST "persist"
+#define GF_SQL_JM_MEMORY "memory"
+#define GF_SQL_JM_WAL "wal"
+#define GF_SQL_JM_OFF "off"
+
+#define GF_SQL_COMPACT_NONE 0
+#define GF_SQL_COMPACT_FULL 1
+#define GF_SQL_COMPACT_INCR 2
#define GF_SQL_COMPACT_MANUAL 3
-#define GF_SQL_COMPACT_DEF GF_SQL_COMPACT_INCR
+#define GF_SQL_COMPACT_DEF GF_SQL_COMPACT_INCR
typedef enum gf_sql_auto_vacuum {
- gf_sql_av_none = 0,
- gf_sql_av_full,
- gf_sql_av_incr,
- gf_sql_av_invalid
+ gf_sql_av_none = 0,
+ gf_sql_av_full,
+ gf_sql_av_incr,
+ gf_sql_av_invalid
} gf_sql_auto_vacuum_t;
typedef enum gf_sql_sync {
- gf_sql_sync_off = 0,
- gf_sql_sync_normal,
- gf_sql_sync_full,
- gf_sql_sync_invalid
+ gf_sql_sync_off = 0,
+ gf_sql_sync_normal,
+ gf_sql_sync_full,
+ gf_sql_sync_invalid
} gf_sql_sync_t;
-
typedef enum gf_sql_journal_mode {
- gf_sql_jm_wal = 0,
- gf_sql_jm_delete,
- gf_sql_jm_truncate,
- gf_sql_jm_persist,
- gf_sql_jm_memory,
- gf_sql_jm_off,
- gf_sql_jm_invalid
+ gf_sql_jm_wal = 0,
+ gf_sql_jm_delete,
+ gf_sql_jm_truncate,
+ gf_sql_jm_persist,
+ gf_sql_jm_memory,
+ gf_sql_jm_off,
+ gf_sql_jm_invalid
} gf_sql_journal_mode_t;
-
typedef struct gf_sql_connection {
- char sqlite3_db_path[PATH_MAX];
- sqlite3 *sqlite3_db_conn;
- ssize_t cache_size;
- ssize_t page_size;
- ssize_t wal_autocheckpoint;
- gf_sql_journal_mode_t journal_mode;
- gf_sql_sync_t synchronous;
- gf_sql_auto_vacuum_t auto_vacuum;
+ char sqlite3_db_path[PATH_MAX];
+ sqlite3 *sqlite3_db_conn;
+ ssize_t cache_size;
+ ssize_t page_size;
+ ssize_t wal_autocheckpoint;
+ gf_sql_journal_mode_t journal_mode;
+ gf_sql_sync_t synchronous;
+ gf_sql_auto_vacuum_t auto_vacuum;
} gf_sql_connection_t;
-
-
-#define CHECK_SQL_CONN(sql_conn, out)\
-do {\
- GF_VALIDATE_OR_GOTO(GFDB_STR_SQLITE3, sql_conn, out);\
- if (!sql_conn->sqlite3_db_conn) {\
- gf_msg (GFDB_STR_SQLITE3, GF_LOG_ERROR, 0,\
- LG_MSG_CONNECTION_INIT_FAILED,\
- "sqlite3 connection not initialized");\
- goto out;\
- };\
-} while (0)
-
-#define GF_SQLITE3_SET_PRAGMA(sqlite3_config_str, param_key, format, value,\
- ret, error)\
-do {\
- sprintf (sqlite3_config_str, "PRAGMA %s = " format , param_key,\
- value);\
- ret = sqlite3_exec (sql_conn->sqlite3_db_conn, sqlite3_config_str,\
- NULL, NULL, NULL);\
- if (ret != SQLITE_OK) {\
- gf_msg (GFDB_STR_SQLITE3, GF_LOG_ERROR, 0, LG_MSG_EXEC_FAILED,\
- "Failed executing: %s : %s",\
- sqlite3_config_str, sqlite3_errmsg\
- (sql_conn->sqlite3_db_conn));\
- ret = -1;\
- goto error;\
- };\
-} while (0)
+#define CHECK_SQL_CONN(sql_conn, out) \
+ do { \
+ GF_VALIDATE_OR_GOTO(GFDB_STR_SQLITE3, sql_conn, out); \
+ if (!sql_conn->sqlite3_db_conn) { \
+ gf_msg(GFDB_STR_SQLITE3, GF_LOG_ERROR, 0, \
+ LG_MSG_CONNECTION_INIT_FAILED, \
+ "sqlite3 connection not initialized"); \
+ goto out; \
+ }; \
+ } while (0)
+
+#define GF_SQLITE3_SET_PRAGMA(sqlite3_config_str, param_key, format, value, \
+ ret, error) \
+ do { \
+ sprintf(sqlite3_config_str, "PRAGMA %s = " format, param_key, value); \
+ ret = sqlite3_exec(sql_conn->sqlite3_db_conn, sqlite3_config_str, \
+ NULL, NULL, NULL); \
+ if (ret != SQLITE_OK) { \
+ gf_msg(GFDB_STR_SQLITE3, GF_LOG_ERROR, 0, LG_MSG_EXEC_FAILED, \
+ "Failed executing: %s : %s", sqlite3_config_str, \
+ sqlite3_errmsg(sql_conn->sqlite3_db_conn)); \
+ ret = -1; \
+ goto error; \
+ }; \
+ } while (0)
/************************SQLITE3 PARAMS KEYS***********************************/
-#define GFDB_SQL_PARAM_DBPATH "sql-db-path"
-#define GFDB_SQL_PARAM_CACHE_SIZE "sql-db-cachesize"
-#define GFDB_SQL_PARAM_PAGE_SIZE "sql-db-pagesize"
-#define GFDB_SQL_PARAM_JOURNAL_MODE "sql-db-journalmode"
-#define GFDB_SQL_PARAM_WAL_AUTOCHECK "sql-db-wal-autocheckpoint"
-#define GFDB_SQL_PARAM_SYNC "sql-db-sync"
-#define GFDB_SQL_PARAM_AUTO_VACUUM "sql-db-autovacuum"
-
-#define GF_SQL_DEFAULT_DBPATH ""
-#define GF_SQL_DEFAULT_PAGE_SIZE "4096"
-#define GF_SQL_DEFAULT_CACHE_SIZE "12500"
-#define GF_SQL_DEFAULT_WAL_AUTOCHECKPOINT "25000"
-#define GF_SQL_DEFAULT_JOURNAL_MODE GF_SQL_JM_WAL
-#define GF_SQL_DEFAULT_SYNC GF_SQL_SYNC_OFF
-#define GF_SQL_DEFAULT_AUTO_VACUUM GF_SQL_AV_NONE
-
+#define GFDB_SQL_PARAM_DBPATH "sql-db-path"
+#define GFDB_SQL_PARAM_CACHE_SIZE "sql-db-cachesize"
+#define GFDB_SQL_PARAM_PAGE_SIZE "sql-db-pagesize"
+#define GFDB_SQL_PARAM_JOURNAL_MODE "sql-db-journalmode"
+#define GFDB_SQL_PARAM_WAL_AUTOCHECK "sql-db-wal-autocheckpoint"
+#define GFDB_SQL_PARAM_SYNC "sql-db-sync"
+#define GFDB_SQL_PARAM_AUTO_VACUUM "sql-db-autovacuum"
+
+#define GF_SQL_DEFAULT_DBPATH ""
+#define GF_SQL_DEFAULT_PAGE_SIZE "4096"
+#define GF_SQL_DEFAULT_CACHE_SIZE "12500"
+#define GF_SQL_DEFAULT_WAL_AUTOCHECKPOINT "25000"
+#define GF_SQL_DEFAULT_JOURNAL_MODE GF_SQL_JM_WAL
+#define GF_SQL_DEFAULT_SYNC GF_SQL_SYNC_OFF
+#define GF_SQL_DEFAULT_AUTO_VACUUM GF_SQL_AV_NONE
/* Defines the indexs for sqlite params
* The order should be maintained*/
typedef enum sqlite_param_index {
- sql_dbpath_ix = 0,
- sql_pagesize_ix,
- sql_cachesize_ix,
- sql_journalmode_ix,
- sql_walautocheck_ix,
- sql_dbsync_ix,
- sql_autovacuum_ix,
- /*This should be in the end*/
- sql_index_max
+ sql_dbpath_ix = 0,
+ sql_pagesize_ix,
+ sql_cachesize_ix,
+ sql_journalmode_ix,
+ sql_walautocheck_ix,
+ sql_dbsync_ix,
+ sql_autovacuum_ix,
+ /*This should be in the end*/
+ sql_index_max
} sqlite_param_index_t;
/* Array to hold the sqlite param keys
* The order should be maintained as sqlite_param_index_t*/
static char *sqlite_params_keys[] = {
- GFDB_SQL_PARAM_DBPATH,
- GFDB_SQL_PARAM_PAGE_SIZE,
- GFDB_SQL_PARAM_CACHE_SIZE,
- GFDB_SQL_PARAM_JOURNAL_MODE,
- GFDB_SQL_PARAM_WAL_AUTOCHECK,
- GFDB_SQL_PARAM_SYNC,
- GFDB_SQL_PARAM_AUTO_VACUUM
-};
-
+ GFDB_SQL_PARAM_DBPATH, GFDB_SQL_PARAM_PAGE_SIZE,
+ GFDB_SQL_PARAM_CACHE_SIZE, GFDB_SQL_PARAM_JOURNAL_MODE,
+ GFDB_SQL_PARAM_WAL_AUTOCHECK, GFDB_SQL_PARAM_SYNC,
+ GFDB_SQL_PARAM_AUTO_VACUUM};
/* Array of default values for sqlite params
* The order should be maintained as sqlite_param_index_t*/
-static char *sqlite_params_default_value[] = {
- GF_SQL_DEFAULT_DBPATH,
- GF_SQL_DEFAULT_PAGE_SIZE,
- GF_SQL_DEFAULT_CACHE_SIZE,
- GF_SQL_DEFAULT_JOURNAL_MODE,
- GF_SQL_DEFAULT_WAL_AUTOCHECKPOINT,
- GF_SQL_DEFAULT_SYNC,
- GF_SQL_DEFAULT_AUTO_VACUUM
-};
+static char *sqlite_params_default_value[] = {GF_SQL_DEFAULT_DBPATH,
+ GF_SQL_DEFAULT_PAGE_SIZE,
+ GF_SQL_DEFAULT_CACHE_SIZE,
+ GF_SQL_DEFAULT_JOURNAL_MODE,
+ GF_SQL_DEFAULT_WAL_AUTOCHECKPOINT,
+ GF_SQL_DEFAULT_SYNC,
+ GF_SQL_DEFAULT_AUTO_VACUUM};
/*Extract sql params from page_size to auto_vacumm
* The dbpath is extracted in a different way*/
static inline int
gfdb_set_sql_params(char *comp_name, dict_t *from_dict, dict_t *to_dict)
{
- sqlite_param_index_t sql_index = sql_pagesize_ix;
- char *_val_str = NULL;
- int ret = -1;
-
- GF_ASSERT (comp_name);
- GF_ASSERT (from_dict);
- GF_ASSERT (to_dict);
-
- /*Extract and Set of the sql params from page_size*/
- for (sql_index = sql_pagesize_ix; sql_index < sql_index_max;
- sql_index++) {
- _val_str = NULL;
- GET_DB_PARAM_FROM_DICT_DEFAULT (comp_name, from_dict,
- sqlite_params_keys[sql_index], _val_str,
- sqlite_params_default_value[sql_index]);
- SET_DB_PARAM_TO_DICT (comp_name, to_dict,
- sqlite_params_keys[sql_index], _val_str, ret, out);
- }
+ sqlite_param_index_t sql_index = sql_pagesize_ix;
+ char *_val_str = NULL;
+ int ret = -1;
+
+ GF_ASSERT(comp_name);
+ GF_ASSERT(from_dict);
+ GF_ASSERT(to_dict);
+
+ /*Extract and Set of the sql params from page_size*/
+ for (sql_index = sql_pagesize_ix; sql_index < sql_index_max; sql_index++) {
+ _val_str = NULL;
+ GET_DB_PARAM_FROM_DICT_DEFAULT(comp_name, from_dict,
+ sqlite_params_keys[sql_index], _val_str,
+ sqlite_params_default_value[sql_index]);
+ SET_DB_PARAM_TO_DICT(comp_name, to_dict, sqlite_params_keys[sql_index],
+ _val_str, ret, out);
+ }
out:
- return ret;
+ return ret;
}
-
-
-
/*************************SQLITE3 GFDB PLUGINS*********************************/
/*Db init and fini modules*/
-int gf_sqlite3_fini (void **db_conn);
-int gf_sqlite3_init (dict_t *args, void **db_conn);
+int
+gf_sqlite3_fini(void **db_conn);
+int
+gf_sqlite3_init(dict_t *args, void **db_conn);
/*insert/update/delete modules*/
-int gf_sqlite3_insert (void *db_conn, gfdb_db_record_t *);
-int gf_sqlite3_delete (void *db_conn, gfdb_db_record_t *);
+int
+gf_sqlite3_insert(void *db_conn, gfdb_db_record_t *);
+int
+gf_sqlite3_delete(void *db_conn, gfdb_db_record_t *);
/*querying modules*/
-int gf_sqlite3_find_all (void *db_conn, gf_query_callback_t,
- void *_query_cbk_args,
- int query_limit);
-int gf_sqlite3_find_unchanged_for_time (void *db_conn,
- gf_query_callback_t query_callback,
- void *_query_cbk_args,
- gfdb_time_t *for_time);
-int gf_sqlite3_find_recently_changed_files (void *db_conn,
- gf_query_callback_t query_callback,
- void *_query_cbk_args,
- gfdb_time_t *from_time);
-int gf_sqlite3_find_unchanged_for_time_freq (void *db_conn,
+int
+gf_sqlite3_find_all(void *db_conn, gf_query_callback_t, void *_query_cbk_args,
+ int query_limit);
+int
+gf_sqlite3_find_unchanged_for_time(void *db_conn,
+ gf_query_callback_t query_callback,
+ void *_query_cbk_args,
+ gfdb_time_t *for_time);
+int
+gf_sqlite3_find_recently_changed_files(void *db_conn,
+ gf_query_callback_t query_callback,
+ void *_query_cbk_args,
+ gfdb_time_t *from_time);
+int
+gf_sqlite3_find_unchanged_for_time_freq(void *db_conn,
gf_query_callback_t query_callback,
void *_query_cbk_args,
gfdb_time_t *for_time,
- int write_freq_cnt,
- int read_freq_cnt,
- gf_boolean_t clear_counters);
-int gf_sqlite3_find_recently_changed_files_freq (void *db_conn,
- gf_query_callback_t query_callback,
- void *_query_cbk_args,
- gfdb_time_t *from_time,
- int write_freq_cnt,
- int read_freq_cnt,
+ int write_freq_cnt, int read_freq_cnt,
gf_boolean_t clear_counters);
+int
+gf_sqlite3_find_recently_changed_files_freq(
+ void *db_conn, gf_query_callback_t query_callback, void *_query_cbk_args,
+ gfdb_time_t *from_time, int write_freq_cnt, int read_freq_cnt,
+ gf_boolean_t clear_counters);
-int gf_sqlite3_clear_files_heat (void *db_conn);
+int
+gf_sqlite3_clear_files_heat(void *db_conn);
/* Function to extract version of sqlite db
* Input:
@@ -296,7 +279,8 @@ int gf_sqlite3_clear_files_heat (void *db_conn);
* extracted.
* On failure return -1
* */
-int gf_sqlite3_version (void *db_conn, char **version);
+int
+gf_sqlite3_version(void *db_conn, char **version);
/* Function to extract PRAGMA or setting from sqlite db
* Input:
@@ -310,7 +294,8 @@ int gf_sqlite3_version (void *db_conn, char **version);
* extracted.
* On failure return -1
* */
-int gf_sqlite3_pragma (void *db_conn, char *pragma_key, char **pragma_value);
+int
+gf_sqlite3_pragma(void *db_conn, char *pragma_key, char **pragma_value);
/* Function to set PRAGMA to sqlite db
* Input:
@@ -322,7 +307,7 @@ int gf_sqlite3_pragma (void *db_conn, char *pragma_key, char **pragma_value);
* On failure return -1
* */
int
-gf_sqlite3_set_pragma (void *db_conn, char *pragma_key, char *pragma_value);
+gf_sqlite3_set_pragma(void *db_conn, char *pragma_key, char *pragma_value);
/* Function to vacuum of sqlite db
* Input:
@@ -334,10 +319,10 @@ gf_sqlite3_set_pragma (void *db_conn, char *pragma_key, char *pragma_value);
* On failure return -1
* */
int
-gf_sqlite3_vacuum (void *db_conn, gf_boolean_t compact_active,
- gf_boolean_t compact_mode_switched);
-
-void gf_sqlite3_fill_db_operations (gfdb_db_operations_t *gfdb_db_ops);
+gf_sqlite3_vacuum(void *db_conn, gf_boolean_t compact_active,
+ gf_boolean_t compact_mode_switched);
+void
+gf_sqlite3_fill_db_operations(gfdb_db_operations_t *gfdb_db_ops);
#endif
diff --git a/libglusterfs/src/gfdb/gfdb_sqlite3_helper.h b/libglusterfs/src/gfdb/gfdb_sqlite3_helper.h
index 0d222305d01..f19344a353c 100644
--- a/libglusterfs/src/gfdb/gfdb_sqlite3_helper.h
+++ b/libglusterfs/src/gfdb/gfdb_sqlite3_helper.h
@@ -10,7 +10,6 @@
#ifndef __GFDB_SQLITE3_HELPER_H
#define __GFDB_SQLITE3_HELPER_H
-
#include "gfdb_sqlite3.h"
/******************************************************************************
@@ -19,27 +18,21 @@
*
* ****************************************************************************/
-
int
-gf_sql_insert_wind (gf_sql_connection_t *sql_conn,
- gfdb_db_record_t *gfdb_db_record);
+gf_sql_insert_wind(gf_sql_connection_t *sql_conn,
+ gfdb_db_record_t *gfdb_db_record);
int
-gf_sql_insert_unwind (gf_sql_connection_t *sql_conn,
- gfdb_db_record_t *gfdb_db_record);
-
+gf_sql_insert_unwind(gf_sql_connection_t *sql_conn,
+ gfdb_db_record_t *gfdb_db_record);
int
-gf_sql_update_delete_wind (gf_sql_connection_t *sql_conn,
- gfdb_db_record_t *gfdb_db_record);
+gf_sql_update_delete_wind(gf_sql_connection_t *sql_conn,
+ gfdb_db_record_t *gfdb_db_record);
int
-gf_sql_delete_unwind (gf_sql_connection_t *sql_conn,
- gfdb_db_record_t *gfdb_db_record);
-
-
-
-
+gf_sql_delete_unwind(gf_sql_connection_t *sql_conn,
+ gfdb_db_record_t *gfdb_db_record);
/******************************************************************************
*
@@ -47,13 +40,12 @@ gf_sql_delete_unwind (gf_sql_connection_t *sql_conn,
*
* ****************************************************************************/
-
int
-gf_sql_query_function (sqlite3_stmt *prep_stmt,
- gf_query_callback_t query_callback,
- void *_query_cbk_args);
+gf_sql_query_function(sqlite3_stmt *prep_stmt,
+ gf_query_callback_t query_callback,
+ void *_query_cbk_args);
int
-gf_sql_clear_counters (gf_sql_connection_t *sql_conn);
+gf_sql_clear_counters(gf_sql_connection_t *sql_conn);
#endif
diff --git a/libglusterfs/src/gidcache.h b/libglusterfs/src/gidcache.h
index 886721e719f..3a7de47dec7 100644
--- a/libglusterfs/src/gidcache.h
+++ b/libglusterfs/src/gidcache.h
@@ -26,30 +26,35 @@
* to scan more entries with every lookup/update.
*/
-#define AUX_GID_CACHE_ASSOC 4
-#define AUX_GID_CACHE_BUCKETS 256
-#define AUX_GID_CACHE_SIZE (AUX_GID_CACHE_ASSOC * AUX_GID_CACHE_BUCKETS)
+#define AUX_GID_CACHE_ASSOC 4
+#define AUX_GID_CACHE_BUCKETS 256
+#define AUX_GID_CACHE_SIZE (AUX_GID_CACHE_ASSOC * AUX_GID_CACHE_BUCKETS)
typedef struct {
- uint64_t gl_id;
- uint64_t gl_uid;
- uint64_t gl_gid;
- int gl_count;
- gid_t *gl_list;
- time_t gl_deadline;
+ uint64_t gl_id;
+ uint64_t gl_uid;
+ uint64_t gl_gid;
+ int gl_count;
+ gid_t *gl_list;
+ time_t gl_deadline;
} gid_list_t;
typedef struct {
- gf_lock_t gc_lock;
- uint32_t gc_max_age;
- unsigned int gc_nbuckets;
- gid_list_t gc_cache[AUX_GID_CACHE_SIZE];
+ gf_lock_t gc_lock;
+ uint32_t gc_max_age;
+ unsigned int gc_nbuckets;
+ gid_list_t gc_cache[AUX_GID_CACHE_SIZE];
} gid_cache_t;
-int gid_cache_init(gid_cache_t *, uint32_t);
-int gid_cache_reconf(gid_cache_t *, uint32_t);
-const gid_list_t *gid_cache_lookup(gid_cache_t *, uint64_t, uint64_t, uint64_t);
-void gid_cache_release(gid_cache_t *, const gid_list_t *);
-int gid_cache_add(gid_cache_t *, gid_list_t *);
+int
+gid_cache_init(gid_cache_t *, uint32_t);
+int
+gid_cache_reconf(gid_cache_t *, uint32_t);
+const gid_list_t *
+gid_cache_lookup(gid_cache_t *, uint64_t, uint64_t, uint64_t);
+void
+gid_cache_release(gid_cache_t *, const gid_list_t *);
+int
+gid_cache_add(gid_cache_t *, gid_list_t *);
#endif /* __GIDCACHE_H__ */
diff --git a/libglusterfs/src/glfs-message-id.h b/libglusterfs/src/glfs-message-id.h
index 9702a18ffe4..21d5397d2e6 100644
--- a/libglusterfs/src/glfs-message-id.h
+++ b/libglusterfs/src/glfs-message-id.h
@@ -13,86 +13,87 @@
/* Base of all message IDs, all message IDs would be
* greater than this */
-#define GLFS_MSGID_BASE 100000
+#define GLFS_MSGID_BASE 100000
/* Segment size of allocated range. Any component needing more than this
* segment size should take multiple segments (at times non contiguous,
* if extensions are being made post the next segment already allocated) */
-#define GLFS_MSGID_SEGMENT 1000
+#define GLFS_MSGID_SEGMENT 1000
/* Macro to define a range of messages for a component. The first argument is
* the name of the component. The second argument is the number of segments
* to allocate. The defined values will be GLFS_MSGID_COMP_<name> and
* GLFS_MSGID_COMP_<name>_END. */
-#define GLFS_MSGID_COMP(_name, _blocks) \
- GLFS_MSGID_COMP_##_name, \
- GLFS_MSGID_COMP_##_name##_END = (GLFS_MSGID_COMP_##_name + \
+#define GLFS_MSGID_COMP(_name, _blocks) \
+ GLFS_MSGID_COMP_##_name, \
+ GLFS_MSGID_COMP_##_name##_END = (GLFS_MSGID_COMP_##_name + \
(GLFS_MSGID_SEGMENT * (_blocks)) - 1)
-#define GLFS_MSGID(_name, _msgs...) \
- enum _msgid_table_##_name { \
- GLFS_##_name##_COMP_BASE = GLFS_MSGID_COMP_##_name, ## _msgs, \
- GLGS_##_name##_COMP_END \
- }
+#define GLFS_MSGID(_name, _msgs...) \
+ enum _msgid_table_##_name \
+ { \
+ GLFS_##_name##_COMP_BASE = GLFS_MSGID_COMP_##_name, ##_msgs, \
+ GLGS_##_name##_COMP_END \
+ }
/* Per module message segments allocated */
/* NOTE: For any new module add to the end the modules */
enum _msgid_comp {
- GLFS_MSGID_RESERVED = GLFS_MSGID_BASE - 1,
+ GLFS_MSGID_RESERVED = GLFS_MSGID_BASE - 1,
- GLFS_MSGID_COMP(GLUSTERFSD, 1),
- GLFS_MSGID_COMP(LIBGLUSTERFS, 1),
- GLFS_MSGID_COMP(RPC_LIB, 1),
- GLFS_MSGID_COMP(RPC_TRANS_RDMA, 1),
- GLFS_MSGID_COMP(API, 1),
- GLFS_MSGID_COMP(CLI, 1),
-/* glusterd has a lot of messages, taking 2 segments for the same */
- GLFS_MSGID_COMP(GLUSTERD, 2),
- GLFS_MSGID_COMP(AFR, 1),
- GLFS_MSGID_COMP(DHT, 1),
-/* there is no component called 'common', however reserving this segment
- * for common actions/errors like dict_{get/set}, memory accounting*/
- GLFS_MSGID_COMP(COMMON, 1),
- GLFS_MSGID_COMP(UPCALL, 1),
- GLFS_MSGID_COMP(NFS, 1),
- GLFS_MSGID_COMP(POSIX, 1),
- GLFS_MSGID_COMP(PC, 1),
- GLFS_MSGID_COMP(PS, 1),
- GLFS_MSGID_COMP(BITROT_STUB, 1),
- GLFS_MSGID_COMP(CHANGELOG, 1),
- GLFS_MSGID_COMP(BITROT_BITD, 1),
- GLFS_MSGID_COMP(RPC_TRANS_SOCKET, 1),
- GLFS_MSGID_COMP(QUOTA, 1),
- GLFS_MSGID_COMP(CTR, 1),
- GLFS_MSGID_COMP(EC, 1),
- GLFS_MSGID_COMP(IO_CACHE, 1),
- GLFS_MSGID_COMP(IO_THREADS, 1),
- GLFS_MSGID_COMP(MD_CACHE, 1),
- GLFS_MSGID_COMP(OPEN_BEHIND, 1),
- GLFS_MSGID_COMP(QUICK_READ, 1),
- GLFS_MSGID_COMP(READ_AHEAD, 1),
- GLFS_MSGID_COMP(READDIR_AHEAD, 1),
- GLFS_MSGID_COMP(SYMLINK_CACHE, 1),
- GLFS_MSGID_COMP(WRITE_BEHIND, 1),
- GLFS_MSGID_COMP(CHANGELOG_LIB, 1),
- GLFS_MSGID_COMP(SHARD, 1),
- GLFS_MSGID_COMP(JBR, 1),
- GLFS_MSGID_COMP(PL, 1),
- GLFS_MSGID_COMP(DC, 1),
- GLFS_MSGID_COMP(LEASES, 1),
- GLFS_MSGID_COMP(INDEX, 1),
- GLFS_MSGID_COMP(POSIX_ACL, 1),
- GLFS_MSGID_COMP(NLC, 1),
- GLFS_MSGID_COMP(SL, 1),
- GLFS_MSGID_COMP(HAM, 1),
- GLFS_MSGID_COMP(SDFS, 1),
- GLFS_MSGID_COMP(QUIESCE, 1),
- GLFS_MSGID_COMP(TA, 1),
- GLFS_MSGID_COMP(TEMPLATE, 1),
+ GLFS_MSGID_COMP(GLUSTERFSD, 1),
+ GLFS_MSGID_COMP(LIBGLUSTERFS, 1),
+ GLFS_MSGID_COMP(RPC_LIB, 1),
+ GLFS_MSGID_COMP(RPC_TRANS_RDMA, 1),
+ GLFS_MSGID_COMP(API, 1),
+ GLFS_MSGID_COMP(CLI, 1),
+ /* glusterd has a lot of messages, taking 2 segments for the same */
+ GLFS_MSGID_COMP(GLUSTERD, 2),
+ GLFS_MSGID_COMP(AFR, 1),
+ GLFS_MSGID_COMP(DHT, 1),
+ /* there is no component called 'common', however reserving this segment
+ * for common actions/errors like dict_{get/set}, memory accounting*/
+ GLFS_MSGID_COMP(COMMON, 1),
+ GLFS_MSGID_COMP(UPCALL, 1),
+ GLFS_MSGID_COMP(NFS, 1),
+ GLFS_MSGID_COMP(POSIX, 1),
+ GLFS_MSGID_COMP(PC, 1),
+ GLFS_MSGID_COMP(PS, 1),
+ GLFS_MSGID_COMP(BITROT_STUB, 1),
+ GLFS_MSGID_COMP(CHANGELOG, 1),
+ GLFS_MSGID_COMP(BITROT_BITD, 1),
+ GLFS_MSGID_COMP(RPC_TRANS_SOCKET, 1),
+ GLFS_MSGID_COMP(QUOTA, 1),
+ GLFS_MSGID_COMP(CTR, 1),
+ GLFS_MSGID_COMP(EC, 1),
+ GLFS_MSGID_COMP(IO_CACHE, 1),
+ GLFS_MSGID_COMP(IO_THREADS, 1),
+ GLFS_MSGID_COMP(MD_CACHE, 1),
+ GLFS_MSGID_COMP(OPEN_BEHIND, 1),
+ GLFS_MSGID_COMP(QUICK_READ, 1),
+ GLFS_MSGID_COMP(READ_AHEAD, 1),
+ GLFS_MSGID_COMP(READDIR_AHEAD, 1),
+ GLFS_MSGID_COMP(SYMLINK_CACHE, 1),
+ GLFS_MSGID_COMP(WRITE_BEHIND, 1),
+ GLFS_MSGID_COMP(CHANGELOG_LIB, 1),
+ GLFS_MSGID_COMP(SHARD, 1),
+ GLFS_MSGID_COMP(JBR, 1),
+ GLFS_MSGID_COMP(PL, 1),
+ GLFS_MSGID_COMP(DC, 1),
+ GLFS_MSGID_COMP(LEASES, 1),
+ GLFS_MSGID_COMP(INDEX, 1),
+ GLFS_MSGID_COMP(POSIX_ACL, 1),
+ GLFS_MSGID_COMP(NLC, 1),
+ GLFS_MSGID_COMP(SL, 1),
+ GLFS_MSGID_COMP(HAM, 1),
+ GLFS_MSGID_COMP(SDFS, 1),
+ GLFS_MSGID_COMP(QUIESCE, 1),
+ GLFS_MSGID_COMP(TA, 1),
+ GLFS_MSGID_COMP(TEMPLATE, 1),
-/* --- new segments for messages goes above this line --- */
+ /* --- new segments for messages goes above this line --- */
- GLFS_MSGID_END
+ GLFS_MSGID_END
};
#endif /* !_GLFS_MESSAGE_ID_H_ */
diff --git a/libglusterfs/src/globals.h b/libglusterfs/src/globals.h
index fb1f839b259..95082f04588 100644
--- a/libglusterfs/src/globals.h
+++ b/libglusterfs/src/globals.h
@@ -15,7 +15,7 @@
#define GF_DEFAULT_VOLFILE_TRANSPORT "tcp"
#define GF_GLOBAL_XLATOR_NAME "global"
-#define GD_OP_VERSION_KEY "operating-version"
+#define GD_OP_VERSION_KEY "operating-version"
#define GD_MIN_OP_VERSION_KEY "minimum-operating-version"
#define GD_MAX_OP_VERSION_KEY "maximum-operating-version"
@@ -23,7 +23,6 @@
#define GF_AVOID_OVERWRITE "glusterfs.avoid.overwrite"
#define GF_CLEAN_WRITE_PROTECTION "glusterfs.clean.writexattr"
-
/* Gluster versions - OP-VERSION mapping
*
* 3.3.x - 1
@@ -42,73 +41,75 @@
* should allow for some gaps between two Y releases for backports of features
* in Z releases.
*/
-#define GD_OP_VERSION_MIN 1 /* MIN is the fresh start op-version, mostly
- should not change */
-#define GD_OP_VERSION_MAX GD_OP_VERSION_4_2_0 /* MAX VERSION is the maximum
- count in VME table, should
- keep changing with
- introduction of newer
- versions */
+#define GD_OP_VERSION_MIN \
+ 1 /* MIN is the fresh start op-version, mostly \
+ should not change */
+#define GD_OP_VERSION_MAX \
+ GD_OP_VERSION_4_2_0 /* MAX VERSION is the maximum \
+ count in VME table, should \
+ keep changing with \
+ introduction of newer \
+ versions */
-#define GD_OP_VERSION_3_6_0 30600 /* Op-Version for GlusterFS 3.6.0 */
+#define GD_OP_VERSION_3_6_0 30600 /* Op-Version for GlusterFS 3.6.0 */
-#define GD_OP_VERSION_3_7_0 30700 /* Op-version for GlusterFS 3.7.0 */
+#define GD_OP_VERSION_3_7_0 30700 /* Op-version for GlusterFS 3.7.0 */
-#define GD_OP_VERSION_3_7_1 30701 /* Op-version for GlusterFS 3.7.1 */
+#define GD_OP_VERSION_3_7_1 30701 /* Op-version for GlusterFS 3.7.1 */
-#define GD_OP_VERSION_3_7_2 30702 /* Op-version for GlusterFS 3.7.2 */
+#define GD_OP_VERSION_3_7_2 30702 /* Op-version for GlusterFS 3.7.2 */
-#define GD_OP_VERSION_3_7_3 30703 /* Op-version for GlusterFS 3.7.3 */
+#define GD_OP_VERSION_3_7_3 30703 /* Op-version for GlusterFS 3.7.3 */
-#define GD_OP_VERSION_3_7_4 30704 /* Op-version for GlusterFS 3.7.4 */
+#define GD_OP_VERSION_3_7_4 30704 /* Op-version for GlusterFS 3.7.4 */
-#define GD_OP_VERSION_3_7_5 30705 /* Op-version for GlusterFS 3.7.5 */
+#define GD_OP_VERSION_3_7_5 30705 /* Op-version for GlusterFS 3.7.5 */
-#define GD_OP_VERSION_3_7_6 30706 /* Op-version for GlusterFS 3.7.6 */
+#define GD_OP_VERSION_3_7_6 30706 /* Op-version for GlusterFS 3.7.6 */
-#define GD_OP_VERSION_3_7_7 30707 /* Op-version for GlusterFS 3.7.7 */
+#define GD_OP_VERSION_3_7_7 30707 /* Op-version for GlusterFS 3.7.7 */
-#define GD_OP_VERSION_3_7_10 30710 /* Op-version for GlusterFS 3.7.10 */
+#define GD_OP_VERSION_3_7_10 30710 /* Op-version for GlusterFS 3.7.10 */
-#define GD_OP_VERSION_3_7_12 30712 /* Op-version for GlusterFS 3.7.12 */
+#define GD_OP_VERSION_3_7_12 30712 /* Op-version for GlusterFS 3.7.12 */
-#define GD_OP_VERSION_3_8_0 30800 /* Op-version for GlusterFS 3.8.0 */
+#define GD_OP_VERSION_3_8_0 30800 /* Op-version for GlusterFS 3.8.0 */
-#define GD_OP_VERSION_3_8_3 30803 /* Op-version for GlusterFS 3.8.3 */
+#define GD_OP_VERSION_3_8_3 30803 /* Op-version for GlusterFS 3.8.3 */
-#define GD_OP_VERSION_3_8_4 30804 /* Op-version for GlusterFS 3.8.4 */
+#define GD_OP_VERSION_3_8_4 30804 /* Op-version for GlusterFS 3.8.4 */
-#define GD_OP_VERSION_3_9_0 30900 /* Op-version for GlusterFS 3.9.0 */
+#define GD_OP_VERSION_3_9_0 30900 /* Op-version for GlusterFS 3.9.0 */
-#define GD_OP_VERSION_3_9_1 30901 /* Op-version for GlusterFS 3.9.1 */
+#define GD_OP_VERSION_3_9_1 30901 /* Op-version for GlusterFS 3.9.1 */
-#define GD_OP_VERSION_3_10_0 31000 /* Op-version for GlusterFS 3.10.0 */
+#define GD_OP_VERSION_3_10_0 31000 /* Op-version for GlusterFS 3.10.0 */
-#define GD_OP_VERSION_3_10_1 31001 /* Op-version for GlusterFS 3.10.1 */
+#define GD_OP_VERSION_3_10_1 31001 /* Op-version for GlusterFS 3.10.1 */
-#define GD_OP_VERSION_3_10_2 31002 /* Op-version for GlusterFS 3.10.2 */
+#define GD_OP_VERSION_3_10_2 31002 /* Op-version for GlusterFS 3.10.2 */
-#define GD_OP_VERSION_3_11_0 31100 /* Op-version for GlusterFS 3.11.0 */
+#define GD_OP_VERSION_3_11_0 31100 /* Op-version for GlusterFS 3.11.0 */
-#define GD_OP_VERSION_3_11_1 31101 /* Op-version for GlusterFS 3.11.1 */
+#define GD_OP_VERSION_3_11_1 31101 /* Op-version for GlusterFS 3.11.1 */
-#define GD_OP_VERSION_3_12_0 31200 /* Op-version for GlusterFS 3.12.0 */
+#define GD_OP_VERSION_3_12_0 31200 /* Op-version for GlusterFS 3.12.0 */
-#define GD_OP_VERSION_3_12_2 31202 /* Op-version for GlusterFS 3.12.2 */
+#define GD_OP_VERSION_3_12_2 31202 /* Op-version for GlusterFS 3.12.2 */
-#define GD_OP_VERSION_3_12_3 31203 /* Op-version for GlusterFS 3.12.3 */
+#define GD_OP_VERSION_3_12_3 31203 /* Op-version for GlusterFS 3.12.3 */
-#define GD_OP_VERSION_3_13_0 31300 /* Op-version for GlusterFS 3.13.0 */
+#define GD_OP_VERSION_3_13_0 31300 /* Op-version for GlusterFS 3.13.0 */
-#define GD_OP_VERSION_3_13_1 31301 /* Op-version for GlusterFS 3.13.1 */
+#define GD_OP_VERSION_3_13_1 31301 /* Op-version for GlusterFS 3.13.1 */
-#define GD_OP_VERSION_3_13_2 31302 /* Op-version for GlusterFS 3.13.2 */
+#define GD_OP_VERSION_3_13_2 31302 /* Op-version for GlusterFS 3.13.2 */
-#define GD_OP_VERSION_4_0_0 40000 /* Op-version for GlusterFS 4.0.0 */
+#define GD_OP_VERSION_4_0_0 40000 /* Op-version for GlusterFS 4.0.0 */
-#define GD_OP_VERSION_4_1_0 40100 /* Op-version for GlusterFS 4.1.0 */
+#define GD_OP_VERSION_4_1_0 40100 /* Op-version for GlusterFS 4.1.0 */
-#define GD_OP_VERSION_4_2_0 40200 /* Op-version for GlusterFS 4.2.0 */
+#define GD_OP_VERSION_4_2_0 40200 /* Op-version for GlusterFS 4.2.0 */
#define GD_OP_VER_PERSISTENT_AFR_XATTRS GD_OP_VERSION_3_6_0
@@ -117,41 +118,57 @@
/* THIS */
#define THIS (*__glusterfs_this_location())
-#define DECLARE_OLD_THIS xlator_t *old_THIS = THIS
+#define DECLARE_OLD_THIS xlator_t *old_THIS = THIS
-xlator_t **__glusterfs_this_location (void);
-xlator_t *glusterfs_this_get (void);
-int glusterfs_this_set (xlator_t *);
+xlator_t **
+__glusterfs_this_location(void);
+xlator_t *
+glusterfs_this_get(void);
+int
+glusterfs_this_set(xlator_t *);
extern xlator_t global_xlator;
extern struct volume_options global_xl_options[];
/* syncopctx */
-void *syncopctx_getctx (void);
-int syncopctx_setctx (void *ctx);
+void *
+syncopctx_getctx(void);
+int
+syncopctx_setctx(void *ctx);
/* task */
-void *synctask_get (void);
-int synctask_set (void *);
+void *
+synctask_get(void);
+int
+synctask_set(void *);
/* uuid_buf */
-char *glusterfs_uuid_buf_get (void);
+char *
+glusterfs_uuid_buf_get(void);
/* lkowner_buf */
-char *glusterfs_lkowner_buf_get (void);
+char *
+glusterfs_lkowner_buf_get(void);
/* leaseid buf */
-char *glusterfs_leaseid_buf_get (void);
-char *glusterfs_leaseid_exist (void);
+char *
+glusterfs_leaseid_buf_get(void);
+char *
+glusterfs_leaseid_exist(void);
/* init */
-int glusterfs_globals_init (glusterfs_ctx_t *ctx);
+int
+glusterfs_globals_init(glusterfs_ctx_t *ctx);
-struct tvec_base* glusterfs_ctx_tw_get (glusterfs_ctx_t *ctx);
-void glusterfs_ctx_tw_put (glusterfs_ctx_t *ctx);
+struct tvec_base *
+glusterfs_ctx_tw_get(glusterfs_ctx_t *ctx);
+void
+glusterfs_ctx_tw_put(glusterfs_ctx_t *ctx);
extern const char *gf_fop_list[];
extern const char *gf_upcall_list[];
/* mem acct enable/disable */
-int gf_global_mem_acct_enable_get (void);
-int gf_global_mem_acct_enable_set (int val);
+int
+gf_global_mem_acct_enable_get(void);
+int
+gf_global_mem_acct_enable_set(int val);
#endif /* !_GLOBALS_H */
diff --git a/libglusterfs/src/glusterfs-acl.h b/libglusterfs/src/glusterfs-acl.h
index 6194f320ab0..8c731fc771b 100644
--- a/libglusterfs/src/glusterfs-acl.h
+++ b/libglusterfs/src/glusterfs-acl.h
@@ -11,7 +11,6 @@
#ifndef _GLUSTERFS_ACL_H
#define _GLUSTERFS_ACL_H
-
/* WARNING: Much if this code is restricted to Linux usage.
*
* It would be much cleaner to replace the code with something that is based on
@@ -27,139 +26,136 @@
#include "locking.h" /* For gf_lock_t in struct posix_acl_conf */
-#define ACL_PROGRAM 100227
-#define ACLV3_VERSION 3
+#define ACL_PROGRAM 100227
+#define ACLV3_VERSION 3
-#define POSIX_ACL_MINIMAL_ACE_COUNT 3
+#define POSIX_ACL_MINIMAL_ACE_COUNT 3
-#define POSIX_ACL_READ (0x04)
-#define POSIX_ACL_WRITE (0x02)
-#define POSIX_ACL_EXECUTE (0x01)
+#define POSIX_ACL_READ (0x04)
+#define POSIX_ACL_WRITE (0x02)
+#define POSIX_ACL_EXECUTE (0x01)
-#define POSIX_ACL_UNDEFINED_TAG (0x00)
-#define POSIX_ACL_USER_OBJ (0x01)
-#define POSIX_ACL_USER (0x02)
-#define POSIX_ACL_GROUP_OBJ (0x04)
-#define POSIX_ACL_GROUP (0x08)
-#define POSIX_ACL_MASK (0x10)
-#define POSIX_ACL_OTHER (0x20)
+#define POSIX_ACL_UNDEFINED_TAG (0x00)
+#define POSIX_ACL_USER_OBJ (0x01)
+#define POSIX_ACL_USER (0x02)
+#define POSIX_ACL_GROUP_OBJ (0x04)
+#define POSIX_ACL_GROUP (0x08)
+#define POSIX_ACL_MASK (0x10)
+#define POSIX_ACL_OTHER (0x20)
-#define POSIX_ACL_UNDEFINED_ID (-1)
+#define POSIX_ACL_UNDEFINED_ID (-1)
-#define POSIX_ACL_XATTR_VERSION (0x02)
+#define POSIX_ACL_XATTR_VERSION (0x02)
-#define POSIX_ACL_ACCESS_XATTR "system.posix_acl_access"
-#define POSIX_ACL_DEFAULT_XATTR "system.posix_acl_default"
+#define POSIX_ACL_ACCESS_XATTR "system.posix_acl_access"
+#define POSIX_ACL_DEFAULT_XATTR "system.posix_acl_default"
struct posix_acl_xattr_entry {
- uint16_t tag;
- uint16_t perm;
- uint32_t id;
+ uint16_t tag;
+ uint16_t perm;
+ uint32_t id;
};
struct posix_acl_xattr_header {
- uint32_t version;
- struct posix_acl_xattr_entry entries[];
+ uint32_t version;
+ struct posix_acl_xattr_entry entries[];
};
-typedef struct posix_acl_xattr_entry posix_acl_xattr_entry;
+typedef struct posix_acl_xattr_entry posix_acl_xattr_entry;
typedef struct posix_acl_xattr_header posix_acl_xattr_header;
static inline size_t
-posix_acl_xattr_size (unsigned int count)
+posix_acl_xattr_size(unsigned int count)
{
- return (sizeof(posix_acl_xattr_header) +
- (count * sizeof(posix_acl_xattr_entry)));
+ return (sizeof(posix_acl_xattr_header) +
+ (count * sizeof(posix_acl_xattr_entry)));
}
static inline ssize_t
-posix_acl_xattr_count (size_t size)
+posix_acl_xattr_count(size_t size)
{
- if (size < sizeof(posix_acl_xattr_header))
- return (-1);
- size -= sizeof(posix_acl_xattr_header);
- if (size % sizeof(posix_acl_xattr_entry))
- return (-1);
- return (size / sizeof(posix_acl_xattr_entry));
+ if (size < sizeof(posix_acl_xattr_header))
+ return (-1);
+ size -= sizeof(posix_acl_xattr_header);
+ if (size % sizeof(posix_acl_xattr_entry))
+ return (-1);
+ return (size / sizeof(posix_acl_xattr_entry));
}
struct posix_ace {
- uint16_t tag;
- uint16_t perm;
- uint32_t id;
+ uint16_t tag;
+ uint16_t perm;
+ uint32_t id;
};
-
struct posix_acl {
- int refcnt;
- int count;
- struct posix_ace entries[];
+ int refcnt;
+ int count;
+ struct posix_ace entries[];
};
struct posix_acl_ctx {
- uid_t uid;
- gid_t gid;
- mode_t perm;
- glusterfs_fop_t fop;
- struct posix_acl *acl_access;
- struct posix_acl *acl_default;
+ uid_t uid;
+ gid_t gid;
+ mode_t perm;
+ glusterfs_fop_t fop;
+ struct posix_acl *acl_access;
+ struct posix_acl *acl_default;
};
struct posix_acl_conf {
- gf_lock_t acl_lock;
- uid_t super_uid;
- struct posix_acl *minimal_acl;
+ gf_lock_t acl_lock;
+ uid_t super_uid;
+ struct posix_acl *minimal_acl;
};
-
/* Above this comment, the legacy POSIX ACL support is kept until it is not
* used anymore. Below you will find the more portable version to support POSIX
* ACls based on the implementation of libacl (see sys/acl.h). */
/* virtual xattrs passed over RPC, not stored on disk */
-#define GF_POSIX_ACL_ACCESS "glusterfs.posix.acl"
-#define GF_POSIX_ACL_DEFAULT "glusterfs.posix.default_acl"
-#define GF_POSIX_ACL_REQUEST(key) \
- (!strncmp(key, GF_POSIX_ACL_ACCESS, SLEN (GF_POSIX_ACL_ACCESS)) || \
- !strncmp(key, GF_POSIX_ACL_DEFAULT, SLEN (GF_POSIX_ACL_DEFAULT)))
+#define GF_POSIX_ACL_ACCESS "glusterfs.posix.acl"
+#define GF_POSIX_ACL_DEFAULT "glusterfs.posix.default_acl"
+#define GF_POSIX_ACL_REQUEST(key) \
+ (!strncmp(key, GF_POSIX_ACL_ACCESS, SLEN(GF_POSIX_ACL_ACCESS)) || \
+ !strncmp(key, GF_POSIX_ACL_DEFAULT, SLEN(GF_POSIX_ACL_DEFAULT)))
#ifdef HAVE_SYS_ACL_H /* only NetBSD does not support POSIX ACLs */
#include <sys/acl.h>
-static inline const char*
-gf_posix_acl_get_key (const acl_type_t type)
+static inline const char *
+gf_posix_acl_get_key(const acl_type_t type)
{
- char *acl_key = NULL;
+ char *acl_key = NULL;
- switch (type) {
+ switch (type) {
case ACL_TYPE_ACCESS:
- acl_key = GF_POSIX_ACL_ACCESS;
- break;
+ acl_key = GF_POSIX_ACL_ACCESS;
+ break;
case ACL_TYPE_DEFAULT:
- acl_key = GF_POSIX_ACL_DEFAULT;
- break;
+ acl_key = GF_POSIX_ACL_DEFAULT;
+ break;
default:
- errno = EINVAL;
- }
+ errno = EINVAL;
+ }
- return acl_key;
+ return acl_key;
}
static inline const acl_type_t
-gf_posix_acl_get_type (const char *key)
+gf_posix_acl_get_type(const char *key)
{
- acl_type_t type = 0;
+ acl_type_t type = 0;
- if (!strncmp (key, GF_POSIX_ACL_ACCESS, SLEN (GF_POSIX_ACL_ACCESS)))
- type = ACL_TYPE_ACCESS;
- else if (!strncmp (key, GF_POSIX_ACL_DEFAULT,
- SLEN (GF_POSIX_ACL_DEFAULT)))
- type = ACL_TYPE_DEFAULT;
- else
- errno = EINVAL;
+ if (!strncmp(key, GF_POSIX_ACL_ACCESS, SLEN(GF_POSIX_ACL_ACCESS)))
+ type = ACL_TYPE_ACCESS;
+ else if (!strncmp(key, GF_POSIX_ACL_DEFAULT, SLEN(GF_POSIX_ACL_DEFAULT)))
+ type = ACL_TYPE_DEFAULT;
+ else
+ errno = EINVAL;
- return type;
+ return type;
}
#endif /* HAVE_SYS_ACL_H */
diff --git a/libglusterfs/src/glusterfs.h b/libglusterfs/src/glusterfs.h
index b046e0dd783..376b7a7c673 100644
--- a/libglusterfs/src/glusterfs.h
+++ b/libglusterfs/src/glusterfs.h
@@ -54,7 +54,7 @@
#include "atomic.h"
#define GF_YES 1
-#define GF_NO 0
+#define GF_NO 0
#ifndef O_LARGEFILE
/* savannah bug #20053, patch for compiling on darwin */
@@ -63,7 +63,7 @@
#ifndef O_FMODE_EXEC
/* redhat bug 843080, added from linux/fs.h */
-#define O_FMODE_EXEC 040 //0x20
+#define O_FMODE_EXEC 040 // 0x20
#endif
#ifndef O_DIRECT
@@ -88,95 +88,95 @@
/*gets max-offset on all architectures correctly*/
#define GF_OFF_MAX ((1ULL << (sizeof(off_t) * 8 - 1)) - 1ULL)
-#define GLUSTERD_MAX_SNAP_NAME 255
-#define GLUSTERFS_SOCKET_LISTEN_BACKLOG 10
+#define GLUSTERD_MAX_SNAP_NAME 255
+#define GLUSTERFS_SOCKET_LISTEN_BACKLOG 10
#define SLEN(str) (sizeof(str) - 1)
-#define ZR_MOUNTPOINT_OPT "mountpoint"
-#define ZR_ATTR_TIMEOUT_OPT "attribute-timeout"
-#define ZR_ENTRY_TIMEOUT_OPT "entry-timeout"
+#define ZR_MOUNTPOINT_OPT "mountpoint"
+#define ZR_ATTR_TIMEOUT_OPT "attribute-timeout"
+#define ZR_ENTRY_TIMEOUT_OPT "entry-timeout"
#define ZR_NEGATIVE_TIMEOUT_OPT "negative-timeout"
-#define ZR_DIRECT_IO_OPT "direct-io-mode"
+#define ZR_DIRECT_IO_OPT "direct-io-mode"
#define ZR_STRICT_VOLFILE_CHECK "strict-volfile-check"
-#define ZR_DUMP_FUSE "dump-fuse"
-#define ZR_FUSE_MOUNTOPTS "fuse-mountopts"
+#define ZR_DUMP_FUSE "dump-fuse"
+#define ZR_FUSE_MOUNTOPTS "fuse-mountopts"
#define IO_THREADS_QUEUE_SIZE_KEY "io-thread-queue-size"
-#define GF_XATTR_CLRLK_CMD "glusterfs.clrlk"
-#define GF_XATTR_PATHINFO_KEY "trusted.glusterfs.pathinfo"
-#define GF_XATTR_NODE_UUID_KEY "trusted.glusterfs.node-uuid"
+#define GF_XATTR_CLRLK_CMD "glusterfs.clrlk"
+#define GF_XATTR_PATHINFO_KEY "trusted.glusterfs.pathinfo"
+#define GF_XATTR_NODE_UUID_KEY "trusted.glusterfs.node-uuid"
#define GF_XATTR_LIST_NODE_UUIDS_KEY "trusted.glusterfs.list-node-uuids"
#define GF_REBAL_FIND_LOCAL_SUBVOL "glusterfs.find-local-subvol"
#define GF_REBAL_OLD_FIND_LOCAL_SUBVOL "glusterfs.old-find-local-subvol"
-#define GF_XATTR_VOL_ID_KEY "trusted.glusterfs.volume-id"
-#define GF_XATTR_LOCKINFO_KEY "trusted.glusterfs.lockinfo"
-#define GF_META_LOCK_KEY "glusterfs.lock-migration-meta-lock"
-#define GF_META_UNLOCK_KEY "glusterfs.lock-migration-meta-unlock"
+#define GF_XATTR_VOL_ID_KEY "trusted.glusterfs.volume-id"
+#define GF_XATTR_LOCKINFO_KEY "trusted.glusterfs.lockinfo"
+#define GF_META_LOCK_KEY "glusterfs.lock-migration-meta-lock"
+#define GF_META_UNLOCK_KEY "glusterfs.lock-migration-meta-unlock"
#define GF_XATTR_GET_REAL_FILENAME_KEY "glusterfs.get_real_filename:"
-#define GF_XATTR_USER_PATHINFO_KEY "glusterfs.pathinfo"
+#define GF_XATTR_USER_PATHINFO_KEY "glusterfs.pathinfo"
#define GF_INTERNAL_IGNORE_DEEM_STATFS "ignore-deem-statfs"
#define GF_XATTR_IOSTATS_DUMP_KEY "trusted.io-stats-dump"
-#define GF_READDIR_SKIP_DIRS "readdir-filter-directories"
-#define GF_MDC_LOADED_KEY_NAMES "glusterfs.mdc.loaded.key.names"
-
-#define BD_XATTR_KEY "user.glusterfs"
-#define GF_PREOP_PARENT_KEY "glusterfs.preop.parent.key"
-#define GF_PREOP_CHECK_FAILED "glusterfs.preop.check.failed"
-
-#define XATTR_IS_PATHINFO(x) ((strncmp (x, GF_XATTR_PATHINFO_KEY, \
- strlen (x)) == 0) || \
- (strncmp (x, GF_XATTR_USER_PATHINFO_KEY, \
- strlen (x)) == 0))
-#define XATTR_IS_NODE_UUID(x) (strncmp (x, GF_XATTR_NODE_UUID_KEY, \
- SLEN (GF_XATTR_NODE_UUID_KEY)) == 0)
-#define XATTR_IS_NODE_UUID_LIST(x) (strncmp (x, GF_XATTR_LIST_NODE_UUIDS_KEY, \
- SLEN (GF_XATTR_LIST_NODE_UUIDS_KEY)) == 0)
-#define XATTR_IS_LOCKINFO(x) (strncmp (x, GF_XATTR_LOCKINFO_KEY, \
- SLEN (GF_XATTR_LOCKINFO_KEY)) == 0)
-
-#define XATTR_IS_BD(x) (strncmp (x, BD_XATTR_KEY, SLEN (BD_XATTR_KEY)) == 0)
-
-#define GF_XATTR_LINKINFO_KEY "trusted.distribute.linkinfo"
-#define GFID_XATTR_KEY "trusted.gfid"
-#define PGFID_XATTR_KEY_PREFIX "trusted.pgfid."
-#define GFID2PATH_VIRT_XATTR_KEY "glusterfs.gfidtopath"
-#define GFID2PATH_XATTR_KEY_PREFIX "trusted.gfid2path."
+#define GF_READDIR_SKIP_DIRS "readdir-filter-directories"
+#define GF_MDC_LOADED_KEY_NAMES "glusterfs.mdc.loaded.key.names"
+
+#define BD_XATTR_KEY "user.glusterfs"
+#define GF_PREOP_PARENT_KEY "glusterfs.preop.parent.key"
+#define GF_PREOP_CHECK_FAILED "glusterfs.preop.check.failed"
+
+#define XATTR_IS_PATHINFO(x) \
+ ((strncmp(x, GF_XATTR_PATHINFO_KEY, strlen(x)) == 0) || \
+ (strncmp(x, GF_XATTR_USER_PATHINFO_KEY, strlen(x)) == 0))
+#define XATTR_IS_NODE_UUID(x) \
+ (strncmp(x, GF_XATTR_NODE_UUID_KEY, SLEN(GF_XATTR_NODE_UUID_KEY)) == 0)
+#define XATTR_IS_NODE_UUID_LIST(x) \
+ (strncmp(x, GF_XATTR_LIST_NODE_UUIDS_KEY, \
+ SLEN(GF_XATTR_LIST_NODE_UUIDS_KEY)) == 0)
+#define XATTR_IS_LOCKINFO(x) \
+ (strncmp(x, GF_XATTR_LOCKINFO_KEY, SLEN(GF_XATTR_LOCKINFO_KEY)) == 0)
+
+#define XATTR_IS_BD(x) (strncmp(x, BD_XATTR_KEY, SLEN(BD_XATTR_KEY)) == 0)
+
+#define GF_XATTR_LINKINFO_KEY "trusted.distribute.linkinfo"
+#define GFID_XATTR_KEY "trusted.gfid"
+#define PGFID_XATTR_KEY_PREFIX "trusted.pgfid."
+#define GFID2PATH_VIRT_XATTR_KEY "glusterfs.gfidtopath"
+#define GFID2PATH_XATTR_KEY_PREFIX "trusted.gfid2path."
#define GFID2PATH_XATTR_KEY_PREFIX_LENGTH 18
-#define VIRTUAL_GFID_XATTR_KEY_STR "glusterfs.gfid.string"
-#define VIRTUAL_GFID_XATTR_KEY "glusterfs.gfid"
-#define GF_XATTR_MDATA_KEY "trusted.glusterfs.mdata"
+#define VIRTUAL_GFID_XATTR_KEY_STR "glusterfs.gfid.string"
+#define VIRTUAL_GFID_XATTR_KEY "glusterfs.gfid"
+#define GF_XATTR_MDATA_KEY "trusted.glusterfs.mdata"
#define UUID_CANONICAL_FORM_LEN 36
#define GET_ANCESTRY_PATH_KEY "glusterfs.ancestry.path"
#define GET_ANCESTRY_DENTRY_KEY "glusterfs.ancestry.dentry"
-#define BITROT_DEFAULT_CURRENT_VERSION (unsigned long)1
-#define BITROT_DEFAULT_SIGNING_VERSION (unsigned long)0
+#define BITROT_DEFAULT_CURRENT_VERSION (unsigned long)1
+#define BITROT_DEFAULT_SIGNING_VERSION (unsigned long)0
/* on-disk object signature keys */
-#define BITROT_OBJECT_BAD_KEY "trusted.bit-rot.bad-file"
-#define BITROT_CURRENT_VERSION_KEY "trusted.bit-rot.version"
-#define BITROT_SIGNING_VERSION_KEY "trusted.bit-rot.signature"
+#define BITROT_OBJECT_BAD_KEY "trusted.bit-rot.bad-file"
+#define BITROT_CURRENT_VERSION_KEY "trusted.bit-rot.version"
+#define BITROT_SIGNING_VERSION_KEY "trusted.bit-rot.signature"
/* globally usable bad file marker */
-#define GLUSTERFS_BAD_INODE "glusterfs.bad-inode"
+#define GLUSTERFS_BAD_INODE "glusterfs.bad-inode"
/* on-disk size of signing xattr (not the signature itself) */
-#define BITROT_SIGNING_XATTR_SIZE_KEY "trusted.glusterfs.bit-rot.size"
+#define BITROT_SIGNING_XATTR_SIZE_KEY "trusted.glusterfs.bit-rot.size"
/* GET/SET object signature */
#define GLUSTERFS_GET_OBJECT_SIGNATURE "trusted.glusterfs.get-signature"
#define GLUSTERFS_SET_OBJECT_SIGNATURE "trusted.glusterfs.set-signature"
/* operation needs to be durable on-disk */
-#define GLUSTERFS_DURABLE_OP "trusted.glusterfs.durable-op"
+#define GLUSTERFS_DURABLE_OP "trusted.glusterfs.durable-op"
/* key for version exchange b/w bitrot stub and changelog */
-#define GLUSTERFS_VERSION_XCHG_KEY "glusterfs.version.xchg"
+#define GLUSTERFS_VERSION_XCHG_KEY "glusterfs.version.xchg"
-#define GLUSTERFS_INTERNAL_FOP_KEY "glusterfs-internal-fop"
+#define GLUSTERFS_INTERNAL_FOP_KEY "glusterfs-internal-fop"
/* GlusterFS Internal FOP Indicator flags
* (To pass information on the context in which a paritcular
@@ -186,7 +186,7 @@
* a scenario where there is a need for such context across translators.
* So it cannot be an absolute information on context.
*/
-#define GF_INTERNAL_CTX_KEY "glusterfs.internal-ctx"
+#define GF_INTERNAL_CTX_KEY "glusterfs.internal-ctx"
/*
* Always append entries to end of the enum, do not delete entries.
@@ -194,7 +194,7 @@
* needs to grow beyond this dict_set_flag has to be changed accordingly
*/
enum gf_internal_fop_indicator {
- GF_DHT_HEAL_DIR /* Index 0 in bit array*/
+ GF_DHT_HEAL_DIR /* Index 0 in bit array*/
};
/* Todo:
@@ -203,8 +203,7 @@ enum gf_internal_fop_indicator {
* GLUSTERFS_INTERNAL_FOP_KEY with this flag
*/
-
-#define DHT_CHANGELOG_RENAME_OP_KEY "changelog.rename-op"
+#define DHT_CHANGELOG_RENAME_OP_KEY "changelog.rename-op"
#define GLUSTERFS_WRITE_IS_APPEND "glusterfs.write-is-append"
#define GLUSTERFS_WRITE_UPDATE_ATOMIC "glusterfs.write-update-atomic"
@@ -255,79 +254,80 @@ enum gf_internal_fop_indicator {
#define GF_GFIDLESS_LOOKUP "gfidless-lookup"
/* replace-brick and pump related internal xattrs */
-#define RB_PUMP_CMD_START "glusterfs.pump.start"
-#define RB_PUMP_CMD_PAUSE "glusterfs.pump.pause"
-#define RB_PUMP_CMD_COMMIT "glusterfs.pump.commit"
-#define RB_PUMP_CMD_ABORT "glusterfs.pump.abort"
-#define RB_PUMP_CMD_STATUS "glusterfs.pump.status"
+#define RB_PUMP_CMD_START "glusterfs.pump.start"
+#define RB_PUMP_CMD_PAUSE "glusterfs.pump.pause"
+#define RB_PUMP_CMD_COMMIT "glusterfs.pump.commit"
+#define RB_PUMP_CMD_ABORT "glusterfs.pump.abort"
+#define RB_PUMP_CMD_STATUS "glusterfs.pump.status"
#define GLUSTERFS_MARKER_DONT_ACCOUNT_KEY "glusters.marker.dont-account"
-#define GLUSTERFS_RDMA_INLINE_THRESHOLD (2048)
-#define GLUSTERFS_RDMA_MAX_HEADER_SIZE (228) /* (sizeof (rdma_header_t) \
- + RDMA_MAX_SEGMENTS \
- * sizeof (rdma_read_chunk_t))
- */
+#define GLUSTERFS_RDMA_INLINE_THRESHOLD (2048)
+#define GLUSTERFS_RDMA_MAX_HEADER_SIZE \
+ (228) /* (sizeof (rdma_header_t) \
+ + RDMA_MAX_SEGMENTS \
+ * sizeof (rdma_read_chunk_t)) \
+ */
-#define GLUSTERFS_RPC_REPLY_SIZE 24
+#define GLUSTERFS_RPC_REPLY_SIZE 24
-#define STARTING_EVENT_THREADS 1
+#define STARTING_EVENT_THREADS 1
-#define DEFAULT_VAR_RUN_DIRECTORY DATADIR "/run/gluster"
+#define DEFAULT_VAR_RUN_DIRECTORY DATADIR "/run/gluster"
#define DEFAULT_GLUSTERFSD_MISC_DIRETORY DATADIR "/lib/misc/glusterfsd"
#ifdef GF_LINUX_HOST_OS
#define GLUSTERD_DEFAULT_WORKDIR DATADIR "/lib/glusterd"
#else
#define GLUSTERD_DEFAULT_WORKDIR DATADIR "/db/glusterd"
#endif
-#define GF_REPLICATE_TRASH_DIR ".landfill"
+#define GF_REPLICATE_TRASH_DIR ".landfill"
/* GlusterFS's maximum supported Auxiliary GIDs */
-#define GF_MAX_AUX_GROUPS 65535
+#define GF_MAX_AUX_GROUPS 65535
#define GF_UUID_BUF_SIZE 50
#define GF_UUID_BNAME_BUF_SIZE (320) /* (64 + 256) */
-#define GF_REBALANCE_TID_KEY "rebalance-id"
-#define GF_REMOVE_BRICK_TID_KEY "remove-brick-id"
-#define GF_TIER_TID_KEY "tier-id"
-#define GF_TIER_ENABLED "tier-enabled"
+#define GF_REBALANCE_TID_KEY "rebalance-id"
+#define GF_REMOVE_BRICK_TID_KEY "remove-brick-id"
+#define GF_TIER_TID_KEY "tier-id"
+#define GF_TIER_ENABLED "tier-enabled"
-#define UUID_CANONICAL_FORM_LEN 36
+#define UUID_CANONICAL_FORM_LEN 36
/* Adding this here instead of any glusterd*.h files as it is also required by
* cli
*/
-#define DEFAULT_GLUSTERD_SOCKFILE DATADIR "/run/glusterd.socket"
+#define DEFAULT_GLUSTERD_SOCKFILE DATADIR "/run/glusterd.socket"
/* features/marker-quota also needs to have knowledge of link-files so as to
* exclude them from accounting.
*/
-#define DHT_LINKFILE_MODE (S_ISVTX)
+#define DHT_LINKFILE_MODE (S_ISVTX)
-#define IS_DHT_LINKFILE_MODE(iabuf) ((st_mode_from_ia ((iabuf)->ia_prot, \
- (iabuf)->ia_type) & ~S_IFMT)\
- == DHT_LINKFILE_MODE)
+#define IS_DHT_LINKFILE_MODE(iabuf) \
+ ((st_mode_from_ia((iabuf)->ia_prot, (iabuf)->ia_type) & ~S_IFMT) == \
+ DHT_LINKFILE_MODE)
#define DHT_LINKFILE_STR "linkto"
#define DHT_COMMITHASH_STR "commithash"
-#define DHT_SKIP_NON_LINKTO_UNLINK "unlink-only-if-dht-linkto-file"
-#define TIER_SKIP_NON_LINKTO_UNLINK "unlink-only-if-tier-linkto-file"
-#define TIER_LINKFILE_GFID "tier-linkfile-gfid"
-#define DHT_SKIP_OPEN_FD_UNLINK "dont-unlink-for-open-fd"
-#define DHT_IATT_IN_XDATA_KEY "dht-get-iatt-in-xattr"
-#define DHT_MODE_IN_XDATA_KEY "dht-get-mode-in-xattr"
-#define GET_LINK_COUNT "get-link-count"
-#define GF_GET_SIZE "get-size"
-#define GF_PRESTAT "virt-gf-prestat"
-#define GF_POSTSTAT "virt-gf-poststat"
+#define DHT_SKIP_NON_LINKTO_UNLINK "unlink-only-if-dht-linkto-file"
+#define TIER_SKIP_NON_LINKTO_UNLINK "unlink-only-if-tier-linkto-file"
+#define TIER_LINKFILE_GFID "tier-linkfile-gfid"
+#define DHT_SKIP_OPEN_FD_UNLINK "dont-unlink-for-open-fd"
+#define DHT_IATT_IN_XDATA_KEY "dht-get-iatt-in-xattr"
+#define DHT_MODE_IN_XDATA_KEY "dht-get-mode-in-xattr"
+#define GET_LINK_COUNT "get-link-count"
+#define GF_GET_SIZE "get-size"
+#define GF_PRESTAT "virt-gf-prestat"
+#define GF_POSTSTAT "virt-gf-poststat"
/*CTR and Marker requires inode dentry link count from posix*/
#define GF_RESPONSE_LINK_COUNT_XDATA "gf_response_link_count"
-#define GF_REQUEST_LINK_COUNT_XDATA "gf_request_link_count"
+#define GF_REQUEST_LINK_COUNT_XDATA "gf_request_link_count"
-#define CTR_ATTACH_TIER_LOOKUP "ctr_attach_tier_lookup"
+#define CTR_ATTACH_TIER_LOOKUP "ctr_attach_tier_lookup"
-#define CLIENT_CMD_CONNECT "trusted.glusterfs.client-connect"
+#define CLIENT_CMD_CONNECT "trusted.glusterfs.client-connect"
#define CLIENT_CMD_DISCONNECT "trusted.glusterfs.client-disconnect"
#define GF_LOG_LRU_BUFSIZE_DEFAULT 5
@@ -343,22 +343,22 @@ enum gf_internal_fop_indicator {
#define GF_LOG_FLUSH_TIMEOUT_MAX_STR "300"
#define GF_LOG_LOCALTIME_DEFAULT 0
-#define GF_BACKTRACE_LEN 4096
+#define GF_BACKTRACE_LEN 4096
#define GF_BACKTRACE_FRAME_COUNT 7
-#define GF_LK_ADVISORY 0 /* maps to GLFS_LK_ADVISORY from libgfapi*/
+#define GF_LK_ADVISORY 0 /* maps to GLFS_LK_ADVISORY from libgfapi*/
#define GF_LK_MANDATORY 1 /* maps to GLFS_LK_MANDATORY from libgfapi*/
#define GF_LOCK_MODE "glusterfs.lk.lkmode"
-#define GF_CHECK_XATTR_KEY_AND_GOTO(key, cmpkey, errval, lbl) \
- do { \
- if (key && strcmp (key, cmpkey) == 0) { \
- errval = -EINVAL; \
- goto lbl; \
- } \
- } while (0) \
+#define GF_CHECK_XATTR_KEY_AND_GOTO(key, cmpkey, errval, lbl) \
+ do { \
+ if (key && strcmp(key, cmpkey) == 0) { \
+ errval = -EINVAL; \
+ goto lbl; \
+ } \
+ } while (0)
-#define GF_CS_OBJECT_SIZE "trusted.glusterfs.cs.object_size"
+#define GF_CS_OBJECT_SIZE "trusted.glusterfs.cs.object_size"
#define GF_CS_OBJECT_UPLOAD_COMPLETE "trusted.glusterfs.csou.complete"
#define GF_CS_OBJECT_REMOTE "trusted.glusterfs.cs.remote"
@@ -368,376 +368,370 @@ enum gf_internal_fop_indicator {
#define GF_CS_OBJECT_REPAIR "trusted.glusterfs.cs.repair"
typedef enum {
- GF_CS_LOCAL = 1,
- GF_CS_REMOTE = 2,
- GF_CS_REPAIR = 4,
- GF_CS_DOWNLOADING = 8,
- GF_CS_ERROR = 16,
+ GF_CS_LOCAL = 1,
+ GF_CS_REMOTE = 2,
+ GF_CS_REPAIR = 4,
+ GF_CS_DOWNLOADING = 8,
+ GF_CS_ERROR = 16,
} gf_cs_obj_state;
typedef enum {
- GF_FOP_PRI_UNSPEC = -1, /* Priority not specified */
- GF_FOP_PRI_HI = 0, /* low latency */
- GF_FOP_PRI_NORMAL, /* normal */
- GF_FOP_PRI_LO, /* bulk */
- GF_FOP_PRI_LEAST, /* least */
- GF_FOP_PRI_MAX, /* Highest */
+ GF_FOP_PRI_UNSPEC = -1, /* Priority not specified */
+ GF_FOP_PRI_HI = 0, /* low latency */
+ GF_FOP_PRI_NORMAL, /* normal */
+ GF_FOP_PRI_LO, /* bulk */
+ GF_FOP_PRI_LEAST, /* least */
+ GF_FOP_PRI_MAX, /* Highest */
} gf_fop_pri_t;
typedef enum {
- /* The 'component' (xlator / option) is not yet setting the flag */
- GF_UNCLASSIFIED = 0,
- /* The 'component' is experimental, should not be recommened
- in production mode */
- GF_EXPERIMENTAL,
- /* The 'component' is tech preview, ie, it is 'mostly' working as
- expected, but can have some of the corner cases, which is not
- handled. */
- GF_TECH_PREVIEW,
- /* The 'component' is good to run. Has good enough test and
- documentation coverage. */
- GF_MAINTAINED,
- /* The component is:
- - no more a focus
- - no more solving a valid use case
- - no more maintained, no volunteers to maintain
- - there is 'maintained' or 'tech-preview' feature,
- which does the same thing, better.
- */
- GF_DEPRECATED,
- /* The 'component' is no more 'built'. */
- GF_OBSOLETE,
- /* The 'component' exist for Documentation purposes.
- No real usecase */
- GF_DOCUMENT_PURPOSE,
+ /* The 'component' (xlator / option) is not yet setting the flag */
+ GF_UNCLASSIFIED = 0,
+ /* The 'component' is experimental, should not be recommened
+ in production mode */
+ GF_EXPERIMENTAL,
+ /* The 'component' is tech preview, ie, it is 'mostly' working as
+ expected, but can have some of the corner cases, which is not
+ handled. */
+ GF_TECH_PREVIEW,
+ /* The 'component' is good to run. Has good enough test and
+ documentation coverage. */
+ GF_MAINTAINED,
+ /* The component is:
+ - no more a focus
+ - no more solving a valid use case
+ - no more maintained, no volunteers to maintain
+ - there is 'maintained' or 'tech-preview' feature,
+ which does the same thing, better.
+ */
+ GF_DEPRECATED,
+ /* The 'component' is no more 'built'. */
+ GF_OBSOLETE,
+ /* The 'component' exist for Documentation purposes.
+ No real usecase */
+ GF_DOCUMENT_PURPOSE,
} gf_category_t;
+static const char *const FOP_PRI_STRINGS[] = {"HIGH", "NORMAL", "LOW", "LEAST"};
-static const char * const FOP_PRI_STRINGS[] = {
- "HIGH",
- "NORMAL",
- "LOW",
- "LEAST"
-};
-
-static inline const char *fop_pri_to_string (gf_fop_pri_t pri)
+static inline const char *
+fop_pri_to_string(gf_fop_pri_t pri)
{
- if (pri < 0)
- return "UNSPEC";
+ if (pri < 0)
+ return "UNSPEC";
- if (pri >= GF_FOP_PRI_MAX)
- return "INVALID";
+ if (pri >= GF_FOP_PRI_MAX)
+ return "INVALID";
- return FOP_PRI_STRINGS[pri];
+ return FOP_PRI_STRINGS[pri];
}
-const char *fop_enum_to_pri_string (glusterfs_fop_t fop);
+const char *
+fop_enum_to_pri_string(glusterfs_fop_t fop);
#define GF_SET_IF_NOT_PRESENT 0x1 /* default behaviour */
-#define GF_SET_OVERWRITE 0x2 /* Overwrite with the buf given */
-#define GF_SET_DIR_ONLY 0x4
-#define GF_SET_EPOCH_TIME 0x8 /* used by afr dir lookup selfheal */
-#define GF_AUXILLARY_PARGFID 0xd /* RIO dummy parent gfid */
+#define GF_SET_OVERWRITE 0x2 /* Overwrite with the buf given */
+#define GF_SET_DIR_ONLY 0x4
+#define GF_SET_EPOCH_TIME 0x8 /* used by afr dir lookup selfheal */
+#define GF_AUXILLARY_PARGFID 0xd /* RIO dummy parent gfid */
/* key value which quick read uses to get small files in lookup cbk */
#define GF_CONTENT_KEY "glusterfs.content"
struct _xlator_cmdline_option {
- struct list_head cmd_args;
- char *volume;
- char *key;
- char *value;
+ struct list_head cmd_args;
+ char *volume;
+ char *key;
+ char *value;
};
typedef struct _xlator_cmdline_option xlator_cmdline_option_t;
struct _server_cmdline {
- struct list_head list;
- char *volfile_server;
- char *transport;
- int port;
+ struct list_head list;
+ char *volfile_server;
+ char *transport;
+ int port;
};
typedef struct _server_cmdline server_cmdline_t;
-#define GF_OPTION_ENABLE _gf_true
-#define GF_OPTION_DISABLE _gf_false
+#define GF_OPTION_ENABLE _gf_true
+#define GF_OPTION_DISABLE _gf_false
#define GF_OPTION_DEFERRED 2
struct _cmd_args {
- /* basic options */
- char *volfile_server;
- server_cmdline_t *curr_server;
- /* List of backup volfile servers, including original */
- struct list_head volfile_servers;
- char *volfile;
- char *log_server;
- gf_loglevel_t log_level;
- char *log_file;
- char *log_ident;
- gf_log_logger_t logger;
- gf_log_format_t log_format;
- uint32_t log_buf_size;
- uint32_t log_flush_timeout;
- int32_t max_connect_attempts;
- char *print_exports;
- char *print_netgroups;
- int print_xlatordir;
- int print_statedumpdir;
- int print_logdir;
- int print_libexecdir;
- /* advanced options */
- uint32_t volfile_server_port;
- char *volfile_server_transport;
- uint32_t log_server_port;
- char *pid_file;
- char *sock_file;
- int no_daemon_mode;
- char *run_id;
- int debug_mode;
- int read_only;
- int acl;
- int selinux;
- int capability;
- int enable_ino32;
- int worm;
- int mac_compat;
- int fopen_keep_cache;
- int gid_timeout;
- char gid_timeout_set;
- int aux_gfid_mount;
-
- /* need a process wide timer-wheel? */
- int global_timer_wheel;
-
- /* list of xlator_option_t */
- struct list_head xlator_options;
-
- /* fuse options */
- int fuse_direct_io_mode;
- char *use_readdirp;
- int no_root_squash;
- int volfile_check;
- double fuse_entry_timeout;
- double fuse_negative_timeout;
- double fuse_attribute_timeout;
- char *volume_name;
- int fuse_nodev;
- int fuse_nosuid;
- char *dump_fuse;
- pid_t client_pid;
- int client_pid_set;
- unsigned uid_map_root;
- int background_qlen;
- int congestion_threshold;
- char *fuse_mountopts;
- int mem_acct;
- int resolve_gids;
-
- /* key args */
- char *mount_point;
- char *volfile_id;
-
- /* required for portmap */
- int brick_port;
- char *brick_name;
- int brick_port2;
-
- /* Should management connections use SSL? */
- int secure_mgmt;
-
- /* Linux-only OOM killer adjustment */
+ /* basic options */
+ char *volfile_server;
+ server_cmdline_t *curr_server;
+ /* List of backup volfile servers, including original */
+ struct list_head volfile_servers;
+ char *volfile;
+ char *log_server;
+ gf_loglevel_t log_level;
+ char *log_file;
+ char *log_ident;
+ gf_log_logger_t logger;
+ gf_log_format_t log_format;
+ uint32_t log_buf_size;
+ uint32_t log_flush_timeout;
+ int32_t max_connect_attempts;
+ char *print_exports;
+ char *print_netgroups;
+ int print_xlatordir;
+ int print_statedumpdir;
+ int print_logdir;
+ int print_libexecdir;
+ /* advanced options */
+ uint32_t volfile_server_port;
+ char *volfile_server_transport;
+ uint32_t log_server_port;
+ char *pid_file;
+ char *sock_file;
+ int no_daemon_mode;
+ char *run_id;
+ int debug_mode;
+ int read_only;
+ int acl;
+ int selinux;
+ int capability;
+ int enable_ino32;
+ int worm;
+ int mac_compat;
+ int fopen_keep_cache;
+ int gid_timeout;
+ char gid_timeout_set;
+ int aux_gfid_mount;
+
+ /* need a process wide timer-wheel? */
+ int global_timer_wheel;
+
+ /* list of xlator_option_t */
+ struct list_head xlator_options;
+
+ /* fuse options */
+ int fuse_direct_io_mode;
+ char *use_readdirp;
+ int no_root_squash;
+ int volfile_check;
+ double fuse_entry_timeout;
+ double fuse_negative_timeout;
+ double fuse_attribute_timeout;
+ char *volume_name;
+ int fuse_nodev;
+ int fuse_nosuid;
+ char *dump_fuse;
+ pid_t client_pid;
+ int client_pid_set;
+ unsigned uid_map_root;
+ int background_qlen;
+ int congestion_threshold;
+ char *fuse_mountopts;
+ int mem_acct;
+ int resolve_gids;
+
+ /* key args */
+ char *mount_point;
+ char *volfile_id;
+
+ /* required for portmap */
+ int brick_port;
+ char *brick_name;
+ int brick_port2;
+
+ /* Should management connections use SSL? */
+ int secure_mgmt;
+
+ /* Linux-only OOM killer adjustment */
#ifdef GF_LINUX_HOST_OS
- char *oom_score_adj;
+ char *oom_score_adj;
#endif
- /* Run this process with valgrind? Might want to prevent calling
- * functions that prevent valgrind from working correctly, like
- * dlclose(). */
- int valgrind;
- int localtime_logging;
+ /* Run this process with valgrind? Might want to prevent calling
+ * functions that prevent valgrind from working correctly, like
+ * dlclose(). */
+ int valgrind;
+ int localtime_logging;
- /* For the subdir mount */
- char *subdir_mount;
+ /* For the subdir mount */
+ char *subdir_mount;
- char *process_name;
- char *event_history;
- int thin_client;
- uint32_t reader_thread_count;
+ char *process_name;
+ char *event_history;
+ int thin_client;
+ uint32_t reader_thread_count;
- /* FUSE writeback cache support */
- int kernel_writeback_cache;
- uint32_t attr_times_granularity;
+ /* FUSE writeback cache support */
+ int kernel_writeback_cache;
+ uint32_t attr_times_granularity;
};
typedef struct _cmd_args cmd_args_t;
-
struct _glusterfs_graph {
- struct list_head list;
- char graph_uuid[128];
- struct timeval dob;
- void *first;
- void *top; /* selected by -n */
- uint32_t leaf_count;
- int xl_count;
- int id; /* Used in logging */
- int used; /* Should be set when fuse gets
- first CHILD_UP */
- uint32_t volfile_checksum;
+ struct list_head list;
+ char graph_uuid[128];
+ struct timeval dob;
+ void *first;
+ void *top; /* selected by -n */
+ uint32_t leaf_count;
+ int xl_count;
+ int id; /* Used in logging */
+ int used; /* Should be set when fuse gets
+ first CHILD_UP */
+ uint32_t volfile_checksum;
};
typedef struct _glusterfs_graph glusterfs_graph_t;
-
-typedef int32_t (*glusterfsd_mgmt_event_notify_fn_t) (int32_t event, void *data,
- ...);
+typedef int32_t (*glusterfsd_mgmt_event_notify_fn_t)(int32_t event, void *data,
+ ...);
typedef enum {
- MGMT_SSL_NEVER = 0,
- MGMT_SSL_COPY_IO,
- MGMT_SSL_ALWAYS
+ MGMT_SSL_NEVER = 0,
+ MGMT_SSL_COPY_IO,
+ MGMT_SSL_ALWAYS
} mgmt_ssl_t;
struct tvec_base;
/* reference counting for the global (per ctx) timer-wheel */
struct gf_ctx_tw {
- GF_REF_DECL;
- struct tvec_base *timer_wheel; /* global timer-wheel instance */
+ GF_REF_DECL;
+ struct tvec_base *timer_wheel; /* global timer-wheel instance */
};
struct _glusterfs_ctx {
- cmd_args_t cmd_args;
- char *process_uuid;
- FILE *pidfp;
- char fin;
- void *timer;
- void *ib;
- struct call_pool *pool;
- void *event_pool;
- void *iobuf_pool;
- void *logbuf_pool;
- gf_lock_t lock;
- size_t page_size;
-
- /* one per volfile parse */
- struct list_head graphs;
-
- /* the latest graph in use */
- glusterfs_graph_t *active;
-
- /* fuse or nfs (but not protocol/server) */
- void *master;
-
- /* xlator implementing MOPs for centralized logging, volfile server */
- void *mgmt;
-
- /* listener of the commands from glusterd */
- void *listener;
-
- /* toggle switch for latency measurement */
- unsigned char measure_latency;
- pthread_t sigwaiter;
- char *cmdlinestr;
- struct mem_pool *stub_mem_pool;
- unsigned char cleanup_started;
- int graph_id; /* Incremented per graph, value should
- indicate how many times the graph has
- got changed */
- pid_t mnt_pid; /* pid of the mount agent */
- int process_mode; /*mode in which process is runninng*/
- struct syncenv *env; /* The env pointer to the synctasks */
-
- struct list_head mempool_list; /* used to keep a global list of
- mempools, used to log details of
- mempool in statedump */
- char *statedump_path;
-
- struct mem_pool *dict_pool;
- struct mem_pool *dict_pair_pool;
- struct mem_pool *dict_data_pool;
-
- glusterfsd_mgmt_event_notify_fn_t notify; /* Used for xlators to make
- call to fsd-mgmt */
- gf_log_handle_t log; /* all logging related variables */
-
- int mem_acct_enable;
-
- int daemon_pipe[2];
-
- struct clienttable *clienttable;
-
- /*
- * Should management connections use SSL? This is the only place we
- * can put it where both daemon-startup and socket code will see it.
- *
- * Why is it an int? Because we're included before common-utils.h,
- * which defines gf_boolean_t (what we really want). It doesn't make
- * any sense, but it's not worth turning the codebase upside-down to
- * fix it. Thus, an int.
- */
- int secure_mgmt;
-
- /* The option is use to set cert_depth while management connection
- use SSL
- */
- int ssl_cert_depth;
-
- /*
- * Should *our* server/inbound connections use SSL? This is only true
- * if we're glusterd and secure_mgmt is set, or if we're glusterfsd
- * and SSL is set on the I/O path. It should never be set e.g. for
- * NFS.
- */
- mgmt_ssl_t secure_srvr;
- /* Buffer to 'save' backtrace even under OOM-kill like situations*/
- char btbuf[GF_BACKTRACE_LEN];
-
- pthread_mutex_t notify_lock;
- pthread_cond_t notify_cond;
- int notifying;
-
- struct gf_ctx_tw *tw; /* refcounted timer_wheel */
-
- gf_lock_t volfile_lock;
-
- /* configuration related elements, which gets changed
- from global xlator */
- struct {
- char *metrics_dumppath;
- } config;
-
- struct {
- gf_atomic_t max_dict_pairs;
- gf_atomic_t total_pairs_used;
- gf_atomic_t total_dicts_used;
- } stats;
-
- struct list_head volfile_list;
+ cmd_args_t cmd_args;
+ char *process_uuid;
+ FILE *pidfp;
+ char fin;
+ void *timer;
+ void *ib;
+ struct call_pool *pool;
+ void *event_pool;
+ void *iobuf_pool;
+ void *logbuf_pool;
+ gf_lock_t lock;
+ size_t page_size;
+
+ /* one per volfile parse */
+ struct list_head graphs;
+
+ /* the latest graph in use */
+ glusterfs_graph_t *active;
+
+ /* fuse or nfs (but not protocol/server) */
+ void *master;
+
+ /* xlator implementing MOPs for centralized logging, volfile server */
+ void *mgmt;
+
+ /* listener of the commands from glusterd */
+ void *listener;
+
+ /* toggle switch for latency measurement */
+ unsigned char measure_latency;
+ pthread_t sigwaiter;
+ char *cmdlinestr;
+ struct mem_pool *stub_mem_pool;
+ unsigned char cleanup_started;
+ int graph_id; /* Incremented per graph, value should
+ indicate how many times the graph has
+ got changed */
+ pid_t mnt_pid; /* pid of the mount agent */
+ int process_mode; /*mode in which process is runninng*/
+ struct syncenv *env; /* The env pointer to the synctasks */
+
+ struct list_head mempool_list; /* used to keep a global list of
+ mempools, used to log details of
+ mempool in statedump */
+ char *statedump_path;
+
+ struct mem_pool *dict_pool;
+ struct mem_pool *dict_pair_pool;
+ struct mem_pool *dict_data_pool;
+
+ glusterfsd_mgmt_event_notify_fn_t notify; /* Used for xlators to make
+ call to fsd-mgmt */
+ gf_log_handle_t log; /* all logging related variables */
+
+ int mem_acct_enable;
+
+ int daemon_pipe[2];
+
+ struct clienttable *clienttable;
+
+ /*
+ * Should management connections use SSL? This is the only place we
+ * can put it where both daemon-startup and socket code will see it.
+ *
+ * Why is it an int? Because we're included before common-utils.h,
+ * which defines gf_boolean_t (what we really want). It doesn't make
+ * any sense, but it's not worth turning the codebase upside-down to
+ * fix it. Thus, an int.
+ */
+ int secure_mgmt;
+
+ /* The option is use to set cert_depth while management connection
+ use SSL
+ */
+ int ssl_cert_depth;
+
+ /*
+ * Should *our* server/inbound connections use SSL? This is only true
+ * if we're glusterd and secure_mgmt is set, or if we're glusterfsd
+ * and SSL is set on the I/O path. It should never be set e.g. for
+ * NFS.
+ */
+ mgmt_ssl_t secure_srvr;
+ /* Buffer to 'save' backtrace even under OOM-kill like situations*/
+ char btbuf[GF_BACKTRACE_LEN];
+
+ pthread_mutex_t notify_lock;
+ pthread_cond_t notify_cond;
+ int notifying;
+
+ struct gf_ctx_tw *tw; /* refcounted timer_wheel */
+
+ gf_lock_t volfile_lock;
+
+ /* configuration related elements, which gets changed
+ from global xlator */
+ struct {
+ char *metrics_dumppath;
+ } config;
+
+ struct {
+ gf_atomic_t max_dict_pairs;
+ gf_atomic_t total_pairs_used;
+ gf_atomic_t total_dicts_used;
+ } stats;
+
+ struct list_head volfile_list;
};
typedef struct _glusterfs_ctx glusterfs_ctx_t;
typedef struct {
- char volfile_checksum[SHA256_DIGEST_LENGTH];
- char vol_id[NAME_MAX+1];
- struct list_head volfile_list;
+ char volfile_checksum[SHA256_DIGEST_LENGTH];
+ char vol_id[NAME_MAX + 1];
+ struct list_head volfile_list;
} gf_volfile_t;
-
-glusterfs_ctx_t *glusterfs_ctx_new (void);
+glusterfs_ctx_t *
+glusterfs_ctx_new(void);
struct gf_flock {
- short l_type;
- short l_whence;
- off_t l_start;
- off_t l_len;
- pid_t l_pid;
- gf_lkowner_t l_owner;
+ short l_type;
+ short l_whence;
+ off_t l_start;
+ off_t l_len;
+ pid_t l_pid;
+ gf_lkowner_t l_owner;
};
typedef struct lock_migration_info {
- struct list_head list;
- struct gf_flock flock;
- char *client_uid;
- uint32_t lk_flags;
+ struct list_head list;
+ struct gf_flock flock;
+ char *client_uid;
+ uint32_t lk_flags;
} lock_migration_info_t;
#define GF_MUST_CHECK __attribute__((warn_unused_result))
@@ -766,26 +760,39 @@ typedef struct lock_migration_info {
* done using secure connections for all tests without change elsewhere).
*
*/
-#define SECURE_ACCESS_FILE GLUSTERD_DEFAULT_WORKDIR "/secure-access"
-
-int glusterfs_graph_prepare (glusterfs_graph_t *graph, glusterfs_ctx_t *ctx,
- char *volume_name);
-int glusterfs_graph_destroy_residual (glusterfs_graph_t *graph);
-int glusterfs_graph_deactivate (glusterfs_graph_t *graph);
-int glusterfs_graph_destroy (glusterfs_graph_t *graph);
-int glusterfs_get_leaf_count (glusterfs_graph_t *graph);
-int glusterfs_graph_activate (glusterfs_graph_t *graph, glusterfs_ctx_t *ctx);
-glusterfs_graph_t *glusterfs_graph_construct (FILE *fp);
-int glusterfs_graph_init (glusterfs_graph_t *graph);
-glusterfs_graph_t *glusterfs_graph_new (void);
-int glusterfs_graph_reconfigure (glusterfs_graph_t *oldgraph,
- glusterfs_graph_t *newgraph);
-int glusterfs_graph_attach (glusterfs_graph_t *orig_graph, char *path,
- glusterfs_graph_t **newgraph);
-int glusterfs_graph_parent_up (glusterfs_graph_t *graph);
+#define SECURE_ACCESS_FILE GLUSTERD_DEFAULT_WORKDIR "/secure-access"
+
+int
+glusterfs_graph_prepare(glusterfs_graph_t *graph, glusterfs_ctx_t *ctx,
+ char *volume_name);
+int
+glusterfs_graph_destroy_residual(glusterfs_graph_t *graph);
+int
+glusterfs_graph_deactivate(glusterfs_graph_t *graph);
+int
+glusterfs_graph_destroy(glusterfs_graph_t *graph);
+int
+glusterfs_get_leaf_count(glusterfs_graph_t *graph);
+int
+glusterfs_graph_activate(glusterfs_graph_t *graph, glusterfs_ctx_t *ctx);
+glusterfs_graph_t *
+glusterfs_graph_construct(FILE *fp);
+int
+glusterfs_graph_init(glusterfs_graph_t *graph);
+glusterfs_graph_t *
+glusterfs_graph_new(void);
+int
+glusterfs_graph_reconfigure(glusterfs_graph_t *oldgraph,
+ glusterfs_graph_t *newgraph);
+int
+glusterfs_graph_attach(glusterfs_graph_t *orig_graph, char *path,
+ glusterfs_graph_t **newgraph);
+int
+glusterfs_graph_parent_up(glusterfs_graph_t *graph);
void
-gf_free_mig_locks (lock_migration_info_t *locks);
+gf_free_mig_locks(lock_migration_info_t *locks);
-int glusterfs_read_secure_access_file (void);
+int
+glusterfs_read_secure_access_file(void);
#endif /* _GLUSTERFS_H */
diff --git a/libglusterfs/src/graph-utils.h b/libglusterfs/src/graph-utils.h
index 207664fdb1f..c0e87268c5c 100644
--- a/libglusterfs/src/graph-utils.h
+++ b/libglusterfs/src/graph-utils.h
@@ -11,10 +11,14 @@
#ifndef _GRAPH_H_
#define _GRAPH_H_
-int glusterfs_graph_print_file (FILE *file, glusterfs_graph_t *graph);
+int
+glusterfs_graph_print_file(FILE *file, glusterfs_graph_t *graph);
-char *glusterfs_graph_print_buf (glusterfs_graph_t *graph);
+char *
+glusterfs_graph_print_buf(glusterfs_graph_t *graph);
-int glusterfs_xlator_link (xlator_t *pxl, xlator_t *cxl);
-void glusterfs_graph_set_first (glusterfs_graph_t *graph, xlator_t *xl);
+int
+glusterfs_xlator_link(xlator_t *pxl, xlator_t *cxl);
+void
+glusterfs_graph_set_first(glusterfs_graph_t *graph, xlator_t *xl);
#endif
diff --git a/libglusterfs/src/hashfn.h b/libglusterfs/src/hashfn.h
index fed464e11cd..a4cb33f072a 100644
--- a/libglusterfs/src/hashfn.h
+++ b/libglusterfs/src/hashfn.h
@@ -14,9 +14,12 @@
#include <sys/types.h>
#include <stdint.h>
-uint32_t SuperFastHash (const char * data, int32_t len);
+uint32_t
+SuperFastHash(const char *data, int32_t len);
-uint32_t gf_dm_hashfn (const char *msg, int len);
+uint32_t
+gf_dm_hashfn(const char *msg, int len);
-uint32_t ReallySimpleHash (char *path, int len);
+uint32_t
+ReallySimpleHash(char *path, int len);
#endif /* __HASHFN_H__ */
diff --git a/libglusterfs/src/iatt.h b/libglusterfs/src/iatt.h
index 500ccb01324..db366472970 100644
--- a/libglusterfs/src/iatt.h
+++ b/libglusterfs/src/iatt.h
@@ -8,7 +8,6 @@
cases as published by the Free Software Foundation.
*/
-
#ifndef _IATT_H
#define _IATT_H
@@ -23,90 +22,90 @@
#include "compat-uuid.h"
typedef enum {
- IA_INVAL = 0,
- IA_IFREG,
- IA_IFDIR,
- IA_IFLNK,
- IA_IFBLK,
- IA_IFCHR,
- IA_IFIFO,
- IA_IFSOCK
+ IA_INVAL = 0,
+ IA_IFREG,
+ IA_IFDIR,
+ IA_IFLNK,
+ IA_IFBLK,
+ IA_IFCHR,
+ IA_IFIFO,
+ IA_IFSOCK
} ia_type_t;
typedef struct {
- uint8_t suid:1;
- uint8_t sgid:1;
- uint8_t sticky:1;
- struct {
- uint8_t read:1;
- uint8_t write:1;
- uint8_t exec:1;
- } owner, group, other;
+ uint8_t suid : 1;
+ uint8_t sgid : 1;
+ uint8_t sticky : 1;
+ struct {
+ uint8_t read : 1;
+ uint8_t write : 1;
+ uint8_t exec : 1;
+ } owner, group, other;
} ia_prot_t;
struct iatt {
- uint64_t ia_flags;
- uint64_t ia_ino; /* inode number */
- uint64_t ia_dev; /* backing device ID */
- uint64_t ia_rdev; /* device ID (if special file) */
- uint64_t ia_size; /* file size in bytes */
- uint32_t ia_nlink; /* Link count */
- uint32_t ia_uid; /* user ID of owner */
- uint32_t ia_gid; /* group ID of owner */
- uint32_t ia_blksize; /* blocksize for filesystem I/O */
- uint64_t ia_blocks; /* number of 512B blocks allocated */
- int64_t ia_atime; /* last access time */
- int64_t ia_mtime; /* last modification time */
- int64_t ia_ctime; /* last status change time */
- int64_t ia_btime; /* creation time. Fill using statx */
- uint32_t ia_atime_nsec;
- uint32_t ia_mtime_nsec;
- uint32_t ia_ctime_nsec;
- uint32_t ia_btime_nsec;
- uint64_t ia_attributes; /* chattr related:compressed, immutable,
- * append only, encrypted etc.*/
- uint64_t ia_attributes_mask; /* Mask for the attributes */
-
- uuid_t ia_gfid;
- ia_type_t ia_type; /* type of file */
- ia_prot_t ia_prot; /* protection */
+ uint64_t ia_flags;
+ uint64_t ia_ino; /* inode number */
+ uint64_t ia_dev; /* backing device ID */
+ uint64_t ia_rdev; /* device ID (if special file) */
+ uint64_t ia_size; /* file size in bytes */
+ uint32_t ia_nlink; /* Link count */
+ uint32_t ia_uid; /* user ID of owner */
+ uint32_t ia_gid; /* group ID of owner */
+ uint32_t ia_blksize; /* blocksize for filesystem I/O */
+ uint64_t ia_blocks; /* number of 512B blocks allocated */
+ int64_t ia_atime; /* last access time */
+ int64_t ia_mtime; /* last modification time */
+ int64_t ia_ctime; /* last status change time */
+ int64_t ia_btime; /* creation time. Fill using statx */
+ uint32_t ia_atime_nsec;
+ uint32_t ia_mtime_nsec;
+ uint32_t ia_ctime_nsec;
+ uint32_t ia_btime_nsec;
+ uint64_t ia_attributes; /* chattr related:compressed, immutable,
+ * append only, encrypted etc.*/
+ uint64_t ia_attributes_mask; /* Mask for the attributes */
+
+ uuid_t ia_gfid;
+ ia_type_t ia_type; /* type of file */
+ ia_prot_t ia_prot; /* protection */
};
struct old_iatt {
- uint64_t ia_ino; /* inode number */
- uuid_t ia_gfid;
- uint64_t ia_dev; /* backing device ID */
- ia_type_t ia_type; /* type of file */
- ia_prot_t ia_prot; /* protection */
- uint32_t ia_nlink; /* Link count */
- uint32_t ia_uid; /* user ID of owner */
- uint32_t ia_gid; /* group ID of owner */
- uint64_t ia_rdev; /* device ID (if special file) */
- uint64_t ia_size; /* file size in bytes */
- uint32_t ia_blksize; /* blocksize for filesystem I/O */
- uint64_t ia_blocks; /* number of 512B blocks allocated */
- uint32_t ia_atime; /* last access time */
- uint32_t ia_atime_nsec;
- uint32_t ia_mtime; /* last modification time */
- uint32_t ia_mtime_nsec;
- uint32_t ia_ctime; /* last status change time */
- uint32_t ia_ctime_nsec;
+ uint64_t ia_ino; /* inode number */
+ uuid_t ia_gfid;
+ uint64_t ia_dev; /* backing device ID */
+ ia_type_t ia_type; /* type of file */
+ ia_prot_t ia_prot; /* protection */
+ uint32_t ia_nlink; /* Link count */
+ uint32_t ia_uid; /* user ID of owner */
+ uint32_t ia_gid; /* group ID of owner */
+ uint64_t ia_rdev; /* device ID (if special file) */
+ uint64_t ia_size; /* file size in bytes */
+ uint32_t ia_blksize; /* blocksize for filesystem I/O */
+ uint64_t ia_blocks; /* number of 512B blocks allocated */
+ uint32_t ia_atime; /* last access time */
+ uint32_t ia_atime_nsec;
+ uint32_t ia_mtime; /* last modification time */
+ uint32_t ia_mtime_nsec;
+ uint32_t ia_ctime; /* last status change time */
+ uint32_t ia_ctime_nsec;
};
/* 64-bit mask for valid members in struct iatt. */
-#define IATT_TYPE 0x0000000000000001U
-#define IATT_MODE 0x0000000000000002U
-#define IATT_NLINK 0x0000000000000004U
-#define IATT_UID 0x0000000000000008U
-#define IATT_GID 0x0000000000000010U
-#define IATT_ATIME 0x0000000000000020U
-#define IATT_MTIME 0x0000000000000040U
-#define IATT_CTIME 0x0000000000000080U
-#define IATT_INO 0x0000000000000100U
-#define IATT_SIZE 0x0000000000000200U
-#define IATT_BLOCKS 0x0000000000000400U
-#define IATT_BTIME 0x0000000000000800U
-#define IATT_GFID 0x0000000000001000U
+#define IATT_TYPE 0x0000000000000001U
+#define IATT_MODE 0x0000000000000002U
+#define IATT_NLINK 0x0000000000000004U
+#define IATT_UID 0x0000000000000008U
+#define IATT_GID 0x0000000000000010U
+#define IATT_ATIME 0x0000000000000020U
+#define IATT_MTIME 0x0000000000000040U
+#define IATT_CTIME 0x0000000000000080U
+#define IATT_INO 0x0000000000000100U
+#define IATT_SIZE 0x0000000000000200U
+#define IATT_BLOCKS 0x0000000000000400U
+#define IATT_BTIME 0x0000000000000800U
+#define IATT_GFID 0x0000000000001000U
/* Macros for checking validity of struct iatt members.*/
#define IATT_TYPE_VALID(iaflags) (iaflags & IATT_TYPE)
@@ -132,339 +131,330 @@ struct old_iatt {
#define IA_ISSOCK(t) (t == IA_IFSOCK)
#define IA_ISINVAL(t) (t == IA_INVAL)
-#define IA_PROT_RUSR(prot) ((prot).owner.read == 1)
-#define IA_PROT_WUSR(prot) ((prot).owner.write == 1)
-#define IA_PROT_XUSR(prot) ((prot).owner.exec == 1)
+#define IA_PROT_RUSR(prot) ((prot).owner.read == 1)
+#define IA_PROT_WUSR(prot) ((prot).owner.write == 1)
+#define IA_PROT_XUSR(prot) ((prot).owner.exec == 1)
-#define IA_PROT_RGRP(prot) ((prot).group.read == 1)
-#define IA_PROT_WGRP(prot) ((prot).group.write == 1)
-#define IA_PROT_XGRP(prot) ((prot).group.exec == 1)
+#define IA_PROT_RGRP(prot) ((prot).group.read == 1)
+#define IA_PROT_WGRP(prot) ((prot).group.write == 1)
+#define IA_PROT_XGRP(prot) ((prot).group.exec == 1)
-#define IA_PROT_ROTH(prot) ((prot).other.read == 1)
-#define IA_PROT_WOTH(prot) ((prot).other.write == 1)
-#define IA_PROT_XOTH(prot) ((prot).other.exec == 1)
+#define IA_PROT_ROTH(prot) ((prot).other.read == 1)
+#define IA_PROT_WOTH(prot) ((prot).other.write == 1)
+#define IA_PROT_XOTH(prot) ((prot).other.exec == 1)
-#define IA_PROT_SUID(prot) ((prot).suid == 1)
-#define IA_PROT_SGID(prot) ((prot).sgid == 1)
-#define IA_PROT_STCKY(prot) ((prot).sticky == 1)
+#define IA_PROT_SUID(prot) ((prot).suid == 1)
+#define IA_PROT_SGID(prot) ((prot).sgid == 1)
+#define IA_PROT_STCKY(prot) ((prot).sticky == 1)
-#define IA_FILE_OR_DIR(t) (IA_ISREG(t) || IA_ISDIR(t))
+#define IA_FILE_OR_DIR(t) (IA_ISREG(t) || IA_ISDIR(t))
static inline uint32_t
-ia_major (uint64_t ia_dev)
+ia_major(uint64_t ia_dev)
{
- return (uint32_t) (ia_dev >> 32);
+ return (uint32_t)(ia_dev >> 32);
}
-
static inline uint32_t
-ia_minor (uint64_t ia_dev)
+ia_minor(uint64_t ia_dev)
{
- return (uint32_t) (ia_dev & 0xffffffff);
+ return (uint32_t)(ia_dev & 0xffffffff);
}
-
static inline uint64_t
-ia_makedev (uint32_t ia_maj, uint32_t ia_min)
+ia_makedev(uint32_t ia_maj, uint32_t ia_min)
{
- return ((((uint64_t) ia_maj) << 32) | ia_min);
+ return ((((uint64_t)ia_maj) << 32) | ia_min);
}
-
static inline ia_prot_t
-ia_prot_from_st_mode (mode_t mode)
+ia_prot_from_st_mode(mode_t mode)
{
- ia_prot_t ia_prot = {0, };
-
- if (mode & S_ISUID)
- ia_prot.suid = 1;
- if (mode & S_ISGID)
- ia_prot.sgid = 1;
- if (mode & S_ISVTX)
- ia_prot.sticky = 1;
-
- if (mode & S_IRUSR)
- ia_prot.owner.read = 1;
- if (mode & S_IWUSR)
- ia_prot.owner.write = 1;
- if (mode & S_IXUSR)
- ia_prot.owner.exec = 1;
-
- if (mode & S_IRGRP)
- ia_prot.group.read = 1;
- if (mode & S_IWGRP)
- ia_prot.group.write = 1;
- if (mode & S_IXGRP)
- ia_prot.group.exec = 1;
-
- if (mode & S_IROTH)
- ia_prot.other.read = 1;
- if (mode & S_IWOTH)
- ia_prot.other.write = 1;
- if (mode & S_IXOTH)
- ia_prot.other.exec = 1;
-
- return ia_prot;
+ ia_prot_t ia_prot = {
+ 0,
+ };
+
+ if (mode & S_ISUID)
+ ia_prot.suid = 1;
+ if (mode & S_ISGID)
+ ia_prot.sgid = 1;
+ if (mode & S_ISVTX)
+ ia_prot.sticky = 1;
+
+ if (mode & S_IRUSR)
+ ia_prot.owner.read = 1;
+ if (mode & S_IWUSR)
+ ia_prot.owner.write = 1;
+ if (mode & S_IXUSR)
+ ia_prot.owner.exec = 1;
+
+ if (mode & S_IRGRP)
+ ia_prot.group.read = 1;
+ if (mode & S_IWGRP)
+ ia_prot.group.write = 1;
+ if (mode & S_IXGRP)
+ ia_prot.group.exec = 1;
+
+ if (mode & S_IROTH)
+ ia_prot.other.read = 1;
+ if (mode & S_IWOTH)
+ ia_prot.other.write = 1;
+ if (mode & S_IXOTH)
+ ia_prot.other.exec = 1;
+
+ return ia_prot;
}
-
static inline ia_type_t
-ia_type_from_st_mode (mode_t mode)
+ia_type_from_st_mode(mode_t mode)
{
- ia_type_t type = IA_INVAL;
-
- if (S_ISREG (mode))
- type = IA_IFREG;
- if (S_ISDIR (mode))
- type = IA_IFDIR;
- if (S_ISLNK (mode))
- type = IA_IFLNK;
- if (S_ISBLK (mode))
- type = IA_IFBLK;
- if (S_ISCHR (mode))
- type = IA_IFCHR;
- if (S_ISFIFO (mode))
- type = IA_IFIFO;
- if (S_ISSOCK (mode))
- type = IA_IFSOCK;
-
- return type;
+ ia_type_t type = IA_INVAL;
+
+ if (S_ISREG(mode))
+ type = IA_IFREG;
+ if (S_ISDIR(mode))
+ type = IA_IFDIR;
+ if (S_ISLNK(mode))
+ type = IA_IFLNK;
+ if (S_ISBLK(mode))
+ type = IA_IFBLK;
+ if (S_ISCHR(mode))
+ type = IA_IFCHR;
+ if (S_ISFIFO(mode))
+ type = IA_IFIFO;
+ if (S_ISSOCK(mode))
+ type = IA_IFSOCK;
+
+ return type;
}
-
static inline uint32_t
-st_mode_prot_from_ia (ia_prot_t prot)
+st_mode_prot_from_ia(ia_prot_t prot)
{
- uint32_t prot_bit = 0;
-
- if (prot.suid)
- prot_bit |= S_ISUID;
- if (prot.sgid)
- prot_bit |= S_ISGID;
- if (prot.sticky)
- prot_bit |= S_ISVTX;
-
- if (prot.owner.read)
- prot_bit |= S_IRUSR;
- if (prot.owner.write)
- prot_bit |= S_IWUSR;
- if (prot.owner.exec)
- prot_bit |= S_IXUSR;
-
- if (prot.group.read)
- prot_bit |= S_IRGRP;
- if (prot.group.write)
- prot_bit |= S_IWGRP;
- if (prot.group.exec)
- prot_bit |= S_IXGRP;
-
- if (prot.other.read)
- prot_bit |= S_IROTH;
- if (prot.other.write)
- prot_bit |= S_IWOTH;
- if (prot.other.exec)
- prot_bit |= S_IXOTH;
-
- return prot_bit;
+ uint32_t prot_bit = 0;
+
+ if (prot.suid)
+ prot_bit |= S_ISUID;
+ if (prot.sgid)
+ prot_bit |= S_ISGID;
+ if (prot.sticky)
+ prot_bit |= S_ISVTX;
+
+ if (prot.owner.read)
+ prot_bit |= S_IRUSR;
+ if (prot.owner.write)
+ prot_bit |= S_IWUSR;
+ if (prot.owner.exec)
+ prot_bit |= S_IXUSR;
+
+ if (prot.group.read)
+ prot_bit |= S_IRGRP;
+ if (prot.group.write)
+ prot_bit |= S_IWGRP;
+ if (prot.group.exec)
+ prot_bit |= S_IXGRP;
+
+ if (prot.other.read)
+ prot_bit |= S_IROTH;
+ if (prot.other.write)
+ prot_bit |= S_IWOTH;
+ if (prot.other.exec)
+ prot_bit |= S_IXOTH;
+
+ return prot_bit;
}
-
static inline mode_t
-st_mode_from_ia (ia_prot_t prot, ia_type_t type)
+st_mode_from_ia(ia_prot_t prot, ia_type_t type)
{
- mode_t st_mode = 0;
- uint32_t type_bit = 0;
- uint32_t prot_bit = 0;
+ mode_t st_mode = 0;
+ uint32_t type_bit = 0;
+ uint32_t prot_bit = 0;
- switch (type) {
+ switch (type) {
case IA_IFREG:
- type_bit = S_IFREG;
- break;
+ type_bit = S_IFREG;
+ break;
case IA_IFDIR:
- type_bit = S_IFDIR;
- break;
+ type_bit = S_IFDIR;
+ break;
case IA_IFLNK:
- type_bit = S_IFLNK;
- break;
+ type_bit = S_IFLNK;
+ break;
case IA_IFBLK:
- type_bit = S_IFBLK;
- break;
+ type_bit = S_IFBLK;
+ break;
case IA_IFCHR:
- type_bit = S_IFCHR;
- break;
+ type_bit = S_IFCHR;
+ break;
case IA_IFIFO:
- type_bit = S_IFIFO;
- break;
+ type_bit = S_IFIFO;
+ break;
case IA_IFSOCK:
- type_bit = S_IFSOCK;
- break;
+ type_bit = S_IFSOCK;
+ break;
case IA_INVAL:
- break;
- }
+ break;
+ }
- prot_bit = st_mode_prot_from_ia (prot);
+ prot_bit = st_mode_prot_from_ia(prot);
- st_mode = (type_bit | prot_bit);
+ st_mode = (type_bit | prot_bit);
- return st_mode;
+ return st_mode;
}
-
static inline int
-iatt_from_stat (struct iatt *iatt, struct stat *stat)
+iatt_from_stat(struct iatt *iatt, struct stat *stat)
{
- iatt->ia_dev = stat->st_dev;
- iatt->ia_ino = stat->st_ino;
+ iatt->ia_dev = stat->st_dev;
+ iatt->ia_ino = stat->st_ino;
- iatt->ia_type = ia_type_from_st_mode (stat->st_mode);
- iatt->ia_prot = ia_prot_from_st_mode (stat->st_mode);
+ iatt->ia_type = ia_type_from_st_mode(stat->st_mode);
+ iatt->ia_prot = ia_prot_from_st_mode(stat->st_mode);
- iatt->ia_nlink = stat->st_nlink;
- iatt->ia_uid = stat->st_uid;
- iatt->ia_gid = stat->st_gid;
+ iatt->ia_nlink = stat->st_nlink;
+ iatt->ia_uid = stat->st_uid;
+ iatt->ia_gid = stat->st_gid;
- iatt->ia_rdev = ia_makedev (major (stat->st_rdev),
- minor (stat->st_rdev));
+ iatt->ia_rdev = ia_makedev(major(stat->st_rdev), minor(stat->st_rdev));
- iatt->ia_size = stat->st_size;
- iatt->ia_blksize = stat->st_blksize;
- iatt->ia_blocks = stat->st_blocks;
+ iatt->ia_size = stat->st_size;
+ iatt->ia_blksize = stat->st_blksize;
+ iatt->ia_blocks = stat->st_blocks;
- /* There is a possibility that the backend FS (like XFS) can
- allocate blocks beyond EOF for better performance reasons, which
- results in 'st_blocks' with higher values than what is consumed by
- the file descriptor. This would break few logic inside GlusterFS,
- like quota behavior etc, thus we need the exact number of blocks
- which are consumed by the file to the higher layers inside GlusterFS.
- Currently, this logic won't work for sparse files (ie, file with
- holes)
- */
- {
- uint64_t maxblocks;
+ /* There is a possibility that the backend FS (like XFS) can
+ allocate blocks beyond EOF for better performance reasons, which
+ results in 'st_blocks' with higher values than what is consumed by
+ the file descriptor. This would break few logic inside GlusterFS,
+ like quota behavior etc, thus we need the exact number of blocks
+ which are consumed by the file to the higher layers inside GlusterFS.
+ Currently, this logic won't work for sparse files (ie, file with
+ holes)
+ */
+ {
+ uint64_t maxblocks;
- maxblocks = (iatt->ia_size + 511) / 512;
+ maxblocks = (iatt->ia_size + 511) / 512;
- if (iatt->ia_blocks > maxblocks)
- iatt->ia_blocks = maxblocks;
- }
+ if (iatt->ia_blocks > maxblocks)
+ iatt->ia_blocks = maxblocks;
+ }
- iatt->ia_atime = stat->st_atime;
- iatt->ia_atime_nsec = ST_ATIM_NSEC (stat);
+ iatt->ia_atime = stat->st_atime;
+ iatt->ia_atime_nsec = ST_ATIM_NSEC(stat);
- iatt->ia_mtime = stat->st_mtime;
- iatt->ia_mtime_nsec = ST_MTIM_NSEC (stat);
+ iatt->ia_mtime = stat->st_mtime;
+ iatt->ia_mtime_nsec = ST_MTIM_NSEC(stat);
- iatt->ia_ctime = stat->st_ctime;
- iatt->ia_ctime_nsec = ST_CTIM_NSEC (stat);
+ iatt->ia_ctime = stat->st_ctime;
+ iatt->ia_ctime_nsec = ST_CTIM_NSEC(stat);
- /* Setting IATT_INO in ia_flags is done in posix_fill_ino_from_gfid. */
- iatt->ia_flags = iatt->ia_flags | IATT_TYPE | IATT_MODE | IATT_NLINK |
- IATT_UID | IATT_GID | IATT_SIZE | IATT_BLOCKS |
- IATT_ATIME | IATT_MTIME | IATT_CTIME;
+ /* Setting IATT_INO in ia_flags is done in posix_fill_ino_from_gfid. */
+ iatt->ia_flags = iatt->ia_flags | IATT_TYPE | IATT_MODE | IATT_NLINK |
+ IATT_UID | IATT_GID | IATT_SIZE | IATT_BLOCKS |
+ IATT_ATIME | IATT_MTIME | IATT_CTIME;
- return 0;
+ return 0;
}
-
static inline int
-iatt_to_stat (struct iatt *iatt, struct stat *stat)
+iatt_to_stat(struct iatt *iatt, struct stat *stat)
{
- stat->st_dev = iatt->ia_dev;
- stat->st_ino = iatt->ia_ino;
+ stat->st_dev = iatt->ia_dev;
+ stat->st_ino = iatt->ia_ino;
- stat->st_mode = st_mode_from_ia (iatt->ia_prot, iatt->ia_type);
+ stat->st_mode = st_mode_from_ia(iatt->ia_prot, iatt->ia_type);
- stat->st_nlink = iatt->ia_nlink;
- stat->st_uid = iatt->ia_uid;
- stat->st_gid = iatt->ia_gid;
+ stat->st_nlink = iatt->ia_nlink;
+ stat->st_uid = iatt->ia_uid;
+ stat->st_gid = iatt->ia_gid;
- stat->st_rdev = makedev (ia_major (iatt->ia_rdev),
- ia_minor (iatt->ia_rdev));
+ stat->st_rdev = makedev(ia_major(iatt->ia_rdev), ia_minor(iatt->ia_rdev));
- stat->st_size = iatt->ia_size;
- stat->st_blksize = iatt->ia_blksize;
- stat->st_blocks = iatt->ia_blocks;
+ stat->st_size = iatt->ia_size;
+ stat->st_blksize = iatt->ia_blksize;
+ stat->st_blocks = iatt->ia_blocks;
- stat->st_atime = iatt->ia_atime;
- ST_ATIM_NSEC_SET (stat, iatt->ia_atime_nsec);
+ stat->st_atime = iatt->ia_atime;
+ ST_ATIM_NSEC_SET(stat, iatt->ia_atime_nsec);
- stat->st_mtime = iatt->ia_mtime;
- ST_MTIM_NSEC_SET (stat, iatt->ia_mtime_nsec);
+ stat->st_mtime = iatt->ia_mtime;
+ ST_MTIM_NSEC_SET(stat, iatt->ia_mtime_nsec);
- stat->st_ctime = iatt->ia_ctime;
- ST_CTIM_NSEC_SET (stat, iatt->ia_ctime_nsec);
+ stat->st_ctime = iatt->ia_ctime;
+ ST_CTIM_NSEC_SET(stat, iatt->ia_ctime_nsec);
- return 0;
+ return 0;
}
static inline void
-oldiatt_from_iatt (struct old_iatt *o_iatt, struct iatt *c_iatt)
+oldiatt_from_iatt(struct old_iatt *o_iatt, struct iatt *c_iatt)
{
- o_iatt->ia_dev = c_iatt->ia_dev;
- o_iatt->ia_ino = c_iatt->ia_ino;
- o_iatt->ia_type = c_iatt->ia_type;
- o_iatt->ia_prot = c_iatt->ia_prot;
- o_iatt->ia_nlink = c_iatt->ia_nlink;
- o_iatt->ia_uid = c_iatt->ia_uid;
- o_iatt->ia_gid = c_iatt->ia_gid;
- o_iatt->ia_rdev = c_iatt->ia_rdev;
- o_iatt->ia_size = c_iatt->ia_size;
- o_iatt->ia_blksize = c_iatt->ia_blksize;
- o_iatt->ia_blocks = c_iatt->ia_blocks;
- o_iatt->ia_atime = c_iatt->ia_atime;
- o_iatt->ia_atime_nsec = c_iatt->ia_atime_nsec;
- o_iatt->ia_mtime = c_iatt->ia_mtime;
- o_iatt->ia_mtime_nsec = c_iatt->ia_mtime_nsec;
- o_iatt->ia_ctime = c_iatt->ia_ctime;
- o_iatt->ia_ctime_nsec = c_iatt->ia_ctime_nsec;
-
- gf_uuid_copy (o_iatt->ia_gfid, c_iatt->ia_gfid);
-
- return;
+ o_iatt->ia_dev = c_iatt->ia_dev;
+ o_iatt->ia_ino = c_iatt->ia_ino;
+ o_iatt->ia_type = c_iatt->ia_type;
+ o_iatt->ia_prot = c_iatt->ia_prot;
+ o_iatt->ia_nlink = c_iatt->ia_nlink;
+ o_iatt->ia_uid = c_iatt->ia_uid;
+ o_iatt->ia_gid = c_iatt->ia_gid;
+ o_iatt->ia_rdev = c_iatt->ia_rdev;
+ o_iatt->ia_size = c_iatt->ia_size;
+ o_iatt->ia_blksize = c_iatt->ia_blksize;
+ o_iatt->ia_blocks = c_iatt->ia_blocks;
+ o_iatt->ia_atime = c_iatt->ia_atime;
+ o_iatt->ia_atime_nsec = c_iatt->ia_atime_nsec;
+ o_iatt->ia_mtime = c_iatt->ia_mtime;
+ o_iatt->ia_mtime_nsec = c_iatt->ia_mtime_nsec;
+ o_iatt->ia_ctime = c_iatt->ia_ctime;
+ o_iatt->ia_ctime_nsec = c_iatt->ia_ctime_nsec;
+
+ gf_uuid_copy(o_iatt->ia_gfid, c_iatt->ia_gfid);
+
+ return;
}
static inline void
-iatt_from_oldiatt (struct iatt *c_iatt, struct old_iatt *o_iatt)
+iatt_from_oldiatt(struct iatt *c_iatt, struct old_iatt *o_iatt)
{
- c_iatt->ia_dev = o_iatt->ia_dev;
- c_iatt->ia_ino = o_iatt->ia_ino;
- c_iatt->ia_type = o_iatt->ia_type;
- c_iatt->ia_prot = o_iatt->ia_prot;
- c_iatt->ia_nlink = o_iatt->ia_nlink;
- c_iatt->ia_uid = o_iatt->ia_uid;
- c_iatt->ia_gid = o_iatt->ia_gid;
- c_iatt->ia_rdev = o_iatt->ia_rdev;
- c_iatt->ia_size = o_iatt->ia_size;
- c_iatt->ia_blksize = o_iatt->ia_blksize;
- c_iatt->ia_blocks = o_iatt->ia_blocks;
- c_iatt->ia_atime = o_iatt->ia_atime;
- c_iatt->ia_atime_nsec = o_iatt->ia_atime_nsec;
- c_iatt->ia_mtime = o_iatt->ia_mtime;
- c_iatt->ia_mtime_nsec = o_iatt->ia_mtime_nsec;
- c_iatt->ia_ctime = o_iatt->ia_ctime;
- c_iatt->ia_ctime_nsec = o_iatt->ia_ctime_nsec;
-
- gf_uuid_copy (c_iatt->ia_gfid, o_iatt->ia_gfid);
-
- c_iatt->ia_attributes = 0;
-
- c_iatt->ia_flags = IATT_TYPE | IATT_MODE | IATT_NLINK | IATT_INO |
- IATT_UID | IATT_GID | IATT_SIZE | IATT_BLOCKS |
- IATT_ATIME | IATT_MTIME | IATT_CTIME | IATT_GFID;
-
- return;
+ c_iatt->ia_dev = o_iatt->ia_dev;
+ c_iatt->ia_ino = o_iatt->ia_ino;
+ c_iatt->ia_type = o_iatt->ia_type;
+ c_iatt->ia_prot = o_iatt->ia_prot;
+ c_iatt->ia_nlink = o_iatt->ia_nlink;
+ c_iatt->ia_uid = o_iatt->ia_uid;
+ c_iatt->ia_gid = o_iatt->ia_gid;
+ c_iatt->ia_rdev = o_iatt->ia_rdev;
+ c_iatt->ia_size = o_iatt->ia_size;
+ c_iatt->ia_blksize = o_iatt->ia_blksize;
+ c_iatt->ia_blocks = o_iatt->ia_blocks;
+ c_iatt->ia_atime = o_iatt->ia_atime;
+ c_iatt->ia_atime_nsec = o_iatt->ia_atime_nsec;
+ c_iatt->ia_mtime = o_iatt->ia_mtime;
+ c_iatt->ia_mtime_nsec = o_iatt->ia_mtime_nsec;
+ c_iatt->ia_ctime = o_iatt->ia_ctime;
+ c_iatt->ia_ctime_nsec = o_iatt->ia_ctime_nsec;
+
+ gf_uuid_copy(c_iatt->ia_gfid, o_iatt->ia_gfid);
+
+ c_iatt->ia_attributes = 0;
+
+ c_iatt->ia_flags = IATT_TYPE | IATT_MODE | IATT_NLINK | IATT_INO |
+ IATT_UID | IATT_GID | IATT_SIZE | IATT_BLOCKS |
+ IATT_ATIME | IATT_MTIME | IATT_CTIME | IATT_GFID;
+
+ return;
}
static inline int
-is_same_mode (ia_prot_t prot1, ia_prot_t prot2)
+is_same_mode(ia_prot_t prot1, ia_prot_t prot2)
{
- int ret = 0;
+ int ret = 0;
- if (st_mode_prot_from_ia(prot1) != st_mode_prot_from_ia(prot2))
- ret = -1;
+ if (st_mode_prot_from_ia(prot1) != st_mode_prot_from_ia(prot2))
+ ret = -1;
- return ret;
+ return ret;
}
-
#endif /* _IATT_H */
diff --git a/libglusterfs/src/inode.h b/libglusterfs/src/inode.h
index 658477700c0..276a1f1577c 100644
--- a/libglusterfs/src/inode.h
+++ b/libglusterfs/src/inode.h
@@ -17,7 +17,7 @@
#define LOOKUP_NEEDED 1
#define LOOKUP_NOT_NEEDED 2
-#define DEFAULT_INODE_MEMPOOL_ENTRIES 32 * 1024
+#define DEFAULT_INODE_MEMPOOL_ENTRIES 32 * 1024
#define INODE_PATH_FMT "<gfid:%s>"
struct _inode_table;
typedef struct _inode_table inode_table_t;
@@ -34,259 +34,256 @@ typedef struct _dentry dentry_t;
#include "fd.h"
struct _inode_table {
- pthread_mutex_t lock;
- size_t hashsize; /* bucket size of inode hash and dentry hash */
- char *name; /* name of the inode table, just for gf_log() */
- inode_t *root; /* root directory inode, with number 1 */
- xlator_t *xl; /* xlator to be called to do purge */
- uint32_t lru_limit; /* maximum LRU cache size */
- struct list_head *inode_hash; /* buckets for inode hash table */
- struct list_head *name_hash; /* buckets for dentry hash table */
- struct list_head active; /* list of inodes currently active (in an fop) */
- uint32_t active_size; /* count of inodes in active list */
- struct list_head lru; /* list of inodes recently used.
- lru.next most recent */
- uint32_t lru_size; /* count of inodes in lru list */
- struct list_head purge; /* list of inodes to be purged soon */
- uint32_t purge_size; /* count of inodes in purge list */
-
- struct mem_pool *inode_pool; /* memory pool for inodes */
- struct mem_pool *dentry_pool; /* memory pool for dentrys */
- struct mem_pool *fd_mem_pool; /* memory pool for fd_t */
- int ctxcount; /* number of slots in inode->ctx */
+ pthread_mutex_t lock;
+ size_t hashsize; /* bucket size of inode hash and dentry hash */
+ char *name; /* name of the inode table, just for gf_log() */
+ inode_t *root; /* root directory inode, with number 1 */
+ xlator_t *xl; /* xlator to be called to do purge */
+ uint32_t lru_limit; /* maximum LRU cache size */
+ struct list_head *inode_hash; /* buckets for inode hash table */
+ struct list_head *name_hash; /* buckets for dentry hash table */
+ struct list_head active; /* list of inodes currently active (in an fop) */
+ uint32_t active_size; /* count of inodes in active list */
+ struct list_head lru; /* list of inodes recently used.
+ lru.next most recent */
+ uint32_t lru_size; /* count of inodes in lru list */
+ struct list_head purge; /* list of inodes to be purged soon */
+ uint32_t purge_size; /* count of inodes in purge list */
+
+ struct mem_pool *inode_pool; /* memory pool for inodes */
+ struct mem_pool *dentry_pool; /* memory pool for dentrys */
+ struct mem_pool *fd_mem_pool; /* memory pool for fd_t */
+ int ctxcount; /* number of slots in inode->ctx */
};
-
struct _dentry {
- struct list_head inode_list; /* list of dentries of inode */
- struct list_head hash; /* hash table pointers */
- inode_t *inode; /* inode of this directory entry */
- char *name; /* name of the directory entry */
- inode_t *parent; /* directory of the entry */
+ struct list_head inode_list; /* list of dentries of inode */
+ struct list_head hash; /* hash table pointers */
+ inode_t *inode; /* inode of this directory entry */
+ char *name; /* name of the directory entry */
+ inode_t *parent; /* directory of the entry */
};
struct _inode_ctx {
- union {
- uint64_t key;
- xlator_t *xl_key;
- };
- /* if value1 is 0, then field is not set.. */
- union {
- uint64_t value1;
- void *ptr1;
- };
- /* if value2 is 0, then field is not set.. */
- union {
- uint64_t value2;
- void *ptr2;
- };
- int ref; /* This is for debugging inode ref leaks,
- basically helps in identifying the xlator
- causing th ref leak, it is printed in
- statedump */
+ union {
+ uint64_t key;
+ xlator_t *xl_key;
+ };
+ /* if value1 is 0, then field is not set.. */
+ union {
+ uint64_t value1;
+ void *ptr1;
+ };
+ /* if value2 is 0, then field is not set.. */
+ union {
+ uint64_t value2;
+ void *ptr2;
+ };
+ int ref; /* This is for debugging inode ref leaks,
+ basically helps in identifying the xlator
+ causing th ref leak, it is printed in
+ statedump */
};
struct _inode {
- inode_table_t *table; /* the table this inode belongs to */
- uuid_t gfid;
- gf_lock_t lock;
- uint64_t nlookup;
- uint32_t fd_count; /* Open fd count */
- uint32_t active_fd_count; /* Active open fd count */
- uint32_t ref; /* reference count on this inode */
- ia_type_t ia_type; /* what kind of file */
- struct list_head fd_list; /* list of open files on this inode */
- struct list_head dentry_list; /* list of directory entries for this inode */
- struct list_head hash; /* hash table pointers */
- struct list_head list; /* active/lru/purge */
-
- struct _inode_ctx *_ctx; /* replacement for dict_t *(inode->ctx) */
+ inode_table_t *table; /* the table this inode belongs to */
+ uuid_t gfid;
+ gf_lock_t lock;
+ uint64_t nlookup;
+ uint32_t fd_count; /* Open fd count */
+ uint32_t active_fd_count; /* Active open fd count */
+ uint32_t ref; /* reference count on this inode */
+ ia_type_t ia_type; /* what kind of file */
+ struct list_head fd_list; /* list of open files on this inode */
+ struct list_head dentry_list; /* list of directory entries for this inode */
+ struct list_head hash; /* hash table pointers */
+ struct list_head list; /* active/lru/purge */
+
+ struct _inode_ctx *_ctx; /* replacement for dict_t *(inode->ctx) */
};
-
#define UUID0_STR "00000000-0000-0000-0000-000000000000"
#define GFID_STR_PFX "<gfid:" UUID0_STR ">"
-#define GFID_STR_PFX_LEN (sizeof (GFID_STR_PFX) - 1)
+#define GFID_STR_PFX_LEN (sizeof(GFID_STR_PFX) - 1)
inode_table_t *
-inode_table_new (size_t lru_limit, xlator_t *xl);
+inode_table_new(size_t lru_limit, xlator_t *xl);
void
-inode_table_destroy_all (glusterfs_ctx_t *ctx);
+inode_table_destroy_all(glusterfs_ctx_t *ctx);
void
-inode_table_destroy (inode_table_t *inode_table);
+inode_table_destroy(inode_table_t *inode_table);
inode_t *
-inode_new (inode_table_t *table);
+inode_new(inode_table_t *table);
inode_t *
-inode_link (inode_t *inode, inode_t *parent,
- const char *name, struct iatt *stbuf);
+inode_link(inode_t *inode, inode_t *parent, const char *name,
+ struct iatt *stbuf);
void
-inode_unlink (inode_t *inode, inode_t *parent, const char *name);
+inode_unlink(inode_t *inode, inode_t *parent, const char *name);
inode_t *
-inode_parent (inode_t *inode, uuid_t pargfid, const char *name);
+inode_parent(inode_t *inode, uuid_t pargfid, const char *name);
inode_t *
-inode_ref (inode_t *inode);
+inode_ref(inode_t *inode);
inode_t *
-inode_unref (inode_t *inode);
+inode_unref(inode_t *inode);
int
-inode_lookup (inode_t *inode);
+inode_lookup(inode_t *inode);
int
-inode_forget (inode_t *inode, uint64_t nlookup);
+inode_forget(inode_t *inode, uint64_t nlookup);
int
-inode_ref_reduce_by_n (inode_t *inode, uint64_t nref);
+inode_ref_reduce_by_n(inode_t *inode, uint64_t nref);
int
inode_invalidate(inode_t *inode);
int
-inode_rename (inode_table_t *table, inode_t *olddir, const char *oldname,
- inode_t *newdir, const char *newname,
- inode_t *inode, struct iatt *stbuf);
+inode_rename(inode_table_t *table, inode_t *olddir, const char *oldname,
+ inode_t *newdir, const char *newname, inode_t *inode,
+ struct iatt *stbuf);
dentry_t *
-__dentry_grep (inode_table_t *table, inode_t *parent, const char *name);
+__dentry_grep(inode_table_t *table, inode_t *parent, const char *name);
inode_t *
-inode_grep (inode_table_t *table, inode_t *parent, const char *name);
+inode_grep(inode_table_t *table, inode_t *parent, const char *name);
int
-inode_grep_for_gfid (inode_table_t *table, inode_t *parent, const char *name,
- uuid_t gfid, ia_type_t *type);
+inode_grep_for_gfid(inode_table_t *table, inode_t *parent, const char *name,
+ uuid_t gfid, ia_type_t *type);
inode_t *
-inode_find (inode_table_t *table, uuid_t gfid);
+inode_find(inode_table_t *table, uuid_t gfid);
int
-inode_path (inode_t *inode, const char *name, char **bufp);
+inode_path(inode_t *inode, const char *name, char **bufp);
int
-__inode_path (inode_t *inode, const char *name, char **bufp);
+__inode_path(inode_t *inode, const char *name, char **bufp);
inode_t *
-inode_from_path (inode_table_t *table, const char *path);
+inode_from_path(inode_table_t *table, const char *path);
inode_t *
-inode_resolve (inode_table_t *table, char *path);
+inode_resolve(inode_table_t *table, char *path);
/* deal with inode ctx's both values */
int
-inode_ctx_set2 (inode_t *inode, xlator_t *xlator, uint64_t *value1,
- uint64_t *value2);
+inode_ctx_set2(inode_t *inode, xlator_t *xlator, uint64_t *value1,
+ uint64_t *value2);
int
-__inode_ctx_set2 (inode_t *inode, xlator_t *xlator, uint64_t *value1,
- uint64_t *value2);
+__inode_ctx_set2(inode_t *inode, xlator_t *xlator, uint64_t *value1,
+ uint64_t *value2);
int
-inode_ctx_get2 (inode_t *inode, xlator_t *xlator, uint64_t *value1,
- uint64_t *value2);
+inode_ctx_get2(inode_t *inode, xlator_t *xlator, uint64_t *value1,
+ uint64_t *value2);
int
-__inode_ctx_get2 (inode_t *inode, xlator_t *xlator, uint64_t *value1,
- uint64_t *value2);
+__inode_ctx_get2(inode_t *inode, xlator_t *xlator, uint64_t *value1,
+ uint64_t *value2);
int
-inode_ctx_del2 (inode_t *inode, xlator_t *xlator, uint64_t *value1,
- uint64_t *value2);
+inode_ctx_del2(inode_t *inode, xlator_t *xlator, uint64_t *value1,
+ uint64_t *value2);
int
-inode_ctx_reset2 (inode_t *inode, xlator_t *xlator, uint64_t *value1,
- uint64_t *value2);
+inode_ctx_reset2(inode_t *inode, xlator_t *xlator, uint64_t *value1,
+ uint64_t *value2);
/* deal with inode ctx's 1st value */
int
-inode_ctx_set0 (inode_t *inode, xlator_t *xlator, uint64_t *value1);
+inode_ctx_set0(inode_t *inode, xlator_t *xlator, uint64_t *value1);
int
-__inode_ctx_set0 (inode_t *inode, xlator_t *xlator, uint64_t *value1);
+__inode_ctx_set0(inode_t *inode, xlator_t *xlator, uint64_t *value1);
int
-inode_ctx_get0 (inode_t *inode, xlator_t *xlator, uint64_t *value1);
+inode_ctx_get0(inode_t *inode, xlator_t *xlator, uint64_t *value1);
int
-__inode_ctx_get0 (inode_t *inode, xlator_t *xlator, uint64_t *value1);
+__inode_ctx_get0(inode_t *inode, xlator_t *xlator, uint64_t *value1);
int
-inode_ctx_reset0 (inode_t *inode, xlator_t *xlator, uint64_t *value1);
+inode_ctx_reset0(inode_t *inode, xlator_t *xlator, uint64_t *value1);
/* deal with inode ctx's 2st value */
int
-inode_ctx_set1 (inode_t *inode, xlator_t *xlator, uint64_t *value2);
+inode_ctx_set1(inode_t *inode, xlator_t *xlator, uint64_t *value2);
int
-__inode_ctx_set1 (inode_t *inode, xlator_t *xlator, uint64_t *value2);
+__inode_ctx_set1(inode_t *inode, xlator_t *xlator, uint64_t *value2);
int
-inode_ctx_get1 (inode_t *inode, xlator_t *xlator, uint64_t *value2);
+inode_ctx_get1(inode_t *inode, xlator_t *xlator, uint64_t *value2);
int
-__inode_ctx_get1 (inode_t *inode, xlator_t *xlator, uint64_t *value2);
+__inode_ctx_get1(inode_t *inode, xlator_t *xlator, uint64_t *value2);
int
-inode_ctx_reset1 (inode_t *inode, xlator_t *xlator, uint64_t *value2);
-
+inode_ctx_reset1(inode_t *inode, xlator_t *xlator, uint64_t *value2);
static inline int
__inode_ctx_put(inode_t *inode, xlator_t *this, uint64_t v)
{
- return __inode_ctx_set0 (inode, this, &v);
+ return __inode_ctx_set0(inode, this, &v);
}
static inline int
inode_ctx_put(inode_t *inode, xlator_t *this, uint64_t v)
{
- return inode_ctx_set0 (inode, this, &v);
+ return inode_ctx_set0(inode, this, &v);
}
-#define __inode_ctx_set(i,x,v_p) __inode_ctx_set0(i,x,v_p)
+#define __inode_ctx_set(i, x, v_p) __inode_ctx_set0(i, x, v_p)
-#define inode_ctx_set(i,x,v_p) inode_ctx_set0(i,x,v_p)
+#define inode_ctx_set(i, x, v_p) inode_ctx_set0(i, x, v_p)
-#define inode_ctx_reset(i,x,v) inode_ctx_reset0(i,x,v)
+#define inode_ctx_reset(i, x, v) inode_ctx_reset0(i, x, v)
-#define __inode_ctx_get(i,x,v) __inode_ctx_get0(i,x,v)
+#define __inode_ctx_get(i, x, v) __inode_ctx_get0(i, x, v)
-#define inode_ctx_get(i,x,v) inode_ctx_get0(i,x,v)
+#define inode_ctx_get(i, x, v) inode_ctx_get0(i, x, v)
-#define inode_ctx_del(i,x,v) inode_ctx_del2(i,x,v,0)
+#define inode_ctx_del(i, x, v) inode_ctx_del2(i, x, v, 0)
#define inode_ctx_del1(i, x, v) inode_ctx_del2(i, x, 0, v)
gf_boolean_t
-__is_root_gfid (uuid_t gfid);
+__is_root_gfid(uuid_t gfid);
void
-__inode_table_set_lru_limit (inode_table_t *table, uint32_t lru_limit);
+__inode_table_set_lru_limit(inode_table_t *table, uint32_t lru_limit);
void
-inode_table_set_lru_limit (inode_table_t *table, uint32_t lru_limit);
+inode_table_set_lru_limit(inode_table_t *table, uint32_t lru_limit);
void
-inode_ctx_merge (fd_t *fd, inode_t *inode, inode_t *linked_inode);
+inode_ctx_merge(fd_t *fd, inode_t *inode, inode_t *linked_inode);
int
-inode_is_linked (inode_t *inode);
+inode_is_linked(inode_t *inode);
void
-inode_set_need_lookup (inode_t *inode, xlator_t *this);
+inode_set_need_lookup(inode_t *inode, xlator_t *this);
gf_boolean_t
-inode_needs_lookup (inode_t *inode, xlator_t *this);
+inode_needs_lookup(inode_t *inode, xlator_t *this);
int
-inode_has_dentry (inode_t *inode);
+inode_has_dentry(inode_t *inode);
size_t
-inode_ctx_size (inode_t *inode);
+inode_ctx_size(inode_t *inode);
void
-inode_find_directory_name (inode_t *inode, const char **name);
+inode_find_directory_name(inode_t *inode, const char **name);
#endif /* _INODE_H */
diff --git a/libglusterfs/src/iobuf.h b/libglusterfs/src/iobuf.h
index 21184da1d2e..41ac5dd191c 100644
--- a/libglusterfs/src/iobuf.h
+++ b/libglusterfs/src/iobuf.h
@@ -32,8 +32,8 @@
#define MAP_ANONYMOUS MAP_ANON
#endif
-#define GF_ALIGN_BUF(ptr,bound) ((void *)((unsigned long)(ptr + bound - 1) & \
- (unsigned long)(~(bound - 1))))
+#define GF_ALIGN_BUF(ptr, bound) \
+ ((void *)((unsigned long)(ptr + bound - 1) & (unsigned long)(~(bound - 1))))
#define GF_IOBUF_ALIGN_SIZE 512
@@ -50,133 +50,144 @@ struct iobuf_arena;
struct iobuf_pool;
struct iobuf_init_config {
- size_t pagesize;
- int32_t num_pages;
+ size_t pagesize;
+ int32_t num_pages;
};
struct iobuf {
- union {
- struct list_head list;
- struct {
- struct iobuf *next;
- struct iobuf *prev;
- };
+ union {
+ struct list_head list;
+ struct {
+ struct iobuf *next;
+ struct iobuf *prev;
};
- struct iobuf_arena *iobuf_arena;
+ };
+ struct iobuf_arena *iobuf_arena;
- gf_lock_t lock; /* for ->ptr and ->ref */
- gf_atomic_t ref; /* 0 == passive, >0 == active */
+ gf_lock_t lock; /* for ->ptr and ->ref */
+ gf_atomic_t ref; /* 0 == passive, >0 == active */
- void *ptr; /* usable memory region by the consumer */
+ void *ptr; /* usable memory region by the consumer */
- void *free_ptr; /* in case of stdalloc, this is the
- one to be freed */
+ void *free_ptr; /* in case of stdalloc, this is the
+ one to be freed */
};
-
struct iobuf_arena {
- union {
- struct list_head list;
- struct {
- struct iobuf_arena *next;
- struct iobuf_arena *prev;
- };
+ union {
+ struct list_head list;
+ struct {
+ struct iobuf_arena *next;
+ struct iobuf_arena *prev;
};
-
- struct list_head all_list;
- size_t page_size; /* size of all iobufs in this arena */
- size_t arena_size;
- /* this is equal to rounded_size * num_iobufs.
- (rounded_size comes with gf_iobuf_get_pagesize().) */
- size_t page_count;
-
- struct iobuf_pool *iobuf_pool;
-
- void *mem_base;
- struct iobuf *iobufs; /* allocated iobufs list */
-
- int active_cnt;
- struct iobuf active; /* head node iobuf
- (unused by itself) */
- int passive_cnt;
- struct iobuf passive; /* head node iobuf
- (unused by itself) */
- uint64_t alloc_cnt; /* total allocs in this pool */
- int max_active; /* max active buffers at a given time */
+ };
+
+ struct list_head all_list;
+ size_t page_size; /* size of all iobufs in this arena */
+ size_t arena_size;
+ /* this is equal to rounded_size * num_iobufs.
+ (rounded_size comes with gf_iobuf_get_pagesize().) */
+ size_t page_count;
+
+ struct iobuf_pool *iobuf_pool;
+
+ void *mem_base;
+ struct iobuf *iobufs; /* allocated iobufs list */
+
+ int active_cnt;
+ struct iobuf active; /* head node iobuf
+ (unused by itself) */
+ int passive_cnt;
+ struct iobuf passive; /* head node iobuf
+ (unused by itself) */
+ uint64_t alloc_cnt; /* total allocs in this pool */
+ int max_active; /* max active buffers at a given time */
};
-
struct iobuf_pool {
- pthread_mutex_t mutex;
- size_t arena_size; /* size of memory region in
- arena */
- size_t default_page_size; /* default size of iobuf */
-
- int arena_cnt;
- struct list_head all_arenas;
- struct list_head arenas[GF_VARIABLE_IOBUF_COUNT];
- /* array of arenas. Each element of the array is a list of arenas
- holding iobufs of particular page_size */
-
- struct list_head filled[GF_VARIABLE_IOBUF_COUNT];
- /* array of arenas without free iobufs */
-
- struct list_head purge[GF_VARIABLE_IOBUF_COUNT];
- /* array of of arenas which can be purged */
-
- uint64_t request_misses; /* mostly the requests for higher
- value of iobufs */
- int rdma_device_count;
- struct list_head *mr_list[GF_RDMA_DEVICE_COUNT];
- void *device[GF_RDMA_DEVICE_COUNT];
- int (*rdma_registration)(void **, void*);
- int (*rdma_deregistration)(struct list_head**, struct iobuf_arena *);
-
+ pthread_mutex_t mutex;
+ size_t arena_size; /* size of memory region in
+ arena */
+ size_t default_page_size; /* default size of iobuf */
+
+ int arena_cnt;
+ struct list_head all_arenas;
+ struct list_head arenas[GF_VARIABLE_IOBUF_COUNT];
+ /* array of arenas. Each element of the array is a list of arenas
+ holding iobufs of particular page_size */
+
+ struct list_head filled[GF_VARIABLE_IOBUF_COUNT];
+ /* array of arenas without free iobufs */
+
+ struct list_head purge[GF_VARIABLE_IOBUF_COUNT];
+ /* array of of arenas which can be purged */
+
+ uint64_t request_misses; /* mostly the requests for higher
+ value of iobufs */
+ int rdma_device_count;
+ struct list_head *mr_list[GF_RDMA_DEVICE_COUNT];
+ void *device[GF_RDMA_DEVICE_COUNT];
+ int (*rdma_registration)(void **, void *);
+ int (*rdma_deregistration)(struct list_head **, struct iobuf_arena *);
};
-
-struct iobuf_pool *iobuf_pool_new (void);
-void iobuf_pool_destroy (struct iobuf_pool *iobuf_pool);
-struct iobuf *iobuf_get (struct iobuf_pool *iobuf_pool);
-void iobuf_unref (struct iobuf *iobuf);
-struct iobuf *iobuf_ref (struct iobuf *iobuf);
-void iobuf_pool_destroy (struct iobuf_pool *iobuf_pool);
-void iobuf_to_iovec(struct iobuf *iob, struct iovec *iov);
+struct iobuf_pool *
+iobuf_pool_new(void);
+void
+iobuf_pool_destroy(struct iobuf_pool *iobuf_pool);
+struct iobuf *
+iobuf_get(struct iobuf_pool *iobuf_pool);
+void
+iobuf_unref(struct iobuf *iobuf);
+struct iobuf *
+iobuf_ref(struct iobuf *iobuf);
+void
+iobuf_pool_destroy(struct iobuf_pool *iobuf_pool);
+void
+iobuf_to_iovec(struct iobuf *iob, struct iovec *iov);
#define iobuf_ptr(iob) ((iob)->ptr)
#define iobpool_default_pagesize(iobpool) ((iobpool)->default_page_size)
#define iobuf_pagesize(iob) (iob->iobuf_arena->page_size)
-
struct iobref {
- gf_lock_t lock;
- gf_atomic_t ref;
- struct iobuf **iobrefs;
- int allocated;
- int used;
+ gf_lock_t lock;
+ gf_atomic_t ref;
+ struct iobuf **iobrefs;
+ int allocated;
+ int used;
};
-struct iobref *iobref_new (void);
-struct iobref *iobref_ref (struct iobref *iobref);
-void iobref_unref (struct iobref *iobref);
-int iobref_add (struct iobref *iobref, struct iobuf *iobuf);
-int iobref_merge (struct iobref *to, struct iobref *from);
-void iobref_clear (struct iobref *iobref);
+struct iobref *
+iobref_new(void);
+struct iobref *
+iobref_ref(struct iobref *iobref);
+void
+iobref_unref(struct iobref *iobref);
+int
+iobref_add(struct iobref *iobref, struct iobuf *iobuf);
+int
+iobref_merge(struct iobref *to, struct iobref *from);
+void
+iobref_clear(struct iobref *iobref);
-size_t iobuf_size (struct iobuf *iobuf);
-size_t iobref_size (struct iobref *iobref);
-void iobuf_stats_dump (struct iobuf_pool *iobuf_pool);
+size_t
+iobuf_size(struct iobuf *iobuf);
+size_t
+iobref_size(struct iobref *iobref);
+void
+iobuf_stats_dump(struct iobuf_pool *iobuf_pool);
struct iobuf *
-iobuf_get2 (struct iobuf_pool *iobuf_pool, size_t page_size);
+iobuf_get2(struct iobuf_pool *iobuf_pool, size_t page_size);
struct iobuf *
-iobuf_get_page_aligned (struct iobuf_pool *iobuf_pool, size_t page_size,
- size_t align_size);
+iobuf_get_page_aligned(struct iobuf_pool *iobuf_pool, size_t page_size,
+ size_t align_size);
int
-iobuf_copy (struct iobuf_pool *iobuf_pool, const struct iovec *iovec_src,
- int iovcnt, struct iobref **iobref, struct iobuf **iobuf,
- struct iovec *iov_dst);
+iobuf_copy(struct iobuf_pool *iobuf_pool, const struct iovec *iovec_src,
+ int iovcnt, struct iobref **iobref, struct iobuf **iobuf,
+ struct iovec *iov_dst);
#endif /* !_IOBUF_H_ */
diff --git a/libglusterfs/src/latency.h b/libglusterfs/src/latency.h
index 73a93242341..063ea291ee2 100644
--- a/libglusterfs/src/latency.h
+++ b/libglusterfs/src/latency.h
@@ -14,10 +14,10 @@
#include "glusterfs.h"
typedef struct fop_latency {
- double min; /* min time for the call (microseconds) */
- double max; /* max time for the call (microseconds) */
- double total; /* total time (microseconds) */
- uint64_t count;
+ double min; /* min time for the call (microseconds) */
+ double max; /* max time for the call (microseconds) */
+ double total; /* total time (microseconds) */
+ uint64_t count;
} fop_latency_t;
#endif /* __LATENCY_H__ */
diff --git a/libglusterfs/src/libglusterfs-messages.h b/libglusterfs/src/libglusterfs-messages.h
index 66e92f2b8f1..d40d644fad9 100644
--- a/libglusterfs/src/libglusterfs-messages.h
+++ b/libglusterfs/src/libglusterfs-messages.h
@@ -23,221 +23,92 @@
* glfs-message-id.h.
*/
-GLFS_MSGID(LIBGLUSTERFS,
- LG_MSG_ASPRINTF_FAILED,
- LG_MSG_INVALID_ENTRY,
- LG_MSG_COUNT_LESS_THAN_ZERO,
- LG_MSG_COUNT_LESS_THAN_DATA_PAIRS,
- LG_MSG_VALUE_LENGTH_LESS_THAN_ZERO,
- LG_MSG_PAIRS_LESS_THAN_COUNT,
- LG_MSG_KEY_OR_VALUE_NULL,
- LG_MSG_FAILED_TO_LOG_DICT,
- LG_MSG_NULL_VALUE_IN_DICT,
- LG_MSG_DIR_OP_FAILED,
- LG_MSG_STORE_HANDLE_CREATE_FAILED,
- LG_MSG_FILE_OP_FAILED,
- LG_MSG_FILE_STAT_FAILED,
- LG_MSG_LOCK_FAILED,
- LG_MSG_UNLOCK_FAILED,
- LG_MSG_DICT_SERIAL_FAILED,
- LG_MSG_DICT_UNSERIAL_FAILED,
- LG_MSG_NO_MEMORY,
- LG_MSG_VOLUME_ERROR,
- LG_MSG_SUB_VOLUME_ERROR,
- LG_MSG_SYNTAX_ERROR,
- LG_MSG_BACKTICK_PARSE_FAILED,
- LG_MSG_BUFFER_ERROR,
- LG_MSG_STRDUP_ERROR,
- LG_MSG_HASH_FUNC_ERROR,
- LG_MSG_GET_BUCKET_FAILED,
- LG_MSG_INSERT_FAILED,
- LG_MSG_OUT_OF_RANGE,
- LG_MSG_VALIDATE_RETURNS,
- LG_MSG_VALIDATE_REC_FAILED,
- LG_MSG_RB_TABLE_CREATE_FAILED,
- LG_MSG_PATH_NOT_FOUND,
- LG_MSG_EXPAND_FD_TABLE_FAILED,
- LG_MSG_MAPPING_FAILED,
- LG_MSG_INIT_IOBUF_FAILED,
- LG_MSG_PAGE_SIZE_EXCEEDED,
- LG_MSG_ARENA_NOT_FOUND,
- LG_MSG_IOBUF_NOT_FOUND,
- LG_MSG_POOL_NOT_FOUND,
- LG_MSG_SET_ATTRIBUTE_FAILED,
- LG_MSG_READ_ATTRIBUTE_FAILED,
- LG_MSG_UNMOUNT_FAILED,
- LG_MSG_LATENCY_MEASUREMENT_STATE,
- LG_MSG_NO_PERM,
- LG_MSG_NO_KEY,
- LG_MSG_DICT_NULL,
- LG_MSG_INIT_TIMER_FAILED,
- LG_MSG_FD_ANONYMOUS_FAILED,
- LG_MSG_FD_CREATE_FAILED,
- LG_MSG_BUFFER_FULL,
- LG_MSG_FWRITE_FAILED,
- LG_MSG_PRINT_FAILED,
- LG_MSG_MEM_POOL_DESTROY,
- LG_MSG_EXPAND_CLIENT_TABLE_FAILED,
- LG_MSG_DISCONNECT_CLIENT,
- LG_MSG_PIPE_CREATE_FAILED,
- LG_MSG_SET_PIPE_FAILED,
- LG_MSG_REGISTER_PIPE_FAILED,
- LG_MSG_POLL_IGNORE_MULTIPLE_THREADS,
- LG_MSG_INDEX_NOT_FOUND,
- LG_MSG_EPOLL_FD_CREATE_FAILED,
- LG_MSG_SLOT_NOT_FOUND,
- LG_MSG_STALE_FD_FOUND,
- LG_MSG_GENERATION_MISMATCH,
- LG_MSG_PTHREAD_KEY_CREATE_FAILED,
- LG_MSG_TRANSLATOR_INIT_FAILED,
- LG_MSG_UUID_BUF_INIT_FAILED,
- LG_MSG_LKOWNER_BUF_INIT_FAILED,
- LG_MSG_SYNCTASK_INIT_FAILED,
- LG_MSG_SYNCOPCTX_INIT_FAILED,
- LG_MSG_GLOBAL_INIT_FAILED,
- LG_MSG_PTHREAD_FAILED,
- LG_MSG_DIR_IS_SYMLINK,
- LG_MSG_RESOLVE_HOSTNAME_FAILED,
- LG_MSG_GETADDRINFO_FAILED,
- LG_MSG_GETNAMEINFO_FAILED,
- LG_MSG_PATH_ERROR,
- LG_MSG_INET_PTON_FAILED,
- LG_MSG_NEGATIVE_NUM_PASSED,
- LG_MSG_GETHOSTNAME_FAILED,
- LG_MSG_RESERVED_PORTS_ERROR,
- LG_MSG_INVALID_PORT,
- LG_MSG_INVALID_FAMILY,
- LG_MSG_CONVERSION_FAILED,
- LG_MSG_SKIP_HEADER_FAILED,
- LG_MSG_INVALID_LOG,
- LG_MSG_UTIMES_FAILED,
- LG_MSG_BACKTRACE_SAVE_FAILED,
- LG_MSG_INIT_FAILED,
- LG_MSG_VALIDATION_FAILED,
- LG_MSG_GRAPH_ERROR,
- LG_MSG_UNKNOWN_OPTIONS_FAILED,
- LG_MSG_CTX_NULL,
- LG_MSG_TMPFILE_CREATE_FAILED,
- LG_MSG_DLOPEN_FAILED,
- LG_MSG_LOAD_FAILED,
- LG_MSG_DLSYM_ERROR,
- LG_MSG_TREE_NOT_FOUND,
- LG_MSG_PER_DENTRY,
- LG_MSG_DENTRY,
- LG_MSG_GETIFADDRS_FAILED,
- LG_MSG_REGEX_OP_FAILED,
- LG_MSG_FRAME_ERROR,
- LG_MSG_SET_PARAM_FAILED,
- LG_MSG_GET_PARAM_FAILED,
- LG_MSG_PREPARE_FAILED,
- LG_MSG_EXEC_FAILED,
- LG_MSG_BINDING_FAILED,
- LG_MSG_DELETE_FAILED,
- LG_MSG_GET_ID_FAILED,
- LG_MSG_CREATE_FAILED,
- LG_MSG_PARSE_FAILED,
- LG_MSG_GETCONTEXT_FAILED,
- LG_MSG_UPDATE_FAILED,
- LG_MSG_QUERY_CALL_BACK_FAILED,
- LG_MSG_GET_RECORD_FAILED,
- LG_MSG_DB_ERROR,
- LG_MSG_CONNECTION_ERROR,
- LG_MSG_NOT_MULTITHREAD_MODE,
- LG_MSG_SKIP_PATH,
- LG_MSG_INVALID_FOP,
- LG_MSG_QUERY_FAILED,
- LG_MSG_CLEAR_COUNTER_FAILED,
- LG_MSG_LOCK_LIST_FAILED,
- LG_MSG_UNLOCK_LIST_FAILED,
- LG_MSG_ADD_TO_LIST_FAILED,
- LG_MSG_INIT_DB_FAILED,
- LG_MSG_DELETE_FROM_LIST_FAILED,
- LG_MSG_CLOSE_CONNECTION_FAILED,
- LG_MSG_INSERT_OR_UPDATE_FAILED,
- LG_MSG_FIND_OP_FAILED,
- LG_MSG_CONNECTION_INIT_FAILED,
- LG_MSG_COMPLETED_TASK,
- LG_MSG_WAKE_UP_ZOMBIE,
- LG_MSG_REWAITING_TASK,
- LG_MSG_SLEEP_ZOMBIE,
- LG_MSG_SWAPCONTEXT_FAILED,
- LG_MSG_UNSUPPORTED_PLUGIN,
- LG_MSG_INVALID_DB_TYPE,
- LG_MSG_UNDERSIZED_BUF,
- LG_MSG_DATA_CONVERSION_ERROR,
- LG_MSG_DICT_ERROR,
- LG_MSG_IOBUFS_NOT_FOUND,
- LG_MSG_ENTRIES_NULL,
- LG_MSG_FD_NOT_FOUND_IN_FDTABLE,
- LG_MSG_REALLOC_FOR_FD_PTR_FAILED,
- LG_MSG_DICT_SET_FAILED,
- LG_MSG_NULL_PTR,
- LG_MSG_RBTHASH_INIT_BUCKET_FAILED,
- LG_MSG_ASSERTION_FAILED,
- LG_MSG_HOSTNAME_NULL,
- LG_MSG_INVALID_IPV4_FORMAT,
- LG_MSG_CTX_CLEANUP_STARTED,
- LG_MSG_TIMER_REGISTER_ERROR,
- LG_MSG_PTR_HEADER_CORRUPTED,
- LG_MSG_INVALID_UPLINK,
- LG_MSG_CLIENT_NULL,
- LG_MSG_XLATOR_DOES_NOT_IMPLEMENT,
- LG_MSG_DENTRY_NOT_FOUND,
- LG_MSG_INODE_NOT_FOUND,
- LG_MSG_INODE_TABLE_NOT_FOUND,
- LG_MSG_DENTRY_CREATE_FAILED,
- LG_MSG_INODE_CONTEXT_FREED,
- LG_MSG_UNKNOWN_LOCK_TYPE,
- LG_MSG_UNLOCK_BEFORE_LOCK,
- LG_MSG_LOCK_OWNER_ERROR,
- LG_MSG_MEMPOOL_PTR_NULL,
- LG_MSG_QUOTA_XATTRS_MISSING,
- LG_MSG_INVALID_STRING,
- LG_MSG_BIND_REF,
- LG_MSG_REF_COUNT,
- LG_MSG_INVALID_ARG,
- LG_MSG_VOL_OPTION_ADD,
- LG_MSG_XLATOR_OPTION_INVALID,
- LG_MSG_GETTIMEOFDAY_FAILED,
- LG_MSG_GRAPH_INIT_FAILED,
- LG_MSG_EVENT_NOTIFY_FAILED,
- LG_MSG_ACTIVE_GRAPH_NULL,
- LG_MSG_VOLFILE_PARSE_ERROR,
- LG_MSG_FD_INODE_NULL,
- LG_MSG_INVALID_VOLFILE_ENTRY,
- LG_MSG_PER_DENTRY_FAILED,
- LG_MSG_PARENT_DENTRY_NOT_FOUND,
- LG_MSG_DENTRY_CYCLIC_LOOP,
- LG_MSG_INVALID_POLL_IN,
- LG_MSG_INVALID_POLL_OUT,
- LG_MSG_EPOLL_FD_ADD_FAILED,
- LG_MSG_EPOLL_FD_DEL_FAILED,
- LG_MSG_EPOLL_FD_MODIFY_FAILED,
- LG_MSG_STARTED_EPOLL_THREAD,
- LG_MSG_EXITED_EPOLL_THREAD,
- LG_MSG_START_EPOLL_THREAD_FAILED,
- LG_MSG_FALLBACK_TO_POLL,
- LG_MSG_QUOTA_CONF_ERROR,
- LG_MSG_RBTHASH_GET_ENTRY_FAILED,
- LG_MSG_RBTHASH_GET_BUCKET_FAILED,
- LG_MSG_RBTHASH_INSERT_FAILED,
- LG_MSG_RBTHASH_INIT_ENTRY_FAILED,
- LG_MSG_TMPFILE_DELETE_FAILED,
- LG_MSG_MEMPOOL_INVALID_FREE,
- LG_MSG_LOCK_FAILURE,
- LG_MSG_SET_LOG_LEVEL,
- LG_MSG_VERIFY_PLATFORM,
- LG_MSG_RUNNER_LOG,
- LG_MSG_LEASEID_BUF_INIT_FAILED,
- LG_MSG_PTHREAD_ATTR_INIT_FAILED,
- LG_MSG_INVALID_INODE_LIST,
- LG_MSG_COMPACT_FAILED,
- LG_MSG_COMPACT_STATUS,
- LG_MSG_UTIMENSAT_FAILED,
- LG_MSG_PTHREAD_NAMING_FAILED,
- LG_MSG_SYSCALL_RETURNS_WRONG,
- LG_MSG_XXH64_TO_GFID_FAILED
-);
+GLFS_MSGID(
+ LIBGLUSTERFS, LG_MSG_ASPRINTF_FAILED, LG_MSG_INVALID_ENTRY,
+ LG_MSG_COUNT_LESS_THAN_ZERO, LG_MSG_COUNT_LESS_THAN_DATA_PAIRS,
+ LG_MSG_VALUE_LENGTH_LESS_THAN_ZERO, LG_MSG_PAIRS_LESS_THAN_COUNT,
+ LG_MSG_KEY_OR_VALUE_NULL, LG_MSG_FAILED_TO_LOG_DICT,
+ LG_MSG_NULL_VALUE_IN_DICT, LG_MSG_DIR_OP_FAILED,
+ LG_MSG_STORE_HANDLE_CREATE_FAILED, LG_MSG_FILE_OP_FAILED,
+ LG_MSG_FILE_STAT_FAILED, LG_MSG_LOCK_FAILED, LG_MSG_UNLOCK_FAILED,
+ LG_MSG_DICT_SERIAL_FAILED, LG_MSG_DICT_UNSERIAL_FAILED, LG_MSG_NO_MEMORY,
+ LG_MSG_VOLUME_ERROR, LG_MSG_SUB_VOLUME_ERROR, LG_MSG_SYNTAX_ERROR,
+ LG_MSG_BACKTICK_PARSE_FAILED, LG_MSG_BUFFER_ERROR, LG_MSG_STRDUP_ERROR,
+ LG_MSG_HASH_FUNC_ERROR, LG_MSG_GET_BUCKET_FAILED, LG_MSG_INSERT_FAILED,
+ LG_MSG_OUT_OF_RANGE, LG_MSG_VALIDATE_RETURNS, LG_MSG_VALIDATE_REC_FAILED,
+ LG_MSG_RB_TABLE_CREATE_FAILED, LG_MSG_PATH_NOT_FOUND,
+ LG_MSG_EXPAND_FD_TABLE_FAILED, LG_MSG_MAPPING_FAILED,
+ LG_MSG_INIT_IOBUF_FAILED, LG_MSG_PAGE_SIZE_EXCEEDED, LG_MSG_ARENA_NOT_FOUND,
+ LG_MSG_IOBUF_NOT_FOUND, LG_MSG_POOL_NOT_FOUND, LG_MSG_SET_ATTRIBUTE_FAILED,
+ LG_MSG_READ_ATTRIBUTE_FAILED, LG_MSG_UNMOUNT_FAILED,
+ LG_MSG_LATENCY_MEASUREMENT_STATE, LG_MSG_NO_PERM, LG_MSG_NO_KEY,
+ LG_MSG_DICT_NULL, LG_MSG_INIT_TIMER_FAILED, LG_MSG_FD_ANONYMOUS_FAILED,
+ LG_MSG_FD_CREATE_FAILED, LG_MSG_BUFFER_FULL, LG_MSG_FWRITE_FAILED,
+ LG_MSG_PRINT_FAILED, LG_MSG_MEM_POOL_DESTROY,
+ LG_MSG_EXPAND_CLIENT_TABLE_FAILED, LG_MSG_DISCONNECT_CLIENT,
+ LG_MSG_PIPE_CREATE_FAILED, LG_MSG_SET_PIPE_FAILED,
+ LG_MSG_REGISTER_PIPE_FAILED, LG_MSG_POLL_IGNORE_MULTIPLE_THREADS,
+ LG_MSG_INDEX_NOT_FOUND, LG_MSG_EPOLL_FD_CREATE_FAILED,
+ LG_MSG_SLOT_NOT_FOUND, LG_MSG_STALE_FD_FOUND, LG_MSG_GENERATION_MISMATCH,
+ LG_MSG_PTHREAD_KEY_CREATE_FAILED, LG_MSG_TRANSLATOR_INIT_FAILED,
+ LG_MSG_UUID_BUF_INIT_FAILED, LG_MSG_LKOWNER_BUF_INIT_FAILED,
+ LG_MSG_SYNCTASK_INIT_FAILED, LG_MSG_SYNCOPCTX_INIT_FAILED,
+ LG_MSG_GLOBAL_INIT_FAILED, LG_MSG_PTHREAD_FAILED, LG_MSG_DIR_IS_SYMLINK,
+ LG_MSG_RESOLVE_HOSTNAME_FAILED, LG_MSG_GETADDRINFO_FAILED,
+ LG_MSG_GETNAMEINFO_FAILED, LG_MSG_PATH_ERROR, LG_MSG_INET_PTON_FAILED,
+ LG_MSG_NEGATIVE_NUM_PASSED, LG_MSG_GETHOSTNAME_FAILED,
+ LG_MSG_RESERVED_PORTS_ERROR, LG_MSG_INVALID_PORT, LG_MSG_INVALID_FAMILY,
+ LG_MSG_CONVERSION_FAILED, LG_MSG_SKIP_HEADER_FAILED, LG_MSG_INVALID_LOG,
+ LG_MSG_UTIMES_FAILED, LG_MSG_BACKTRACE_SAVE_FAILED, LG_MSG_INIT_FAILED,
+ LG_MSG_VALIDATION_FAILED, LG_MSG_GRAPH_ERROR, LG_MSG_UNKNOWN_OPTIONS_FAILED,
+ LG_MSG_CTX_NULL, LG_MSG_TMPFILE_CREATE_FAILED, LG_MSG_DLOPEN_FAILED,
+ LG_MSG_LOAD_FAILED, LG_MSG_DLSYM_ERROR, LG_MSG_TREE_NOT_FOUND,
+ LG_MSG_PER_DENTRY, LG_MSG_DENTRY, LG_MSG_GETIFADDRS_FAILED,
+ LG_MSG_REGEX_OP_FAILED, LG_MSG_FRAME_ERROR, LG_MSG_SET_PARAM_FAILED,
+ LG_MSG_GET_PARAM_FAILED, LG_MSG_PREPARE_FAILED, LG_MSG_EXEC_FAILED,
+ LG_MSG_BINDING_FAILED, LG_MSG_DELETE_FAILED, LG_MSG_GET_ID_FAILED,
+ LG_MSG_CREATE_FAILED, LG_MSG_PARSE_FAILED, LG_MSG_GETCONTEXT_FAILED,
+ LG_MSG_UPDATE_FAILED, LG_MSG_QUERY_CALL_BACK_FAILED,
+ LG_MSG_GET_RECORD_FAILED, LG_MSG_DB_ERROR, LG_MSG_CONNECTION_ERROR,
+ LG_MSG_NOT_MULTITHREAD_MODE, LG_MSG_SKIP_PATH, LG_MSG_INVALID_FOP,
+ LG_MSG_QUERY_FAILED, LG_MSG_CLEAR_COUNTER_FAILED, LG_MSG_LOCK_LIST_FAILED,
+ LG_MSG_UNLOCK_LIST_FAILED, LG_MSG_ADD_TO_LIST_FAILED, LG_MSG_INIT_DB_FAILED,
+ LG_MSG_DELETE_FROM_LIST_FAILED, LG_MSG_CLOSE_CONNECTION_FAILED,
+ LG_MSG_INSERT_OR_UPDATE_FAILED, LG_MSG_FIND_OP_FAILED,
+ LG_MSG_CONNECTION_INIT_FAILED, LG_MSG_COMPLETED_TASK, LG_MSG_WAKE_UP_ZOMBIE,
+ LG_MSG_REWAITING_TASK, LG_MSG_SLEEP_ZOMBIE, LG_MSG_SWAPCONTEXT_FAILED,
+ LG_MSG_UNSUPPORTED_PLUGIN, LG_MSG_INVALID_DB_TYPE, LG_MSG_UNDERSIZED_BUF,
+ LG_MSG_DATA_CONVERSION_ERROR, LG_MSG_DICT_ERROR, LG_MSG_IOBUFS_NOT_FOUND,
+ LG_MSG_ENTRIES_NULL, LG_MSG_FD_NOT_FOUND_IN_FDTABLE,
+ LG_MSG_REALLOC_FOR_FD_PTR_FAILED, LG_MSG_DICT_SET_FAILED, LG_MSG_NULL_PTR,
+ LG_MSG_RBTHASH_INIT_BUCKET_FAILED, LG_MSG_ASSERTION_FAILED,
+ LG_MSG_HOSTNAME_NULL, LG_MSG_INVALID_IPV4_FORMAT,
+ LG_MSG_CTX_CLEANUP_STARTED, LG_MSG_TIMER_REGISTER_ERROR,
+ LG_MSG_PTR_HEADER_CORRUPTED, LG_MSG_INVALID_UPLINK, LG_MSG_CLIENT_NULL,
+ LG_MSG_XLATOR_DOES_NOT_IMPLEMENT, LG_MSG_DENTRY_NOT_FOUND,
+ LG_MSG_INODE_NOT_FOUND, LG_MSG_INODE_TABLE_NOT_FOUND,
+ LG_MSG_DENTRY_CREATE_FAILED, LG_MSG_INODE_CONTEXT_FREED,
+ LG_MSG_UNKNOWN_LOCK_TYPE, LG_MSG_UNLOCK_BEFORE_LOCK,
+ LG_MSG_LOCK_OWNER_ERROR, LG_MSG_MEMPOOL_PTR_NULL,
+ LG_MSG_QUOTA_XATTRS_MISSING, LG_MSG_INVALID_STRING, LG_MSG_BIND_REF,
+ LG_MSG_REF_COUNT, LG_MSG_INVALID_ARG, LG_MSG_VOL_OPTION_ADD,
+ LG_MSG_XLATOR_OPTION_INVALID, LG_MSG_GETTIMEOFDAY_FAILED,
+ LG_MSG_GRAPH_INIT_FAILED, LG_MSG_EVENT_NOTIFY_FAILED,
+ LG_MSG_ACTIVE_GRAPH_NULL, LG_MSG_VOLFILE_PARSE_ERROR, LG_MSG_FD_INODE_NULL,
+ LG_MSG_INVALID_VOLFILE_ENTRY, LG_MSG_PER_DENTRY_FAILED,
+ LG_MSG_PARENT_DENTRY_NOT_FOUND, LG_MSG_DENTRY_CYCLIC_LOOP,
+ LG_MSG_INVALID_POLL_IN, LG_MSG_INVALID_POLL_OUT, LG_MSG_EPOLL_FD_ADD_FAILED,
+ LG_MSG_EPOLL_FD_DEL_FAILED, LG_MSG_EPOLL_FD_MODIFY_FAILED,
+ LG_MSG_STARTED_EPOLL_THREAD, LG_MSG_EXITED_EPOLL_THREAD,
+ LG_MSG_START_EPOLL_THREAD_FAILED, LG_MSG_FALLBACK_TO_POLL,
+ LG_MSG_QUOTA_CONF_ERROR, LG_MSG_RBTHASH_GET_ENTRY_FAILED,
+ LG_MSG_RBTHASH_GET_BUCKET_FAILED, LG_MSG_RBTHASH_INSERT_FAILED,
+ LG_MSG_RBTHASH_INIT_ENTRY_FAILED, LG_MSG_TMPFILE_DELETE_FAILED,
+ LG_MSG_MEMPOOL_INVALID_FREE, LG_MSG_LOCK_FAILURE, LG_MSG_SET_LOG_LEVEL,
+ LG_MSG_VERIFY_PLATFORM, LG_MSG_RUNNER_LOG, LG_MSG_LEASEID_BUF_INIT_FAILED,
+ LG_MSG_PTHREAD_ATTR_INIT_FAILED, LG_MSG_INVALID_INODE_LIST,
+ LG_MSG_COMPACT_FAILED, LG_MSG_COMPACT_STATUS, LG_MSG_UTIMENSAT_FAILED,
+ LG_MSG_PTHREAD_NAMING_FAILED, LG_MSG_SYSCALL_RETURNS_WRONG,
+ LG_MSG_XXH64_TO_GFID_FAILED);
#endif /* !_LG_MESSAGES_H_ */
-
diff --git a/libglusterfs/src/list.h b/libglusterfs/src/list.h
index b8f9a6eebd8..221a710ca30 100644
--- a/libglusterfs/src/list.h
+++ b/libglusterfs/src/list.h
@@ -11,40 +11,36 @@
#ifndef _LLIST_H
#define _LLIST_H
-
struct list_head {
- struct list_head *next;
- struct list_head *prev;
+ struct list_head *next;
+ struct list_head *prev;
};
-
-#define INIT_LIST_HEAD(head) do { \
- (head)->next = (head)->prev = head; \
- } while (0)
-
+#define INIT_LIST_HEAD(head) \
+ do { \
+ (head)->next = (head)->prev = head; \
+ } while (0)
static inline void
-list_add (struct list_head *new, struct list_head *head)
+list_add(struct list_head *new, struct list_head *head)
{
- new->prev = head;
- new->next = head->next;
+ new->prev = head;
+ new->next = head->next;
- new->prev->next = new;
- new->next->prev = new;
+ new->prev->next = new;
+ new->next->prev = new;
}
-
static inline void
-list_add_tail (struct list_head *new, struct list_head *head)
+list_add_tail(struct list_head *new, struct list_head *head)
{
- new->next = head;
- new->prev = head->prev;
+ new->next = head;
+ new->prev = head->prev;
- new->prev->next = new;
- new->next->prev = new;
+ new->prev->next = new;
+ new->next->prev = new;
}
-
/* This function will insert the element to the list in a order.
Order will be based on the compare function provided as a input.
If element to be inserted in ascending order compare should return:
@@ -52,143 +48,133 @@ list_add_tail (struct list_head *new, struct list_head *head)
>0: if first argument is greater than second argument
<0: if first argument is less than second argument */
static inline void
-list_add_order (struct list_head *new, struct list_head *head,
- int (*compare)(struct list_head *, struct list_head *))
+list_add_order(struct list_head *new, struct list_head *head,
+ int (*compare)(struct list_head *, struct list_head *))
{
- struct list_head *pos = head->prev;
+ struct list_head *pos = head->prev;
- while ( pos != head ) {
- if (compare(new, pos) >= 0)
- break;
+ while (pos != head) {
+ if (compare(new, pos) >= 0)
+ break;
- /* Iterate the list in the reverse order. This will have
- better efficiency if the elements are inserted in the
- ascending order */
- pos = pos->prev;
- }
+ /* Iterate the list in the reverse order. This will have
+ better efficiency if the elements are inserted in the
+ ascending order */
+ pos = pos->prev;
+ }
- list_add (new, pos);
+ list_add(new, pos);
}
static inline void
-list_del (struct list_head *old)
+list_del(struct list_head *old)
{
- old->prev->next = old->next;
- old->next->prev = old->prev;
+ old->prev->next = old->next;
+ old->next->prev = old->prev;
- old->next = (void *)0xbabebabe;
- old->prev = (void *)0xcafecafe;
+ old->next = (void *)0xbabebabe;
+ old->prev = (void *)0xcafecafe;
}
-
static inline void
-list_del_init (struct list_head *old)
+list_del_init(struct list_head *old)
{
- old->prev->next = old->next;
- old->next->prev = old->prev;
+ old->prev->next = old->next;
+ old->next->prev = old->prev;
- old->next = old;
- old->prev = old;
+ old->next = old;
+ old->prev = old;
}
-
static inline void
-list_move (struct list_head *list, struct list_head *head)
+list_move(struct list_head *list, struct list_head *head)
{
- list_del (list);
- list_add (list, head);
+ list_del(list);
+ list_add(list, head);
}
-
static inline void
-list_move_tail (struct list_head *list, struct list_head *head)
+list_move_tail(struct list_head *list, struct list_head *head)
{
- list_del (list);
- list_add_tail (list, head);
+ list_del(list);
+ list_add_tail(list, head);
}
-
static inline int
-list_empty (struct list_head *head)
+list_empty(struct list_head *head)
{
- return (head->next == head);
+ return (head->next == head);
}
-
static inline void
-__list_splice (struct list_head *list, struct list_head *head)
+__list_splice(struct list_head *list, struct list_head *head)
{
- (list->prev)->next = (head->next);
- (head->next)->prev = (list->prev);
+ (list->prev)->next = (head->next);
+ (head->next)->prev = (list->prev);
- (head)->next = (list->next);
- (list->next)->prev = (head);
+ (head)->next = (list->next);
+ (list->next)->prev = (head);
}
-
static inline void
-list_splice (struct list_head *list, struct list_head *head)
+list_splice(struct list_head *list, struct list_head *head)
{
- if (list_empty (list))
- return;
+ if (list_empty(list))
+ return;
- __list_splice (list, head);
+ __list_splice(list, head);
}
-
/* Splice moves @list to the head of the list at @head. */
static inline void
-list_splice_init (struct list_head *list, struct list_head *head)
+list_splice_init(struct list_head *list, struct list_head *head)
{
- if (list_empty (list))
- return;
+ if (list_empty(list))
+ return;
- __list_splice (list, head);
- INIT_LIST_HEAD (list);
+ __list_splice(list, head);
+ INIT_LIST_HEAD(list);
}
-
static inline void
-__list_append (struct list_head *list, struct list_head *head)
+__list_append(struct list_head *list, struct list_head *head)
{
- (head->prev)->next = (list->next);
- (list->next)->prev = (head->prev);
- (head->prev) = (list->prev);
- (list->prev)->next = head;
+ (head->prev)->next = (list->next);
+ (list->next)->prev = (head->prev);
+ (head->prev) = (list->prev);
+ (list->prev)->next = head;
}
-
static inline void
-list_append (struct list_head *list, struct list_head *head)
+list_append(struct list_head *list, struct list_head *head)
{
- if (list_empty (list))
- return;
+ if (list_empty(list))
+ return;
- __list_append (list, head);
+ __list_append(list, head);
}
-
/* Append moves @list to the end of @head */
static inline void
-list_append_init (struct list_head *list, struct list_head *head)
+list_append_init(struct list_head *list, struct list_head *head)
{
- if (list_empty (list))
- return;
+ if (list_empty(list))
+ return;
- __list_append (list, head);
- INIT_LIST_HEAD (list);
+ __list_append(list, head);
+ INIT_LIST_HEAD(list);
}
static inline int
-list_is_last (struct list_head *list, struct list_head *head)
+list_is_last(struct list_head *list, struct list_head *head)
{
- return (list->next == head);
+ return (list->next == head);
}
static inline int
list_is_singular(struct list_head *head)
{
- return !list_empty(head) && (head->next == head->prev);
+ return !list_empty(head) && (head->next == head->prev);
}
/**
@@ -198,77 +184,75 @@ list_is_singular(struct list_head *head)
*
* If @old was empty, it will be overwritten.
*/
-static inline void list_replace(struct list_head *old,
- struct list_head *new)
+static inline void
+list_replace(struct list_head *old, struct list_head *new)
{
- new->next = old->next;
- new->next->prev = new;
- new->prev = old->prev;
- new->prev->next = new;
+ new->next = old->next;
+ new->next->prev = new;
+ new->prev = old->prev;
+ new->prev->next = new;
}
-static inline void list_replace_init(struct list_head *old,
- struct list_head *new)
+static inline void
+list_replace_init(struct list_head *old, struct list_head *new)
{
- list_replace(old, new);
- INIT_LIST_HEAD(old);
+ list_replace(old, new);
+ INIT_LIST_HEAD(old);
}
/**
* list_rotate_left - rotate the list to the left
* @head: the head of the list
*/
-static inline void list_rotate_left (struct list_head *head)
+static inline void
+list_rotate_left(struct list_head *head)
{
- struct list_head *first;
+ struct list_head *first;
- if (!list_empty (head)) {
- first = head->next;
- list_move_tail (first, head);
- }
+ if (!list_empty(head)) {
+ first = head->next;
+ list_move_tail(first, head);
+ }
}
-#define list_entry(ptr, type, member) \
- ((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member)))
-
-#define list_first_entry(ptr, type, member) \
- list_entry((ptr)->next, type, member)
-
-#define list_last_entry(ptr, type, member) \
- list_entry((ptr)->prev, type, member)
+#define list_entry(ptr, type, member) \
+ ((type *)((char *)(ptr) - (unsigned long)(&((type *)0)->member)))
-#define list_next_entry(pos, member) \
- list_entry((pos)->member.next, typeof(*(pos)), member)
+#define list_first_entry(ptr, type, member) \
+ list_entry((ptr)->next, type, member)
-#define list_prev_entry(pos, member) \
- list_entry((pos)->member.prev, typeof(*(pos)), member)
+#define list_last_entry(ptr, type, member) list_entry((ptr)->prev, type, member)
-#define list_for_each(pos, head) \
- for (pos = (head)->next; pos != (head); pos = pos->next)
+#define list_next_entry(pos, member) \
+ list_entry((pos)->member.next, typeof(*(pos)), member)
-#define list_for_each_entry(pos, head, member) \
- for (pos = list_entry((head)->next, typeof(*pos), member); \
- &pos->member != (head); \
- pos = list_entry(pos->member.next, typeof(*pos), member))
+#define list_prev_entry(pos, member) \
+ list_entry((pos)->member.prev, typeof(*(pos)), member)
+#define list_for_each(pos, head) \
+ for (pos = (head)->next; pos != (head); pos = pos->next)
-#define list_for_each_entry_safe(pos, n, head, member) \
- for (pos = list_entry((head)->next, typeof(*pos), member), \
- n = list_entry(pos->member.next, typeof(*pos), member); \
- &pos->member != (head); \
- pos = n, n = list_entry(n->member.next, typeof(*n), member))
+#define list_for_each_entry(pos, head, member) \
+ for (pos = list_entry((head)->next, typeof(*pos), member); \
+ &pos->member != (head); \
+ pos = list_entry(pos->member.next, typeof(*pos), member))
-#define list_for_each_entry_reverse(pos, head, member) \
- for (pos = list_entry((head)->prev, typeof(*pos), member); \
- &pos->member != (head); \
- pos = list_entry(pos->member.prev, typeof(*pos), member))
+#define list_for_each_entry_safe(pos, n, head, member) \
+ for (pos = list_entry((head)->next, typeof(*pos), member), \
+ n = list_entry(pos->member.next, typeof(*pos), member); \
+ &pos->member != (head); \
+ pos = n, n = list_entry(n->member.next, typeof(*n), member))
+#define list_for_each_entry_reverse(pos, head, member) \
+ for (pos = list_entry((head)->prev, typeof(*pos), member); \
+ &pos->member != (head); \
+ pos = list_entry(pos->member.prev, typeof(*pos), member))
-#define list_for_each_entry_safe_reverse(pos, n, head, member) \
- for (pos = list_entry((head)->prev, typeof(*pos), member), \
- n = list_entry(pos->member.prev, typeof(*pos), member); \
- &pos->member != (head); \
- pos = n, n = list_entry(n->member.prev, typeof(*n), member))
+#define list_for_each_entry_safe_reverse(pos, n, head, member) \
+ for (pos = list_entry((head)->prev, typeof(*pos), member), \
+ n = list_entry(pos->member.prev, typeof(*pos), member); \
+ &pos->member != (head); \
+ pos = n, n = list_entry(n->member.prev, typeof(*n), member))
/*
* This list implementation has some advantages, but one disadvantage: you
@@ -276,12 +260,14 @@ static inline void list_rotate_left (struct list_head *head)
* address of the head has to be an argument for these macros.
*/
-#define list_next(ptr, head, type, member) \
- (((ptr)->member.next == head) ? NULL \
- : list_entry((ptr)->member.next, type, member))
+#define list_next(ptr, head, type, member) \
+ (((ptr)->member.next == head) \
+ ? NULL \
+ : list_entry((ptr)->member.next, type, member))
-#define list_prev(ptr, head, type, member) \
- (((ptr)->member.prev == head) ? NULL \
- : list_entry((ptr)->member.prev, type, member))
+#define list_prev(ptr, head, type, member) \
+ (((ptr)->member.prev == head) \
+ ? NULL \
+ : list_entry((ptr)->member.prev, type, member))
#endif /* _LLIST_H */
diff --git a/libglusterfs/src/lkowner.h b/libglusterfs/src/lkowner.h
index 9712f176f30..b49e9af6bcb 100644
--- a/libglusterfs/src/lkowner.h
+++ b/libglusterfs/src/lkowner.h
@@ -15,79 +15,79 @@
/* LKOWNER to string functions */
static inline void
-lkowner_unparse (gf_lkowner_t *lkowner, char *buf, int buf_len)
+lkowner_unparse(gf_lkowner_t *lkowner, char *buf, int buf_len)
{
- int i = 0;
- int j = 0;
+ int i = 0;
+ int j = 0;
- for (i = 0; i < lkowner->len; i++) {
- if (i && !(i % 8)) {
- buf[j] = '-';
- j++;
- }
- sprintf (&buf[j], "%02hhx", lkowner->data[i]);
- j += 2;
- if (j == buf_len)
- break;
+ for (i = 0; i < lkowner->len; i++) {
+ if (i && !(i % 8)) {
+ buf[j] = '-';
+ j++;
}
- if (j < buf_len)
- buf[j] = '\0';
+ sprintf(&buf[j], "%02hhx", lkowner->data[i]);
+ j += 2;
+ if (j == buf_len)
+ break;
+ }
+ if (j < buf_len)
+ buf[j] = '\0';
}
static inline void
-set_lk_owner_from_ptr (gf_lkowner_t *lkowner, void *data)
+set_lk_owner_from_ptr(gf_lkowner_t *lkowner, void *data)
{
- int i = 0;
- int j = 0;
+ int i = 0;
+ int j = 0;
- lkowner->len = sizeof (unsigned long);
- for (i = 0, j = 0; i < lkowner->len; i++, j += 8) {
- lkowner->data[i] = (char)((((unsigned long)data) >> j) & 0xff);
- }
+ lkowner->len = sizeof(unsigned long);
+ for (i = 0, j = 0; i < lkowner->len; i++, j += 8) {
+ lkowner->data[i] = (char)((((unsigned long)data) >> j) & 0xff);
+ }
}
static inline void
-set_lk_owner_from_uint64 (gf_lkowner_t *lkowner, uint64_t data)
+set_lk_owner_from_uint64(gf_lkowner_t *lkowner, uint64_t data)
{
- int i = 0;
- int j = 0;
+ int i = 0;
+ int j = 0;
- lkowner->len = 8;
- for (i = 0, j = 0; i < lkowner->len; i++, j += 8) {
- lkowner->data[i] = (char)((data >> j) & 0xff);
- }
+ lkowner->len = 8;
+ for (i = 0, j = 0; i < lkowner->len; i++, j += 8) {
+ lkowner->data[i] = (char)((data >> j) & 0xff);
+ }
}
/* Return true if the locks have the same owner */
static inline int
-is_same_lkowner (gf_lkowner_t *l1, gf_lkowner_t *l2)
+is_same_lkowner(gf_lkowner_t *l1, gf_lkowner_t *l2)
{
- return ((l1->len == l2->len) && !memcmp(l1->data, l2->data, l1->len));
+ return ((l1->len == l2->len) && !memcmp(l1->data, l2->data, l1->len));
}
static inline int
-is_lk_owner_null (gf_lkowner_t *lkowner)
+is_lk_owner_null(gf_lkowner_t *lkowner)
{
- int is_null = 1;
- int i = 0;
+ int is_null = 1;
+ int i = 0;
- if (lkowner == NULL || lkowner->len == 0)
- goto out;
+ if (lkowner == NULL || lkowner->len == 0)
+ goto out;
- for (i = 0; i < lkowner->len; i++) {
- if (lkowner->data[i] != 0) {
- is_null = 0;
- break;
- }
+ for (i = 0; i < lkowner->len; i++) {
+ if (lkowner->data[i] != 0) {
+ is_null = 0;
+ break;
}
+ }
out:
- return is_null;
+ return is_null;
}
static inline void
-lk_owner_copy (gf_lkowner_t *dst, gf_lkowner_t *src)
+lk_owner_copy(gf_lkowner_t *dst, gf_lkowner_t *src)
{
- dst->len = src->len;
- memcpy(dst->data, src->data, src->len);
+ dst->len = src->len;
+ memcpy(dst->data, src->data, src->len);
}
#endif /* _LK_OWNER_H */
diff --git a/libglusterfs/src/locking.h b/libglusterfs/src/locking.h
index 71b6a286e6c..43cc87735d1 100644
--- a/libglusterfs/src/locking.h
+++ b/libglusterfs/src/locking.h
@@ -13,7 +13,7 @@
#include <pthread.h>
-#if defined (GF_DARWIN_HOST_OS)
+#if defined(GF_DARWIN_HOST_OS)
#include <libkern/OSAtomic.h>
#define pthread_spinlock_t OSSpinLock
#define pthread_spin_lock(l) OSSpinLockLock(l)
@@ -22,11 +22,11 @@
#define pthread_spin_init(l, v) (*l = v)
#endif
-#if defined (HAVE_SPINLOCK)
+#if defined(HAVE_SPINLOCK)
typedef union {
- pthread_spinlock_t spinlock;
- pthread_mutex_t mutex;
+ pthread_spinlock_t spinlock;
+ pthread_mutex_t mutex;
} gf_lock_t;
#if !defined(LOCKING_IMPL)
@@ -47,25 +47,25 @@ extern int use_spinlocks;
* worth the extra complexity, but for now this way seems preferable.
*/
-#define LOCK_INIT(x) (use_spinlocks \
- ? pthread_spin_init (&((x)->spinlock), 0) \
- : pthread_mutex_init (&((x)->mutex), 0))
+#define LOCK_INIT(x) \
+ (use_spinlocks ? pthread_spin_init(&((x)->spinlock), 0) \
+ : pthread_mutex_init(&((x)->mutex), 0))
-#define LOCK(x) (use_spinlocks \
- ? pthread_spin_lock (&((x)->spinlock)) \
- : pthread_mutex_lock (&((x)->mutex)))
+#define LOCK(x) \
+ (use_spinlocks ? pthread_spin_lock(&((x)->spinlock)) \
+ : pthread_mutex_lock(&((x)->mutex)))
-#define TRY_LOCK(x) (use_spinlocks \
- ? pthread_spin_trylock (&((x)->spinlock)) \
- : pthread_mutex_trylock (&((x)->mutex)))
+#define TRY_LOCK(x) \
+ (use_spinlocks ? pthread_spin_trylock(&((x)->spinlock)) \
+ : pthread_mutex_trylock(&((x)->mutex)))
-#define UNLOCK(x) (use_spinlocks \
- ? pthread_spin_unlock (&((x)->spinlock)) \
- : pthread_mutex_unlock (&((x)->mutex)))
+#define UNLOCK(x) \
+ (use_spinlocks ? pthread_spin_unlock(&((x)->spinlock)) \
+ : pthread_mutex_unlock(&((x)->mutex)))
-#define LOCK_DESTROY(x) (use_spinlocks \
- ? pthread_spin_destroy (&((x)->spinlock)) \
- : pthread_mutex_destroy (&((x)->mutex)))
+#define LOCK_DESTROY(x) \
+ (use_spinlocks ? pthread_spin_destroy(&((x)->spinlock)) \
+ : pthread_mutex_destroy(&((x)->mutex)))
#endif
@@ -73,13 +73,12 @@ extern int use_spinlocks;
typedef pthread_mutex_t gf_lock_t;
-#define LOCK_INIT(x) pthread_mutex_init (x, 0)
-#define LOCK(x) pthread_mutex_lock (x)
-#define TRY_LOCK(x) pthread_mutex_trylock (x)
-#define UNLOCK(x) pthread_mutex_unlock (x)
-#define LOCK_DESTROY(x) pthread_mutex_destroy (x)
+#define LOCK_INIT(x) pthread_mutex_init(x, 0)
+#define LOCK(x) pthread_mutex_lock(x)
+#define TRY_LOCK(x) pthread_mutex_trylock(x)
+#define UNLOCK(x) pthread_mutex_unlock(x)
+#define LOCK_DESTROY(x) pthread_mutex_destroy(x)
#endif /* HAVE_SPINLOCK */
-
#endif /* _LOCKING_H */
diff --git a/libglusterfs/src/logging.h b/libglusterfs/src/logging.h
index 94acd960b50..f2294488fae 100644
--- a/libglusterfs/src/logging.h
+++ b/libglusterfs/src/logging.h
@@ -19,27 +19,27 @@
#include "list.h"
#ifdef GF_DARWIN_HOST_OS
-#define GF_PRI_FSBLK "u"
-#define GF_PRI_DEV PRId32
-#define GF_PRI_INODE PRIu64
-#define GF_PRI_NLINK PRIu32
-#define GF_PRI_SECOND "ld"
-#define GF_PRI_SUSECONDS "06d"
-#define GF_PRI_SNSECONDS "09ld"
-#define GF_PRI_USEC "d"
+#define GF_PRI_FSBLK "u"
+#define GF_PRI_DEV PRId32
+#define GF_PRI_INODE PRIu64
+#define GF_PRI_NLINK PRIu32
+#define GF_PRI_SECOND "ld"
+#define GF_PRI_SUSECONDS "06d"
+#define GF_PRI_SNSECONDS "09ld"
+#define GF_PRI_USEC "d"
#else
-#define GF_PRI_FSBLK PRIu64
-#define GF_PRI_DEV PRIu64
-#define GF_PRI_INODE PRIu64
-#define GF_PRI_NLINK PRIu32
-#define GF_PRI_SECOND "lu"
-#define GF_PRI_SUSECONDS "06ld"
-#define GF_PRI_SNSECONDS "09ld"
-#define GF_PRI_USEC "ld"
+#define GF_PRI_FSBLK PRIu64
+#define GF_PRI_DEV PRIu64
+#define GF_PRI_INODE PRIu64
+#define GF_PRI_NLINK PRIu32
+#define GF_PRI_SECOND "lu"
+#define GF_PRI_SUSECONDS "06ld"
+#define GF_PRI_SNSECONDS "09ld"
+#define GF_PRI_USEC "ld"
#endif
-#define GF_PRI_BLKSIZE PRId32
-#define GF_PRI_SIZET "zu"
-#define GF_PRI_ATOMIC PRIu64
+#define GF_PRI_BLKSIZE PRId32
+#define GF_PRI_SIZET "zu"
+#define GF_PRI_ATOMIC PRIu64
#ifdef GF_DARWIN_HOST_OS
#define GF_PRI_TIME "ld"
@@ -49,305 +49,343 @@
#if 0
/* Syslog definitions :-) */
-#define LOG_EMERG 0 /* system is unusable */
-#define LOG_ALERT 1 /* action must be taken immediately */
-#define LOG_CRIT 2 /* critical conditions */
-#define LOG_ERR 3 /* error conditions */
-#define LOG_WARNING 4 /* warning conditions */
-#define LOG_NOTICE 5 /* normal but significant condition */
-#define LOG_INFO 6 /* informational */
-#define LOG_DEBUG 7 /* debug-level messages */
+#define LOG_EMERG 0 /* system is unusable */
+#define LOG_ALERT 1 /* action must be taken immediately */
+#define LOG_CRIT 2 /* critical conditions */
+#define LOG_ERR 3 /* error conditions */
+#define LOG_WARNING 4 /* warning conditions */
+#define LOG_NOTICE 5 /* normal but significant condition */
+#define LOG_INFO 6 /* informational */
+#define LOG_DEBUG 7 /* debug-level messages */
#endif
-#define GF_LOG_FORMAT_NO_MSG_ID "no-msg-id"
-#define GF_LOG_FORMAT_WITH_MSG_ID "with-msg-id"
+#define GF_LOG_FORMAT_NO_MSG_ID "no-msg-id"
+#define GF_LOG_FORMAT_WITH_MSG_ID "with-msg-id"
-#define GF_LOGGER_GLUSTER_LOG "gluster-log"
-#define GF_LOGGER_SYSLOG "syslog"
+#define GF_LOGGER_GLUSTER_LOG "gluster-log"
+#define GF_LOGGER_SYSLOG "syslog"
typedef enum {
- GF_LOG_NONE,
- GF_LOG_EMERG,
- GF_LOG_ALERT,
- GF_LOG_CRITICAL, /* fatal errors */
- GF_LOG_ERROR, /* major failures (not necessarily fatal) */
- GF_LOG_WARNING, /* info about normal operation */
- GF_LOG_NOTICE,
- GF_LOG_INFO, /* Normal information */
- GF_LOG_DEBUG, /* internal errors */
- GF_LOG_TRACE, /* full trace of operation */
+ GF_LOG_NONE,
+ GF_LOG_EMERG,
+ GF_LOG_ALERT,
+ GF_LOG_CRITICAL, /* fatal errors */
+ GF_LOG_ERROR, /* major failures (not necessarily fatal) */
+ GF_LOG_WARNING, /* info about normal operation */
+ GF_LOG_NOTICE,
+ GF_LOG_INFO, /* Normal information */
+ GF_LOG_DEBUG, /* internal errors */
+ GF_LOG_TRACE, /* full trace of operation */
} gf_loglevel_t;
/* format for the logs */
typedef enum {
- gf_logformat_traditional = 0, /* Format as in gluster 3.5 */
- gf_logformat_withmsgid, /* Format enhanced with MsgID, ident, errstr */
- gf_logformat_cee /* log enhanced format in cee */
+ gf_logformat_traditional = 0, /* Format as in gluster 3.5 */
+ gf_logformat_withmsgid, /* Format enhanced with MsgID, ident, errstr */
+ gf_logformat_cee /* log enhanced format in cee */
} gf_log_format_t;
/* log infrastructure to log to */
typedef enum {
- gf_logger_glusterlog = 0, /* locations and files as in gluster 3.5 */
- gf_logger_syslog /* log to (r)syslog, based on (r)syslog conf */
- /* NOTE: In the future journald, lumberjack, next new thing here */
+ gf_logger_glusterlog = 0, /* locations and files as in gluster 3.5 */
+ gf_logger_syslog /* log to (r)syslog, based on (r)syslog conf */
+ /* NOTE: In the future journald, lumberjack, next new thing here */
} gf_log_logger_t;
-#define DEFAULT_LOG_FILE_DIRECTORY DATADIR "/log/glusterfs"
-#define DEFAULT_QUOTA_CRAWL_LOG_DIRECTORY DATADIR "/log/glusterfs/quota_crawl"
-#define DEFAULT_LOG_LEVEL GF_LOG_INFO
+#define DEFAULT_LOG_FILE_DIRECTORY DATADIR "/log/glusterfs"
+#define DEFAULT_QUOTA_CRAWL_LOG_DIRECTORY DATADIR "/log/glusterfs/quota_crawl"
+#define DEFAULT_LOG_LEVEL GF_LOG_INFO
typedef struct gf_log_handle_ {
- pthread_mutex_t logfile_mutex;
- uint8_t logrotate;
- uint8_t cmd_history_logrotate;
- gf_loglevel_t loglevel;
- int gf_log_syslog;
- gf_loglevel_t sys_log_level;
- char *filename;
- FILE *logfile;
- FILE *gf_log_logfile;
- char *cmd_log_filename;
- FILE *cmdlogfile;
- gf_log_logger_t logger;
- gf_log_format_t logformat;
- char *ident;
- int log_control_file_found;
- struct list_head lru_queue;
- uint32_t lru_size;
- uint32_t lru_cur_size;
- uint32_t timeout;
- pthread_mutex_t log_buf_lock;
- struct _gf_timer *log_flush_timer;
- int localtime;
+ pthread_mutex_t logfile_mutex;
+ uint8_t logrotate;
+ uint8_t cmd_history_logrotate;
+ gf_loglevel_t loglevel;
+ int gf_log_syslog;
+ gf_loglevel_t sys_log_level;
+ char *filename;
+ FILE *logfile;
+ FILE *gf_log_logfile;
+ char *cmd_log_filename;
+ FILE *cmdlogfile;
+ gf_log_logger_t logger;
+ gf_log_format_t logformat;
+ char *ident;
+ int log_control_file_found;
+ struct list_head lru_queue;
+ uint32_t lru_size;
+ uint32_t lru_cur_size;
+ uint32_t timeout;
+ pthread_mutex_t log_buf_lock;
+ struct _gf_timer *log_flush_timer;
+ int localtime;
} gf_log_handle_t;
-
typedef struct log_buf_ {
- char *msg;
- uint64_t msg_id;
- int errnum;
- struct timeval oldest;
- struct timeval latest;
- char *domain;
- char *file;
- char *function;
- int32_t line;
- gf_loglevel_t level;
- int refcount;
- int graph_id;
- struct list_head msg_list;
+ char *msg;
+ uint64_t msg_id;
+ int errnum;
+ struct timeval oldest;
+ struct timeval latest;
+ char *domain;
+ char *file;
+ char *function;
+ int32_t line;
+ gf_loglevel_t level;
+ int refcount;
+ int graph_id;
+ struct list_head msg_list;
} log_buf_t;
-void gf_log_globals_init (void *ctx, gf_loglevel_t level);
-int gf_log_init (void *data, const char *filename, const char *ident);
+void
+gf_log_globals_init(void *ctx, gf_loglevel_t level);
+int
+gf_log_init(void *data, const char *filename, const char *ident);
-void gf_log_logrotate (int signum);
+void
+gf_log_logrotate(int signum);
-void gf_log_cleanup (void);
+void
+gf_log_cleanup(void);
/* Internal interfaces to log messages with message IDs */
-int _gf_msg (const char *domain, const char *file,
- const char *function, int32_t line, gf_loglevel_t level,
- int errnum, int trace, uint64_t msgid, const char *fmt, ...)
- __attribute__ ((__format__ (__printf__, 9, 10)));
-
-void _gf_msg_backtrace_nomem (gf_loglevel_t level, int stacksize);
-
-int _gf_msg_plain (gf_loglevel_t level, const char *fmt, ...)
- __attribute__ ((__format__ (__printf__, 2, 3)));
+int
+_gf_msg(const char *domain, const char *file, const char *function,
+ int32_t line, gf_loglevel_t level, int errnum, int trace,
+ uint64_t msgid, const char *fmt, ...)
+ __attribute__((__format__(__printf__, 9, 10)));
-int _gf_msg_plain_nomem (gf_loglevel_t level, const char *msg);
+void
+_gf_msg_backtrace_nomem(gf_loglevel_t level, int stacksize);
-int _gf_msg_vplain (gf_loglevel_t level, const char *fmt, va_list ap);
+int
+_gf_msg_plain(gf_loglevel_t level, const char *fmt, ...)
+ __attribute__((__format__(__printf__, 2, 3)));
-int _gf_msg_nomem (const char *domain, const char *file,
- const char *function, int line, gf_loglevel_t level,
- size_t size);
+int
+_gf_msg_plain_nomem(gf_loglevel_t level, const char *msg);
-int _gf_log (const char *domain, const char *file,
- const char *function, int32_t line, gf_loglevel_t level,
- const char *fmt, ...)
- __attribute__ ((__format__ (__printf__, 6, 7)));
+int
+_gf_msg_vplain(gf_loglevel_t level, const char *fmt, va_list ap);
-int _gf_log_callingfn (const char *domain, const char *file,
- const char *function, int32_t line, gf_loglevel_t level,
- const char *fmt, ...)
- __attribute__ ((__format__ (__printf__, 6, 7)));
+int
+_gf_msg_nomem(const char *domain, const char *file, const char *function,
+ int line, gf_loglevel_t level, size_t size);
-int _gf_log_eh (const char *function, const char *fmt, ...);
+int
+_gf_log(const char *domain, const char *file, const char *function,
+ int32_t line, gf_loglevel_t level, const char *fmt, ...)
+ __attribute__((__format__(__printf__, 6, 7)));
+int
+_gf_log_callingfn(const char *domain, const char *file, const char *function,
+ int32_t line, gf_loglevel_t level, const char *fmt, ...)
+ __attribute__((__format__(__printf__, 6, 7)));
+int
+_gf_log_eh(const char *function, const char *fmt, ...);
/* treat GF_LOG_TRACE and GF_LOG_NONE as LOG_DEBUG and
* other level as is */
-#define SET_LOG_PRIO(level, priority) do { \
- if (GF_LOG_TRACE == (level) || GF_LOG_NONE == (level)) { \
- priority = LOG_DEBUG; \
- } else { \
- priority = (level) - 1; \
- } \
- } while (0)
+#define SET_LOG_PRIO(level, priority) \
+ do { \
+ if (GF_LOG_TRACE == (level) || GF_LOG_NONE == (level)) { \
+ priority = LOG_DEBUG; \
+ } else { \
+ priority = (level)-1; \
+ } \
+ } while (0)
/* extract just the file name from the path */
-#define GET_FILE_NAME_TO_LOG(file, basename) do { \
- basename = strrchr ((file), '/'); \
- if (basename) \
- basename++; \
- else \
- basename = (file); \
- } while (0)
-
-#define PRINT_SIZE_CHECK(ret, label, strsize) do { \
- if (ret < 0) \
- goto label; \
- if ((strsize - ret) > 0) { \
- strsize -= ret; \
- } else { \
- ret = 0; \
- goto label; \
- } \
- } while (0)
-
-#define FMT_WARN(fmt...) do { if (0) printf (fmt); } while (0)
+#define GET_FILE_NAME_TO_LOG(file, basename) \
+ do { \
+ basename = strrchr((file), '/'); \
+ if (basename) \
+ basename++; \
+ else \
+ basename = (file); \
+ } while (0)
+
+#define PRINT_SIZE_CHECK(ret, label, strsize) \
+ do { \
+ if (ret < 0) \
+ goto label; \
+ if ((strsize - ret) > 0) { \
+ strsize -= ret; \
+ } else { \
+ ret = 0; \
+ goto label; \
+ } \
+ } while (0)
+
+#define FMT_WARN(fmt...) \
+ do { \
+ if (0) \
+ printf(fmt); \
+ } while (0)
/* Interface to log messages with message IDs */
-#define gf_msg(dom, level, errnum, msgid, fmt...) do { \
- _gf_msg (dom, __FILE__, __FUNCTION__, __LINE__, \
- level, errnum, 0, msgid, ##fmt); \
- } while (0)
+#define gf_msg(dom, level, errnum, msgid, fmt...) \
+ do { \
+ _gf_msg(dom, __FILE__, __FUNCTION__, __LINE__, level, errnum, 0, \
+ msgid, ##fmt); \
+ } while (0)
/* no frills, no thrills, just a vanilla message, used to print the graph */
-#define gf_msg_plain(level, fmt...) do { \
- _gf_msg_plain (level, ##fmt); \
- } while (0)
-
-#define gf_msg_plain_nomem(level, msg) do { \
- _gf_msg_plain_nomem (level, msg); \
- } while (0)
-
-#define gf_msg_vplain(level, fmt, va) do { \
- _gf_msg_vplain (level, fmt, va); \
- } while (0)
-
-#define gf_msg_backtrace_nomem(level, stacksize) do { \
- _gf_msg_backtrace_nomem (level, stacksize); \
- } while (0)
-
-#define gf_msg_callingfn(dom, level, errnum, msgid, fmt...) do { \
- _gf_msg (dom, __FILE__, __FUNCTION__, __LINE__, \
- level, errnum, 1, msgid, ##fmt); \
- } while (0)
+#define gf_msg_plain(level, fmt...) \
+ do { \
+ _gf_msg_plain(level, ##fmt); \
+ } while (0)
+
+#define gf_msg_plain_nomem(level, msg) \
+ do { \
+ _gf_msg_plain_nomem(level, msg); \
+ } while (0)
+
+#define gf_msg_vplain(level, fmt, va) \
+ do { \
+ _gf_msg_vplain(level, fmt, va); \
+ } while (0)
+
+#define gf_msg_backtrace_nomem(level, stacksize) \
+ do { \
+ _gf_msg_backtrace_nomem(level, stacksize); \
+ } while (0)
+
+#define gf_msg_callingfn(dom, level, errnum, msgid, fmt...) \
+ do { \
+ _gf_msg(dom, __FILE__, __FUNCTION__, __LINE__, level, errnum, 1, \
+ msgid, ##fmt); \
+ } while (0)
/* No malloc or calloc should be called in this function */
-#define gf_msg_nomem(dom, level, size) do { \
- _gf_msg_nomem (dom, __FILE__, __FUNCTION__, __LINE__, \
- level, size); \
- } while (0)
+#define gf_msg_nomem(dom, level, size) \
+ do { \
+ _gf_msg_nomem(dom, __FILE__, __FUNCTION__, __LINE__, level, size); \
+ } while (0)
/* Debug or trace messages do not need message IDs as these are more developer
* related. Hence, the following abstractions are provided for the same */
-#define gf_msg_debug(dom, errnum, fmt...) do { \
- _gf_msg (dom, __FILE__, __FUNCTION__, __LINE__, \
- GF_LOG_DEBUG, errnum, 0, 0, ##fmt); \
- } while (0)
-
-#define gf_msg_trace(dom, errnum, fmt...) do { \
- _gf_msg (dom, __FILE__, __FUNCTION__, __LINE__, \
- GF_LOG_TRACE, errnum, 0, 0, ##fmt); \
- } while (0)
-
-#define gf_log(dom, level, fmt...) do { \
- FMT_WARN (fmt); \
- _gf_log (dom, __FILE__, __FUNCTION__, __LINE__, \
- level, ##fmt); \
- } while (0)
-
-#define gf_log_eh(fmt...) do { \
- FMT_WARN (fmt); \
- _gf_log_eh (__FUNCTION__, ##fmt); \
- } while (0)
-
-#define gf_log_callingfn(dom, level, fmt...) do { \
- FMT_WARN (fmt); \
- _gf_log_callingfn (dom, __FILE__, __FUNCTION__, __LINE__, \
- level, ##fmt); \
- } while (0)
-
+#define gf_msg_debug(dom, errnum, fmt...) \
+ do { \
+ _gf_msg(dom, __FILE__, __FUNCTION__, __LINE__, GF_LOG_DEBUG, errnum, \
+ 0, 0, ##fmt); \
+ } while (0)
+
+#define gf_msg_trace(dom, errnum, fmt...) \
+ do { \
+ _gf_msg(dom, __FILE__, __FUNCTION__, __LINE__, GF_LOG_TRACE, errnum, \
+ 0, 0, ##fmt); \
+ } while (0)
+
+#define gf_log(dom, level, fmt...) \
+ do { \
+ FMT_WARN(fmt); \
+ _gf_log(dom, __FILE__, __FUNCTION__, __LINE__, level, ##fmt); \
+ } while (0)
+
+#define gf_log_eh(fmt...) \
+ do { \
+ FMT_WARN(fmt); \
+ _gf_log_eh(__FUNCTION__, ##fmt); \
+ } while (0)
+
+#define gf_log_callingfn(dom, level, fmt...) \
+ do { \
+ FMT_WARN(fmt); \
+ _gf_log_callingfn(dom, __FILE__, __FUNCTION__, __LINE__, level, \
+ ##fmt); \
+ } while (0)
/* Log once in GF_UNIVERSAL_ANSWER times */
-#define GF_LOG_OCCASIONALLY(var, args...) if (!(var++%GF_UNIVERSAL_ANSWER)) { \
- gf_log (args); \
- }
+#define GF_LOG_OCCASIONALLY(var, args...) \
+ if (!(var++ % GF_UNIVERSAL_ANSWER)) { \
+ gf_log(args); \
+ }
struct _glusterfs_ctx;
-void gf_log_disable_syslog (void);
-void gf_log_enable_syslog (void);
-gf_loglevel_t gf_log_get_loglevel (void);
-void gf_log_set_loglevel (struct _glusterfs_ctx *ctx, gf_loglevel_t level);
-int gf_log_get_localtime (void);
-void gf_log_set_localtime (int);
-void gf_log_flush (void);
-gf_loglevel_t gf_log_get_xl_loglevel (void *xl);
-void gf_log_set_xl_loglevel (void *xl, gf_loglevel_t level);
+void
+gf_log_disable_syslog(void);
+void
+gf_log_enable_syslog(void);
+gf_loglevel_t
+gf_log_get_loglevel(void);
+void
+gf_log_set_loglevel(struct _glusterfs_ctx *ctx, gf_loglevel_t level);
+int
+gf_log_get_localtime(void);
+void
+gf_log_set_localtime(int);
+void
+gf_log_flush(void);
+gf_loglevel_t
+gf_log_get_xl_loglevel(void *xl);
+void
+gf_log_set_xl_loglevel(void *xl, gf_loglevel_t level);
-int gf_cmd_log (const char *domain, const char *fmt, ...)
- __attribute__ ((__format__ (__printf__, 2, 3)));
+int
+gf_cmd_log(const char *domain, const char *fmt, ...)
+ __attribute__((__format__(__printf__, 2, 3)));
-int gf_cmd_log_init (const char *filename);
+int
+gf_cmd_log_init(const char *filename);
-void set_sys_log_level (gf_loglevel_t level);
+void
+set_sys_log_level(gf_loglevel_t level);
-int gf_log_fini(void *data);
+int
+gf_log_fini(void *data);
void
-gf_log_set_logger (gf_log_logger_t logger);
+gf_log_set_logger(gf_log_logger_t logger);
void
-gf_log_set_logformat (gf_log_format_t format);
+gf_log_set_logformat(gf_log_format_t format);
void
-gf_log_set_log_buf_size (uint32_t buf_size);
+gf_log_set_log_buf_size(uint32_t buf_size);
void
-gf_log_set_log_flush_timeout (uint32_t timeout);
+gf_log_set_log_flush_timeout(uint32_t timeout);
void
-gf_log_flush_msgs (struct _glusterfs_ctx *ctx);
+gf_log_flush_msgs(struct _glusterfs_ctx *ctx);
int
-gf_log_inject_timer_event (struct _glusterfs_ctx *ctx);
+gf_log_inject_timer_event(struct _glusterfs_ctx *ctx);
void
-gf_log_disable_suppression_before_exit (struct _glusterfs_ctx *ctx);
+gf_log_disable_suppression_before_exit(struct _glusterfs_ctx *ctx);
-#define GF_DEBUG(xl, format, args...) \
- gf_log ((xl)->name, GF_LOG_DEBUG, format, ##args)
-#define GF_INFO(xl, format, args...) \
- gf_log ((xl)->name, GF_LOG_INFO, format, ##args)
-#define GF_WARNING(xl, format, args...) \
- gf_log ((xl)->name, GF_LOG_WARNING, format, ##args)
-#define GF_ERROR(xl, format, args...) \
- gf_log ((xl)->name, GF_LOG_ERROR, format, ##args)
+#define GF_DEBUG(xl, format, args...) \
+ gf_log((xl)->name, GF_LOG_DEBUG, format, ##args)
+#define GF_INFO(xl, format, args...) \
+ gf_log((xl)->name, GF_LOG_INFO, format, ##args)
+#define GF_WARNING(xl, format, args...) \
+ gf_log((xl)->name, GF_LOG_WARNING, format, ##args)
+#define GF_ERROR(xl, format, args...) \
+ gf_log((xl)->name, GF_LOG_ERROR, format, ##args)
int
-_gf_slog (const char *domain, const char *file, const char *function, int line,
- gf_loglevel_t level, const char *event, ...);
+_gf_slog(const char *domain, const char *file, const char *function, int line,
+ gf_loglevel_t level, const char *event, ...);
int
-_gf_smsg (const char *domain, const char *file, const char *function,
- int32_t line, gf_loglevel_t level, int errnum, int trace,
- uint64_t msgid, const char *event, ...);
+_gf_smsg(const char *domain, const char *file, const char *function,
+ int32_t line, gf_loglevel_t level, int errnum, int trace,
+ uint64_t msgid, const char *event, ...);
/* Interface to log messages with message IDs */
-#define gf_smsg(dom, level, errnum, msgid, event...) do { \
- _gf_smsg (dom, __FILE__, __FUNCTION__, __LINE__, \
- level, errnum, 0, msgid, ##event); \
- } while (0)
-
-#define gf_slog(dom, level, event...) do { \
- _gf_slog (dom, __FILE__, __FUNCTION__, __LINE__, \
- level, ##event); \
- } while (0)
+#define gf_smsg(dom, level, errnum, msgid, event...) \
+ do { \
+ _gf_smsg(dom, __FILE__, __FUNCTION__, __LINE__, level, errnum, 0, \
+ msgid, ##event); \
+ } while (0)
+
+#define gf_slog(dom, level, event...) \
+ do { \
+ _gf_slog(dom, __FILE__, __FUNCTION__, __LINE__, level, ##event); \
+ } while (0)
#endif /* __LOGGING_H__ */
diff --git a/libglusterfs/src/mem-pool.h b/libglusterfs/src/mem-pool.h
index 9a457bbca5a..b163458c488 100644
--- a/libglusterfs/src/mem-pool.h
+++ b/libglusterfs/src/mem-pool.h
@@ -34,262 +34,270 @@
#endif
#define GF_MEM_TRAILER_SIZE 8
-#define GF_MEM_HEADER_MAGIC 0xCAFEBABE
+#define GF_MEM_HEADER_MAGIC 0xCAFEBABE
#define GF_MEM_TRAILER_MAGIC 0xBAADF00D
#define GF_MEM_INVALID_MAGIC 0xDEADC0DE
struct mem_acct_rec {
- const char *typestr;
- size_t size;
- size_t max_size;
- uint32_t num_allocs;
- uint32_t total_allocs;
- uint32_t max_num_allocs;
- gf_lock_t lock;
+ const char *typestr;
+ size_t size;
+ size_t max_size;
+ uint32_t num_allocs;
+ uint32_t total_allocs;
+ uint32_t max_num_allocs;
+ gf_lock_t lock;
#ifdef DEBUG
- struct list_head obj_list;
+ struct list_head obj_list;
#endif
};
struct mem_acct {
- uint32_t num_types;
- gf_atomic_t refcnt;
- struct mem_acct_rec rec[0];
+ uint32_t num_types;
+ gf_atomic_t refcnt;
+ struct mem_acct_rec rec[0];
};
struct mem_header {
- uint32_t type;
- size_t size;
- struct mem_acct *mem_acct;
- uint32_t magic;
+ uint32_t type;
+ size_t size;
+ struct mem_acct *mem_acct;
+ uint32_t magic;
#ifdef DEBUG
- struct list_head acct_list;
+ struct list_head acct_list;
#endif
- int padding[8];
+ int padding[8];
};
-#define GF_MEM_HEADER_SIZE (sizeof (struct mem_header))
+#define GF_MEM_HEADER_SIZE (sizeof(struct mem_header))
#ifdef DEBUG
struct mem_invalid {
- uint32_t magic;
- void *mem_acct;
- uint32_t type;
- size_t size;
- void *baseaddr;
+ uint32_t magic;
+ void *mem_acct;
+ uint32_t type;
+ size_t size;
+ void *baseaddr;
};
#endif
void *
-__gf_calloc (size_t cnt, size_t size, uint32_t type, const char *typestr);
+__gf_calloc(size_t cnt, size_t size, uint32_t type, const char *typestr);
void *
-__gf_malloc (size_t size, uint32_t type, const char *typestr);
+__gf_malloc(size_t size, uint32_t type, const char *typestr);
void *
-__gf_realloc (void *ptr, size_t size);
+__gf_realloc(void *ptr, size_t size);
int
-gf_vasprintf (char **string_ptr, const char *format, va_list arg);
+gf_vasprintf(char **string_ptr, const char *format, va_list arg);
int
-gf_asprintf (char **string_ptr, const char *format, ...);
+gf_asprintf(char **string_ptr, const char *format, ...);
void
-__gf_free (void *ptr);
+__gf_free(void *ptr);
-static inline
-void* __gf_default_malloc (size_t size)
+static inline void *
+__gf_default_malloc(size_t size)
{
- void *ptr = NULL;
+ void *ptr = NULL;
- ptr = malloc (size);
- if (!ptr)
- gf_msg_nomem ("", GF_LOG_ALERT, size);
+ ptr = malloc(size);
+ if (!ptr)
+ gf_msg_nomem("", GF_LOG_ALERT, size);
- return ptr;
+ return ptr;
}
-static inline
-void* __gf_default_calloc (int cnt, size_t size)
+static inline void *
+__gf_default_calloc(int cnt, size_t size)
{
- void *ptr = NULL;
+ void *ptr = NULL;
- ptr = calloc (cnt, size);
- if (!ptr)
- gf_msg_nomem ("", GF_LOG_ALERT, (cnt * size));
+ ptr = calloc(cnt, size);
+ if (!ptr)
+ gf_msg_nomem("", GF_LOG_ALERT, (cnt * size));
- return ptr;
+ return ptr;
}
-static inline
-void* __gf_default_realloc (void *oldptr, size_t size)
+static inline void *
+__gf_default_realloc(void *oldptr, size_t size)
{
- void *ptr = NULL;
+ void *ptr = NULL;
- ptr = realloc (oldptr, size);
- if (!ptr)
- gf_msg_nomem ("", GF_LOG_ALERT, size);
+ ptr = realloc(oldptr, size);
+ if (!ptr)
+ gf_msg_nomem("", GF_LOG_ALERT, size);
- return ptr;
+ return ptr;
}
-#define MALLOC(size) __gf_default_malloc(size)
-#define CALLOC(cnt,size) __gf_default_calloc(cnt,size)
-#define REALLOC(ptr,size) __gf_default_realloc(ptr,size)
+#define MALLOC(size) __gf_default_malloc(size)
+#define CALLOC(cnt, size) __gf_default_calloc(cnt, size)
+#define REALLOC(ptr, size) __gf_default_realloc(ptr, size)
-#define FREE(ptr) \
- do { \
- if (ptr != NULL) { \
- free ((void *)ptr); \
- ptr = (void *)0xeeeeeeee; \
- } \
- } while (0)
+#define FREE(ptr) \
+ do { \
+ if (ptr != NULL) { \
+ free((void *)ptr); \
+ ptr = (void *)0xeeeeeeee; \
+ } \
+ } while (0)
-#define GF_CALLOC(nmemb, size, type) __gf_calloc (nmemb, size, type, #type)
+#define GF_CALLOC(nmemb, size, type) __gf_calloc(nmemb, size, type, #type)
-#define GF_MALLOC(size, type) __gf_malloc (size, type, #type)
+#define GF_MALLOC(size, type) __gf_malloc(size, type, #type)
-#define GF_REALLOC(ptr, size) __gf_realloc (ptr, size)
+#define GF_REALLOC(ptr, size) __gf_realloc(ptr, size)
-#define GF_FREE(free_ptr) __gf_free (free_ptr)
+#define GF_FREE(free_ptr) __gf_free(free_ptr)
-static inline
-char *gf_strndup (const char *src, size_t len)
+static inline char *
+gf_strndup(const char *src, size_t len)
{
- char *dup_str = NULL;
+ char *dup_str = NULL;
- if (!src) {
- goto out;
- }
+ if (!src) {
+ goto out;
+ }
- dup_str = GF_MALLOC (len + 1, gf_common_mt_strdup);
- if (!dup_str) {
- goto out;
- }
+ dup_str = GF_MALLOC(len + 1, gf_common_mt_strdup);
+ if (!dup_str) {
+ goto out;
+ }
- memcpy (dup_str, src, len);
- dup_str[len] = '\0';
+ memcpy(dup_str, src, len);
+ dup_str[len] = '\0';
out:
- return dup_str;
+ return dup_str;
}
-static inline
-char * gf_strdup (const char *src)
+static inline char *
+gf_strdup(const char *src)
{
- if (!src)
- return NULL;
+ if (!src)
+ return NULL;
- return gf_strndup (src, strlen (src));
+ return gf_strndup(src, strlen(src));
}
static inline void *
-gf_memdup (const void *src, size_t size)
+gf_memdup(const void *src, size_t size)
{
- void *dup_mem = NULL;
+ void *dup_mem = NULL;
- dup_mem = GF_MALLOC (size, gf_common_mt_strdup);
- if (!dup_mem)
- goto out;
+ dup_mem = GF_MALLOC(size, gf_common_mt_strdup);
+ if (!dup_mem)
+ goto out;
- memcpy (dup_mem, src, size);
+ memcpy(dup_mem, src, size);
out:
- return dup_mem;
+ return dup_mem;
}
/* kind of 'header' for the actual mem_pool_shared structure, this might make
* it possible to dump some more details in a statedump */
struct mem_pool {
- /* object size, without pooled_obj_hdr_t */
- unsigned long sizeof_type;
- unsigned long count; /* requested pool size (unused) */
- char *name;
- gf_atomic_t active; /* current allocations */
+ /* object size, without pooled_obj_hdr_t */
+ unsigned long sizeof_type;
+ unsigned long count; /* requested pool size (unused) */
+ char *name;
+ gf_atomic_t active; /* current allocations */
- struct list_head owner; /* glusterfs_ctx_t->mempool_list */
- glusterfs_ctx_t *ctx; /* take ctx->lock when updating owner */
+ struct list_head owner; /* glusterfs_ctx_t->mempool_list */
+ glusterfs_ctx_t *ctx; /* take ctx->lock when updating owner */
- struct mem_pool_shared *pool; /* the initial pool that was returned */
+ struct mem_pool_shared *pool; /* the initial pool that was returned */
};
typedef struct pooled_obj_hdr {
- unsigned long magic;
- struct pooled_obj_hdr *next;
- struct per_thread_pool_list *pool_list;
- unsigned int power_of_two;
+ unsigned long magic;
+ struct pooled_obj_hdr *next;
+ struct per_thread_pool_list *pool_list;
+ unsigned int power_of_two;
- /* track the pool that was used to request this object */
- struct mem_pool *pool;
+ /* track the pool that was used to request this object */
+ struct mem_pool *pool;
} pooled_obj_hdr_t;
-#define AVAILABLE_SIZE(p2) ((1 << (p2)) - sizeof(pooled_obj_hdr_t))
+#define AVAILABLE_SIZE(p2) ((1 << (p2)) - sizeof(pooled_obj_hdr_t))
typedef struct per_thread_pool {
- /* the pool that was used to request this allocation */
- struct mem_pool_shared *parent;
- /* Everything else is protected by our own lock. */
- pooled_obj_hdr_t *hot_list;
- pooled_obj_hdr_t *cold_list;
+ /* the pool that was used to request this allocation */
+ struct mem_pool_shared *parent;
+ /* Everything else is protected by our own lock. */
+ pooled_obj_hdr_t *hot_list;
+ pooled_obj_hdr_t *cold_list;
} per_thread_pool_t;
typedef struct per_thread_pool_list {
- /*
- * These first two members are protected by the global pool lock. When
- * a thread first tries to use any pool, we create one of these. We
- * link it into the global list using thr_list so the pool-sweeper
- * thread can find it, and use pthread_setspecific so this thread can
- * find it. When the per-thread destructor runs, we "poison" the pool
- * list to prevent further allocations. This also signals to the
- * pool-sweeper thread that the list should be detached and freed after
- * the next time it's swept.
- */
- struct list_head thr_list;
- unsigned int poison;
- /*
- * There's really more than one pool, but the actual number is hidden
- * in the implementation code so we just make it a single-element array
- * here.
- */
- pthread_spinlock_t lock;
- per_thread_pool_t pools[1];
+ /*
+ * These first two members are protected by the global pool lock. When
+ * a thread first tries to use any pool, we create one of these. We
+ * link it into the global list using thr_list so the pool-sweeper
+ * thread can find it, and use pthread_setspecific so this thread can
+ * find it. When the per-thread destructor runs, we "poison" the pool
+ * list to prevent further allocations. This also signals to the
+ * pool-sweeper thread that the list should be detached and freed after
+ * the next time it's swept.
+ */
+ struct list_head thr_list;
+ unsigned int poison;
+ /*
+ * There's really more than one pool, but the actual number is hidden
+ * in the implementation code so we just make it a single-element array
+ * here.
+ */
+ pthread_spinlock_t lock;
+ per_thread_pool_t pools[1];
} per_thread_pool_list_t;
/* actual pool structure, shared between different mem_pools */
struct mem_pool_shared {
- unsigned int power_of_two;
- /*
- * Updates to these are *not* protected by a global lock, so races
- * could occur and the numbers might be slightly off. Don't expect
- * them to line up exactly. It's the general trends that matter, and
- * it's not worth the locked-bus-cycle overhead to make these precise.
- */
- gf_atomic_t allocs_hot;
- gf_atomic_t allocs_cold;
- gf_atomic_t allocs_stdc;
- gf_atomic_t frees_to_list;
+ unsigned int power_of_two;
+ /*
+ * Updates to these are *not* protected by a global lock, so races
+ * could occur and the numbers might be slightly off. Don't expect
+ * them to line up exactly. It's the general trends that matter, and
+ * it's not worth the locked-bus-cycle overhead to make these precise.
+ */
+ gf_atomic_t allocs_hot;
+ gf_atomic_t allocs_cold;
+ gf_atomic_t allocs_stdc;
+ gf_atomic_t frees_to_list;
};
-void mem_pools_init_early (void); /* basic initialization of memory pools */
-void mem_pools_init_late (void); /* start the pool_sweeper thread */
-void mem_pools_fini (void); /* cleanup memory pools */
+void
+mem_pools_init_early(void); /* basic initialization of memory pools */
+void
+mem_pools_init_late(void); /* start the pool_sweeper thread */
+void
+mem_pools_fini(void); /* cleanup memory pools */
struct mem_pool *
-mem_pool_new_fn (glusterfs_ctx_t *ctx, unsigned long sizeof_type, unsigned long
- count, char *name);
+mem_pool_new_fn(glusterfs_ctx_t *ctx, unsigned long sizeof_type,
+ unsigned long count, char *name);
-#define mem_pool_new(type,count) \
- mem_pool_new_fn (THIS->ctx, sizeof(type), count, #type)
+#define mem_pool_new(type, count) \
+ mem_pool_new_fn(THIS->ctx, sizeof(type), count, #type)
-#define mem_pool_new_ctx(ctx,type,count) \
- mem_pool_new_fn (ctx, sizeof(type), count, #type)
+#define mem_pool_new_ctx(ctx, type, count) \
+ mem_pool_new_fn(ctx, sizeof(type), count, #type)
-void mem_put (void *ptr);
-void *mem_get (struct mem_pool *pool);
-void *mem_get0 (struct mem_pool *pool);
+void
+mem_put(void *ptr);
+void *
+mem_get(struct mem_pool *pool);
+void *
+mem_get0(struct mem_pool *pool);
-void mem_pool_destroy (struct mem_pool *pool);
+void
+mem_pool_destroy(struct mem_pool *pool);
-void gf_mem_acct_enable_set (void *ctx);
+void
+gf_mem_acct_enable_set(void *ctx);
#endif /* _MEM_POOL_H */
diff --git a/libglusterfs/src/mem-types.h b/libglusterfs/src/mem-types.h
index 85c06e9cbe5..4f6ca4e0e84 100644
--- a/libglusterfs/src/mem-types.h
+++ b/libglusterfs/src/mem-types.h
@@ -11,172 +11,171 @@
#ifndef __MEM_TYPES_H__
#define __MEM_TYPES_H__
-
enum gf_common_mem_types_ {
- gf_common_mt_call_stub_t,
- gf_common_mt_dnscache6,
- gf_common_mt_data_pair_t,
- gf_common_mt_data_t,
- gf_common_mt_dict_t,
- gf_common_mt_event_pool,
- gf_common_mt_reg,
- gf_common_mt_pollfd,
- gf_common_mt_epoll_event,
- gf_common_mt_fdentry_t,
- gf_common_mt_fdtable_t,
- gf_common_mt_fd_t,
- gf_common_mt_fd_ctx,
- gf_common_mt_gf_dirent_t,
- gf_common_mt_glusterfs_ctx_t,
- gf_common_mt_dentry_t,
- gf_common_mt_inode_t,
- gf_common_mt_inode_ctx,
- gf_common_mt_list_head,
- gf_common_mt_inode_table_t,
- gf_common_mt_xlator_t,
- gf_common_mt_xlator_list_t,
- gf_common_mt_log_msg,
- gf_common_mt_client_log,
- gf_common_mt_volume_opt_list_t,
- gf_common_mt_gf_hdr_common_t,
- gf_common_mt_call_frame_t,
- gf_common_mt_call_stack_t,
- gf_common_mt_gf_timer_t,
- gf_common_mt_gf_timer_registry_t,
- gf_common_mt_transport,
- gf_common_mt_transport_msg,
- gf_common_mt_auth_handle_t,
- gf_common_mt_iobuf,
- gf_common_mt_iobuf_arena,
- gf_common_mt_iobref,
- gf_common_mt_iobuf_pool,
- gf_common_mt_iovec,
- gf_common_mt_memdup,
- gf_common_mt_asprintf,
- gf_common_mt_strdup,
- gf_common_mt_socket_private_t,
- gf_common_mt_ioq,
- gf_common_mt_transport_t,
- gf_common_mt_socket_local_t,
- gf_common_mt_char,
- gf_common_mt_rbthash_table_t,
- gf_common_mt_rbthash_bucket,
- gf_common_mt_mem_pool,
- gf_common_mt_long,
- gf_common_mt_rpcsvc_auth_list,
- gf_common_mt_rpcsvc_t,
- gf_common_mt_rpcsvc_conn_t,
- gf_common_mt_rpcsvc_program_t,
- gf_common_mt_rpcsvc_listener_t,
- gf_common_mt_rpcsvc_wrapper_t,
- gf_common_mt_rpcsvc_stage_t,
- gf_common_mt_rpcclnt_t,
- gf_common_mt_rpcclnt_savedframe_t,
- gf_common_mt_rpc_trans_t,
- gf_common_mt_rpc_trans_pollin_t,
- gf_common_mt_rpc_trans_handover_t,
- gf_common_mt_rpc_trans_reqinfo_t,
- gf_common_mt_rpc_trans_rsp_t,
- gf_common_mt_glusterfs_graph_t,
- gf_common_mt_rdma_private_t,
- gf_common_mt_rdma_ioq_t,
- gf_common_mt_rpc_transport_t,
- gf_common_mt_rdma_local_t,
- gf_common_mt_rdma_post_t,
- gf_common_mt_qpent,
- gf_common_mt_rdma_device_t,
- gf_common_mt_rdma_context_t,
- gf_common_mt_sge,
- gf_common_mt_rpcclnt_cb_program_t,
- gf_common_mt_libxl_marker_local,
- gf_common_mt_graph_buf,
- gf_common_mt_trie_trie,
- gf_common_mt_trie_data,
- gf_common_mt_trie_node,
- gf_common_mt_trie_buf,
- gf_common_mt_trie_end,
- gf_common_mt_run_argv,
- gf_common_mt_run_logbuf,
- gf_common_mt_fd_lk_ctx_t,
- gf_common_mt_fd_lk_ctx_node_t,
- gf_common_mt_buffer_t,
- gf_common_mt_circular_buffer_t,
- gf_common_mt_eh_t,
- gf_common_mt_store_handle_t,
- gf_common_mt_store_iter_t,
- gf_common_mt_drc_client_t,
- gf_common_mt_drc_globals_t,
- gf_common_mt_drc_rbtree_node_t,
- gf_common_mt_iov_base_t,
- gf_common_mt_groups_t,
- gf_common_mt_cliententry_t,
- gf_common_mt_clienttable_t,
- gf_common_mt_client_t,
- gf_common_mt_client_ctx,
- gf_common_mt_lock_table,
- gf_common_mt_locker,
- gf_common_mt_auxgids,
- gf_common_mt_syncopctx,
- gf_common_mt_iobrefs,
- gf_common_mt_gsync_status_t,
- gf_common_mt_uuid_t,
- gf_common_mt_mgmt_v3_lock_obj_t,
- gf_common_mt_txn_opinfo_obj_t,
- gf_common_mt_strfd_t,
- gf_common_mt_strfd_data_t,
- gf_common_mt_regex_t,
- gf_common_mt_ereg,
- gf_common_mt_wr,
- gf_common_mt_rdma_arena_mr,
- gf_common_mt_dnscache = 115,
- gf_common_mt_dnscache_entry = 116,
- gf_common_mt_parser_t,
- gf_common_quota_meta_t,
- /*related to gfdb library*/
- gfdb_mt_time_t,
- gf_mt_sql_cbk_args_t,
- gf_mt_gfdb_query_record_t,
- gf_mt_gfdb_link_info_t,
- gf_mt_gfdb_db_operations_t,
- gf_mt_sql_connection_t,
- gf_mt_sql_conn_node_t,
- gf_mt_db_conn_node_t,
- gf_mt_db_connection_t,
- gfdb_mt_db_record_t,
- /*related to gfdb library*/
- gf_common_mt_rbuf_t,
- gf_common_mt_rlist_t,
- gf_common_mt_rvec_t,
- /* glusterd can load the nfs-xlator dynamically and needs these two */
- gf_common_mt_nfs_netgroups,
- gf_common_mt_nfs_exports,
- gf_common_mt_gf_brick_spec_t,
- gf_common_mt_gf_timer_entry_t,
- gf_common_mt_int,
- gf_common_mt_pointer,
- gf_common_mt_synctask,
- gf_common_mt_syncstack,
- gf_common_mt_syncenv,
- gf_common_mt_scan_data,
- gf_common_list_node,
- gf_mt_default_args_t,
- gf_mt_default_args_cbk_t,
- /*used for compound fops*/
- gf_mt_compound_req_t,
- gf_mt_compound_rsp_t,
- gf_common_mt_tw_ctx,
- gf_common_mt_tw_timer_list,
- /*lock migration*/
- gf_common_mt_lock_mig,
- /* throttle */
- gf_common_mt_tbf_t,
- gf_common_mt_tbf_bucket_t,
- gf_common_mt_tbf_throttle_t,
- gf_common_mt_pthread_t,
- gf_common_ping_local_t,
- gf_common_volfile_t,
- gf_common_mt_mgmt_v3_lock_timer_t,
- gf_common_mt_server_cmdline_t,
- gf_common_mt_end
+ gf_common_mt_call_stub_t,
+ gf_common_mt_dnscache6,
+ gf_common_mt_data_pair_t,
+ gf_common_mt_data_t,
+ gf_common_mt_dict_t,
+ gf_common_mt_event_pool,
+ gf_common_mt_reg,
+ gf_common_mt_pollfd,
+ gf_common_mt_epoll_event,
+ gf_common_mt_fdentry_t,
+ gf_common_mt_fdtable_t,
+ gf_common_mt_fd_t,
+ gf_common_mt_fd_ctx,
+ gf_common_mt_gf_dirent_t,
+ gf_common_mt_glusterfs_ctx_t,
+ gf_common_mt_dentry_t,
+ gf_common_mt_inode_t,
+ gf_common_mt_inode_ctx,
+ gf_common_mt_list_head,
+ gf_common_mt_inode_table_t,
+ gf_common_mt_xlator_t,
+ gf_common_mt_xlator_list_t,
+ gf_common_mt_log_msg,
+ gf_common_mt_client_log,
+ gf_common_mt_volume_opt_list_t,
+ gf_common_mt_gf_hdr_common_t,
+ gf_common_mt_call_frame_t,
+ gf_common_mt_call_stack_t,
+ gf_common_mt_gf_timer_t,
+ gf_common_mt_gf_timer_registry_t,
+ gf_common_mt_transport,
+ gf_common_mt_transport_msg,
+ gf_common_mt_auth_handle_t,
+ gf_common_mt_iobuf,
+ gf_common_mt_iobuf_arena,
+ gf_common_mt_iobref,
+ gf_common_mt_iobuf_pool,
+ gf_common_mt_iovec,
+ gf_common_mt_memdup,
+ gf_common_mt_asprintf,
+ gf_common_mt_strdup,
+ gf_common_mt_socket_private_t,
+ gf_common_mt_ioq,
+ gf_common_mt_transport_t,
+ gf_common_mt_socket_local_t,
+ gf_common_mt_char,
+ gf_common_mt_rbthash_table_t,
+ gf_common_mt_rbthash_bucket,
+ gf_common_mt_mem_pool,
+ gf_common_mt_long,
+ gf_common_mt_rpcsvc_auth_list,
+ gf_common_mt_rpcsvc_t,
+ gf_common_mt_rpcsvc_conn_t,
+ gf_common_mt_rpcsvc_program_t,
+ gf_common_mt_rpcsvc_listener_t,
+ gf_common_mt_rpcsvc_wrapper_t,
+ gf_common_mt_rpcsvc_stage_t,
+ gf_common_mt_rpcclnt_t,
+ gf_common_mt_rpcclnt_savedframe_t,
+ gf_common_mt_rpc_trans_t,
+ gf_common_mt_rpc_trans_pollin_t,
+ gf_common_mt_rpc_trans_handover_t,
+ gf_common_mt_rpc_trans_reqinfo_t,
+ gf_common_mt_rpc_trans_rsp_t,
+ gf_common_mt_glusterfs_graph_t,
+ gf_common_mt_rdma_private_t,
+ gf_common_mt_rdma_ioq_t,
+ gf_common_mt_rpc_transport_t,
+ gf_common_mt_rdma_local_t,
+ gf_common_mt_rdma_post_t,
+ gf_common_mt_qpent,
+ gf_common_mt_rdma_device_t,
+ gf_common_mt_rdma_context_t,
+ gf_common_mt_sge,
+ gf_common_mt_rpcclnt_cb_program_t,
+ gf_common_mt_libxl_marker_local,
+ gf_common_mt_graph_buf,
+ gf_common_mt_trie_trie,
+ gf_common_mt_trie_data,
+ gf_common_mt_trie_node,
+ gf_common_mt_trie_buf,
+ gf_common_mt_trie_end,
+ gf_common_mt_run_argv,
+ gf_common_mt_run_logbuf,
+ gf_common_mt_fd_lk_ctx_t,
+ gf_common_mt_fd_lk_ctx_node_t,
+ gf_common_mt_buffer_t,
+ gf_common_mt_circular_buffer_t,
+ gf_common_mt_eh_t,
+ gf_common_mt_store_handle_t,
+ gf_common_mt_store_iter_t,
+ gf_common_mt_drc_client_t,
+ gf_common_mt_drc_globals_t,
+ gf_common_mt_drc_rbtree_node_t,
+ gf_common_mt_iov_base_t,
+ gf_common_mt_groups_t,
+ gf_common_mt_cliententry_t,
+ gf_common_mt_clienttable_t,
+ gf_common_mt_client_t,
+ gf_common_mt_client_ctx,
+ gf_common_mt_lock_table,
+ gf_common_mt_locker,
+ gf_common_mt_auxgids,
+ gf_common_mt_syncopctx,
+ gf_common_mt_iobrefs,
+ gf_common_mt_gsync_status_t,
+ gf_common_mt_uuid_t,
+ gf_common_mt_mgmt_v3_lock_obj_t,
+ gf_common_mt_txn_opinfo_obj_t,
+ gf_common_mt_strfd_t,
+ gf_common_mt_strfd_data_t,
+ gf_common_mt_regex_t,
+ gf_common_mt_ereg,
+ gf_common_mt_wr,
+ gf_common_mt_rdma_arena_mr,
+ gf_common_mt_dnscache = 115,
+ gf_common_mt_dnscache_entry = 116,
+ gf_common_mt_parser_t,
+ gf_common_quota_meta_t,
+ /*related to gfdb library*/
+ gfdb_mt_time_t,
+ gf_mt_sql_cbk_args_t,
+ gf_mt_gfdb_query_record_t,
+ gf_mt_gfdb_link_info_t,
+ gf_mt_gfdb_db_operations_t,
+ gf_mt_sql_connection_t,
+ gf_mt_sql_conn_node_t,
+ gf_mt_db_conn_node_t,
+ gf_mt_db_connection_t,
+ gfdb_mt_db_record_t,
+ /*related to gfdb library*/
+ gf_common_mt_rbuf_t,
+ gf_common_mt_rlist_t,
+ gf_common_mt_rvec_t,
+ /* glusterd can load the nfs-xlator dynamically and needs these two */
+ gf_common_mt_nfs_netgroups,
+ gf_common_mt_nfs_exports,
+ gf_common_mt_gf_brick_spec_t,
+ gf_common_mt_gf_timer_entry_t,
+ gf_common_mt_int,
+ gf_common_mt_pointer,
+ gf_common_mt_synctask,
+ gf_common_mt_syncstack,
+ gf_common_mt_syncenv,
+ gf_common_mt_scan_data,
+ gf_common_list_node,
+ gf_mt_default_args_t,
+ gf_mt_default_args_cbk_t,
+ /*used for compound fops*/
+ gf_mt_compound_req_t,
+ gf_mt_compound_rsp_t,
+ gf_common_mt_tw_ctx,
+ gf_common_mt_tw_timer_list,
+ /*lock migration*/
+ gf_common_mt_lock_mig,
+ /* throttle */
+ gf_common_mt_tbf_t,
+ gf_common_mt_tbf_bucket_t,
+ gf_common_mt_tbf_throttle_t,
+ gf_common_mt_pthread_t,
+ gf_common_ping_local_t,
+ gf_common_volfile_t,
+ gf_common_mt_mgmt_v3_lock_timer_t,
+ gf_common_mt_server_cmdline_t,
+ gf_common_mt_end
};
#endif
diff --git a/libglusterfs/src/monitoring.h b/libglusterfs/src/monitoring.h
index 1c08bfc7eb6..7826d4ec4df 100644
--- a/libglusterfs/src/monitoring.h
+++ b/libglusterfs/src/monitoring.h
@@ -16,6 +16,6 @@
#define GLUSTER_METRICS_DIR "/var/run/gluster/metrics"
char *
-gf_monitor_metrics (glusterfs_ctx_t *ctx);
+gf_monitor_metrics(glusterfs_ctx_t *ctx);
#endif /* __MONITORING_H__ */
diff --git a/libglusterfs/src/options.h b/libglusterfs/src/options.h
index 1ce8975e799..e47d7496a39 100644
--- a/libglusterfs/src/options.h
+++ b/libglusterfs/src/options.h
@@ -19,51 +19,50 @@
#include "libglusterfs-messages.h"
/* Add possible new type of option you may need */
typedef enum {
- GF_OPTION_TYPE_ANY = 0,
- GF_OPTION_TYPE_STR,
- GF_OPTION_TYPE_INT,
- GF_OPTION_TYPE_SIZET,
- GF_OPTION_TYPE_PERCENT,
- GF_OPTION_TYPE_PERCENT_OR_SIZET,
- GF_OPTION_TYPE_BOOL,
- GF_OPTION_TYPE_XLATOR,
- GF_OPTION_TYPE_PATH,
- GF_OPTION_TYPE_TIME,
- GF_OPTION_TYPE_DOUBLE,
- GF_OPTION_TYPE_INTERNET_ADDRESS,
- GF_OPTION_TYPE_INTERNET_ADDRESS_LIST,
- GF_OPTION_TYPE_PRIORITY_LIST,
- GF_OPTION_TYPE_SIZE_LIST,
- GF_OPTION_TYPE_CLIENT_AUTH_ADDR,
- GF_OPTION_TYPE_MAX,
+ GF_OPTION_TYPE_ANY = 0,
+ GF_OPTION_TYPE_STR,
+ GF_OPTION_TYPE_INT,
+ GF_OPTION_TYPE_SIZET,
+ GF_OPTION_TYPE_PERCENT,
+ GF_OPTION_TYPE_PERCENT_OR_SIZET,
+ GF_OPTION_TYPE_BOOL,
+ GF_OPTION_TYPE_XLATOR,
+ GF_OPTION_TYPE_PATH,
+ GF_OPTION_TYPE_TIME,
+ GF_OPTION_TYPE_DOUBLE,
+ GF_OPTION_TYPE_INTERNET_ADDRESS,
+ GF_OPTION_TYPE_INTERNET_ADDRESS_LIST,
+ GF_OPTION_TYPE_PRIORITY_LIST,
+ GF_OPTION_TYPE_SIZE_LIST,
+ GF_OPTION_TYPE_CLIENT_AUTH_ADDR,
+ GF_OPTION_TYPE_MAX,
} volume_option_type_t;
typedef enum {
- GF_OPT_VALIDATE_BOTH = 0,
- GF_OPT_VALIDATE_MIN,
- GF_OPT_VALIDATE_MAX,
+ GF_OPT_VALIDATE_BOTH = 0,
+ GF_OPT_VALIDATE_MIN,
+ GF_OPT_VALIDATE_MAX,
} opt_validate_type_t;
typedef enum {
- OPT_FLAG_NONE = 0,
- OPT_FLAG_SETTABLE = 1 << 0, /* can be set using volume set */
- OPT_FLAG_CLIENT_OPT = 1 << 1, /* affects clients */
- OPT_FLAG_GLOBAL = 1 << 2, /* affects all instances of the particular xlator */
- OPT_FLAG_FORCE = 1 << 3, /* needs force to be reset */
- OPT_FLAG_NEVER_RESET = 1 << 4, /* which should not be reset */
- OPT_FLAG_DOC = 1 << 5, /* can be shown in volume set help */
+ OPT_FLAG_NONE = 0,
+ OPT_FLAG_SETTABLE = 1 << 0, /* can be set using volume set */
+ OPT_FLAG_CLIENT_OPT = 1 << 1, /* affects clients */
+ OPT_FLAG_GLOBAL = 1
+ << 2, /* affects all instances of the particular xlator */
+ OPT_FLAG_FORCE = 1 << 3, /* needs force to be reset */
+ OPT_FLAG_NEVER_RESET = 1 << 4, /* which should not be reset */
+ OPT_FLAG_DOC = 1 << 5, /* can be shown in volume set help */
} opt_flags_t;
-
typedef enum {
- OPT_STATUS_ADVANCED = 0,
- OPT_STATUS_BASIC = 1,
- OPT_STATUS_EXPERIMENTAL = 2,
- OPT_STATUS_DEPRECATED = 3,
+ OPT_STATUS_ADVANCED = 0,
+ OPT_STATUS_BASIC = 1,
+ OPT_STATUS_EXPERIMENTAL = 2,
+ OPT_STATUS_DEPRECATED = 3,
} opt_level_t;
-
-#define ZR_VOLUME_MAX_NUM_KEY 4
+#define ZR_VOLUME_MAX_NUM_KEY 4
#define ZR_OPTION_MAX_ARRAY_SIZE 64
/* The maximum number of releases that an option could be backported to
* based on the release schedule as in August 2017 (3), plus one more
@@ -76,112 +75,115 @@ typedef enum {
* passing the volinfo is actually required. If it is, then we should possibly
* try a solution in GD2 for this.
*/
-/* typedef int (*option_validation_fn) (glusterd_volinfo_t *volinfo, dict_t *dict,
- char *key, char *value, char **op_errstr);
+/* typedef int (*option_validation_fn) (glusterd_volinfo_t *volinfo, dict_t
+ *dict, char *key, char *value, char **op_errstr);
*/
-
/* Each translator should define this structure */
/* XXX: This structure is in use by GD2, and SHOULD NOT be modified.
* If there is a need to add new members, add them to the end of the structure.
* If the struct must be modified, GD2 MUST be updated as well
*/
typedef struct volume_options {
- char *key[ZR_VOLUME_MAX_NUM_KEY];
- /* different key, same meaning */
- volume_option_type_t type;
- double min; /* 0 means no range */
- double max; /* 0 means no range */
- char *value[ZR_OPTION_MAX_ARRAY_SIZE];
- /* If specified, will check for one of
- the value from this array */
- char *default_value;
- char *description; /* about the key */
- /* Required for int options where only the min value
- * is given and is 0. This will cause validation not to
- * happen
- */
- opt_validate_type_t validate;
-
- /* The op-version at which this option was introduced.
- * This is an array to support options that get backported to supported
- * releases.
- * Normally, an option introduced for a major release just has a single
- * entry in the array, with op-version of the major release
- * For an option that is backported, the op-versions of the all the
- * releases it was ported to should be added, starting from the newest,
- * to the oldest.
- */
- uint32_t op_version[GF_MAX_RELEASES];
- /* The op-version at which this option was deprecated.
- * Follows the same rules as above.
- */
- uint32_t deprecated[GF_MAX_RELEASES];
- /* Additional flags for an option
- * Check the OPT_FLAG_* enums for available flags
- */
- uint32_t flags;
- /* Tags applicable to this option, which can be used to group similar
- * options
- */
- char *tags[ZR_OPTION_MAX_ARRAY_SIZE];
- /* A custom validation function if required
- * TODO: See todo above for option_validation_fn
- */
- /* option_validation_fn validate_fn; */
- /* This is actual key that should be set in the options dict. Can
- * contain varstrings
- */
- char *setkey;
-
- /* A 'level' is about the technical depth / understanding one
- needs to handle the option. 'category' is based on
- quality (ie, tests, people behind it, documentation available) */
-
- /* The level at which the option is classified */
- opt_level_t level;
-
- /* Flag to understand how this option is categorized */
- gf_category_t category;
+ char *key[ZR_VOLUME_MAX_NUM_KEY];
+ /* different key, same meaning */
+ volume_option_type_t type;
+ double min; /* 0 means no range */
+ double max; /* 0 means no range */
+ char *value[ZR_OPTION_MAX_ARRAY_SIZE];
+ /* If specified, will check for one of
+ the value from this array */
+ char *default_value;
+ char *description; /* about the key */
+ /* Required for int options where only the min value
+ * is given and is 0. This will cause validation not to
+ * happen
+ */
+ opt_validate_type_t validate;
+
+ /* The op-version at which this option was introduced.
+ * This is an array to support options that get backported to supported
+ * releases.
+ * Normally, an option introduced for a major release just has a single
+ * entry in the array, with op-version of the major release
+ * For an option that is backported, the op-versions of the all the
+ * releases it was ported to should be added, starting from the newest,
+ * to the oldest.
+ */
+ uint32_t op_version[GF_MAX_RELEASES];
+ /* The op-version at which this option was deprecated.
+ * Follows the same rules as above.
+ */
+ uint32_t deprecated[GF_MAX_RELEASES];
+ /* Additional flags for an option
+ * Check the OPT_FLAG_* enums for available flags
+ */
+ uint32_t flags;
+ /* Tags applicable to this option, which can be used to group similar
+ * options
+ */
+ char *tags[ZR_OPTION_MAX_ARRAY_SIZE];
+ /* A custom validation function if required
+ * TODO: See todo above for option_validation_fn
+ */
+ /* option_validation_fn validate_fn; */
+ /* This is actual key that should be set in the options dict. Can
+ * contain varstrings
+ */
+ char *setkey;
+
+ /* A 'level' is about the technical depth / understanding one
+ needs to handle the option. 'category' is based on
+ quality (ie, tests, people behind it, documentation available) */
+
+ /* The level at which the option is classified */
+ opt_level_t level;
+
+ /* Flag to understand how this option is categorized */
+ gf_category_t category;
} volume_option_t;
-
typedef struct vol_opt_list {
- struct list_head list;
- volume_option_t *given_opt;
+ struct list_head list;
+ volume_option_t *given_opt;
} volume_opt_list_t;
-
-int xlator_tree_reconfigure (xlator_t *old_xl, xlator_t *new_xl);
-int xlator_validate_rec (xlator_t *xlator, char **op_errstr);
-int graph_reconf_validateopt (glusterfs_graph_t *graph, char **op_errstr);
-int xlator_option_info_list (volume_opt_list_t *list, char *key,
- char **def_val, char **descr);
+int
+xlator_tree_reconfigure(xlator_t *old_xl, xlator_t *new_xl);
+int
+xlator_validate_rec(xlator_t *xlator, char **op_errstr);
+int
+graph_reconf_validateopt(glusterfs_graph_t *graph, char **op_errstr);
+int
+xlator_option_info_list(volume_opt_list_t *list, char *key, char **def_val,
+ char **descr);
/*
int validate_xlator_volume_options (xlator_t *xl, dict_t *options,
volume_option_t *opt, char **op_errstr);
*/
-int xlator_options_validate_list (xlator_t *xl, dict_t *options,
- volume_opt_list_t *list, char **op_errstr);
-int xlator_option_validate (xlator_t *xl, char *key, char *value,
- volume_option_t *opt, char **op_errstr);
-int xlator_options_validate (xlator_t *xl, dict_t *options, char **errstr);
-
-int xlator_option_validate_addr_list (xlator_t *xl, const char *key,
- const char *value, volume_option_t *opt,
- char **op_errstr);
+int
+xlator_options_validate_list(xlator_t *xl, dict_t *options,
+ volume_opt_list_t *list, char **op_errstr);
+int
+xlator_option_validate(xlator_t *xl, char *key, char *value,
+ volume_option_t *opt, char **op_errstr);
+int
+xlator_options_validate(xlator_t *xl, dict_t *options, char **errstr);
+
+int
+xlator_option_validate_addr_list(xlator_t *xl, const char *key,
+ const char *value, volume_option_t *opt,
+ char **op_errstr);
volume_option_t *
-xlator_volume_option_get (xlator_t *xl, const char *key);
+xlator_volume_option_get(xlator_t *xl, const char *key);
volume_option_t *
-xlator_volume_option_get_list (volume_opt_list_t *vol_list, const char *key);
+xlator_volume_option_get_list(volume_opt_list_t *vol_list, const char *key);
-
-#define DECLARE_INIT_OPT(type_t, type) \
-int \
-xlator_option_init_##type (xlator_t *this, dict_t *options, char *key, \
- type_t *val_p);
+#define DECLARE_INIT_OPT(type_t, type) \
+ int xlator_option_init_##type(xlator_t *this, dict_t *options, char *key, \
+ type_t *val_p);
DECLARE_INIT_OPT(char *, str);
DECLARE_INIT_OPT(uint64_t, uint64);
@@ -198,76 +200,71 @@ DECLARE_INIT_OPT(char *, path);
DECLARE_INIT_OPT(double, double);
DECLARE_INIT_OPT(uint32_t, time);
-
-#define DEFINE_INIT_OPT(type_t, type, conv) \
-int \
-xlator_option_init_##type (xlator_t *this, dict_t *options, char *key, \
- type_t *val_p) \
-{ \
- int ret = 0; \
- volume_option_t *opt = NULL; \
- char *def_value = NULL; \
- char *set_value = NULL; \
- char *value = NULL; \
- xlator_t *old_THIS = NULL; \
- \
- opt = xlator_volume_option_get (this, key); \
- if (!opt) { \
- gf_msg (this->name, GF_LOG_WARNING, EINVAL, \
- LG_MSG_INVALID_ENTRY, \
- "unknown option: %s", key); \
- ret = -1; \
- return ret; \
- } \
- def_value = opt->default_value; \
- ret = dict_get_str (options, key, &set_value); \
- \
- if (def_value) \
- value = def_value; \
- if (set_value) \
- value = set_value; \
- if (!value) { \
- gf_msg_trace (this->name, 0, "option %s not set", \
- key); \
- *val_p = (type_t)0; \
- return 0; \
- } \
- if (value == def_value) { \
- gf_msg_trace (this->name, 0, "option %s using default" \
- " value %s", key, value); \
- } else { \
- gf_msg_debug (this->name, 0, "option %s using set" \
- " value %s", key, value); \
- } \
- old_THIS = THIS; \
- THIS = this; \
- ret = conv (value, val_p); \
- THIS = old_THIS; \
- if (ret) { \
- gf_msg (this->name, GF_LOG_INFO, 0, \
- LG_MSG_CONVERSION_FAILED, \
- "option %s conversion failed value %s", \
- key, value); \
- return ret; \
- } \
- ret = xlator_option_validate (this, key, value, opt, NULL); \
- return ret; \
-}
-
-#define GF_OPTION_INIT(key, val, type, err_label) do { \
- int val_ret = 0; \
- val_ret = xlator_option_init_##type (THIS, THIS->options, \
- key, &(val)); \
- if (val_ret) \
- goto err_label; \
- } while (0)
-
-
-
-#define DECLARE_RECONF_OPT(type_t, type) \
-int \
-xlator_option_reconf_##type (xlator_t *this, dict_t *options, char *key,\
- type_t *val_p);
+#define DEFINE_INIT_OPT(type_t, type, conv) \
+ int xlator_option_init_##type(xlator_t *this, dict_t *options, char *key, \
+ type_t *val_p) \
+ { \
+ int ret = 0; \
+ volume_option_t *opt = NULL; \
+ char *def_value = NULL; \
+ char *set_value = NULL; \
+ char *value = NULL; \
+ xlator_t *old_THIS = NULL; \
+ \
+ opt = xlator_volume_option_get(this, key); \
+ if (!opt) { \
+ gf_msg(this->name, GF_LOG_WARNING, EINVAL, LG_MSG_INVALID_ENTRY, \
+ "unknown option: %s", key); \
+ ret = -1; \
+ return ret; \
+ } \
+ def_value = opt->default_value; \
+ ret = dict_get_str(options, key, &set_value); \
+ \
+ if (def_value) \
+ value = def_value; \
+ if (set_value) \
+ value = set_value; \
+ if (!value) { \
+ gf_msg_trace(this->name, 0, "option %s not set", key); \
+ *val_p = (type_t)0; \
+ return 0; \
+ } \
+ if (value == def_value) { \
+ gf_msg_trace(this->name, 0, \
+ "option %s using default" \
+ " value %s", \
+ key, value); \
+ } else { \
+ gf_msg_debug(this->name, 0, \
+ "option %s using set" \
+ " value %s", \
+ key, value); \
+ } \
+ old_THIS = THIS; \
+ THIS = this; \
+ ret = conv(value, val_p); \
+ THIS = old_THIS; \
+ if (ret) { \
+ gf_msg(this->name, GF_LOG_INFO, 0, LG_MSG_CONVERSION_FAILED, \
+ "option %s conversion failed value %s", key, value); \
+ return ret; \
+ } \
+ ret = xlator_option_validate(this, key, value, opt, NULL); \
+ return ret; \
+ }
+
+#define GF_OPTION_INIT(key, val, type, err_label) \
+ do { \
+ int val_ret = 0; \
+ val_ret = xlator_option_init_##type(THIS, THIS->options, key, &(val)); \
+ if (val_ret) \
+ goto err_label; \
+ } while (0)
+
+#define DECLARE_RECONF_OPT(type_t, type) \
+ int xlator_option_reconf_##type(xlator_t *this, dict_t *options, \
+ char *key, type_t *val_p);
DECLARE_RECONF_OPT(char *, str);
DECLARE_RECONF_OPT(uint64_t, uint64);
@@ -284,65 +281,59 @@ DECLARE_RECONF_OPT(char *, path);
DECLARE_RECONF_OPT(double, double);
DECLARE_RECONF_OPT(uint32_t, time);
-
-#define DEFINE_RECONF_OPT(type_t, type, conv) \
-int \
-xlator_option_reconf_##type (xlator_t *this, dict_t *options, char *key, \
- type_t *val_p) \
-{ \
- int ret = 0; \
- volume_option_t *opt = NULL; \
- char *def_value = NULL; \
- char *set_value = NULL; \
- char *value = NULL; \
- xlator_t *old_THIS = NULL; \
- \
- opt = xlator_volume_option_get (this, key); \
- if (!opt) { \
- gf_msg (this->name, GF_LOG_WARNING, EINVAL, \
- LG_MSG_INVALID_ENTRY, \
- "unknown option: %s", key); \
- ret = -1; \
- return ret; \
- } \
- def_value = opt->default_value; \
- ret = dict_get_str (options, key, &set_value); \
- \
- if (def_value) \
- value = def_value; \
- if (set_value) \
- value = set_value; \
- if (!value) { \
- gf_msg_trace (this->name, 0, "option %s not set", key); \
- *val_p = (type_t)0; \
- return 0; \
- } \
- if (value == def_value) { \
- gf_msg_trace (this->name, 0, \
- "option %s using default value %s", \
- key, value); \
- } else { \
- gf_msg (this->name, GF_LOG_INFO, 0, 0, \
- "option %s using set value %s", \
- key, value); \
- } \
- old_THIS = THIS; \
- THIS = this; \
- ret = conv (value, val_p); \
- THIS = old_THIS; \
- if (ret) \
- return ret; \
- ret = xlator_option_validate (this, key, value, opt, NULL); \
- return ret; \
-}
-
-#define GF_OPTION_RECONF(key, val, opt, type, err_label) do { \
- int val_ret = 0; \
- val_ret = xlator_option_reconf_##type (THIS, opt, key, \
- &(val)); \
- if (val_ret) \
- goto err_label; \
- } while (0)
-
+#define DEFINE_RECONF_OPT(type_t, type, conv) \
+ int xlator_option_reconf_##type(xlator_t *this, dict_t *options, \
+ char *key, type_t *val_p) \
+ { \
+ int ret = 0; \
+ volume_option_t *opt = NULL; \
+ char *def_value = NULL; \
+ char *set_value = NULL; \
+ char *value = NULL; \
+ xlator_t *old_THIS = NULL; \
+ \
+ opt = xlator_volume_option_get(this, key); \
+ if (!opt) { \
+ gf_msg(this->name, GF_LOG_WARNING, EINVAL, LG_MSG_INVALID_ENTRY, \
+ "unknown option: %s", key); \
+ ret = -1; \
+ return ret; \
+ } \
+ def_value = opt->default_value; \
+ ret = dict_get_str(options, key, &set_value); \
+ \
+ if (def_value) \
+ value = def_value; \
+ if (set_value) \
+ value = set_value; \
+ if (!value) { \
+ gf_msg_trace(this->name, 0, "option %s not set", key); \
+ *val_p = (type_t)0; \
+ return 0; \
+ } \
+ if (value == def_value) { \
+ gf_msg_trace(this->name, 0, "option %s using default value %s", \
+ key, value); \
+ } else { \
+ gf_msg(this->name, GF_LOG_INFO, 0, 0, \
+ "option %s using set value %s", key, value); \
+ } \
+ old_THIS = THIS; \
+ THIS = this; \
+ ret = conv(value, val_p); \
+ THIS = old_THIS; \
+ if (ret) \
+ return ret; \
+ ret = xlator_option_validate(this, key, value, opt, NULL); \
+ return ret; \
+ }
+
+#define GF_OPTION_RECONF(key, val, opt, type, err_label) \
+ do { \
+ int val_ret = 0; \
+ val_ret = xlator_option_reconf_##type(THIS, opt, key, &(val)); \
+ if (val_ret) \
+ goto err_label; \
+ } while (0)
#endif /* !_OPTIONS_H */
diff --git a/libglusterfs/src/parse-utils.h b/libglusterfs/src/parse-utils.h
index 275ccf3153b..8653b9dd180 100644
--- a/libglusterfs/src/parse-utils.h
+++ b/libglusterfs/src/parse-utils.h
@@ -20,31 +20,31 @@
#define GF_PARSE "parse-utils"
struct parser {
- regex_t preg; /* Compiled regex */
- regmatch_t pmatch[1]; /* The match */
- char *complete_str; /* The string we are parsing */
- char *regex; /* Regex used to parse the string */
- char *_rstr; /* Temp string to hold offsets */
+ regex_t preg; /* Compiled regex */
+ regmatch_t pmatch[1]; /* The match */
+ char *complete_str; /* The string we are parsing */
+ char *regex; /* Regex used to parse the string */
+ char *_rstr; /* Temp string to hold offsets */
};
/* Initializes some of the parsers variables */
struct parser *
-parser_init (const char *regex);
+parser_init(const char *regex);
/* Sets the string to parse */
int
-parser_set_string (struct parser *parser, const char *complete_str);
+parser_set_string(struct parser *parser, const char *complete_str);
/* Frees memory used by the string after all matches are found */
int
-parser_unset_string (struct parser *parser);
+parser_unset_string(struct parser *parser);
/* Free memory used by the parser */
void
-parser_deinit (struct parser *ptr);
+parser_deinit(struct parser *ptr);
/* Get the next matching string */
char *
-parser_get_next_match (struct parser *parser);
+parser_get_next_match(struct parser *parser);
#endif /* _PARSE_UTILS_H */
diff --git a/libglusterfs/src/quota-common-utils.h b/libglusterfs/src/quota-common-utils.h
index e479398c398..7c3ce498427 100644
--- a/libglusterfs/src/quota-common-utils.h
+++ b/libglusterfs/src/quota-common-utils.h
@@ -14,55 +14,53 @@
#include "iatt.h"
#define GF_QUOTA_CONF_VERSION 1.2
-#define QUOTA_CONF_HEADER \
- "GlusterFS Quota conf | version: v1.2\n"
-#define QUOTA_CONF_HEADER_1_1 \
- "GlusterFS Quota conf | version: v1.1\n"
+#define QUOTA_CONF_HEADER "GlusterFS Quota conf | version: v1.2\n"
+#define QUOTA_CONF_HEADER_1_1 "GlusterFS Quota conf | version: v1.1\n"
typedef enum {
- GF_QUOTA_CONF_TYPE_USAGE = 1,
- GF_QUOTA_CONF_TYPE_OBJECTS
+ GF_QUOTA_CONF_TYPE_USAGE = 1,
+ GF_QUOTA_CONF_TYPE_OBJECTS
} gf_quota_conf_type_t;
struct _quota_limits {
- int64_t hl;
- int64_t sl;
-} __attribute__ ((__packed__));
+ int64_t hl;
+ int64_t sl;
+} __attribute__((__packed__));
typedef struct _quota_limits quota_limits_t;
struct _quota_meta {
- int64_t size;
- int64_t file_count;
- int64_t dir_count;
-} __attribute__ ((__packed__));
+ int64_t size;
+ int64_t file_count;
+ int64_t dir_count;
+} __attribute__((__packed__));
typedef struct _quota_meta quota_meta_t;
gf_boolean_t
-quota_meta_is_null (const quota_meta_t *meta);
+quota_meta_is_null(const quota_meta_t *meta);
int32_t
-quota_data_to_meta (data_t *data, char *key, quota_meta_t *meta);
+quota_data_to_meta(data_t *data, char *key, quota_meta_t *meta);
int32_t
-quota_dict_get_inode_meta (dict_t *dict, char *key, quota_meta_t *meta);
+quota_dict_get_inode_meta(dict_t *dict, char *key, quota_meta_t *meta);
int32_t
-quota_dict_get_meta (dict_t *dict, char *key, quota_meta_t *meta);
+quota_dict_get_meta(dict_t *dict, char *key, quota_meta_t *meta);
int32_t
-quota_dict_set_meta (dict_t *dict, char *key, const quota_meta_t *meta,
- ia_type_t ia_type);
+quota_dict_set_meta(dict_t *dict, char *key, const quota_meta_t *meta,
+ ia_type_t ia_type);
int32_t
-quota_conf_read_header (int fd, char *buf);
+quota_conf_read_header(int fd, char *buf);
int32_t
-quota_conf_read_version (int fd, float *version);
+quota_conf_read_version(int fd, float *version);
int32_t
-quota_conf_read_gfid (int fd, void *buf, char *type, float version);
+quota_conf_read_gfid(int fd, void *buf, char *type, float version);
int32_t
-quota_conf_skip_header (int fd);
+quota_conf_skip_header(int fd);
#endif /* _QUOTA_COMMON_UTILS_H */
diff --git a/libglusterfs/src/rbthash.h b/libglusterfs/src/rbthash.h
index 949b88a4380..dea4648ca5a 100644
--- a/libglusterfs/src/rbthash.h
+++ b/libglusterfs/src/rbthash.h
@@ -19,59 +19,59 @@
#include <pthread.h>
-#define GF_RBTHASH_MEMPOOL 16384 //1048576
-#define GF_RBTHASH "rbthash"
+#define GF_RBTHASH_MEMPOOL 16384 // 1048576
+#define GF_RBTHASH "rbthash"
struct rbthash_bucket {
- struct rb_table *bucket;
- gf_lock_t bucketlock;
+ struct rb_table *bucket;
+ gf_lock_t bucketlock;
};
typedef struct rbthash_entry {
- void *data;
- void *key;
- int keylen;
- uint32_t keyhash;
- struct list_head list;
+ void *data;
+ void *key;
+ int keylen;
+ uint32_t keyhash;
+ struct list_head list;
} rbthash_entry_t;
-typedef uint32_t (*rbt_hasher_t) (void *data, int len);
-typedef void (*rbt_data_destroyer_t) (void *data);
-typedef void (*rbt_traverse_t) (void *data, void *mydata);
+typedef uint32_t (*rbt_hasher_t)(void *data, int len);
+typedef void (*rbt_data_destroyer_t)(void *data);
+typedef void (*rbt_traverse_t)(void *data, void *mydata);
typedef struct rbthash_table {
- int size;
- int numbuckets;
- struct mem_pool *entrypool;
- gf_lock_t tablelock;
- struct rbthash_bucket *buckets;
- rbt_hasher_t hashfunc;
- rbt_data_destroyer_t dfunc;
- gf_boolean_t pool_alloced;
- struct list_head list;
+ int size;
+ int numbuckets;
+ struct mem_pool *entrypool;
+ gf_lock_t tablelock;
+ struct rbthash_bucket *buckets;
+ rbt_hasher_t hashfunc;
+ rbt_data_destroyer_t dfunc;
+ gf_boolean_t pool_alloced;
+ struct list_head list;
} rbthash_table_t;
extern rbthash_table_t *
-rbthash_table_init (glusterfs_ctx_t *ctx, int buckets, rbt_hasher_t hfunc,
- rbt_data_destroyer_t dfunc, unsigned long expected_entries,
- struct mem_pool *entrypool);
+rbthash_table_init(glusterfs_ctx_t *ctx, int buckets, rbt_hasher_t hfunc,
+ rbt_data_destroyer_t dfunc, unsigned long expected_entries,
+ struct mem_pool *entrypool);
extern int
-rbthash_insert (rbthash_table_t *tbl, void *data, void *key, int keylen);
+rbthash_insert(rbthash_table_t *tbl, void *data, void *key, int keylen);
extern void *
-rbthash_get (rbthash_table_t *tbl, void *key, int keylen);
+rbthash_get(rbthash_table_t *tbl, void *key, int keylen);
extern void *
-rbthash_remove (rbthash_table_t *tbl, void *key, int keylen);
+rbthash_remove(rbthash_table_t *tbl, void *key, int keylen);
extern void *
-rbthash_replace (rbthash_table_t *tbl, void *key, int keylen, void *newdata);
+rbthash_replace(rbthash_table_t *tbl, void *key, int keylen, void *newdata);
extern void
-rbthash_table_destroy (rbthash_table_t *tbl);
+rbthash_table_destroy(rbthash_table_t *tbl);
extern void
-rbthash_table_traverse (rbthash_table_t *tbl, rbt_traverse_t traverse,
- void *mydata);
+rbthash_table_traverse(rbthash_table_t *tbl, rbt_traverse_t traverse,
+ void *mydata);
#endif
diff --git a/libglusterfs/src/refcount.h b/libglusterfs/src/refcount.h
index 2186c155607..6a3a73d80e8 100644
--- a/libglusterfs/src/refcount.h
+++ b/libglusterfs/src/refcount.h
@@ -17,7 +17,8 @@
* http://lists.iptel.org/pipermail/semsdev/2010-October/005075.html
* this is sufficient for RHEL5 i386 builds
*/
-#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) && !defined(__i386__)
+#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) && \
+ !defined(__i386__)
#undef REFCOUNT_NEEDS_LOCK
#else
#define REFCOUNT_NEEDS_LOCK
@@ -28,22 +29,21 @@ typedef void (*gf_ref_release_t)(void *data);
struct _gf_ref {
#ifdef REFCOUNT_NEEDS_LOCK
- gf_lock_t lk; /* lock for atomically adjust cnt */
+ gf_lock_t lk; /* lock for atomically adjust cnt */
#endif
- unsigned int cnt; /* number of users, free on 0 */
+ unsigned int cnt; /* number of users, free on 0 */
- gf_ref_release_t release; /* cleanup when cnt == 0 */
- void *data; /* parameter passed to release() */
+ gf_ref_release_t release; /* cleanup when cnt == 0 */
+ void *data; /* parameter passed to release() */
};
typedef struct _gf_ref gf_ref_t;
-
/* _gf_ref_get -- increase the refcount
*
* @return: greater then 0 when a reference was taken, 0 when not
*/
void *
-_gf_ref_get (gf_ref_t *ref);
+_gf_ref_get(gf_ref_t *ref);
/* _gf_ref_put -- decrease the refcount
*
@@ -51,7 +51,7 @@ _gf_ref_get (gf_ref_t *ref);
* should be done, gf_ref_release_t is called on cleanup
*/
unsigned int
-_gf_ref_put (gf_ref_t *ref);
+_gf_ref_put(gf_ref_t *ref);
/* _gf_ref_init -- initialize an embedded refcount object
*
@@ -59,8 +59,7 @@ _gf_ref_put (gf_ref_t *ref);
* @data: parameter to be passed to @release
*/
void
-_gf_ref_init (gf_ref_t *ref, gf_ref_release_t release, void *data);
-
+_gf_ref_init(gf_ref_t *ref, gf_ref_release_t release, void *data);
/*
* Strong suggestion to use the simplified GF_REF_* API.
@@ -75,7 +74,7 @@ _gf_ref_init (gf_ref_t *ref, gf_ref_release_t release, void *data);
* ... // additional members
* };
*/
-#define GF_REF_DECL gf_ref_t _ref
+#define GF_REF_DECL gf_ref_t _ref
/* GF_REF_INIT -- initialize a GF_REF_DECL structure
*
@@ -84,20 +83,19 @@ _gf_ref_init (gf_ref_t *ref, gf_ref_release_t release, void *data);
*
* Sets the refcount to 1.
*/
-#define GF_REF_INIT(p, d) _gf_ref_init (&(p)->_ref, (gf_ref_release_t) d, p)
+#define GF_REF_INIT(p, d) _gf_ref_init(&(p)->_ref, (gf_ref_release_t)d, p)
/* GF_REF_GET -- increase the refcount of a GF_REF_DECL structure
*
* @return: greater then 0 when a reference was taken, 0 when not
*/
-#define GF_REF_GET(p) _gf_ref_get (&(p)->_ref)
+#define GF_REF_GET(p) _gf_ref_get(&(p)->_ref)
/* GF_REF_PUT -- decrease the refcount of a GF_REF_DECL structure
*
* @return: greater then 0 when there are still references, 0 when cleanup
* should be done, gf_ref_release_t is called on cleanup
*/
-#define GF_REF_PUT(p) _gf_ref_put (&(p)->_ref)
-
+#define GF_REF_PUT(p) _gf_ref_put(&(p)->_ref)
#endif /* _REFCOUNT_H */
diff --git a/libglusterfs/src/rot-buffs.h b/libglusterfs/src/rot-buffs.h
index 8ee5271533e..1e91e83ecf0 100644
--- a/libglusterfs/src/rot-buffs.h
+++ b/libglusterfs/src/rot-buffs.h
@@ -16,106 +16,110 @@
#include "common-utils.h"
typedef struct rbuf_iovec {
- struct iovec iov;
+ struct iovec iov;
- struct list_head list;
+ struct list_head list;
} rbuf_iovec_t;
-#define RBUF_IOVEC_SIZE (sizeof (rbuf_iovec_t))
+#define RBUF_IOVEC_SIZE (sizeof(rbuf_iovec_t))
typedef struct rbuf_list {
- gf_lock_t c_lock;
+ gf_lock_t c_lock;
- pthread_mutex_t b_lock; /* protects this structure */
- pthread_cond_t b_cond; /* signal for writer completion */
+ pthread_mutex_t b_lock; /* protects this structure */
+ pthread_cond_t b_cond; /* signal for writer completion */
- gf_boolean_t awaiting;
+ gf_boolean_t awaiting;
- unsigned long long pending; /* pending writers */
- unsigned long long completed; /* completed writers */
+ unsigned long long pending; /* pending writers */
+ unsigned long long completed; /* completed writers */
- rbuf_iovec_t *rvec; /* currently used IO vector */
+ rbuf_iovec_t *rvec; /* currently used IO vector */
- struct list_head veclist; /* list of attached rbuf_iov */
+ struct list_head veclist; /* list of attached rbuf_iov */
- unsigned long long used; /* consumable entries
- attached in ->veclist */
- unsigned long long total; /* total entries in ->veclist (used
- during deallocation) */
+ unsigned long long used; /* consumable entries
+ attached in ->veclist */
+ unsigned long long total; /* total entries in ->veclist (used
+ during deallocation) */
- unsigned long seq[2]; /* if interested, this whould store
- the start sequence number and the
- range */
+ unsigned long seq[2]; /* if interested, this whould store
+ the start sequence number and the
+ range */
- struct list_head list; /* attachment to rbuf_t */
+ struct list_head list; /* attachment to rbuf_t */
} rbuf_list_t;
struct rlist_iter {
- struct list_head veclist;
+ struct list_head veclist;
- unsigned long long iter;
+ unsigned long long iter;
};
-#define RLIST_ENTRY_COUNT(rlist) rlist->used
+#define RLIST_ENTRY_COUNT(rlist) rlist->used
-#define rlist_iter_init(riter, rlist) \
- do { \
- (riter)->iter = rlist->used; \
- (riter)->veclist = rlist->veclist; \
- } while (0)
+#define rlist_iter_init(riter, rlist) \
+ do { \
+ (riter)->iter = rlist->used; \
+ (riter)->veclist = rlist->veclist; \
+ } while (0)
-#define rvec_for_each_entry(pos, riter) \
- for (pos = list_entry \
- ((riter)->veclist.next, typeof(*pos), list); \
- (riter)->iter > 0; \
- pos = list_entry \
- (pos->list.next, typeof(*pos), list), \
- --((riter)->iter))
+#define rvec_for_each_entry(pos, riter) \
+ for (pos = list_entry((riter)->veclist.next, typeof(*pos), list); \
+ (riter)->iter > 0; \
+ pos = list_entry(pos->list.next, typeof(*pos), list), \
+ --((riter)->iter))
/**
* Sequence number assignment routine is called during buffer
* switch under rbuff ->lock.
*/
-typedef void (sequence_fn) (rbuf_list_t *, void *);
+typedef void(sequence_fn)(rbuf_list_t *, void *);
-#define RLIST_STORE_SEQ(rlist, start, range) \
- do { \
- rlist->seq[0] = start; \
- rlist->seq[1] = range; \
- } while (0)
+#define RLIST_STORE_SEQ(rlist, start, range) \
+ do { \
+ rlist->seq[0] = start; \
+ rlist->seq[1] = range; \
+ } while (0)
-#define RLIST_GET_SEQ(rlist, start, range) \
- do { \
- start = rlist->seq[0]; \
- range = rlist->seq[1]; \
- } while (0)
+#define RLIST_GET_SEQ(rlist, start, range) \
+ do { \
+ start = rlist->seq[0]; \
+ range = rlist->seq[1]; \
+ } while (0)
typedef struct rbuf {
- gf_lock_t lock; /* protects "current" rlist */
+ gf_lock_t lock; /* protects "current" rlist */
- rbuf_list_t *current; /* cached pointer to first free rlist */
+ rbuf_list_t *current; /* cached pointer to first free rlist */
- struct list_head freelist;
+ struct list_head freelist;
} rbuf_t;
typedef enum {
- RBUF_CONSUMABLE = 1,
- RBUF_BUSY,
- RBUF_EMPTY,
- RBUF_WOULD_STARVE,
+ RBUF_CONSUMABLE = 1,
+ RBUF_BUSY,
+ RBUF_EMPTY,
+ RBUF_WOULD_STARVE,
} rlist_retval_t;
/* Initialization/Destruction */
-rbuf_t *rbuf_init (int);
-void rbuf_dtor (rbuf_t *);
+rbuf_t *
+rbuf_init(int);
+void
+rbuf_dtor(rbuf_t *);
/* Producer API */
-char *rbuf_reserve_write_area (rbuf_t *, size_t, void **);
-int rbuf_write_complete (void *);
+char *
+rbuf_reserve_write_area(rbuf_t *, size_t, void **);
+int
+rbuf_write_complete(void *);
/* Consumer API */
-int rbuf_get_buffer (rbuf_t *, void **, sequence_fn *, void *);
-int rbuf_wait_for_completion (rbuf_t *, void *,
- void (*)(rbuf_list_t *, void *), void *);
+int
+rbuf_get_buffer(rbuf_t *, void **, sequence_fn *, void *);
+int
+rbuf_wait_for_completion(rbuf_t *, void *, void (*)(rbuf_list_t *, void *),
+ void *);
#endif
diff --git a/libglusterfs/src/run.h b/libglusterfs/src/run.h
index 1dc4bf9f1b0..dd19972d07e 100644
--- a/libglusterfs/src/run.h
+++ b/libglusterfs/src/run.h
@@ -14,12 +14,12 @@
#define RUN_PIPE -1
struct runner {
- char **argv;
- unsigned argvlen;
- int runerr;
- pid_t chpid;
- int chfd[3];
- FILE *chio[3];
+ char **argv;
+ unsigned argvlen;
+ int runerr;
+ pid_t chpid;
+ int chfd[3];
+ FILE *chio[3];
};
typedef struct runner runner_t;
@@ -29,7 +29,8 @@ typedef struct runner runner_t;
*
* @param runner pointer to runner_t instance
*/
-void runinit (runner_t *runner);
+void
+runinit(runner_t *runner);
/**
* get FILE pointer to which child's stdio is redirected.
@@ -40,7 +41,8 @@ void runinit (runner_t *runner);
*
* @see runner_redir()
*/
-FILE *runner_chio (runner_t *runner, int fd);
+FILE *
+runner_chio(runner_t *runner, int fd);
/**
* add an argument.
@@ -52,7 +54,8 @@ FILE *runner_chio (runner_t *runner, int fd);
* @param runner pointer to runner_t instance
* @param arg command line argument
*/
-void runner_add_arg (runner_t *runner, const char *arg);
+void
+runner_add_arg(runner_t *runner, const char *arg);
/**
* add a sequence of arguments.
@@ -66,7 +69,8 @@ void runner_add_arg (runner_t *runner, const char *arg);
*
* @see runner_add_arg()
*/
-void runner_add_args (runner_t *runner, ...);
+void
+runner_add_args(runner_t *runner, ...);
/**
* add an argument with printf style formatting.
@@ -76,7 +80,8 @@ void runner_add_args (runner_t *runner, ...);
* @param runner pointer to runner_t instance
* @param format printf style format specifier
*/
-void runner_argprintf (runner_t *runner, const char *format, ...);
+void
+runner_argprintf(runner_t *runner, const char *format, ...);
/**
* log a message about the command to be run.
@@ -89,8 +94,9 @@ void runner_argprintf (runner_t *runner, const char *format, ...);
*
* @see gf_log()
*/
-void runner_log (runner_t *runner, const char *dom, gf_loglevel_t lvl,
- const char *msg);
+void
+runner_log(runner_t *runner, const char *dom, gf_loglevel_t lvl,
+ const char *msg);
/**
* set up redirection for child.
@@ -111,7 +117,7 @@ void runner_log (runner_t *runner, const char *dom, gf_loglevel_t lvl,
* @see runner_start(), dup(2), runner_chio(), runner_start()
*/
void
-runner_redir (runner_t *runner, int fd, int tgt_fd);
+runner_redir(runner_t *runner, int fd, int tgt_fd);
/**
* spawn child with accumulated arg list.
@@ -123,7 +129,8 @@ runner_redir (runner_t *runner, int fd, int tgt_fd);
*
* @see runner_cout()
*/
-int runner_start (runner_t *runner);
+int
+runner_start(runner_t *runner);
/**
* complete operation and free resources.
@@ -140,7 +147,8 @@ int runner_start (runner_t *runner);
*
* @see waitpid(2)
*/
-int runner_end (runner_t *runner);
+int
+runner_end(runner_t *runner);
/**
* variant of runner_end() which does not free internal data
@@ -148,7 +156,8 @@ int runner_end (runner_t *runner);
*
* @see runner_end()
*/
-int runner_end_reuse (runner_t *runner);
+int
+runner_end_reuse(runner_t *runner);
/**
* spawn and child, take it to completion and free resources.
@@ -163,13 +172,15 @@ int runner_end_reuse (runner_t *runner);
*
* @see runner_start(), runner_end()
*/
-int runner_run (runner_t *runner);
+int
+runner_run(runner_t *runner);
/**
* variant for runner_run() which does not wait for acknowledgement
* from child, and always assumes it succeeds.
*/
-int runner_run_nowait (runner_t *runner);
+int
+runner_run_nowait(runner_t *runner);
/**
* variant of runner_run() which does not free internal data
@@ -177,7 +188,8 @@ int runner_run_nowait (runner_t *runner);
*
* @see runner_run()
*/
-int runner_run_reuse (runner_t *runner);
+int
+runner_run_reuse(runner_t *runner);
/**
* run a command with args.
@@ -189,6 +201,7 @@ int runner_run_reuse (runner_t *runner);
* @return 0 on success
* -1 on failure
*/
-int runcmd (const char *arg, ...);
+int
+runcmd(const char *arg, ...);
#endif
diff --git a/libglusterfs/src/stack.h b/libglusterfs/src/stack.h
index 212a649d42e..8d58e4daab9 100644
--- a/libglusterfs/src/stack.h
+++ b/libglusterfs/src/stack.h
@@ -37,55 +37,53 @@ typedef struct call_pool call_pool_t;
#define NFS_PID 1
#define LOW_PRIO_PROC_PID -1
-#define STACK_ERR_XL_NAME(stack) (stack->err_xl?stack->err_xl->name:"-")
-#define STACK_CLIENT_NAME(stack) (stack->client?stack->client->client_uid:"-")
+#define STACK_ERR_XL_NAME(stack) (stack->err_xl ? stack->err_xl->name : "-")
+#define STACK_CLIENT_NAME(stack) \
+ (stack->client ? stack->client->client_uid : "-")
-typedef int32_t (*ret_fn_t) (call_frame_t *frame,
- call_frame_t *prev_frame,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno,
- ...);
+typedef int32_t (*ret_fn_t)(call_frame_t *frame, call_frame_t *prev_frame,
+ xlator_t *this, int32_t op_ret, int32_t op_errno,
+ ...);
struct call_pool {
- union {
- struct list_head all_frames;
- struct {
- call_stack_t *next_call;
- call_stack_t *prev_call;
- } all_stacks;
- };
- int64_t cnt;
- gf_atomic_t total_count;
- gf_lock_t lock;
- struct mem_pool *frame_mem_pool;
- struct mem_pool *stack_mem_pool;
+ union {
+ struct list_head all_frames;
+ struct {
+ call_stack_t *next_call;
+ call_stack_t *prev_call;
+ } all_stacks;
+ };
+ int64_t cnt;
+ gf_atomic_t total_count;
+ gf_lock_t lock;
+ struct mem_pool *frame_mem_pool;
+ struct mem_pool *stack_mem_pool;
};
struct _call_frame {
- call_stack_t *root; /* stack root */
- call_frame_t *parent; /* previous BP */
- struct list_head frames;
- void *local; /* local variables */
- xlator_t *this; /* implicit object */
- ret_fn_t ret; /* op_return address */
- int32_t ref_count;
- gf_lock_t lock;
- void *cookie; /* unique cookie */
- gf_boolean_t complete;
-
- glusterfs_fop_t op;
- struct timespec begin; /* when this frame was created */
- struct timespec end; /* when this frame completed */
- const char *wind_from;
- const char *wind_to;
- const char *unwind_from;
- const char *unwind_to;
+ call_stack_t *root; /* stack root */
+ call_frame_t *parent; /* previous BP */
+ struct list_head frames;
+ void *local; /* local variables */
+ xlator_t *this; /* implicit object */
+ ret_fn_t ret; /* op_return address */
+ int32_t ref_count;
+ gf_lock_t lock;
+ void *cookie; /* unique cookie */
+ gf_boolean_t complete;
+
+ glusterfs_fop_t op;
+ struct timespec begin; /* when this frame was created */
+ struct timespec end; /* when this frame completed */
+ const char *wind_from;
+ const char *wind_to;
+ const char *unwind_from;
+ const char *unwind_to;
};
struct _ns_info {
- uint32_t hash; /* Hash of the namespace from SuperFastHash */
- gf_boolean_t found; /* Set to true if we found a namespace */
+ uint32_t hash; /* Hash of the namespace from SuperFastHash */
+ gf_boolean_t found; /* Set to true if we found a namespace */
};
typedef struct _ns_info ns_info_t;
@@ -93,160 +91,157 @@ typedef struct _ns_info ns_info_t;
#define SMALL_GROUP_COUNT 128
struct _call_stack {
- union {
- struct list_head all_frames;
- struct {
- call_stack_t *next_call;
- call_stack_t *prev_call;
- };
+ union {
+ struct list_head all_frames;
+ struct {
+ call_stack_t *next_call;
+ call_stack_t *prev_call;
};
- call_pool_t *pool;
- gf_lock_t stack_lock;
- client_t *client;
- uint64_t unique;
- void *state; /* pointer to request state */
- uid_t uid;
- gid_t gid;
- pid_t pid;
- char identifier[UNIX_PATH_MAX];
- uint16_t ngrps;
- uint32_t groups_small[SMALL_GROUP_COUNT];
- uint32_t *groups_large;
- uint32_t *groups;
- gf_lkowner_t lk_owner;
- glusterfs_ctx_t *ctx;
-
- struct list_head myframes; /* List of call_frame_t that go
- to make the call stack */
-
- int32_t op;
- int8_t type;
- struct timespec tv;
- xlator_t *err_xl;
- int32_t error;
-
- uint32_t flags; /* use it wisely, think of it as a mechanism to
- send information over the wire too */
- struct timespec ctime; /* timestamp, most probably set at
- creation of stack. */
-
- ns_info_t ns_info;
+ };
+ call_pool_t *pool;
+ gf_lock_t stack_lock;
+ client_t *client;
+ uint64_t unique;
+ void *state; /* pointer to request state */
+ uid_t uid;
+ gid_t gid;
+ pid_t pid;
+ char identifier[UNIX_PATH_MAX];
+ uint16_t ngrps;
+ uint32_t groups_small[SMALL_GROUP_COUNT];
+ uint32_t *groups_large;
+ uint32_t *groups;
+ gf_lkowner_t lk_owner;
+ glusterfs_ctx_t *ctx;
+
+ struct list_head myframes; /* List of call_frame_t that go
+ to make the call stack */
+
+ int32_t op;
+ int8_t type;
+ struct timespec tv;
+ xlator_t *err_xl;
+ int32_t error;
+
+ uint32_t flags; /* use it wisely, think of it as a mechanism to
+ send information over the wire too */
+ struct timespec ctime; /* timestamp, most probably set at
+ creation of stack. */
+
+ ns_info_t ns_info;
};
-
/* call_stack flags field users */
-#define MDATA_CTIME (1<<0)
-#define MDATA_MTIME (1<<1)
-#define MDATA_ATIME (1<<2)
-#define MDATA_PAR_CTIME (1<<3)
-#define MDATA_PAR_MTIME (1<<4)
-#define MDATA_PAR_ATIME (1<<5)
-
-#define frame_set_uid_gid(frm, u, g) \
- do { \
- if (frm) { \
- (frm)->root->uid = u; \
- (frm)->root->gid = g; \
- (frm)->root->ngrps = 0; \
- } \
- } while (0); \
-
+#define MDATA_CTIME (1 << 0)
+#define MDATA_MTIME (1 << 1)
+#define MDATA_ATIME (1 << 2)
+#define MDATA_PAR_CTIME (1 << 3)
+#define MDATA_PAR_MTIME (1 << 4)
+#define MDATA_PAR_ATIME (1 << 5)
+
+#define frame_set_uid_gid(frm, u, g) \
+ do { \
+ if (frm) { \
+ (frm)->root->uid = u; \
+ (frm)->root->gid = g; \
+ (frm)->root->ngrps = 0; \
+ } \
+ } while (0);
struct xlator_fops;
-void gf_update_latency (call_frame_t *frame);
-
+void
+gf_update_latency(call_frame_t *frame);
static inline void
-FRAME_DESTROY (call_frame_t *frame)
+FRAME_DESTROY(call_frame_t *frame)
{
- void *local = NULL;
+ void *local = NULL;
- if (frame->root->ctx->measure_latency)
- gf_update_latency (frame);
+ if (frame->root->ctx->measure_latency)
+ gf_update_latency(frame);
- list_del_init (&frame->frames);
- if (frame->local) {
- local = frame->local;
- frame->local = NULL;
+ list_del_init(&frame->frames);
+ if (frame->local) {
+ local = frame->local;
+ frame->local = NULL;
+ }
- }
+ LOCK_DESTROY(&frame->lock);
+ mem_put(frame);
- LOCK_DESTROY (&frame->lock);
- mem_put (frame);
-
- if (local)
- mem_put (local);
+ if (local)
+ mem_put(local);
}
-
static inline void
-STACK_DESTROY (call_stack_t *stack)
+STACK_DESTROY(call_stack_t *stack)
{
- call_frame_t *frame = NULL;
- call_frame_t *tmp = NULL;
+ call_frame_t *frame = NULL;
+ call_frame_t *tmp = NULL;
- LOCK (&stack->pool->lock);
- {
- list_del_init (&stack->all_frames);
- stack->pool->cnt--;
- }
- UNLOCK (&stack->pool->lock);
+ LOCK(&stack->pool->lock);
+ {
+ list_del_init(&stack->all_frames);
+ stack->pool->cnt--;
+ }
+ UNLOCK(&stack->pool->lock);
- LOCK_DESTROY (&stack->stack_lock);
+ LOCK_DESTROY(&stack->stack_lock);
- list_for_each_entry_safe (frame, tmp, &stack->myframes, frames) {
- FRAME_DESTROY (frame);
- }
+ list_for_each_entry_safe(frame, tmp, &stack->myframes, frames)
+ {
+ FRAME_DESTROY(frame);
+ }
- GF_FREE (stack->groups_large);
+ GF_FREE(stack->groups_large);
- mem_put (stack);
+ mem_put(stack);
}
static inline void
-STACK_RESET (call_stack_t *stack)
+STACK_RESET(call_stack_t *stack)
{
- call_frame_t *frame = NULL;
- call_frame_t *tmp = NULL;
- call_frame_t *last = NULL;
- struct list_head toreset = {0};
-
- INIT_LIST_HEAD (&toreset);
-
- /* We acquire call_pool->lock only to remove the frames from this stack
- * to preserve atomicity. This synchronizes across concurrent requests
- * like statedump, STACK_DESTROY etc. */
-
- LOCK (&stack->pool->lock);
- {
- last = list_last_entry (&stack->myframes, call_frame_t, frames);
- list_del_init (&last->frames);
- list_splice_init (&stack->myframes, &toreset);
- list_add (&last->frames, &stack->myframes);
- }
- UNLOCK (&stack->pool->lock);
-
- list_for_each_entry_safe (frame, tmp, &toreset, frames) {
- FRAME_DESTROY (frame);
- }
+ call_frame_t *frame = NULL;
+ call_frame_t *tmp = NULL;
+ call_frame_t *last = NULL;
+ struct list_head toreset = {0};
+
+ INIT_LIST_HEAD(&toreset);
+
+ /* We acquire call_pool->lock only to remove the frames from this stack
+ * to preserve atomicity. This synchronizes across concurrent requests
+ * like statedump, STACK_DESTROY etc. */
+
+ LOCK(&stack->pool->lock);
+ {
+ last = list_last_entry(&stack->myframes, call_frame_t, frames);
+ list_del_init(&last->frames);
+ list_splice_init(&stack->myframes, &toreset);
+ list_add(&last->frames, &stack->myframes);
+ }
+ UNLOCK(&stack->pool->lock);
+
+ list_for_each_entry_safe(frame, tmp, &toreset, frames)
+ {
+ FRAME_DESTROY(frame);
+ }
}
-#define FRAME_SU_DO(frm, local_type) \
- do { \
- local_type *__local = (frm)->local; \
- __local->uid = frm->root->uid; \
- __local->gid = frm->root->gid; \
- frm->root->uid = 0; \
- frm->root->gid = 0; \
- } while (0); \
-
-#define FRAME_SU_UNDO(frm, local_type) \
- do { \
- local_type *__local = (frm)->local; \
- frm->root->uid = __local->uid; \
- frm->root->gid = __local->gid; \
- } while (0); \
-
+#define FRAME_SU_DO(frm, local_type) \
+ do { \
+ local_type *__local = (frm)->local; \
+ __local->uid = frm->root->uid; \
+ __local->gid = frm->root->gid; \
+ frm->root->uid = 0; \
+ frm->root->gid = 0; \
+ } while (0);
+
+#define FRAME_SU_UNDO(frm, local_type) \
+ do { \
+ local_type *__local = (frm)->local; \
+ frm->root->uid = __local->uid; \
+ frm->root->gid = __local->gid; \
+ } while (0);
/* NOTE: make sure to keep this as an macro, mainly because, we need 'fn'
field here to be the proper fn ptr, so its address is valid entry in
@@ -256,8 +251,8 @@ STACK_RESET (call_stack_t *stack)
the address offset should give the index */
/* +1 is required as 0 means NULL fop, and we don't have a variable for it */
-#define get_fop_index_from_fn(xl, fn) \
- (1 + (((long)&(fn) - (long)&((xl)->fops->stat)) / sizeof (void *)))
+#define get_fop_index_from_fn(xl, fn) \
+ (1 + (((long)&(fn) - (long)&((xl)->fops->stat)) / sizeof(void *)))
/* NOTE: the above reason holds good here too. But notice that we are getting
the base address of the 'stat' fop, which is the first entry in the fop
@@ -267,291 +262,283 @@ STACK_RESET (call_stack_t *stack)
static inline void *
get_the_pt_fop(void *base_fop, int fop_idx)
{
- void *target_addr = (base_fop + ((fop_idx - 1) * sizeof (void *)));
- /* all below type casting is for not getting warning. */
- return (void *)*(unsigned long *)target_addr;
+ void *target_addr = (base_fop + ((fop_idx - 1) * sizeof(void *)));
+ /* all below type casting is for not getting warning. */
+ return (void *)*(unsigned long *)target_addr;
}
/* make a call without switching frames */
-#define STACK_WIND_TAIL(frame, obj, fn, params ...) \
- do { \
- xlator_t *old_THIS = NULL; \
- xlator_t *next_xl = obj; \
- typeof(fn) next_xl_fn = fn; \
- int opn = get_fop_index_from_fn((next_xl), (fn)); \
- \
- frame->this = next_xl; \
- frame->wind_to = #fn; \
- old_THIS = THIS; \
- THIS = next_xl; \
- gf_msg_trace ("stack-trace", 0, \
- "stack-address: %p, " \
- "winding from %s to %s", \
- frame->root, old_THIS->name, \
- THIS->name); \
- /* Need to capture counts at leaf node */ \
- if (!next_xl->pass_through && !next_xl->children) { \
- GF_ATOMIC_INC (next_xl->stats.total.metrics[opn].fop); \
- GF_ATOMIC_INC (next_xl->stats.interval.metrics[opn].fop); \
- GF_ATOMIC_INC (next_xl->stats.total.count); \
- GF_ATOMIC_INC (next_xl->stats.interval.count); \
- } \
- \
- if (next_xl->pass_through) { \
- next_xl_fn = get_the_pt_fop(&next_xl->pass_through_fops->stat, opn); \
- } \
- next_xl_fn (frame, next_xl, params); \
- THIS = old_THIS; \
- } while (0)
-
+#define STACK_WIND_TAIL(frame, obj, fn, params...) \
+ do { \
+ xlator_t *old_THIS = NULL; \
+ xlator_t *next_xl = obj; \
+ typeof(fn) next_xl_fn = fn; \
+ int opn = get_fop_index_from_fn((next_xl), (fn)); \
+ \
+ frame->this = next_xl; \
+ frame->wind_to = #fn; \
+ old_THIS = THIS; \
+ THIS = next_xl; \
+ gf_msg_trace("stack-trace", 0, \
+ "stack-address: %p, " \
+ "winding from %s to %s", \
+ frame->root, old_THIS->name, THIS->name); \
+ /* Need to capture counts at leaf node */ \
+ if (!next_xl->pass_through && !next_xl->children) { \
+ GF_ATOMIC_INC(next_xl->stats.total.metrics[opn].fop); \
+ GF_ATOMIC_INC(next_xl->stats.interval.metrics[opn].fop); \
+ GF_ATOMIC_INC(next_xl->stats.total.count); \
+ GF_ATOMIC_INC(next_xl->stats.interval.count); \
+ } \
+ \
+ if (next_xl->pass_through) { \
+ next_xl_fn = get_the_pt_fop(&next_xl->pass_through_fops->stat, \
+ opn); \
+ } \
+ next_xl_fn(frame, next_xl, params); \
+ THIS = old_THIS; \
+ } while (0)
/* make a call */
-#define STACK_WIND(frame, rfn, obj, fn, params ...) \
- STACK_WIND_COMMON(frame, rfn, 0, NULL, obj, fn, params)
+#define STACK_WIND(frame, rfn, obj, fn, params...) \
+ STACK_WIND_COMMON(frame, rfn, 0, NULL, obj, fn, params)
/* make a call with a cookie */
-#define STACK_WIND_COOKIE(frame, rfn, cky, obj, fn, params ...) \
- STACK_WIND_COMMON(frame, rfn, 1, cky, obj, fn, params)
+#define STACK_WIND_COOKIE(frame, rfn, cky, obj, fn, params...) \
+ STACK_WIND_COMMON(frame, rfn, 1, cky, obj, fn, params)
/* Cookie passed as the argument can be NULL (ptr) or 0 (int). Hence we
have to have a mechanism to separate out the two STACK_WIND formats.
Needed a common macro, as other than for cookie, all the other code
is common across.
*/
-#define STACK_WIND_COMMON(frame, rfn, has_cookie, cky, obj, fn, params ...) \
- do { \
- call_frame_t *_new = NULL; \
- xlator_t *old_THIS = NULL; \
- typeof(fn) next_xl_fn = fn; \
- \
- _new = mem_get0 (frame->root->pool->frame_mem_pool); \
- if (!_new) { \
- break; \
- } \
- typeof(fn##_cbk) tmp_cbk = rfn; \
- _new->root = frame->root; \
- _new->this = obj; \
- _new->ret = (ret_fn_t) tmp_cbk; \
- _new->parent = frame; \
- /* (void *) is required for avoiding gcc warning */ \
- _new->cookie = ((has_cookie == 1) ? \
- (void *)(cky) : (void *)_new); \
- _new->wind_from = __FUNCTION__; \
- _new->wind_to = #fn; \
- _new->unwind_to = #rfn; \
- LOCK_INIT (&_new->lock); \
- LOCK(&frame->root->stack_lock); \
- { \
- list_add (&_new->frames, &frame->root->myframes);\
- frame->ref_count++; \
- } \
- UNLOCK(&frame->root->stack_lock); \
- fn##_cbk = rfn; \
- old_THIS = THIS; \
- THIS = obj; \
- gf_msg_trace ("stack-trace", 0, \
- "stack-address: %p, " \
- "winding from %s to %s", \
- frame->root, old_THIS->name, \
- THIS->name); \
- if (obj->ctx->measure_latency) \
- timespec_now (&_new->begin); \
- _new->op = get_fop_index_from_fn ((_new->this), (fn)); \
- if (!obj->pass_through) { \
- GF_ATOMIC_INC (obj->stats.total.metrics[_new->op].fop); \
- GF_ATOMIC_INC (obj->stats.interval.metrics[_new->op].fop); \
- GF_ATOMIC_INC (obj->stats.total.count); \
- GF_ATOMIC_INC (obj->stats.interval.count); \
- } else { \
- /* we want to get to the actual fop to call */ \
- next_xl_fn = get_the_pt_fop(&obj->pass_through_fops->stat, _new->op); \
- } \
- next_xl_fn (_new, obj, params); \
- THIS = old_THIS; \
- } while (0)
-
+#define STACK_WIND_COMMON(frame, rfn, has_cookie, cky, obj, fn, params...) \
+ do { \
+ call_frame_t *_new = NULL; \
+ xlator_t *old_THIS = NULL; \
+ typeof(fn) next_xl_fn = fn; \
+ \
+ _new = mem_get0(frame->root->pool->frame_mem_pool); \
+ if (!_new) { \
+ break; \
+ } \
+ typeof(fn##_cbk) tmp_cbk = rfn; \
+ _new->root = frame->root; \
+ _new->this = obj; \
+ _new->ret = (ret_fn_t)tmp_cbk; \
+ _new->parent = frame; \
+ /* (void *) is required for avoiding gcc warning */ \
+ _new->cookie = ((has_cookie == 1) ? (void *)(cky) : (void *)_new); \
+ _new->wind_from = __FUNCTION__; \
+ _new->wind_to = #fn; \
+ _new->unwind_to = #rfn; \
+ LOCK_INIT(&_new->lock); \
+ LOCK(&frame->root->stack_lock); \
+ { \
+ list_add(&_new->frames, &frame->root->myframes); \
+ frame->ref_count++; \
+ } \
+ UNLOCK(&frame->root->stack_lock); \
+ fn##_cbk = rfn; \
+ old_THIS = THIS; \
+ THIS = obj; \
+ gf_msg_trace("stack-trace", 0, \
+ "stack-address: %p, " \
+ "winding from %s to %s", \
+ frame->root, old_THIS->name, THIS->name); \
+ if (obj->ctx->measure_latency) \
+ timespec_now(&_new->begin); \
+ _new->op = get_fop_index_from_fn((_new->this), (fn)); \
+ if (!obj->pass_through) { \
+ GF_ATOMIC_INC(obj->stats.total.metrics[_new->op].fop); \
+ GF_ATOMIC_INC(obj->stats.interval.metrics[_new->op].fop); \
+ GF_ATOMIC_INC(obj->stats.total.count); \
+ GF_ATOMIC_INC(obj->stats.interval.count); \
+ } else { \
+ /* we want to get to the actual fop to call */ \
+ next_xl_fn = get_the_pt_fop(&obj->pass_through_fops->stat, \
+ _new->op); \
+ } \
+ next_xl_fn(_new, obj, params); \
+ THIS = old_THIS; \
+ } while (0)
#define STACK_UNWIND STACK_UNWIND_STRICT
/* return from function in type-safe way */
-#define STACK_UNWIND_STRICT(fop, frame, op_ret, op_errno, params ...) \
- do { \
- fop_##fop##_cbk_t fn = NULL; \
- call_frame_t *_parent = NULL; \
- xlator_t *old_THIS = NULL; \
- \
- if (!frame) { \
- gf_msg ("stack", GF_LOG_CRITICAL, 0, \
- LG_MSG_FRAME_ERROR, "!frame"); \
- break; \
- } \
- if ((op_ret) < 0) { \
- gf_msg_debug ("stack-trace", op_errno, \
- "stack-address: %p, " \
- "%s returned %d error: %s", \
- frame->root, THIS->name, \
- (int32_t)(op_ret), \
- strerror(op_errno)); \
- } else { \
- gf_msg_trace ("stack-trace", 0, \
- "stack-address: %p, " \
- "%s returned %d", \
- frame->root, THIS->name, \
- (int32_t)(op_ret)); \
- } \
- fn = (fop_##fop##_cbk_t)frame->ret; \
- _parent = frame->parent; \
- LOCK(&frame->root->stack_lock); \
- { \
- _parent->ref_count--; \
- if ((op_ret) < 0 && \
- (op_errno) != frame->root->error) { \
- frame->root->err_xl = frame->this; \
- frame->root->error = (op_errno); \
- } else if ((op_ret) == 0) { \
- frame->root->err_xl = NULL; \
- frame->root->error = 0; \
- } \
- } \
- UNLOCK(&frame->root->stack_lock); \
- old_THIS = THIS; \
- THIS = _parent->this; \
- frame->complete = _gf_true; \
- frame->unwind_from = __FUNCTION__; \
- if (frame->this->ctx->measure_latency) { \
- timespec_now (&frame->end); \
- /* required for top most xlator */ \
- if (_parent->ret == NULL) \
- timespec_now (&_parent->end); \
- } \
- if (op_ret < 0) { \
- GF_ATOMIC_INC (THIS->stats.total.metrics[frame->op].cbk); \
- GF_ATOMIC_INC (THIS->stats.interval.metrics[frame->op].cbk); \
- } \
- fn (_parent, frame->cookie, _parent->this, op_ret, \
- op_errno, params); \
- THIS = old_THIS; \
- } while (0)
-
+#define STACK_UNWIND_STRICT(fop, frame, op_ret, op_errno, params...) \
+ do { \
+ fop_##fop##_cbk_t fn = NULL; \
+ call_frame_t *_parent = NULL; \
+ xlator_t *old_THIS = NULL; \
+ \
+ if (!frame) { \
+ gf_msg("stack", GF_LOG_CRITICAL, 0, LG_MSG_FRAME_ERROR, "!frame"); \
+ break; \
+ } \
+ if ((op_ret) < 0) { \
+ gf_msg_debug("stack-trace", op_errno, \
+ "stack-address: %p, " \
+ "%s returned %d error: %s", \
+ frame->root, THIS->name, (int32_t)(op_ret), \
+ strerror(op_errno)); \
+ } else { \
+ gf_msg_trace("stack-trace", 0, \
+ "stack-address: %p, " \
+ "%s returned %d", \
+ frame->root, THIS->name, (int32_t)(op_ret)); \
+ } \
+ fn = (fop_##fop##_cbk_t)frame->ret; \
+ _parent = frame->parent; \
+ LOCK(&frame->root->stack_lock); \
+ { \
+ _parent->ref_count--; \
+ if ((op_ret) < 0 && (op_errno) != frame->root->error) { \
+ frame->root->err_xl = frame->this; \
+ frame->root->error = (op_errno); \
+ } else if ((op_ret) == 0) { \
+ frame->root->err_xl = NULL; \
+ frame->root->error = 0; \
+ } \
+ } \
+ UNLOCK(&frame->root->stack_lock); \
+ old_THIS = THIS; \
+ THIS = _parent->this; \
+ frame->complete = _gf_true; \
+ frame->unwind_from = __FUNCTION__; \
+ if (frame->this->ctx->measure_latency) { \
+ timespec_now(&frame->end); \
+ /* required for top most xlator */ \
+ if (_parent->ret == NULL) \
+ timespec_now(&_parent->end); \
+ } \
+ if (op_ret < 0) { \
+ GF_ATOMIC_INC(THIS->stats.total.metrics[frame->op].cbk); \
+ GF_ATOMIC_INC(THIS->stats.interval.metrics[frame->op].cbk); \
+ } \
+ fn(_parent, frame->cookie, _parent->this, op_ret, op_errno, params); \
+ THIS = old_THIS; \
+ } while (0)
static inline int
-call_stack_alloc_groups (call_stack_t *stack, int ngrps)
+call_stack_alloc_groups(call_stack_t *stack, int ngrps)
{
- if (ngrps <= SMALL_GROUP_COUNT) {
- stack->groups = stack->groups_small;
- } else {
- stack->groups_large = GF_CALLOC (ngrps, sizeof (gid_t),
- gf_common_mt_groups_t);
- if (!stack->groups_large)
- return -1;
- stack->groups = stack->groups_large;
- }
-
- stack->ngrps = ngrps;
-
- return 0;
+ if (ngrps <= SMALL_GROUP_COUNT) {
+ stack->groups = stack->groups_small;
+ } else {
+ stack->groups_large = GF_CALLOC(ngrps, sizeof(gid_t),
+ gf_common_mt_groups_t);
+ if (!stack->groups_large)
+ return -1;
+ stack->groups = stack->groups_large;
+ }
+
+ stack->ngrps = ngrps;
+
+ return 0;
}
-static inline
-int call_frames_count (call_stack_t *call_stack)
+static inline int
+call_frames_count(call_stack_t *call_stack)
{
- call_frame_t *pos;
- int32_t count = 0;
+ call_frame_t *pos;
+ int32_t count = 0;
- if (!call_stack)
- return count;
+ if (!call_stack)
+ return count;
- list_for_each_entry (pos, &call_stack->myframes, frames)
- count++;
+ list_for_each_entry(pos, &call_stack->myframes, frames) count++;
- return count;
+ return count;
}
static inline call_frame_t *
-copy_frame (call_frame_t *frame)
+copy_frame(call_frame_t *frame)
{
- call_stack_t *newstack = NULL;
- call_stack_t *oldstack = NULL;
- call_frame_t *newframe = NULL;
-
- if (!frame) {
- return NULL;
- }
-
- newstack = mem_get0 (frame->root->pool->stack_mem_pool);
- if (newstack == NULL) {
- return NULL;
- }
-
- INIT_LIST_HEAD (&newstack->myframes);
-
- newframe = mem_get0 (frame->root->pool->frame_mem_pool);
- if (!newframe) {
- mem_put (newstack);
- return NULL;
- }
-
- newframe->this = frame->this;
- newframe->root = newstack;
- INIT_LIST_HEAD (&newframe->frames);
- list_add (&newframe->frames, &newstack->myframes);
-
- oldstack = frame->root;
-
- newstack->uid = oldstack->uid;
- newstack->gid = oldstack->gid;
- newstack->pid = oldstack->pid;
- newstack->op = oldstack->op;
- newstack->type = oldstack->type;
- newstack->ctime = oldstack->ctime;
- newstack->flags = oldstack->flags;
- if (call_stack_alloc_groups (newstack, oldstack->ngrps) != 0) {
- mem_put (newstack);
- return NULL;
- }
- if (!oldstack->groups) {
- gf_msg_debug ("stack", EINVAL, "groups is null (ngrps: %d)",
- oldstack->ngrps);
- /* Considering 'groups' is NULL, set ngrps to 0 */
- oldstack->ngrps = 0;
-
- if (oldstack->groups_large)
- oldstack->groups = oldstack->groups_large;
- else
- oldstack->groups = oldstack->groups_small;
- }
- newstack->ngrps = oldstack->ngrps;
- memcpy (newstack->groups, oldstack->groups,
- sizeof (gid_t) * oldstack->ngrps);
- newstack->unique = oldstack->unique;
- newstack->pool = oldstack->pool;
- newstack->lk_owner = oldstack->lk_owner;
- newstack->ctx = oldstack->ctx;
-
- if (newstack->ctx->measure_latency) {
- timespec_now (&newstack->tv);
- memcpy (&newframe->begin, &newstack->tv,
- sizeof (newstack->tv));
- }
-
- LOCK_INIT (&newframe->lock);
- LOCK_INIT (&newstack->stack_lock);
-
- LOCK (&oldstack->pool->lock);
- {
- list_add (&newstack->all_frames, &oldstack->all_frames);
- newstack->pool->cnt++;
- }
- UNLOCK (&oldstack->pool->lock);
- GF_ATOMIC_INC (newstack->pool->total_count);
-
- return newframe;
+ call_stack_t *newstack = NULL;
+ call_stack_t *oldstack = NULL;
+ call_frame_t *newframe = NULL;
+
+ if (!frame) {
+ return NULL;
+ }
+
+ newstack = mem_get0(frame->root->pool->stack_mem_pool);
+ if (newstack == NULL) {
+ return NULL;
+ }
+
+ INIT_LIST_HEAD(&newstack->myframes);
+
+ newframe = mem_get0(frame->root->pool->frame_mem_pool);
+ if (!newframe) {
+ mem_put(newstack);
+ return NULL;
+ }
+
+ newframe->this = frame->this;
+ newframe->root = newstack;
+ INIT_LIST_HEAD(&newframe->frames);
+ list_add(&newframe->frames, &newstack->myframes);
+
+ oldstack = frame->root;
+
+ newstack->uid = oldstack->uid;
+ newstack->gid = oldstack->gid;
+ newstack->pid = oldstack->pid;
+ newstack->op = oldstack->op;
+ newstack->type = oldstack->type;
+ newstack->ctime = oldstack->ctime;
+ newstack->flags = oldstack->flags;
+ if (call_stack_alloc_groups(newstack, oldstack->ngrps) != 0) {
+ mem_put(newstack);
+ return NULL;
+ }
+ if (!oldstack->groups) {
+ gf_msg_debug("stack", EINVAL, "groups is null (ngrps: %d)",
+ oldstack->ngrps);
+ /* Considering 'groups' is NULL, set ngrps to 0 */
+ oldstack->ngrps = 0;
+
+ if (oldstack->groups_large)
+ oldstack->groups = oldstack->groups_large;
+ else
+ oldstack->groups = oldstack->groups_small;
+ }
+ newstack->ngrps = oldstack->ngrps;
+ memcpy(newstack->groups, oldstack->groups, sizeof(gid_t) * oldstack->ngrps);
+ newstack->unique = oldstack->unique;
+ newstack->pool = oldstack->pool;
+ newstack->lk_owner = oldstack->lk_owner;
+ newstack->ctx = oldstack->ctx;
+
+ if (newstack->ctx->measure_latency) {
+ timespec_now(&newstack->tv);
+ memcpy(&newframe->begin, &newstack->tv, sizeof(newstack->tv));
+ }
+
+ LOCK_INIT(&newframe->lock);
+ LOCK_INIT(&newstack->stack_lock);
+
+ LOCK(&oldstack->pool->lock);
+ {
+ list_add(&newstack->all_frames, &oldstack->all_frames);
+ newstack->pool->cnt++;
+ }
+ UNLOCK(&oldstack->pool->lock);
+ GF_ATOMIC_INC(newstack->pool->total_count);
+
+ return newframe;
}
-void call_stack_set_groups (call_stack_t *stack, int ngrps, gid_t **groupbuf_p);
-void gf_proc_dump_pending_frames(call_pool_t *call_pool);
-void gf_proc_dump_pending_frames_to_dict (call_pool_t *call_pool,
- dict_t *dict);
-call_frame_t *create_frame (xlator_t *xl, call_pool_t *pool);
-gf_boolean_t __is_fuse_call (call_frame_t *frame);
+void
+call_stack_set_groups(call_stack_t *stack, int ngrps, gid_t **groupbuf_p);
+void
+gf_proc_dump_pending_frames(call_pool_t *call_pool);
+void
+gf_proc_dump_pending_frames_to_dict(call_pool_t *call_pool, dict_t *dict);
+call_frame_t *
+create_frame(xlator_t *xl, call_pool_t *pool);
+gf_boolean_t
+__is_fuse_call(call_frame_t *frame);
#endif /* _STACK_H */
diff --git a/libglusterfs/src/statedump.h b/libglusterfs/src/statedump.h
index 92246e1e37e..6c32c161ad3 100644
--- a/libglusterfs/src/statedump.h
+++ b/libglusterfs/src/statedump.h
@@ -8,7 +8,6 @@
cases as published by the Free Software Foundation.
*/
-
#ifndef STATEDUMP_H
#define STATEDUMP_H
@@ -19,93 +18,111 @@
#define GF_DUMP_MAX_BUF_LEN 4096
typedef struct gf_dump_xl_options_ {
- gf_boolean_t dump_priv;
- gf_boolean_t dump_inode;
- gf_boolean_t dump_fd;
- gf_boolean_t dump_inodectx;
- gf_boolean_t dump_fdctx;
- gf_boolean_t dump_history;
+ gf_boolean_t dump_priv;
+ gf_boolean_t dump_inode;
+ gf_boolean_t dump_fd;
+ gf_boolean_t dump_inodectx;
+ gf_boolean_t dump_fdctx;
+ gf_boolean_t dump_history;
} gf_dump_xl_options_t;
typedef struct gf_dump_options_ {
- gf_boolean_t dump_mem;
- gf_boolean_t dump_iobuf;
- gf_boolean_t dump_callpool;
- gf_dump_xl_options_t xl_options; //options for all xlators
- char *dump_path;
+ gf_boolean_t dump_mem;
+ gf_boolean_t dump_iobuf;
+ gf_boolean_t dump_callpool;
+ gf_dump_xl_options_t xl_options; // options for all xlators
+ char *dump_path;
} gf_dump_options_t;
extern gf_dump_options_t dump_options;
-__attribute__ ((__format__ (__printf__, 3, 4)))
-static inline void
-_gf_proc_dump_build_key (char *key, const char *prefix, const char *fmt, ...)
+__attribute__((__format__(__printf__, 3, 4))) static inline void
+_gf_proc_dump_build_key(char *key, const char *prefix, const char *fmt, ...)
{
- va_list ap;
- int32_t len;
-
- len = snprintf(key, GF_DUMP_MAX_BUF_LEN, "%s.", prefix);
- if (len >= 0) {
- va_start(ap, fmt);
- len = vsnprintf(key + len, GF_DUMP_MAX_BUF_LEN - len, fmt, ap);
- va_end(ap);
- }
- if (len < 0) {
- *key = 0;
- }
+ va_list ap;
+ int32_t len;
+
+ len = snprintf(key, GF_DUMP_MAX_BUF_LEN, "%s.", prefix);
+ if (len >= 0) {
+ va_start(ap, fmt);
+ len = vsnprintf(key + len, GF_DUMP_MAX_BUF_LEN - len, fmt, ap);
+ va_end(ap);
+ }
+ if (len < 0) {
+ *key = 0;
+ }
}
-#define gf_proc_dump_build_key(key, key_prefix, fmt...) \
- { \
- _gf_proc_dump_build_key(key, key_prefix, ##fmt); \
- }
+#define gf_proc_dump_build_key(key, key_prefix, fmt...) \
+ { \
+ _gf_proc_dump_build_key(key, key_prefix, ##fmt); \
+ }
-#define GF_PROC_DUMP_SET_OPTION(opt,val) opt = val
+#define GF_PROC_DUMP_SET_OPTION(opt, val) opt = val
-#define GF_CHECK_DUMP_OPTION_ENABLED(option_dump, var, label) \
- do { \
- if (option_dump == _gf_true) { \
- var = _gf_false; \
- goto label; \
- } \
- } while (0);
+#define GF_CHECK_DUMP_OPTION_ENABLED(option_dump, var, label) \
+ do { \
+ if (option_dump == _gf_true) { \
+ var = _gf_false; \
+ goto label; \
+ } \
+ } while (0);
-void gf_proc_dump_init();
+void
+gf_proc_dump_init();
-void gf_proc_dump_fini(void);
+void
+gf_proc_dump_fini(void);
-void gf_proc_dump_cleanup(void);
+void
+gf_proc_dump_cleanup(void);
-void gf_proc_dump_info(int signum, glusterfs_ctx_t *ctx);
+void
+gf_proc_dump_info(int signum, glusterfs_ctx_t *ctx);
-int gf_proc_dump_add_section(char *key,...);
+int
+gf_proc_dump_add_section(char *key, ...);
-int gf_proc_dump_write(char *key, char *value,...);
+int
+gf_proc_dump_write(char *key, char *value, ...);
-void inode_table_dump(inode_table_t *itable, char *prefix);
+void
+inode_table_dump(inode_table_t *itable, char *prefix);
-void inode_table_dump_to_dict (inode_table_t *itable, char *prefix, dict_t *dict);
+void
+inode_table_dump_to_dict(inode_table_t *itable, char *prefix, dict_t *dict);
-void fdtable_dump(fdtable_t *fdtable, char *prefix);
+void
+fdtable_dump(fdtable_t *fdtable, char *prefix);
-void fdtable_dump_to_dict (fdtable_t *fdtable, char *prefix, dict_t *dict);
+void
+fdtable_dump_to_dict(fdtable_t *fdtable, char *prefix, dict_t *dict);
-void inode_dump(inode_t *inode, char *prefix);
+void
+inode_dump(inode_t *inode, char *prefix);
-void gf_proc_dump_mem_info_to_dict (dict_t *dict);
+void
+gf_proc_dump_mem_info_to_dict(dict_t *dict);
-void gf_proc_dump_mempool_info_to_dict (glusterfs_ctx_t *ctx, dict_t *dict);
+void
+gf_proc_dump_mempool_info_to_dict(glusterfs_ctx_t *ctx, dict_t *dict);
-void glusterd_init (int sig);
+void
+glusterd_init(int sig);
-void gf_proc_dump_xlator_private (xlator_t *this, strfd_t *strfd);
+void
+gf_proc_dump_xlator_private(xlator_t *this, strfd_t *strfd);
-void gf_proc_dump_mallinfo (strfd_t *strfd);
+void
+gf_proc_dump_mallinfo(strfd_t *strfd);
-void gf_proc_dump_xlator_history (xlator_t *this, strfd_t *strfd);
+void
+gf_proc_dump_xlator_history(xlator_t *this, strfd_t *strfd);
-void gf_proc_dump_xlator_meminfo (xlator_t *this, strfd_t *strfd);
+void
+gf_proc_dump_xlator_meminfo(xlator_t *this, strfd_t *strfd);
-void gf_proc_dump_xlator_profile (xlator_t *this, strfd_t *strfd);
+void
+gf_proc_dump_xlator_profile(xlator_t *this, strfd_t *strfd);
#endif /* STATEDUMP_H */
diff --git a/libglusterfs/src/store.h b/libglusterfs/src/store.h
index 7ac307bf5ae..d69e39a7ce3 100644
--- a/libglusterfs/src/store.h
+++ b/libglusterfs/src/store.h
@@ -14,96 +14,96 @@
#include "glusterfs.h"
struct gf_store_handle_ {
- char *path;
- int fd;
- int tmp_fd;
- FILE *read;
- int locked; /* state of lockf() */
+ char *path;
+ int fd;
+ int tmp_fd;
+ FILE *read;
+ int locked; /* state of lockf() */
};
typedef struct gf_store_handle_ gf_store_handle_t;
struct gf_store_iter_ {
- FILE *file;
- char filepath[PATH_MAX];
+ FILE *file;
+ char filepath[PATH_MAX];
};
typedef struct gf_store_iter_ gf_store_iter_t;
typedef enum {
- GD_STORE_SUCCESS,
- GD_STORE_KEY_NULL,
- GD_STORE_VALUE_NULL,
- GD_STORE_KEY_VALUE_NULL,
- GD_STORE_EOF,
- GD_STORE_ENOMEM,
- GD_STORE_STAT_FAILED
+ GD_STORE_SUCCESS,
+ GD_STORE_KEY_NULL,
+ GD_STORE_VALUE_NULL,
+ GD_STORE_KEY_VALUE_NULL,
+ GD_STORE_EOF,
+ GD_STORE_ENOMEM,
+ GD_STORE_STAT_FAILED
} gf_store_op_errno_t;
int32_t
-gf_store_mkdir (char *path);
+gf_store_mkdir(char *path);
int32_t
-gf_store_handle_create_on_absence (gf_store_handle_t **shandle, char *path);
+gf_store_handle_create_on_absence(gf_store_handle_t **shandle, char *path);
int32_t
-gf_store_mkstemp (gf_store_handle_t *shandle);
+gf_store_mkstemp(gf_store_handle_t *shandle);
int
-gf_store_sync_direntry (char *path);
+gf_store_sync_direntry(char *path);
int32_t
-gf_store_rename_tmppath (gf_store_handle_t *shandle);
+gf_store_rename_tmppath(gf_store_handle_t *shandle);
int32_t
-gf_store_unlink_tmppath (gf_store_handle_t *shandle);
+gf_store_unlink_tmppath(gf_store_handle_t *shandle);
int
-gf_store_read_and_tokenize (FILE *file, char *str, int size, char **iter_key,
- char **iter_val, gf_store_op_errno_t *store_errno);
+gf_store_read_and_tokenize(FILE *file, char *str, int size, char **iter_key,
+ char **iter_val, gf_store_op_errno_t *store_errno);
int32_t
-gf_store_retrieve_value (gf_store_handle_t *handle, char *key, char **value);
+gf_store_retrieve_value(gf_store_handle_t *handle, char *key, char **value);
int32_t
-gf_store_save_value (int fd, char *key, char *value);
+gf_store_save_value(int fd, char *key, char *value);
int32_t
-gf_store_handle_new (const char *path, gf_store_handle_t **handle);
+gf_store_handle_new(const char *path, gf_store_handle_t **handle);
int
-gf_store_handle_retrieve (char *path, gf_store_handle_t **handle);
+gf_store_handle_retrieve(char *path, gf_store_handle_t **handle);
int32_t
-gf_store_handle_destroy (gf_store_handle_t *handle);
+gf_store_handle_destroy(gf_store_handle_t *handle);
int32_t
-gf_store_iter_new (gf_store_handle_t *shandle, gf_store_iter_t **iter);
+gf_store_iter_new(gf_store_handle_t *shandle, gf_store_iter_t **iter);
int32_t
-gf_store_validate_key_value (char *storepath, char *key, char *val,
- gf_store_op_errno_t *op_errno);
+gf_store_validate_key_value(char *storepath, char *key, char *val,
+ gf_store_op_errno_t *op_errno);
int32_t
-gf_store_iter_get_next (gf_store_iter_t *iter, char **key, char **value,
- gf_store_op_errno_t *op_errno);
+gf_store_iter_get_next(gf_store_iter_t *iter, char **key, char **value,
+ gf_store_op_errno_t *op_errno);
int32_t
-gf_store_iter_get_matching (gf_store_iter_t *iter, char *key, char **value);
+gf_store_iter_get_matching(gf_store_iter_t *iter, char *key, char **value);
int32_t
-gf_store_iter_destroy (gf_store_iter_t *iter);
+gf_store_iter_destroy(gf_store_iter_t *iter);
-char*
-gf_store_strerror (gf_store_op_errno_t op_errno);
+char *
+gf_store_strerror(gf_store_op_errno_t op_errno);
int
-gf_store_lock (gf_store_handle_t *sh);
+gf_store_lock(gf_store_handle_t *sh);
void
-gf_store_unlock (gf_store_handle_t *sh);
+gf_store_unlock(gf_store_handle_t *sh);
int
-gf_store_locked_local (gf_store_handle_t *sh);
+gf_store_locked_local(gf_store_handle_t *sh);
#endif
diff --git a/libglusterfs/src/strfd.h b/libglusterfs/src/strfd.h
index 9084e235eef..861cd02e005 100644
--- a/libglusterfs/src/strfd.h
+++ b/libglusterfs/src/strfd.h
@@ -12,19 +12,23 @@
#define _STRFD_H
typedef struct {
- void *data;
- size_t alloc_size;
- size_t size;
- off_t pos;
+ void *data;
+ size_t alloc_size;
+ size_t size;
+ off_t pos;
} strfd_t;
-strfd_t *strfd_open();
+strfd_t *
+strfd_open();
-int strprintf(strfd_t *strfd, const char *fmt, ...)
- __attribute__ ((__format__ (__printf__, 2, 3)));
+int
+strprintf(strfd_t *strfd, const char *fmt, ...)
+ __attribute__((__format__(__printf__, 2, 3)));
-int strvprintf(strfd_t *strfd, const char *fmt, va_list ap);
+int
+strvprintf(strfd_t *strfd, const char *fmt, va_list ap);
-int strfd_close(strfd_t *strfd);
+int
+strfd_close(strfd_t *strfd);
#endif
diff --git a/libglusterfs/src/syncop-utils.h b/libglusterfs/src/syncop-utils.h
index 97b35046780..1f3ee403edc 100644
--- a/libglusterfs/src/syncop-utils.h
+++ b/libglusterfs/src/syncop-utils.h
@@ -11,45 +11,44 @@
#ifndef _SYNCOP_UTILS_H
#define _SYNCOP_UTILS_H
-typedef int (*syncop_dir_scan_fn_t) (xlator_t *subvol, gf_dirent_t *entry,
- loc_t *parent, void *data);
+typedef int (*syncop_dir_scan_fn_t)(xlator_t *subvol, gf_dirent_t *entry,
+ loc_t *parent, void *data);
int
-syncop_ftw (xlator_t *subvol, loc_t *loc, int pid, void *data,
- int (*fn) (xlator_t *subvol, gf_dirent_t *entry, loc_t *parent,
- void *data));
+syncop_ftw(xlator_t *subvol, loc_t *loc, int pid, void *data,
+ int (*fn)(xlator_t *subvol, gf_dirent_t *entry, loc_t *parent,
+ void *data));
int
-syncop_mt_dir_scan (call_frame_t *frame, xlator_t *subvol, loc_t *loc, int pid,
- void *data, syncop_dir_scan_fn_t fn, dict_t *xdata,
- uint32_t max_jobs, uint32_t max_qlen);
+syncop_mt_dir_scan(call_frame_t *frame, xlator_t *subvol, loc_t *loc, int pid,
+ void *data, syncop_dir_scan_fn_t fn, dict_t *xdata,
+ uint32_t max_jobs, uint32_t max_qlen);
int
-syncop_dir_scan (xlator_t *subvol, loc_t *loc, int pid, void *data,
- int (*fn) (xlator_t *subvol, gf_dirent_t *entry, loc_t *parent,
- void *data));
+syncop_dir_scan(xlator_t *subvol, loc_t *loc, int pid, void *data,
+ int (*fn)(xlator_t *subvol, gf_dirent_t *entry, loc_t *parent,
+ void *data));
int
-syncop_dirfd (xlator_t *subvol, loc_t *loc, fd_t **fd, int pid);
+syncop_dirfd(xlator_t *subvol, loc_t *loc, fd_t **fd, int pid);
int
-syncop_is_subvol_local (xlator_t *this, loc_t *loc, gf_boolean_t *is_local);
+syncop_is_subvol_local(xlator_t *this, loc_t *loc, gf_boolean_t *is_local);
int
-syncop_gfid_to_path (inode_table_t *itable, xlator_t *subvol, uuid_t gfid,
- char **path_p);
+syncop_gfid_to_path(inode_table_t *itable, xlator_t *subvol, uuid_t gfid,
+ char **path_p);
int
-syncop_ftw_throttle (xlator_t *subvol, loc_t *loc, int pid, void *data,
- int (*fn) (xlator_t *subvol, gf_dirent_t *entry,
- loc_t *parent, void *data),
- int count, int sleep_time);
+syncop_ftw_throttle(xlator_t *subvol, loc_t *loc, int pid, void *data,
+ int (*fn)(xlator_t *subvol, gf_dirent_t *entry,
+ loc_t *parent, void *data),
+ int count, int sleep_time);
int
-syncop_inode_find (xlator_t *this, xlator_t *subvol,
- uuid_t gfid, inode_t **inode,
- dict_t *xdata, dict_t **rsp_dict);
+syncop_inode_find(xlator_t *this, xlator_t *subvol, uuid_t gfid,
+ inode_t **inode, dict_t *xdata, dict_t **rsp_dict);
int
-syncop_gfid_to_path_hard (inode_table_t *itable, xlator_t *subvol, uuid_t gfid,
- inode_t *inode, char **path_p,
- gf_boolean_t hard_resolve);
+syncop_gfid_to_path_hard(inode_table_t *itable, xlator_t *subvol, uuid_t gfid,
+ inode_t *inode, char **path_p,
+ gf_boolean_t hard_resolve);
#endif /* _SYNCOP_H */
diff --git a/libglusterfs/src/syncop.h b/libglusterfs/src/syncop.h
index 3000d2e74c9..d07aed3d53b 100644
--- a/libglusterfs/src/syncop.h
+++ b/libglusterfs/src/syncop.h
@@ -23,245 +23,233 @@
/*
* Flags for syncopctx valid elements
*/
-#define SYNCOPCTX_UID 0x00000001
-#define SYNCOPCTX_GID 0x00000002
+#define SYNCOPCTX_UID 0x00000001
+#define SYNCOPCTX_GID 0x00000002
#define SYNCOPCTX_GROUPS 0x00000004
-#define SYNCOPCTX_PID 0x00000008
+#define SYNCOPCTX_PID 0x00000008
#define SYNCOPCTX_LKOWNER 0x00000010
struct synctask;
struct syncproc;
struct syncenv;
+typedef int (*synctask_cbk_t)(int ret, call_frame_t *frame, void *opaque);
-typedef int (*synctask_cbk_t) (int ret, call_frame_t *frame, void *opaque);
-
-typedef int (*synctask_fn_t) (void *opaque);
-
+typedef int (*synctask_fn_t)(void *opaque);
typedef enum {
- SYNCTASK_INIT = 0,
- SYNCTASK_RUN,
- SYNCTASK_SUSPEND,
- SYNCTASK_WAIT,
- SYNCTASK_DONE,
- SYNCTASK_ZOMBIE,
+ SYNCTASK_INIT = 0,
+ SYNCTASK_RUN,
+ SYNCTASK_SUSPEND,
+ SYNCTASK_WAIT,
+ SYNCTASK_DONE,
+ SYNCTASK_ZOMBIE,
} synctask_state_t;
/* for one sequential execution of @syncfn */
struct synctask {
- struct list_head all_tasks;
- struct syncenv *env;
- xlator_t *xl;
- call_frame_t *frame;
- call_frame_t *opframe;
- synctask_cbk_t synccbk;
- synctask_fn_t syncfn;
- synctask_state_t state;
- void *opaque;
- void *stack;
- int woken;
- int slept;
- int ret;
-
- uid_t uid;
- gid_t gid;
-
- ucontext_t ctx;
- struct syncproc *proc;
-
- pthread_mutex_t mutex; /* for synchronous spawning of synctask */
- pthread_cond_t cond;
- int done;
-
- struct list_head waitq; /* can wait only "once" at a time */
- char btbuf[GF_BACKTRACE_LEN];
+ struct list_head all_tasks;
+ struct syncenv *env;
+ xlator_t *xl;
+ call_frame_t *frame;
+ call_frame_t *opframe;
+ synctask_cbk_t synccbk;
+ synctask_fn_t syncfn;
+ synctask_state_t state;
+ void *opaque;
+ void *stack;
+ int woken;
+ int slept;
+ int ret;
+
+ uid_t uid;
+ gid_t gid;
+
+ ucontext_t ctx;
+ struct syncproc *proc;
+
+ pthread_mutex_t mutex; /* for synchronous spawning of synctask */
+ pthread_cond_t cond;
+ int done;
+
+ struct list_head waitq; /* can wait only "once" at a time */
+ char btbuf[GF_BACKTRACE_LEN];
};
-
struct syncproc {
- pthread_t processor;
- ucontext_t sched;
- struct syncenv *env;
- struct synctask *current;
+ pthread_t processor;
+ ucontext_t sched;
+ struct syncenv *env;
+ struct synctask *current;
};
/* hosts the scheduler thread and framework for executing synctasks */
struct syncenv {
- struct syncproc proc[SYNCENV_PROC_MAX];
- int procs;
+ struct syncproc proc[SYNCENV_PROC_MAX];
+ int procs;
- struct list_head runq;
- int runcount;
- struct list_head waitq;
- int waitcount;
+ struct list_head runq;
+ int runcount;
+ struct list_head waitq;
+ int waitcount;
- int procmin;
- int procmax;
+ int procmin;
+ int procmax;
- pthread_mutex_t mutex;
- pthread_cond_t cond;
+ pthread_mutex_t mutex;
+ pthread_cond_t cond;
- size_t stacksize;
+ size_t stacksize;
- int destroy; /* FLAG to mark syncenv is in destroy mode
- so that no more synctasks are accepted*/
+ int destroy; /* FLAG to mark syncenv is in destroy mode
+ so that no more synctasks are accepted*/
};
+typedef enum { LOCK_NULL = 0, LOCK_TASK, LOCK_THREAD } lock_type_t;
typedef enum {
- LOCK_NULL = 0,
- LOCK_TASK,
- LOCK_THREAD
-} lock_type_t;
-
-typedef enum {
- SYNC_LOCK_DEFAULT = 0,
- SYNC_LOCK_RECURSIVE, /*it allows recursive locking*/
+ SYNC_LOCK_DEFAULT = 0,
+ SYNC_LOCK_RECURSIVE, /*it allows recursive locking*/
} lock_attr_t;
struct synclock {
- pthread_mutex_t guard; /* guard the remaining members, pair @cond */
- pthread_cond_t cond; /* waiting non-synctasks */
- struct list_head waitq; /* waiting synctasks */
- volatile int lock; /* true(non zero) or false(zero), lock status */
- lock_attr_t attr;
- struct synctask *owner; /* NULL if current owner is not a synctask */
- pthread_t owner_tid;
- lock_type_t type;
+ pthread_mutex_t guard; /* guard the remaining members, pair @cond */
+ pthread_cond_t cond; /* waiting non-synctasks */
+ struct list_head waitq; /* waiting synctasks */
+ volatile int lock; /* true(non zero) or false(zero), lock status */
+ lock_attr_t attr;
+ struct synctask *owner; /* NULL if current owner is not a synctask */
+ pthread_t owner_tid;
+ lock_type_t type;
};
typedef struct synclock synclock_t;
-
struct syncbarrier {
- gf_boolean_t initialized; /*Set on successful initialization*/
- pthread_mutex_t guard; /* guard the remaining members, pair @cond */
- pthread_cond_t cond; /* waiting non-synctasks */
- struct list_head waitq; /* waiting synctasks */
- int count; /* count the number of wakes */
- int waitfor; /* no. of wakes until which task can be in
- waitq before being woken up. */
+ gf_boolean_t initialized; /*Set on successful initialization*/
+ pthread_mutex_t guard; /* guard the remaining members, pair @cond */
+ pthread_cond_t cond; /* waiting non-synctasks */
+ struct list_head waitq; /* waiting synctasks */
+ int count; /* count the number of wakes */
+ int waitfor; /* no. of wakes until which task can be in
+ waitq before being woken up. */
};
typedef struct syncbarrier syncbarrier_t;
-
struct syncargs {
- int op_ret;
- int op_errno;
- struct iatt iatt1;
- struct iatt iatt2;
- dict_t *xattr;
- struct statvfs statvfs_buf;
- struct iovec *vector;
- int count;
- struct iobref *iobref;
- char *buffer;
- dict_t *xdata;
- struct gf_flock flock;
- struct gf_lease lease;
- dict_t *dict_out;
-
- /* some more _cbk needs */
- uuid_t uuid;
- char *errstr;
- dict_t *dict;
- pthread_mutex_t lock_dict;
-
- syncbarrier_t barrier;
-
- /* do not touch */
- struct synctask *task;
- pthread_mutex_t mutex;
- pthread_cond_t cond;
- int done;
-
- gf_dirent_t entries;
- off_t offset;
-
- lock_migration_info_t locklist;
+ int op_ret;
+ int op_errno;
+ struct iatt iatt1;
+ struct iatt iatt2;
+ dict_t *xattr;
+ struct statvfs statvfs_buf;
+ struct iovec *vector;
+ int count;
+ struct iobref *iobref;
+ char *buffer;
+ dict_t *xdata;
+ struct gf_flock flock;
+ struct gf_lease lease;
+ dict_t *dict_out;
+
+ /* some more _cbk needs */
+ uuid_t uuid;
+ char *errstr;
+ dict_t *dict;
+ pthread_mutex_t lock_dict;
+
+ syncbarrier_t barrier;
+
+ /* do not touch */
+ struct synctask *task;
+ pthread_mutex_t mutex;
+ pthread_cond_t cond;
+ int done;
+
+ gf_dirent_t entries;
+ off_t offset;
+
+ lock_migration_info_t locklist;
};
struct syncopctx {
- unsigned int valid; /* valid flags for elements that are set */
- uid_t uid;
- gid_t gid;
- int grpsize;
- int ngrps;
- gid_t *groups;
- pid_t pid;
- gf_lkowner_t lk_owner;
+ unsigned int valid; /* valid flags for elements that are set */
+ uid_t uid;
+ gid_t gid;
+ int grpsize;
+ int ngrps;
+ gid_t *groups;
+ pid_t pid;
+ gf_lkowner_t lk_owner;
};
-#define __yawn(args) do { \
- args->task = synctask_get (); \
- if (args->task) \
- break; \
- pthread_mutex_init (&args->mutex, NULL); \
- pthread_cond_init (&args->cond, NULL); \
- args->done = 0; \
- } while (0)
-
-
-#define __wake(args) do { \
- if (args->task) { \
- synctask_wake (args->task); \
- } else { \
- pthread_mutex_lock (&args->mutex); \
- { \
- args->done = 1; \
- pthread_cond_signal (&args->cond); \
- } \
- pthread_mutex_unlock (&args->mutex); \
- } \
- } while (0)
-
-
-#define __yield(args) do { \
- if (args->task) { \
- synctask_yield (args->task); \
- } else { \
- pthread_mutex_lock (&args->mutex); \
- { \
- while (!args->done) \
- pthread_cond_wait (&args->cond, \
- &args->mutex); \
- } \
- pthread_mutex_unlock (&args->mutex); \
- pthread_mutex_destroy (&args->mutex); \
- pthread_cond_destroy (&args->cond); \
- } \
- } while (0)
-
-
-#define SYNCOP(subvol, stb, cbk, fn_op, params ...) do { \
- struct synctask *task = NULL; \
- call_frame_t *frame = NULL; \
- \
- task = synctask_get (); \
- stb->task = task; \
- if (task) \
- frame = task->opframe; \
- else \
- frame = syncop_create_frame (THIS); \
- \
- if (task) { \
- frame->root->uid = task->uid; \
- frame->root->gid = task->gid; \
- } \
- \
- __yawn (stb); \
- \
- frame->op = get_fop_index_from_fn (subvol, fn_op); \
- STACK_WIND_COOKIE (frame, cbk, (void *)stb, subvol, \
- fn_op, params); \
- \
- __yield (stb); \
- if (task) \
- STACK_RESET (frame->root); \
- else \
- STACK_DESTROY (frame->root); \
- } while (0)
-
+#define __yawn(args) \
+ do { \
+ args->task = synctask_get(); \
+ if (args->task) \
+ break; \
+ pthread_mutex_init(&args->mutex, NULL); \
+ pthread_cond_init(&args->cond, NULL); \
+ args->done = 0; \
+ } while (0)
+
+#define __wake(args) \
+ do { \
+ if (args->task) { \
+ synctask_wake(args->task); \
+ } else { \
+ pthread_mutex_lock(&args->mutex); \
+ { \
+ args->done = 1; \
+ pthread_cond_signal(&args->cond); \
+ } \
+ pthread_mutex_unlock(&args->mutex); \
+ } \
+ } while (0)
+
+#define __yield(args) \
+ do { \
+ if (args->task) { \
+ synctask_yield(args->task); \
+ } else { \
+ pthread_mutex_lock(&args->mutex); \
+ { \
+ while (!args->done) \
+ pthread_cond_wait(&args->cond, &args->mutex); \
+ } \
+ pthread_mutex_unlock(&args->mutex); \
+ pthread_mutex_destroy(&args->mutex); \
+ pthread_cond_destroy(&args->cond); \
+ } \
+ } while (0)
+
+#define SYNCOP(subvol, stb, cbk, fn_op, params...) \
+ do { \
+ struct synctask *task = NULL; \
+ call_frame_t *frame = NULL; \
+ \
+ task = synctask_get(); \
+ stb->task = task; \
+ if (task) \
+ frame = task->opframe; \
+ else \
+ frame = syncop_create_frame(THIS); \
+ \
+ if (task) { \
+ frame->root->uid = task->uid; \
+ frame->root->gid = task->gid; \
+ } \
+ \
+ __yawn(stb); \
+ \
+ frame->op = get_fop_index_from_fn(subvol, fn_op); \
+ STACK_WIND_COOKIE(frame, cbk, (void *)stb, subvol, fn_op, params); \
+ \
+ __yield(stb); \
+ if (task) \
+ STACK_RESET(frame->root); \
+ else \
+ STACK_DESTROY(frame->root); \
+ } while (0)
/*
* syncop_xxx() calls are executed in two ways, one is inside a synctask where
@@ -276,319 +264,376 @@ struct syncopctx {
* like a system call, where -1 is returned and errno is set when a failure
* occurs.
*/
-#define DECODE_SYNCOP_ERR(ret) do { \
- if (ret < 0) { \
- errno = -ret; \
- ret = -1; \
- } else { \
- errno = 0; \
- } \
- } while (0)
-
+#define DECODE_SYNCOP_ERR(ret) \
+ do { \
+ if (ret < 0) { \
+ errno = -ret; \
+ ret = -1; \
+ } else { \
+ errno = 0; \
+ } \
+ } while (0)
#define SYNCENV_DEFAULT_STACKSIZE (2 * 1024 * 1024)
-struct syncenv * syncenv_new (size_t stacksize, int procmin, int procmax);
-void syncenv_destroy (struct syncenv *);
-void syncenv_scale (struct syncenv *env);
-
-int synctask_new1 (struct syncenv *, size_t stacksize, synctask_fn_t,
- synctask_cbk_t, call_frame_t *frame, void *);
-int synctask_new (struct syncenv *, synctask_fn_t, synctask_cbk_t,
- call_frame_t *frame, void *);
-struct synctask *synctask_create (struct syncenv *, size_t stacksize,
- synctask_fn_t, synctask_cbk_t, call_frame_t *,
- void *);
-int synctask_join (struct synctask *task);
-void synctask_wake (struct synctask *task);
-void synctask_yield (struct synctask *task);
-void synctask_waitfor (struct synctask *task, int count);
-
-#define synctask_barrier_init(args) syncbarrier_init (&args->barrier)
-#define synctask_barrier_wait(args, n) syncbarrier_wait (&args->barrier, n)
-#define synctask_barrier_wake(args) syncbarrier_wake (&args->barrier)
-
-int synctask_setid (struct synctask *task, uid_t uid, gid_t gid);
-#define SYNCTASK_SETID(uid, gid) synctask_setid (synctask_get(), uid, gid);
-
-int syncopctx_setfsuid (void *uid);
-int syncopctx_setfsgid (void *gid);
-int syncopctx_setfsgroups (int count, const void *groups);
-int syncopctx_setfspid (void *pid);
-int syncopctx_setfslkowner (gf_lkowner_t *lk_owner);
+struct syncenv *
+syncenv_new(size_t stacksize, int procmin, int procmax);
+void
+syncenv_destroy(struct syncenv *);
+void
+syncenv_scale(struct syncenv *env);
+
+int
+synctask_new1(struct syncenv *, size_t stacksize, synctask_fn_t, synctask_cbk_t,
+ call_frame_t *frame, void *);
+int
+synctask_new(struct syncenv *, synctask_fn_t, synctask_cbk_t,
+ call_frame_t *frame, void *);
+struct synctask *
+synctask_create(struct syncenv *, size_t stacksize, synctask_fn_t,
+ synctask_cbk_t, call_frame_t *, void *);
+int
+synctask_join(struct synctask *task);
+void
+synctask_wake(struct synctask *task);
+void
+synctask_yield(struct synctask *task);
+void
+synctask_waitfor(struct synctask *task, int count);
+
+#define synctask_barrier_init(args) syncbarrier_init(&args->barrier)
+#define synctask_barrier_wait(args, n) syncbarrier_wait(&args->barrier, n)
+#define synctask_barrier_wake(args) syncbarrier_wake(&args->barrier)
+
+int
+synctask_setid(struct synctask *task, uid_t uid, gid_t gid);
+#define SYNCTASK_SETID(uid, gid) synctask_setid(synctask_get(), uid, gid);
+
+int
+syncopctx_setfsuid(void *uid);
+int
+syncopctx_setfsgid(void *gid);
+int
+syncopctx_setfsgroups(int count, const void *groups);
+int
+syncopctx_setfspid(void *pid);
+int
+syncopctx_setfslkowner(gf_lkowner_t *lk_owner);
static inline call_frame_t *
-syncop_create_frame (xlator_t *this)
+syncop_create_frame(xlator_t *this)
{
- call_frame_t *frame = NULL;
- int ngrps = -1;
- struct syncopctx *opctx = NULL;
-
- frame = create_frame (this, this->ctx->pool);
- if (!frame)
- return NULL;
-
- opctx = syncopctx_getctx ();
-
- if (opctx && (opctx->valid & SYNCOPCTX_PID))
- frame->root->pid = opctx->pid;
- else
- frame->root->pid = getpid ();
-
- if (opctx && (opctx->valid & SYNCOPCTX_UID))
- frame->root->uid = opctx->uid;
- else
- frame->root->uid = geteuid ();
-
- if (opctx && (opctx->valid & SYNCOPCTX_GID))
- frame->root->gid = opctx->gid;
- else
- frame->root->gid = getegid ();
-
- if (opctx && (opctx->valid & SYNCOPCTX_GROUPS)) {
- ngrps = opctx->ngrps;
-
- if (ngrps != 0 && opctx->groups != NULL) {
- if (call_stack_alloc_groups (frame->root, ngrps) != 0) {
- STACK_DESTROY (frame->root);
- return NULL;
- }
-
- memcpy (frame->root->groups, opctx->groups,
- (sizeof (gid_t) * ngrps));
- }
- }
- else {
- ngrps = getgroups (0, 0);
- if (ngrps < 0) {
- STACK_DESTROY (frame->root);
- return NULL;
- }
-
- if (call_stack_alloc_groups (frame->root, ngrps) != 0) {
- STACK_DESTROY (frame->root);
- return NULL;
- }
-
- if (getgroups (ngrps, frame->root->groups) < 0) {
- STACK_DESTROY (frame->root);
- return NULL;
- }
- }
-
- if (opctx && (opctx->valid & SYNCOPCTX_LKOWNER))
- frame->root->lk_owner = opctx->lk_owner;
-
- return frame;
+ call_frame_t *frame = NULL;
+ int ngrps = -1;
+ struct syncopctx *opctx = NULL;
+
+ frame = create_frame(this, this->ctx->pool);
+ if (!frame)
+ return NULL;
+
+ opctx = syncopctx_getctx();
+
+ if (opctx && (opctx->valid & SYNCOPCTX_PID))
+ frame->root->pid = opctx->pid;
+ else
+ frame->root->pid = getpid();
+
+ if (opctx && (opctx->valid & SYNCOPCTX_UID))
+ frame->root->uid = opctx->uid;
+ else
+ frame->root->uid = geteuid();
+
+ if (opctx && (opctx->valid & SYNCOPCTX_GID))
+ frame->root->gid = opctx->gid;
+ else
+ frame->root->gid = getegid();
+
+ if (opctx && (opctx->valid & SYNCOPCTX_GROUPS)) {
+ ngrps = opctx->ngrps;
+
+ if (ngrps != 0 && opctx->groups != NULL) {
+ if (call_stack_alloc_groups(frame->root, ngrps) != 0) {
+ STACK_DESTROY(frame->root);
+ return NULL;
+ }
+
+ memcpy(frame->root->groups, opctx->groups, (sizeof(gid_t) * ngrps));
+ }
+ } else {
+ ngrps = getgroups(0, 0);
+ if (ngrps < 0) {
+ STACK_DESTROY(frame->root);
+ return NULL;
+ }
+
+ if (call_stack_alloc_groups(frame->root, ngrps) != 0) {
+ STACK_DESTROY(frame->root);
+ return NULL;
+ }
+
+ if (getgroups(ngrps, frame->root->groups) < 0) {
+ STACK_DESTROY(frame->root);
+ return NULL;
+ }
+ }
+
+ if (opctx && (opctx->valid & SYNCOPCTX_LKOWNER))
+ frame->root->lk_owner = opctx->lk_owner;
+
+ return frame;
}
-int synclock_init (synclock_t *lock, lock_attr_t attr);
-int synclock_destroy (synclock_t *lock);
-int synclock_lock (synclock_t *lock);
-int synclock_trylock (synclock_t *lock);
-int synclock_unlock (synclock_t *lock);
-
+int
+synclock_init(synclock_t *lock, lock_attr_t attr);
+int
+synclock_destroy(synclock_t *lock);
+int
+synclock_lock(synclock_t *lock);
+int
+synclock_trylock(synclock_t *lock);
+int
+synclock_unlock(synclock_t *lock);
-int syncbarrier_init (syncbarrier_t *barrier);
-int syncbarrier_wait (syncbarrier_t *barrier, int waitfor);
-int syncbarrier_wake (syncbarrier_t *barrier);
-int syncbarrier_destroy (syncbarrier_t *barrier);
+int
+syncbarrier_init(syncbarrier_t *barrier);
+int
+syncbarrier_wait(syncbarrier_t *barrier, int waitfor);
+int
+syncbarrier_wake(syncbarrier_t *barrier);
+int
+syncbarrier_destroy(syncbarrier_t *barrier);
-int syncop_lookup (xlator_t *subvol, loc_t *loc,
- /* out */
- struct iatt *iatt, struct iatt *parent,
- /* xdata */
- dict_t *xdata_in, dict_t **xdata_out);
+int
+syncop_lookup(xlator_t *subvol, loc_t *loc,
+ /* out */
+ struct iatt *iatt, struct iatt *parent,
+ /* xdata */
+ dict_t *xdata_in, dict_t **xdata_out);
-int syncop_readdirp (xlator_t *subvol, fd_t *fd, size_t size, off_t off,
- /* out */
- gf_dirent_t *entries,
- dict_t *xdata_in, dict_t **xdata_out);
+int
+syncop_readdirp(xlator_t *subvol, fd_t *fd, size_t size, off_t off,
+ /* out */
+ gf_dirent_t *entries, dict_t *xdata_in, dict_t **xdata_out);
-int syncop_readdir (xlator_t *subvol, fd_t *fd, size_t size, off_t off,
- gf_dirent_t *entries, dict_t *xdata_in, dict_t **xdata_out);
+int
+syncop_readdir(xlator_t *subvol, fd_t *fd, size_t size, off_t off,
+ gf_dirent_t *entries, dict_t *xdata_in, dict_t **xdata_out);
-int syncop_opendir (xlator_t *subvol, loc_t *loc, fd_t *fd, dict_t *xdata_in,
- dict_t **xdata_out);
+int
+syncop_opendir(xlator_t *subvol, loc_t *loc, fd_t *fd, dict_t *xdata_in,
+ dict_t **xdata_out);
-int syncop_setattr (xlator_t *subvol, loc_t *loc, struct iatt *iatt, int valid,
- /* out */
- struct iatt *preop, struct iatt *postop, dict_t *xdata_in,
- dict_t **xdata_out);
+int
+syncop_setattr(xlator_t *subvol, loc_t *loc, struct iatt *iatt, int valid,
+ /* out */
+ struct iatt *preop, struct iatt *postop, dict_t *xdata_in,
+ dict_t **xdata_out);
-int syncop_fsetattr (xlator_t *subvol, fd_t *fd, struct iatt *iatt, int valid,
- /* out */
- struct iatt *preop, struct iatt *postop, dict_t *xdata_in,
- dict_t **xdata_out);
+int
+syncop_fsetattr(xlator_t *subvol, fd_t *fd, struct iatt *iatt, int valid,
+ /* out */
+ struct iatt *preop, struct iatt *postop, dict_t *xdata_in,
+ dict_t **xdata_out);
-int syncop_statfs (xlator_t *subvol, loc_t *loc,
- /* out */
- struct statvfs *buf,
- dict_t *xdata_in, dict_t **xdata_out);
+int
+syncop_statfs(xlator_t *subvol, loc_t *loc,
+ /* out */
+ struct statvfs *buf, dict_t *xdata_in, dict_t **xdata_out);
-int syncop_setxattr (xlator_t *subvol, loc_t *loc, dict_t *dict, int32_t flags,
- dict_t *xdata_in, dict_t **xdata_out);
+int
+syncop_setxattr(xlator_t *subvol, loc_t *loc, dict_t *dict, int32_t flags,
+ dict_t *xdata_in, dict_t **xdata_out);
-int syncop_fsetxattr (xlator_t *subvol, fd_t *fd, dict_t *dict, int32_t flags,
- dict_t *xdata_in, dict_t **xdata_out);
+int
+syncop_fsetxattr(xlator_t *subvol, fd_t *fd, dict_t *dict, int32_t flags,
+ dict_t *xdata_in, dict_t **xdata_out);
-int syncop_listxattr (xlator_t *subvol, loc_t *loc, dict_t **dict,
- dict_t *xdata_in, dict_t **xdata_out);
+int
+syncop_listxattr(xlator_t *subvol, loc_t *loc, dict_t **dict, dict_t *xdata_in,
+ dict_t **xdata_out);
-int syncop_getxattr (xlator_t *xl, loc_t *loc, dict_t **dict, const char *key,
- dict_t *xdata_in, dict_t **xdata_out);
+int
+syncop_getxattr(xlator_t *xl, loc_t *loc, dict_t **dict, const char *key,
+ dict_t *xdata_in, dict_t **xdata_out);
-int syncop_fgetxattr (xlator_t *xl, fd_t *fd, dict_t **dict, const char *key,
- dict_t *xdata_in, dict_t **xdata_out);
+int
+syncop_fgetxattr(xlator_t *xl, fd_t *fd, dict_t **dict, const char *key,
+ dict_t *xdata_in, dict_t **xdata_out);
-int syncop_removexattr (xlator_t *subvol, loc_t *loc, const char *name,
- dict_t *xdata_in, dict_t **xdata_out);
+int
+syncop_removexattr(xlator_t *subvol, loc_t *loc, const char *name,
+ dict_t *xdata_in, dict_t **xdata_out);
-int syncop_fremovexattr (xlator_t *subvol, fd_t *fd, const char *name,
- dict_t *xdata_in, dict_t **xdata_out);
+int
+syncop_fremovexattr(xlator_t *subvol, fd_t *fd, const char *name,
+ dict_t *xdata_in, dict_t **xdata_out);
-int syncop_create (xlator_t *subvol, loc_t *loc, int32_t flags, mode_t mode,
- fd_t *fd, struct iatt *iatt,
- dict_t *xdata_in, dict_t **xdata_out);
+int
+syncop_create(xlator_t *subvol, loc_t *loc, int32_t flags, mode_t mode,
+ fd_t *fd, struct iatt *iatt, dict_t *xdata_in,
+ dict_t **xdata_out);
-int syncop_open (xlator_t *subvol, loc_t *loc, int32_t flags, fd_t *fd,
- dict_t *xdata_in, dict_t **xdata_out);
+int
+syncop_open(xlator_t *subvol, loc_t *loc, int32_t flags, fd_t *fd,
+ dict_t *xdata_in, dict_t **xdata_out);
-int syncop_close (fd_t *fd);
+int
+syncop_close(fd_t *fd);
-int syncop_write (xlator_t *subvol, fd_t *fd, const char *buf, int size,
- off_t offset, struct iobref *iobref, uint32_t flags,
- dict_t *xdata_in, dict_t **xdata_out);
+int
+syncop_write(xlator_t *subvol, fd_t *fd, const char *buf, int size,
+ off_t offset, struct iobref *iobref, uint32_t flags,
+ dict_t *xdata_in, dict_t **xdata_out);
-int syncop_writev (xlator_t *subvol, fd_t *fd, const struct iovec *vector,
- int32_t count, off_t offset, struct iobref *iobref,
- uint32_t flags, struct iatt *preiatt, struct iatt *postiatt,
- dict_t *xdata_in, dict_t **xdata_out);
+int
+syncop_writev(xlator_t *subvol, fd_t *fd, const struct iovec *vector,
+ int32_t count, off_t offset, struct iobref *iobref,
+ uint32_t flags, struct iatt *preiatt, struct iatt *postiatt,
+ dict_t *xdata_in, dict_t **xdata_out);
-int syncop_readv (xlator_t *subvol, fd_t *fd, size_t size, off_t off,
- uint32_t flags,
- /* out */
- struct iovec **vector, int *count, struct iobref **iobref,
- struct iatt *iatt, dict_t *xdata_in, dict_t **xdata_out);
+int
+syncop_readv(xlator_t *subvol, fd_t *fd, size_t size, off_t off, uint32_t flags,
+ /* out */
+ struct iovec **vector, int *count, struct iobref **iobref,
+ struct iatt *iatt, dict_t *xdata_in, dict_t **xdata_out);
-int syncop_ftruncate (xlator_t *subvol, fd_t *fd, off_t offset,
- struct iatt *preiatt, struct iatt *postiatt,
- dict_t *xdata_in, dict_t **xdata_out);
+int
+syncop_ftruncate(xlator_t *subvol, fd_t *fd, off_t offset, struct iatt *preiatt,
+ struct iatt *postiatt, dict_t *xdata_in, dict_t **xdata_out);
-int syncop_truncate (xlator_t *subvol, loc_t *loc, off_t offset,
- dict_t *xdata_in, dict_t **xdata_out);
+int
+syncop_truncate(xlator_t *subvol, loc_t *loc, off_t offset, dict_t *xdata_in,
+ dict_t **xdata_out);
-int syncop_unlink (xlator_t *subvol, loc_t *loc, dict_t *xdata_in,
- dict_t **xdata_out);
+int
+syncop_unlink(xlator_t *subvol, loc_t *loc, dict_t *xdata_in,
+ dict_t **xdata_out);
-int syncop_rmdir (xlator_t *subvol, loc_t *loc, int flags, dict_t *xdata_in,
- dict_t **xdata_out);
+int
+syncop_rmdir(xlator_t *subvol, loc_t *loc, int flags, dict_t *xdata_in,
+ dict_t **xdata_out);
-int syncop_fsync (xlator_t *subvol, fd_t *fd, int dataonly,
- struct iatt *preiatt, struct iatt *postiatt,
- dict_t *xdata_in, dict_t **xdata_out);
+int
+syncop_fsync(xlator_t *subvol, fd_t *fd, int dataonly, struct iatt *preiatt,
+ struct iatt *postiatt, dict_t *xdata_in, dict_t **xdata_out);
-int syncop_flush (xlator_t *subvol, fd_t *fd, dict_t *xdata_in,
- dict_t **xdata_out);
+int
+syncop_flush(xlator_t *subvol, fd_t *fd, dict_t *xdata_in, dict_t **xdata_out);
-int syncop_fstat (xlator_t *subvol, fd_t *fd, struct iatt *stbuf,
- dict_t *xdata_in, dict_t **xdata_out);
+int
+syncop_fstat(xlator_t *subvol, fd_t *fd, struct iatt *stbuf, dict_t *xdata_in,
+ dict_t **xdata_out);
-int syncop_stat (xlator_t *subvol, loc_t *loc, struct iatt *stbuf,
- dict_t *xdata_in, dict_t **xdata_out);
+int
+syncop_stat(xlator_t *subvol, loc_t *loc, struct iatt *stbuf, dict_t *xdata_in,
+ dict_t **xdata_out);
-int syncop_symlink (xlator_t *subvol, loc_t *loc, const char *newpath,
- struct iatt *iatt,
- dict_t *xdata_in, dict_t **xdata_out);
+int
+syncop_symlink(xlator_t *subvol, loc_t *loc, const char *newpath,
+ struct iatt *iatt, dict_t *xdata_in, dict_t **xdata_out);
-int syncop_readlink (xlator_t *subvol, loc_t *loc, char **buffer, size_t size,
- dict_t *xdata_in, dict_t **xdata_out);
+int
+syncop_readlink(xlator_t *subvol, loc_t *loc, char **buffer, size_t size,
+ dict_t *xdata_in, dict_t **xdata_out);
-int syncop_mknod (xlator_t *subvol, loc_t *loc, mode_t mode, dev_t rdev,
- struct iatt *iatt, dict_t *xdata_in, dict_t **xdata_out);
+int
+syncop_mknod(xlator_t *subvol, loc_t *loc, mode_t mode, dev_t rdev,
+ struct iatt *iatt, dict_t *xdata_in, dict_t **xdata_out);
-int syncop_mkdir (xlator_t *subvol, loc_t *loc, mode_t mode, struct iatt *iatt,
- dict_t *xdata_in, dict_t **xdata_out);
+int
+syncop_mkdir(xlator_t *subvol, loc_t *loc, mode_t mode, struct iatt *iatt,
+ dict_t *xdata_in, dict_t **xdata_out);
-int syncop_link (xlator_t *subvol, loc_t *oldloc, loc_t *newloc,
- struct iatt *iatt, dict_t *xdata_in, dict_t **xdata_out);
+int
+syncop_link(xlator_t *subvol, loc_t *oldloc, loc_t *newloc, struct iatt *iatt,
+ dict_t *xdata_in, dict_t **xdata_out);
-int syncop_fsyncdir (xlator_t *subvol, fd_t *fd, int datasync,
- dict_t *xdata_in, dict_t **xdata_out);
+int
+syncop_fsyncdir(xlator_t *subvol, fd_t *fd, int datasync, dict_t *xdata_in,
+ dict_t **xdata_out);
-int syncop_access (xlator_t *subvol, loc_t *loc, int32_t mask,
- dict_t *xdata_in, dict_t **xdata_out);
+int
+syncop_access(xlator_t *subvol, loc_t *loc, int32_t mask, dict_t *xdata_in,
+ dict_t **xdata_out);
-int syncop_fallocate(xlator_t *subvol, fd_t *fd, int32_t keep_size,
- off_t offset, size_t len, dict_t *xdata_in,
- dict_t **xdata_out);
+int
+syncop_fallocate(xlator_t *subvol, fd_t *fd, int32_t keep_size, off_t offset,
+ size_t len, dict_t *xdata_in, dict_t **xdata_out);
-int syncop_discard(xlator_t *subvol, fd_t *fd, off_t offset, size_t len,
- dict_t *xdata_in, dict_t **xdata_out);
+int
+syncop_discard(xlator_t *subvol, fd_t *fd, off_t offset, size_t len,
+ dict_t *xdata_in, dict_t **xdata_out);
-int syncop_zerofill(xlator_t *subvol, fd_t *fd, off_t offset, off_t len,
- dict_t *xdata_in, dict_t **xdata_out);
+int
+syncop_zerofill(xlator_t *subvol, fd_t *fd, off_t offset, off_t len,
+ dict_t *xdata_in, dict_t **xdata_out);
-int syncop_rename (xlator_t *subvol, loc_t *oldloc, loc_t *newloc,
- dict_t *xdata_in, dict_t **xdata_out);
+int
+syncop_rename(xlator_t *subvol, loc_t *oldloc, loc_t *newloc, dict_t *xdata_in,
+ dict_t **xdata_out);
-int syncop_lk (xlator_t *subvol, fd_t *fd, int cmd, struct gf_flock *flock,
- dict_t *xdata_in, dict_t **xdata_out);
+int
+syncop_lk(xlator_t *subvol, fd_t *fd, int cmd, struct gf_flock *flock,
+ dict_t *xdata_in, dict_t **xdata_out);
-int syncop_inodelk (xlator_t *subvol, const char *volume, loc_t *loc,
- int32_t cmd, struct gf_flock *lock, dict_t *xdata_in,
- dict_t **xdata_out);
+int
+syncop_inodelk(xlator_t *subvol, const char *volume, loc_t *loc, int32_t cmd,
+ struct gf_flock *lock, dict_t *xdata_in, dict_t **xdata_out);
-int syncop_lease (xlator_t *subvol, loc_t *loc, struct gf_lease *lease,
- dict_t *xdata_in, dict_t **xdata_out);
+int
+syncop_lease(xlator_t *subvol, loc_t *loc, struct gf_lease *lease,
+ dict_t *xdata_in, dict_t **xdata_out);
-int syncop_ipc (xlator_t *subvol, int op, dict_t *xdata_in, dict_t **xdata_out);
+int
+syncop_ipc(xlator_t *subvol, int op, dict_t *xdata_in, dict_t **xdata_out);
-int syncop_xattrop (xlator_t *subvol, loc_t *loc, gf_xattrop_flags_t flags,
- dict_t *dict, dict_t *xdata_in, dict_t **dict_out,
- dict_t **xdata_out);
+int
+syncop_xattrop(xlator_t *subvol, loc_t *loc, gf_xattrop_flags_t flags,
+ dict_t *dict, dict_t *xdata_in, dict_t **dict_out,
+ dict_t **xdata_out);
int
-syncop_fxattrop (xlator_t *subvol, fd_t *fd, gf_xattrop_flags_t flags,
- dict_t *dict, dict_t *xdata_in, dict_t **dict_out,
- dict_t **xdata_out);
+syncop_fxattrop(xlator_t *subvol, fd_t *fd, gf_xattrop_flags_t flags,
+ dict_t *dict, dict_t *xdata_in, dict_t **dict_out,
+ dict_t **xdata_out);
int
-syncop_seek (xlator_t *subvol, fd_t *fd, off_t offset, gf_seek_what_t what,
- dict_t *xdata_in, off_t *off);
+syncop_seek(xlator_t *subvol, fd_t *fd, off_t offset, gf_seek_what_t what,
+ dict_t *xdata_in, off_t *off);
int
-syncop_getactivelk (xlator_t *subvol, loc_t *loc, lock_migration_info_t *locklist,
- dict_t *xdata_in, dict_t **xdata_out);
+syncop_getactivelk(xlator_t *subvol, loc_t *loc,
+ lock_migration_info_t *locklist, dict_t *xdata_in,
+ dict_t **xdata_out);
int
-syncop_setactivelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, dict_t *xdata);
+syncop_setactivelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *xdata);
int
-syncop_setactivelk (xlator_t *subvol, loc_t *loc,
- lock_migration_info_t *locklist, dict_t *xdata_in,
- dict_t **xdata_out);
+syncop_setactivelk(xlator_t *subvol, loc_t *loc,
+ lock_migration_info_t *locklist, dict_t *xdata_in,
+ dict_t **xdata_out);
int
-syncop_put (xlator_t *subvol, loc_t *loc, mode_t mode, mode_t umask,
- uint32_t flags, struct iovec *vector, int32_t count,
- off_t offset, struct iobref *iobref, dict_t *xattr,
- struct iatt *iatt, dict_t *xdata_in, dict_t **xdata_out);
+syncop_put(xlator_t *subvol, loc_t *loc, mode_t mode, mode_t umask,
+ uint32_t flags, struct iovec *vector, int32_t count, off_t offset,
+ struct iobref *iobref, dict_t *xattr, struct iatt *iatt,
+ dict_t *xdata_in, dict_t **xdata_out);
int
-syncop_setactivelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, dict_t *xdata);
+syncop_setactivelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *xdata);
int
-syncop_icreate (xlator_t *subvol, loc_t *loc, mode_t mode, dict_t *xdata_out);
+syncop_icreate(xlator_t *subvol, loc_t *loc, mode_t mode, dict_t *xdata_out);
int
-syncop_namelink (xlator_t *subvol, loc_t *loc, dict_t *xdata_out);
+syncop_namelink(xlator_t *subvol, loc_t *loc, dict_t *xdata_out);
int
-syncop_entrylk (xlator_t *subvol, const char *volume, loc_t *loc,
- const char *basename, entrylk_cmd cmd, entrylk_type type,
- dict_t *xdata_in, dict_t **xdata_out);
+syncop_entrylk(xlator_t *subvol, const char *volume, loc_t *loc,
+ const char *basename, entrylk_cmd cmd, entrylk_type type,
+ dict_t *xdata_in, dict_t **xdata_out);
#endif /* _SYNCOP_H */
diff --git a/libglusterfs/src/syscall.h b/libglusterfs/src/syscall.h
index 032ff70ffb6..f691ebdaa53 100644
--- a/libglusterfs/src/syscall.h
+++ b/libglusterfs/src/syscall.h
@@ -18,7 +18,7 @@
#include <sys/time.h>
/* GF follows the Linux XATTR definition, which differs in Darwin. */
-#define GF_XATTR_CREATE 0x1 /* set value, fail if attr already exists */
+#define GF_XATTR_CREATE 0x1 /* set value, fail if attr already exists */
#define GF_XATTR_REPLACE 0x2 /* set value, fail if attr does not exist */
/* Linux kernel version 2.6.x don't have these defined
@@ -26,151 +26,150 @@
#ifndef XATTR_SECURITY_PREFIX
#define XATTR_SECURITY_PREFIX "security."
-#define XATTR_SECURITY_PREFIX_LEN (sizeof (XATTR_SECURITY_PREFIX) - 1)
+#define XATTR_SECURITY_PREFIX_LEN (sizeof(XATTR_SECURITY_PREFIX) - 1)
#endif
#ifndef XATTR_SYSTEM_PREFIX
#define XATTR_SYSTEM_PREFIX "system."
-#define XATTR_SYSTEM_PREFIX_LEN (sizeof (XATTR_SYSTEM_PREFIX) - 1)
+#define XATTR_SYSTEM_PREFIX_LEN (sizeof(XATTR_SYSTEM_PREFIX) - 1)
#endif
#ifndef XATTR_TRUSTED_PREFIX
#define XATTR_TRUSTED_PREFIX "trusted."
-#define XATTR_TRUSTED_PREFIX_LEN (sizeof (XATTR_TRUSTED_PREFIX) - 1)
+#define XATTR_TRUSTED_PREFIX_LEN (sizeof(XATTR_TRUSTED_PREFIX) - 1)
#endif
#ifndef XATTR_USER_PREFIX
#define XATTR_USER_PREFIX "user."
-#define XATTR_USER_PREFIX_LEN (sizeof (XATTR_USER_PREFIX) - 1)
+#define XATTR_USER_PREFIX_LEN (sizeof(XATTR_USER_PREFIX) - 1)
#endif
#if defined(GF_DARWIN_HOST_OS)
#include <sys/xattr.h>
#define XATTR_DARWIN_NOSECURITY XATTR_NOSECURITY
-#define XATTR_DARWIN_NODEFAULT XATTR_NODEFAULT
+#define XATTR_DARWIN_NODEFAULT XATTR_NODEFAULT
#define XATTR_DARWIN_SHOWCOMPRESSION XATTR_SHOWCOMPRESSION
#endif
-
int
-sys_lstat (const char *path, struct stat *buf);
+sys_lstat(const char *path, struct stat *buf);
int
-sys_stat (const char *path, struct stat *buf);
+sys_stat(const char *path, struct stat *buf);
int
-sys_fstat (int fd, struct stat *buf);
+sys_fstat(int fd, struct stat *buf);
int
-sys_fstatat (int dirfd, const char *pathname, struct stat *buf,
- int flags);
+sys_fstatat(int dirfd, const char *pathname, struct stat *buf, int flags);
int
-sys_open (const char *pathname, int flags, int mode);
+sys_open(const char *pathname, int flags, int mode);
int
-sys_openat (int dirfd, const char *pathname, int flags, int mode);
+sys_openat(int dirfd, const char *pathname, int flags, int mode);
-DIR *sys_opendir (const char *name);
+DIR *
+sys_opendir(const char *name);
struct dirent *
-sys_readdir (DIR *dir, struct dirent *de);
+sys_readdir(DIR *dir, struct dirent *de);
ssize_t
-sys_readlink (const char *path, char *buf, size_t bufsiz);
+sys_readlink(const char *path, char *buf, size_t bufsiz);
int
-sys_closedir (DIR *dir);
+sys_closedir(DIR *dir);
int
-sys_mknod (const char *pathname, mode_t mode, dev_t dev);
+sys_mknod(const char *pathname, mode_t mode, dev_t dev);
int
-sys_mkdir (const char *pathname, mode_t mode);
+sys_mkdir(const char *pathname, mode_t mode);
int
-sys_mkdirat (int dirfd, const char *pathname, mode_t mode);
+sys_mkdirat(int dirfd, const char *pathname, mode_t mode);
int
-sys_unlink (const char *pathname);
+sys_unlink(const char *pathname);
int
-sys_rmdir (const char *pathname);
+sys_rmdir(const char *pathname);
int
-sys_symlink (const char *oldpath, const char *newpath);
+sys_symlink(const char *oldpath, const char *newpath);
int
-sys_rename (const char *oldpath, const char *newpath);
+sys_rename(const char *oldpath, const char *newpath);
int
-sys_link (const char *oldpath, const char *newpath);
+sys_link(const char *oldpath, const char *newpath);
int
-sys_chmod (const char *path, mode_t mode);
+sys_chmod(const char *path, mode_t mode);
int
-sys_fchmod (int fd, mode_t mode);
+sys_fchmod(int fd, mode_t mode);
int
-sys_chown (const char *path, uid_t owner, gid_t group);
+sys_chown(const char *path, uid_t owner, gid_t group);
int
-sys_fchown (int fd, uid_t owner, gid_t group);
+sys_fchown(int fd, uid_t owner, gid_t group);
int
-sys_lchown (const char *path, uid_t owner, gid_t group);
+sys_lchown(const char *path, uid_t owner, gid_t group);
int
-sys_truncate (const char *path, off_t length);
+sys_truncate(const char *path, off_t length);
int
-sys_ftruncate (int fd, off_t length);
+sys_ftruncate(int fd, off_t length);
int
-sys_utimes (const char *filename, const struct timeval times[2]);
+sys_utimes(const char *filename, const struct timeval times[2]);
#if defined(HAVE_UTIMENSAT)
int
-sys_utimensat (int dirfd, const char *filename, const struct timespec times[2],
- int flags);
+sys_utimensat(int dirfd, const char *filename, const struct timespec times[2],
+ int flags);
#endif
int
-sys_futimes (int fd, const struct timeval times[2]);
+sys_futimes(int fd, const struct timeval times[2]);
int
-sys_creat (const char *pathname, mode_t mode);
+sys_creat(const char *pathname, mode_t mode);
ssize_t
-sys_readv (int fd, const struct iovec *iov, int iovcnt);
+sys_readv(int fd, const struct iovec *iov, int iovcnt);
ssize_t
-sys_writev (int fd, const struct iovec *iov, int iovcnt);
+sys_writev(int fd, const struct iovec *iov, int iovcnt);
ssize_t
-sys_read (int fd, void *buf, size_t count);
+sys_read(int fd, void *buf, size_t count);
ssize_t
-sys_write (int fd, const void *buf, size_t count);
+sys_write(int fd, const void *buf, size_t count);
off_t
-sys_lseek (int fd, off_t offset, int whence);
+sys_lseek(int fd, off_t offset, int whence);
int
-sys_statvfs (const char *path, struct statvfs *buf);
+sys_statvfs(const char *path, struct statvfs *buf);
int
-sys_fstatvfs (int fd, struct statvfs *buf);
+sys_fstatvfs(int fd, struct statvfs *buf);
int
-sys_close (int fd);
+sys_close(int fd);
int
-sys_fsync (int fd);
+sys_fsync(int fd);
int
-sys_fdatasync (int fd);
+sys_fdatasync(int fd);
void
gf_add_prefix(const char *ns, const char *key, char **newkey);
@@ -179,42 +178,42 @@ void
gf_remove_prefix(const char *ns, const char *key, char **newkey);
int
-sys_lsetxattr (const char *path, const char *name, const void *value,
- size_t size, int flags);
+sys_lsetxattr(const char *path, const char *name, const void *value,
+ size_t size, int flags);
ssize_t
-sys_llistxattr (const char *path, char *list, size_t size);
+sys_llistxattr(const char *path, char *list, size_t size);
ssize_t
-sys_lgetxattr (const char *path, const char *name, void *value, size_t size);
+sys_lgetxattr(const char *path, const char *name, void *value, size_t size);
ssize_t
-sys_fgetxattr (int filedes, const char *name, void *value, size_t size);
+sys_fgetxattr(int filedes, const char *name, void *value, size_t size);
int
-sys_fsetxattr (int filedes, const char *name, const void *value,
- size_t size, int flags);
+sys_fsetxattr(int filedes, const char *name, const void *value, size_t size,
+ int flags);
ssize_t
-sys_flistxattr (int filedes, char *list, size_t size);
+sys_flistxattr(int filedes, char *list, size_t size);
int
-sys_lremovexattr (const char *path, const char *name);
+sys_lremovexattr(const char *path, const char *name);
int
-sys_fremovexattr (int filedes, const char *name);
+sys_fremovexattr(int filedes, const char *name);
int
-sys_access (const char *pathname, int mode);
+sys_access(const char *pathname, int mode);
int
sys_fallocate(int fd, int mode, off_t offset, off_t len);
ssize_t
-sys_preadv (int fd, const struct iovec *iov, int iovcnt, off_t offset);
+sys_preadv(int fd, const struct iovec *iov, int iovcnt, off_t offset);
ssize_t
-sys_pwritev (int fd, const struct iovec *iov, int iovcnt, off_t offset);
+sys_pwritev(int fd, const struct iovec *iov, int iovcnt, off_t offset);
ssize_t
sys_pread(int fd, void *buf, size_t count, off_t offset);
diff --git a/libglusterfs/src/template-component-messages.h b/libglusterfs/src/template-component-messages.h
index 0f0062a5d7c..4dcdda4abf4 100644
--- a/libglusterfs/src/template-component-messages.h
+++ b/libglusterfs/src/template-component-messages.h
@@ -23,10 +23,6 @@
* glfs-message-id.h.
*/
-GLFS_MSGID(component,
- message id,
- message id,
- ...
-);
+GLFS_MSGID(component, message id, message id, ...);
#endif /* !_component_MESSAGES_H_ */
diff --git a/libglusterfs/src/throttle-tbf.h b/libglusterfs/src/throttle-tbf.h
index b6e04962ca4..b44a0f1fdd5 100644
--- a/libglusterfs/src/throttle-tbf.h
+++ b/libglusterfs/src/throttle-tbf.h
@@ -16,59 +16,59 @@
#define THROTTLE_TBF_H__
typedef enum tbf_ops {
- TBF_OP_MIN = -1,
- TBF_OP_HASH = 0, /* checksum calculation */
- TBF_OP_READ = 1, /* inode read(s) */
- TBF_OP_READDIR = 2, /* dentry read(s) */
- TBF_OP_MAX = 3,
+ TBF_OP_MIN = -1,
+ TBF_OP_HASH = 0, /* checksum calculation */
+ TBF_OP_READ = 1, /* inode read(s) */
+ TBF_OP_READDIR = 2, /* dentry read(s) */
+ TBF_OP_MAX = 3,
} tbf_ops_t;
/**
* Operation rate specification
*/
typedef struct tbf_opspec {
- tbf_ops_t op;
+ tbf_ops_t op;
- unsigned long rate;
+ unsigned long rate;
- unsigned long maxlimit;
+ unsigned long maxlimit;
- unsigned long token_gen_interval;/* Token generation interval in usec */
+ unsigned long token_gen_interval; /* Token generation interval in usec */
} tbf_opspec_t;
/**
* Token bucket for each operation type
*/
typedef struct tbf_bucket {
- gf_lock_t lock;
+ gf_lock_t lock;
- pthread_t tokener; /* token generator thread */
+ pthread_t tokener; /* token generator thread */
- unsigned long tokenrate; /* token generation rate */
+ unsigned long tokenrate; /* token generation rate */
- unsigned long tokens; /* number of current tokens */
+ unsigned long tokens; /* number of current tokens */
- unsigned long maxtokens; /* maximum token in the bucket */
+ unsigned long maxtokens; /* maximum token in the bucket */
- struct list_head queued; /* list of non-conformant requests */
+ struct list_head queued; /* list of non-conformant requests */
- unsigned long token_gen_interval;/* Token generation interval in usec */
+ unsigned long token_gen_interval; /* Token generation interval in usec */
} tbf_bucket_t;
typedef struct tbf {
- tbf_bucket_t **bucket;
+ tbf_bucket_t **bucket;
} tbf_t;
tbf_t *
-tbf_init (tbf_opspec_t *, unsigned int);
+tbf_init(tbf_opspec_t *, unsigned int);
int
-tbf_mod (tbf_t *, tbf_opspec_t *);
+tbf_mod(tbf_t *, tbf_opspec_t *);
void
-tbf_throttle (tbf_t *, tbf_ops_t, unsigned long);
+tbf_throttle(tbf_t *, tbf_ops_t, unsigned long);
-#define TBF_THROTTLE_BEGIN(tbf, op, tokens) (tbf_throttle (tbf, op, tokens))
+#define TBF_THROTTLE_BEGIN(tbf, op, tokens) (tbf_throttle(tbf, op, tokens))
#define TBF_THROTTLE_END(tbf, op, tokens)
#endif /** THROTTLE_TBF_H__ */
diff --git a/libglusterfs/src/tier-ctr-interface.h b/libglusterfs/src/tier-ctr-interface.h
index cfd3f8a5e5d..8a627542c0c 100644
--- a/libglusterfs/src/tier-ctr-interface.h
+++ b/libglusterfs/src/tier-ctr-interface.h
@@ -33,12 +33,12 @@
*
*/
typedef struct gfdb_ipc_ctr_params {
- gf_boolean_t is_promote;
- int write_freq_threshold;
- int read_freq_threshold;
- gfdb_time_t time_stamp;
- int query_limit;
- gf_boolean_t emergency_demote;
+ gf_boolean_t is_promote;
+ int write_freq_threshold;
+ int read_freq_threshold;
+ gfdb_time_t time_stamp;
+ int query_limit;
+ gf_boolean_t emergency_demote;
} gfdb_ipc_ctr_params_t;
#endif
diff --git a/libglusterfs/src/timer.h b/libglusterfs/src/timer.h
index 32b246cf00d..216fc65144a 100644
--- a/libglusterfs/src/timer.h
+++ b/libglusterfs/src/timer.h
@@ -16,43 +16,40 @@
#include <sys/time.h>
#include <pthread.h>
-typedef void (*gf_timer_cbk_t) (void *);
+typedef void (*gf_timer_cbk_t)(void *);
struct _gf_timer {
- union {
- struct list_head list;
- struct {
- struct _gf_timer *next;
- struct _gf_timer *prev;
- };
+ union {
+ struct list_head list;
+ struct {
+ struct _gf_timer *next;
+ struct _gf_timer *prev;
};
- struct timespec at;
- gf_timer_cbk_t callbk;
- void *data;
- xlator_t *xl;
- gf_boolean_t fired;
+ };
+ struct timespec at;
+ gf_timer_cbk_t callbk;
+ void *data;
+ xlator_t *xl;
+ gf_boolean_t fired;
};
struct _gf_timer_registry {
- pthread_t th;
- char fin;
- struct list_head active;
- gf_lock_t lock;
+ pthread_t th;
+ char fin;
+ struct list_head active;
+ gf_lock_t lock;
};
typedef struct _gf_timer gf_timer_t;
typedef struct _gf_timer_registry gf_timer_registry_t;
gf_timer_t *
-gf_timer_call_after (glusterfs_ctx_t *ctx,
- struct timespec delta,
- gf_timer_cbk_t cbk,
- void *data);
+gf_timer_call_after(glusterfs_ctx_t *ctx, struct timespec delta,
+ gf_timer_cbk_t cbk, void *data);
int32_t
-gf_timer_call_cancel (glusterfs_ctx_t *ctx,
- gf_timer_t *event);
+gf_timer_call_cancel(glusterfs_ctx_t *ctx, gf_timer_t *event);
void
-gf_timer_registry_destroy (glusterfs_ctx_t *ctx);
+gf_timer_registry_destroy(glusterfs_ctx_t *ctx);
#endif /* _TIMER_H */
diff --git a/libglusterfs/src/timespec.h b/libglusterfs/src/timespec.h
index 9c393ee7166..73db2d16abe 100644
--- a/libglusterfs/src/timespec.h
+++ b/libglusterfs/src/timespec.h
@@ -14,14 +14,16 @@
#include <stdint.h>
#include <sys/time.h>
-#define TS(ts) ((ts.tv_sec * 1000000000LL) + ts.tv_nsec)
+#define TS(ts) ((ts.tv_sec * 1000000000LL) + ts.tv_nsec)
#define NANO (+1.0E-9)
#define GIGA UINT64_C(1000000000)
-void timespec_now (struct timespec *ts);
-void timespec_adjust_delta (struct timespec *ts, struct timespec delta);
-void timespec_sub (const struct timespec *begin,
- const struct timespec *end,
- struct timespec *res);
+void
+timespec_now(struct timespec *ts);
+void
+timespec_adjust_delta(struct timespec *ts, struct timespec delta);
+void
+timespec_sub(const struct timespec *begin, const struct timespec *end,
+ struct timespec *res);
#endif /* __INCLUDE_TIMESPEC_H__ */
diff --git a/libglusterfs/src/trie.h b/libglusterfs/src/trie.h
index f7a4deee02f..6d2d8015964 100644
--- a/libglusterfs/src/trie.h
+++ b/libglusterfs/src/trie.h
@@ -18,29 +18,35 @@ struct trie;
typedef struct trie trie_t;
struct trienodevec {
- trienode_t **nodes;
- unsigned cnt;
+ trienode_t **nodes;
+ unsigned cnt;
};
+trie_t *
+trie_new();
-trie_t *trie_new ();
+int
+trie_add(trie_t *trie, const char *word);
-int trie_add (trie_t *trie, const char *word);
+void
+trie_destroy(trie_t *trie);
-void trie_destroy (trie_t *trie);
+void
+trie_destroy_bynode(trienode_t *node);
-void trie_destroy_bynode (trienode_t *node);
+int
+trie_measure(trie_t *trie, const char *word, trienode_t **nodes, int nodecnt);
-int trie_measure (trie_t *trie, const char *word, trienode_t **nodes,
- int nodecnt);
+int
+trie_measure_vec(trie_t *trie, const char *word, struct trienodevec *nodevec);
-int trie_measure_vec (trie_t *trie, const char *word,
- struct trienodevec *nodevec);
+void
+trie_reset_search(trie_t *trie);
-void trie_reset_search (trie_t *trie);
+int
+trienode_get_dist(trienode_t *node);
-int trienode_get_dist (trienode_t *node);
-
-int trienode_get_word (trienode_t *node, char **buf);
+int
+trienode_get_word(trienode_t *node, char **buf);
#endif
diff --git a/libglusterfs/src/unittest/unittest.h b/libglusterfs/src/unittest/unittest.h
index 6320217db0d..58b3e28bb6e 100644
--- a/libglusterfs/src/unittest/unittest.h
+++ b/libglusterfs/src/unittest/unittest.h
@@ -18,8 +18,9 @@
#include <cmocka_pbc.h>
#include <cmocka.h>
-extern void mock_assert(const int result, const char* const expression,
- const char * const file, const int line);
+extern void
+mock_assert(const int result, const char *const expression,
+ const char *const file, const int line);
// Change GF_CALLOC and GF_FREE to use
// cmocka memory allocation versions
@@ -30,16 +31,17 @@ extern void mock_assert(const int result, const char* const expression,
#define GF_FREE test_free
/* Catch intended assert()'s while unit-testing */
-extern void mock_assert(const int result, const char* const expression,
- const char * const file, const int line);
+extern void
+mock_assert(const int result, const char *const expression,
+ const char *const file, const int line);
#undef assert
-#define assert(expression) \
- mock_assert((int)(expression), #expression, __FILE__, __LINE__);
+#define assert(expression) \
+ mock_assert((int)(expression), #expression, __FILE__, __LINE__);
#endif
#else
#define REQUIRE(p) /**/
-#define ENSURE(p) /**/
+#define ENSURE(p) /**/
#endif
#endif /* _GF_UNITTEST */
diff --git a/libglusterfs/src/upcall-utils.h b/libglusterfs/src/upcall-utils.h
index 48d10382c10..765b8ef1aa6 100644
--- a/libglusterfs/src/upcall-utils.h
+++ b/libglusterfs/src/upcall-utils.h
@@ -16,93 +16,95 @@
#include "compat.h"
/* Flags sent for cache_invalidation */
-#define UP_NLINK 0x00000001 /* update nlink */
-#define UP_MODE 0x00000002 /* update mode and ctime */
-#define UP_OWN 0x00000004 /* update mode,uid,gid and ctime */
-#define UP_SIZE 0x00000008 /* update fsize */
-#define UP_TIMES 0x00000010 /* update all times */
-#define UP_ATIME 0x00000020 /* update atime only */
-#define UP_PERM 0x00000040 /* update fields needed for permission
- checking */
-#define UP_RENAME 0x00000080 /* this is a rename op - delete the cache
- entry */
-#define UP_FORGET 0x00000100 /* inode_forget on server side -
- invalidate the cache entry */
-#define UP_PARENT_TIMES 0x00000200 /* update parent dir times */
-
-#define UP_XATTR 0x00000400 /* update the xattrs and ctime */
-#define UP_XATTR_RM 0x00000800 /* Remove the xattrs and update ctime */
+#define UP_NLINK 0x00000001 /* update nlink */
+#define UP_MODE 0x00000002 /* update mode and ctime */
+#define UP_OWN 0x00000004 /* update mode,uid,gid and ctime */
+#define UP_SIZE 0x00000008 /* update fsize */
+#define UP_TIMES 0x00000010 /* update all times */
+#define UP_ATIME 0x00000020 /* update atime only */
+#define UP_PERM \
+ 0x00000040 /* update fields needed for permission \
+ checking */
+#define UP_RENAME \
+ 0x00000080 /* this is a rename op - delete the cache \
+ entry */
+#define UP_FORGET \
+ 0x00000100 /* inode_forget on server side - \
+ invalidate the cache entry */
+#define UP_PARENT_TIMES 0x00000200 /* update parent dir times */
+
+#define UP_XATTR 0x00000400 /* update the xattrs and ctime */
+#define UP_XATTR_RM 0x00000800 /* Remove the xattrs and update ctime */
#define UP_EXPLICIT_LOOKUP 0x00001000 /* Request an explicit lookup */
-#define UP_INVAL_ATTR 0x00002000 /* Request to invalidate iatt and xatt */
+#define UP_INVAL_ATTR 0x00002000 /* Request to invalidate iatt and xatt */
/* for fops - open, read, lk, */
-#define UP_UPDATE_CLIENT (UP_ATIME)
+#define UP_UPDATE_CLIENT (UP_ATIME)
/* for fop - write, truncate */
-#define UP_WRITE_FLAGS (UP_SIZE | UP_TIMES)
+#define UP_WRITE_FLAGS (UP_SIZE | UP_TIMES)
/* for fop - setattr */
-#define UP_ATTR_FLAGS (UP_SIZE | UP_TIMES | UP_OWN | UP_MODE | \
- UP_PERM)
+#define UP_ATTR_FLAGS (UP_SIZE | UP_TIMES | UP_OWN | UP_MODE | UP_PERM)
/* for fop - rename */
-#define UP_RENAME_FLAGS (UP_RENAME)
+#define UP_RENAME_FLAGS (UP_RENAME)
/* to invalidate parent directory entries for fops -rename, unlink, rmdir,
* mkdir, create */
-#define UP_PARENT_DENTRY_FLAGS (UP_PARENT_TIMES)
+#define UP_PARENT_DENTRY_FLAGS (UP_PARENT_TIMES)
/* for fop - unlink, link, rmdir, mkdir */
-#define UP_NLINK_FLAGS (UP_NLINK | UP_TIMES)
+#define UP_NLINK_FLAGS (UP_NLINK | UP_TIMES)
-#define IATT_UPDATE_FLAGS (UP_NLINK | UP_MODE | UP_OWN | UP_SIZE | \
- UP_TIMES | UP_ATIME | UP_PERM)
+#define IATT_UPDATE_FLAGS \
+ (UP_NLINK | UP_MODE | UP_OWN | UP_SIZE | UP_TIMES | UP_ATIME | UP_PERM)
typedef enum {
- GF_UPCALL_EVENT_NULL,
- GF_UPCALL_CACHE_INVALIDATION,
- GF_UPCALL_RECALL_LEASE,
- GF_UPCALL_INODELK_CONTENTION,
- GF_UPCALL_ENTRYLK_CONTENTION,
+ GF_UPCALL_EVENT_NULL,
+ GF_UPCALL_CACHE_INVALIDATION,
+ GF_UPCALL_RECALL_LEASE,
+ GF_UPCALL_INODELK_CONTENTION,
+ GF_UPCALL_ENTRYLK_CONTENTION,
} gf_upcall_event_t;
struct gf_upcall {
- char *client_uid;
- uuid_t gfid;
- uint32_t event_type;
- void *data;
+ char *client_uid;
+ uuid_t gfid;
+ uint32_t event_type;
+ void *data;
};
struct gf_upcall_cache_invalidation {
- uint32_t flags;
- uint32_t expire_time_attr;
- struct iatt stat;
- struct iatt p_stat; /* parent dir stat */
- struct iatt oldp_stat; /* oldparent dir stat */
- dict_t *dict; /* For xattrs */
+ uint32_t flags;
+ uint32_t expire_time_attr;
+ struct iatt stat;
+ struct iatt p_stat; /* parent dir stat */
+ struct iatt oldp_stat; /* oldparent dir stat */
+ dict_t *dict; /* For xattrs */
};
struct gf_upcall_recall_lease {
- uint32_t lease_type; /* Lease type to which client can downgrade to*/
- uuid_t tid; /* transaction id of the fop that caused
- the recall */
- dict_t *dict;
+ uint32_t lease_type; /* Lease type to which client can downgrade to*/
+ uuid_t tid; /* transaction id of the fop that caused
+ the recall */
+ dict_t *dict;
};
struct gf_upcall_inodelk_contention {
- struct gf_flock flock;
- pid_t pid;
- const char *domain;
- dict_t *xdata;
+ struct gf_flock flock;
+ pid_t pid;
+ const char *domain;
+ dict_t *xdata;
};
struct gf_upcall_entrylk_contention {
- uint32_t type;
- pid_t pid;
- const char *name;
- const char *domain;
- dict_t *xdata;
+ uint32_t type;
+ pid_t pid;
+ const char *name;
+ const char *domain;
+ dict_t *xdata;
};
#endif /* _UPCALL_UTILS_H */
diff --git a/libglusterfs/src/xlator.h b/libglusterfs/src/xlator.h
index e0b8207444c..12078bb72e3 100644
--- a/libglusterfs/src/xlator.h
+++ b/libglusterfs/src/xlator.h
@@ -27,20 +27,20 @@
#define FIRST_CHILD(xl) (xl->children->xlator)
#define SECOND_CHILD(xl) (xl->children->next->xlator)
-#define GF_SET_ATTR_MODE 0x1
-#define GF_SET_ATTR_UID 0x2
-#define GF_SET_ATTR_GID 0x4
-#define GF_SET_ATTR_SIZE 0x8
+#define GF_SET_ATTR_MODE 0x1
+#define GF_SET_ATTR_UID 0x2
+#define GF_SET_ATTR_GID 0x4
+#define GF_SET_ATTR_SIZE 0x8
#define GF_SET_ATTR_ATIME 0x10
#define GF_SET_ATTR_MTIME 0x20
#define GF_SET_ATTR_CTIME 0x40
-#define gf_attr_mode_set(mode) ((mode) & GF_SET_ATTR_MODE)
-#define gf_attr_uid_set(mode) ((mode) & GF_SET_ATTR_UID)
-#define gf_attr_gid_set(mode) ((mode) & GF_SET_ATTR_GID)
-#define gf_attr_size_set(mode) ((mode) & GF_SET_ATTR_SIZE)
-#define gf_attr_atime_set(mode) ((mode) & GF_SET_ATTR_ATIME)
-#define gf_attr_mtime_set(mode) ((mode) & GF_SET_ATTR_MTIME)
+#define gf_attr_mode_set(mode) ((mode)&GF_SET_ATTR_MODE)
+#define gf_attr_uid_set(mode) ((mode)&GF_SET_ATTR_UID)
+#define gf_attr_gid_set(mode) ((mode)&GF_SET_ATTR_GID)
+#define gf_attr_size_set(mode) ((mode)&GF_SET_ATTR_SIZE)
+#define gf_attr_atime_set(mode) ((mode)&GF_SET_ATTR_ATIME)
+#define gf_attr_mtime_set(mode) ((mode)&GF_SET_ATTR_MTIME)
struct _xlator;
typedef struct _xlator xlator_t;
@@ -51,9 +51,8 @@ typedef struct _gf_dirent gf_dirent_t;
struct _loc;
typedef struct _loc loc_t;
-
-typedef int32_t (*event_notify_fn_t) (xlator_t *this, int32_t event, void *data,
- ...);
+typedef int32_t (*event_notify_fn_t)(xlator_t *this, int32_t event, void *data,
+ ...);
#include "list.h"
#include "gf-dirent.h"
@@ -64,1003 +63,792 @@ typedef int32_t (*event_notify_fn_t) (xlator_t *this, int32_t event, void *data,
#include "options.h"
#include "client_t.h"
-
struct _loc {
- const char *path;
- const char *name;
- inode_t *inode;
- inode_t *parent;
- /* Currently all location based operations are through 'gfid' of inode.
- * But the 'inode->gfid' only gets set in higher most layer (as in,
- * 'fuse', 'protocol/server', or 'nfs/server'). So if translators want
- * to send fops on a inode before the 'inode->gfid' is set, they have to
- * make use of below 'gfid' fields
- */
- uuid_t gfid;
- uuid_t pargfid;
+ const char *path;
+ const char *name;
+ inode_t *inode;
+ inode_t *parent;
+ /* Currently all location based operations are through 'gfid' of inode.
+ * But the 'inode->gfid' only gets set in higher most layer (as in,
+ * 'fuse', 'protocol/server', or 'nfs/server'). So if translators want
+ * to send fops on a inode before the 'inode->gfid' is set, they have to
+ * make use of below 'gfid' fields
+ */
+ uuid_t gfid;
+ uuid_t pargfid;
};
+typedef int32_t (*fop_getspec_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, char *spec_data);
-typedef int32_t (*fop_getspec_cbk_t) (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno,
- char *spec_data);
-
-typedef int32_t (*fop_rchecksum_cbk_t) (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno,
- uint32_t weak_checksum,
- uint8_t *strong_checksum,
- dict_t *xdata);
-
-
-typedef int32_t (*fop_getspec_t) (call_frame_t *frame,
- xlator_t *this,
- const char *key,
- int32_t flag);
-
-typedef int32_t (*fop_rchecksum_t) (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd, off_t offset,
- int32_t len, dict_t *xdata);
-
-
-typedef int32_t (*fop_lookup_cbk_t) (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno,
- inode_t *inode,
- struct iatt *buf,
- dict_t *xdata,
- struct iatt *postparent);
-
-typedef int32_t (*fop_stat_cbk_t) (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno,
- struct iatt *buf, dict_t *xdata);
-
-typedef int32_t (*fop_fstat_cbk_t) (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno,
- struct iatt *buf, dict_t *xdata);
-
-typedef int32_t (*fop_truncate_cbk_t) (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno,
- struct iatt *prebuf,
+typedef int32_t (*fop_rchecksum_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, uint32_t weak_checksum,
+ uint8_t *strong_checksum, dict_t *xdata);
+
+typedef int32_t (*fop_getspec_t)(call_frame_t *frame, xlator_t *this,
+ const char *key, int32_t flag);
+
+typedef int32_t (*fop_rchecksum_t)(call_frame_t *frame, xlator_t *this,
+ fd_t *fd, off_t offset, int32_t len,
+ dict_t *xdata);
+
+typedef int32_t (*fop_lookup_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, inode_t *inode,
+ struct iatt *buf, dict_t *xdata,
+ struct iatt *postparent);
+
+typedef int32_t (*fop_stat_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, struct iatt *buf,
+ dict_t *xdata);
+
+typedef int32_t (*fop_fstat_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, struct iatt *buf,
+ dict_t *xdata);
+
+typedef int32_t (*fop_truncate_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, struct iatt *prebuf,
+ struct iatt *postbuf, dict_t *xdata);
+
+typedef int32_t (*fop_ftruncate_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, struct iatt *prebuf,
struct iatt *postbuf, dict_t *xdata);
-typedef int32_t (*fop_ftruncate_cbk_t) (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno,
- struct iatt *prebuf,
- struct iatt *postbuf, dict_t *xdata);
-
-typedef int32_t (*fop_access_cbk_t) (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno, dict_t *xdata);
+typedef int32_t (*fop_access_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, dict_t *xdata);
-typedef int32_t (*fop_readlink_cbk_t) (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno,
- const char *path,
- struct iatt *buf, dict_t *xdata);
-
-typedef int32_t (*fop_mknod_cbk_t) (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno,
- inode_t *inode,
- struct iatt *buf,
- struct iatt *preparent,
- struct iatt *postparent, dict_t *xdata);
+typedef int32_t (*fop_readlink_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, const char *path,
+ struct iatt *buf, dict_t *xdata);
-typedef int32_t (*fop_mkdir_cbk_t) (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno,
- inode_t *inode,
- struct iatt *buf,
- struct iatt *preparent,
- struct iatt *postparent, dict_t *xdata);
+typedef int32_t (*fop_mknod_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, inode_t *inode,
+ struct iatt *buf, struct iatt *preparent,
+ struct iatt *postparent, dict_t *xdata);
-typedef int32_t (*fop_unlink_cbk_t) (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno,
- struct iatt *preparent,
- struct iatt *postparent, dict_t *xdata);
+typedef int32_t (*fop_mkdir_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, inode_t *inode,
+ struct iatt *buf, struct iatt *preparent,
+ struct iatt *postparent, dict_t *xdata);
-typedef int32_t (*fop_rmdir_cbk_t) (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno,
- struct iatt *preparent,
+typedef int32_t (*fop_unlink_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, struct iatt *preparent,
struct iatt *postparent, dict_t *xdata);
-typedef int32_t (*fop_symlink_cbk_t) (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno,
- inode_t *inode,
- struct iatt *buf,
- struct iatt *preparent,
- struct iatt *postparent, dict_t *xdata);
-
-typedef int32_t (*fop_rename_cbk_t) (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno,
- struct iatt *buf,
- struct iatt *preoldparent,
- struct iatt *postoldparent,
- struct iatt *prenewparent,
- struct iatt *postnewparent, dict_t *xdata);
-
-typedef int32_t (*fop_link_cbk_t) (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno,
- inode_t *inode,
- struct iatt *buf,
- struct iatt *preparent,
+typedef int32_t (*fop_rmdir_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, struct iatt *preparent,
struct iatt *postparent, dict_t *xdata);
-typedef int32_t (*fop_create_cbk_t) (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno,
- fd_t *fd,
- inode_t *inode,
- struct iatt *buf,
- struct iatt *preparent,
+typedef int32_t (*fop_symlink_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, inode_t *inode,
+ struct iatt *buf, struct iatt *preparent,
struct iatt *postparent, dict_t *xdata);
-typedef int32_t (*fop_open_cbk_t) (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno,
- fd_t *fd, dict_t *xdata);
-
-typedef int32_t (*fop_readv_cbk_t) (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno,
- struct iovec *vector,
- int32_t count,
- struct iatt *stbuf,
- struct iobref *iobref, dict_t *xdata);
-
-typedef int32_t (*fop_writev_cbk_t) (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno,
- struct iatt *prebuf,
- struct iatt *postbuf, dict_t *xdata);
-
-typedef int32_t (*fop_flush_cbk_t) (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno, dict_t *xdata);
+typedef int32_t (*fop_rename_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, struct iatt *buf,
+ struct iatt *preoldparent,
+ struct iatt *postoldparent,
+ struct iatt *prenewparent,
+ struct iatt *postnewparent, dict_t *xdata);
+
+typedef int32_t (*fop_link_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, inode_t *inode,
+ struct iatt *buf, struct iatt *preparent,
+ struct iatt *postparent, dict_t *xdata);
+
+typedef int32_t (*fop_create_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, fd_t *fd, inode_t *inode,
+ struct iatt *buf, struct iatt *preparent,
+ struct iatt *postparent, dict_t *xdata);
+
+typedef int32_t (*fop_open_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, fd_t *fd, dict_t *xdata);
-typedef int32_t (*fop_fsync_cbk_t) (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno,
- struct iatt *prebuf,
+typedef int32_t (*fop_readv_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, struct iovec *vector,
+ int32_t count, struct iatt *stbuf,
+ struct iobref *iobref, dict_t *xdata);
+
+typedef int32_t (*fop_writev_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, struct iatt *prebuf,
struct iatt *postbuf, dict_t *xdata);
-typedef int32_t (*fop_opendir_cbk_t) (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno,
- fd_t *fd, dict_t *xdata);
+typedef int32_t (*fop_flush_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, dict_t *xdata);
-typedef int32_t (*fop_fsyncdir_cbk_t) (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno, dict_t *xdata);
+typedef int32_t (*fop_fsync_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, struct iatt *prebuf,
+ struct iatt *postbuf, dict_t *xdata);
-typedef int32_t (*fop_statfs_cbk_t) (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno,
- struct statvfs *buf, dict_t *xdata);
-
-typedef int32_t (*fop_setxattr_cbk_t) (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno, dict_t *xdata);
+typedef int32_t (*fop_opendir_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, fd_t *fd, dict_t *xdata);
-typedef int32_t (*fop_getxattr_cbk_t) (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno,
- dict_t *dict, dict_t *xdata);
-
-typedef int32_t (*fop_fsetxattr_cbk_t) (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno, dict_t *xdata);
-
-typedef int32_t (*fop_fgetxattr_cbk_t) (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno,
- dict_t *dict, dict_t *xdata);
-
-typedef int32_t (*fop_removexattr_cbk_t) (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno, dict_t *xdata);
+typedef int32_t (*fop_fsyncdir_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, dict_t *xdata);
-typedef int32_t (*fop_fremovexattr_cbk_t) (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno, dict_t *xdata);
-
-typedef int32_t (*fop_lk_cbk_t) (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno,
- struct gf_flock *flock, dict_t *xdata);
+typedef int32_t (*fop_statfs_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, struct statvfs *buf,
+ dict_t *xdata);
-typedef int32_t (*fop_inodelk_cbk_t) (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
+typedef int32_t (*fop_setxattr_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
int32_t op_errno, dict_t *xdata);
-typedef int32_t (*fop_finodelk_cbk_t) (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
+typedef int32_t (*fop_getxattr_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, dict_t *dict,
+ dict_t *xdata);
+
+typedef int32_t (*fop_fsetxattr_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
int32_t op_errno, dict_t *xdata);
-typedef int32_t (*fop_entrylk_cbk_t) (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
+typedef int32_t (*fop_fgetxattr_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, dict_t *dict,
+ dict_t *xdata);
+
+typedef int32_t (*fop_removexattr_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, dict_t *xdata);
+
+typedef int32_t (*fop_fremovexattr_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, dict_t *xdata);
+
+typedef int32_t (*fop_lk_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, struct gf_flock *flock,
+ dict_t *xdata);
+
+typedef int32_t (*fop_inodelk_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, dict_t *xdata);
+
+typedef int32_t (*fop_finodelk_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
int32_t op_errno, dict_t *xdata);
-typedef int32_t (*fop_fentrylk_cbk_t) (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno, dict_t *xdata);
+typedef int32_t (*fop_entrylk_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, dict_t *xdata);
-typedef int32_t (*fop_readdir_cbk_t) (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno,
- gf_dirent_t *entries, dict_t *xdata);
+typedef int32_t (*fop_fentrylk_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, dict_t *xdata);
-typedef int32_t (*fop_readdirp_cbk_t) (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno,
- gf_dirent_t *entries, dict_t *xdata);
+typedef int32_t (*fop_readdir_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, gf_dirent_t *entries,
+ dict_t *xdata);
-typedef int32_t (*fop_xattrop_cbk_t) (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno,
- dict_t *xattr, dict_t *xdata);
+typedef int32_t (*fop_readdirp_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, gf_dirent_t *entries,
+ dict_t *xdata);
-typedef int32_t (*fop_fxattrop_cbk_t) (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno,
- dict_t *xattr, dict_t *xdata);
+typedef int32_t (*fop_xattrop_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, dict_t *xattr,
+ dict_t *xdata);
+typedef int32_t (*fop_fxattrop_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, dict_t *xattr,
+ dict_t *xdata);
-typedef int32_t (*fop_setattr_cbk_t) (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
+typedef int32_t (*fop_setattr_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, struct iatt *preop_stbuf,
+ struct iatt *postop_stbuf, dict_t *xdata);
+
+typedef int32_t (*fop_fsetattr_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
int32_t op_errno,
struct iatt *preop_stbuf,
struct iatt *postop_stbuf, dict_t *xdata);
-typedef int32_t (*fop_fsetattr_cbk_t) (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
+typedef int32_t (*fop_fallocate_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
int32_t op_errno,
struct iatt *preop_stbuf,
- struct iatt *postop_stbuf, dict_t *xdata);
-
-typedef int32_t (*fop_fallocate_cbk_t) (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno,
- struct iatt *preop_stbuf,
- struct iatt *postop_stbuf, dict_t *xdata);
-
-typedef int32_t (*fop_discard_cbk_t) (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno,
- struct iatt *preop_stbuf,
- struct iatt *postop_stbuf, dict_t *xdata);
+ struct iatt *postop_stbuf,
+ dict_t *xdata);
+
+typedef int32_t (*fop_discard_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, struct iatt *preop_stbuf,
+ struct iatt *postop_stbuf, dict_t *xdata);
-typedef int32_t (*fop_zerofill_cbk_t) (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
+typedef int32_t (*fop_zerofill_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
int32_t op_errno,
struct iatt *preop_stbuf,
struct iatt *postop_stbuf, dict_t *xdata);
-typedef int32_t (*fop_ipc_cbk_t) (call_frame_t *frame, void *cookie,
+typedef int32_t (*fop_ipc_cbk_t)(call_frame_t *frame, void *cookie,
xlator_t *this, int32_t op_ret,
int32_t op_errno, dict_t *xdata);
-typedef int32_t (*fop_seek_cbk_t) (call_frame_t *frame, void *cookie,
+typedef int32_t (*fop_seek_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, off_t offset,
+ dict_t *xdata);
+
+typedef int32_t (*fop_lease_cbk_t)(call_frame_t *frame, void *cookie,
xlator_t *this, int32_t op_ret,
- int32_t op_errno, off_t offset,
+ int32_t op_errno, struct gf_lease *lease,
dict_t *xdata);
+typedef int32_t (*fop_compound_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, void *data,
+ dict_t *xdata);
-typedef int32_t (*fop_lease_cbk_t) (call_frame_t *frame, void *cookie,
- xlator_t *this, int32_t op_ret,
- int32_t op_errno, struct gf_lease *lease,
- dict_t *xdata);
-typedef int32_t (*fop_compound_cbk_t) (call_frame_t *frame,
- void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno,
- void *data, dict_t *xdata);
-
-typedef int32_t (*fop_getactivelk_cbk_t) (call_frame_t *frame, void *cookie,
- xlator_t *this, int32_t op_ret,
- int32_t op_errno,
- lock_migration_info_t *locklist,
- dict_t *xdata);
-
-typedef int32_t (*fop_setactivelk_cbk_t) (call_frame_t *frame, void *cookie,
- xlator_t *this, int32_t op_ret,
- int32_t op_errno, dict_t *xdata);
-
-typedef int32_t (*fop_put_cbk_t) (call_frame_t *frame, void *cookie,
- xlator_t *this, int32_t op_ret,
- int32_t op_errno, inode_t *inode,
- struct iatt *buf, struct iatt *preparent,
- struct iatt *postparent, dict_t *xdata);
+typedef int32_t (*fop_getactivelk_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno,
+ lock_migration_info_t *locklist,
+ dict_t *xdata);
-typedef int32_t (*fop_icreate_cbk_t) (call_frame_t *frame, void *cookie,
- xlator_t *this, int32_t op_ret,
- int32_t op_errno, inode_t *inode,
- struct iatt *buf, dict_t *xdata);
+typedef int32_t (*fop_setactivelk_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, dict_t *xdata);
-typedef int32_t (*fop_namelink_cbk_t) (call_frame_t *frame, void *cookie,
- xlator_t *this, int32_t op_ret,
- int32_t op_errno, struct iatt *prebuf,
- struct iatt *postbuf, dict_t *xdata);
+typedef int32_t (*fop_put_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, inode_t *inode,
+ struct iatt *buf, struct iatt *preparent,
+ struct iatt *postparent, dict_t *xdata);
-typedef int32_t (*fop_lookup_t) (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc,
- dict_t *xdata);
+typedef int32_t (*fop_icreate_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, inode_t *inode,
+ struct iatt *buf, dict_t *xdata);
-typedef int32_t (*fop_stat_t) (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc, dict_t *xdata);
+typedef int32_t (*fop_namelink_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, struct iatt *prebuf,
+ struct iatt *postbuf, dict_t *xdata);
-typedef int32_t (*fop_fstat_t) (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd, dict_t *xdata);
+typedef int32_t (*fop_lookup_t)(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ dict_t *xdata);
+
+typedef int32_t (*fop_stat_t)(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ dict_t *xdata);
+
+typedef int32_t (*fop_fstat_t)(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ dict_t *xdata);
-typedef int32_t (*fop_truncate_t) (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc,
- off_t offset, dict_t *xdata);
+typedef int32_t (*fop_truncate_t)(call_frame_t *frame, xlator_t *this,
+ loc_t *loc, off_t offset, dict_t *xdata);
-typedef int32_t (*fop_ftruncate_t) (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- off_t offset, dict_t *xdata);
+typedef int32_t (*fop_ftruncate_t)(call_frame_t *frame, xlator_t *this,
+ fd_t *fd, off_t offset, dict_t *xdata);
-typedef int32_t (*fop_access_t) (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc,
- int32_t mask, dict_t *xdata);
+typedef int32_t (*fop_access_t)(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ int32_t mask, dict_t *xdata);
-typedef int32_t (*fop_readlink_t) (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc,
- size_t size, dict_t *xdata);
+typedef int32_t (*fop_readlink_t)(call_frame_t *frame, xlator_t *this,
+ loc_t *loc, size_t size, dict_t *xdata);
-typedef int32_t (*fop_mknod_t) (call_frame_t *frame, xlator_t *this,
- loc_t *loc, mode_t mode, dev_t rdev,
- mode_t umask, dict_t *xdata);
+typedef int32_t (*fop_mknod_t)(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ mode_t mode, dev_t rdev, mode_t umask,
+ dict_t *xdata);
-typedef int32_t (*fop_mkdir_t) (call_frame_t *frame, xlator_t *this, loc_t *loc,
- mode_t mode, mode_t umask, dict_t *xdata);
+typedef int32_t (*fop_mkdir_t)(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ mode_t mode, mode_t umask, dict_t *xdata);
-typedef int32_t (*fop_unlink_t) (call_frame_t *frame, xlator_t *this,
- loc_t *loc, int xflags, dict_t *xdata);
+typedef int32_t (*fop_unlink_t)(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ int xflags, dict_t *xdata);
-typedef int32_t (*fop_rmdir_t) (call_frame_t *frame, xlator_t *this,
- loc_t *loc, int xflags, dict_t *xdata);
+typedef int32_t (*fop_rmdir_t)(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ int xflags, dict_t *xdata);
-typedef int32_t (*fop_symlink_t) (call_frame_t *frame, xlator_t *this,
- const char *linkname, loc_t *loc,
- mode_t umask, dict_t *xdata);
+typedef int32_t (*fop_symlink_t)(call_frame_t *frame, xlator_t *this,
+ const char *linkname, loc_t *loc, mode_t umask,
+ dict_t *xdata);
-typedef int32_t (*fop_rename_t) (call_frame_t *frame,
- xlator_t *this,
- loc_t *oldloc,
- loc_t *newloc, dict_t *xdata);
+typedef int32_t (*fop_rename_t)(call_frame_t *frame, xlator_t *this,
+ loc_t *oldloc, loc_t *newloc, dict_t *xdata);
-typedef int32_t (*fop_link_t) (call_frame_t *frame,
- xlator_t *this,
- loc_t *oldloc,
- loc_t *newloc, dict_t *xdata);
+typedef int32_t (*fop_link_t)(call_frame_t *frame, xlator_t *this,
+ loc_t *oldloc, loc_t *newloc, dict_t *xdata);
-typedef int32_t (*fop_create_t) (call_frame_t *frame, xlator_t *this,
- loc_t *loc, int32_t flags, mode_t mode,
- mode_t umask, fd_t *fd, dict_t *xdata);
+typedef int32_t (*fop_create_t)(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ int32_t flags, mode_t mode, mode_t umask,
+ fd_t *fd, dict_t *xdata);
/* Tell subsequent writes on the fd_t to fsync after every writev fop without
* requiring a fsync fop.
*/
-#define GF_OPEN_FSYNC 0x01
+#define GF_OPEN_FSYNC 0x01
/* Tell write-behind to disable writing behind despite O_SYNC not being set.
*/
-#define GF_OPEN_NOWB 0x02
-
-typedef int32_t (*fop_open_t) (call_frame_t *frame, xlator_t *this,
- loc_t *loc, int32_t flags,
- fd_t *fd, dict_t *xdata);
-
-typedef int32_t (*fop_readv_t) (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- size_t size,
- off_t offset,
- uint32_t flags, dict_t *xdata);
-
-typedef int32_t (*fop_writev_t) (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- struct iovec *vector,
- int32_t count,
- off_t offset,
- uint32_t flags,
- struct iobref *iobref, dict_t *xdata);
-
-typedef int32_t (*fop_flush_t) (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd, dict_t *xdata);
+#define GF_OPEN_NOWB 0x02
+
+typedef int32_t (*fop_open_t)(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ int32_t flags, fd_t *fd, dict_t *xdata);
+
+typedef int32_t (*fop_readv_t)(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ size_t size, off_t offset, uint32_t flags,
+ dict_t *xdata);
+
+typedef int32_t (*fop_writev_t)(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ struct iovec *vector, int32_t count,
+ off_t offset, uint32_t flags,
+ struct iobref *iobref, dict_t *xdata);
+
+typedef int32_t (*fop_flush_t)(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ dict_t *xdata);
+
+typedef int32_t (*fop_fsync_t)(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ int32_t datasync, dict_t *xdata);
+
+typedef int32_t (*fop_opendir_t)(call_frame_t *frame, xlator_t *this,
+ loc_t *loc, fd_t *fd, dict_t *xdata);
+
+typedef int32_t (*fop_fsyncdir_t)(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ int32_t datasync, dict_t *xdata);
+
+typedef int32_t (*fop_statfs_t)(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ dict_t *xdata);
+
+typedef int32_t (*fop_setxattr_t)(call_frame_t *frame, xlator_t *this,
+ loc_t *loc, dict_t *dict, int32_t flags,
+ dict_t *xdata);
-typedef int32_t (*fop_fsync_t) (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- int32_t datasync, dict_t *xdata);
-
-typedef int32_t (*fop_opendir_t) (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc,
- fd_t *fd, dict_t *xdata);
-
-typedef int32_t (*fop_fsyncdir_t) (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- int32_t datasync, dict_t *xdata);
-
-typedef int32_t (*fop_statfs_t) (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc, dict_t *xdata);
-
-typedef int32_t (*fop_setxattr_t) (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc,
- dict_t *dict,
- int32_t flags, dict_t *xdata);
-
-typedef int32_t (*fop_getxattr_t) (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc,
- const char *name, dict_t *xdata);
-
-typedef int32_t (*fop_fsetxattr_t) (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- dict_t *dict,
- int32_t flags, dict_t *xdata);
-
-typedef int32_t (*fop_fgetxattr_t) (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- const char *name, dict_t *xdata);
-
-typedef int32_t (*fop_removexattr_t) (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc,
- const char *name, dict_t *xdata);
-
-typedef int32_t (*fop_fremovexattr_t) (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- const char *name, dict_t *xdata);
-
-typedef int32_t (*fop_lk_t) (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- int32_t cmd,
- struct gf_flock *flock, dict_t *xdata);
-
-typedef int32_t (*fop_inodelk_t) (call_frame_t *frame,
- xlator_t *this,
- const char *volume,
- loc_t *loc,
- int32_t cmd,
+typedef int32_t (*fop_getxattr_t)(call_frame_t *frame, xlator_t *this,
+ loc_t *loc, const char *name, dict_t *xdata);
+
+typedef int32_t (*fop_fsetxattr_t)(call_frame_t *frame, xlator_t *this,
+ fd_t *fd, dict_t *dict, int32_t flags,
+ dict_t *xdata);
+
+typedef int32_t (*fop_fgetxattr_t)(call_frame_t *frame, xlator_t *this,
+ fd_t *fd, const char *name, dict_t *xdata);
+
+typedef int32_t (*fop_removexattr_t)(call_frame_t *frame, xlator_t *this,
+ loc_t *loc, const char *name,
+ dict_t *xdata);
+
+typedef int32_t (*fop_fremovexattr_t)(call_frame_t *frame, xlator_t *this,
+ fd_t *fd, const char *name,
+ dict_t *xdata);
+
+typedef int32_t (*fop_lk_t)(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ int32_t cmd, struct gf_flock *flock, dict_t *xdata);
+
+typedef int32_t (*fop_inodelk_t)(call_frame_t *frame, xlator_t *this,
+ const char *volume, loc_t *loc, int32_t cmd,
+ struct gf_flock *flock, dict_t *xdata);
+
+typedef int32_t (*fop_finodelk_t)(call_frame_t *frame, xlator_t *this,
+ const char *volume, fd_t *fd, int32_t cmd,
struct gf_flock *flock, dict_t *xdata);
-typedef int32_t (*fop_finodelk_t) (call_frame_t *frame,
- xlator_t *this,
- const char *volume,
- fd_t *fd,
- int32_t cmd,
- struct gf_flock *flock, dict_t *xdata);
+typedef int32_t (*fop_entrylk_t)(call_frame_t *frame, xlator_t *this,
+ const char *volume, loc_t *loc,
+ const char *basename, entrylk_cmd cmd,
+ entrylk_type type, dict_t *xdata);
-typedef int32_t (*fop_entrylk_t) (call_frame_t *frame,
- xlator_t *this,
- const char *volume, loc_t *loc,
+typedef int32_t (*fop_fentrylk_t)(call_frame_t *frame, xlator_t *this,
+ const char *volume, fd_t *fd,
const char *basename, entrylk_cmd cmd,
entrylk_type type, dict_t *xdata);
-typedef int32_t (*fop_fentrylk_t) (call_frame_t *frame,
- xlator_t *this,
- const char *volume, fd_t *fd,
- const char *basename, entrylk_cmd cmd,
- entrylk_type type, dict_t *xdata);
-
-typedef int32_t (*fop_readdir_t) (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- size_t size,
- off_t offset, dict_t *xdata);
-
-typedef int32_t (*fop_readdirp_t) (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- size_t size,
- off_t offset,
- dict_t *xdata);
+typedef int32_t (*fop_readdir_t)(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ size_t size, off_t offset, dict_t *xdata);
-typedef int32_t (*fop_xattrop_t) (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc,
- gf_xattrop_flags_t optype,
- dict_t *xattr, dict_t *xdata);
-
-typedef int32_t (*fop_fxattrop_t) (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- gf_xattrop_flags_t optype,
- dict_t *xattr, dict_t *xdata);
-
-typedef int32_t (*fop_setattr_t) (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc,
- struct iatt *stbuf,
- int32_t valid, dict_t *xdata);
-
-typedef int32_t (*fop_fsetattr_t) (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- struct iatt *stbuf,
- int32_t valid, dict_t *xdata);
-
-typedef int32_t (*fop_fallocate_t) (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- int32_t keep_size,
- off_t offset,
- size_t len,
- dict_t *xdata);
+typedef int32_t (*fop_readdirp_t)(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ size_t size, off_t offset, dict_t *xdata);
-typedef int32_t (*fop_discard_t) (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- off_t offset,
- size_t len,
+typedef int32_t (*fop_xattrop_t)(call_frame_t *frame, xlator_t *this,
+ loc_t *loc, gf_xattrop_flags_t optype,
+ dict_t *xattr, dict_t *xdata);
+
+typedef int32_t (*fop_fxattrop_t)(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ gf_xattrop_flags_t optype, dict_t *xattr,
dict_t *xdata);
-typedef int32_t (*fop_zerofill_t) (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- off_t offset,
- off_t len,
+typedef int32_t (*fop_setattr_t)(call_frame_t *frame, xlator_t *this,
+ loc_t *loc, struct iatt *stbuf, int32_t valid,
+ dict_t *xdata);
+
+typedef int32_t (*fop_fsetattr_t)(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ struct iatt *stbuf, int32_t valid,
dict_t *xdata);
-typedef int32_t (*fop_ipc_t) (call_frame_t *frame, xlator_t *this, int32_t op,
- dict_t *xdata);
+typedef int32_t (*fop_fallocate_t)(call_frame_t *frame, xlator_t *this,
+ fd_t *fd, int32_t keep_size, off_t offset,
+ size_t len, dict_t *xdata);
-typedef int32_t (*fop_seek_t) (call_frame_t *frame, xlator_t *this, fd_t *fd,
- off_t offset, gf_seek_what_t what,
- dict_t *xdata);
+typedef int32_t (*fop_discard_t)(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ off_t offset, size_t len, dict_t *xdata);
-typedef int32_t (*fop_lease_t) (call_frame_t *frame, xlator_t *this, loc_t *loc,
- struct gf_lease *lease, dict_t *xdata);
+typedef int32_t (*fop_zerofill_t)(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ off_t offset, off_t len, dict_t *xdata);
-typedef int32_t (*fop_compound_t) (call_frame_t *frame, xlator_t *this,
- void *args, dict_t *xdata);
+typedef int32_t (*fop_ipc_t)(call_frame_t *frame, xlator_t *this, int32_t op,
+ dict_t *xdata);
-typedef int32_t (*fop_getactivelk_t) (call_frame_t *frame, xlator_t *this,
- loc_t *loc, dict_t *xdata);
+typedef int32_t (*fop_seek_t)(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ off_t offset, gf_seek_what_t what, dict_t *xdata);
-typedef int32_t (*fop_setactivelk_t) (call_frame_t *frame, xlator_t *this,
- loc_t *loc,
- lock_migration_info_t *locklist,
- dict_t *xdata);
+typedef int32_t (*fop_lease_t)(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ struct gf_lease *lease, dict_t *xdata);
-typedef int32_t (*fop_put_t) (call_frame_t *frame, xlator_t *this, loc_t *loc,
- mode_t mode, mode_t umask, uint32_t flags,
- struct iovec *vector, int32_t count, off_t offset,
- struct iobref *iobref, dict_t *xattr,
- dict_t *xdata);
+typedef int32_t (*fop_compound_t)(call_frame_t *frame, xlator_t *this,
+ void *args, dict_t *xdata);
+
+typedef int32_t (*fop_getactivelk_t)(call_frame_t *frame, xlator_t *this,
+ loc_t *loc, dict_t *xdata);
+
+typedef int32_t (*fop_setactivelk_t)(call_frame_t *frame, xlator_t *this,
+ loc_t *loc,
+ lock_migration_info_t *locklist,
+ dict_t *xdata);
-typedef int32_t (*fop_icreate_t) (call_frame_t *frame, xlator_t *this,
- loc_t *loc, mode_t mode, dict_t *xdata);
+typedef int32_t (*fop_put_t)(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ mode_t mode, mode_t umask, uint32_t flags,
+ struct iovec *vector, int32_t count, off_t offset,
+ struct iobref *iobref, dict_t *xattr,
+ dict_t *xdata);
-typedef int32_t (*fop_namelink_t) (call_frame_t *frame, xlator_t *this,
- loc_t *loc, dict_t *xdata);
+typedef int32_t (*fop_icreate_t)(call_frame_t *frame, xlator_t *this,
+ loc_t *loc, mode_t mode, dict_t *xdata);
+
+typedef int32_t (*fop_namelink_t)(call_frame_t *frame, xlator_t *this,
+ loc_t *loc, dict_t *xdata);
/* WARNING: make sure the list is in order with FOP definition in
`rpc/xdr/src/glusterfs-fops.x`.
If it is not in order, mainly the metrics related feature would be broken */
struct xlator_fops {
- fop_stat_t stat;
- fop_readlink_t readlink;
- fop_mknod_t mknod;
- fop_mkdir_t mkdir;
- fop_unlink_t unlink;
- fop_rmdir_t rmdir;
- fop_symlink_t symlink;
- fop_rename_t rename;
- fop_link_t link;
- fop_truncate_t truncate;
- fop_open_t open;
- fop_readv_t readv;
- fop_writev_t writev;
- fop_statfs_t statfs;
- fop_flush_t flush;
- fop_fsync_t fsync;
- fop_setxattr_t setxattr;
- fop_getxattr_t getxattr;
- fop_removexattr_t removexattr;
- fop_opendir_t opendir;
- fop_fsyncdir_t fsyncdir;
- fop_access_t access;
- fop_create_t create;
- fop_ftruncate_t ftruncate;
- fop_fstat_t fstat;
- fop_lk_t lk;
- fop_lookup_t lookup;
- fop_readdir_t readdir;
- fop_inodelk_t inodelk;
- fop_finodelk_t finodelk;
- fop_entrylk_t entrylk;
- fop_fentrylk_t fentrylk;
- fop_xattrop_t xattrop;
- fop_fxattrop_t fxattrop;
- fop_fgetxattr_t fgetxattr;
- fop_fsetxattr_t fsetxattr;
- fop_rchecksum_t rchecksum;
- fop_setattr_t setattr;
- fop_fsetattr_t fsetattr;
- fop_readdirp_t readdirp;
-
- /* These 3 are required to keep the index same as GF_FOP_##FOP */
- void *forget_placeholder;
- void *release_placeholder;
- void *releasedir_placeholder;
-
- fop_getspec_t getspec;
- fop_fremovexattr_t fremovexattr;
- fop_fallocate_t fallocate;
- fop_discard_t discard;
- fop_zerofill_t zerofill;
- fop_ipc_t ipc;
- fop_seek_t seek;
- fop_lease_t lease;
- fop_compound_t compound;
- fop_getactivelk_t getactivelk;
- fop_setactivelk_t setactivelk;
- fop_put_t put;
- fop_icreate_t icreate;
- fop_namelink_t namelink;
-
- /* these entries are used for a typechecking hack in STACK_WIND _only_ */
- /* make sure to add _cbk variables only after defining regular fops as
- its relative position is used to get the index */
- fop_stat_cbk_t stat_cbk;
- fop_readlink_cbk_t readlink_cbk;
- fop_mknod_cbk_t mknod_cbk;
- fop_mkdir_cbk_t mkdir_cbk;
- fop_unlink_cbk_t unlink_cbk;
- fop_rmdir_cbk_t rmdir_cbk;
- fop_symlink_cbk_t symlink_cbk;
- fop_rename_cbk_t rename_cbk;
- fop_link_cbk_t link_cbk;
- fop_truncate_cbk_t truncate_cbk;
- fop_open_cbk_t open_cbk;
- fop_readv_cbk_t readv_cbk;
- fop_writev_cbk_t writev_cbk;
- fop_statfs_cbk_t statfs_cbk;
- fop_flush_cbk_t flush_cbk;
- fop_fsync_cbk_t fsync_cbk;
- fop_setxattr_cbk_t setxattr_cbk;
- fop_getxattr_cbk_t getxattr_cbk;
- fop_removexattr_cbk_t removexattr_cbk;
- fop_opendir_cbk_t opendir_cbk;
- fop_fsyncdir_cbk_t fsyncdir_cbk;
- fop_access_cbk_t access_cbk;
- fop_create_cbk_t create_cbk;
- fop_ftruncate_cbk_t ftruncate_cbk;
- fop_fstat_cbk_t fstat_cbk;
- fop_lk_cbk_t lk_cbk;
- fop_lookup_cbk_t lookup_cbk;
- fop_readdir_cbk_t readdir_cbk;
- fop_inodelk_cbk_t inodelk_cbk;
- fop_finodelk_cbk_t finodelk_cbk;
- fop_entrylk_cbk_t entrylk_cbk;
- fop_fentrylk_cbk_t fentrylk_cbk;
- fop_xattrop_cbk_t xattrop_cbk;
- fop_fxattrop_cbk_t fxattrop_cbk;
- fop_fgetxattr_cbk_t fgetxattr_cbk;
- fop_fsetxattr_cbk_t fsetxattr_cbk;
- fop_rchecksum_cbk_t rchecksum_cbk;
- fop_setattr_cbk_t setattr_cbk;
- fop_fsetattr_cbk_t fsetattr_cbk;
- fop_readdirp_cbk_t readdirp_cbk;
-
- /* These 3 are required to keep the index same as GF_FOP_##FOP */
- void *forget_placeholder_cbk;
- void *release_placeholder_cbk;
- void *releasedir_placeholder_cbk;
-
- fop_getspec_cbk_t getspec_cbk;
- fop_fremovexattr_cbk_t fremovexattr_cbk;
- fop_fallocate_cbk_t fallocate_cbk;
- fop_discard_cbk_t discard_cbk;
- fop_zerofill_cbk_t zerofill_cbk;
- fop_ipc_cbk_t ipc_cbk;
- fop_seek_cbk_t seek_cbk;
- fop_lease_cbk_t lease_cbk;
- fop_compound_cbk_t compound_cbk;
- fop_getactivelk_cbk_t getactivelk_cbk;
- fop_setactivelk_cbk_t setactivelk_cbk;
- fop_put_cbk_t put_cbk;
- fop_icreate_cbk_t icreate_cbk;
- fop_namelink_cbk_t namelink_cbk;
+ fop_stat_t stat;
+ fop_readlink_t readlink;
+ fop_mknod_t mknod;
+ fop_mkdir_t mkdir;
+ fop_unlink_t unlink;
+ fop_rmdir_t rmdir;
+ fop_symlink_t symlink;
+ fop_rename_t rename;
+ fop_link_t link;
+ fop_truncate_t truncate;
+ fop_open_t open;
+ fop_readv_t readv;
+ fop_writev_t writev;
+ fop_statfs_t statfs;
+ fop_flush_t flush;
+ fop_fsync_t fsync;
+ fop_setxattr_t setxattr;
+ fop_getxattr_t getxattr;
+ fop_removexattr_t removexattr;
+ fop_opendir_t opendir;
+ fop_fsyncdir_t fsyncdir;
+ fop_access_t access;
+ fop_create_t create;
+ fop_ftruncate_t ftruncate;
+ fop_fstat_t fstat;
+ fop_lk_t lk;
+ fop_lookup_t lookup;
+ fop_readdir_t readdir;
+ fop_inodelk_t inodelk;
+ fop_finodelk_t finodelk;
+ fop_entrylk_t entrylk;
+ fop_fentrylk_t fentrylk;
+ fop_xattrop_t xattrop;
+ fop_fxattrop_t fxattrop;
+ fop_fgetxattr_t fgetxattr;
+ fop_fsetxattr_t fsetxattr;
+ fop_rchecksum_t rchecksum;
+ fop_setattr_t setattr;
+ fop_fsetattr_t fsetattr;
+ fop_readdirp_t readdirp;
+
+ /* These 3 are required to keep the index same as GF_FOP_##FOP */
+ void *forget_placeholder;
+ void *release_placeholder;
+ void *releasedir_placeholder;
+
+ fop_getspec_t getspec;
+ fop_fremovexattr_t fremovexattr;
+ fop_fallocate_t fallocate;
+ fop_discard_t discard;
+ fop_zerofill_t zerofill;
+ fop_ipc_t ipc;
+ fop_seek_t seek;
+ fop_lease_t lease;
+ fop_compound_t compound;
+ fop_getactivelk_t getactivelk;
+ fop_setactivelk_t setactivelk;
+ fop_put_t put;
+ fop_icreate_t icreate;
+ fop_namelink_t namelink;
+
+ /* these entries are used for a typechecking hack in STACK_WIND _only_ */
+ /* make sure to add _cbk variables only after defining regular fops as
+ its relative position is used to get the index */
+ fop_stat_cbk_t stat_cbk;
+ fop_readlink_cbk_t readlink_cbk;
+ fop_mknod_cbk_t mknod_cbk;
+ fop_mkdir_cbk_t mkdir_cbk;
+ fop_unlink_cbk_t unlink_cbk;
+ fop_rmdir_cbk_t rmdir_cbk;
+ fop_symlink_cbk_t symlink_cbk;
+ fop_rename_cbk_t rename_cbk;
+ fop_link_cbk_t link_cbk;
+ fop_truncate_cbk_t truncate_cbk;
+ fop_open_cbk_t open_cbk;
+ fop_readv_cbk_t readv_cbk;
+ fop_writev_cbk_t writev_cbk;
+ fop_statfs_cbk_t statfs_cbk;
+ fop_flush_cbk_t flush_cbk;
+ fop_fsync_cbk_t fsync_cbk;
+ fop_setxattr_cbk_t setxattr_cbk;
+ fop_getxattr_cbk_t getxattr_cbk;
+ fop_removexattr_cbk_t removexattr_cbk;
+ fop_opendir_cbk_t opendir_cbk;
+ fop_fsyncdir_cbk_t fsyncdir_cbk;
+ fop_access_cbk_t access_cbk;
+ fop_create_cbk_t create_cbk;
+ fop_ftruncate_cbk_t ftruncate_cbk;
+ fop_fstat_cbk_t fstat_cbk;
+ fop_lk_cbk_t lk_cbk;
+ fop_lookup_cbk_t lookup_cbk;
+ fop_readdir_cbk_t readdir_cbk;
+ fop_inodelk_cbk_t inodelk_cbk;
+ fop_finodelk_cbk_t finodelk_cbk;
+ fop_entrylk_cbk_t entrylk_cbk;
+ fop_fentrylk_cbk_t fentrylk_cbk;
+ fop_xattrop_cbk_t xattrop_cbk;
+ fop_fxattrop_cbk_t fxattrop_cbk;
+ fop_fgetxattr_cbk_t fgetxattr_cbk;
+ fop_fsetxattr_cbk_t fsetxattr_cbk;
+ fop_rchecksum_cbk_t rchecksum_cbk;
+ fop_setattr_cbk_t setattr_cbk;
+ fop_fsetattr_cbk_t fsetattr_cbk;
+ fop_readdirp_cbk_t readdirp_cbk;
+
+ /* These 3 are required to keep the index same as GF_FOP_##FOP */
+ void *forget_placeholder_cbk;
+ void *release_placeholder_cbk;
+ void *releasedir_placeholder_cbk;
+
+ fop_getspec_cbk_t getspec_cbk;
+ fop_fremovexattr_cbk_t fremovexattr_cbk;
+ fop_fallocate_cbk_t fallocate_cbk;
+ fop_discard_cbk_t discard_cbk;
+ fop_zerofill_cbk_t zerofill_cbk;
+ fop_ipc_cbk_t ipc_cbk;
+ fop_seek_cbk_t seek_cbk;
+ fop_lease_cbk_t lease_cbk;
+ fop_compound_cbk_t compound_cbk;
+ fop_getactivelk_cbk_t getactivelk_cbk;
+ fop_setactivelk_cbk_t setactivelk_cbk;
+ fop_put_cbk_t put_cbk;
+ fop_icreate_cbk_t icreate_cbk;
+ fop_namelink_cbk_t namelink_cbk;
};
-typedef int32_t (*cbk_forget_t) (xlator_t *this,
- inode_t *inode);
+typedef int32_t (*cbk_forget_t)(xlator_t *this, inode_t *inode);
-typedef int32_t (*cbk_release_t) (xlator_t *this,
- fd_t *fd);
+typedef int32_t (*cbk_release_t)(xlator_t *this, fd_t *fd);
typedef int32_t (*cbk_invalidate_t)(xlator_t *this, inode_t *inode);
typedef int32_t (*cbk_client_t)(xlator_t *this, client_t *client);
-typedef void (*cbk_ictxmerge_t) (xlator_t *this, fd_t *fd,
- inode_t *inode, inode_t *linked_inode);
+typedef void (*cbk_ictxmerge_t)(xlator_t *this, fd_t *fd, inode_t *inode,
+ inode_t *linked_inode);
typedef size_t (*cbk_inodectx_size_t)(xlator_t *this, inode_t *inode);
typedef size_t (*cbk_fdctx_size_t)(xlator_t *this, fd_t *fd);
struct xlator_cbks {
- cbk_forget_t forget;
- cbk_release_t release;
- cbk_release_t releasedir;
- cbk_invalidate_t invalidate;
- cbk_client_t client_destroy;
- cbk_client_t client_disconnect;
- cbk_ictxmerge_t ictxmerge;
- cbk_inodectx_size_t ictxsize;
- cbk_fdctx_size_t fdctxsize;
+ cbk_forget_t forget;
+ cbk_release_t release;
+ cbk_release_t releasedir;
+ cbk_invalidate_t invalidate;
+ cbk_client_t client_destroy;
+ cbk_client_t client_disconnect;
+ cbk_ictxmerge_t ictxmerge;
+ cbk_inodectx_size_t ictxsize;
+ cbk_fdctx_size_t fdctxsize;
};
-typedef int32_t (*dumpop_priv_t) (xlator_t *this);
+typedef int32_t (*dumpop_priv_t)(xlator_t *this);
-typedef int32_t (*dumpop_inode_t) (xlator_t *this);
+typedef int32_t (*dumpop_inode_t)(xlator_t *this);
-typedef int32_t (*dumpop_fd_t) (xlator_t *this);
+typedef int32_t (*dumpop_fd_t)(xlator_t *this);
-typedef int32_t (*dumpop_inodectx_t) (xlator_t *this, inode_t *ino);
+typedef int32_t (*dumpop_inodectx_t)(xlator_t *this, inode_t *ino);
-typedef int32_t (*dumpop_fdctx_t) (xlator_t *this, fd_t *fd);
+typedef int32_t (*dumpop_fdctx_t)(xlator_t *this, fd_t *fd);
-typedef int32_t (*dumpop_priv_to_dict_t) (xlator_t *this, dict_t *dict,
- char *brickname);
+typedef int32_t (*dumpop_priv_to_dict_t)(xlator_t *this, dict_t *dict,
+ char *brickname);
-typedef int32_t (*dumpop_inode_to_dict_t) (xlator_t *this, dict_t *dict);
+typedef int32_t (*dumpop_inode_to_dict_t)(xlator_t *this, dict_t *dict);
-typedef int32_t (*dumpop_fd_to_dict_t) (xlator_t *this, dict_t *dict);
+typedef int32_t (*dumpop_fd_to_dict_t)(xlator_t *this, dict_t *dict);
-typedef int32_t (*dumpop_inodectx_to_dict_t) (xlator_t *this, inode_t *ino,
- dict_t *dict);
+typedef int32_t (*dumpop_inodectx_to_dict_t)(xlator_t *this, inode_t *ino,
+ dict_t *dict);
-typedef int32_t (*dumpop_fdctx_to_dict_t) (xlator_t *this, fd_t *fd,
- dict_t *dict);
+typedef int32_t (*dumpop_fdctx_to_dict_t)(xlator_t *this, fd_t *fd,
+ dict_t *dict);
-typedef int32_t (*dumpop_eh_t) (xlator_t *this);
+typedef int32_t (*dumpop_eh_t)(xlator_t *this);
struct xlator_dumpops {
- dumpop_priv_t priv;
- dumpop_inode_t inode;
- dumpop_fd_t fd;
- dumpop_inodectx_t inodectx;
- dumpop_fdctx_t fdctx;
- dumpop_priv_to_dict_t priv_to_dict;
- dumpop_inode_to_dict_t inode_to_dict;
- dumpop_fd_to_dict_t fd_to_dict;
- dumpop_inodectx_to_dict_t inodectx_to_dict;
- dumpop_fdctx_to_dict_t fdctx_to_dict;
- dumpop_eh_t history;
+ dumpop_priv_t priv;
+ dumpop_inode_t inode;
+ dumpop_fd_t fd;
+ dumpop_inodectx_t inodectx;
+ dumpop_fdctx_t fdctx;
+ dumpop_priv_to_dict_t priv_to_dict;
+ dumpop_inode_to_dict_t inode_to_dict;
+ dumpop_fd_to_dict_t fd_to_dict;
+ dumpop_inodectx_to_dict_t inodectx_to_dict;
+ dumpop_fdctx_to_dict_t fdctx_to_dict;
+ dumpop_eh_t history;
};
typedef struct xlator_list {
- xlator_t *xlator;
- struct xlator_list *next;
+ xlator_t *xlator;
+ struct xlator_list *next;
} xlator_list_t;
typedef struct fop_metrics {
- gf_atomic_t fop;
- gf_atomic_t cbk; /* only updaed when there is failure */
+ gf_atomic_t fop;
+ gf_atomic_t cbk; /* only updaed when there is failure */
} fop_metrics_t;
struct _xlator {
- /* Built during parsing */
- char *name;
- char *type;
- char *instance_name; /* Used for multi NFSd */
- xlator_t *next;
- xlator_t *prev;
- xlator_list_t *parents;
- xlator_list_t *children;
- dict_t *options;
-
- /* Set after doing dlopen() */
- void *dlhandle;
- struct xlator_fops *fops;
- struct xlator_cbks *cbks;
- struct xlator_dumpops *dumpops;
- struct list_head volume_options; /* list of volume_option_t */
-
- void (*fini)(xlator_t *this);
- int32_t (*init)(xlator_t *this);
- int32_t (*reconfigure)(xlator_t *this, dict_t *options);
- int32_t (*mem_acct_init)(xlator_t *this);
- int32_t (*dump_metrics)(xlator_t *this, int fd);
-
- event_notify_fn_t notify;
-
- gf_loglevel_t loglevel; /* Log level for translator */
-
+ /* Built during parsing */
+ char *name;
+ char *type;
+ char *instance_name; /* Used for multi NFSd */
+ xlator_t *next;
+ xlator_t *prev;
+ xlator_list_t *parents;
+ xlator_list_t *children;
+ dict_t *options;
+
+ /* Set after doing dlopen() */
+ void *dlhandle;
+ struct xlator_fops *fops;
+ struct xlator_cbks *cbks;
+ struct xlator_dumpops *dumpops;
+ struct list_head volume_options; /* list of volume_option_t */
+
+ void (*fini)(xlator_t *this);
+ int32_t (*init)(xlator_t *this);
+ int32_t (*reconfigure)(xlator_t *this, dict_t *options);
+ int32_t (*mem_acct_init)(xlator_t *this);
+ int32_t (*dump_metrics)(xlator_t *this, int fd);
+
+ event_notify_fn_t notify;
+
+ gf_loglevel_t loglevel; /* Log level for translator */
+
+ struct {
struct {
- struct {
- /* for latency measurement */
- fop_metrics_t metrics[GF_FOP_MAXVALUE];
+ /* for latency measurement */
+ fop_metrics_t metrics[GF_FOP_MAXVALUE];
- gf_atomic_t count;
- } total;
+ gf_atomic_t count;
+ } total;
- struct {
- /* for latency measurement */
- fop_latency_t latencies[GF_FOP_MAXVALUE];
- /* for latency measurement */
- fop_metrics_t metrics[GF_FOP_MAXVALUE];
+ struct {
+ /* for latency measurement */
+ fop_latency_t latencies[GF_FOP_MAXVALUE];
+ /* for latency measurement */
+ fop_metrics_t metrics[GF_FOP_MAXVALUE];
- gf_atomic_t count;
- } interval;
- } stats;
+ gf_atomic_t count;
+ } interval;
+ } stats;
- /* Misc */
- eh_t *history; /* event history context */
- glusterfs_ctx_t *ctx;
- glusterfs_graph_t *graph; /* not set for fuse */
- inode_table_t *itable;
- char init_succeeded;
- void *private;
- struct mem_acct *mem_acct;
- uint64_t winds;
- char switched;
+ /* Misc */
+ eh_t *history; /* event history context */
+ glusterfs_ctx_t *ctx;
+ glusterfs_graph_t *graph; /* not set for fuse */
+ inode_table_t *itable;
+ char init_succeeded;
+ void *private;
+ struct mem_acct *mem_acct;
+ uint64_t winds;
+ char switched;
- /* for the memory pool of 'frame->local' */
- struct mem_pool *local_pool;
- gf_boolean_t is_autoloaded;
+ /* for the memory pool of 'frame->local' */
+ struct mem_pool *local_pool;
+ gf_boolean_t is_autoloaded;
- /* Saved volfile ID (used for multiplexing) */
- char *volfile_id;
+ /* Saved volfile ID (used for multiplexing) */
+ char *volfile_id;
- /* Its used as an index to inode_ctx*/
- uint32_t xl_id;
+ /* Its used as an index to inode_ctx*/
+ uint32_t xl_id;
- /* op_version: initialized in xlator code itself */
- uint32_t op_version[GF_MAX_RELEASES];
+ /* op_version: initialized in xlator code itself */
+ uint32_t op_version[GF_MAX_RELEASES];
- /* flags: initialized in xlator code itself */
- uint32_t flags;
+ /* flags: initialized in xlator code itself */
+ uint32_t flags;
- /* id: unique, initialized in xlator code itself */
- uint32_t id;
+ /* id: unique, initialized in xlator code itself */
+ uint32_t id;
- /* identifier: a full string which can unique identify the xlator */
- char *identifier;
+ /* identifier: a full string which can unique identify the xlator */
+ char *identifier;
- /* Is this pass_through? */
- gf_boolean_t pass_through;
- struct xlator_fops *pass_through_fops;
+ /* Is this pass_through? */
+ gf_boolean_t pass_through;
+ struct xlator_fops *pass_through_fops;
- /* cleanup flag to avoid races during xlator cleanup */
- uint32_t cleanup_starting;
+ /* cleanup flag to avoid races during xlator cleanup */
+ uint32_t cleanup_starting;
- /* flag to avoid recall of xlator_mem_cleanup for xame xlator */
- uint32_t call_cleanup;
+ /* flag to avoid recall of xlator_mem_cleanup for xame xlator */
+ uint32_t call_cleanup;
- /* Flag to understand how this xlator is categorized */
- gf_category_t category;
+ /* Flag to understand how this xlator is categorized */
+ gf_category_t category;
};
typedef struct {
- int32_t (*init) (xlator_t *this);
- void (*fini) (xlator_t *this);
- int32_t (*reconfigure) (xlator_t *this,
- dict_t *options);
- event_notify_fn_t notify;
+ int32_t (*init)(xlator_t *this);
+ void (*fini)(xlator_t *this);
+ int32_t (*reconfigure)(xlator_t *this, dict_t *options);
+ event_notify_fn_t notify;
} class_methods_t;
/* This would be the only structure which needs to be exported by
@@ -1071,166 +859,192 @@ typedef struct {
* GD2MARKER below.
*/
typedef struct {
- /* op_version: will be used by volume generation logic to figure
- out whether to insert it in graph or no, based on cluster's
- operating version.
- default value: 0, which means good to insert always */
- uint32_t op_version[GF_MAX_RELEASES];
-
- /* flags: will be used by volume generation logic to optimize the
- placements etc.
- default value: 0, which means don't treat it specially */
- uint32_t flags;
-
- /* xlator_id: unique per xlator. make sure to have no collission
- in this ID */
- uint32_t xlator_id;
-
- /* identifier: a string constant */
- char *identifier;
-
- /* struct options: if the translator takes any 'options' from the
- volume file, then that should be defined here. optional. */
- volume_option_t *options;
-
- /* Flag to understand how this xlator is categorized */
- gf_category_t category;
-
- /* XXX: GD2MARKER
- * If a new member that needs to be visible to GD2 is introduced,
- * add it above this comment.
- * Any other new members need to be added below this comment, or at the
- * end of the struct
- */
-
- /* init(): mandatory method, will be called during the
- graph initialization */
- int32_t (*init) (xlator_t *this);
-
- /* fini(): optional method, will be initialized to default
- method which would just free the 'xlator->private' variable.
- This method is called when the graph is no more in use, and
- is being destroyed. Also when SIGTERM is received */
- void (*fini) (xlator_t *this);
-
- /* reconfigure(): optional method, will be initialized to default
- method in case not provided by xlator. This method is called
- when there are only option changes in xlator, and no graph change.
- eg., a 'gluster volume set' command */
- int32_t (*reconfigure) (xlator_t *this, dict_t *options);
-
- /* mem_acct_init(): used for memory accounting inside of the xlator.
- optional. called during translator initialization */
- int32_t (*mem_acct_init) (xlator_t *this);
-
- /* dump_metrics(): used for providing internal metrics. optional */
- int32_t (*dump_metrics) (xlator_t *this, int fd);
-
- /* notify(): used for handling the notification of events from either
- the parent or child in the graph. optional. */
- event_notify_fn_t notify;
-
- /* struct fops: mandatory. provides all the filesystem operations
- methods of the xlator */
- struct xlator_fops *fops;
- /* struct cbks: optional. provides methods to handle
- inode forgets, and fd releases */
- struct xlator_cbks *cbks;
-
- /* dumpops: a structure again, with methods to dump the details.
- optional. */
- struct xlator_dumpops *dumpops;
-
- /* struct pass_through_fops: optional. provides all the filesystem
- operations which should be used if the xlator is marked as pass_through */
- /* by default, the default_fops would be used */
- struct xlator_fops *pass_through_fops;
+ /* op_version: will be used by volume generation logic to figure
+ out whether to insert it in graph or no, based on cluster's
+ operating version.
+ default value: 0, which means good to insert always */
+ uint32_t op_version[GF_MAX_RELEASES];
+
+ /* flags: will be used by volume generation logic to optimize the
+ placements etc.
+ default value: 0, which means don't treat it specially */
+ uint32_t flags;
+
+ /* xlator_id: unique per xlator. make sure to have no collission
+ in this ID */
+ uint32_t xlator_id;
+
+ /* identifier: a string constant */
+ char *identifier;
+
+ /* struct options: if the translator takes any 'options' from the
+ volume file, then that should be defined here. optional. */
+ volume_option_t *options;
+
+ /* Flag to understand how this xlator is categorized */
+ gf_category_t category;
+
+ /* XXX: GD2MARKER
+ * If a new member that needs to be visible to GD2 is introduced,
+ * add it above this comment.
+ * Any other new members need to be added below this comment, or at the
+ * end of the struct
+ */
+
+ /* init(): mandatory method, will be called during the
+ graph initialization */
+ int32_t (*init)(xlator_t *this);
+
+ /* fini(): optional method, will be initialized to default
+ method which would just free the 'xlator->private' variable.
+ This method is called when the graph is no more in use, and
+ is being destroyed. Also when SIGTERM is received */
+ void (*fini)(xlator_t *this);
+
+ /* reconfigure(): optional method, will be initialized to default
+ method in case not provided by xlator. This method is called
+ when there are only option changes in xlator, and no graph change.
+ eg., a 'gluster volume set' command */
+ int32_t (*reconfigure)(xlator_t *this, dict_t *options);
+
+ /* mem_acct_init(): used for memory accounting inside of the xlator.
+ optional. called during translator initialization */
+ int32_t (*mem_acct_init)(xlator_t *this);
+
+ /* dump_metrics(): used for providing internal metrics. optional */
+ int32_t (*dump_metrics)(xlator_t *this, int fd);
+
+ /* notify(): used for handling the notification of events from either
+ the parent or child in the graph. optional. */
+ event_notify_fn_t notify;
+
+ /* struct fops: mandatory. provides all the filesystem operations
+ methods of the xlator */
+ struct xlator_fops *fops;
+ /* struct cbks: optional. provides methods to handle
+ inode forgets, and fd releases */
+ struct xlator_cbks *cbks;
+
+ /* dumpops: a structure again, with methods to dump the details.
+ optional. */
+ struct xlator_dumpops *dumpops;
+
+ /* struct pass_through_fops: optional. provides all the filesystem
+ operations which should be used if the xlator is marked as pass_through
+ */
+ /* by default, the default_fops would be used */
+ struct xlator_fops *pass_through_fops;
} xlator_api_t;
#define xlator_has_parent(xl) (xl->parents != NULL)
-#define XLATOR_NOTIFY(ret, _xl, params ...) \
- do { \
- xlator_t *_old_THIS = NULL; \
- \
- _old_THIS = THIS; \
- THIS = _xl; \
- \
- ret = _xl->notify (_xl, params);\
- \
- THIS = _old_THIS; \
- } while (0);
+#define XLATOR_NOTIFY(ret, _xl, params...) \
+ do { \
+ xlator_t *_old_THIS = NULL; \
+ \
+ _old_THIS = THIS; \
+ THIS = _xl; \
+ \
+ ret = _xl->notify(_xl, params); \
+ \
+ THIS = _old_THIS; \
+ } while (0);
-int32_t xlator_set_type_virtual (xlator_t *xl, const char *type);
+int32_t
+xlator_set_type_virtual(xlator_t *xl, const char *type);
-int32_t xlator_set_type (xlator_t *xl, const char *type);
+int32_t
+xlator_set_type(xlator_t *xl, const char *type);
-int32_t xlator_dynload (xlator_t *xl);
+int32_t
+xlator_dynload(xlator_t *xl);
-xlator_t *file_to_xlator_tree (glusterfs_ctx_t *ctx,
- FILE *fp);
+xlator_t *
+file_to_xlator_tree(glusterfs_ctx_t *ctx, FILE *fp);
-int xlator_notify (xlator_t *this, int32_t event, void *data, ...);
-int xlator_init (xlator_t *this);
-int xlator_destroy (xlator_t *xl);
+int
+xlator_notify(xlator_t *this, int32_t event, void *data, ...);
+int
+xlator_init(xlator_t *this);
+int
+xlator_destroy(xlator_t *xl);
-int32_t xlator_tree_init (xlator_t *xl);
-int32_t xlator_tree_free_members (xlator_t *xl);
-int32_t xlator_tree_free_memacct (xlator_t *xl);
+int32_t
+xlator_tree_init(xlator_t *xl);
+int32_t
+xlator_tree_free_members(xlator_t *xl);
+int32_t
+xlator_tree_free_memacct(xlator_t *xl);
-void xlator_tree_fini (xlator_t *xl);
+void
+xlator_tree_fini(xlator_t *xl);
-void xlator_foreach (xlator_t *this,
- void (*fn) (xlator_t *each,
- void *data),
- void *data);
+void
+xlator_foreach(xlator_t *this, void (*fn)(xlator_t *each, void *data),
+ void *data);
-void xlator_foreach_depth_first (xlator_t *this,
- void (*fn) (xlator_t *each,
- void *data),
- void *data);
+void
+xlator_foreach_depth_first(xlator_t *this,
+ void (*fn)(xlator_t *each, void *data), void *data);
-xlator_t *xlator_search_by_name (xlator_t *any, const char *name);
-xlator_t *get_xlator_by_name (xlator_t *this, char *target);
-xlator_t *get_xlator_by_type (xlator_t *this, char *target);
+xlator_t *
+xlator_search_by_name(xlator_t *any, const char *name);
+xlator_t *
+get_xlator_by_name(xlator_t *this, char *target);
+xlator_t *
+get_xlator_by_type(xlator_t *this, char *target);
void
-xlator_set_inode_lru_limit (xlator_t *this, void *data);
+xlator_set_inode_lru_limit(xlator_t *this, void *data);
-void inode_destroy_notify (inode_t *inode, const char *xlname);
+void
+inode_destroy_notify(inode_t *inode, const char *xlname);
-int loc_copy (loc_t *dst, loc_t *src);
-int loc_copy_overload_parent (loc_t *dst,
- loc_t *src, inode_t *parent);
+int
+loc_copy(loc_t *dst, loc_t *src);
+int
+loc_copy_overload_parent(loc_t *dst, loc_t *src, inode_t *parent);
#define loc_dup(src, dst) loc_copy(dst, src)
-void loc_wipe (loc_t *loc);
-int loc_path (loc_t *loc, const char *bname);
-void loc_gfid (loc_t *loc, uuid_t gfid);
-void loc_pargfid (loc_t *loc, uuid_t pargfid);
-char* loc_gfid_utoa (loc_t *loc);
-gf_boolean_t loc_is_root (loc_t *loc);
-int32_t loc_build_child (loc_t *child, loc_t *parent, char *name);
-gf_boolean_t loc_is_nameless (loc_t *loc);
-int xlator_mem_acct_init (xlator_t *xl, int num_types);
-int is_gf_log_command (xlator_t *trans, const char *name, char *value);
-int glusterd_check_log_level (const char *value);
-int xlator_volopt_dynload (char *xlator_type, void **dl_handle,
- volume_opt_list_t *vol_opt_handle);
+void
+loc_wipe(loc_t *loc);
+int
+loc_path(loc_t *loc, const char *bname);
+void
+loc_gfid(loc_t *loc, uuid_t gfid);
+void
+loc_pargfid(loc_t *loc, uuid_t pargfid);
+char *
+loc_gfid_utoa(loc_t *loc);
+gf_boolean_t
+loc_is_root(loc_t *loc);
+int32_t
+loc_build_child(loc_t *child, loc_t *parent, char *name);
+gf_boolean_t
+loc_is_nameless(loc_t *loc);
+int
+xlator_mem_acct_init(xlator_t *xl, int num_types);
+int
+is_gf_log_command(xlator_t *trans, const char *name, char *value);
+int
+glusterd_check_log_level(const char *value);
+int
+xlator_volopt_dynload(char *xlator_type, void **dl_handle,
+ volume_opt_list_t *vol_opt_handle);
enum gf_hdsk_event_notify_op {
- GF_EN_DEFRAG_STATUS,
- GF_EN_MAX,
+ GF_EN_DEFRAG_STATUS,
+ GF_EN_MAX,
};
gf_boolean_t
-is_graph_topology_equal (glusterfs_graph_t *graph1, glusterfs_graph_t *graph2);
+is_graph_topology_equal(glusterfs_graph_t *graph1, glusterfs_graph_t *graph2);
int
-glusterfs_volfile_reconfigure (FILE *newvolfile_fp, glusterfs_ctx_t *ctx);
+glusterfs_volfile_reconfigure(FILE *newvolfile_fp, glusterfs_ctx_t *ctx);
int
-gf_volfile_reconfigure (int oldvollen, FILE *newvolfile_fp,
- glusterfs_ctx_t *ctx, const char *oldvolfile);
+gf_volfile_reconfigure(int oldvollen, FILE *newvolfile_fp, glusterfs_ctx_t *ctx,
+ const char *oldvolfile);
int
-loc_touchup (loc_t *loc, const char *name);
+loc_touchup(loc_t *loc, const char *name);
int
glusterfs_leaf_position(xlator_t *tgt);
@@ -1239,19 +1053,20 @@ int
glusterfs_reachable_leaves(xlator_t *base, dict_t *leaves);
int
-xlator_subvolume_count (xlator_t *this);
+xlator_subvolume_count(xlator_t *this);
-void xlator_init_lock (void);
-void xlator_init_unlock (void);
+void
+xlator_init_lock(void);
+void
+xlator_init_unlock(void);
int
-copy_opts_to_child (xlator_t *src, xlator_t *dst, char *glob);
+copy_opts_to_child(xlator_t *src, xlator_t *dst, char *glob);
int
-glusterfs_delete_volfile_checksum (glusterfs_ctx_t *ctx,
- const char *volfile_id);
+glusterfs_delete_volfile_checksum(glusterfs_ctx_t *ctx, const char *volfile_id);
int
-xlator_memrec_free (xlator_t *xl);
+xlator_memrec_free(xlator_t *xl);
void
-xlator_mem_cleanup (xlator_t *this);
+xlator_mem_cleanup(xlator_t *this);
#endif /* _XLATOR_H */
diff --git a/rpc/rpc-lib/src/protocol-common.h b/rpc/rpc-lib/src/protocol-common.h
index 1dfd6d5128b..4950857ae9e 100644
--- a/rpc/rpc-lib/src/protocol-common.h
+++ b/rpc/rpc-lib/src/protocol-common.h
@@ -12,366 +12,367 @@
#define _PROTOCOL_COMMON_H
enum gf_fop_procnum {
- GFS3_OP_NULL, /* 0 */
- GFS3_OP_STAT,
- GFS3_OP_READLINK,
- GFS3_OP_MKNOD,
- GFS3_OP_MKDIR,
- GFS3_OP_UNLINK,
- GFS3_OP_RMDIR,
- GFS3_OP_SYMLINK,
- GFS3_OP_RENAME,
- GFS3_OP_LINK,
- GFS3_OP_TRUNCATE,
- GFS3_OP_OPEN,
- GFS3_OP_READ,
- GFS3_OP_WRITE,
- GFS3_OP_STATFS,
- GFS3_OP_FLUSH,
- GFS3_OP_FSYNC,
- GFS3_OP_SETXATTR,
- GFS3_OP_GETXATTR,
- GFS3_OP_REMOVEXATTR,
- GFS3_OP_OPENDIR,
- GFS3_OP_FSYNCDIR,
- GFS3_OP_ACCESS,
- GFS3_OP_CREATE,
- GFS3_OP_FTRUNCATE,
- GFS3_OP_FSTAT,
- GFS3_OP_LK,
- GFS3_OP_LOOKUP,
- GFS3_OP_READDIR,
- GFS3_OP_INODELK,
- GFS3_OP_FINODELK,
- GFS3_OP_ENTRYLK,
- GFS3_OP_FENTRYLK,
- GFS3_OP_XATTROP,
- GFS3_OP_FXATTROP,
- GFS3_OP_FGETXATTR,
- GFS3_OP_FSETXATTR,
- GFS3_OP_RCHECKSUM,
- GFS3_OP_SETATTR,
- GFS3_OP_FSETATTR,
- GFS3_OP_READDIRP,
- GFS3_OP_RELEASE,
- GFS3_OP_RELEASEDIR,
- GFS3_OP_FREMOVEXATTR,
- GFS3_OP_FALLOCATE,
- GFS3_OP_DISCARD,
- GFS3_OP_ZEROFILL,
- GFS3_OP_IPC,
- GFS3_OP_SEEK,
- GFS3_OP_COMPOUND,
- GFS3_OP_LEASE,
- GFS3_OP_GETACTIVELK,
- GFS3_OP_SETACTIVELK,
- GFS3_OP_ICREATE,
- GFS3_OP_NAMELINK,
- GFS3_OP_PUT,
- GFS3_OP_MAXVALUE,
+ GFS3_OP_NULL, /* 0 */
+ GFS3_OP_STAT,
+ GFS3_OP_READLINK,
+ GFS3_OP_MKNOD,
+ GFS3_OP_MKDIR,
+ GFS3_OP_UNLINK,
+ GFS3_OP_RMDIR,
+ GFS3_OP_SYMLINK,
+ GFS3_OP_RENAME,
+ GFS3_OP_LINK,
+ GFS3_OP_TRUNCATE,
+ GFS3_OP_OPEN,
+ GFS3_OP_READ,
+ GFS3_OP_WRITE,
+ GFS3_OP_STATFS,
+ GFS3_OP_FLUSH,
+ GFS3_OP_FSYNC,
+ GFS3_OP_SETXATTR,
+ GFS3_OP_GETXATTR,
+ GFS3_OP_REMOVEXATTR,
+ GFS3_OP_OPENDIR,
+ GFS3_OP_FSYNCDIR,
+ GFS3_OP_ACCESS,
+ GFS3_OP_CREATE,
+ GFS3_OP_FTRUNCATE,
+ GFS3_OP_FSTAT,
+ GFS3_OP_LK,
+ GFS3_OP_LOOKUP,
+ GFS3_OP_READDIR,
+ GFS3_OP_INODELK,
+ GFS3_OP_FINODELK,
+ GFS3_OP_ENTRYLK,
+ GFS3_OP_FENTRYLK,
+ GFS3_OP_XATTROP,
+ GFS3_OP_FXATTROP,
+ GFS3_OP_FGETXATTR,
+ GFS3_OP_FSETXATTR,
+ GFS3_OP_RCHECKSUM,
+ GFS3_OP_SETATTR,
+ GFS3_OP_FSETATTR,
+ GFS3_OP_READDIRP,
+ GFS3_OP_RELEASE,
+ GFS3_OP_RELEASEDIR,
+ GFS3_OP_FREMOVEXATTR,
+ GFS3_OP_FALLOCATE,
+ GFS3_OP_DISCARD,
+ GFS3_OP_ZEROFILL,
+ GFS3_OP_IPC,
+ GFS3_OP_SEEK,
+ GFS3_OP_COMPOUND,
+ GFS3_OP_LEASE,
+ GFS3_OP_GETACTIVELK,
+ GFS3_OP_SETACTIVELK,
+ GFS3_OP_ICREATE,
+ GFS3_OP_NAMELINK,
+ GFS3_OP_PUT,
+ GFS3_OP_MAXVALUE,
};
enum gf_handshake_procnum {
- GF_HNDSK_NULL,
- GF_HNDSK_SETVOLUME,
- GF_HNDSK_GETSPEC,
- GF_HNDSK_PING,
- GF_HNDSK_SET_LK_VER,
- GF_HNDSK_EVENT_NOTIFY,
- GF_HNDSK_GET_VOLUME_INFO,
- GF_HNDSK_GET_SNAPSHOT_INFO,
- GF_HNDSK_MAXVALUE,
+ GF_HNDSK_NULL,
+ GF_HNDSK_SETVOLUME,
+ GF_HNDSK_GETSPEC,
+ GF_HNDSK_PING,
+ GF_HNDSK_SET_LK_VER,
+ GF_HNDSK_EVENT_NOTIFY,
+ GF_HNDSK_GET_VOLUME_INFO,
+ GF_HNDSK_GET_SNAPSHOT_INFO,
+ GF_HNDSK_MAXVALUE,
};
enum gf_pmap_procnum {
- GF_PMAP_NULL = 0,
- GF_PMAP_PORTBYBRICK,
- GF_PMAP_BRICKBYPORT,
- /*
- * SIGNUP is not used, and shouldn't be used. It was kept here only
- * to avoid changing the numbers for things that come after it in this
- * list.
- */
- GF_PMAP_SIGNUP,
- GF_PMAP_SIGNIN,
- GF_PMAP_SIGNOUT,
- GF_PMAP_MAXVALUE,
+ GF_PMAP_NULL = 0,
+ GF_PMAP_PORTBYBRICK,
+ GF_PMAP_BRICKBYPORT,
+ /*
+ * SIGNUP is not used, and shouldn't be used. It was kept here only
+ * to avoid changing the numbers for things that come after it in this
+ * list.
+ */
+ GF_PMAP_SIGNUP,
+ GF_PMAP_SIGNIN,
+ GF_PMAP_SIGNOUT,
+ GF_PMAP_MAXVALUE,
};
enum gf_aggregator_procnum {
- GF_AGGREGATOR_NULL = 0,
- GF_AGGREGATOR_LOOKUP,
- GF_AGGREGATOR_GETLIMIT,
- GF_AGGREGATOR_MAXVALUE,
+ GF_AGGREGATOR_NULL = 0,
+ GF_AGGREGATOR_LOOKUP,
+ GF_AGGREGATOR_GETLIMIT,
+ GF_AGGREGATOR_MAXVALUE,
};
enum gf_pmap_port_type {
- GF_PMAP_PORT_FREE = 0,
- GF_PMAP_PORT_FOREIGN, /* it actually means, not sure who is using it, but it is in-use */
- GF_PMAP_PORT_LEASED,
- GF_PMAP_PORT_ANY,
- GF_PMAP_PORT_BRICKSERVER, /* port used by brick process */
+ GF_PMAP_PORT_FREE = 0,
+ GF_PMAP_PORT_FOREIGN, /* it actually means, not sure who is using it, but it
+ is in-use */
+ GF_PMAP_PORT_LEASED,
+ GF_PMAP_PORT_ANY,
+ GF_PMAP_PORT_BRICKSERVER, /* port used by brick process */
};
typedef enum gf_pmap_port_type gf_pmap_port_type_t;
enum gf_probe_resp {
- GF_PROBE_SUCCESS,
- GF_PROBE_LOCALHOST,
- GF_PROBE_FRIEND,
- GF_PROBE_ANOTHER_CLUSTER,
- GF_PROBE_VOLUME_CONFLICT,
- GF_PROBE_SAME_UUID,
- GF_PROBE_UNKNOWN_PEER,
- GF_PROBE_ADD_FAILED,
- GF_PROBE_QUORUM_NOT_MET,
- GF_PROBE_MISSED_SNAP_CONFLICT,
- GF_PROBE_SNAP_CONFLICT,
- GF_PROBE_FRIEND_DETACHING,
+ GF_PROBE_SUCCESS,
+ GF_PROBE_LOCALHOST,
+ GF_PROBE_FRIEND,
+ GF_PROBE_ANOTHER_CLUSTER,
+ GF_PROBE_VOLUME_CONFLICT,
+ GF_PROBE_SAME_UUID,
+ GF_PROBE_UNKNOWN_PEER,
+ GF_PROBE_ADD_FAILED,
+ GF_PROBE_QUORUM_NOT_MET,
+ GF_PROBE_MISSED_SNAP_CONFLICT,
+ GF_PROBE_SNAP_CONFLICT,
+ GF_PROBE_FRIEND_DETACHING,
};
enum gf_deprobe_resp {
- GF_DEPROBE_SUCCESS,
- GF_DEPROBE_LOCALHOST,
- GF_DEPROBE_NOT_FRIEND,
- GF_DEPROBE_BRICK_EXIST,
- GF_DEPROBE_FRIEND_DOWN,
- GF_DEPROBE_QUORUM_NOT_MET,
- GF_DEPROBE_FRIEND_DETACHING,
- GF_DEPROBE_SNAP_BRICK_EXIST,
+ GF_DEPROBE_SUCCESS,
+ GF_DEPROBE_LOCALHOST,
+ GF_DEPROBE_NOT_FRIEND,
+ GF_DEPROBE_BRICK_EXIST,
+ GF_DEPROBE_FRIEND_DOWN,
+ GF_DEPROBE_QUORUM_NOT_MET,
+ GF_DEPROBE_FRIEND_DETACHING,
+ GF_DEPROBE_SNAP_BRICK_EXIST,
};
enum gf_cbk_procnum {
- GF_CBK_NULL = 0,
- GF_CBK_FETCHSPEC,
- GF_CBK_INO_FLUSH,
- GF_CBK_EVENT_NOTIFY,
- GF_CBK_GET_SNAPS,
- GF_CBK_CACHE_INVALIDATION,
- GF_CBK_CHILD_UP,
- GF_CBK_CHILD_DOWN,
- GF_CBK_RECALL_LEASE,
- GF_CBK_STATEDUMP,
- GF_CBK_INODELK_CONTENTION,
- GF_CBK_ENTRYLK_CONTENTION,
- GF_CBK_MAXVALUE,
+ GF_CBK_NULL = 0,
+ GF_CBK_FETCHSPEC,
+ GF_CBK_INO_FLUSH,
+ GF_CBK_EVENT_NOTIFY,
+ GF_CBK_GET_SNAPS,
+ GF_CBK_CACHE_INVALIDATION,
+ GF_CBK_CHILD_UP,
+ GF_CBK_CHILD_DOWN,
+ GF_CBK_RECALL_LEASE,
+ GF_CBK_STATEDUMP,
+ GF_CBK_INODELK_CONTENTION,
+ GF_CBK_ENTRYLK_CONTENTION,
+ GF_CBK_MAXVALUE,
};
enum gluster_cli_procnum {
- GLUSTER_CLI_NULL, /* 0 */
- GLUSTER_CLI_PROBE,
- GLUSTER_CLI_DEPROBE,
- GLUSTER_CLI_LIST_FRIENDS,
- GLUSTER_CLI_CREATE_VOLUME,
- GLUSTER_CLI_GET_VOLUME,
- GLUSTER_CLI_GET_NEXT_VOLUME,
- GLUSTER_CLI_DELETE_VOLUME,
- GLUSTER_CLI_START_VOLUME,
- GLUSTER_CLI_STOP_VOLUME,
- GLUSTER_CLI_RENAME_VOLUME,
- GLUSTER_CLI_DEFRAG_VOLUME,
- GLUSTER_CLI_SET_VOLUME,
- GLUSTER_CLI_ADD_BRICK,
- GLUSTER_CLI_REMOVE_BRICK,
- GLUSTER_CLI_REPLACE_BRICK,
- GLUSTER_CLI_LOG_ROTATE,
- GLUSTER_CLI_GETSPEC,
- GLUSTER_CLI_PMAP_PORTBYBRICK,
- GLUSTER_CLI_SYNC_VOLUME,
- GLUSTER_CLI_RESET_VOLUME,
- GLUSTER_CLI_FSM_LOG,
- GLUSTER_CLI_GSYNC_SET,
- GLUSTER_CLI_PROFILE_VOLUME,
- GLUSTER_CLI_QUOTA,
- GLUSTER_CLI_TOP_VOLUME,
- GLUSTER_CLI_GETWD,
- GLUSTER_CLI_STATUS_VOLUME,
- GLUSTER_CLI_STATUS_ALL,
- GLUSTER_CLI_MOUNT,
- GLUSTER_CLI_UMOUNT,
- GLUSTER_CLI_HEAL_VOLUME,
- GLUSTER_CLI_STATEDUMP_VOLUME,
- GLUSTER_CLI_LIST_VOLUME,
- GLUSTER_CLI_CLRLOCKS_VOLUME,
- GLUSTER_CLI_UUID_RESET,
- GLUSTER_CLI_UUID_GET,
- GLUSTER_CLI_COPY_FILE,
- GLUSTER_CLI_SYS_EXEC,
- GLUSTER_CLI_SNAP,
- GLUSTER_CLI_BARRIER_VOLUME,
- GLUSTER_CLI_GET_VOL_OPT,
- GLUSTER_CLI_GANESHA,
- GLUSTER_CLI_BITROT,
- GLUSTER_CLI_ATTACH_TIER,
- GLUSTER_CLI_TIER,
- GLUSTER_CLI_GET_STATE,
- GLUSTER_CLI_RESET_BRICK,
- GLUSTER_CLI_REMOVE_TIER_BRICK,
- GLUSTER_CLI_ADD_TIER_BRICK,
- GLUSTER_CLI_MAXVALUE,
+ GLUSTER_CLI_NULL, /* 0 */
+ GLUSTER_CLI_PROBE,
+ GLUSTER_CLI_DEPROBE,
+ GLUSTER_CLI_LIST_FRIENDS,
+ GLUSTER_CLI_CREATE_VOLUME,
+ GLUSTER_CLI_GET_VOLUME,
+ GLUSTER_CLI_GET_NEXT_VOLUME,
+ GLUSTER_CLI_DELETE_VOLUME,
+ GLUSTER_CLI_START_VOLUME,
+ GLUSTER_CLI_STOP_VOLUME,
+ GLUSTER_CLI_RENAME_VOLUME,
+ GLUSTER_CLI_DEFRAG_VOLUME,
+ GLUSTER_CLI_SET_VOLUME,
+ GLUSTER_CLI_ADD_BRICK,
+ GLUSTER_CLI_REMOVE_BRICK,
+ GLUSTER_CLI_REPLACE_BRICK,
+ GLUSTER_CLI_LOG_ROTATE,
+ GLUSTER_CLI_GETSPEC,
+ GLUSTER_CLI_PMAP_PORTBYBRICK,
+ GLUSTER_CLI_SYNC_VOLUME,
+ GLUSTER_CLI_RESET_VOLUME,
+ GLUSTER_CLI_FSM_LOG,
+ GLUSTER_CLI_GSYNC_SET,
+ GLUSTER_CLI_PROFILE_VOLUME,
+ GLUSTER_CLI_QUOTA,
+ GLUSTER_CLI_TOP_VOLUME,
+ GLUSTER_CLI_GETWD,
+ GLUSTER_CLI_STATUS_VOLUME,
+ GLUSTER_CLI_STATUS_ALL,
+ GLUSTER_CLI_MOUNT,
+ GLUSTER_CLI_UMOUNT,
+ GLUSTER_CLI_HEAL_VOLUME,
+ GLUSTER_CLI_STATEDUMP_VOLUME,
+ GLUSTER_CLI_LIST_VOLUME,
+ GLUSTER_CLI_CLRLOCKS_VOLUME,
+ GLUSTER_CLI_UUID_RESET,
+ GLUSTER_CLI_UUID_GET,
+ GLUSTER_CLI_COPY_FILE,
+ GLUSTER_CLI_SYS_EXEC,
+ GLUSTER_CLI_SNAP,
+ GLUSTER_CLI_BARRIER_VOLUME,
+ GLUSTER_CLI_GET_VOL_OPT,
+ GLUSTER_CLI_GANESHA,
+ GLUSTER_CLI_BITROT,
+ GLUSTER_CLI_ATTACH_TIER,
+ GLUSTER_CLI_TIER,
+ GLUSTER_CLI_GET_STATE,
+ GLUSTER_CLI_RESET_BRICK,
+ GLUSTER_CLI_REMOVE_TIER_BRICK,
+ GLUSTER_CLI_ADD_TIER_BRICK,
+ GLUSTER_CLI_MAXVALUE,
};
enum glusterd_mgmt_procnum {
- GLUSTERD_MGMT_NULL, /* 0 */
- GLUSTERD_MGMT_CLUSTER_LOCK,
- GLUSTERD_MGMT_CLUSTER_UNLOCK,
- GLUSTERD_MGMT_STAGE_OP,
- GLUSTERD_MGMT_COMMIT_OP,
- GLUSTERD_MGMT_MAXVALUE,
+ GLUSTERD_MGMT_NULL, /* 0 */
+ GLUSTERD_MGMT_CLUSTER_LOCK,
+ GLUSTERD_MGMT_CLUSTER_UNLOCK,
+ GLUSTERD_MGMT_STAGE_OP,
+ GLUSTERD_MGMT_COMMIT_OP,
+ GLUSTERD_MGMT_MAXVALUE,
};
enum glusterd_friend_procnum {
- GLUSTERD_FRIEND_NULL, /* 0 */
- GLUSTERD_PROBE_QUERY,
- GLUSTERD_FRIEND_ADD,
- GLUSTERD_FRIEND_REMOVE,
- GLUSTERD_FRIEND_UPDATE,
- GLUSTERD_FRIEND_MAXVALUE,
+ GLUSTERD_FRIEND_NULL, /* 0 */
+ GLUSTERD_PROBE_QUERY,
+ GLUSTERD_FRIEND_ADD,
+ GLUSTERD_FRIEND_REMOVE,
+ GLUSTERD_FRIEND_UPDATE,
+ GLUSTERD_FRIEND_MAXVALUE,
};
enum glusterd_brick_procnum {
- GLUSTERD_BRICK_NULL, /* 0 */
- GLUSTERD_BRICK_TERMINATE,
- GLUSTERD_BRICK_XLATOR_INFO,
- GLUSTERD_BRICK_XLATOR_OP,
- GLUSTERD_BRICK_STATUS,
- GLUSTERD_BRICK_OP,
- GLUSTERD_BRICK_XLATOR_DEFRAG,
- GLUSTERD_NODE_PROFILE,
- GLUSTERD_NODE_STATUS,
- GLUSTERD_VOLUME_BARRIER_OP,
- GLUSTERD_BRICK_BARRIER,
- GLUSTERD_NODE_BITROT,
- GLUSTERD_BRICK_ATTACH,
- GLUSTERD_DUMP_METRICS,
- GLUSTERD_BRICK_MAXVALUE,
+ GLUSTERD_BRICK_NULL, /* 0 */
+ GLUSTERD_BRICK_TERMINATE,
+ GLUSTERD_BRICK_XLATOR_INFO,
+ GLUSTERD_BRICK_XLATOR_OP,
+ GLUSTERD_BRICK_STATUS,
+ GLUSTERD_BRICK_OP,
+ GLUSTERD_BRICK_XLATOR_DEFRAG,
+ GLUSTERD_NODE_PROFILE,
+ GLUSTERD_NODE_STATUS,
+ GLUSTERD_VOLUME_BARRIER_OP,
+ GLUSTERD_BRICK_BARRIER,
+ GLUSTERD_NODE_BITROT,
+ GLUSTERD_BRICK_ATTACH,
+ GLUSTERD_DUMP_METRICS,
+ GLUSTERD_BRICK_MAXVALUE,
};
enum glusterd_mgmt_hndsk_procnum {
- GD_MGMT_HNDSK_NULL,
- GD_MGMT_HNDSK_VERSIONS,
- GD_MGMT_HNDSK_VERSIONS_ACK,
- GD_MGMT_HNDSK_MAXVALUE,
+ GD_MGMT_HNDSK_NULL,
+ GD_MGMT_HNDSK_VERSIONS,
+ GD_MGMT_HNDSK_VERSIONS_ACK,
+ GD_MGMT_HNDSK_MAXVALUE,
};
typedef enum {
- GF_SHD_OP_INVALID,
- GF_SHD_OP_HEAL_INDEX,
- GF_SHD_OP_HEAL_FULL,
- GF_SHD_OP_INDEX_SUMMARY,
- GF_SHD_OP_HEALED_FILES,
- GF_SHD_OP_HEAL_FAILED_FILES,
- GF_SHD_OP_SPLIT_BRAIN_FILES,
- GF_SHD_OP_STATISTICS,
- GF_SHD_OP_STATISTICS_HEAL_COUNT,
- GF_SHD_OP_STATISTICS_HEAL_COUNT_PER_REPLICA,
- GF_SHD_OP_SBRAIN_HEAL_FROM_BIGGER_FILE,
- GF_SHD_OP_SBRAIN_HEAL_FROM_BRICK,
- GF_SHD_OP_HEAL_ENABLE,
- GF_SHD_OP_HEAL_DISABLE,
- GF_SHD_OP_SBRAIN_HEAL_FROM_LATEST_MTIME,
- GF_SHD_OP_GRANULAR_ENTRY_HEAL_ENABLE,
- GF_SHD_OP_GRANULAR_ENTRY_HEAL_DISABLE,
- GF_SHD_OP_HEAL_SUMMARY,
-} gf_xl_afr_op_t ;
+ GF_SHD_OP_INVALID,
+ GF_SHD_OP_HEAL_INDEX,
+ GF_SHD_OP_HEAL_FULL,
+ GF_SHD_OP_INDEX_SUMMARY,
+ GF_SHD_OP_HEALED_FILES,
+ GF_SHD_OP_HEAL_FAILED_FILES,
+ GF_SHD_OP_SPLIT_BRAIN_FILES,
+ GF_SHD_OP_STATISTICS,
+ GF_SHD_OP_STATISTICS_HEAL_COUNT,
+ GF_SHD_OP_STATISTICS_HEAL_COUNT_PER_REPLICA,
+ GF_SHD_OP_SBRAIN_HEAL_FROM_BIGGER_FILE,
+ GF_SHD_OP_SBRAIN_HEAL_FROM_BRICK,
+ GF_SHD_OP_HEAL_ENABLE,
+ GF_SHD_OP_HEAL_DISABLE,
+ GF_SHD_OP_SBRAIN_HEAL_FROM_LATEST_MTIME,
+ GF_SHD_OP_GRANULAR_ENTRY_HEAL_ENABLE,
+ GF_SHD_OP_GRANULAR_ENTRY_HEAL_DISABLE,
+ GF_SHD_OP_HEAL_SUMMARY,
+} gf_xl_afr_op_t;
struct gf_gsync_detailed_status_ {
- char node[NAME_MAX];
- char master[NAME_MAX];
- char brick[PATH_MAX];
- char slave_user[NAME_MAX];
- char slave[NAME_MAX];
- char slave_node[NAME_MAX];
- char worker_status[NAME_MAX];
- char crawl_status[NAME_MAX];
- char last_synced[NAME_MAX];
- char last_synced_utc[NAME_MAX];
- char entry[NAME_MAX];
- char data[NAME_MAX];
- char meta[NAME_MAX];
- char failures[NAME_MAX];
- char checkpoint_time[NAME_MAX];
- char checkpoint_time_utc[NAME_MAX];
- char checkpoint_completed[NAME_MAX];
- char checkpoint_completion_time[NAME_MAX];
- char checkpoint_completion_time_utc[NAME_MAX];
- char brick_host_uuid[NAME_MAX];
- char slavekey[NAME_MAX];
- char session_slave[NAME_MAX];
+ char node[NAME_MAX];
+ char master[NAME_MAX];
+ char brick[PATH_MAX];
+ char slave_user[NAME_MAX];
+ char slave[NAME_MAX];
+ char slave_node[NAME_MAX];
+ char worker_status[NAME_MAX];
+ char crawl_status[NAME_MAX];
+ char last_synced[NAME_MAX];
+ char last_synced_utc[NAME_MAX];
+ char entry[NAME_MAX];
+ char data[NAME_MAX];
+ char meta[NAME_MAX];
+ char failures[NAME_MAX];
+ char checkpoint_time[NAME_MAX];
+ char checkpoint_time_utc[NAME_MAX];
+ char checkpoint_completed[NAME_MAX];
+ char checkpoint_completion_time[NAME_MAX];
+ char checkpoint_completion_time_utc[NAME_MAX];
+ char brick_host_uuid[NAME_MAX];
+ char slavekey[NAME_MAX];
+ char session_slave[NAME_MAX];
};
enum glusterd_mgmt_v3_procnum {
- GLUSTERD_MGMT_V3_NULL, /* 0 */
- GLUSTERD_MGMT_V3_LOCK,
- GLUSTERD_MGMT_V3_PRE_VALIDATE,
- GLUSTERD_MGMT_V3_BRICK_OP,
- GLUSTERD_MGMT_V3_COMMIT,
- GLUSTERD_MGMT_V3_POST_VALIDATE,
- GLUSTERD_MGMT_V3_UNLOCK,
- GLUSTERD_MGMT_V3_MAXVALUE,
+ GLUSTERD_MGMT_V3_NULL, /* 0 */
+ GLUSTERD_MGMT_V3_LOCK,
+ GLUSTERD_MGMT_V3_PRE_VALIDATE,
+ GLUSTERD_MGMT_V3_BRICK_OP,
+ GLUSTERD_MGMT_V3_COMMIT,
+ GLUSTERD_MGMT_V3_POST_VALIDATE,
+ GLUSTERD_MGMT_V3_UNLOCK,
+ GLUSTERD_MGMT_V3_MAXVALUE,
};
typedef struct gf_gsync_detailed_status_ gf_gsync_status_t;
enum gf_get_volume_info_type {
- GF_GET_VOLUME_NONE, /* 0 */
- GF_GET_VOLUME_UUID
+ GF_GET_VOLUME_NONE, /* 0 */
+ GF_GET_VOLUME_UUID
};
typedef enum gf_get_volume_info_type gf_get_volume_info_type;
-
enum gf_get_snapshot_info_type {
- GF_GET_SNAPSHOT_LIST,
+ GF_GET_SNAPSHOT_LIST,
};
typedef enum gf_get_snapshot_info_type gf_get_snapshot_info_type;
-enum gf_getspec_flags_type {
- GF_GETSPEC_FLAG_SERVERS_LIST = 1
-};
+enum gf_getspec_flags_type { GF_GETSPEC_FLAG_SERVERS_LIST = 1 };
typedef enum gf_getspec_flags_type gf_getspec_flags_type;
-#define GLUSTER_HNDSK_PROGRAM 14398633 /* Completely random */
-#define GLUSTER_HNDSK_VERSION 2 /* 0.0.2 */
+#define GLUSTER_HNDSK_PROGRAM 14398633 /* Completely random */
+#define GLUSTER_HNDSK_VERSION 2 /* 0.0.2 */
-#define GLUSTER_PMAP_PROGRAM 34123456
-#define GLUSTER_PMAP_VERSION 1
+#define GLUSTER_PMAP_PROGRAM 34123456
+#define GLUSTER_PMAP_VERSION 1
-#define GLUSTER_CBK_PROGRAM 52743234 /* Completely random */
-#define GLUSTER_CBK_VERSION 1 /* 0.0.1 */
+#define GLUSTER_CBK_PROGRAM 52743234 /* Completely random */
+#define GLUSTER_CBK_VERSION 1 /* 0.0.1 */
-#define GLUSTER_FOP_PROGRAM 1298437 /* Completely random */
-#define GLUSTER_FOP_VERSION 330 /* 3.3.0 */
-#define GLUSTER_FOP_PROCCNT GFS3_OP_MAXVALUE
+#define GLUSTER_FOP_PROGRAM 1298437 /* Completely random */
+#define GLUSTER_FOP_VERSION 330 /* 3.3.0 */
+#define GLUSTER_FOP_PROCCNT GFS3_OP_MAXVALUE
-#define GLUSTER_FOP_VERSION_v2 400 /* 4.0.0 */
+#define GLUSTER_FOP_VERSION_v2 400 /* 4.0.0 */
/* Aggregator */
#define GLUSTER_AGGREGATOR_PROGRAM 29852134 /* Completely random */
#define GLUSTER_AGGREGATOR_VERSION 1
/* Second version */
-#define GD_MGMT_PROGRAM 1238433 /* Completely random */
-#define GD_MGMT_VERSION 2 /* 0.0.2 */
+#define GD_MGMT_PROGRAM 1238433 /* Completely random */
+#define GD_MGMT_VERSION 2 /* 0.0.2 */
-#define GD_FRIEND_PROGRAM 1238437 /* Completely random */
-#define GD_FRIEND_VERSION 2 /* 0.0.2 */
+#define GD_FRIEND_PROGRAM 1238437 /* Completely random */
+#define GD_FRIEND_VERSION 2 /* 0.0.2 */
-#define GLUSTER_CLI_PROGRAM 1238463 /* Completely random */
-#define GLUSTER_CLI_VERSION 2 /* 0.0.2 */
+#define GLUSTER_CLI_PROGRAM 1238463 /* Completely random */
+#define GLUSTER_CLI_VERSION 2 /* 0.0.2 */
-#define GD_BRICK_PROGRAM 4867634 /*Completely random*/
-#define GD_BRICK_VERSION 2
+#define GD_BRICK_PROGRAM 4867634 /*Completely random*/
+#define GD_BRICK_VERSION 2
/* Third version */
-#define GD_MGMT_V3_VERSION 3
+#define GD_MGMT_V3_VERSION 3
/* OP-VERSION handshake */
-#define GD_MGMT_HNDSK_PROGRAM 1239873 /* Completely random */
-#define GD_MGMT_HNDSK_VERSION 1
+#define GD_MGMT_HNDSK_PROGRAM 1239873 /* Completely random */
+#define GD_MGMT_HNDSK_VERSION 1
-#define GD_VOLUME_NAME_MAX ((NAME_MAX + 1) - 5) /* Maximum size of volume name */
-#define GD_VOLUME_NAME_MAX_TIER (GD_VOLUME_NAME_MAX + 5) /* +5 needed for '-hot'
- and '-cold' suffixes*/
+#define GD_VOLUME_NAME_MAX \
+ ((NAME_MAX + 1) - 5) /* Maximum size of volume name */
+#define GD_VOLUME_NAME_MAX_TIER \
+ (GD_VOLUME_NAME_MAX + 5) /* +5 needed for '-hot' \
+ and '-cold' suffixes*/
-#define GLUSTER_PROCESS_UUID_FMT "CTX_ID:%s-GRAPH_ID:%d-PID:%d-HOST:%s-PC_NAME:%s-RECON_NO:%s"
+#define GLUSTER_PROCESS_UUID_FMT \
+ "CTX_ID:%s-GRAPH_ID:%d-PID:%d-HOST:%s-PC_NAME:%s-RECON_NO:%s"
#endif /* !_PROTOCOL_COMMON_H */
diff --git a/rpc/rpc-lib/src/rpc-clnt-ping.h b/rpc/rpc-lib/src/rpc-clnt-ping.h
index d92e5054190..fcbac6f9e21 100644
--- a/rpc/rpc-lib/src/rpc-clnt-ping.h
+++ b/rpc/rpc-lib/src/rpc-clnt-ping.h
@@ -8,9 +8,8 @@
cases as published by the Free Software Foundation.
*/
-
#define RPC_DEFAULT_PING_TIMEOUT 30
void
-rpc_clnt_check_and_start_ping (struct rpc_clnt *rpc_ptr);
+rpc_clnt_check_and_start_ping(struct rpc_clnt *rpc_ptr);
int
-rpc_clnt_remove_ping_timer_locked (struct rpc_clnt *rpc);
+rpc_clnt_remove_ping_timer_locked(struct rpc_clnt *rpc);
diff --git a/rpc/rpc-lib/src/rpc-clnt.h b/rpc/rpc-lib/src/rpc-clnt.h
index 2d6cb060c4e..28b6f0e7f4d 100644
--- a/rpc/rpc-lib/src/rpc-clnt.h
+++ b/rpc/rpc-lib/src/rpc-clnt.h
@@ -18,14 +18,13 @@
#include "glusterfs3.h"
typedef enum {
- RPC_CLNT_CONNECT,
- RPC_CLNT_DISCONNECT,
- RPC_CLNT_PING,
- RPC_CLNT_MSG,
- RPC_CLNT_DESTROY
+ RPC_CLNT_CONNECT,
+ RPC_CLNT_DISCONNECT,
+ RPC_CLNT_PING,
+ RPC_CLNT_MSG,
+ RPC_CLNT_DESTROY
} rpc_clnt_event_t;
-
#define SFRAME_GET_PROGNUM(sframe) (sframe->rpcreq->prog->prognum)
#define SFRAME_GET_PROGVER(sframe) (sframe->rpcreq->prog->progver)
#define SFRAME_GET_PROCNUM(sframe) (sframe->rpcreq->procnum)
@@ -35,60 +34,59 @@ struct rpc_clnt;
struct rpc_clnt_config;
struct rpc_clnt_program;
-typedef int (*rpc_clnt_notify_t) (struct rpc_clnt *rpc, void *mydata,
- rpc_clnt_event_t fn, void *data);
+typedef int (*rpc_clnt_notify_t)(struct rpc_clnt *rpc, void *mydata,
+ rpc_clnt_event_t fn, void *data);
-typedef int (*fop_cbk_fn_t) (struct rpc_req *req, struct iovec *iov, int count,
- void *myframe);
+typedef int (*fop_cbk_fn_t)(struct rpc_req *req, struct iovec *iov, int count,
+ void *myframe);
-typedef int (*clnt_fn_t) (call_frame_t *fr, xlator_t *xl, void *args);
+typedef int (*clnt_fn_t)(call_frame_t *fr, xlator_t *xl, void *args);
struct saved_frame {
- union {
- struct list_head list;
- struct {
- struct saved_frame *frame_next;
- struct saved_frame *frame_prev;
- };
- };
- void *capital_this;
- void *frame;
- struct timeval saved_at;
- struct rpc_req *rpcreq;
- rpc_transport_rsp_t rsp;
+ union {
+ struct list_head list;
+ struct {
+ struct saved_frame *frame_next;
+ struct saved_frame *frame_prev;
+ };
+ };
+ void *capital_this;
+ void *frame;
+ struct timeval saved_at;
+ struct rpc_req *rpcreq;
+ rpc_transport_rsp_t rsp;
};
struct saved_frames {
- int64_t count;
- struct saved_frame sf;
- struct saved_frame lk_sf;
+ int64_t count;
+ struct saved_frame sf;
+ struct saved_frame lk_sf;
};
-
/* Initialized by procnum */
typedef struct rpc_clnt_procedure {
- char *procname;
- clnt_fn_t fn;
+ char *procname;
+ clnt_fn_t fn;
} rpc_clnt_procedure_t;
typedef struct rpc_clnt_program {
- char *progname;
- int prognum;
- int progver;
- rpc_clnt_procedure_t *proctable;
- char **procnames;
- int numproc;
+ char *progname;
+ int prognum;
+ int progver;
+ rpc_clnt_procedure_t *proctable;
+ char **procnames;
+ int numproc;
} rpc_clnt_prog_t;
-typedef int (*rpcclnt_cb_fn) (struct rpc_clnt *rpc, void *mydata, void *data);
+typedef int (*rpcclnt_cb_fn)(struct rpc_clnt *rpc, void *mydata, void *data);
/* The descriptor for each procedure/actor that runs
* over the RPC service.
*/
typedef struct rpcclnt_actor_desc {
- char procname[32];
- int procnum;
- rpcclnt_cb_fn actor;
+ char procname[32];
+ int procnum;
+ rpcclnt_cb_fn actor;
} rpcclnt_cb_actor_t;
/* Describes a program and its version along with the function pointers
@@ -96,113 +94,112 @@ typedef struct rpcclnt_actor_desc {
* Never changed ever by any thread so no need for a lock.
*/
typedef struct rpcclnt_cb_program {
- char progname[32];
- int prognum;
- int progver;
- rpcclnt_cb_actor_t *actors; /* All procedure handlers */
- int numactors; /* Num actors in actor array */
-
- /* Program specific state handed to actors */
- void *private;
+ char progname[32];
+ int prognum;
+ int progver;
+ rpcclnt_cb_actor_t *actors; /* All procedure handlers */
+ int numactors; /* Num actors in actor array */
+ /* Program specific state handed to actors */
+ void *private;
- /* list member to link to list of registered services with rpc_clnt */
- struct list_head program;
+ /* list member to link to list of registered services with rpc_clnt */
+ struct list_head program;
- /* Needed for passing back in cb_actor */
- void *mydata;
+ /* Needed for passing back in cb_actor */
+ void *mydata;
} rpcclnt_cb_program_t;
-
-
typedef struct rpc_auth_data {
- int flavour;
- int datalen;
- char authdata[GF_MAX_AUTH_BYTES];
+ int flavour;
+ int datalen;
+ char authdata[GF_MAX_AUTH_BYTES];
} rpc_auth_data_t;
-
struct rpc_clnt_config {
- int rpc_timeout;
- int remote_port;
- char * remote_host;
- int ping_timeout;
+ int rpc_timeout;
+ int remote_port;
+ char *remote_host;
+ int ping_timeout;
};
-
-#define rpc_auth_flavour(au) ((au).flavour)
+#define rpc_auth_flavour(au) ((au).flavour)
struct rpc_clnt_connection {
- pthread_mutex_t lock;
- rpc_transport_t *trans;
- struct rpc_clnt_config config;
- gf_timer_t *reconnect;
- gf_timer_t *timer;
- gf_timer_t *ping_timer;
- struct rpc_clnt *rpc_clnt;
- char connected;
- gf_boolean_t disconnected;
- struct saved_frames *saved_frames;
- int32_t frame_timeout;
- struct timespec last_sent;
- struct timespec last_received;
- int32_t ping_started;
- char *name;
- int32_t ping_timeout;
- uint64_t pingcnt;
- uint64_t msgcnt;
- uint64_t cleanup_gen;
+ pthread_mutex_t lock;
+ rpc_transport_t *trans;
+ struct rpc_clnt_config config;
+ gf_timer_t *reconnect;
+ gf_timer_t *timer;
+ gf_timer_t *ping_timer;
+ struct rpc_clnt *rpc_clnt;
+ char connected;
+ gf_boolean_t disconnected;
+ struct saved_frames *saved_frames;
+ int32_t frame_timeout;
+ struct timespec last_sent;
+ struct timespec last_received;
+ int32_t ping_started;
+ char *name;
+ int32_t ping_timeout;
+ uint64_t pingcnt;
+ uint64_t msgcnt;
+ uint64_t cleanup_gen;
};
typedef struct rpc_clnt_connection rpc_clnt_connection_t;
struct rpc_req {
- rpc_clnt_connection_t *conn;
- uint32_t xid;
- struct iovec req[2];
- int reqcnt;
- struct iobref *req_iobref;
- struct iovec rsp[2];
- int rspcnt;
- struct iobref *rsp_iobref;
- int rpc_status;
- rpc_auth_data_t verf;
- rpc_clnt_prog_t *prog;
- int procnum;
- fop_cbk_fn_t cbkfn;
- void *conn_private;
+ rpc_clnt_connection_t *conn;
+ uint32_t xid;
+ struct iovec req[2];
+ int reqcnt;
+ struct iobref *req_iobref;
+ struct iovec rsp[2];
+ int rspcnt;
+ struct iobref *rsp_iobref;
+ int rpc_status;
+ rpc_auth_data_t verf;
+ rpc_clnt_prog_t *prog;
+ int procnum;
+ fop_cbk_fn_t cbkfn;
+ void *conn_private;
};
typedef struct rpc_clnt {
- pthread_mutex_t lock;
- rpc_clnt_notify_t notifyfn;
- rpc_clnt_connection_t conn;
- void *mydata;
- gf_atomic_t xid;
+ pthread_mutex_t lock;
+ rpc_clnt_notify_t notifyfn;
+ rpc_clnt_connection_t conn;
+ void *mydata;
+ gf_atomic_t xid;
- /* list of cb programs registered with rpc-clnt */
- struct list_head programs;
+ /* list of cb programs registered with rpc-clnt */
+ struct list_head programs;
- /* Memory pool for rpc_req_t */
- struct mem_pool *reqpool;
+ /* Memory pool for rpc_req_t */
+ struct mem_pool *reqpool;
- struct mem_pool *saved_frames_pool;
+ struct mem_pool *saved_frames_pool;
- glusterfs_ctx_t *ctx;
- gf_atomic_t refcount;
- int auth_value;
- char disabled;
- xlator_t *owner;
+ glusterfs_ctx_t *ctx;
+ gf_atomic_t refcount;
+ int auth_value;
+ char disabled;
+ xlator_t *owner;
} rpc_clnt_t;
-struct rpc_clnt *rpc_clnt_new (dict_t *options, xlator_t *owner,
- char *name, uint32_t reqpool_size);
+struct rpc_clnt *
+rpc_clnt_new(dict_t *options, xlator_t *owner, char *name,
+ uint32_t reqpool_size);
-int rpc_clnt_start (struct rpc_clnt *rpc);
+int
+rpc_clnt_start(struct rpc_clnt *rpc);
-int rpc_clnt_cleanup_and_start (struct rpc_clnt *rpc);
+int
+rpc_clnt_cleanup_and_start(struct rpc_clnt *rpc);
-int rpc_clnt_register_notify (struct rpc_clnt *rpc, rpc_clnt_notify_t fn,
- void *mydata);
+int
+rpc_clnt_register_notify(struct rpc_clnt *rpc, rpc_clnt_notify_t fn,
+ void *mydata);
/* Some preconditions related to vectors holding responses.
* @rsphdr: should contain pointer to buffer which can hold response header
@@ -219,44 +216,50 @@ int rpc_clnt_register_notify (struct rpc_clnt *rpc, rpc_clnt_notify_t fn,
* of the header.
*/
-int rpc_clnt_submit (struct rpc_clnt *rpc, rpc_clnt_prog_t *prog,
- int procnum, fop_cbk_fn_t cbkfn,
- struct iovec *proghdr, int proghdrcount,
- struct iovec *progpayload, int progpayloadcount,
- struct iobref *iobref, void *frame, struct iovec *rsphdr,
- int rsphdr_count, struct iovec *rsp_payload,
- int rsp_payload_count, struct iobref *rsp_iobref);
+int
+rpc_clnt_submit(struct rpc_clnt *rpc, rpc_clnt_prog_t *prog, int procnum,
+ fop_cbk_fn_t cbkfn, struct iovec *proghdr, int proghdrcount,
+ struct iovec *progpayload, int progpayloadcount,
+ struct iobref *iobref, void *frame, struct iovec *rsphdr,
+ int rsphdr_count, struct iovec *rsp_payload,
+ int rsp_payload_count, struct iobref *rsp_iobref);
struct rpc_clnt *
-rpc_clnt_ref (struct rpc_clnt *rpc);
+rpc_clnt_ref(struct rpc_clnt *rpc);
struct rpc_clnt *
-rpc_clnt_unref (struct rpc_clnt *rpc);
+rpc_clnt_unref(struct rpc_clnt *rpc);
-int rpc_clnt_connection_cleanup (rpc_clnt_connection_t *conn);
-int rpc_clnt_reconnect_cleanup (rpc_clnt_connection_t *conn);
-gf_boolean_t is_rpc_clnt_disconnected (rpc_clnt_connection_t *conn);
+int
+rpc_clnt_connection_cleanup(rpc_clnt_connection_t *conn);
+int
+rpc_clnt_reconnect_cleanup(rpc_clnt_connection_t *conn);
+gf_boolean_t
+is_rpc_clnt_disconnected(rpc_clnt_connection_t *conn);
-void rpc_clnt_reconnect (void *trans_ptr);
+void
+rpc_clnt_reconnect(void *trans_ptr);
-void rpc_clnt_reconfig (struct rpc_clnt *rpc, struct rpc_clnt_config *config);
+void
+rpc_clnt_reconfig(struct rpc_clnt *rpc, struct rpc_clnt_config *config);
/* All users of RPC services should use this API to register their
* procedure handlers.
*/
-int rpcclnt_cbk_program_register (struct rpc_clnt *svc,
- rpcclnt_cb_program_t *program, void *mydata);
+int
+rpcclnt_cbk_program_register(struct rpc_clnt *svc,
+ rpcclnt_cb_program_t *program, void *mydata);
void
-rpc_clnt_disable (struct rpc_clnt *rpc);
+rpc_clnt_disable(struct rpc_clnt *rpc);
void
-rpc_clnt_disconnect (struct rpc_clnt *rpc);
+rpc_clnt_disconnect(struct rpc_clnt *rpc);
char
-rpc_clnt_is_disabled (struct rpc_clnt *rpc);
+rpc_clnt_is_disabled(struct rpc_clnt *rpc);
int
-rpc_clnt_mgmt_pmap_signout (glusterfs_ctx_t *ctx, char *brick_name);
+rpc_clnt_mgmt_pmap_signout(glusterfs_ctx_t *ctx, char *brick_name);
#endif /* !_RPC_CLNT_H */
diff --git a/rpc/rpc-lib/src/rpc-drc.h b/rpc/rpc-lib/src/rpc-drc.h
index cd9e2c73d32..1fd1e5e24ef 100644
--- a/rpc/rpc-lib/src/rpc-drc.h
+++ b/rpc/rpc-lib/src/rpc-drc.h
@@ -19,83 +19,79 @@
/* per-client cache structure */
struct drc_client {
- uint32_t ref;
- union gf_sock_union sock_union;
- /* pointers to the cache */
- struct rb_table *rbtree;
- /* no. of ops currently cached */
- uint32_t op_count;
- struct list_head client_list;
+ uint32_t ref;
+ union gf_sock_union sock_union;
+ /* pointers to the cache */
+ struct rb_table *rbtree;
+ /* no. of ops currently cached */
+ uint32_t op_count;
+ struct list_head client_list;
};
struct drc_cached_op {
- drc_op_state_t state;
- uint32_t xid;
- int prognum;
- int progversion;
- int procnum;
- rpc_transport_msg_t msg;
- drc_client_t *client;
- struct list_head client_list;
- struct list_head global_list;
- int32_t ref;
+ drc_op_state_t state;
+ uint32_t xid;
+ int prognum;
+ int progversion;
+ int procnum;
+ rpc_transport_msg_t msg;
+ drc_client_t *client;
+ struct list_head client_list;
+ struct list_head global_list;
+ int32_t ref;
};
/* global drc definitions */
-enum drc_status {
- DRC_UNINITIATED,
- DRC_INITIATED
-};
+enum drc_status { DRC_UNINITIATED, DRC_INITIATED };
typedef enum drc_status drc_status_t;
struct drc_globals {
- /* allocator must be the first member since
- * it is used so in gf_libavl_allocator
- */
- struct libavl_allocator allocator;
- drc_type_t type;
- /* configurable size parameter */
- uint32_t global_cache_size;
- drc_lru_factor_t lru_factor;
- gf_lock_t lock;
- drc_status_t status;
- uint32_t op_count;
- uint64_t cache_hits;
- uint64_t intransit_hits;
- struct mem_pool *mempool;
- struct list_head cache_head;
- uint32_t client_count;
- struct list_head clients_head;
+ /* allocator must be the first member since
+ * it is used so in gf_libavl_allocator
+ */
+ struct libavl_allocator allocator;
+ drc_type_t type;
+ /* configurable size parameter */
+ uint32_t global_cache_size;
+ drc_lru_factor_t lru_factor;
+ gf_lock_t lock;
+ drc_status_t status;
+ uint32_t op_count;
+ uint64_t cache_hits;
+ uint64_t intransit_hits;
+ struct mem_pool *mempool;
+ struct list_head cache_head;
+ uint32_t client_count;
+ struct list_head clients_head;
};
int
-rpcsvc_need_drc (rpcsvc_request_t *req);
+rpcsvc_need_drc(rpcsvc_request_t *req);
drc_cached_op_t *
-rpcsvc_drc_lookup (rpcsvc_request_t *req);
+rpcsvc_drc_lookup(rpcsvc_request_t *req);
int
-rpcsvc_send_cached_reply (rpcsvc_request_t *req, drc_cached_op_t *reply);
+rpcsvc_send_cached_reply(rpcsvc_request_t *req, drc_cached_op_t *reply);
int
-rpcsvc_cache_reply (rpcsvc_request_t *req, struct iobref *iobref,
- struct iovec *rpchdr, int rpchdrcount,
- struct iovec *proghdr, int proghdrcount,
- struct iovec *payload, int payloadcount);
+rpcsvc_cache_reply(rpcsvc_request_t *req, struct iobref *iobref,
+ struct iovec *rpchdr, int rpchdrcount, struct iovec *proghdr,
+ int proghdrcount, struct iovec *payload, int payloadcount);
int
-rpcsvc_cache_request (rpcsvc_request_t *req);
+rpcsvc_cache_request(rpcsvc_request_t *req);
int32_t
-rpcsvc_drc_priv (rpcsvc_drc_globals_t *drc);
+rpcsvc_drc_priv(rpcsvc_drc_globals_t *drc);
int
-rpcsvc_drc_init (rpcsvc_t *svc, dict_t *options);
+rpcsvc_drc_init(rpcsvc_t *svc, dict_t *options);
int
-rpcsvc_drc_deinit (rpcsvc_t *svc);
+rpcsvc_drc_deinit(rpcsvc_t *svc);
int
-rpcsvc_drc_reconfigure (rpcsvc_t *svc, dict_t *options);
+rpcsvc_drc_reconfigure(rpcsvc_t *svc, dict_t *options);
#endif /* RPC_DRC_H */
diff --git a/rpc/rpc-lib/src/rpc-lib-messages.h b/rpc/rpc-lib/src/rpc-lib-messages.h
index 31e0d8ea267..9251578a121 100644
--- a/rpc/rpc-lib/src/rpc-lib-messages.h
+++ b/rpc/rpc-lib/src/rpc-lib-messages.h
@@ -23,21 +23,12 @@
* glfs-message-id.h.
*/
-GLFS_MSGID(RPC_LIB,
- TRANS_MSG_ADDR_FAMILY_NOT_SPECIFIED,
- TRANS_MSG_UNKNOWN_ADDR_FAMILY,
- TRANS_MSG_REMOTE_HOST_ERROR,
- TRANS_MSG_DNS_RESOL_FAILED,
- TRANS_MSG_LISTEN_PATH_ERROR,
- TRANS_MSG_CONNECT_PATH_ERROR,
- TRANS_MSG_GET_ADDR_INFO_FAILED,
- TRANS_MSG_PORT_BIND_FAILED,
- TRANS_MSG_INET_ERROR,
- TRANS_MSG_GET_NAME_INFO_FAILED,
- TRANS_MSG_TRANSPORT_ERROR,
- TRANS_MSG_TIMEOUT_EXCEEDED,
- TRANS_MSG_SOCKET_BIND_ERROR
-);
+GLFS_MSGID(RPC_LIB, TRANS_MSG_ADDR_FAMILY_NOT_SPECIFIED,
+ TRANS_MSG_UNKNOWN_ADDR_FAMILY, TRANS_MSG_REMOTE_HOST_ERROR,
+ TRANS_MSG_DNS_RESOL_FAILED, TRANS_MSG_LISTEN_PATH_ERROR,
+ TRANS_MSG_CONNECT_PATH_ERROR, TRANS_MSG_GET_ADDR_INFO_FAILED,
+ TRANS_MSG_PORT_BIND_FAILED, TRANS_MSG_INET_ERROR,
+ TRANS_MSG_GET_NAME_INFO_FAILED, TRANS_MSG_TRANSPORT_ERROR,
+ TRANS_MSG_TIMEOUT_EXCEEDED, TRANS_MSG_SOCKET_BIND_ERROR);
#endif /* !_RPC_LIB_MESSAGES_H_ */
-
diff --git a/rpc/rpc-lib/src/rpc-transport.h b/rpc/rpc-lib/src/rpc-transport.h
index 332efb45c25..c238501b5c7 100644
--- a/rpc/rpc-lib/src/rpc-transport.h
+++ b/rpc/rpc-lib/src/rpc-transport.h
@@ -11,7 +11,6 @@
#ifndef __RPC_TRANSPORT_H__
#define __RPC_TRANSPORT_H__
-
#include <inttypes.h>
#ifdef GF_SOLARIS_HOST_OS
#include <rpc/auth.h>
@@ -21,7 +20,6 @@
#include <rpc/rpc_msg.h>
-
#ifndef MAX_IOVEC
#define MAX_IOVEC 16
#endif
@@ -43,17 +41,17 @@
*/
#define RPC_FRAGSIZE(fraghdr) ((uint32_t)(fraghdr & 0x7fffffffU))
-#define RPC_FRAGHDR_SIZE 4
-#define RPC_MSGTYPE_SIZE 8
+#define RPC_FRAGHDR_SIZE 4
+#define RPC_MSGTYPE_SIZE 8
/* size of the msg from the start of call-body till and including credlen */
-#define RPC_CALL_BODY_SIZE 24
+#define RPC_CALL_BODY_SIZE 24
-#define RPC_REPLY_STATUS_SIZE 4
+#define RPC_REPLY_STATUS_SIZE 4
#define RPC_AUTH_FLAVOUR_N_LENGTH_SIZE 8
-#define RPC_ACCEPT_STATUS_LEN 4
+#define RPC_ACCEPT_STATUS_LEN 4
struct rpc_transport_ops;
typedef struct rpc_transport rpc_transport_t;
@@ -63,24 +61,24 @@ typedef struct rpc_transport rpc_transport_t;
#include "rpcsvc-common.h"
struct peer_info {
- struct sockaddr_storage sockaddr;
- socklen_t sockaddr_len;
- char identifier[UNIX_PATH_MAX];
- // OP-VERSION of clients
- uint32_t max_op_version;
- uint32_t min_op_version;
- //Volume mounted by client
- char volname[NAME_MAX];
+ struct sockaddr_storage sockaddr;
+ socklen_t sockaddr_len;
+ char identifier[UNIX_PATH_MAX];
+ // OP-VERSION of clients
+ uint32_t max_op_version;
+ uint32_t min_op_version;
+ // Volume mounted by client
+ char volname[NAME_MAX];
};
typedef struct peer_info peer_info_t;
typedef enum msg_type msg_type_t;
typedef enum {
- RPC_TRANSPORT_ACCEPT, /* New client has been accepted */
- RPC_TRANSPORT_DISCONNECT, /* Connection is disconnected */
- RPC_TRANSPORT_CLEANUP, /* connection is about to be freed */
- /*RPC_TRANSPORT_READ,*/ /* An event used to enable rpcsvc to instruct
+ RPC_TRANSPORT_ACCEPT, /* New client has been accepted */
+ RPC_TRANSPORT_DISCONNECT, /* Connection is disconnected */
+ RPC_TRANSPORT_CLEANUP, /* connection is about to be freed */
+ /*RPC_TRANSPORT_READ,*/ /* An event used to enable rpcsvc to instruct
* transport the number of bytes to read.
* This helps in reading large msgs, wherein
* the rpc actors might decide to place the
@@ -92,54 +90,54 @@ typedef enum {
* reading a single msg, this event may be
* delivered more than once.
*/
- RPC_TRANSPORT_MAP_XID_REQUEST, /* receiver of this event should send
- * the prognum and procnum corresponding
- * to xid.
- */
- RPC_TRANSPORT_MSG_RECEIVED, /* Complete rpc msg has been read */
- RPC_TRANSPORT_CONNECT, /* client is connected to server */
- RPC_TRANSPORT_MSG_SENT,
+ RPC_TRANSPORT_MAP_XID_REQUEST, /* receiver of this event should send
+ * the prognum and procnum corresponding
+ * to xid.
+ */
+ RPC_TRANSPORT_MSG_RECEIVED, /* Complete rpc msg has been read */
+ RPC_TRANSPORT_CONNECT, /* client is connected to server */
+ RPC_TRANSPORT_MSG_SENT,
} rpc_transport_event_t;
struct rpc_transport_msg {
- struct iovec *rpchdr;
- int rpchdrcount;
- struct iovec *proghdr;
- int proghdrcount;
- struct iovec *progpayload;
- int progpayloadcount;
- struct iobref *iobref;
+ struct iovec *rpchdr;
+ int rpchdrcount;
+ struct iovec *proghdr;
+ int proghdrcount;
+ struct iovec *progpayload;
+ int progpayloadcount;
+ struct iobref *iobref;
};
typedef struct rpc_transport_msg rpc_transport_msg_t;
struct rpc_transport_rsp {
- struct iovec *rsphdr;
- int rsphdr_count;
- struct iovec *rsp_payload;
- int rsp_payload_count;
- struct iobref *rsp_iobref;
+ struct iovec *rsphdr;
+ int rsphdr_count;
+ struct iovec *rsp_payload;
+ int rsp_payload_count;
+ struct iobref *rsp_iobref;
};
typedef struct rpc_transport_rsp rpc_transport_rsp_t;
struct rpc_transport_req {
- rpc_transport_msg_t msg;
- rpc_transport_rsp_t rsp;
- struct rpc_req *rpc_req;
+ rpc_transport_msg_t msg;
+ rpc_transport_rsp_t rsp;
+ struct rpc_req *rpc_req;
};
typedef struct rpc_transport_req rpc_transport_req_t;
struct rpc_transport_reply {
- rpc_transport_msg_t msg;
- void *private;
+ rpc_transport_msg_t msg;
+ void *private;
};
typedef struct rpc_transport_reply rpc_transport_reply_t;
struct rpc_transport_data {
- char is_request;
- union {
- rpc_transport_req_t req;
- rpc_transport_reply_t reply;
- } data;
+ char is_request;
+ union {
+ rpc_transport_req_t req;
+ rpc_transport_reply_t reply;
+ } data;
};
typedef struct rpc_transport_data rpc_transport_data_t;
@@ -147,173 +145,166 @@ typedef struct rpc_transport_data rpc_transport_data_t;
* rpc_request, hence these should be removed from request_info
*/
struct rpc_request_info {
- uint32_t xid;
- int prognum;
- int progver;
- int procnum;
- void *rpc_req; /* struct rpc_req */
- rpc_transport_rsp_t rsp;
+ uint32_t xid;
+ int prognum;
+ int progver;
+ int procnum;
+ void *rpc_req; /* struct rpc_req */
+ rpc_transport_rsp_t rsp;
};
typedef struct rpc_request_info rpc_request_info_t;
-
struct rpc_transport_pollin {
- struct iovec vector[MAX_IOVEC];
- int count;
- char vectored;
- void *private;
- struct iobref *iobref;
- char is_reply;
+ struct iovec vector[MAX_IOVEC];
+ int count;
+ char vectored;
+ void *private;
+ struct iobref *iobref;
+ char is_reply;
};
typedef struct rpc_transport_pollin rpc_transport_pollin_t;
-typedef int (*rpc_transport_notify_t) (rpc_transport_t *, void *mydata,
- rpc_transport_event_t, void *data, ...);
-
+typedef int (*rpc_transport_notify_t)(rpc_transport_t *, void *mydata,
+ rpc_transport_event_t, void *data, ...);
struct rpc_transport {
- struct rpc_transport_ops *ops;
- rpc_transport_t *listener; /* listener transport to which
- * request for creation of this
- * transport came from. valid only
- * on server process.
- */
-
- void *private;
- struct _client *xl_private;
- void *xl; /* Used for THIS */
- void *mydata;
- pthread_mutex_t lock;
- gf_atomic_t refcount;
-
- int32_t outstanding_rpc_count;
-
- glusterfs_ctx_t *ctx;
- dict_t *options;
- char *name;
- void *dnscache;
- void *drc_client;
- data_t *buf;
- int32_t (*init) (rpc_transport_t *this);
- void (*fini) (rpc_transport_t *this);
- int (*reconfigure) (rpc_transport_t *this, dict_t *options);
- rpc_transport_notify_t notify;
- void *notify_data;
- peer_info_t peerinfo;
- peer_info_t myinfo;
-
- uint64_t total_bytes_read;
- uint64_t total_bytes_write;
- uint32_t xid; /* RPC/XID used for callbacks */
-
- struct list_head list;
- int bind_insecure;
- void *dl_handle; /* handle of dlopen() */
- char *ssl_name;
- dict_t *clnt_options; /* store options received from
- * client */
- /* connect_failed: saves the connect() syscall status as socket_t
- * member holding connect() status can't be accessed by higher gfapi
- * layer or in client management notification handler functions
- */
- gf_boolean_t connect_failed;
+ struct rpc_transport_ops *ops;
+ rpc_transport_t *listener; /* listener transport to which
+ * request for creation of this
+ * transport came from. valid only
+ * on server process.
+ */
+
+ void *private;
+ struct _client *xl_private;
+ void *xl; /* Used for THIS */
+ void *mydata;
+ pthread_mutex_t lock;
+ gf_atomic_t refcount;
+
+ int32_t outstanding_rpc_count;
+
+ glusterfs_ctx_t *ctx;
+ dict_t *options;
+ char *name;
+ void *dnscache;
+ void *drc_client;
+ data_t *buf;
+ int32_t (*init)(rpc_transport_t *this);
+ void (*fini)(rpc_transport_t *this);
+ int (*reconfigure)(rpc_transport_t *this, dict_t *options);
+ rpc_transport_notify_t notify;
+ void *notify_data;
+ peer_info_t peerinfo;
+ peer_info_t myinfo;
+
+ uint64_t total_bytes_read;
+ uint64_t total_bytes_write;
+ uint32_t xid; /* RPC/XID used for callbacks */
+
+ struct list_head list;
+ int bind_insecure;
+ void *dl_handle; /* handle of dlopen() */
+ char *ssl_name;
+ dict_t *clnt_options; /* store options received from
+ * client */
+ /* connect_failed: saves the connect() syscall status as socket_t
+ * member holding connect() status can't be accessed by higher gfapi
+ * layer or in client management notification handler functions
+ */
+ gf_boolean_t connect_failed;
};
struct rpc_transport_ops {
- /* no need of receive op, msg will be delivered through an event
- * notification
- */
- int32_t (*submit_request) (rpc_transport_t *this,
- rpc_transport_req_t *req);
- int32_t (*submit_reply) (rpc_transport_t *this,
- rpc_transport_reply_t *reply);
- int32_t (*connect) (rpc_transport_t *this, int port);
- int32_t (*listen) (rpc_transport_t *this);
- int32_t (*disconnect) (rpc_transport_t *this, gf_boolean_t wait);
- int32_t (*get_peername) (rpc_transport_t *this, char *hostname,
- int hostlen);
- int32_t (*get_peeraddr) (rpc_transport_t *this, char *peeraddr,
- int addrlen, struct sockaddr_storage *sa,
- socklen_t sasize);
- int32_t (*get_myname) (rpc_transport_t *this, char *hostname,
- int hostlen);
- int32_t (*get_myaddr) (rpc_transport_t *this, char *peeraddr,
- int addrlen, struct sockaddr_storage *sa,
- socklen_t sasize);
- int32_t (*throttle) (rpc_transport_t *this, gf_boolean_t onoff);
+ /* no need of receive op, msg will be delivered through an event
+ * notification
+ */
+ int32_t (*submit_request)(rpc_transport_t *this, rpc_transport_req_t *req);
+ int32_t (*submit_reply)(rpc_transport_t *this,
+ rpc_transport_reply_t *reply);
+ int32_t (*connect)(rpc_transport_t *this, int port);
+ int32_t (*listen)(rpc_transport_t *this);
+ int32_t (*disconnect)(rpc_transport_t *this, gf_boolean_t wait);
+ int32_t (*get_peername)(rpc_transport_t *this, char *hostname, int hostlen);
+ int32_t (*get_peeraddr)(rpc_transport_t *this, char *peeraddr, int addrlen,
+ struct sockaddr_storage *sa, socklen_t sasize);
+ int32_t (*get_myname)(rpc_transport_t *this, char *hostname, int hostlen);
+ int32_t (*get_myaddr)(rpc_transport_t *this, char *peeraddr, int addrlen,
+ struct sockaddr_storage *sa, socklen_t sasize);
+ int32_t (*throttle)(rpc_transport_t *this, gf_boolean_t onoff);
};
int32_t
-rpc_transport_count (const char *transport_type);
+rpc_transport_count(const char *transport_type);
int32_t
-rpc_transport_listen (rpc_transport_t *this);
+rpc_transport_listen(rpc_transport_t *this);
int32_t
-rpc_transport_connect (rpc_transport_t *this, int port);
+rpc_transport_connect(rpc_transport_t *this, int port);
int32_t
-rpc_transport_disconnect (rpc_transport_t *this, gf_boolean_t wait);
+rpc_transport_disconnect(rpc_transport_t *this, gf_boolean_t wait);
int32_t
-rpc_transport_destroy (rpc_transport_t *this);
+rpc_transport_destroy(rpc_transport_t *this);
int32_t
-rpc_transport_notify (rpc_transport_t *this, rpc_transport_event_t event,
- void *data, ...);
+rpc_transport_notify(rpc_transport_t *this, rpc_transport_event_t event,
+ void *data, ...);
int32_t
-rpc_transport_submit_request (rpc_transport_t *this, rpc_transport_req_t *req);
+rpc_transport_submit_request(rpc_transport_t *this, rpc_transport_req_t *req);
int32_t
-rpc_transport_submit_reply (rpc_transport_t *this,
- rpc_transport_reply_t *reply);
+rpc_transport_submit_reply(rpc_transport_t *this, rpc_transport_reply_t *reply);
rpc_transport_t *
-rpc_transport_load (glusterfs_ctx_t *ctx, dict_t *options, char *name);
+rpc_transport_load(glusterfs_ctx_t *ctx, dict_t *options, char *name);
rpc_transport_t *
-rpc_transport_ref (rpc_transport_t *trans);
+rpc_transport_ref(rpc_transport_t *trans);
int32_t
-rpc_transport_unref (rpc_transport_t *trans);
+rpc_transport_unref(rpc_transport_t *trans);
int
-rpc_transport_register_notify (rpc_transport_t *trans, rpc_transport_notify_t,
- void *mydata);
+rpc_transport_register_notify(rpc_transport_t *trans, rpc_transport_notify_t,
+ void *mydata);
int32_t
-rpc_transport_get_peername (rpc_transport_t *this, char *hostname, int hostlen);
+rpc_transport_get_peername(rpc_transport_t *this, char *hostname, int hostlen);
int32_t
-rpc_transport_get_peeraddr (rpc_transport_t *this, char *peeraddr, int addrlen,
- struct sockaddr_storage *sa, size_t salen);
+rpc_transport_get_peeraddr(rpc_transport_t *this, char *peeraddr, int addrlen,
+ struct sockaddr_storage *sa, size_t salen);
int32_t
-rpc_transport_get_myname (rpc_transport_t *this, char *hostname, int hostlen);
+rpc_transport_get_myname(rpc_transport_t *this, char *hostname, int hostlen);
int32_t
-rpc_transport_get_myaddr (rpc_transport_t *this, char *peeraddr, int addrlen,
- struct sockaddr_storage *sa, size_t salen);
+rpc_transport_get_myaddr(rpc_transport_t *this, char *peeraddr, int addrlen,
+ struct sockaddr_storage *sa, size_t salen);
int
-rpc_transport_throttle (rpc_transport_t *this, gf_boolean_t onoff);
+rpc_transport_throttle(rpc_transport_t *this, gf_boolean_t onoff);
rpc_transport_pollin_t *
-rpc_transport_pollin_alloc (rpc_transport_t *this, struct iovec *vector,
- int count, struct iobuf *hdr_iobuf,
- struct iobref *iobref, void *private);
+rpc_transport_pollin_alloc(rpc_transport_t *this, struct iovec *vector,
+ int count, struct iobuf *hdr_iobuf,
+ struct iobref *iobref, void *private);
void
-rpc_transport_pollin_destroy (rpc_transport_pollin_t *pollin);
+rpc_transport_pollin_destroy(rpc_transport_pollin_t *pollin);
int
-rpc_transport_keepalive_options_set (dict_t *options, int32_t interval,
- int32_t time, int32_t timeout);
+rpc_transport_keepalive_options_set(dict_t *options, int32_t interval,
+ int32_t time, int32_t timeout);
int
-rpc_transport_unix_options_build (dict_t **options, char *filepath,
- int frame_timeout);
+rpc_transport_unix_options_build(dict_t **options, char *filepath,
+ int frame_timeout);
int
-rpc_transport_inet_options_build (dict_t **options, const char *hostname, int port);
+rpc_transport_inet_options_build(dict_t **options, const char *hostname,
+ int port);
#endif /* __RPC_TRANSPORT_H__ */
diff --git a/rpc/rpc-lib/src/rpcsvc-common.h b/rpc/rpc-lib/src/rpcsvc-common.h
index ab715d3417e..6a36b1f1b9b 100644
--- a/rpc/rpc-lib/src/rpcsvc-common.h
+++ b/rpc/rpc-lib/src/rpcsvc-common.h
@@ -19,17 +19,16 @@
#include "xlator.h"
typedef enum {
- RPCSVC_EVENT_ACCEPT,
- RPCSVC_EVENT_DISCONNECT,
- RPCSVC_EVENT_TRANSPORT_DESTROY,
- RPCSVC_EVENT_LISTENER_DEAD,
+ RPCSVC_EVENT_ACCEPT,
+ RPCSVC_EVENT_DISCONNECT,
+ RPCSVC_EVENT_TRANSPORT_DESTROY,
+ RPCSVC_EVENT_LISTENER_DEAD,
} rpcsvc_event_t;
-
struct rpcsvc_state;
-typedef int (*rpcsvc_notify_t) (struct rpcsvc_state *, void *mydata,
- rpcsvc_event_t, void *data);
+typedef int (*rpcsvc_notify_t)(struct rpcsvc_state *, void *mydata,
+ rpcsvc_event_t, void *data);
struct drc_globals;
typedef struct drc_globals rpcsvc_drc_globals_t;
@@ -37,95 +36,79 @@ typedef struct drc_globals rpcsvc_drc_globals_t;
/* Contains global state required for all the RPC services.
*/
typedef struct rpcsvc_state {
+ /* Contains list of (program, version) handlers.
+ * other options.
+ */
- /* Contains list of (program, version) handlers.
- * other options.
- */
-
- pthread_rwlock_t rpclock;
+ pthread_rwlock_t rpclock;
- unsigned int memfactor;
+ unsigned int memfactor;
- /* List of the authentication schemes available. */
- struct list_head authschemes;
+ /* List of the authentication schemes available. */
+ struct list_head authschemes;
- /* Reference to the options */
- dict_t *options;
+ /* Reference to the options */
+ dict_t *options;
- /* Allow insecure ports. */
- gf_boolean_t allow_insecure;
- gf_boolean_t register_portmap;
- gf_boolean_t root_squash;
- uid_t anonuid;
- gid_t anongid;
- glusterfs_ctx_t *ctx;
+ /* Allow insecure ports. */
+ gf_boolean_t allow_insecure;
+ gf_boolean_t register_portmap;
+ gf_boolean_t root_squash;
+ uid_t anonuid;
+ gid_t anongid;
+ glusterfs_ctx_t *ctx;
- /* list of connections which will listen for incoming connections */
- struct list_head listeners;
+ /* list of connections which will listen for incoming connections */
+ struct list_head listeners;
- /* list of programs registered with rpcsvc */
- struct list_head programs;
+ /* list of programs registered with rpcsvc */
+ struct list_head programs;
- /* list of notification callbacks */
- struct list_head notify;
- int notify_count;
+ /* list of notification callbacks */
+ struct list_head notify;
+ int notify_count;
- xlator_t *xl; /* xlator */
- void *mydata;
- rpcsvc_notify_t notifyfn;
- struct mem_pool *rxpool;
- rpcsvc_drc_globals_t *drc;
+ xlator_t *xl; /* xlator */
+ void *mydata;
+ rpcsvc_notify_t notifyfn;
+ struct mem_pool *rxpool;
+ rpcsvc_drc_globals_t *drc;
- /* per-client limit of outstanding rpc requests */
- int outstanding_rpc_limit;
- gf_boolean_t addr_namelookup;
- /* determine whether throttling is needed, by default OFF */
- gf_boolean_t throttle;
+ /* per-client limit of outstanding rpc requests */
+ int outstanding_rpc_limit;
+ gf_boolean_t addr_namelookup;
+ /* determine whether throttling is needed, by default OFF */
+ gf_boolean_t throttle;
} rpcsvc_t;
/* DRC START */
-enum drc_op_type {
- DRC_NA = 0,
- DRC_IDEMPOTENT = 1,
- DRC_NON_IDEMPOTENT = 2
-};
+enum drc_op_type { DRC_NA = 0, DRC_IDEMPOTENT = 1, DRC_NON_IDEMPOTENT = 2 };
typedef enum drc_op_type drc_op_type_t;
-enum drc_type {
- DRC_TYPE_NONE = 0,
- DRC_TYPE_IN_MEMORY = 1
-};
+enum drc_type { DRC_TYPE_NONE = 0, DRC_TYPE_IN_MEMORY = 1 };
typedef enum drc_type drc_type_t;
enum drc_lru_factor {
- DRC_LRU_5_PC = 20,
- DRC_LRU_10_PC = 10,
- DRC_LRU_25_PC = 4,
- DRC_LRU_50_PC = 2
+ DRC_LRU_5_PC = 20,
+ DRC_LRU_10_PC = 10,
+ DRC_LRU_25_PC = 4,
+ DRC_LRU_50_PC = 2
};
typedef enum drc_lru_factor drc_lru_factor_t;
-enum drc_xid_state {
- DRC_XID_MONOTONOUS = 0,
- DRC_XID_WRAPPED = 1
-};
+enum drc_xid_state { DRC_XID_MONOTONOUS = 0, DRC_XID_WRAPPED = 1 };
typedef enum drc_xid_state drc_xid_state_t;
-enum drc_op_state {
- DRC_OP_IN_TRANSIT = 0,
- DRC_OP_CACHED = 1
-};
+enum drc_op_state { DRC_OP_IN_TRANSIT = 0, DRC_OP_CACHED = 1 };
typedef enum drc_op_state drc_op_state_t;
-enum drc_policy {
- DRC_LRU = 0
-};
+enum drc_policy { DRC_LRU = 0 };
typedef enum drc_policy drc_policy_t;
/* Default policies for DRC */
-#define DRC_DEFAULT_TYPE DRC_TYPE_IN_MEMORY
-#define DRC_DEFAULT_CACHE_SIZE 0x20000
-#define DRC_DEFAULT_LRU_FACTOR DRC_LRU_25_PC
+#define DRC_DEFAULT_TYPE DRC_TYPE_IN_MEMORY
+#define DRC_DEFAULT_CACHE_SIZE 0x20000
+#define DRC_DEFAULT_LRU_FACTOR DRC_LRU_25_PC
/* DRC END */
diff --git a/rpc/rpc-lib/src/rpcsvc.h b/rpc/rpc-lib/src/rpcsvc.h
index c6efa4f5369..ebb836fba3f 100644
--- a/rpc/rpc-lib/src/rpcsvc.h
+++ b/rpc/rpc-lib/src/rpcsvc.h
@@ -33,29 +33,30 @@
#define MAX_IOVEC 16
#endif
-#define RPCSVC_DEFAULT_OUTSTANDING_RPC_LIMIT 64 /* Default for protocol/server */
+#define RPCSVC_DEFAULT_OUTSTANDING_RPC_LIMIT \
+ 64 /* Default for protocol/server */
#define RPCSVC_DEF_NFS_OUTSTANDING_RPC_LIMIT 16 /* Default for nfs/server */
#define RPCSVC_MAX_OUTSTANDING_RPC_LIMIT 65536
#define RPCSVC_MIN_OUTSTANDING_RPC_LIMIT 0 /* No limit i.e. Unlimited */
-#define GF_RPCSVC "rpc-service"
+#define GF_RPCSVC "rpc-service"
#define RPCSVC_THREAD_STACK_SIZE ((size_t)(1024 * GF_UNIT_KB))
-#define RPCSVC_FRAGHDR_SIZE 4 /* 4-byte RPC fragment header size */
-#define RPCSVC_DEFAULT_LISTEN_PORT GF_DEFAULT_BASE_PORT
-#define RPCSVC_DEFAULT_MEMFACTOR 8
-#define RPCSVC_EVENTPOOL_SIZE_MULT 1024
-#define RPCSVC_POOLCOUNT_MULT 64
-#define RPCSVC_CONN_READ (128 * GF_UNIT_KB)
-#define RPCSVC_PAGE_SIZE (128 * GF_UNIT_KB)
-#define RPC_ROOT_UID 0
-#define RPC_ROOT_GID 0
-#define RPC_NOBODY_UID 65534
-#define RPC_NOBODY_GID 65534
+#define RPCSVC_FRAGHDR_SIZE 4 /* 4-byte RPC fragment header size */
+#define RPCSVC_DEFAULT_LISTEN_PORT GF_DEFAULT_BASE_PORT
+#define RPCSVC_DEFAULT_MEMFACTOR 8
+#define RPCSVC_EVENTPOOL_SIZE_MULT 1024
+#define RPCSVC_POOLCOUNT_MULT 64
+#define RPCSVC_CONN_READ (128 * GF_UNIT_KB)
+#define RPCSVC_PAGE_SIZE (128 * GF_UNIT_KB)
+#define RPC_ROOT_UID 0
+#define RPC_ROOT_GID 0
+#define RPC_NOBODY_UID 65534
+#define RPC_NOBODY_GID 65534
/* RPC Record States */
-#define RPCSVC_READ_FRAGHDR 1
-#define RPCSVC_READ_FRAG 2
+#define RPCSVC_READ_FRAGHDR 1
+#define RPCSVC_READ_FRAG 2
/* The size in bytes, if crossed by a fragment will be handed over to the
* vectored actor so that it can allocate its buffers the way it wants.
* In our RPC layer, we assume that vectored RPC requests/records are never
@@ -63,21 +64,28 @@
* whether the record should be handled in RPC layer completely or handed to
* the vectored handler.
*/
-#define RPCSVC_VECTORED_FRAGSZ 4096
-#define RPCSVC_VECTOR_READCRED 1003
-#define RPCSVC_VECTOR_READVERFSZ 1004
-#define RPCSVC_VECTOR_READVERF 1005
-#define RPCSVC_VECTOR_IGNORE 1006
-#define RPCSVC_VECTOR_READVEC 1007
-#define RPCSVC_VECTOR_READPROCHDR 1008
-
-#define rpcsvc_record_vectored_baremsg(rs) (((rs)->state == RPCSVC_READ_FRAG) && (rs)->vecstate == 0)
-#define rpcsvc_record_vectored_cred(rs) ((rs)->vecstate == RPCSVC_VECTOR_READCRED)
-#define rpcsvc_record_vectored_verfsz(rs) ((rs)->vecstate == RPCSVC_VECTOR_READVERFSZ)
-#define rpcsvc_record_vectored_verfread(rs) ((rs)->vecstate == RPCSVC_VECTOR_READVERF)
-#define rpcsvc_record_vectored_ignore(rs) ((rs)->vecstate == RPCSVC_VECTOR_IGNORE)
-#define rpcsvc_record_vectored_readvec(rs) ((rs)->vecstate == RPCSVC_VECTOR_READVEC)
-#define rpcsvc_record_vectored_readprochdr(rs) ((rs)->vecstate == RPCSVC_VECTOR_READPROCHDR)
+#define RPCSVC_VECTORED_FRAGSZ 4096
+#define RPCSVC_VECTOR_READCRED 1003
+#define RPCSVC_VECTOR_READVERFSZ 1004
+#define RPCSVC_VECTOR_READVERF 1005
+#define RPCSVC_VECTOR_IGNORE 1006
+#define RPCSVC_VECTOR_READVEC 1007
+#define RPCSVC_VECTOR_READPROCHDR 1008
+
+#define rpcsvc_record_vectored_baremsg(rs) \
+ (((rs)->state == RPCSVC_READ_FRAG) && (rs)->vecstate == 0)
+#define rpcsvc_record_vectored_cred(rs) \
+ ((rs)->vecstate == RPCSVC_VECTOR_READCRED)
+#define rpcsvc_record_vectored_verfsz(rs) \
+ ((rs)->vecstate == RPCSVC_VECTOR_READVERFSZ)
+#define rpcsvc_record_vectored_verfread(rs) \
+ ((rs)->vecstate == RPCSVC_VECTOR_READVERF)
+#define rpcsvc_record_vectored_ignore(rs) \
+ ((rs)->vecstate == RPCSVC_VECTOR_IGNORE)
+#define rpcsvc_record_vectored_readvec(rs) \
+ ((rs)->vecstate == RPCSVC_VECTOR_READVEC)
+#define rpcsvc_record_vectored_readprochdr(rs) \
+ ((rs)->vecstate == RPCSVC_VECTOR_READPROCHDR)
#define rpcsvc_record_vectored(rs) ((rs)->fragsize > RPCSVC_VECTORED_FRAGSZ)
/* Includes bytes up to and including the credential length field. The credlen
* will be followed by @credlen bytes of credential data which will have to be
@@ -85,60 +93,58 @@
* verifier which will also have to be read separately including the 8 bytes of
* verf flavour and verflen.
*/
-#define RPCSVC_BARERPC_MSGSZ 32
-#define rpcsvc_record_readfraghdr(rs) ((rs)->state == RPCSVC_READ_FRAGHDR)
-#define rpcsvc_record_readfrag(rs) ((rs)->state == RPCSVC_READ_FRAG)
+#define RPCSVC_BARERPC_MSGSZ 32
+#define rpcsvc_record_readfraghdr(rs) ((rs)->state == RPCSVC_READ_FRAGHDR)
+#define rpcsvc_record_readfrag(rs) ((rs)->state == RPCSVC_READ_FRAG)
-#define RPCSVC_LOWVERS 2
+#define RPCSVC_LOWVERS 2
#define RPCSVC_HIGHVERS 2
-
#if 0
#error "defined in /usr/include/rpc/auth.h"
-#define AUTH_NONE 0 /* no authentication */
-#define AUTH_NULL 0 /* backward compatibility */
-#define AUTH_SYS 1 /* unix style (uid, gids) */
-#define AUTH_UNIX AUTH_SYS
-#define AUTH_SHORT 2 /* short hand unix style */
-#define AUTH_DES 3 /* des style (encrypted timestamps) */
-#define AUTH_DH AUTH_DES /* Diffie-Hellman (this is DES) */
-#define AUTH_KERB 4 /* kerberos style */
-#endif /* */
+#define AUTH_NONE 0 /* no authentication */
+#define AUTH_NULL 0 /* backward compatibility */
+#define AUTH_SYS 1 /* unix style (uid, gids) */
+#define AUTH_UNIX AUTH_SYS
+#define AUTH_SHORT 2 /* short hand unix style */
+#define AUTH_DES 3 /* des style (encrypted timestamps) */
+#define AUTH_DH AUTH_DES /* Diffie-Hellman (this is DES) */
+#define AUTH_KERB 4 /* kerberos style */
+#endif /* */
typedef struct rpcsvc_program rpcsvc_program_t;
struct rpcsvc_notify_wrapper {
- struct list_head list;
- void *data;
- rpcsvc_notify_t notify;
+ struct list_head list;
+ void *data;
+ rpcsvc_notify_t notify;
};
typedef struct rpcsvc_notify_wrapper rpcsvc_notify_wrapper_t;
-
typedef struct rpcsvc_request rpcsvc_request_t;
typedef struct {
- rpc_transport_t *trans;
- rpcsvc_t *svc;
- /* FIXME: remove address from this structure. Instead use get_myaddr
- * interface implemented by individual transports.
- */
- struct sockaddr_storage sa;
- struct list_head list;
+ rpc_transport_t *trans;
+ rpcsvc_t *svc;
+ /* FIXME: remove address from this structure. Instead use get_myaddr
+ * interface implemented by individual transports.
+ */
+ struct sockaddr_storage sa;
+ struct list_head list;
} rpcsvc_listener_t;
struct rpcsvc_config {
- int max_block_size;
+ int max_block_size;
};
typedef struct rpcsvc_auth_data {
- int flavour;
- int datalen;
- char authdata[GF_MAX_AUTH_BYTES];
+ int flavour;
+ int datalen;
+ char authdata[GF_MAX_AUTH_BYTES];
} rpcsvc_auth_data_t;
-#define rpcsvc_auth_flavour(au) ((au).flavour)
+#define rpcsvc_auth_flavour(au) ((au).flavour)
typedef struct drc_client drc_client_t;
typedef struct drc_cached_op drc_cached_op_t;
@@ -148,163 +154,161 @@ typedef struct drc_cached_op drc_cached_op_t;
* transmitted.
* */
struct rpcsvc_request {
- /* connection over which this request came. */
- rpc_transport_t *trans;
-
- rpcsvc_t *svc;
-
- rpcsvc_program_t *prog;
+ /* connection over which this request came. */
+ rpc_transport_t *trans;
- /* The identifier for the call from client.
- * Needed to pair the reply with the call.
- */
- uint32_t xid;
+ rpcsvc_t *svc;
- int prognum;
+ rpcsvc_program_t *prog;
- int progver;
+ /* The identifier for the call from client.
+ * Needed to pair the reply with the call.
+ */
+ uint32_t xid;
- int procnum;
+ int prognum;
- int type;
+ int progver;
- /* Uid and gid filled by the rpc-auth module during the authentication
- * phase.
- */
- uid_t uid;
- gid_t gid;
- pid_t pid;
+ int procnum;
- gf_lkowner_t lk_owner;
- uint64_t gfs_id;
+ int type;
- /* Might want to move this to AUTH_UNIX specific state since this array
- * is not available for every authentication scheme.
- */
- gid_t *auxgids;
- gid_t auxgidsmall[SMALL_GROUP_COUNT];
- gid_t *auxgidlarge;
- int auxgidcount;
+ /* Uid and gid filled by the rpc-auth module during the authentication
+ * phase.
+ */
+ uid_t uid;
+ gid_t gid;
+ pid_t pid;
+ gf_lkowner_t lk_owner;
+ uint64_t gfs_id;
- /* The RPC message payload, contains the data required
- * by the program actors. This is the buffer that will need to
- * be de-xdred by the actor.
- */
- struct iovec msg[MAX_IOVEC];
- int count;
+ /* Might want to move this to AUTH_UNIX specific state since this array
+ * is not available for every authentication scheme.
+ */
+ gid_t *auxgids;
+ gid_t auxgidsmall[SMALL_GROUP_COUNT];
+ gid_t *auxgidlarge;
+ int auxgidcount;
- struct iobref *iobref;
+ /* The RPC message payload, contains the data required
+ * by the program actors. This is the buffer that will need to
+ * be de-xdred by the actor.
+ */
+ struct iovec msg[MAX_IOVEC];
+ int count;
- /* Status of the RPC call, whether it was accepted or denied. */
- int rpc_status;
+ struct iobref *iobref;
- /* In case, the call was denied, the RPC error is stored here
- * till the reply is sent.
- */
- int rpc_err;
+ /* Status of the RPC call, whether it was accepted or denied. */
+ int rpc_status;
- /* In case the failure happened because of an authentication problem
- * , this value needs to be assigned the correct auth error number.
- */
- int auth_err;
+ /* In case, the call was denied, the RPC error is stored here
+ * till the reply is sent.
+ */
+ int rpc_err;
- /* There can be cases of RPC requests where the reply needs to
- * be built from multiple sources. E.g. where even the NFS reply
- * can contain a payload, as in the NFSv3 read reply. Here the RPC header
- * ,NFS header and the read data are brought together separately from
- * different buffers, so we need to stage the buffers temporarily here
- * before all of them get added to the connection's transmission list.
- */
- struct list_head txlist;
+ /* In case the failure happened because of an authentication problem
+ * , this value needs to be assigned the correct auth error number.
+ */
+ int auth_err;
- /* While the reply record is being built, this variable keeps track
- * of how many bytes have been added to the record.
- */
- size_t payloadsize;
+ /* There can be cases of RPC requests where the reply needs to
+ * be built from multiple sources. E.g. where even the NFS reply
+ * can contain a payload, as in the NFSv3 read reply. Here the RPC header
+ * ,NFS header and the read data are brought together separately from
+ * different buffers, so we need to stage the buffers temporarily here
+ * before all of them get added to the connection's transmission list.
+ */
+ struct list_head txlist;
- /* The credentials extracted from the rpc request */
- rpcsvc_auth_data_t cred;
+ /* While the reply record is being built, this variable keeps track
+ * of how many bytes have been added to the record.
+ */
+ size_t payloadsize;
- /* The verified extracted from the rpc request. In request side
- * processing this contains the verifier sent by the client, on reply
- * side processing, it is filled with the verified that will be
- * sent to the client.
- */
- rpcsvc_auth_data_t verf;
+ /* The credentials extracted from the rpc request */
+ rpcsvc_auth_data_t cred;
- /* Execute this request's actor function in ownthread of program?*/
- gf_boolean_t ownthread;
+ /* The verified extracted from the rpc request. In request side
+ * processing this contains the verifier sent by the client, on reply
+ * side processing, it is filled with the verified that will be
+ * sent to the client.
+ */
+ rpcsvc_auth_data_t verf;
- gf_boolean_t synctask;
- /* Container for a RPC program wanting to store a temp
- * request-specific item.
- */
- void *private;
+ /* Execute this request's actor function in ownthread of program?*/
+ gf_boolean_t ownthread;
- /* Container for transport to store request-specific item */
- void *trans_private;
+ gf_boolean_t synctask;
+ /* Container for a RPC program wanting to store a temp
+ * request-specific item.
+ */
+ void *private;
- /* pointer to cached reply for use in DRC */
- drc_cached_op_t *reply;
+ /* Container for transport to store request-specific item */
+ void *trans_private;
- /* request queue in rpcsvc */
- struct list_head request_list;
+ /* pointer to cached reply for use in DRC */
+ drc_cached_op_t *reply;
- /* Things passed to rpc layer from client */
+ /* request queue in rpcsvc */
+ struct list_head request_list;
- /* @flags: Can be used for binary data passed in xdata to be
- passed here instead */
- unsigned int flags;
-
- /* ctime: origin of time on the client side, ideally this is
- the one we should consider for time */
- struct timespec ctime;
+ /* Things passed to rpc layer from client */
+
+ /* @flags: Can be used for binary data passed in xdata to be
+ passed here instead */
+ unsigned int flags;
+
+ /* ctime: origin of time on the client side, ideally this is
+ the one we should consider for time */
+ struct timespec ctime;
};
#define rpcsvc_request_program(req) ((rpcsvc_program_t *)((req)->prog))
#define rpcsvc_request_procnum(req) (((req)->procnum))
-#define rpcsvc_request_program_private(req) (((rpcsvc_program_t *)((req)->prog))->private)
-#define rpcsvc_request_accepted(req) ((req)->rpc_status == MSG_ACCEPTED)
+#define rpcsvc_request_program_private(req) \
+ (((rpcsvc_program_t *)((req)->prog))->private)
+#define rpcsvc_request_accepted(req) ((req)->rpc_status == MSG_ACCEPTED)
#define rpcsvc_request_accepted_success(req) ((req)->rpc_err == SUCCESS)
#define rpcsvc_request_prog_minauth(req) (rpcsvc_request_program(req)->min_auth)
#define rpcsvc_request_cred_flavour(req) (rpcsvc_auth_flavour(req->cred))
#define rpcsvc_request_verf_flavour(req) (rpcsvc_auth_flavour(req->verf))
-#define rpcsvc_request_service(req) ((req)->svc)
-#define rpcsvc_request_uid(req) ((req)->uid)
-#define rpcsvc_request_gid(req) ((req)->gid)
-#define rpcsvc_request_private(req) ((req)->private)
-#define rpcsvc_request_xid(req) ((req)->xid)
-#define rpcsvc_request_set_private(req,prv) (req)->private = (void *)(prv)
-#define rpcsvc_request_iobref_ref(req) (iobref_ref ((req)->iobref))
-#define rpcsvc_request_record_ref(req) (iobuf_ref ((req)->recordiob))
-#define rpcsvc_request_record_unref(req) (iobuf_unref ((req)->recordiob))
-#define rpcsvc_request_record_iob(req) ((req)->recordiob)
-#define rpcsvc_request_set_vecstate(req, state) ((req)->vecstate = state)
+#define rpcsvc_request_service(req) ((req)->svc)
+#define rpcsvc_request_uid(req) ((req)->uid)
+#define rpcsvc_request_gid(req) ((req)->gid)
+#define rpcsvc_request_private(req) ((req)->private)
+#define rpcsvc_request_xid(req) ((req)->xid)
+#define rpcsvc_request_set_private(req, prv) (req)->private = (void *)(prv)
+#define rpcsvc_request_iobref_ref(req) (iobref_ref((req)->iobref))
+#define rpcsvc_request_record_ref(req) (iobuf_ref((req)->recordiob))
+#define rpcsvc_request_record_unref(req) (iobuf_unref((req)->recordiob))
+#define rpcsvc_request_record_iob(req) ((req)->recordiob)
+#define rpcsvc_request_set_vecstate(req, state) ((req)->vecstate = state)
#define rpcsvc_request_vecstate(req) ((req)->vecstate)
#define rpcsvc_request_transport(req) ((req)->trans)
#define rpcsvc_request_transport_ref(req) (rpc_transport_ref((req)->trans))
-#define RPC_AUTH_ROOT_SQUASH(req) \
- do { \
- int gidcount = 0; \
- if (req->svc->root_squash) { \
- if (req->uid == RPC_ROOT_UID) \
- req->uid = req->svc->anonuid; \
- if (req->gid == RPC_ROOT_GID) \
- req->gid = req->svc->anongid; \
- \
- for (gidcount = 0; gidcount < req->auxgidcount; \
- ++gidcount) { \
- if (!req->auxgids[gidcount]) \
- req->auxgids[gidcount] = \
- req->svc->anongid; \
- } \
- } \
- } while (0);
-
-#define RPCSVC_ACTOR_SUCCESS 0
-#define RPCSVC_ACTOR_ERROR (-1)
-#define RPCSVC_ACTOR_IGNORE (-2)
+#define RPC_AUTH_ROOT_SQUASH(req) \
+ do { \
+ int gidcount = 0; \
+ if (req->svc->root_squash) { \
+ if (req->uid == RPC_ROOT_UID) \
+ req->uid = req->svc->anonuid; \
+ if (req->gid == RPC_ROOT_GID) \
+ req->gid = req->svc->anongid; \
+ \
+ for (gidcount = 0; gidcount < req->auxgidcount; ++gidcount) { \
+ if (!req->auxgids[gidcount]) \
+ req->auxgids[gidcount] = req->svc->anongid; \
+ } \
+ } \
+ } while (0);
+
+#define RPCSVC_ACTOR_SUCCESS 0
+#define RPCSVC_ACTOR_ERROR (-1)
+#define RPCSVC_ACTOR_IGNORE (-2)
/* Functor for every type of protocol actor
* must be defined like this.
@@ -318,44 +322,44 @@ struct rpcsvc_request {
* should return RPCSVC_ACTOR_ERROR.
*
*/
-typedef int (*rpcsvc_actor) (rpcsvc_request_t *req);
-typedef int (*rpcsvc_vector_sizer) (int state, ssize_t *readsize,
- char *base_addr, char *curr_addr);
+typedef int (*rpcsvc_actor)(rpcsvc_request_t *req);
+typedef int (*rpcsvc_vector_sizer)(int state, ssize_t *readsize,
+ char *base_addr, char *curr_addr);
/* Every protocol actor will also need to specify the function the RPC layer
* will use to serialize or encode the message into XDR format just before
* transmitting on the connection.
*/
-typedef void *(*rpcsvc_encode_reply) (void *msg);
+typedef void *(*rpcsvc_encode_reply)(void *msg);
/* Once the reply has been transmitted, the message will have to be de-allocated
* , so every actor will need to provide a function that deallocates the message
* it had allocated as a response.
*/
-typedef void (*rpcsvc_deallocate_reply) (void *msg);
+typedef void (*rpcsvc_deallocate_reply)(void *msg);
-#define RPCSVC_NAME_MAX 32
+#define RPCSVC_NAME_MAX 32
/* The descriptor for each procedure/actor that runs
* over the RPC service.
*/
typedef struct rpcsvc_actor_desc {
- char procname[RPCSVC_NAME_MAX];
- int procnum;
- rpcsvc_actor actor;
-
- /* Handler for cases where the RPC requests fragments are large enough
- * to benefit from being decoded into aligned memory addresses. While
- * decoding the request in a non-vectored manner, due to the nature of
- * the XDR scheme, RPC cannot guarantee memory aligned addresses for
- * the resulting message-specific structures. Allowing a specialized
- * handler for letting the RPC program read the data from the network
- * directly into its aligned buffers.
- */
- rpcsvc_vector_sizer vector_sizer;
-
- /* Can actor be ran on behalf an unprivileged requestor? */
- gf_boolean_t unprivileged;
- drc_op_type_t op_type;
+ char procname[RPCSVC_NAME_MAX];
+ int procnum;
+ rpcsvc_actor actor;
+
+ /* Handler for cases where the RPC requests fragments are large enough
+ * to benefit from being decoded into aligned memory addresses. While
+ * decoding the request in a non-vectored manner, due to the nature of
+ * the XDR scheme, RPC cannot guarantee memory aligned addresses for
+ * the resulting message-specific structures. Allowing a specialized
+ * handler for letting the RPC program read the data from the network
+ * directly into its aligned buffers.
+ */
+ rpcsvc_vector_sizer vector_sizer;
+
+ /* Can actor be ran on behalf an unprivileged requestor? */
+ gf_boolean_t unprivileged;
+ drc_op_type_t op_type;
} rpcsvc_actor_t;
/* Describes a program and its version along with the function pointers
@@ -363,87 +367,86 @@ typedef struct rpcsvc_actor_desc {
* Never changed ever by any thread so no need for a lock.
*/
struct rpcsvc_program {
- char progname[RPCSVC_NAME_MAX];
- int prognum;
- int progver;
- /* FIXME */
- dict_t *options; /* An opaque dictionary
- * populated by the program
- * (probably from xl->options)
- * which contain enough
- * information for transport to
- * initialize. As a part of
- * cleanup, the members of
- * options which are of interest
- * to transport should be put
- * into a structure for better
- * readability and structure
- * should replace options member
- * here.
- */
- uint16_t progport; /* Registered with portmap */
+ char progname[RPCSVC_NAME_MAX];
+ int prognum;
+ int progver;
+ /* FIXME */
+ dict_t *options; /* An opaque dictionary
+ * populated by the program
+ * (probably from xl->options)
+ * which contain enough
+ * information for transport to
+ * initialize. As a part of
+ * cleanup, the members of
+ * options which are of interest
+ * to transport should be put
+ * into a structure for better
+ * readability and structure
+ * should replace options member
+ * here.
+ */
+ uint16_t progport; /* Registered with portmap */
#if 0
int progaddrfamily; /* AF_INET or AF_INET6 */
char *proghost; /* Bind host, can be NULL */
#endif
- rpcsvc_actor_t *actors; /* All procedure handlers */
- int numactors; /* Num actors in actor array */
- int proghighvers; /* Highest ver for program
- supported by the system. */
- int proglowvers; /* Lowest ver */
-
- /* Program specific state handed to actors */
- void *private;
-
-
- /* This upcall is provided by the program during registration.
- * It is used to notify the program about events like connection being
- * destroyed etc. The rpc program may take appropriate actions, for eg.,
- * in the case of connection being destroyed, it should cleanup its
- * state stored in the connection.
- */
- rpcsvc_notify_t notify;
-
- /* An integer that identifies the min auth strength that is required
- * by this protocol, for eg. MOUNT3 needs AUTH_UNIX at least.
- * See RFC 1813, Section 5.2.1.
- */
- int min_auth;
-
- /* Execute actor function in program's own thread? This will reduce */
- /* the workload on poller threads */
- gf_boolean_t ownthread;
- gf_boolean_t alive;
-
- gf_boolean_t synctask;
- /* list member to link to list of registered services with rpcsvc */
- struct list_head program;
- struct list_head request_queue;
- pthread_mutex_t queue_lock;
- pthread_cond_t queue_cond;
- pthread_t thread;
- int threadcount;
- /* eventthreadcount is just a readonly copy of the actual value
- * owned by the event sub-system
- * It is used to control the scaling of rpcsvc_request_handler threads
- */
- int eventthreadcount;
+ rpcsvc_actor_t *actors; /* All procedure handlers */
+ int numactors; /* Num actors in actor array */
+ int proghighvers; /* Highest ver for program
+ supported by the system. */
+ int proglowvers; /* Lowest ver */
+
+ /* Program specific state handed to actors */
+ void *private;
+
+ /* This upcall is provided by the program during registration.
+ * It is used to notify the program about events like connection being
+ * destroyed etc. The rpc program may take appropriate actions, for eg.,
+ * in the case of connection being destroyed, it should cleanup its
+ * state stored in the connection.
+ */
+ rpcsvc_notify_t notify;
+
+ /* An integer that identifies the min auth strength that is required
+ * by this protocol, for eg. MOUNT3 needs AUTH_UNIX at least.
+ * See RFC 1813, Section 5.2.1.
+ */
+ int min_auth;
+
+ /* Execute actor function in program's own thread? This will reduce */
+ /* the workload on poller threads */
+ gf_boolean_t ownthread;
+ gf_boolean_t alive;
+
+ gf_boolean_t synctask;
+ /* list member to link to list of registered services with rpcsvc */
+ struct list_head program;
+ struct list_head request_queue;
+ pthread_mutex_t queue_lock;
+ pthread_cond_t queue_cond;
+ pthread_t thread;
+ int threadcount;
+ /* eventthreadcount is just a readonly copy of the actual value
+ * owned by the event sub-system
+ * It is used to control the scaling of rpcsvc_request_handler threads
+ */
+ int eventthreadcount;
};
typedef struct rpcsvc_cbk_program {
- char *progname;
- int prognum;
- int progver;
+ char *progname;
+ int prognum;
+ int progver;
} rpcsvc_cbk_program_t;
/* All users of RPC services should use this API to register their
* procedure handlers.
*/
extern int
-rpcsvc_program_register (rpcsvc_t *svc, rpcsvc_program_t *program,
- gf_boolean_t add_to_head);
+rpcsvc_program_register(rpcsvc_t *svc, rpcsvc_program_t *program,
+ gf_boolean_t add_to_head);
extern int
-rpcsvc_program_unregister (rpcsvc_t *svc, rpcsvc_program_t *program);
+rpcsvc_program_unregister(rpcsvc_t *svc, rpcsvc_program_t *program);
/* This will create and add a listener to listener pool. Programs can
* use any of the listener in this pool. A single listener can be used by
@@ -454,149 +457,150 @@ rpcsvc_program_unregister (rpcsvc_t *svc, rpcsvc_program_t *program);
*/
/* FIXME: can multiple programs registered on same port? */
extern int32_t
-rpcsvc_create_listeners (rpcsvc_t *svc, dict_t *options, char *name);
+rpcsvc_create_listeners(rpcsvc_t *svc, dict_t *options, char *name);
void
-rpcsvc_listener_destroy (rpcsvc_listener_t *listener);
+rpcsvc_listener_destroy(rpcsvc_listener_t *listener);
extern int
-rpcsvc_program_register_portmap (rpcsvc_program_t *newprog, uint32_t port);
+rpcsvc_program_register_portmap(rpcsvc_program_t *newprog, uint32_t port);
#ifdef IPV6_DEFAULT
extern int
-rpcsvc_program_register_rpcbind6 (rpcsvc_program_t *newprog, uint32_t port);
+rpcsvc_program_register_rpcbind6(rpcsvc_program_t *newprog, uint32_t port);
extern int
-rpcsvc_program_unregister_rpcbind6 (rpcsvc_program_t *newprog);
+rpcsvc_program_unregister_rpcbind6(rpcsvc_program_t *newprog);
#endif
extern int
-rpcsvc_program_unregister_portmap (rpcsvc_program_t *newprog);
+rpcsvc_program_unregister_portmap(rpcsvc_program_t *newprog);
extern int
-rpcsvc_register_portmap_enabled (rpcsvc_t *svc);
+rpcsvc_register_portmap_enabled(rpcsvc_t *svc);
/* Inits the global RPC service data structures.
* Called in main.
*/
extern rpcsvc_t *
-rpcsvc_init (xlator_t *xl, glusterfs_ctx_t *ctx, dict_t *options,
- uint32_t poolcount);
+rpcsvc_init(xlator_t *xl, glusterfs_ctx_t *ctx, dict_t *options,
+ uint32_t poolcount);
extern int
-rpcsvc_reconfigure_options (rpcsvc_t *svc, dict_t *options);
+rpcsvc_reconfigure_options(rpcsvc_t *svc, dict_t *options);
int
-rpcsvc_register_notify (rpcsvc_t *svc, rpcsvc_notify_t notify, void *mydata);
+rpcsvc_register_notify(rpcsvc_t *svc, rpcsvc_notify_t notify, void *mydata);
/* unregister a notification callback @notify with data @mydata from svc.
* returns the number of notification callbacks unregistered.
*/
int
-rpcsvc_unregister_notify (rpcsvc_t *svc, rpcsvc_notify_t notify, void *mydata);
+rpcsvc_unregister_notify(rpcsvc_t *svc, rpcsvc_notify_t notify, void *mydata);
int
-rpcsvc_transport_submit (rpc_transport_t *trans, struct iovec *rpchdr,
- int rpchdrcount, struct iovec *proghdr,
- int proghdrcount, struct iovec *progpayload,
- int progpayloadcount, struct iobref *iobref,
- void *priv);
+rpcsvc_transport_submit(rpc_transport_t *trans, struct iovec *rpchdr,
+ int rpchdrcount, struct iovec *proghdr,
+ int proghdrcount, struct iovec *progpayload,
+ int progpayloadcount, struct iobref *iobref,
+ void *priv);
int
-rpcsvc_submit_message (rpcsvc_request_t *req, struct iovec *proghdr,
- int hdrcount, struct iovec *payload, int payloadcount,
- struct iobref *iobref);
+rpcsvc_submit_message(rpcsvc_request_t *req, struct iovec *proghdr,
+ int hdrcount, struct iovec *payload, int payloadcount,
+ struct iobref *iobref);
int
-rpcsvc_submit_generic (rpcsvc_request_t *req, struct iovec *proghdr,
- int hdrcount, struct iovec *payload, int payloadcount,
- struct iobref *iobref);
+rpcsvc_submit_generic(rpcsvc_request_t *req, struct iovec *proghdr,
+ int hdrcount, struct iovec *payload, int payloadcount,
+ struct iobref *iobref);
extern int
-rpcsvc_error_reply (rpcsvc_request_t *req);
+rpcsvc_error_reply(rpcsvc_request_t *req);
-#define RPCSVC_PEER_STRLEN 1024
-#define RPCSVC_AUTH_ACCEPT 1
-#define RPCSVC_AUTH_REJECT 2
-#define RPCSVC_AUTH_DONTCARE 3
+#define RPCSVC_PEER_STRLEN 1024
+#define RPCSVC_AUTH_ACCEPT 1
+#define RPCSVC_AUTH_REJECT 2
+#define RPCSVC_AUTH_DONTCARE 3
extern int
-rpcsvc_transport_peername (rpc_transport_t *trans, char *hostname, int hostlen);
+rpcsvc_transport_peername(rpc_transport_t *trans, char *hostname, int hostlen);
extern int
-rpcsvc_transport_peeraddr (rpc_transport_t *trans, char *addrstr, int addrlen,
- struct sockaddr_storage *returnsa, socklen_t sasize);
+rpcsvc_transport_peeraddr(rpc_transport_t *trans, char *addrstr, int addrlen,
+ struct sockaddr_storage *returnsa, socklen_t sasize);
extern int
-rpcsvc_auth_check (rpcsvc_t *svc, char *volname, char *ipaddr);
+rpcsvc_auth_check(rpcsvc_t *svc, char *volname, char *ipaddr);
extern int
-rpcsvc_transport_privport_check (rpcsvc_t *svc, char *volname, uint16_t port);
-
-#define rpcsvc_request_seterr(req, err) ((req)->rpc_err = (int)(err))
-#define rpcsvc_request_set_autherr(req, err) ((req)->auth_err = (int)(err))
+rpcsvc_transport_privport_check(rpcsvc_t *svc, char *volname, uint16_t port);
-extern int rpcsvc_submit_vectors (rpcsvc_request_t *req);
+#define rpcsvc_request_seterr(req, err) ((req)->rpc_err = (int)(err))
+#define rpcsvc_request_set_autherr(req, err) ((req)->auth_err = (int)(err))
-extern int rpcsvc_request_attach_vector (rpcsvc_request_t *req,
- struct iovec msgvec, struct iobuf *iob,
- struct iobref *ioref, int finalvector);
+extern int
+rpcsvc_submit_vectors(rpcsvc_request_t *req);
+extern int
+rpcsvc_request_attach_vector(rpcsvc_request_t *req, struct iovec msgvec,
+ struct iobuf *iob, struct iobref *ioref,
+ int finalvector);
-typedef int (*auth_init_trans) (rpc_transport_t *trans, void *priv);
-typedef int (*auth_init_request) (rpcsvc_request_t *req, void *priv);
-typedef int (*auth_request_authenticate) (rpcsvc_request_t *req, void *priv);
+typedef int (*auth_init_trans)(rpc_transport_t *trans, void *priv);
+typedef int (*auth_init_request)(rpcsvc_request_t *req, void *priv);
+typedef int (*auth_request_authenticate)(rpcsvc_request_t *req, void *priv);
/* This structure needs to be registered by every authentication scheme.
* Our authentication schemes are stored per connection because
* each connection will end up using a different authentication scheme.
*/
typedef struct rpcsvc_auth_ops {
- auth_init_trans transport_init;
- auth_init_request request_init;
- auth_request_authenticate authenticate;
+ auth_init_trans transport_init;
+ auth_init_request request_init;
+ auth_request_authenticate authenticate;
} rpcsvc_auth_ops_t;
typedef struct rpcsvc_auth_flavour_desc {
- char authname[RPCSVC_NAME_MAX];
- int authnum;
- rpcsvc_auth_ops_t *authops;
- void *authprivate;
+ char authname[RPCSVC_NAME_MAX];
+ int authnum;
+ rpcsvc_auth_ops_t *authops;
+ void *authprivate;
} rpcsvc_auth_t;
-typedef void * (*rpcsvc_auth_initer_t) (rpcsvc_t *svc, dict_t *options);
+typedef void *(*rpcsvc_auth_initer_t)(rpcsvc_t *svc, dict_t *options);
struct rpcsvc_auth_list {
- struct list_head authlist;
- rpcsvc_auth_initer_t init;
- /* Should be the name with which we identify the auth scheme given
- * in the volfile options.
- * This should be different from the authname in rpc_auth_t
- * in way that makes it easier to specify this scheme in the volfile.
- * This is because the technical names of the schemes can be a bit
- * arcane.
- */
- char name[RPCSVC_NAME_MAX];
- rpcsvc_auth_t *auth;
- int enable;
+ struct list_head authlist;
+ rpcsvc_auth_initer_t init;
+ /* Should be the name with which we identify the auth scheme given
+ * in the volfile options.
+ * This should be different from the authname in rpc_auth_t
+ * in way that makes it easier to specify this scheme in the volfile.
+ * This is because the technical names of the schemes can be a bit
+ * arcane.
+ */
+ char name[RPCSVC_NAME_MAX];
+ rpcsvc_auth_t *auth;
+ int enable;
};
extern int
-rpcsvc_auth_request_init (rpcsvc_request_t *req, struct rpc_msg *callmsg);
+rpcsvc_auth_request_init(rpcsvc_request_t *req, struct rpc_msg *callmsg);
extern int
-rpcsvc_auth_init (rpcsvc_t *svc, dict_t *options);
+rpcsvc_auth_init(rpcsvc_t *svc, dict_t *options);
extern int
-rpcsvc_auth_reconf (rpcsvc_t *svc, dict_t *options);
+rpcsvc_auth_reconf(rpcsvc_t *svc, dict_t *options);
extern int
-rpcsvc_auth_transport_init (rpc_transport_t *xprt);
+rpcsvc_auth_transport_init(rpc_transport_t *xprt);
extern int
-rpcsvc_authenticate (rpcsvc_request_t *req);
+rpcsvc_authenticate(rpcsvc_request_t *req);
extern int
-rpcsvc_auth_array (rpcsvc_t *svc, char *volname, int *autharr, int arrlen);
+rpcsvc_auth_array(rpcsvc_t *svc, char *volname, int *autharr, int arrlen);
/* If the request has been sent using AUTH_UNIX, this function returns the
* auxiliary gids as an array, otherwise, it returns NULL.
@@ -604,51 +608,53 @@ rpcsvc_auth_array (rpcsvc_t *svc, char *volname, int *autharr, int arrlen);
* authentication code even further to support mode auth schemes.
*/
extern gid_t *
-rpcsvc_auth_unix_auxgids (rpcsvc_request_t *req, int *arrlen);
+rpcsvc_auth_unix_auxgids(rpcsvc_request_t *req, int *arrlen);
extern char *
-rpcsvc_volume_allowed (dict_t *options, char *volname);
+rpcsvc_volume_allowed(dict_t *options, char *volname);
-int rpcsvc_request_submit (rpcsvc_t *rpc, rpc_transport_t *trans,
- rpcsvc_cbk_program_t *prog, int procnum,
- void *req, glusterfs_ctx_t *ctx,
- xdrproc_t xdrproc);
+int
+rpcsvc_request_submit(rpcsvc_t *rpc, rpc_transport_t *trans,
+ rpcsvc_cbk_program_t *prog, int procnum, void *req,
+ glusterfs_ctx_t *ctx, xdrproc_t xdrproc);
-int rpcsvc_callback_submit (rpcsvc_t *rpc, rpc_transport_t *trans,
- rpcsvc_cbk_program_t *prog, int procnum,
- struct iovec *proghdr, int proghdrcount,
- struct iobref *iobref);
+int
+rpcsvc_callback_submit(rpcsvc_t *rpc, rpc_transport_t *trans,
+ rpcsvc_cbk_program_t *prog, int procnum,
+ struct iovec *proghdr, int proghdrcount,
+ struct iobref *iobref);
rpcsvc_actor_t *
-rpcsvc_program_actor (rpcsvc_request_t *req);
+rpcsvc_program_actor(rpcsvc_request_t *req);
int
-rpcsvc_transport_unix_options_build (dict_t **options, char *filepath);
+rpcsvc_transport_unix_options_build(dict_t **options, char *filepath);
int
-rpcsvc_set_allow_insecure (rpcsvc_t *svc, dict_t *options);
+rpcsvc_set_allow_insecure(rpcsvc_t *svc, dict_t *options);
int
-rpcsvc_set_addr_namelookup (rpcsvc_t *svc, dict_t *options);
+rpcsvc_set_addr_namelookup(rpcsvc_t *svc, dict_t *options);
int
-rpcsvc_set_root_squash (rpcsvc_t *svc, dict_t *options);
+rpcsvc_set_root_squash(rpcsvc_t *svc, dict_t *options);
int
-rpcsvc_set_outstanding_rpc_limit (rpcsvc_t *svc, dict_t *options, int defvalue);
+rpcsvc_set_outstanding_rpc_limit(rpcsvc_t *svc, dict_t *options, int defvalue);
int
-rpcsvc_set_throttle_on (rpcsvc_t *svc);
+rpcsvc_set_throttle_on(rpcsvc_t *svc);
int
-rpcsvc_set_throttle_off (rpcsvc_t *svc);
+rpcsvc_set_throttle_off(rpcsvc_t *svc);
gf_boolean_t
-rpcsvc_get_throttle (rpcsvc_t *svc);
+rpcsvc_get_throttle(rpcsvc_t *svc);
int
-rpcsvc_auth_array (rpcsvc_t *svc, char *volname, int *autharr, int arrlen);
+rpcsvc_auth_array(rpcsvc_t *svc, char *volname, int *autharr, int arrlen);
rpcsvc_vector_sizer
-rpcsvc_get_program_vector_sizer (rpcsvc_t *svc, uint32_t prognum,
- uint32_t progver, int procnum);
+rpcsvc_get_program_vector_sizer(rpcsvc_t *svc, uint32_t prognum,
+ uint32_t progver, int procnum);
extern int
-rpcsvc_ownthread_reconf (rpcsvc_t *svc, int new_eventthreadcount);
+rpcsvc_ownthread_reconf(rpcsvc_t *svc, int new_eventthreadcount);
-void rpcsvc_autoscale_threads (glusterfs_ctx_t *ctx, rpcsvc_t *rpc, int incr);
+void
+rpcsvc_autoscale_threads(glusterfs_ctx_t *ctx, rpcsvc_t *rpc, int incr);
#endif
diff --git a/rpc/rpc-lib/src/xdr-common.h b/rpc/rpc-lib/src/xdr-common.h
index db6b5f1a0d2..7b0bc36ec64 100644
--- a/rpc/rpc-lib/src/xdr-common.h
+++ b/rpc/rpc-lib/src/xdr-common.h
@@ -22,10 +22,10 @@
#endif /* __NetBSD__ */
enum gf_dump_procnum {
- GF_DUMP_NULL,
- GF_DUMP_DUMP,
- GF_DUMP_PING,
- GF_DUMP_MAXVALUE,
+ GF_DUMP_NULL,
+ GF_DUMP_DUMP,
+ GF_DUMP_PING,
+ GF_DUMP_MAXVALUE,
};
#define GLUSTER_DUMP_PROGRAM 123451501 /* Completely random */
@@ -33,7 +33,7 @@ enum gf_dump_procnum {
/* MAX_AUTH_BYTES is restricted to 400 bytes, see
* http://tools.ietf.org/html/rfc5531#section-8.2 */
-#define GF_MAX_AUTH_BYTES MAX_AUTH_BYTES
+#define GF_MAX_AUTH_BYTES MAX_AUTH_BYTES
/* The size of an AUTH_GLUSTERFS_V2 structure:
*
@@ -58,32 +58,33 @@ enum gf_dump_procnum {
* -------
* On v3, there are 4 more units, and hence it will be 9 xdr-units
*/
-#define GF_AUTH_GLUSTERFS_MAX_GROUPS(lk_len, type) \
- ((type == AUTH_GLUSTERFS_v2) ? (95 - lk_len) : (91 - lk_len))
-#define GF_AUTH_GLUSTERFS_MAX_LKOWNER(groups_len, type) \
- ((type == AUTH_GLUSTERFS_v2) ? (95 - groups_len) : (91 - groups_len))
-
+#define GF_AUTH_GLUSTERFS_MAX_GROUPS(lk_len, type) \
+ ((type == AUTH_GLUSTERFS_v2) ? (95 - lk_len) : (91 - lk_len))
+#define GF_AUTH_GLUSTERFS_MAX_LKOWNER(groups_len, type) \
+ ((type == AUTH_GLUSTERFS_v2) ? (95 - groups_len) : (91 - groups_len))
#ifdef GF_LINUX_HOST_OS
#define xdr_u_int32_t xdr_uint32_t
#define xdr_u_int64_t xdr_uint64_t
#ifdef IPV6_DEFAULT
-unsigned long xdr_sizeof (xdrproc_t func, void *data);
+unsigned long
+xdr_sizeof(xdrproc_t func, void *data);
#endif
#endif
#ifdef GF_DARWIN_HOST_OS
#define xdr_u_quad_t xdr_u_int64_t
-#define xdr_quad_t xdr_int64_t
+#define xdr_quad_t xdr_int64_t
#define xdr_uint32_t xdr_u_int32_t
#define xdr_uint64_t xdr_u_int64_t
#define uint64_t u_int64_t
-unsigned long xdr_sizeof (xdrproc_t func, void *data);
+unsigned long
+xdr_sizeof(xdrproc_t func, void *data);
#endif
#if defined(__NetBSD__)
#define xdr_u_quad_t xdr_u_int64_t
-#define xdr_quad_t xdr_int64_t
+#define xdr_quad_t xdr_int64_t
#define xdr_uint32_t xdr_u_int32_t
#define xdr_uint64_t xdr_u_int64_t
#endif
@@ -92,7 +93,7 @@ unsigned long xdr_sizeof (xdrproc_t func, void *data);
#define u_quad_t uint64_t
#define quad_t int64_t
#define xdr_u_quad_t xdr_uint64_t
-#define xdr_quad_t xdr_int64_t
+#define xdr_quad_t xdr_int64_t
#endif
/* Returns the address of the byte that follows the
@@ -100,16 +101,18 @@ unsigned long xdr_sizeof (xdrproc_t func, void *data);
* E.g. once the RPC call for NFS has been decoded, the macro will return
* the address from which the NFS header starts.
*/
-#define xdr_decoded_remaining_addr(xdr) ((&xdr)->x_private)
+#define xdr_decoded_remaining_addr(xdr) ((&xdr)->x_private)
/* Returns the length of the remaining record after the previous decode
* operation completed.
*/
-#define xdr_decoded_remaining_len(xdr) ((&xdr)->x_handy)
+#define xdr_decoded_remaining_len(xdr) ((&xdr)->x_handy)
/* Returns the number of bytes used by the last encode operation. */
-#define xdr_encoded_length(xdr) (((size_t)(&xdr)->x_private) - ((size_t)(&xdr)->x_base))
+#define xdr_encoded_length(xdr) \
+ (((size_t)(&xdr)->x_private) - ((size_t)(&xdr)->x_base))
-#define xdr_decoded_length(xdr) (((size_t)(&xdr)->x_private) - ((size_t)(&xdr)->x_base))
+#define xdr_decoded_length(xdr) \
+ (((size_t)(&xdr)->x_private) - ((size_t)(&xdr)->x_base))
#endif
diff --git a/rpc/rpc-lib/src/xdr-rpc.h b/rpc/rpc-lib/src/xdr-rpc.h
index 9f0e78a0fc1..a57cd9430be 100644
--- a/rpc/rpc-lib/src/xdr-rpc.h
+++ b/rpc/rpc-lib/src/xdr-rpc.h
@@ -28,66 +28,68 @@
#include "xdr-common.h"
typedef enum {
- AUTH_GLUSTERFS = 5,
- AUTH_GLUSTERFS_v2 = 390039, /* using a number from 'unused' range,
- from the list available in RFC5531 */
- AUTH_GLUSTERFS_v3 = 390040, /* this too is unused */
+ AUTH_GLUSTERFS = 5,
+ AUTH_GLUSTERFS_v2 = 390039, /* using a number from 'unused' range,
+ from the list available in RFC5531 */
+ AUTH_GLUSTERFS_v3 = 390040, /* this too is unused */
} gf_rpc_authtype_t;
/* Converts a given network buffer from its XDR format to a structure
* that contains everything an RPC call needs to work.
*/
extern int
-xdr_to_rpc_call (char *msgbuf, size_t len, struct rpc_msg *call,
- struct iovec *payload, char *credbytes, char *verfbytes);
+xdr_to_rpc_call(char *msgbuf, size_t len, struct rpc_msg *call,
+ struct iovec *payload, char *credbytes, char *verfbytes);
extern int
-rpc_fill_empty_reply (struct rpc_msg *reply, uint32_t xid);
+rpc_fill_empty_reply(struct rpc_msg *reply, uint32_t xid);
extern int
-rpc_fill_denied_reply (struct rpc_msg *reply, int rjstat, int auth_err);
+rpc_fill_denied_reply(struct rpc_msg *reply, int rjstat, int auth_err);
extern int
-rpc_fill_accepted_reply (struct rpc_msg *reply, int arstat, int proglow,
- int proghigh, int verf, int len, char *vdata);
+rpc_fill_accepted_reply(struct rpc_msg *reply, int arstat, int proglow,
+ int proghigh, int verf, int len, char *vdata);
extern int
-rpc_reply_to_xdr (struct rpc_msg *reply, char *dest, size_t len,
- struct iovec *dst);
+rpc_reply_to_xdr(struct rpc_msg *reply, char *dest, size_t len,
+ struct iovec *dst);
extern int
-xdr_to_auth_unix_cred (char *msgbuf, int msglen, struct authunix_parms *au,
- char *machname, gid_t *gids);
+xdr_to_auth_unix_cred(char *msgbuf, int msglen, struct authunix_parms *au,
+ char *machname, gid_t *gids);
/* Macros that simplify accessing the members of an RPC call structure. */
-#define rpc_call_xid(call) ((call)->rm_xid)
-#define rpc_call_direction(call) ((call)->rm_direction)
-#define rpc_call_rpcvers(call) ((call)->ru.RM_cmb.cb_rpcvers)
-#define rpc_call_program(call) ((call)->ru.RM_cmb.cb_prog)
-#define rpc_call_progver(call) ((call)->ru.RM_cmb.cb_vers)
-#define rpc_call_progproc(call) ((call)->ru.RM_cmb.cb_proc)
-#define rpc_opaque_auth_flavour(oa) ((oa)->oa_flavor)
-#define rpc_opaque_auth_len(oa) ((oa)->oa_length)
-
-#define rpc_call_cred_flavour(call) (rpc_opaque_auth_flavour ((&(call)->ru.RM_cmb.cb_cred)))
-#define rpc_call_cred_len(call) (rpc_opaque_auth_len ((&(call)->ru.RM_cmb.cb_cred)))
-
-
-#define rpc_call_verf_flavour(call) (rpc_opaque_auth_flavour ((&(call)->ru.RM_cmb.cb_verf)))
-#define rpc_call_verf_len(call) (rpc_opaque_auth_len ((&(call)->ru.RM_cmb.cb_verf)))
-
-
-#if defined(GF_DARWIN_HOST_OS) || !defined (HAVE_RPC_RPC_H)
-#define GF_PRI_RPC_XID PRIu32
-#define GF_PRI_RPC_VERSION PRIu32
-#define GF_PRI_RPC_PROG_ID PRIu32
-#define GF_PRI_RPC_PROG_VERS PRIu32
-#define GF_PRI_RPC_PROC PRIu32
+#define rpc_call_xid(call) ((call)->rm_xid)
+#define rpc_call_direction(call) ((call)->rm_direction)
+#define rpc_call_rpcvers(call) ((call)->ru.RM_cmb.cb_rpcvers)
+#define rpc_call_program(call) ((call)->ru.RM_cmb.cb_prog)
+#define rpc_call_progver(call) ((call)->ru.RM_cmb.cb_vers)
+#define rpc_call_progproc(call) ((call)->ru.RM_cmb.cb_proc)
+#define rpc_opaque_auth_flavour(oa) ((oa)->oa_flavor)
+#define rpc_opaque_auth_len(oa) ((oa)->oa_length)
+
+#define rpc_call_cred_flavour(call) \
+ (rpc_opaque_auth_flavour((&(call)->ru.RM_cmb.cb_cred)))
+#define rpc_call_cred_len(call) \
+ (rpc_opaque_auth_len((&(call)->ru.RM_cmb.cb_cred)))
+
+#define rpc_call_verf_flavour(call) \
+ (rpc_opaque_auth_flavour((&(call)->ru.RM_cmb.cb_verf)))
+#define rpc_call_verf_len(call) \
+ (rpc_opaque_auth_len((&(call)->ru.RM_cmb.cb_verf)))
+
+#if defined(GF_DARWIN_HOST_OS) || !defined(HAVE_RPC_RPC_H)
+#define GF_PRI_RPC_XID PRIu32
+#define GF_PRI_RPC_VERSION PRIu32
+#define GF_PRI_RPC_PROG_ID PRIu32
+#define GF_PRI_RPC_PROG_VERS PRIu32
+#define GF_PRI_RPC_PROC PRIu32
#define GF_PRI_RPC_PROC_VERSION PRIu32
#else
-#define GF_PRI_RPC_XID PRIu64
-#define GF_PRI_RPC_VERSION PRIu64
-#define GF_PRI_RPC_PROG_ID PRIu64
-#define GF_PRI_RPC_PROG_VERS PRIu64
-#define GF_PRI_RPC_PROC PRIu64
+#define GF_PRI_RPC_XID PRIu64
+#define GF_PRI_RPC_VERSION PRIu64
+#define GF_PRI_RPC_PROG_ID PRIu64
+#define GF_PRI_RPC_PROG_VERS PRIu64
+#define GF_PRI_RPC_PROC PRIu64
#define GF_PRI_RPC_PROC_VERSION PRIu64
#endif
diff --git a/rpc/rpc-lib/src/xdr-rpcclnt.h b/rpc/rpc-lib/src/xdr-rpcclnt.h
index e8d615a872e..4d6e38d429c 100644
--- a/rpc/rpc-lib/src/xdr-rpcclnt.h
+++ b/rpc/rpc-lib/src/xdr-rpcclnt.h
@@ -20,18 +20,19 @@
#include <rpc/auth_unix.h>
/* Macros that simplify accessing the members of an RPC call structure. */
-#define rpc_reply_xid(reply) ((reply)->rm_xid)
-#define rpc_reply_status(reply) ((reply)->ru.RM_rmb.rp_stat)
-#define rpc_accepted_reply_status(reply) ((reply)->acpted_rply.ar_stat)
-#define rpc_reply_verf_flavour(reply) ((reply)->acpted_rply.ar_verf.oa_flavor)
+#define rpc_reply_xid(reply) ((reply)->rm_xid)
+#define rpc_reply_status(reply) ((reply)->ru.RM_rmb.rp_stat)
+#define rpc_accepted_reply_status(reply) ((reply)->acpted_rply.ar_stat)
+#define rpc_reply_verf_flavour(reply) ((reply)->acpted_rply.ar_verf.oa_flavor)
-int xdr_to_rpc_reply (char *msgbuf, size_t len, struct rpc_msg *reply,
- struct iovec *payload, char *verfbytes);
int
-rpc_request_to_xdr (struct rpc_msg *request, char *dest, size_t len,
- struct iovec *dst);
+xdr_to_rpc_reply(char *msgbuf, size_t len, struct rpc_msg *reply,
+ struct iovec *payload, char *verfbytes);
int
-auth_unix_cred_to_xdr (struct authunix_parms *au, char *dest, size_t len,
- struct iovec *iov);
+rpc_request_to_xdr(struct rpc_msg *request, char *dest, size_t len,
+ struct iovec *dst);
+int
+auth_unix_cred_to_xdr(struct authunix_parms *au, char *dest, size_t len,
+ struct iovec *iov);
#endif
diff --git a/rpc/rpc-transport/rdma/src/name.h b/rpc/rpc-transport/rdma/src/name.h
index 742fc5fc3f2..6c782b52db5 100644
--- a/rpc/rpc-transport/rdma/src/name.h
+++ b/rpc/rpc-transport/rdma/src/name.h
@@ -16,21 +16,20 @@
#include "compat.h"
int32_t
-gf_rdma_client_bind (rpc_transport_t *this, struct sockaddr *sockaddr,
- socklen_t *sockaddr_len, struct rdma_cm_id *cm_id);
+gf_rdma_client_bind(rpc_transport_t *this, struct sockaddr *sockaddr,
+ socklen_t *sockaddr_len, struct rdma_cm_id *cm_id);
int32_t
-gf_rdma_client_get_remote_sockaddr (rpc_transport_t *this,
- struct sockaddr *sockaddr,
- socklen_t *sockaddr_len,
- int16_t remote_port);
+gf_rdma_client_get_remote_sockaddr(rpc_transport_t *this,
+ struct sockaddr *sockaddr,
+ socklen_t *sockaddr_len,
+ int16_t remote_port);
int32_t
-gf_rdma_server_get_local_sockaddr (rpc_transport_t *this,
- struct sockaddr *addr,
- socklen_t *addr_len);
+gf_rdma_server_get_local_sockaddr(rpc_transport_t *this, struct sockaddr *addr,
+ socklen_t *addr_len);
int32_t
-gf_rdma_get_transport_identifiers (rpc_transport_t *this);
+gf_rdma_get_transport_identifiers(rpc_transport_t *this);
#endif /* _IB_VERBS_NAME_H */
diff --git a/rpc/rpc-transport/rdma/src/rdma.h b/rpc/rpc-transport/rdma/src/rdma.h
index 39f7f45046d..84c1397054b 100644
--- a/rpc/rpc-transport/rdma/src/rdma.h
+++ b/rpc/rpc-transport/rdma/src/rdma.h
@@ -11,7 +11,6 @@
#ifndef _XPORT_RDMA_H
#define _XPORT_RDMA_H
-
#ifndef MAX_IOVEC
#define MAX_IOVEC 16
#endif /* MAX_IOVEC */
@@ -29,364 +28,357 @@
/* FIXME: give appropriate values to these macros */
#define GF_DEFAULT_RDMA_LISTEN_PORT (GF_DEFAULT_BASE_PORT + 1)
-
/* If you are changing GF_RDMA_MAX_SEGMENTS, please make sure to update
* GLUSTERFS_GF_RDMA_MAX_HEADER_SIZE defined in glusterfs.h .
*/
-#define GF_RDMA_MAX_SEGMENTS 8
+#define GF_RDMA_MAX_SEGMENTS 8
-#define GF_RDMA_VERSION 1
-#define GF_RDMA_POOL_SIZE 512
+#define GF_RDMA_VERSION 1
+#define GF_RDMA_POOL_SIZE 512
/* Additional attributes */
-#define GF_RDMA_TIMEOUT 14
-#define GF_RDMA_RETRY_CNT 7
-#define GF_RDMA_RNR_RETRY 7
+#define GF_RDMA_TIMEOUT 14
+#define GF_RDMA_RETRY_CNT 7
+#define GF_RDMA_RNR_RETRY 7
-typedef enum gf_rdma_errcode {
- ERR_VERS = 1,
- ERR_CHUNK = 2
-}gf_rdma_errcode_t;
+typedef enum gf_rdma_errcode { ERR_VERS = 1, ERR_CHUNK = 2 } gf_rdma_errcode_t;
struct gf_rdma_err_vers {
- uint32_t gf_rdma_vers_low; /* Version range supported by peer */
- uint32_t gf_rdma_vers_high;
-}__attribute__ ((packed));
+ uint32_t gf_rdma_vers_low; /* Version range supported by peer */
+ uint32_t gf_rdma_vers_high;
+} __attribute__((packed));
typedef struct gf_rdma_err_vers gf_rdma_err_vers_t;
typedef enum gf_rdma_proc {
- GF_RDMA_MSG = 0, /* An RPC call or reply msg */
- GF_RDMA_NOMSG = 1, /* An RPC call or reply msg - separate body */
- GF_RDMA_MSGP = 2, /* An RPC call or reply msg with padding */
- GF_RDMA_DONE = 3, /* Client signals reply completion */
- GF_RDMA_ERROR = 4 /* An RPC RDMA encoding error */
-}gf_rdma_proc_t;
+ GF_RDMA_MSG = 0, /* An RPC call or reply msg */
+ GF_RDMA_NOMSG = 1, /* An RPC call or reply msg - separate body */
+ GF_RDMA_MSGP = 2, /* An RPC call or reply msg with padding */
+ GF_RDMA_DONE = 3, /* Client signals reply completion */
+ GF_RDMA_ERROR = 4 /* An RPC RDMA encoding error */
+} gf_rdma_proc_t;
typedef enum gf_rdma_chunktype {
- gf_rdma_noch = 0, /* no chunk */
- gf_rdma_readch, /* some argument through rdma read */
- gf_rdma_areadch, /* entire request through rdma read */
- gf_rdma_writech, /* some result through rdma write */
- gf_rdma_replych /* entire reply through rdma write */
-}gf_rdma_chunktype_t;
+ gf_rdma_noch = 0, /* no chunk */
+ gf_rdma_readch, /* some argument through rdma read */
+ gf_rdma_areadch, /* entire request through rdma read */
+ gf_rdma_writech, /* some result through rdma write */
+ gf_rdma_replych /* entire reply through rdma write */
+} gf_rdma_chunktype_t;
/* If you are modifying __gf_rdma_header, please make sure to change
- * GLUSTERFS_GF_RDMA_MAX_HEADER_SIZE defined in glusterfs.h to reflect your changes
+ * GLUSTERFS_GF_RDMA_MAX_HEADER_SIZE defined in glusterfs.h to reflect your
+ * changes
*/
struct __gf_rdma_header {
- uint32_t rm_xid; /* Mirrors the RPC header xid */
- uint32_t rm_vers; /* Version of this protocol */
- uint32_t rm_credit; /* Buffers requested/granted */
- uint32_t rm_type; /* Type of message (enum gf_rdma_proc) */
- union {
- struct { /* no chunks */
- uint32_t rm_empty[3]; /* 3 empty chunk lists */
- }__attribute__((packed)) rm_nochunks;
-
- struct { /* no chunks and padded */
- uint32_t rm_align; /* Padding alignment */
- uint32_t rm_thresh; /* Padding threshold */
- uint32_t rm_pempty[3]; /* 3 empty chunk lists */
- }__attribute__((packed)) rm_padded;
-
- struct {
- uint32_t rm_type;
- gf_rdma_err_vers_t rm_version;
- }__attribute__ ((packed)) rm_error;
-
- uint32_t rm_chunks[0]; /* read, write and reply chunks */
- }__attribute__ ((packed)) rm_body;
+ uint32_t rm_xid; /* Mirrors the RPC header xid */
+ uint32_t rm_vers; /* Version of this protocol */
+ uint32_t rm_credit; /* Buffers requested/granted */
+ uint32_t rm_type; /* Type of message (enum gf_rdma_proc) */
+ union {
+ struct { /* no chunks */
+ uint32_t rm_empty[3]; /* 3 empty chunk lists */
+ } __attribute__((packed)) rm_nochunks;
+
+ struct { /* no chunks and padded */
+ uint32_t rm_align; /* Padding alignment */
+ uint32_t rm_thresh; /* Padding threshold */
+ uint32_t rm_pempty[3]; /* 3 empty chunk lists */
+ } __attribute__((packed)) rm_padded;
+
+ struct {
+ uint32_t rm_type;
+ gf_rdma_err_vers_t rm_version;
+ } __attribute__((packed)) rm_error;
+
+ uint32_t rm_chunks[0]; /* read, write and reply chunks */
+ } __attribute__((packed)) rm_body;
} __attribute__((packed));
typedef struct __gf_rdma_header gf_rdma_header_t;
-/* If you are modifying __gf_rdma_segment or __gf_rdma_read_chunk, please make sure
- * to change GLUSTERFS_GF_RDMA_MAX_HEADER_SIZE defined in glusterfs.h to reflect
- * your changes.
+/* If you are modifying __gf_rdma_segment or __gf_rdma_read_chunk, please make
+ * sure to change GLUSTERFS_GF_RDMA_MAX_HEADER_SIZE defined in glusterfs.h to
+ * reflect your changes.
*/
struct __gf_rdma_segment {
- uint32_t rs_handle; /* Registered memory handle */
- uint32_t rs_length; /* Length of the chunk in bytes */
- uint64_t rs_offset; /* Chunk virtual address or offset */
+ uint32_t rs_handle; /* Registered memory handle */
+ uint32_t rs_length; /* Length of the chunk in bytes */
+ uint64_t rs_offset; /* Chunk virtual address or offset */
} __attribute__((packed));
typedef struct __gf_rdma_segment gf_rdma_segment_t;
/* read chunk(s), encoded as a linked list. */
struct __gf_rdma_read_chunk {
- uint32_t rc_discrim; /* 1 indicates presence */
- uint32_t rc_position; /* Position in XDR stream */
- gf_rdma_segment_t rc_target;
+ uint32_t rc_discrim; /* 1 indicates presence */
+ uint32_t rc_position; /* Position in XDR stream */
+ gf_rdma_segment_t rc_target;
} __attribute__((packed));
typedef struct __gf_rdma_read_chunk gf_rdma_read_chunk_t;
/* write chunk, and reply chunk. */
struct __gf_rdma_write_chunk {
- gf_rdma_segment_t wc_target;
+ gf_rdma_segment_t wc_target;
} __attribute__((packed));
typedef struct __gf_rdma_write_chunk gf_rdma_write_chunk_t;
/* write chunk(s), encoded as a counted array. */
struct __gf_rdma_write_array {
- uint32_t wc_discrim; /* 1 indicates presence */
- uint32_t wc_nchunks; /* Array count */
- struct __gf_rdma_write_chunk wc_array[0];
+ uint32_t wc_discrim; /* 1 indicates presence */
+ uint32_t wc_nchunks; /* Array count */
+ struct __gf_rdma_write_chunk wc_array[0];
} __attribute__((packed));
typedef struct __gf_rdma_write_array gf_rdma_write_array_t;
/* options per transport end point */
struct __gf_rdma_options {
- int32_t port;
- char *device_name;
- enum ibv_mtu mtu;
- int32_t send_count;
- int32_t recv_count;
- uint64_t recv_size;
- uint64_t send_size;
- uint8_t attr_timeout;
- uint8_t attr_retry_cnt;
- uint8_t attr_rnr_retry;
- uint32_t backlog;
+ int32_t port;
+ char *device_name;
+ enum ibv_mtu mtu;
+ int32_t send_count;
+ int32_t recv_count;
+ uint64_t recv_size;
+ uint64_t send_size;
+ uint8_t attr_timeout;
+ uint8_t attr_retry_cnt;
+ uint8_t attr_rnr_retry;
+ uint32_t backlog;
};
typedef struct __gf_rdma_options gf_rdma_options_t;
struct __gf_rdma_reply_info {
- uint32_t rm_xid; /* xid in network endian */
- gf_rdma_chunktype_t type; /*
- * can be either gf_rdma_replych
- * or gf_rdma_writech.
- */
- gf_rdma_write_array_t *wc_array;
- struct mem_pool *pool;
+ uint32_t rm_xid; /* xid in network endian */
+ gf_rdma_chunktype_t type; /*
+ * can be either gf_rdma_replych
+ * or gf_rdma_writech.
+ */
+ gf_rdma_write_array_t *wc_array;
+ struct mem_pool *pool;
};
typedef struct __gf_rdma_reply_info gf_rdma_reply_info_t;
struct __gf_rdma_ioq {
- union {
- struct list_head list;
- struct {
- struct __gf_rdma_ioq *next;
- struct __gf_rdma_ioq *prev;
- };
+ union {
+ struct list_head list;
+ struct {
+ struct __gf_rdma_ioq *next;
+ struct __gf_rdma_ioq *prev;
};
+ };
+
+ char is_request;
+ struct iovec rpchdr[MAX_IOVEC];
+ int rpchdr_count;
+ struct iovec proghdr[MAX_IOVEC];
+ int proghdr_count;
+ struct iovec prog_payload[MAX_IOVEC];
+ int prog_payload_count;
+
+ struct iobref *iobref;
+
+ union {
+ struct __gf_rdma_ioq_request {
+ /* used to build reply_chunk for GF_RDMA_NOMSG type msgs */
+ struct iovec rsphdr_vec[MAX_IOVEC];
+ int rsphdr_count;
+
+ /*
+ * used to build write_array during operations like
+ * read.
+ */
+ struct iovec rsp_payload[MAX_IOVEC];
+ int rsp_payload_count;
+
+ struct rpc_req *rpc_req; /* FIXME: hack! hack! should be
+ * cleaned up later
+ */
+ struct iobref *rsp_iobref;
+ } request;
+
+ gf_rdma_reply_info_t *reply_info;
+ } msg;
- char is_request;
- struct iovec rpchdr[MAX_IOVEC];
- int rpchdr_count;
- struct iovec proghdr[MAX_IOVEC];
- int proghdr_count;
- struct iovec prog_payload[MAX_IOVEC];
- int prog_payload_count;
-
- struct iobref *iobref;
-
- union {
- struct __gf_rdma_ioq_request {
- /* used to build reply_chunk for GF_RDMA_NOMSG type msgs */
- struct iovec rsphdr_vec[MAX_IOVEC];
- int rsphdr_count;
-
- /*
- * used to build write_array during operations like
- * read.
- */
- struct iovec rsp_payload[MAX_IOVEC];
- int rsp_payload_count;
-
- struct rpc_req *rpc_req; /* FIXME: hack! hack! should be
- * cleaned up later
- */
- struct iobref *rsp_iobref;
- }request;
-
- gf_rdma_reply_info_t *reply_info;
- }msg;
-
- struct mem_pool *pool;
+ struct mem_pool *pool;
};
typedef struct __gf_rdma_ioq gf_rdma_ioq_t;
typedef enum __gf_rdma_send_post_type {
- GF_RDMA_SEND_POST_NO_CHUNKLIST, /* post which is sent using rdma-send
- * and the msg carries no
- * chunklists.
- */
- GF_RDMA_SEND_POST_READ_CHUNKLIST, /* post which is sent using rdma-send
- * and the msg carries only read
- * chunklist.
- */
- GF_RDMA_SEND_POST_WRITE_CHUNKLIST, /* post which is sent using
- * rdma-send and the msg carries
- * only write chunklist.
- */
- GF_RDMA_SEND_POST_READ_WRITE_CHUNKLIST, /* post which is sent using
- * rdma-send and the msg
- * carries both read and
- * write chunklists.
- */
- GF_RDMA_SEND_POST_GF_RDMA_READ, /* RDMA read */
- GF_RDMA_SEND_POST_GF_RDMA_WRITE, /* RDMA write */
-}gf_rdma_send_post_type_t;
+ GF_RDMA_SEND_POST_NO_CHUNKLIST, /* post which is sent using rdma-send
+ * and the msg carries no
+ * chunklists.
+ */
+ GF_RDMA_SEND_POST_READ_CHUNKLIST, /* post which is sent using rdma-send
+ * and the msg carries only read
+ * chunklist.
+ */
+ GF_RDMA_SEND_POST_WRITE_CHUNKLIST, /* post which is sent using
+ * rdma-send and the msg carries
+ * only write chunklist.
+ */
+ GF_RDMA_SEND_POST_READ_WRITE_CHUNKLIST, /* post which is sent using
+ * rdma-send and the msg
+ * carries both read and
+ * write chunklists.
+ */
+ GF_RDMA_SEND_POST_GF_RDMA_READ, /* RDMA read */
+ GF_RDMA_SEND_POST_GF_RDMA_WRITE, /* RDMA write */
+} gf_rdma_send_post_type_t;
/* represents one communication peer, two per transport_t */
struct __gf_rdma_peer {
- rpc_transport_t *trans;
- struct rdma_cm_id *cm_id;
- struct ibv_qp *qp;
- pthread_t rdma_event_thread;
- char quota_set;
-
- int32_t recv_count;
- int32_t send_count;
- int32_t recv_size;
- int32_t send_size;
-
- int32_t quota;
- union {
- struct list_head ioq;
- struct {
- gf_rdma_ioq_t *ioq_next;
- gf_rdma_ioq_t *ioq_prev;
- };
+ rpc_transport_t *trans;
+ struct rdma_cm_id *cm_id;
+ struct ibv_qp *qp;
+ pthread_t rdma_event_thread;
+ char quota_set;
+
+ int32_t recv_count;
+ int32_t send_count;
+ int32_t recv_size;
+ int32_t send_size;
+
+ int32_t quota;
+ union {
+ struct list_head ioq;
+ struct {
+ gf_rdma_ioq_t *ioq_next;
+ gf_rdma_ioq_t *ioq_prev;
};
-
- /* QP attributes, needed to connect with remote QP */
- int32_t local_lid;
- int32_t local_psn;
- int32_t local_qpn;
- int32_t remote_lid;
- int32_t remote_psn;
- int32_t remote_qpn;
+ };
+
+ /* QP attributes, needed to connect with remote QP */
+ int32_t local_lid;
+ int32_t local_psn;
+ int32_t local_qpn;
+ int32_t remote_lid;
+ int32_t remote_psn;
+ int32_t remote_qpn;
};
typedef struct __gf_rdma_peer gf_rdma_peer_t;
struct __gf_rdma_post_context {
- struct ibv_mr *mr[GF_RDMA_MAX_SEGMENTS];
- int mr_count;
- struct iovec vector[MAX_IOVEC];
- int count;
- struct iobref *iobref;
- struct iobuf *hdr_iobuf;
- char is_request;
- int gf_rdma_reads;
- gf_rdma_reply_info_t *reply_info;
+ struct ibv_mr *mr[GF_RDMA_MAX_SEGMENTS];
+ int mr_count;
+ struct iovec vector[MAX_IOVEC];
+ int count;
+ struct iobref *iobref;
+ struct iobuf *hdr_iobuf;
+ char is_request;
+ int gf_rdma_reads;
+ gf_rdma_reply_info_t *reply_info;
};
typedef struct __gf_rdma_post_context gf_rdma_post_context_t;
-typedef enum {
- GF_RDMA_SEND_POST,
- GF_RDMA_RECV_POST
-} gf_rdma_post_type_t;
+typedef enum { GF_RDMA_SEND_POST, GF_RDMA_RECV_POST } gf_rdma_post_type_t;
struct __gf_rdma_post {
- struct __gf_rdma_post *next, *prev;
- struct ibv_mr *mr;
- char *buf;
- int32_t buf_size;
- char aux;
- int32_t reused;
- struct __gf_rdma_device *device;
- gf_rdma_post_type_t type;
- gf_rdma_post_context_t ctx;
- int refcount;
- pthread_mutex_t lock;
+ struct __gf_rdma_post *next, *prev;
+ struct ibv_mr *mr;
+ char *buf;
+ int32_t buf_size;
+ char aux;
+ int32_t reused;
+ struct __gf_rdma_device *device;
+ gf_rdma_post_type_t type;
+ gf_rdma_post_context_t ctx;
+ int refcount;
+ pthread_mutex_t lock;
};
typedef struct __gf_rdma_post gf_rdma_post_t;
struct __gf_rdma_queue {
- gf_rdma_post_t active_posts, passive_posts;
- int32_t active_count, passive_count;
- pthread_mutex_t lock;
+ gf_rdma_post_t active_posts, passive_posts;
+ int32_t active_count, passive_count;
+ pthread_mutex_t lock;
};
typedef struct __gf_rdma_queue gf_rdma_queue_t;
struct __gf_rdma_qpreg {
- pthread_mutex_t lock;
- int32_t count;
- struct _qpent {
- struct _qpent *next, *prev;
- int32_t qp_num;
- gf_rdma_peer_t *peer;
- } ents[42];
+ pthread_mutex_t lock;
+ int32_t count;
+ struct _qpent {
+ struct _qpent *next, *prev;
+ int32_t qp_num;
+ gf_rdma_peer_t *peer;
+ } ents[42];
};
typedef struct __gf_rdma_qpreg gf_rdma_qpreg_t;
/* context per device, stored in global glusterfs_ctx_t->ib */
struct __gf_rdma_device {
- struct __gf_rdma_device *next;
- const char *device_name;
- struct ibv_context *context;
- int32_t port;
- struct ibv_pd *pd;
- struct ibv_srq *srq;
- gf_rdma_qpreg_t qpreg;
- struct ibv_comp_channel *send_chan, *recv_chan;
- struct ibv_cq *send_cq, *recv_cq;
- gf_rdma_queue_t sendq, recvq;
- pthread_t send_thread, recv_thread, async_event_thread;
- struct mem_pool *request_ctx_pool;
- struct mem_pool *ioq_pool;
- struct mem_pool *reply_info_pool;
- struct list_head all_mr;
- pthread_mutex_t all_mr_lock;
+ struct __gf_rdma_device *next;
+ const char *device_name;
+ struct ibv_context *context;
+ int32_t port;
+ struct ibv_pd *pd;
+ struct ibv_srq *srq;
+ gf_rdma_qpreg_t qpreg;
+ struct ibv_comp_channel *send_chan, *recv_chan;
+ struct ibv_cq *send_cq, *recv_cq;
+ gf_rdma_queue_t sendq, recvq;
+ pthread_t send_thread, recv_thread, async_event_thread;
+ struct mem_pool *request_ctx_pool;
+ struct mem_pool *ioq_pool;
+ struct mem_pool *reply_info_pool;
+ struct list_head all_mr;
+ pthread_mutex_t all_mr_lock;
};
typedef struct __gf_rdma_device gf_rdma_device_t;
-
struct __gf_rdma_arena_mr {
- struct list_head list;
- struct iobuf_arena *iobuf_arena;
- struct ibv_mr *mr;
+ struct list_head list;
+ struct iobuf_arena *iobuf_arena;
+ struct ibv_mr *mr;
};
typedef struct __gf_rdma_arena_mr gf_rdma_arena_mr;
struct __gf_rdma_ctx {
- gf_rdma_device_t *device;
- struct rdma_event_channel *rdma_cm_event_channel;
- pthread_t rdma_cm_thread;
- pthread_mutex_t lock;
- int32_t dlcount;
+ gf_rdma_device_t *device;
+ struct rdma_event_channel *rdma_cm_event_channel;
+ pthread_t rdma_cm_thread;
+ pthread_mutex_t lock;
+ int32_t dlcount;
};
typedef struct __gf_rdma_ctx gf_rdma_ctx_t;
struct __gf_rdma_request_context {
- struct ibv_mr *mr[GF_RDMA_MAX_SEGMENTS];
- int mr_count;
- struct mem_pool *pool;
- gf_rdma_peer_t *peer;
- struct iobref *iobref;
- struct iobref *rsp_iobref;
+ struct ibv_mr *mr[GF_RDMA_MAX_SEGMENTS];
+ int mr_count;
+ struct mem_pool *pool;
+ gf_rdma_peer_t *peer;
+ struct iobref *iobref;
+ struct iobref *rsp_iobref;
};
typedef struct __gf_rdma_request_context gf_rdma_request_context_t;
typedef enum {
- GF_RDMA_SERVER_LISTENER,
- GF_RDMA_SERVER,
- GF_RDMA_CLIENT,
+ GF_RDMA_SERVER_LISTENER,
+ GF_RDMA_SERVER,
+ GF_RDMA_CLIENT,
} gf_rdma_transport_entity_t;
struct __gf_rdma_private {
- int32_t idx;
- unsigned char connected;
- in_addr_t addr;
- unsigned short port;
-
- /* IB Verbs Driver specific variables, pointers */
- gf_rdma_peer_t peer;
- struct __gf_rdma_device *device;
- gf_rdma_options_t options;
-
- /* Used by trans->op->receive */
- char *data_ptr;
- int32_t data_offset;
- int32_t data_len;
-
- /* Mutex */
- pthread_mutex_t write_mutex;
- rpc_transport_t *listener;
- pthread_mutex_t recv_mutex;
- pthread_cond_t recv_cond;
- gf_rdma_transport_entity_t entity;
- uint32_t backlog;
+ int32_t idx;
+ unsigned char connected;
+ in_addr_t addr;
+ unsigned short port;
+
+ /* IB Verbs Driver specific variables, pointers */
+ gf_rdma_peer_t peer;
+ struct __gf_rdma_device *device;
+ gf_rdma_options_t options;
+
+ /* Used by trans->op->receive */
+ char *data_ptr;
+ int32_t data_offset;
+ int32_t data_len;
+
+ /* Mutex */
+ pthread_mutex_t write_mutex;
+ rpc_transport_t *listener;
+ pthread_mutex_t recv_mutex;
+ pthread_cond_t recv_cond;
+ gf_rdma_transport_entity_t entity;
+ uint32_t backlog;
};
-typedef struct __gf_rdma_private gf_rdma_private_t;
+typedef struct __gf_rdma_private gf_rdma_private_t;
#endif /* _XPORT_GF_RDMA_H */
diff --git a/rpc/rpc-transport/rdma/src/rpc-trans-rdma-messages.h b/rpc/rpc-transport/rdma/src/rpc-trans-rdma-messages.h
index 97979970e73..6e9ea9a2925 100644
--- a/rpc/rpc-transport/rdma/src/rpc-trans-rdma-messages.h
+++ b/rpc/rpc-transport/rdma/src/rpc-trans-rdma-messages.h
@@ -23,85 +23,44 @@
* glfs-message-id.h.
*/
-GLFS_MSGID(RPC_TRANS_RDMA,
- RDMA_MSG_PORT_BIND_FAILED,
- RDMA_MSG_POST_CREATION_FAILED,
- RDMA_MSG_DEREGISTER_ARENA_FAILED,
- RDMA_MSG_MR_ALOC_FAILED,
- RDMA_MSG_PREREG_BUFFER_FAILED,
- RDMA_MSG_CQ_CREATION_FAILED,
- RDMA_MSG_REQ_NOTIFY_CQ_REVQ_FAILED,
- RDMA_MSG_QUERY_DEVICE_FAILED,
- RDMA_MSG_REQ_NOTIFY_CQ_SENDQ_FAILED,
- RDMA_MSG_SEND_COMP_CHAN_FAILED,
- RDMA_MSG_RECV_COMP_CHAN_FAILED,
- RDMA_MSG_ALOC_PROT_DOM_FAILED,
- RDMA_MSG_CRE_SRQ_FAILED,
- RDMA_MSG_ALOC_POST_FAILED,
- RDMA_MSG_SEND_COMP_THREAD_FAILED,
- RDMA_MSG_RECV_COMP_THREAD_FAILED,
- RDMA_MSG_ASYNC_EVENT_THEAD_FAILED,
- RDMA_MSG_GET_DEVICE_NAME_FAILED,
- RDMA_MSG_GET_IB_DEVICE_FAILED,
- RDMA_MSG_CREAT_INC_TRANS_FAILED,
- RDMA_MSG_CREAT_QP_FAILED,
- RDMA_MSG_ACCEPT_FAILED,
- RDMA_MSG_CONNECT_FAILED,
- RDMA_MSG_ROUTE_RESOLVE_FAILED,
- RDMA_MSG_GET_DEVICE_FAILED,
- RDMA_MSG_PEER_DISCONNECTED,
- RDMA_MSG_ENCODE_ERROR,
- RDMA_MSG_POST_SEND_FAILED,
- RDMA_MSG_READ_CHUNK_VECTOR_FAILED,
- RDMA_MSG_WRITE_CHUNK_VECTOR_FAILED,
- RDMA_MSG_WRITE_REPLY_CHUNCK_CONFLICT,
- RDMA_MSG_CHUNK_COUNT_GREAT_MAX_SEGMENTS,
- RDMA_MSG_CREATE_READ_CHUNK_FAILED,
- RDMA_MSG_CREATE_WRITE_REPLAY_FAILED,
- RDMA_MSG_SEND_SIZE_GREAT_INLINE_THRESHOLD,
- RDMA_MSG_REG_ACCESS_LOCAL_WRITE_FAILED,
- RDMA_MSG_WRITE_PEER_FAILED,
- RDMA_MSG_SEND_REPLY_FAILED,
- RDMA_MSG_INVALID_CHUNK_TYPE,
- RDMA_MSG_PROC_IOQ_ENTRY_FAILED,
- RDMA_MSG_NEW_IOQ_ENTRY_FAILED,
- RDMA_MSG_RPC_REPLY_CREATE_FAILED,
- RDMA_MSG_GET_READ_CHUNK_FAILED,
- RDMA_MSG_GET_WRITE_CHUNK_FAILED,
- RDMA_MSG_REPLY_INFO_ALLOC_FAILED,
- RDMA_MSG_RDMA_ERROR_RECEIVED,
- RDMA_MSG_GET_REQ_INFO_RPC_FAILED,
- RDMA_MSG_POLL_IN_NOTIFY_FAILED,
- RDMA_MSG_HEADER_DECODE_FAILED,
- RDMA_MSG_EVENT_SRQ_LIMIT_REACHED,
- RDMA_MSG_UNRECG_MQ_VALUE,
- RDMA_MSG_BUFFER_ERROR,
- RDMA_MSG_OPTION_SET_FAILED,
- RDMA_MSG_LISTEN_FAILED,
- RDMA_MSG_INIT_IB_DEVICE_FAILED,
- RDMA_MSG_WRITE_CLIENT_ERROR,
- RDMA_MSG_CHUNKLIST_ERROR,
- RDMA_MSG_INVALID_ENTRY,
- RDMA_MSG_READ_CLIENT_ERROR,
- RDMA_MSG_RPC_ST_ERROR,
- RDMA_MSG_PEER_READ_FAILED,
- RDMA_MSG_POST_MISSING,
- RDMA_MSG_PEER_REQ_FAILED,
- RDMA_MSG_PEER_REP_FAILED,
- RDMA_MSG_EVENT_ERROR,
- RDMA_MSG_IBV_GET_CQ_FAILED,
- RDMA_MSG_IBV_REQ_NOTIFY_CQ_FAILED,
- RDMA_MSG_RECV_ERROR,
- RDMA_MSG_IBV_POLL_CQ_ERROR,
- RDMA_MSG_RDMA_HANDLE_FAILED,
- RDMA_MSG_CM_EVENT_FAILED,
- RDMA_MSG_CLIENT_BIND_FAILED,
- RDMA_MSG_RDMA_RESOLVE_ADDR_FAILED,
- RDMA_MSG_NW_ADDR_UNKNOWN,
- RDMA_MSG_RDMA_BIND_ADDR_FAILED,
- RDMA_MSG_SEND_CLIENT_ERROR,
- RDMA_MSG_UNRECG_MTU_VALUE
-);
+GLFS_MSGID(
+ RPC_TRANS_RDMA, RDMA_MSG_PORT_BIND_FAILED, RDMA_MSG_POST_CREATION_FAILED,
+ RDMA_MSG_DEREGISTER_ARENA_FAILED, RDMA_MSG_MR_ALOC_FAILED,
+ RDMA_MSG_PREREG_BUFFER_FAILED, RDMA_MSG_CQ_CREATION_FAILED,
+ RDMA_MSG_REQ_NOTIFY_CQ_REVQ_FAILED, RDMA_MSG_QUERY_DEVICE_FAILED,
+ RDMA_MSG_REQ_NOTIFY_CQ_SENDQ_FAILED, RDMA_MSG_SEND_COMP_CHAN_FAILED,
+ RDMA_MSG_RECV_COMP_CHAN_FAILED, RDMA_MSG_ALOC_PROT_DOM_FAILED,
+ RDMA_MSG_CRE_SRQ_FAILED, RDMA_MSG_ALOC_POST_FAILED,
+ RDMA_MSG_SEND_COMP_THREAD_FAILED, RDMA_MSG_RECV_COMP_THREAD_FAILED,
+ RDMA_MSG_ASYNC_EVENT_THEAD_FAILED, RDMA_MSG_GET_DEVICE_NAME_FAILED,
+ RDMA_MSG_GET_IB_DEVICE_FAILED, RDMA_MSG_CREAT_INC_TRANS_FAILED,
+ RDMA_MSG_CREAT_QP_FAILED, RDMA_MSG_ACCEPT_FAILED, RDMA_MSG_CONNECT_FAILED,
+ RDMA_MSG_ROUTE_RESOLVE_FAILED, RDMA_MSG_GET_DEVICE_FAILED,
+ RDMA_MSG_PEER_DISCONNECTED, RDMA_MSG_ENCODE_ERROR,
+ RDMA_MSG_POST_SEND_FAILED, RDMA_MSG_READ_CHUNK_VECTOR_FAILED,
+ RDMA_MSG_WRITE_CHUNK_VECTOR_FAILED, RDMA_MSG_WRITE_REPLY_CHUNCK_CONFLICT,
+ RDMA_MSG_CHUNK_COUNT_GREAT_MAX_SEGMENTS, RDMA_MSG_CREATE_READ_CHUNK_FAILED,
+ RDMA_MSG_CREATE_WRITE_REPLAY_FAILED,
+ RDMA_MSG_SEND_SIZE_GREAT_INLINE_THRESHOLD,
+ RDMA_MSG_REG_ACCESS_LOCAL_WRITE_FAILED, RDMA_MSG_WRITE_PEER_FAILED,
+ RDMA_MSG_SEND_REPLY_FAILED, RDMA_MSG_INVALID_CHUNK_TYPE,
+ RDMA_MSG_PROC_IOQ_ENTRY_FAILED, RDMA_MSG_NEW_IOQ_ENTRY_FAILED,
+ RDMA_MSG_RPC_REPLY_CREATE_FAILED, RDMA_MSG_GET_READ_CHUNK_FAILED,
+ RDMA_MSG_GET_WRITE_CHUNK_FAILED, RDMA_MSG_REPLY_INFO_ALLOC_FAILED,
+ RDMA_MSG_RDMA_ERROR_RECEIVED, RDMA_MSG_GET_REQ_INFO_RPC_FAILED,
+ RDMA_MSG_POLL_IN_NOTIFY_FAILED, RDMA_MSG_HEADER_DECODE_FAILED,
+ RDMA_MSG_EVENT_SRQ_LIMIT_REACHED, RDMA_MSG_UNRECG_MQ_VALUE,
+ RDMA_MSG_BUFFER_ERROR, RDMA_MSG_OPTION_SET_FAILED, RDMA_MSG_LISTEN_FAILED,
+ RDMA_MSG_INIT_IB_DEVICE_FAILED, RDMA_MSG_WRITE_CLIENT_ERROR,
+ RDMA_MSG_CHUNKLIST_ERROR, RDMA_MSG_INVALID_ENTRY,
+ RDMA_MSG_READ_CLIENT_ERROR, RDMA_MSG_RPC_ST_ERROR,
+ RDMA_MSG_PEER_READ_FAILED, RDMA_MSG_POST_MISSING, RDMA_MSG_PEER_REQ_FAILED,
+ RDMA_MSG_PEER_REP_FAILED, RDMA_MSG_EVENT_ERROR, RDMA_MSG_IBV_GET_CQ_FAILED,
+ RDMA_MSG_IBV_REQ_NOTIFY_CQ_FAILED, RDMA_MSG_RECV_ERROR,
+ RDMA_MSG_IBV_POLL_CQ_ERROR, RDMA_MSG_RDMA_HANDLE_FAILED,
+ RDMA_MSG_CM_EVENT_FAILED, RDMA_MSG_CLIENT_BIND_FAILED,
+ RDMA_MSG_RDMA_RESOLVE_ADDR_FAILED, RDMA_MSG_NW_ADDR_UNKNOWN,
+ RDMA_MSG_RDMA_BIND_ADDR_FAILED, RDMA_MSG_SEND_CLIENT_ERROR,
+ RDMA_MSG_UNRECG_MTU_VALUE);
#endif /* !_RPC_TRANS_RDMA_MESSAGES_H_ */
-
diff --git a/rpc/rpc-transport/socket/src/name.h b/rpc/rpc-transport/socket/src/name.h
index 0a13d8a9624..85f8bb7040b 100644
--- a/rpc/rpc-transport/socket/src/name.h
+++ b/rpc/rpc-transport/socket/src/name.h
@@ -14,22 +14,20 @@
#include "compat.h"
int32_t
-client_bind (rpc_transport_t *this,
- struct sockaddr *sockaddr,
- socklen_t *sockaddr_len,
- int sock);
+client_bind(rpc_transport_t *this, struct sockaddr *sockaddr,
+ socklen_t *sockaddr_len, int sock);
int32_t
-socket_client_get_remote_sockaddr (rpc_transport_t *this,
- struct sockaddr *sockaddr,
- socklen_t *sockaddr_len,
- sa_family_t *sa_family);
+socket_client_get_remote_sockaddr(rpc_transport_t *this,
+ struct sockaddr *sockaddr,
+ socklen_t *sockaddr_len,
+ sa_family_t *sa_family);
int32_t
-socket_server_get_local_sockaddr (rpc_transport_t *this, struct sockaddr *addr,
- socklen_t *addr_len, sa_family_t *sa_family);
+socket_server_get_local_sockaddr(rpc_transport_t *this, struct sockaddr *addr,
+ socklen_t *addr_len, sa_family_t *sa_family);
int32_t
-get_transport_identifiers (rpc_transport_t *this);
+get_transport_identifiers(rpc_transport_t *this);
#endif /* _SOCKET_NAME_H */
diff --git a/rpc/rpc-transport/socket/src/socket-mem-types.h b/rpc/rpc-transport/socket/src/socket-mem-types.h
index d1860e6c9a9..81635b72320 100644
--- a/rpc/rpc-transport/socket/src/socket-mem-types.h
+++ b/rpc/rpc-transport/socket/src/socket-mem-types.h
@@ -14,10 +14,10 @@
#include "mem-types.h"
typedef enum gf_sock_mem_types_ {
- gf_sock_connect_error_state_t = gf_common_mt_end + 1,
- gf_sock_mt_lock_array,
- gf_sock_mt_tid_wrap,
- gf_sock_mt_end
+ gf_sock_connect_error_state_t = gf_common_mt_end + 1,
+ gf_sock_mt_lock_array,
+ gf_sock_mt_tid_wrap,
+ gf_sock_mt_end
} gf_sock_mem_types_t;
#endif
diff --git a/rpc/rpc-transport/socket/src/socket.h b/rpc/rpc-transport/socket/src/socket.h
index 4e65489f987..27db0ed427b 100644
--- a/rpc/rpc-transport/socket/src/socket.h
+++ b/rpc/rpc-transport/socket/src/socket.h
@@ -33,7 +33,7 @@
#define MAX_IOVEC 16
#endif /* MAX_IOVEC */
-#define GF_DEFAULT_SOCKET_LISTEN_PORT GF_DEFAULT_BASE_PORT
+#define GF_DEFAULT_SOCKET_LISTEN_PORT GF_DEFAULT_BASE_PORT
#define RPC_MAX_FRAGMENT_SIZE 0x7fffffff
@@ -45,247 +45,246 @@
* setsockopt will fail. Having larger values might be beneficial for
* IB links.
*/
-#define GF_DEFAULT_SOCKET_WINDOW_SIZE (0)
-#define GF_MAX_SOCKET_WINDOW_SIZE (1 * GF_UNIT_MB)
-#define GF_MIN_SOCKET_WINDOW_SIZE (0)
-#define GF_USE_DEFAULT_KEEPALIVE (-1)
+#define GF_DEFAULT_SOCKET_WINDOW_SIZE (0)
+#define GF_MAX_SOCKET_WINDOW_SIZE (1 * GF_UNIT_MB)
+#define GF_MIN_SOCKET_WINDOW_SIZE (0)
+#define GF_USE_DEFAULT_KEEPALIVE (-1)
-#define GF_KEEPALIVE_TIME (20)
-#define GF_KEEPALIVE_INTERVAL (2)
-#define GF_KEEPALIVE_COUNT (9)
+#define GF_KEEPALIVE_TIME (20)
+#define GF_KEEPALIVE_INTERVAL (2)
+#define GF_KEEPALIVE_COUNT (9)
typedef enum {
- SP_STATE_NADA = 0,
- SP_STATE_COMPLETE,
- SP_STATE_READING_FRAGHDR,
- SP_STATE_READ_FRAGHDR,
- SP_STATE_READING_FRAG,
+ SP_STATE_NADA = 0,
+ SP_STATE_COMPLETE,
+ SP_STATE_READING_FRAGHDR,
+ SP_STATE_READ_FRAGHDR,
+ SP_STATE_READING_FRAG,
} sp_rpcrecord_state_t;
typedef enum {
- SP_STATE_RPCFRAG_INIT,
- SP_STATE_READING_MSGTYPE,
- SP_STATE_READ_MSGTYPE,
- SP_STATE_NOTIFYING_XID
+ SP_STATE_RPCFRAG_INIT,
+ SP_STATE_READING_MSGTYPE,
+ SP_STATE_READ_MSGTYPE,
+ SP_STATE_NOTIFYING_XID
} sp_rpcfrag_state_t;
typedef enum {
- SP_STATE_SIMPLE_MSG_INIT,
- SP_STATE_READING_SIMPLE_MSG,
+ SP_STATE_SIMPLE_MSG_INIT,
+ SP_STATE_READING_SIMPLE_MSG,
} sp_rpcfrag_simple_msg_state_t;
typedef enum {
- SP_STATE_VECTORED_REQUEST_INIT,
- SP_STATE_READING_CREDBYTES,
- SP_STATE_READ_CREDBYTES, /* read credential data. */
- SP_STATE_READING_VERFBYTES,
- SP_STATE_READ_VERFBYTES, /* read verifier data */
- SP_STATE_READING_PROGHDR,
- SP_STATE_READ_PROGHDR,
- SP_STATE_READING_PROGHDR_XDATA,
- SP_STATE_READ_PROGHDR_XDATA, /* It's a bad "name" in the generic
- RPC state machine, but greatly
- aids code review (and xdata is
- the only "consumer" of this state)
- */
- SP_STATE_READING_PROG,
+ SP_STATE_VECTORED_REQUEST_INIT,
+ SP_STATE_READING_CREDBYTES,
+ SP_STATE_READ_CREDBYTES, /* read credential data. */
+ SP_STATE_READING_VERFBYTES,
+ SP_STATE_READ_VERFBYTES, /* read verifier data */
+ SP_STATE_READING_PROGHDR,
+ SP_STATE_READ_PROGHDR,
+ SP_STATE_READING_PROGHDR_XDATA,
+ SP_STATE_READ_PROGHDR_XDATA, /* It's a bad "name" in the generic
+ RPC state machine, but greatly
+ aids code review (and xdata is
+ the only "consumer" of this state)
+ */
+ SP_STATE_READING_PROG,
} sp_rpcfrag_vectored_request_state_t;
typedef enum {
- SP_STATE_REQUEST_HEADER_INIT,
- SP_STATE_READING_RPCHDR1,
- SP_STATE_READ_RPCHDR1, /* read msg from beginning till and
- * including credlen
- */
+ SP_STATE_REQUEST_HEADER_INIT,
+ SP_STATE_READING_RPCHDR1,
+ SP_STATE_READ_RPCHDR1, /* read msg from beginning till and
+ * including credlen
+ */
} sp_rpcfrag_request_header_state_t;
struct ioq {
- union {
- struct list_head list;
- struct {
- struct ioq *next;
- struct ioq *prev;
- };
+ union {
+ struct list_head list;
+ struct {
+ struct ioq *next;
+ struct ioq *prev;
};
-
- uint32_t fraghdr;
- struct iovec vector[MAX_IOVEC];
- int count;
- struct iovec *pending_vector;
- int pending_count;
- struct iobref *iobref;
+ };
+
+ uint32_t fraghdr;
+ struct iovec vector[MAX_IOVEC];
+ int count;
+ struct iovec *pending_vector;
+ int pending_count;
+ struct iobref *iobref;
};
typedef struct {
- sp_rpcfrag_request_header_state_t header_state;
- sp_rpcfrag_vectored_request_state_t vector_state;
- int vector_sizer_state;
+ sp_rpcfrag_request_header_state_t header_state;
+ sp_rpcfrag_vectored_request_state_t vector_state;
+ int vector_sizer_state;
} sp_rpcfrag_request_state_t;
typedef enum {
- SP_STATE_VECTORED_REPLY_STATUS_INIT,
- SP_STATE_READING_REPLY_STATUS,
- SP_STATE_READ_REPLY_STATUS,
+ SP_STATE_VECTORED_REPLY_STATUS_INIT,
+ SP_STATE_READING_REPLY_STATUS,
+ SP_STATE_READ_REPLY_STATUS,
} sp_rpcfrag_vectored_reply_status_state_t;
typedef enum {
- SP_STATE_ACCEPTED_SUCCESS_REPLY_INIT,
- SP_STATE_READING_PROC_HEADER,
- SP_STATE_READING_PROC_OPAQUE,
- SP_STATE_READ_PROC_OPAQUE,
- SP_STATE_READ_PROC_HEADER,
+ SP_STATE_ACCEPTED_SUCCESS_REPLY_INIT,
+ SP_STATE_READING_PROC_HEADER,
+ SP_STATE_READING_PROC_OPAQUE,
+ SP_STATE_READ_PROC_OPAQUE,
+ SP_STATE_READ_PROC_HEADER,
} sp_rpcfrag_vectored_reply_accepted_success_state_t;
typedef enum {
- SP_STATE_ACCEPTED_REPLY_INIT,
- SP_STATE_READING_REPLY_VERFLEN,
- SP_STATE_READ_REPLY_VERFLEN,
- SP_STATE_READING_REPLY_VERFBYTES,
- SP_STATE_READ_REPLY_VERFBYTES,
+ SP_STATE_ACCEPTED_REPLY_INIT,
+ SP_STATE_READING_REPLY_VERFLEN,
+ SP_STATE_READ_REPLY_VERFLEN,
+ SP_STATE_READING_REPLY_VERFBYTES,
+ SP_STATE_READ_REPLY_VERFBYTES,
} sp_rpcfrag_vectored_reply_accepted_state_t;
typedef struct {
- uint32_t accept_status;
- sp_rpcfrag_vectored_reply_status_state_t status_state;
- sp_rpcfrag_vectored_reply_accepted_state_t accepted_state;
- sp_rpcfrag_vectored_reply_accepted_success_state_t accepted_success_state;
+ uint32_t accept_status;
+ sp_rpcfrag_vectored_reply_status_state_t status_state;
+ sp_rpcfrag_vectored_reply_accepted_state_t accepted_state;
+ sp_rpcfrag_vectored_reply_accepted_success_state_t accepted_success_state;
} sp_rpcfrag_vectored_reply_state_t;
struct gf_sock_incoming_frag {
- char *fragcurrent;
- uint32_t bytes_read;
- uint32_t remaining_size;
- struct iovec vector;
- struct iovec *pending_vector;
- union {
- sp_rpcfrag_request_state_t request;
- sp_rpcfrag_vectored_reply_state_t reply;
- } call_body;
-
- sp_rpcfrag_simple_msg_state_t simple_state;
- sp_rpcfrag_state_t state;
+ char *fragcurrent;
+ uint32_t bytes_read;
+ uint32_t remaining_size;
+ struct iovec vector;
+ struct iovec *pending_vector;
+ union {
+ sp_rpcfrag_request_state_t request;
+ sp_rpcfrag_vectored_reply_state_t reply;
+ } call_body;
+
+ sp_rpcfrag_simple_msg_state_t simple_state;
+ sp_rpcfrag_state_t state;
};
#define GF_SOCKET_RA_MAX 1024
struct gf_sock_incoming {
- sp_rpcrecord_state_t record_state;
- struct gf_sock_incoming_frag frag;
- char *proghdr_base_addr;
- struct iobuf *iobuf;
- size_t iobuf_size;
- struct iovec vector[2];
- int count;
- struct iovec payload_vector;
- struct iobref *iobref;
- rpc_request_info_t *request_info;
- struct iovec *pending_vector;
- int pending_count;
- uint32_t fraghdr;
- char complete_record;
- msg_type_t msg_type;
- size_t total_bytes_read;
-
- size_t ra_read;
- size_t ra_max;
- size_t ra_served;
- char *ra_buf;
+ sp_rpcrecord_state_t record_state;
+ struct gf_sock_incoming_frag frag;
+ char *proghdr_base_addr;
+ struct iobuf *iobuf;
+ size_t iobuf_size;
+ struct iovec vector[2];
+ int count;
+ struct iovec payload_vector;
+ struct iobref *iobref;
+ rpc_request_info_t *request_info;
+ struct iovec *pending_vector;
+ int pending_count;
+ uint32_t fraghdr;
+ char complete_record;
+ msg_type_t msg_type;
+ size_t total_bytes_read;
+
+ size_t ra_read;
+ size_t ra_max;
+ size_t ra_served;
+ char *ra_buf;
};
typedef enum {
- OT_IDLE, /* Uninitialized or termination complete. */
- OT_SPAWNING, /* Past pthread_create but not in thread yet. */
- OT_RUNNING, /* Poller thread running normally. */
- OT_CALLBACK, /* Poller thread in the middle of a callback. */
- OT_PLEASE_DIE, /* Poller termination requested. */
+ OT_IDLE, /* Uninitialized or termination complete. */
+ OT_SPAWNING, /* Past pthread_create but not in thread yet. */
+ OT_RUNNING, /* Poller thread running normally. */
+ OT_CALLBACK, /* Poller thread in the middle of a callback. */
+ OT_PLEASE_DIE, /* Poller termination requested. */
} ot_state_t;
typedef struct {
- int32_t sock;
- int32_t idx;
- int32_t gen;
- /* -1 = not connected. 0 = in progress. 1 = connected */
- char connected;
- /* 1 = connect failed for reasons other than EINPROGRESS/ENOENT
- see socket_connect for details */
- char connect_failed;
- char bio;
- char connect_finish_log;
- char submit_log;
- union {
- struct list_head ioq;
- struct {
- struct ioq *ioq_next;
- struct ioq *ioq_prev;
- };
- };
- struct gf_sock_incoming incoming;
- pthread_mutex_t in_lock;
- pthread_mutex_t out_lock;
- pthread_mutex_t cond_lock;
- pthread_cond_t cond;
- int windowsize;
- char lowlat;
- char nodelay;
- int keepalive;
- int keepaliveidle;
- int keepaliveintvl;
- int keepalivecnt;
- int timeout;
- uint32_t backlog;
- gf_boolean_t read_fail_log;
- gf_boolean_t ssl_enabled; /* outbound I/O */
- gf_boolean_t mgmt_ssl; /* outbound mgmt */
- mgmt_ssl_t srvr_ssl;
- gf_boolean_t use_ssl;
- SSL_METHOD *ssl_meth;
- SSL_CTX *ssl_ctx;
- int ssl_session_id;
- BIO *ssl_sbio;
- SSL *ssl_ssl;
- char *ssl_own_cert;
- char *ssl_private_key;
- char *ssl_ca_list;
- pthread_t thread;
- int pipe[2];
- gf_boolean_t is_server;
- int log_ctr;
- gf_boolean_t ssl_accepted; /* To indicate SSL_accept() */
- gf_boolean_t ssl_connected;/* or SSL_connect() has been
- * been completed on this socket.
- * These are valid only when
- * use_ssl is true.
- */
- /* SSL_CTX is created for each transport. Since we are now using non-
- * blocking mechanism for SSL_accept() and SSL_connect(), the SSL
- * context is created on the first EPOLLIN event which may lead to
- * SSL_ERROR_WANT_READ/SSL_ERROR_WANT_WRITE and may not complete the
- * SSL connection at the first attempt.
- * ssl_context_created is a flag to note that we've created the SSL
- * context for the connection so that we don't blindly create any more
- * while !ssl_accepted or !ssl_connected.
- */
- gf_boolean_t ssl_context_created;
- gf_boolean_t accepted; /* explicit flag to be set in
- * socket_event_handler() for
- * newly accepted socket
- */
-
- /* ssl_error_required is used only during the SSL connection setup
- * phase.
- * It holds the error code returned by SSL_get_error() and is used to
- * arm the epoll event set for the required event for the specific fd.
- */
- int ssl_error_required;
-
- GF_REF_DECL; /* refcount to keep track of socket_poller
- threads */
+ int32_t sock;
+ int32_t idx;
+ int32_t gen;
+ /* -1 = not connected. 0 = in progress. 1 = connected */
+ char connected;
+ /* 1 = connect failed for reasons other than EINPROGRESS/ENOENT
+ see socket_connect for details */
+ char connect_failed;
+ char bio;
+ char connect_finish_log;
+ char submit_log;
+ union {
+ struct list_head ioq;
struct {
- pthread_mutex_t lock;
- pthread_cond_t cond;
- uint64_t in_progress;
- } notify;
+ struct ioq *ioq_next;
+ struct ioq *ioq_prev;
+ };
+ };
+ struct gf_sock_incoming incoming;
+ pthread_mutex_t in_lock;
+ pthread_mutex_t out_lock;
+ pthread_mutex_t cond_lock;
+ pthread_cond_t cond;
+ int windowsize;
+ char lowlat;
+ char nodelay;
+ int keepalive;
+ int keepaliveidle;
+ int keepaliveintvl;
+ int keepalivecnt;
+ int timeout;
+ uint32_t backlog;
+ gf_boolean_t read_fail_log;
+ gf_boolean_t ssl_enabled; /* outbound I/O */
+ gf_boolean_t mgmt_ssl; /* outbound mgmt */
+ mgmt_ssl_t srvr_ssl;
+ gf_boolean_t use_ssl;
+ SSL_METHOD *ssl_meth;
+ SSL_CTX *ssl_ctx;
+ int ssl_session_id;
+ BIO *ssl_sbio;
+ SSL *ssl_ssl;
+ char *ssl_own_cert;
+ char *ssl_private_key;
+ char *ssl_ca_list;
+ pthread_t thread;
+ int pipe[2];
+ gf_boolean_t is_server;
+ int log_ctr;
+ gf_boolean_t ssl_accepted; /* To indicate SSL_accept() */
+ gf_boolean_t ssl_connected; /* or SSL_connect() has been
+ * been completed on this socket.
+ * These are valid only when
+ * use_ssl is true.
+ */
+ /* SSL_CTX is created for each transport. Since we are now using non-
+ * blocking mechanism for SSL_accept() and SSL_connect(), the SSL
+ * context is created on the first EPOLLIN event which may lead to
+ * SSL_ERROR_WANT_READ/SSL_ERROR_WANT_WRITE and may not complete the
+ * SSL connection at the first attempt.
+ * ssl_context_created is a flag to note that we've created the SSL
+ * context for the connection so that we don't blindly create any more
+ * while !ssl_accepted or !ssl_connected.
+ */
+ gf_boolean_t ssl_context_created;
+ gf_boolean_t accepted; /* explicit flag to be set in
+ * socket_event_handler() for
+ * newly accepted socket
+ */
+
+ /* ssl_error_required is used only during the SSL connection setup
+ * phase.
+ * It holds the error code returned by SSL_get_error() and is used to
+ * arm the epoll event set for the required event for the specific fd.
+ */
+ int ssl_error_required;
+
+ GF_REF_DECL; /* refcount to keep track of socket_poller
+ threads */
+ struct {
+ pthread_mutex_t lock;
+ pthread_cond_t cond;
+ uint64_t in_progress;
+ } notify;
} socket_private_t;
-
#endif
diff --git a/rpc/xdr/src/glusterfs3.h b/rpc/xdr/src/glusterfs3.h
index 4ffad3c5b45..b8ef394abaf 100644
--- a/rpc/xdr/src/glusterfs3.h
+++ b/rpc/xdr/src/glusterfs3.h
@@ -20,867 +20,877 @@
#include "protocol-common.h"
#include "upcall-utils.h"
-#define xdr_decoded_remaining_addr(xdr) ((&xdr)->x_private)
-#define xdr_decoded_remaining_len(xdr) ((&xdr)->x_handy)
-#define xdr_encoded_length(xdr) (((size_t)(&xdr)->x_private) - ((size_t)(&xdr)->x_base))
-#define xdr_decoded_length(xdr) (((size_t)(&xdr)->x_private) - ((size_t)(&xdr)->x_base))
-
-
-#define GF_O_ACCMODE 003
-#define GF_O_RDONLY 00
-#define GF_O_WRONLY 01
-#define GF_O_RDWR 02
-#define GF_O_CREAT 0100
-#define GF_O_EXCL 0200
-#define GF_O_NOCTTY 0400
-#define GF_O_TRUNC 01000
-#define GF_O_APPEND 02000
-#define GF_O_NONBLOCK 04000
-#define GF_O_SYNC 010000
-#define GF_O_ASYNC 020000
-
-#define GF_O_DIRECT 040000
-#define GF_O_DIRECTORY 0200000
-#define GF_O_NOFOLLOW 0400000
-#define GF_O_NOATIME 01000000
-#define GF_O_CLOEXEC 02000000
-
-#define GF_O_LARGEFILE 0100000
-
-#define GF_O_FMODE_EXEC 040
-
-#define XLATE_BIT(from, to, bit) do { \
- if (from & bit) \
- to = to | GF_##bit; \
- } while (0)
-
-#define UNXLATE_BIT(from, to, bit) do { \
- if (from & GF_##bit) \
- to = to | bit; \
- } while (0)
-
-#define XLATE_ACCESSMODE(from, to) do { \
- switch (from & O_ACCMODE) { \
- case O_RDONLY: to |= GF_O_RDONLY; \
- break; \
- case O_WRONLY: to |= GF_O_WRONLY; \
- break; \
- case O_RDWR: to |= GF_O_RDWR; \
- break; \
- } \
- } while (0)
-
-#define UNXLATE_ACCESSMODE(from, to) do { \
- switch (from & GF_O_ACCMODE) { \
- case GF_O_RDONLY: to |= O_RDONLY; \
- break; \
- case GF_O_WRONLY: to |= O_WRONLY; \
- break; \
- case GF_O_RDWR: to |= O_RDWR; \
- break; \
- } \
- } while (0)
+#define xdr_decoded_remaining_addr(xdr) ((&xdr)->x_private)
+#define xdr_decoded_remaining_len(xdr) ((&xdr)->x_handy)
+#define xdr_encoded_length(xdr) \
+ (((size_t)(&xdr)->x_private) - ((size_t)(&xdr)->x_base))
+#define xdr_decoded_length(xdr) \
+ (((size_t)(&xdr)->x_private) - ((size_t)(&xdr)->x_base))
+
+#define GF_O_ACCMODE 003
+#define GF_O_RDONLY 00
+#define GF_O_WRONLY 01
+#define GF_O_RDWR 02
+#define GF_O_CREAT 0100
+#define GF_O_EXCL 0200
+#define GF_O_NOCTTY 0400
+#define GF_O_TRUNC 01000
+#define GF_O_APPEND 02000
+#define GF_O_NONBLOCK 04000
+#define GF_O_SYNC 010000
+#define GF_O_ASYNC 020000
+
+#define GF_O_DIRECT 040000
+#define GF_O_DIRECTORY 0200000
+#define GF_O_NOFOLLOW 0400000
+#define GF_O_NOATIME 01000000
+#define GF_O_CLOEXEC 02000000
+
+#define GF_O_LARGEFILE 0100000
+
+#define GF_O_FMODE_EXEC 040
+
+#define XLATE_BIT(from, to, bit) \
+ do { \
+ if (from & bit) \
+ to = to | GF_##bit; \
+ } while (0)
+
+#define UNXLATE_BIT(from, to, bit) \
+ do { \
+ if (from & GF_##bit) \
+ to = to | bit; \
+ } while (0)
+
+#define XLATE_ACCESSMODE(from, to) \
+ do { \
+ switch (from & O_ACCMODE) { \
+ case O_RDONLY: \
+ to |= GF_O_RDONLY; \
+ break; \
+ case O_WRONLY: \
+ to |= GF_O_WRONLY; \
+ break; \
+ case O_RDWR: \
+ to |= GF_O_RDWR; \
+ break; \
+ } \
+ } while (0)
+
+#define UNXLATE_ACCESSMODE(from, to) \
+ do { \
+ switch (from & GF_O_ACCMODE) { \
+ case GF_O_RDONLY: \
+ to |= O_RDONLY; \
+ break; \
+ case GF_O_WRONLY: \
+ to |= O_WRONLY; \
+ break; \
+ case GF_O_RDWR: \
+ to |= O_RDWR; \
+ break; \
+ } \
+ } while (0)
static inline uint32_t
-gf_flags_from_flags (uint32_t flags)
+gf_flags_from_flags(uint32_t flags)
{
- uint32_t gf_flags = 0;
-
- XLATE_ACCESSMODE (flags, gf_flags);
-
- XLATE_BIT (flags, gf_flags, O_CREAT);
- XLATE_BIT (flags, gf_flags, O_EXCL);
- XLATE_BIT (flags, gf_flags, O_NOCTTY);
- XLATE_BIT (flags, gf_flags, O_TRUNC);
- XLATE_BIT (flags, gf_flags, O_APPEND);
- XLATE_BIT (flags, gf_flags, O_NONBLOCK);
- XLATE_BIT (flags, gf_flags, O_SYNC);
- XLATE_BIT (flags, gf_flags, O_ASYNC);
-
- XLATE_BIT (flags, gf_flags, O_DIRECT);
- XLATE_BIT (flags, gf_flags, O_DIRECTORY);
- XLATE_BIT (flags, gf_flags, O_NOFOLLOW);
+ uint32_t gf_flags = 0;
+
+ XLATE_ACCESSMODE(flags, gf_flags);
+
+ XLATE_BIT(flags, gf_flags, O_CREAT);
+ XLATE_BIT(flags, gf_flags, O_EXCL);
+ XLATE_BIT(flags, gf_flags, O_NOCTTY);
+ XLATE_BIT(flags, gf_flags, O_TRUNC);
+ XLATE_BIT(flags, gf_flags, O_APPEND);
+ XLATE_BIT(flags, gf_flags, O_NONBLOCK);
+ XLATE_BIT(flags, gf_flags, O_SYNC);
+ XLATE_BIT(flags, gf_flags, O_ASYNC);
+
+ XLATE_BIT(flags, gf_flags, O_DIRECT);
+ XLATE_BIT(flags, gf_flags, O_DIRECTORY);
+ XLATE_BIT(flags, gf_flags, O_NOFOLLOW);
#ifdef O_NOATIME
- XLATE_BIT (flags, gf_flags, O_NOATIME);
+ XLATE_BIT(flags, gf_flags, O_NOATIME);
#endif
#ifdef O_CLOEXEC
- XLATE_BIT (flags, gf_flags, O_CLOEXEC);
+ XLATE_BIT(flags, gf_flags, O_CLOEXEC);
#endif
- XLATE_BIT (flags, gf_flags, O_LARGEFILE);
- XLATE_BIT (flags, gf_flags, O_FMODE_EXEC);
+ XLATE_BIT(flags, gf_flags, O_LARGEFILE);
+ XLATE_BIT(flags, gf_flags, O_FMODE_EXEC);
- return gf_flags;
+ return gf_flags;
}
static inline uint32_t
-gf_flags_to_flags (uint32_t gf_flags)
+gf_flags_to_flags(uint32_t gf_flags)
{
- uint32_t flags = 0;
-
- UNXLATE_ACCESSMODE (gf_flags, flags);
-
- UNXLATE_BIT (gf_flags, flags, O_CREAT);
- UNXLATE_BIT (gf_flags, flags, O_EXCL);
- UNXLATE_BIT (gf_flags, flags, O_NOCTTY);
- UNXLATE_BIT (gf_flags, flags, O_TRUNC);
- UNXLATE_BIT (gf_flags, flags, O_APPEND);
- UNXLATE_BIT (gf_flags, flags, O_NONBLOCK);
- UNXLATE_BIT (gf_flags, flags, O_SYNC);
- UNXLATE_BIT (gf_flags, flags, O_ASYNC);
-
- UNXLATE_BIT (gf_flags, flags, O_DIRECT);
- UNXLATE_BIT (gf_flags, flags, O_DIRECTORY);
- UNXLATE_BIT (gf_flags, flags, O_NOFOLLOW);
+ uint32_t flags = 0;
+
+ UNXLATE_ACCESSMODE(gf_flags, flags);
+
+ UNXLATE_BIT(gf_flags, flags, O_CREAT);
+ UNXLATE_BIT(gf_flags, flags, O_EXCL);
+ UNXLATE_BIT(gf_flags, flags, O_NOCTTY);
+ UNXLATE_BIT(gf_flags, flags, O_TRUNC);
+ UNXLATE_BIT(gf_flags, flags, O_APPEND);
+ UNXLATE_BIT(gf_flags, flags, O_NONBLOCK);
+ UNXLATE_BIT(gf_flags, flags, O_SYNC);
+ UNXLATE_BIT(gf_flags, flags, O_ASYNC);
+
+ UNXLATE_BIT(gf_flags, flags, O_DIRECT);
+ UNXLATE_BIT(gf_flags, flags, O_DIRECTORY);
+ UNXLATE_BIT(gf_flags, flags, O_NOFOLLOW);
#ifdef O_NOATIME
- UNXLATE_BIT (gf_flags, flags, O_NOATIME);
+ UNXLATE_BIT(gf_flags, flags, O_NOATIME);
#endif
#ifdef O_CLOEXEC
- UNXLATE_BIT (gf_flags, flags, O_CLOEXEC);
+ UNXLATE_BIT(gf_flags, flags, O_CLOEXEC);
#endif
- UNXLATE_BIT (gf_flags, flags, O_LARGEFILE);
- UNXLATE_BIT (gf_flags, flags, O_FMODE_EXEC);
+ UNXLATE_BIT(gf_flags, flags, O_LARGEFILE);
+ UNXLATE_BIT(gf_flags, flags, O_FMODE_EXEC);
- return flags;
+ return flags;
}
-
static inline void
-gf_statfs_to_statfs (struct gf_statfs *gf_stat, struct statvfs *stat)
+gf_statfs_to_statfs(struct gf_statfs *gf_stat, struct statvfs *stat)
{
- if (!stat || !gf_stat)
- return;
-
- stat->f_bsize = (gf_stat->bsize);
- stat->f_frsize = (gf_stat->frsize);
- stat->f_blocks = (gf_stat->blocks);
- stat->f_bfree = (gf_stat->bfree);
- stat->f_bavail = (gf_stat->bavail);
- stat->f_files = (gf_stat->files);
- stat->f_ffree = (gf_stat->ffree);
- stat->f_favail = (gf_stat->favail);
- stat->f_fsid = (gf_stat->fsid);
- stat->f_flag = (gf_stat->flag);
- stat->f_namemax = (gf_stat->namemax);
+ if (!stat || !gf_stat)
+ return;
+
+ stat->f_bsize = (gf_stat->bsize);
+ stat->f_frsize = (gf_stat->frsize);
+ stat->f_blocks = (gf_stat->blocks);
+ stat->f_bfree = (gf_stat->bfree);
+ stat->f_bavail = (gf_stat->bavail);
+ stat->f_files = (gf_stat->files);
+ stat->f_ffree = (gf_stat->ffree);
+ stat->f_favail = (gf_stat->favail);
+ stat->f_fsid = (gf_stat->fsid);
+ stat->f_flag = (gf_stat->flag);
+ stat->f_namemax = (gf_stat->namemax);
}
-
static inline void
-gf_statfs_from_statfs (struct gf_statfs *gf_stat, struct statvfs *stat)
+gf_statfs_from_statfs(struct gf_statfs *gf_stat, struct statvfs *stat)
{
- if (!stat || !gf_stat)
- return;
-
- gf_stat->bsize = stat->f_bsize;
- gf_stat->frsize = stat->f_frsize;
- gf_stat->blocks = stat->f_blocks;
- gf_stat->bfree = stat->f_bfree;
- gf_stat->bavail = stat->f_bavail;
- gf_stat->files = stat->f_files;
- gf_stat->ffree = stat->f_ffree;
- gf_stat->favail = stat->f_favail;
- gf_stat->fsid = stat->f_fsid;
- gf_stat->flag = stat->f_flag;
- gf_stat->namemax = stat->f_namemax;
+ if (!stat || !gf_stat)
+ return;
+
+ gf_stat->bsize = stat->f_bsize;
+ gf_stat->frsize = stat->f_frsize;
+ gf_stat->blocks = stat->f_blocks;
+ gf_stat->bfree = stat->f_bfree;
+ gf_stat->bavail = stat->f_bavail;
+ gf_stat->files = stat->f_files;
+ gf_stat->ffree = stat->f_ffree;
+ gf_stat->favail = stat->f_favail;
+ gf_stat->fsid = stat->f_fsid;
+ gf_stat->flag = stat->f_flag;
+ gf_stat->namemax = stat->f_namemax;
}
static inline void
-gf_proto_lease_to_lease (struct gf_proto_lease *gf_proto_lease, struct gf_lease *gf_lease)
+gf_proto_lease_to_lease(struct gf_proto_lease *gf_proto_lease,
+ struct gf_lease *gf_lease)
{
- if (!gf_lease || !gf_proto_lease)
- return;
+ if (!gf_lease || !gf_proto_lease)
+ return;
- gf_lease->cmd = gf_proto_lease->cmd;
- gf_lease->lease_type = gf_proto_lease->lease_type;
- memcpy (gf_lease->lease_id, gf_proto_lease->lease_id, LEASE_ID_SIZE);
+ gf_lease->cmd = gf_proto_lease->cmd;
+ gf_lease->lease_type = gf_proto_lease->lease_type;
+ memcpy(gf_lease->lease_id, gf_proto_lease->lease_id, LEASE_ID_SIZE);
}
static inline void
-gf_proto_lease_from_lease (struct gf_proto_lease *gf_proto_lease, struct gf_lease *gf_lease)
+gf_proto_lease_from_lease(struct gf_proto_lease *gf_proto_lease,
+ struct gf_lease *gf_lease)
{
- if (!gf_lease || !gf_proto_lease)
- return;
+ if (!gf_lease || !gf_proto_lease)
+ return;
- gf_proto_lease->cmd = gf_lease->cmd;
- gf_proto_lease->lease_type = gf_lease->lease_type;
- memcpy (gf_proto_lease->lease_id, gf_lease->lease_id, LEASE_ID_SIZE);
+ gf_proto_lease->cmd = gf_lease->cmd;
+ gf_proto_lease->lease_type = gf_lease->lease_type;
+ memcpy(gf_proto_lease->lease_id, gf_lease->lease_id, LEASE_ID_SIZE);
}
static inline int
-gf_proto_recall_lease_to_upcall (struct gfs3_recall_lease_req *recall_lease,
- struct gf_upcall *gf_up_data)
+gf_proto_recall_lease_to_upcall(struct gfs3_recall_lease_req *recall_lease,
+ struct gf_upcall *gf_up_data)
{
- struct gf_upcall_recall_lease *tmp = NULL;
- int ret = 0;
+ struct gf_upcall_recall_lease *tmp = NULL;
+ int ret = 0;
- GF_VALIDATE_OR_GOTO(THIS->name, recall_lease, out);
- GF_VALIDATE_OR_GOTO(THIS->name, gf_up_data, out);
+ GF_VALIDATE_OR_GOTO(THIS->name, recall_lease, out);
+ GF_VALIDATE_OR_GOTO(THIS->name, gf_up_data, out);
- tmp = (struct gf_upcall_recall_lease *)gf_up_data->data;
- tmp->lease_type = recall_lease->lease_type;
- memcpy (gf_up_data->gfid, recall_lease->gfid, 16);
- memcpy (tmp->tid, recall_lease->tid, 16);
+ tmp = (struct gf_upcall_recall_lease *)gf_up_data->data;
+ tmp->lease_type = recall_lease->lease_type;
+ memcpy(gf_up_data->gfid, recall_lease->gfid, 16);
+ memcpy(tmp->tid, recall_lease->tid, 16);
- GF_PROTOCOL_DICT_UNSERIALIZE (THIS, tmp->dict,
- (recall_lease->xdata).xdata_val,
- (recall_lease->xdata).xdata_len, ret,
- errno, out);
+ GF_PROTOCOL_DICT_UNSERIALIZE(
+ THIS, tmp->dict, (recall_lease->xdata).xdata_val,
+ (recall_lease->xdata).xdata_len, ret, errno, out);
out:
- return ret;
-
+ return ret;
}
static inline int
-gf_proto_recall_lease_from_upcall (xlator_t *this,
- struct gfs3_recall_lease_req *recall_lease,
- struct gf_upcall *gf_up_data)
+gf_proto_recall_lease_from_upcall(xlator_t *this,
+ struct gfs3_recall_lease_req *recall_lease,
+ struct gf_upcall *gf_up_data)
{
- struct gf_upcall_recall_lease *tmp = NULL;
- int ret = 0;
+ struct gf_upcall_recall_lease *tmp = NULL;
+ int ret = 0;
- GF_VALIDATE_OR_GOTO(this->name, recall_lease, out);
- GF_VALIDATE_OR_GOTO(this->name, gf_up_data, out);
+ GF_VALIDATE_OR_GOTO(this->name, recall_lease, out);
+ GF_VALIDATE_OR_GOTO(this->name, gf_up_data, out);
- tmp = (struct gf_upcall_recall_lease *)gf_up_data->data;
- recall_lease->lease_type = tmp->lease_type;
- memcpy (recall_lease->gfid, gf_up_data->gfid, 16);
- memcpy (recall_lease->tid, tmp->tid, 16);
+ tmp = (struct gf_upcall_recall_lease *)gf_up_data->data;
+ recall_lease->lease_type = tmp->lease_type;
+ memcpy(recall_lease->gfid, gf_up_data->gfid, 16);
+ memcpy(recall_lease->tid, tmp->tid, 16);
- GF_PROTOCOL_DICT_SERIALIZE (this, tmp->dict,
- &(recall_lease->xdata).xdata_val,
- (recall_lease->xdata).xdata_len, ret, out);
+ GF_PROTOCOL_DICT_SERIALIZE(this, tmp->dict,
+ &(recall_lease->xdata).xdata_val,
+ (recall_lease->xdata).xdata_len, ret, out);
out:
- return ret;
-
+ return ret;
}
static inline void
-gf_proto_flock_to_flock (struct gf_proto_flock *gf_proto_flock, struct gf_flock *gf_flock)
+gf_proto_flock_to_flock(struct gf_proto_flock *gf_proto_flock,
+ struct gf_flock *gf_flock)
{
- if (!gf_flock || !gf_proto_flock)
- return;
-
- gf_flock->l_type = gf_proto_flock->type;
- gf_flock->l_whence = gf_proto_flock->whence;
- gf_flock->l_start = gf_proto_flock->start;
- gf_flock->l_len = gf_proto_flock->len;
- gf_flock->l_pid = gf_proto_flock->pid;
- gf_flock->l_owner.len = gf_proto_flock->lk_owner.lk_owner_len;
- if (gf_flock->l_owner.len &&
- (gf_flock->l_owner.len < GF_MAX_LOCK_OWNER_LEN))
- memcpy (gf_flock->l_owner.data, gf_proto_flock->lk_owner.lk_owner_val,
- gf_flock->l_owner.len);
+ if (!gf_flock || !gf_proto_flock)
+ return;
+
+ gf_flock->l_type = gf_proto_flock->type;
+ gf_flock->l_whence = gf_proto_flock->whence;
+ gf_flock->l_start = gf_proto_flock->start;
+ gf_flock->l_len = gf_proto_flock->len;
+ gf_flock->l_pid = gf_proto_flock->pid;
+ gf_flock->l_owner.len = gf_proto_flock->lk_owner.lk_owner_len;
+ if (gf_flock->l_owner.len &&
+ (gf_flock->l_owner.len < GF_MAX_LOCK_OWNER_LEN))
+ memcpy(gf_flock->l_owner.data, gf_proto_flock->lk_owner.lk_owner_val,
+ gf_flock->l_owner.len);
}
-
static inline void
-gf_proto_flock_from_flock (struct gf_proto_flock *gf_proto_flock, struct gf_flock *gf_flock)
+gf_proto_flock_from_flock(struct gf_proto_flock *gf_proto_flock,
+ struct gf_flock *gf_flock)
{
- if (!gf_flock || !gf_proto_flock)
- return;
-
- gf_proto_flock->type = (gf_flock->l_type);
- gf_proto_flock->whence = (gf_flock->l_whence);
- gf_proto_flock->start = (gf_flock->l_start);
- gf_proto_flock->len = (gf_flock->l_len);
- gf_proto_flock->pid = (gf_flock->l_pid);
- gf_proto_flock->lk_owner.lk_owner_len = gf_flock->l_owner.len;
- if (gf_flock->l_owner.len)
- gf_proto_flock->lk_owner.lk_owner_val = gf_flock->l_owner.data;
+ if (!gf_flock || !gf_proto_flock)
+ return;
+
+ gf_proto_flock->type = (gf_flock->l_type);
+ gf_proto_flock->whence = (gf_flock->l_whence);
+ gf_proto_flock->start = (gf_flock->l_start);
+ gf_proto_flock->len = (gf_flock->l_len);
+ gf_proto_flock->pid = (gf_flock->l_pid);
+ gf_proto_flock->lk_owner.lk_owner_len = gf_flock->l_owner.len;
+ if (gf_flock->l_owner.len)
+ gf_proto_flock->lk_owner.lk_owner_val = gf_flock->l_owner.data;
}
static inline void
-gf_stat_to_iatt (struct gf_iatt *gf_stat, struct iatt *iatt)
+gf_stat_to_iatt(struct gf_iatt *gf_stat, struct iatt *iatt)
{
- if (!iatt || !gf_stat)
- return;
-
- memcpy (iatt->ia_gfid, gf_stat->ia_gfid, 16);
- iatt->ia_ino = gf_stat->ia_ino ;
- iatt->ia_dev = gf_stat->ia_dev ;
- iatt->ia_type = ia_type_from_st_mode (gf_stat->mode) ;
- iatt->ia_prot = ia_prot_from_st_mode (gf_stat->mode) ;
- iatt->ia_nlink = gf_stat->ia_nlink ;
- iatt->ia_uid = gf_stat->ia_uid ;
- iatt->ia_gid = gf_stat->ia_gid ;
- iatt->ia_rdev = gf_stat->ia_rdev ;
- iatt->ia_size = gf_stat->ia_size ;
- iatt->ia_blksize = gf_stat->ia_blksize ;
- iatt->ia_blocks = gf_stat->ia_blocks ;
- iatt->ia_atime = gf_stat->ia_atime ;
- iatt->ia_atime_nsec = gf_stat->ia_atime_nsec ;
- iatt->ia_mtime = gf_stat->ia_mtime ;
- iatt->ia_mtime_nsec = gf_stat->ia_mtime_nsec ;
- iatt->ia_ctime = gf_stat->ia_ctime ;
- iatt->ia_ctime_nsec = gf_stat->ia_ctime_nsec ;
+ if (!iatt || !gf_stat)
+ return;
+
+ memcpy(iatt->ia_gfid, gf_stat->ia_gfid, 16);
+ iatt->ia_ino = gf_stat->ia_ino;
+ iatt->ia_dev = gf_stat->ia_dev;
+ iatt->ia_type = ia_type_from_st_mode(gf_stat->mode);
+ iatt->ia_prot = ia_prot_from_st_mode(gf_stat->mode);
+ iatt->ia_nlink = gf_stat->ia_nlink;
+ iatt->ia_uid = gf_stat->ia_uid;
+ iatt->ia_gid = gf_stat->ia_gid;
+ iatt->ia_rdev = gf_stat->ia_rdev;
+ iatt->ia_size = gf_stat->ia_size;
+ iatt->ia_blksize = gf_stat->ia_blksize;
+ iatt->ia_blocks = gf_stat->ia_blocks;
+ iatt->ia_atime = gf_stat->ia_atime;
+ iatt->ia_atime_nsec = gf_stat->ia_atime_nsec;
+ iatt->ia_mtime = gf_stat->ia_mtime;
+ iatt->ia_mtime_nsec = gf_stat->ia_mtime_nsec;
+ iatt->ia_ctime = gf_stat->ia_ctime;
+ iatt->ia_ctime_nsec = gf_stat->ia_ctime_nsec;
}
static inline void
-gf_stat_from_iatt (struct gf_iatt *gf_stat, struct iatt *iatt)
+gf_stat_from_iatt(struct gf_iatt *gf_stat, struct iatt *iatt)
{
- if (!iatt || !gf_stat)
- return;
-
- memcpy (gf_stat->ia_gfid, iatt->ia_gfid, 16);
- gf_stat->ia_ino = iatt->ia_ino ;
- gf_stat->ia_dev = iatt->ia_dev ;
- gf_stat->mode = st_mode_from_ia (iatt->ia_prot, iatt->ia_type);
- gf_stat->ia_nlink = iatt->ia_nlink ;
- gf_stat->ia_uid = iatt->ia_uid ;
- gf_stat->ia_gid = iatt->ia_gid ;
- gf_stat->ia_rdev = iatt->ia_rdev ;
- gf_stat->ia_size = iatt->ia_size ;
- gf_stat->ia_blksize = iatt->ia_blksize ;
- gf_stat->ia_blocks = iatt->ia_blocks ;
- gf_stat->ia_atime = iatt->ia_atime ;
- gf_stat->ia_atime_nsec = iatt->ia_atime_nsec ;
- gf_stat->ia_mtime = iatt->ia_mtime ;
- gf_stat->ia_mtime_nsec = iatt->ia_mtime_nsec ;
- gf_stat->ia_ctime = iatt->ia_ctime ;
- gf_stat->ia_ctime_nsec = iatt->ia_ctime_nsec ;
+ if (!iatt || !gf_stat)
+ return;
+
+ memcpy(gf_stat->ia_gfid, iatt->ia_gfid, 16);
+ gf_stat->ia_ino = iatt->ia_ino;
+ gf_stat->ia_dev = iatt->ia_dev;
+ gf_stat->mode = st_mode_from_ia(iatt->ia_prot, iatt->ia_type);
+ gf_stat->ia_nlink = iatt->ia_nlink;
+ gf_stat->ia_uid = iatt->ia_uid;
+ gf_stat->ia_gid = iatt->ia_gid;
+ gf_stat->ia_rdev = iatt->ia_rdev;
+ gf_stat->ia_size = iatt->ia_size;
+ gf_stat->ia_blksize = iatt->ia_blksize;
+ gf_stat->ia_blocks = iatt->ia_blocks;
+ gf_stat->ia_atime = iatt->ia_atime;
+ gf_stat->ia_atime_nsec = iatt->ia_atime_nsec;
+ gf_stat->ia_mtime = iatt->ia_mtime;
+ gf_stat->ia_mtime_nsec = iatt->ia_mtime_nsec;
+ gf_stat->ia_ctime = iatt->ia_ctime;
+ gf_stat->ia_ctime_nsec = iatt->ia_ctime_nsec;
}
static inline int
-gf_proto_cache_invalidation_from_upcall (xlator_t *this,
- gfs3_cbk_cache_invalidation_req *gf_c_req,
- struct gf_upcall *gf_up_data)
+gf_proto_cache_invalidation_from_upcall(
+ xlator_t *this, gfs3_cbk_cache_invalidation_req *gf_c_req,
+ struct gf_upcall *gf_up_data)
{
- struct gf_upcall_cache_invalidation *gf_c_data = NULL;
- int is_cache_inval = 0;
- int ret = -1;
-
- GF_VALIDATE_OR_GOTO(this->name, gf_c_req, out);
- GF_VALIDATE_OR_GOTO(this->name, gf_up_data, out);
-
- is_cache_inval = ((gf_up_data->event_type ==
- GF_UPCALL_CACHE_INVALIDATION) ? 1 : 0);
- GF_VALIDATE_OR_GOTO(this->name, is_cache_inval, out);
-
- gf_c_data = (struct gf_upcall_cache_invalidation *)gf_up_data->data;
- GF_VALIDATE_OR_GOTO(this->name, gf_c_data, out);
-
- gf_c_req->gfid = uuid_utoa (gf_up_data->gfid);
- gf_c_req->event_type = gf_up_data->event_type;
- gf_c_req->flags = gf_c_data->flags;
- gf_c_req->expire_time_attr = gf_c_data->expire_time_attr;
- gf_stat_from_iatt (&gf_c_req->stat, &gf_c_data->stat);
- gf_stat_from_iatt (&gf_c_req->parent_stat, &gf_c_data->p_stat);
- gf_stat_from_iatt (&gf_c_req->oldparent_stat, &gf_c_data->oldp_stat);
-
- ret = 0;
- GF_PROTOCOL_DICT_SERIALIZE (this, gf_c_data->dict, &(gf_c_req->xdata).xdata_val,
- (gf_c_req->xdata).xdata_len, ret, out);
+ struct gf_upcall_cache_invalidation *gf_c_data = NULL;
+ int is_cache_inval = 0;
+ int ret = -1;
+
+ GF_VALIDATE_OR_GOTO(this->name, gf_c_req, out);
+ GF_VALIDATE_OR_GOTO(this->name, gf_up_data, out);
+
+ is_cache_inval = ((gf_up_data->event_type == GF_UPCALL_CACHE_INVALIDATION)
+ ? 1
+ : 0);
+ GF_VALIDATE_OR_GOTO(this->name, is_cache_inval, out);
+
+ gf_c_data = (struct gf_upcall_cache_invalidation *)gf_up_data->data;
+ GF_VALIDATE_OR_GOTO(this->name, gf_c_data, out);
+
+ gf_c_req->gfid = uuid_utoa(gf_up_data->gfid);
+ gf_c_req->event_type = gf_up_data->event_type;
+ gf_c_req->flags = gf_c_data->flags;
+ gf_c_req->expire_time_attr = gf_c_data->expire_time_attr;
+ gf_stat_from_iatt(&gf_c_req->stat, &gf_c_data->stat);
+ gf_stat_from_iatt(&gf_c_req->parent_stat, &gf_c_data->p_stat);
+ gf_stat_from_iatt(&gf_c_req->oldparent_stat, &gf_c_data->oldp_stat);
+
+ ret = 0;
+ GF_PROTOCOL_DICT_SERIALIZE(this, gf_c_data->dict,
+ &(gf_c_req->xdata).xdata_val,
+ (gf_c_req->xdata).xdata_len, ret, out);
out:
- return ret;
+ return ret;
}
static inline int
-gf_proto_cache_invalidation_to_upcall (xlator_t *this,
- gfs3_cbk_cache_invalidation_req *gf_c_req,
- struct gf_upcall *gf_up_data)
+gf_proto_cache_invalidation_to_upcall(xlator_t *this,
+ gfs3_cbk_cache_invalidation_req *gf_c_req,
+ struct gf_upcall *gf_up_data)
{
- struct gf_upcall_cache_invalidation *gf_c_data = NULL;
- int ret = -1;
-
- GF_VALIDATE_OR_GOTO(this->name, gf_c_req, out);
- GF_VALIDATE_OR_GOTO(this->name, gf_up_data, out);
-
- gf_c_data = (struct gf_upcall_cache_invalidation *)gf_up_data->data;
- GF_VALIDATE_OR_GOTO(this->name, gf_c_data, out);
-
- ret = gf_uuid_parse (gf_c_req->gfid, gf_up_data->gfid);
- if (ret) {
- gf_log (this->name, GF_LOG_WARNING, "gf_uuid_parse(%s) failed",
- gf_c_req->gfid);
- gf_up_data->event_type = GF_UPCALL_EVENT_NULL;
- goto out;
- }
-
- gf_up_data->event_type = gf_c_req->event_type;
-
- gf_c_data->flags = gf_c_req->flags;
- gf_c_data->expire_time_attr = gf_c_req->expire_time_attr;
- gf_stat_to_iatt (&gf_c_req->stat, &gf_c_data->stat);
- gf_stat_to_iatt (&gf_c_req->parent_stat, &gf_c_data->p_stat);
- gf_stat_to_iatt (&gf_c_req->oldparent_stat, &gf_c_data->oldp_stat);
-
- ret = 0;
- GF_PROTOCOL_DICT_UNSERIALIZE (this, gf_c_data->dict,
- (gf_c_req->xdata).xdata_val,
- (gf_c_req->xdata).xdata_len, ret,
- ret, out);
-
- /* If no dict was sent, create an empty dict, so that each xlator
- * need not check if empty then create new dict. Will be unref'd by the
- * caller */
- if (!gf_c_data->dict)
- gf_c_data->dict = dict_new ();
- out:
- return ret;
+ struct gf_upcall_cache_invalidation *gf_c_data = NULL;
+ int ret = -1;
+
+ GF_VALIDATE_OR_GOTO(this->name, gf_c_req, out);
+ GF_VALIDATE_OR_GOTO(this->name, gf_up_data, out);
+
+ gf_c_data = (struct gf_upcall_cache_invalidation *)gf_up_data->data;
+ GF_VALIDATE_OR_GOTO(this->name, gf_c_data, out);
+
+ ret = gf_uuid_parse(gf_c_req->gfid, gf_up_data->gfid);
+ if (ret) {
+ gf_log(this->name, GF_LOG_WARNING, "gf_uuid_parse(%s) failed",
+ gf_c_req->gfid);
+ gf_up_data->event_type = GF_UPCALL_EVENT_NULL;
+ goto out;
+ }
+
+ gf_up_data->event_type = gf_c_req->event_type;
+
+ gf_c_data->flags = gf_c_req->flags;
+ gf_c_data->expire_time_attr = gf_c_req->expire_time_attr;
+ gf_stat_to_iatt(&gf_c_req->stat, &gf_c_data->stat);
+ gf_stat_to_iatt(&gf_c_req->parent_stat, &gf_c_data->p_stat);
+ gf_stat_to_iatt(&gf_c_req->oldparent_stat, &gf_c_data->oldp_stat);
+
+ ret = 0;
+ GF_PROTOCOL_DICT_UNSERIALIZE(this, gf_c_data->dict,
+ (gf_c_req->xdata).xdata_val,
+ (gf_c_req->xdata).xdata_len, ret, ret, out);
+
+ /* If no dict was sent, create an empty dict, so that each xlator
+ * need not check if empty then create new dict. Will be unref'd by the
+ * caller */
+ if (!gf_c_data->dict)
+ gf_c_data->dict = dict_new();
+out:
+ return ret;
}
static inline int
-gf_proto_inodelk_contention_to_upcall (struct gfs4_inodelk_contention_req *lc,
- struct gf_upcall *gf_up_data)
+gf_proto_inodelk_contention_to_upcall(struct gfs4_inodelk_contention_req *lc,
+ struct gf_upcall *gf_up_data)
{
- struct gf_upcall_inodelk_contention *tmp = NULL;
- xlator_t *this = NULL;
- int ret = -1;
- int op_errno = EINVAL;
+ struct gf_upcall_inodelk_contention *tmp = NULL;
+ xlator_t *this = NULL;
+ int ret = -1;
+ int op_errno = EINVAL;
- this = THIS;
+ this = THIS;
- GF_VALIDATE_OR_GOTO(this->name, lc, out);
- GF_VALIDATE_OR_GOTO(this->name, gf_up_data, out);
+ GF_VALIDATE_OR_GOTO(this->name, lc, out);
+ GF_VALIDATE_OR_GOTO(this->name, gf_up_data, out);
- tmp = (struct gf_upcall_inodelk_contention *)gf_up_data->data;
+ tmp = (struct gf_upcall_inodelk_contention *)gf_up_data->data;
- gf_uuid_copy(gf_up_data->gfid, (unsigned char *)lc->gfid);
+ gf_uuid_copy(gf_up_data->gfid, (unsigned char *)lc->gfid);
- gf_proto_flock_to_flock(&lc->flock, &tmp->flock);
- tmp->pid = lc->pid;
- tmp->domain = lc->domain;
- if ((tmp->domain != NULL) && (*tmp->domain == 0)) {
- tmp->domain = NULL;
- }
+ gf_proto_flock_to_flock(&lc->flock, &tmp->flock);
+ tmp->pid = lc->pid;
+ tmp->domain = lc->domain;
+ if ((tmp->domain != NULL) && (*tmp->domain == 0)) {
+ tmp->domain = NULL;
+ }
- GF_PROTOCOL_DICT_UNSERIALIZE (this, tmp->xdata, lc->xdata.xdata_val,
- lc->xdata.xdata_len, ret, op_errno, out);
+ GF_PROTOCOL_DICT_UNSERIALIZE(this, tmp->xdata, lc->xdata.xdata_val,
+ lc->xdata.xdata_len, ret, op_errno, out);
- ret = 0;
+ ret = 0;
out:
- if (ret < 0) {
- ret = -op_errno;
- }
+ if (ret < 0) {
+ ret = -op_errno;
+ }
- return ret;
+ return ret;
}
static inline int
-gf_proto_inodelk_contention_from_upcall (xlator_t *this,
- struct gfs4_inodelk_contention_req *lc,
- struct gf_upcall *gf_up_data)
+gf_proto_inodelk_contention_from_upcall(xlator_t *this,
+ struct gfs4_inodelk_contention_req *lc,
+ struct gf_upcall *gf_up_data)
{
- struct gf_upcall_inodelk_contention *tmp = NULL;
- int ret = -1;
- int op_errno = EINVAL;
+ struct gf_upcall_inodelk_contention *tmp = NULL;
+ int ret = -1;
+ int op_errno = EINVAL;
- GF_VALIDATE_OR_GOTO(this->name, lc, out);
- GF_VALIDATE_OR_GOTO(this->name, gf_up_data, out);
+ GF_VALIDATE_OR_GOTO(this->name, lc, out);
+ GF_VALIDATE_OR_GOTO(this->name, gf_up_data, out);
- tmp = (struct gf_upcall_inodelk_contention *)gf_up_data->data;
+ tmp = (struct gf_upcall_inodelk_contention *)gf_up_data->data;
- gf_uuid_copy((unsigned char *)lc->gfid, gf_up_data->gfid);
+ gf_uuid_copy((unsigned char *)lc->gfid, gf_up_data->gfid);
- gf_proto_flock_from_flock(&lc->flock, &tmp->flock);
- lc->pid = tmp->pid;
- lc->domain = (char *)tmp->domain;
- if (lc->domain == NULL) {
- lc->domain = "";
- }
+ gf_proto_flock_from_flock(&lc->flock, &tmp->flock);
+ lc->pid = tmp->pid;
+ lc->domain = (char *)tmp->domain;
+ if (lc->domain == NULL) {
+ lc->domain = "";
+ }
- GF_PROTOCOL_DICT_SERIALIZE (this, tmp->xdata, &lc->xdata.xdata_val,
- lc->xdata.xdata_len, op_errno, out);
+ GF_PROTOCOL_DICT_SERIALIZE(this, tmp->xdata, &lc->xdata.xdata_val,
+ lc->xdata.xdata_len, op_errno, out);
- ret = 0;
+ ret = 0;
out:
- if (ret < 0) {
- ret = -op_errno;
- }
+ if (ret < 0) {
+ ret = -op_errno;
+ }
- return ret;
+ return ret;
}
static inline int
-gf_proto_entrylk_contention_to_upcall (struct gfs4_entrylk_contention_req *lc,
- struct gf_upcall *gf_up_data)
+gf_proto_entrylk_contention_to_upcall(struct gfs4_entrylk_contention_req *lc,
+ struct gf_upcall *gf_up_data)
{
- struct gf_upcall_entrylk_contention *tmp = NULL;
- xlator_t *this = NULL;
- int ret = -1;
- int op_errno = EINVAL;
+ struct gf_upcall_entrylk_contention *tmp = NULL;
+ xlator_t *this = NULL;
+ int ret = -1;
+ int op_errno = EINVAL;
- this = THIS;
+ this = THIS;
- GF_VALIDATE_OR_GOTO(this->name, lc, out);
- GF_VALIDATE_OR_GOTO(this->name, gf_up_data, out);
+ GF_VALIDATE_OR_GOTO(this->name, lc, out);
+ GF_VALIDATE_OR_GOTO(this->name, gf_up_data, out);
- tmp = (struct gf_upcall_entrylk_contention *)gf_up_data->data;
+ tmp = (struct gf_upcall_entrylk_contention *)gf_up_data->data;
- gf_uuid_copy(gf_up_data->gfid, (unsigned char *)lc->gfid);
+ gf_uuid_copy(gf_up_data->gfid, (unsigned char *)lc->gfid);
- tmp->type = lc->type;
- tmp->name = lc->name;
- if ((tmp->name != NULL) && (*tmp->name == 0)) {
- tmp->name = NULL;
- }
- tmp->pid = lc->pid;
- tmp->domain = lc->domain;
- if ((tmp->domain != NULL) && (*tmp->domain == 0)) {
- tmp->domain = NULL;
- }
+ tmp->type = lc->type;
+ tmp->name = lc->name;
+ if ((tmp->name != NULL) && (*tmp->name == 0)) {
+ tmp->name = NULL;
+ }
+ tmp->pid = lc->pid;
+ tmp->domain = lc->domain;
+ if ((tmp->domain != NULL) && (*tmp->domain == 0)) {
+ tmp->domain = NULL;
+ }
- GF_PROTOCOL_DICT_UNSERIALIZE (this, tmp->xdata, lc->xdata.xdata_val,
- lc->xdata.xdata_len, ret, op_errno, out);
+ GF_PROTOCOL_DICT_UNSERIALIZE(this, tmp->xdata, lc->xdata.xdata_val,
+ lc->xdata.xdata_len, ret, op_errno, out);
- ret = 0;
+ ret = 0;
out:
- if (ret < 0) {
- ret = -op_errno;
- }
+ if (ret < 0) {
+ ret = -op_errno;
+ }
- return ret;
+ return ret;
}
static inline int
-gf_proto_entrylk_contention_from_upcall (xlator_t *this,
- struct gfs4_entrylk_contention_req *lc,
- struct gf_upcall *gf_up_data)
+gf_proto_entrylk_contention_from_upcall(xlator_t *this,
+ struct gfs4_entrylk_contention_req *lc,
+ struct gf_upcall *gf_up_data)
{
- struct gf_upcall_entrylk_contention *tmp = NULL;
- int ret = -1;
- int op_errno = EINVAL;
+ struct gf_upcall_entrylk_contention *tmp = NULL;
+ int ret = -1;
+ int op_errno = EINVAL;
- GF_VALIDATE_OR_GOTO(this->name, lc, out);
- GF_VALIDATE_OR_GOTO(this->name, gf_up_data, out);
+ GF_VALIDATE_OR_GOTO(this->name, lc, out);
+ GF_VALIDATE_OR_GOTO(this->name, gf_up_data, out);
- tmp = (struct gf_upcall_entrylk_contention *)gf_up_data->data;
+ tmp = (struct gf_upcall_entrylk_contention *)gf_up_data->data;
- gf_uuid_copy((unsigned char *)lc->gfid, gf_up_data->gfid);
+ gf_uuid_copy((unsigned char *)lc->gfid, gf_up_data->gfid);
- lc->type = tmp->type;
- lc->name = (char *)tmp->name;
- if (lc->name == NULL) {
- lc->name = "";
- }
- lc->pid = tmp->pid;
- lc->domain = (char *)tmp->domain;
- if (lc->domain == NULL) {
- lc->domain = "";
- }
+ lc->type = tmp->type;
+ lc->name = (char *)tmp->name;
+ if (lc->name == NULL) {
+ lc->name = "";
+ }
+ lc->pid = tmp->pid;
+ lc->domain = (char *)tmp->domain;
+ if (lc->domain == NULL) {
+ lc->domain = "";
+ }
- GF_PROTOCOL_DICT_SERIALIZE (this, tmp->xdata, &lc->xdata.xdata_val,
- lc->xdata.xdata_len, op_errno, out);
+ GF_PROTOCOL_DICT_SERIALIZE(this, tmp->xdata, &lc->xdata.xdata_val,
+ lc->xdata.xdata_len, op_errno, out);
- ret = 0;
+ ret = 0;
out:
- if (ret < 0) {
- ret = -op_errno;
- }
+ if (ret < 0) {
+ ret = -op_errno;
+ }
- return ret;
+ return ret;
}
static inline void
-gfx_stat_to_iattx (struct gfx_iattx *gf_stat, struct iatt *iatt)
+gfx_stat_to_iattx(struct gfx_iattx *gf_stat, struct iatt *iatt)
{
- if (!iatt || !gf_stat)
- return;
-
- memcpy (iatt->ia_gfid, gf_stat->ia_gfid, 16);
-
- iatt->ia_flags = gf_stat->ia_flags;
- iatt->ia_ino = gf_stat->ia_ino ;
- iatt->ia_dev = gf_stat->ia_dev ;
- iatt->ia_rdev = gf_stat->ia_rdev ;
- iatt->ia_size = gf_stat->ia_size ;
- iatt->ia_nlink = gf_stat->ia_nlink ;
- iatt->ia_uid = gf_stat->ia_uid ;
- iatt->ia_gid = gf_stat->ia_gid ;
- iatt->ia_blksize = gf_stat->ia_blksize ;
- iatt->ia_blocks = gf_stat->ia_blocks ;
- iatt->ia_atime = gf_stat->ia_atime ;
- iatt->ia_atime_nsec = gf_stat->ia_atime_nsec ;
- iatt->ia_mtime = gf_stat->ia_mtime ;
- iatt->ia_mtime_nsec = gf_stat->ia_mtime_nsec ;
- iatt->ia_ctime = gf_stat->ia_ctime ;
- iatt->ia_ctime_nsec = gf_stat->ia_ctime_nsec ;
- iatt->ia_btime = gf_stat->ia_btime ;
- iatt->ia_btime_nsec = gf_stat->ia_btime_nsec ;
- iatt->ia_attributes = gf_stat->ia_attributes;
- iatt->ia_attributes_mask = gf_stat->ia_attributes_mask;
-
- iatt->ia_type = ia_type_from_st_mode (gf_stat->mode);
- iatt->ia_prot = ia_prot_from_st_mode (gf_stat->mode);
+ if (!iatt || !gf_stat)
+ return;
+
+ memcpy(iatt->ia_gfid, gf_stat->ia_gfid, 16);
+
+ iatt->ia_flags = gf_stat->ia_flags;
+ iatt->ia_ino = gf_stat->ia_ino;
+ iatt->ia_dev = gf_stat->ia_dev;
+ iatt->ia_rdev = gf_stat->ia_rdev;
+ iatt->ia_size = gf_stat->ia_size;
+ iatt->ia_nlink = gf_stat->ia_nlink;
+ iatt->ia_uid = gf_stat->ia_uid;
+ iatt->ia_gid = gf_stat->ia_gid;
+ iatt->ia_blksize = gf_stat->ia_blksize;
+ iatt->ia_blocks = gf_stat->ia_blocks;
+ iatt->ia_atime = gf_stat->ia_atime;
+ iatt->ia_atime_nsec = gf_stat->ia_atime_nsec;
+ iatt->ia_mtime = gf_stat->ia_mtime;
+ iatt->ia_mtime_nsec = gf_stat->ia_mtime_nsec;
+ iatt->ia_ctime = gf_stat->ia_ctime;
+ iatt->ia_ctime_nsec = gf_stat->ia_ctime_nsec;
+ iatt->ia_btime = gf_stat->ia_btime;
+ iatt->ia_btime_nsec = gf_stat->ia_btime_nsec;
+ iatt->ia_attributes = gf_stat->ia_attributes;
+ iatt->ia_attributes_mask = gf_stat->ia_attributes_mask;
+
+ iatt->ia_type = ia_type_from_st_mode(gf_stat->mode);
+ iatt->ia_prot = ia_prot_from_st_mode(gf_stat->mode);
}
-
static inline void
-gfx_stat_from_iattx (struct gfx_iattx *gf_stat, struct iatt *iatt)
+gfx_stat_from_iattx(struct gfx_iattx *gf_stat, struct iatt *iatt)
{
- if (!iatt || !gf_stat)
- return;
-
- memcpy (gf_stat->ia_gfid, iatt->ia_gfid, 16);
- gf_stat->ia_ino = iatt->ia_ino ;
- gf_stat->ia_dev = iatt->ia_dev ;
-
- gf_stat->ia_nlink = iatt->ia_nlink ;
- gf_stat->ia_uid = iatt->ia_uid ;
- gf_stat->ia_gid = iatt->ia_gid ;
- gf_stat->ia_rdev = iatt->ia_rdev ;
- gf_stat->ia_size = iatt->ia_size ;
- gf_stat->ia_blksize = iatt->ia_blksize ;
- gf_stat->ia_blocks = iatt->ia_blocks ;
- gf_stat->ia_atime = iatt->ia_atime ;
- gf_stat->ia_atime_nsec = iatt->ia_atime_nsec ;
- gf_stat->ia_mtime = iatt->ia_mtime ;
- gf_stat->ia_mtime_nsec = iatt->ia_mtime_nsec ;
- gf_stat->ia_ctime = iatt->ia_ctime ;
- gf_stat->ia_ctime_nsec = iatt->ia_ctime_nsec ;
-
- gf_stat->ia_flags = iatt->ia_flags;
- gf_stat->ia_btime = iatt->ia_btime ;
- gf_stat->ia_btime_nsec = iatt->ia_btime_nsec ;
- gf_stat->ia_attributes = iatt->ia_attributes;
- gf_stat->ia_attributes_mask = iatt->ia_attributes_mask;
-
- gf_stat->mode = st_mode_from_ia (iatt->ia_prot, iatt->ia_type);
+ if (!iatt || !gf_stat)
+ return;
+
+ memcpy(gf_stat->ia_gfid, iatt->ia_gfid, 16);
+ gf_stat->ia_ino = iatt->ia_ino;
+ gf_stat->ia_dev = iatt->ia_dev;
+
+ gf_stat->ia_nlink = iatt->ia_nlink;
+ gf_stat->ia_uid = iatt->ia_uid;
+ gf_stat->ia_gid = iatt->ia_gid;
+ gf_stat->ia_rdev = iatt->ia_rdev;
+ gf_stat->ia_size = iatt->ia_size;
+ gf_stat->ia_blksize = iatt->ia_blksize;
+ gf_stat->ia_blocks = iatt->ia_blocks;
+ gf_stat->ia_atime = iatt->ia_atime;
+ gf_stat->ia_atime_nsec = iatt->ia_atime_nsec;
+ gf_stat->ia_mtime = iatt->ia_mtime;
+ gf_stat->ia_mtime_nsec = iatt->ia_mtime_nsec;
+ gf_stat->ia_ctime = iatt->ia_ctime;
+ gf_stat->ia_ctime_nsec = iatt->ia_ctime_nsec;
+
+ gf_stat->ia_flags = iatt->ia_flags;
+ gf_stat->ia_btime = iatt->ia_btime;
+ gf_stat->ia_btime_nsec = iatt->ia_btime_nsec;
+ gf_stat->ia_attributes = iatt->ia_attributes;
+ gf_stat->ia_attributes_mask = iatt->ia_attributes_mask;
+
+ gf_stat->mode = st_mode_from_ia(iatt->ia_prot, iatt->ia_type);
}
/* dict_to_xdr () */
static inline int
-dict_to_xdr (dict_t *this, gfx_dict *dict)
+dict_to_xdr(dict_t *this, gfx_dict *dict)
{
- int ret = -1;
- int i = 0;
- int index = 0;
- data_pair_t *dpair = NULL;
- gfx_dict_pair *xpair = NULL;
- ssize_t size = 0;
-
- /* This is a failure as we expect destination to be valid */
- if (!dict)
- goto out;
-
- /* This is OK as dictionary can be null, in which case, destination
- should also know that it is NULL. */
- if (!this) {
- /* encode special meaning data here,
- while decoding, you know it is NULL dict */
- dict->count = -1;
- /* everything else is normal */
- dict->pairs.pairs_len = 0;
- ret = 0;
- goto out;
- }
-
- /* Do the whole operation in locked region */
- LOCK (&this->lock);
-
- dict->pairs.pairs_val = GF_CALLOC (1, (this->count *
- sizeof (gfx_dict_pair)),
- gf_common_mt_char);
- if (!dict->pairs.pairs_val)
- goto out;
-
- dpair = this->members_list;
- for (i = 0; i < this->count; i++) {
- xpair = &dict->pairs.pairs_val[index];
-
- xpair->key.key_val = dpair->key;
- xpair->key.key_len = strlen (dpair->key) + 1;
- xpair->value.type = dpair->value->data_type;
- switch (dpair->value->data_type) {
- /* Add more type here */
- case GF_DATA_TYPE_INT:
- index++;
- xpair->value.gfx_value_u.value_int =
- strtoll (dpair->value->data, NULL, 0);
- break;
- case GF_DATA_TYPE_UINT:
- index++;
- xpair->value.gfx_value_u.value_uint =
- strtoull (dpair->value->data, NULL, 0);
- break;
- case GF_DATA_TYPE_DOUBLE:
- index++;
- xpair->value.gfx_value_u.value_dbl =
- strtod (dpair->value->data, NULL);
- break;
- case GF_DATA_TYPE_STR:
- index++;
- xpair->value.gfx_value_u.val_string.val_string_val = dpair->value->data;
- xpair->value.gfx_value_u.val_string.val_string_len = dpair->value->len;
- break;
- case GF_DATA_TYPE_IATT:
- index++;
- gfx_stat_from_iattx (&xpair->value.gfx_value_u.iatt,
- (struct iatt *)dpair->value->data);
- break;
- case GF_DATA_TYPE_GFUUID:
- index++;
- memcpy (&xpair->value.gfx_value_u.uuid,
- dpair->value->data, sizeof (uuid_t));
- break;
-
- case GF_DATA_TYPE_PTR:
- index++;
- /* Ideally, each type of data stored in dictionary
- should have type. A pointer type shouldn't be
- sent on wire */
-
- /* This is done for backward compatibility as dict is
- heavily used for transporting data over wire.
- Ideally, wherever there is an issue, fix and
- move on */
- xpair->value.gfx_value_u.other.other_val =
- dpair->value->data;
- xpair->value.gfx_value_u.other.other_len =
- dpair->value->len;
-
- /* Change this to INFO, after taking the above down */
- gf_msg ("dict", GF_LOG_INFO, EINVAL,
- LG_MSG_DICT_SERIAL_FAILED,
- "key '%s' would not be sent on wire in the future",
- dpair->key);
- break;
- default:
- /* Unknown type and ptr type is not sent on wire */
- gf_msg ("dict", GF_LOG_WARNING, EINVAL, LG_MSG_DICT_SERIAL_FAILED,
- "key '%s' is not sent on wire", dpair->key);
- break;
- }
- dpair = dpair->next;
+ int ret = -1;
+ int i = 0;
+ int index = 0;
+ data_pair_t *dpair = NULL;
+ gfx_dict_pair *xpair = NULL;
+ ssize_t size = 0;
+
+ /* This is a failure as we expect destination to be valid */
+ if (!dict)
+ goto out;
+
+ /* This is OK as dictionary can be null, in which case, destination
+ should also know that it is NULL. */
+ if (!this) {
+ /* encode special meaning data here,
+ while decoding, you know it is NULL dict */
+ dict->count = -1;
+ /* everything else is normal */
+ dict->pairs.pairs_len = 0;
+ ret = 0;
+ goto out;
+ }
+
+ /* Do the whole operation in locked region */
+ LOCK(&this->lock);
+
+ dict->pairs.pairs_val = GF_CALLOC(1, (this->count * sizeof(gfx_dict_pair)),
+ gf_common_mt_char);
+ if (!dict->pairs.pairs_val)
+ goto out;
+
+ dpair = this->members_list;
+ for (i = 0; i < this->count; i++) {
+ xpair = &dict->pairs.pairs_val[index];
+
+ xpair->key.key_val = dpair->key;
+ xpair->key.key_len = strlen(dpair->key) + 1;
+ xpair->value.type = dpair->value->data_type;
+ switch (dpair->value->data_type) {
+ /* Add more type here */
+ case GF_DATA_TYPE_INT:
+ index++;
+ xpair->value.gfx_value_u.value_int = strtoll(dpair->value->data,
+ NULL, 0);
+ break;
+ case GF_DATA_TYPE_UINT:
+ index++;
+ xpair->value.gfx_value_u.value_uint = strtoull(
+ dpair->value->data, NULL, 0);
+ break;
+ case GF_DATA_TYPE_DOUBLE:
+ index++;
+ xpair->value.gfx_value_u.value_dbl = strtod(dpair->value->data,
+ NULL);
+ break;
+ case GF_DATA_TYPE_STR:
+ index++;
+ xpair->value.gfx_value_u.val_string
+ .val_string_val = dpair->value->data;
+ xpair->value.gfx_value_u.val_string
+ .val_string_len = dpair->value->len;
+ break;
+ case GF_DATA_TYPE_IATT:
+ index++;
+ gfx_stat_from_iattx(&xpair->value.gfx_value_u.iatt,
+ (struct iatt *)dpair->value->data);
+ break;
+ case GF_DATA_TYPE_GFUUID:
+ index++;
+ memcpy(&xpair->value.gfx_value_u.uuid, dpair->value->data,
+ sizeof(uuid_t));
+ break;
+
+ case GF_DATA_TYPE_PTR:
+ index++;
+ /* Ideally, each type of data stored in dictionary
+ should have type. A pointer type shouldn't be
+ sent on wire */
+
+ /* This is done for backward compatibility as dict is
+ heavily used for transporting data over wire.
+ Ideally, wherever there is an issue, fix and
+ move on */
+ xpair->value.gfx_value_u.other.other_val = dpair->value->data;
+ xpair->value.gfx_value_u.other.other_len = dpair->value->len;
+
+ /* Change this to INFO, after taking the above down */
+ gf_msg("dict", GF_LOG_INFO, EINVAL, LG_MSG_DICT_SERIAL_FAILED,
+ "key '%s' would not be sent on wire in the future",
+ dpair->key);
+ break;
+ default:
+ /* Unknown type and ptr type is not sent on wire */
+ gf_msg("dict", GF_LOG_WARNING, EINVAL,
+ LG_MSG_DICT_SERIAL_FAILED,
+ "key '%s' is not sent on wire", dpair->key);
+ break;
}
+ dpair = dpair->next;
+ }
- dict->pairs.pairs_len = index;
- dict->count = index;
+ dict->pairs.pairs_len = index;
+ dict->count = index;
- /* This is required mainly in the RPC layer to understand the
- boundary for proper payload. Hence only send the size of
- variable XDR size. ie, the formula should be:
- xdr_size = total size - (xdr_size + count + pairs.pairs_len)) */
- size = xdr_sizeof ((xdrproc_t) xdr_gfx_dict, dict);
+ /* This is required mainly in the RPC layer to understand the
+ boundary for proper payload. Hence only send the size of
+ variable XDR size. ie, the formula should be:
+ xdr_size = total size - (xdr_size + count + pairs.pairs_len)) */
+ size = xdr_sizeof((xdrproc_t)xdr_gfx_dict, dict);
- dict->xdr_size = (size > 12) ? (size - 12) : 0;
+ dict->xdr_size = (size > 12) ? (size - 12) : 0;
- ret = 0;
+ ret = 0;
out:
- /* this can be null here, so unlock only if its not null */
- if (this)
- UNLOCK (&this->lock);
+ /* this can be null here, so unlock only if its not null */
+ if (this)
+ UNLOCK(&this->lock);
- return ret;
+ return ret;
}
static inline int
-xdr_to_dict (gfx_dict *dict, dict_t **to)
+xdr_to_dict(gfx_dict *dict, dict_t **to)
{
- int ret = -1;
- int index = 0;
- char *key = NULL;
- char *value = NULL;
- gfx_dict_pair *xpair = NULL;
- dict_t *this = NULL;
- unsigned char *uuid = NULL;
- struct iatt *iatt = NULL;
-
- if (!to || !dict)
- goto out;
-
- if (dict->count < 0) {
- /* indicates NULL dict was passed for encoding */
- ret = 0;
- goto out;
- }
-
- this = dict_new();
- if (!this)
- goto out;
-
- for (index = 0; index < dict->pairs.pairs_len; index++) {
- ret = -1;
- xpair = &dict->pairs.pairs_val[index];
-
- key = xpair->key.key_val;
- switch (xpair->value.type) {
- /* Add more type here */
- case GF_DATA_TYPE_INT:
- ret = dict_set_int64 (this, key,
- xpair->value.gfx_value_u.value_int);
- break;
- case GF_DATA_TYPE_UINT:
- ret = dict_set_uint64 (this, key,
- xpair->value.gfx_value_u.value_uint);
- break;
- case GF_DATA_TYPE_DOUBLE:
- ret = dict_set_double (this, key,
- xpair->value.gfx_value_u.value_dbl);
- break;
- case GF_DATA_TYPE_STR:
- value = GF_MALLOC (xpair->value.gfx_value_u.val_string.val_string_len + 1,
- gf_common_mt_char);
- if (!value) {
- errno = ENOMEM;
- goto out;
- }
- memcpy (value, xpair->value.gfx_value_u.val_string.val_string_val,
- xpair->value.gfx_value_u.val_string.val_string_len);
- value[xpair->value.gfx_value_u.val_string.val_string_len] = '\0';
- free (xpair->value.gfx_value_u.val_string.val_string_val);
- ret = dict_set_dynstr (this, key, value);
- break;
- case GF_DATA_TYPE_GFUUID:
- uuid = GF_MALLOC (sizeof (uuid_t), gf_common_mt_uuid_t);
- if (!uuid) {
- errno = ENOMEM;
- goto out;
- }
- memcpy (uuid, xpair->value.gfx_value_u.uuid, sizeof (uuid_t));
- ret = dict_set_gfuuid (this, key, uuid, false);
- break;
- case GF_DATA_TYPE_IATT:
- iatt = GF_CALLOC (1, sizeof (struct iatt), gf_common_mt_char);
- if (!iatt) {
- errno = ENOMEM;
- goto out;
- }
- gfx_stat_to_iattx (&xpair->value.gfx_value_u.iatt, iatt);
- ret = dict_set_iatt (this, key, iatt, false);
- break;
- case GF_DATA_TYPE_PTR:
- value = GF_MALLOC (xpair->value.gfx_value_u.other.other_len + 1,
- gf_common_mt_char);
- if (!value) {
- errno = ENOMEM;
- goto out;
- }
- memcpy (value, xpair->value.gfx_value_u.other.other_val,
- xpair->value.gfx_value_u.other.other_len);
- value[xpair->value.gfx_value_u.other.other_len] = '\0';
- free (xpair->value.gfx_value_u.other.other_val);
- ret = dict_set_dynptr (this, key, value,
- xpair->value.gfx_value_u.other.other_len);
- break;
- default:
- ret = 0;
- /* Unknown type and ptr type is not sent on wire */
- break;
+ int ret = -1;
+ int index = 0;
+ char *key = NULL;
+ char *value = NULL;
+ gfx_dict_pair *xpair = NULL;
+ dict_t *this = NULL;
+ unsigned char *uuid = NULL;
+ struct iatt *iatt = NULL;
+
+ if (!to || !dict)
+ goto out;
+
+ if (dict->count < 0) {
+ /* indicates NULL dict was passed for encoding */
+ ret = 0;
+ goto out;
+ }
+
+ this = dict_new();
+ if (!this)
+ goto out;
+
+ for (index = 0; index < dict->pairs.pairs_len; index++) {
+ ret = -1;
+ xpair = &dict->pairs.pairs_val[index];
+
+ key = xpair->key.key_val;
+ switch (xpair->value.type) {
+ /* Add more type here */
+ case GF_DATA_TYPE_INT:
+ ret = dict_set_int64(this, key,
+ xpair->value.gfx_value_u.value_int);
+ break;
+ case GF_DATA_TYPE_UINT:
+ ret = dict_set_uint64(this, key,
+ xpair->value.gfx_value_u.value_uint);
+ break;
+ case GF_DATA_TYPE_DOUBLE:
+ ret = dict_set_double(this, key,
+ xpair->value.gfx_value_u.value_dbl);
+ break;
+ case GF_DATA_TYPE_STR:
+ value = GF_MALLOC(
+ xpair->value.gfx_value_u.val_string.val_string_len + 1,
+ gf_common_mt_char);
+ if (!value) {
+ errno = ENOMEM;
+ goto out;
}
- if (ret) {
- gf_msg_debug (THIS->name, ENOMEM,
- "failed to set the key (%s) into dict",
- key);
+ memcpy(value,
+ xpair->value.gfx_value_u.val_string.val_string_val,
+ xpair->value.gfx_value_u.val_string.val_string_len);
+ value[xpair->value.gfx_value_u.val_string.val_string_len] =
+ '\0';
+ free(xpair->value.gfx_value_u.val_string.val_string_val);
+ ret = dict_set_dynstr(this, key, value);
+ break;
+ case GF_DATA_TYPE_GFUUID:
+ uuid = GF_MALLOC(sizeof(uuid_t), gf_common_mt_uuid_t);
+ if (!uuid) {
+ errno = ENOMEM;
+ goto out;
}
- free (xpair->key.key_val);
+ memcpy(uuid, xpair->value.gfx_value_u.uuid, sizeof(uuid_t));
+ ret = dict_set_gfuuid(this, key, uuid, false);
+ break;
+ case GF_DATA_TYPE_IATT:
+ iatt = GF_CALLOC(1, sizeof(struct iatt), gf_common_mt_char);
+ if (!iatt) {
+ errno = ENOMEM;
+ goto out;
+ }
+ gfx_stat_to_iattx(&xpair->value.gfx_value_u.iatt, iatt);
+ ret = dict_set_iatt(this, key, iatt, false);
+ break;
+ case GF_DATA_TYPE_PTR:
+ value = GF_MALLOC(xpair->value.gfx_value_u.other.other_len + 1,
+ gf_common_mt_char);
+ if (!value) {
+ errno = ENOMEM;
+ goto out;
+ }
+ memcpy(value, xpair->value.gfx_value_u.other.other_val,
+ xpair->value.gfx_value_u.other.other_len);
+ value[xpair->value.gfx_value_u.other.other_len] = '\0';
+ free(xpair->value.gfx_value_u.other.other_val);
+ ret = dict_set_dynptr(this, key, value,
+ xpair->value.gfx_value_u.other.other_len);
+ break;
+ default:
+ ret = 0;
+ /* Unknown type and ptr type is not sent on wire */
+ break;
}
+ if (ret) {
+ gf_msg_debug(THIS->name, ENOMEM,
+ "failed to set the key (%s) into dict", key);
+ }
+ free(xpair->key.key_val);
+ }
- free (dict->pairs.pairs_val);
- ret = 0;
+ free(dict->pairs.pairs_val);
+ ret = 0;
- /* If everything is fine, assign the dictionary to target */
- *to = this;
- this = NULL;
+ /* If everything is fine, assign the dictionary to target */
+ *to = this;
+ this = NULL;
out:
- if (this)
- dict_unref (this);
+ if (this)
+ dict_unref(this);
- return ret;
+ return ret;
}
#endif /* !_GLUSTERFS3_H */
diff --git a/rpc/xdr/src/msg-nfs3.h b/rpc/xdr/src/msg-nfs3.h
index 628daea5547..869ddc3524a 100644
--- a/rpc/xdr/src/msg-nfs3.h
+++ b/rpc/xdr/src/msg-nfs3.h
@@ -18,202 +18,202 @@
#include <sys/uio.h>
extern ssize_t
-xdr_to_mountpath (struct iovec outpath, struct iovec inmsg);
+xdr_to_mountpath(struct iovec outpath, struct iovec inmsg);
extern ssize_t
-xdr_serialize_mountres3 (struct iovec outmsg, mountres3 *res);
+xdr_serialize_mountres3(struct iovec outmsg, mountres3 *res);
extern ssize_t
-xdr_serialize_mountbody (struct iovec outmsg, mountbody *mb);
+xdr_serialize_mountbody(struct iovec outmsg, mountbody *mb);
extern ssize_t
-xdr_to_getattr3args (struct iovec inmsg, getattr3args *ga);
+xdr_to_getattr3args(struct iovec inmsg, getattr3args *ga);
extern ssize_t
-xdr_serialize_getattr3res (struct iovec outmsg, getattr3res *res);
+xdr_serialize_getattr3res(struct iovec outmsg, getattr3res *res);
extern ssize_t
-xdr_serialize_setattr3res (struct iovec outmsg, setattr3res *res);
+xdr_serialize_setattr3res(struct iovec outmsg, setattr3res *res);
extern ssize_t
-xdr_to_setattr3args (struct iovec inmsg, setattr3args *sa);
+xdr_to_setattr3args(struct iovec inmsg, setattr3args *sa);
extern ssize_t
-xdr_serialize_lookup3res (struct iovec outmsg, lookup3res *res);
+xdr_serialize_lookup3res(struct iovec outmsg, lookup3res *res);
extern ssize_t
-xdr_to_lookup3args (struct iovec inmsg, lookup3args *la);
+xdr_to_lookup3args(struct iovec inmsg, lookup3args *la);
extern ssize_t
-xdr_to_access3args (struct iovec inmsg, access3args *ac);
+xdr_to_access3args(struct iovec inmsg, access3args *ac);
extern ssize_t
-xdr_serialize_access3res (struct iovec outmsg, access3res *res);
+xdr_serialize_access3res(struct iovec outmsg, access3res *res);
extern ssize_t
-xdr_to_readlink3args (struct iovec inmsg, readlink3args *ra);
+xdr_to_readlink3args(struct iovec inmsg, readlink3args *ra);
extern ssize_t
-xdr_serialize_readlink3res (struct iovec outmsg, readlink3res *res);
+xdr_serialize_readlink3res(struct iovec outmsg, readlink3res *res);
extern ssize_t
-xdr_to_read3args (struct iovec inmsg, read3args *ra);
+xdr_to_read3args(struct iovec inmsg, read3args *ra);
extern ssize_t
-xdr_serialize_read3res (struct iovec outmsg, read3res *res);
+xdr_serialize_read3res(struct iovec outmsg, read3res *res);
extern ssize_t
-xdr_serialize_read3res_nocopy (struct iovec outmsg, read3res *res);
+xdr_serialize_read3res_nocopy(struct iovec outmsg, read3res *res);
extern ssize_t
-xdr_to_write3args (struct iovec inmsg, write3args *wa);
+xdr_to_write3args(struct iovec inmsg, write3args *wa);
extern ssize_t
-xdr_to_write3args_nocopy (struct iovec inmsg, write3args *wa,
- struct iovec *payload);
+xdr_to_write3args_nocopy(struct iovec inmsg, write3args *wa,
+ struct iovec *payload);
extern ssize_t
-xdr_serialize_write3res (struct iovec outmsg, write3res *res);
+xdr_serialize_write3res(struct iovec outmsg, write3res *res);
extern ssize_t
-xdr_to_create3args (struct iovec inmsg, create3args *ca);
+xdr_to_create3args(struct iovec inmsg, create3args *ca);
extern ssize_t
-xdr_serialize_create3res (struct iovec outmsg, create3res *res);
+xdr_serialize_create3res(struct iovec outmsg, create3res *res);
extern ssize_t
-xdr_serialize_mkdir3res (struct iovec outmsg, mkdir3res *res);
+xdr_serialize_mkdir3res(struct iovec outmsg, mkdir3res *res);
extern ssize_t
-xdr_to_mkdir3args (struct iovec inmsg, mkdir3args *ma);
+xdr_to_mkdir3args(struct iovec inmsg, mkdir3args *ma);
extern ssize_t
-xdr_to_symlink3args (struct iovec inmsg, symlink3args *sa);
+xdr_to_symlink3args(struct iovec inmsg, symlink3args *sa);
extern ssize_t
-xdr_serialize_symlink3res (struct iovec outmsg, symlink3res *res);
+xdr_serialize_symlink3res(struct iovec outmsg, symlink3res *res);
extern ssize_t
-xdr_to_mknod3args (struct iovec inmsg, mknod3args *ma);
+xdr_to_mknod3args(struct iovec inmsg, mknod3args *ma);
extern ssize_t
-xdr_serialize_mknod3res (struct iovec outmsg, mknod3res *res);
+xdr_serialize_mknod3res(struct iovec outmsg, mknod3res *res);
extern ssize_t
-xdr_to_remove3args (struct iovec inmsg, remove3args *ra);
+xdr_to_remove3args(struct iovec inmsg, remove3args *ra);
extern ssize_t
-xdr_serialize_remove3res (struct iovec outmsg, remove3res *res);
+xdr_serialize_remove3res(struct iovec outmsg, remove3res *res);
extern ssize_t
-xdr_to_rmdir3args (struct iovec inmsg, rmdir3args *ra);
+xdr_to_rmdir3args(struct iovec inmsg, rmdir3args *ra);
extern ssize_t
-xdr_serialize_rmdir3res (struct iovec outmsg, rmdir3res *res);
+xdr_serialize_rmdir3res(struct iovec outmsg, rmdir3res *res);
extern ssize_t
-xdr_serialize_rename3res (struct iovec outmsg, rename3res *res);
+xdr_serialize_rename3res(struct iovec outmsg, rename3res *res);
extern ssize_t
-xdr_to_rename3args (struct iovec inmsg, rename3args *ra);
+xdr_to_rename3args(struct iovec inmsg, rename3args *ra);
extern ssize_t
-xdr_serialize_link3res (struct iovec outmsg, link3res *li);
+xdr_serialize_link3res(struct iovec outmsg, link3res *li);
extern ssize_t
-xdr_to_link3args (struct iovec inmsg, link3args *la);
+xdr_to_link3args(struct iovec inmsg, link3args *la);
extern ssize_t
-xdr_to_readdir3args (struct iovec inmsg, readdir3args *rd);
+xdr_to_readdir3args(struct iovec inmsg, readdir3args *rd);
extern ssize_t
-xdr_serialize_readdir3res (struct iovec outmsg, readdir3res *res);
+xdr_serialize_readdir3res(struct iovec outmsg, readdir3res *res);
extern ssize_t
-xdr_to_readdirp3args (struct iovec inmsg, readdirp3args *rp);
+xdr_to_readdirp3args(struct iovec inmsg, readdirp3args *rp);
extern ssize_t
-xdr_serialize_readdirp3res (struct iovec outmsg, readdirp3res *res);
+xdr_serialize_readdirp3res(struct iovec outmsg, readdirp3res *res);
extern ssize_t
-xdr_to_fsstat3args (struct iovec inmsg, fsstat3args *fa);
+xdr_to_fsstat3args(struct iovec inmsg, fsstat3args *fa);
extern ssize_t
-xdr_serialize_fsstat3res (struct iovec outmsg, fsstat3res *res);
+xdr_serialize_fsstat3res(struct iovec outmsg, fsstat3res *res);
extern ssize_t
-xdr_to_fsinfo3args (struct iovec inmsg, fsinfo3args *fi);
+xdr_to_fsinfo3args(struct iovec inmsg, fsinfo3args *fi);
extern ssize_t
-xdr_serialize_fsinfo3res (struct iovec outmsg, fsinfo3res *res);
+xdr_serialize_fsinfo3res(struct iovec outmsg, fsinfo3res *res);
extern ssize_t
-xdr_to_pathconf3args (struct iovec inmsg, pathconf3args *pc);
+xdr_to_pathconf3args(struct iovec inmsg, pathconf3args *pc);
extern ssize_t
-xdr_serialize_pathconf3res (struct iovec outmsg, pathconf3res *res);
+xdr_serialize_pathconf3res(struct iovec outmsg, pathconf3res *res);
extern ssize_t
-xdr_to_commit3args (struct iovec inmsg, commit3args *ca);
+xdr_to_commit3args(struct iovec inmsg, commit3args *ca);
extern ssize_t
-xdr_serialize_commit3res (struct iovec outmsg, commit3res *res);
+xdr_serialize_commit3res(struct iovec outmsg, commit3res *res);
extern ssize_t
-xdr_serialize_exports (struct iovec outmsg, exports *elist);
+xdr_serialize_exports(struct iovec outmsg, exports *elist);
extern ssize_t
-xdr_serialize_mountlist (struct iovec outmsg, mountlist *ml);
+xdr_serialize_mountlist(struct iovec outmsg, mountlist *ml);
extern ssize_t
-xdr_serialize_mountstat3 (struct iovec outmsg, mountstat3 *m);
+xdr_serialize_mountstat3(struct iovec outmsg, mountstat3 *m);
extern ssize_t
-xdr_serialize_nfsstat3 (struct iovec outmsg, nfsstat3 *s);
+xdr_serialize_nfsstat3(struct iovec outmsg, nfsstat3 *s);
extern ssize_t
-xdr_to_nlm4_testargs (struct iovec inmsg, nlm4_testargs *args);
+xdr_to_nlm4_testargs(struct iovec inmsg, nlm4_testargs *args);
extern ssize_t
-xdr_serialize_nlm4_testres (struct iovec outmsg, nlm4_testres *res);
+xdr_serialize_nlm4_testres(struct iovec outmsg, nlm4_testres *res);
extern ssize_t
-xdr_to_nlm4_lockargs (struct iovec inmsg, nlm4_lockargs *args);
+xdr_to_nlm4_lockargs(struct iovec inmsg, nlm4_lockargs *args);
extern ssize_t
-xdr_serialize_nlm4_res (struct iovec outmsg, nlm4_res *res);
+xdr_serialize_nlm4_res(struct iovec outmsg, nlm4_res *res);
extern ssize_t
-xdr_to_nlm4_cancelargs (struct iovec inmsg, nlm4_cancargs *args);
+xdr_to_nlm4_cancelargs(struct iovec inmsg, nlm4_cancargs *args);
extern ssize_t
-xdr_to_nlm4_unlockargs (struct iovec inmsg, nlm4_unlockargs *args);
+xdr_to_nlm4_unlockargs(struct iovec inmsg, nlm4_unlockargs *args);
extern ssize_t
-xdr_to_nlm4_shareargs (struct iovec inmsg, nlm4_shareargs *args);
+xdr_to_nlm4_shareargs(struct iovec inmsg, nlm4_shareargs *args);
extern ssize_t
-xdr_serialize_nlm4_shareres (struct iovec outmsg, nlm4_shareres *res);
+xdr_serialize_nlm4_shareres(struct iovec outmsg, nlm4_shareres *res);
extern ssize_t
-xdr_serialize_nlm4_testargs (struct iovec outmsg, nlm4_testargs *args);
+xdr_serialize_nlm4_testargs(struct iovec outmsg, nlm4_testargs *args);
extern ssize_t
-xdr_to_nlm4_res (struct iovec inmsg, nlm4_res *args);
+xdr_to_nlm4_res(struct iovec inmsg, nlm4_res *args);
extern ssize_t
-xdr_to_nlm4_freeallargs (struct iovec inmsg, nlm4_freeallargs *args);
+xdr_to_nlm4_freeallargs(struct iovec inmsg, nlm4_freeallargs *args);
extern ssize_t
-xdr_to_getaclargs (struct iovec inmsg, getaclargs *args);
+xdr_to_getaclargs(struct iovec inmsg, getaclargs *args);
extern ssize_t
-xdr_to_setaclargs (struct iovec inmsg, setaclargs *args);
+xdr_to_setaclargs(struct iovec inmsg, setaclargs *args);
extern ssize_t
-xdr_serialize_getaclreply (struct iovec inmsg, getaclreply *res);
+xdr_serialize_getaclreply(struct iovec inmsg, getaclreply *res);
extern ssize_t
-xdr_serialize_setaclreply (struct iovec inmsg, setaclreply *res);
+xdr_serialize_setaclreply(struct iovec inmsg, setaclreply *res);
#endif
diff --git a/rpc/xdr/src/xdr-generic.h b/rpc/xdr/src/xdr-generic.h
index 2f12290ef02..367ef555dd3 100644
--- a/rpc/xdr/src/xdr-generic.h
+++ b/rpc/xdr/src/xdr-generic.h
@@ -17,12 +17,14 @@
#include "compat.h"
-#define xdr_decoded_remaining_addr(xdr) ((&xdr)->x_private)
-#define xdr_decoded_remaining_len(xdr) ((&xdr)->x_handy)
-#define xdr_encoded_length(xdr) (((size_t)(&xdr)->x_private) - ((size_t)(&xdr)->x_base))
-#define xdr_decoded_length(xdr) (((size_t)(&xdr)->x_private) - ((size_t)(&xdr)->x_base))
+#define xdr_decoded_remaining_addr(xdr) ((&xdr)->x_private)
+#define xdr_decoded_remaining_len(xdr) ((&xdr)->x_handy)
+#define xdr_encoded_length(xdr) \
+ (((size_t)(&xdr)->x_private) - ((size_t)(&xdr)->x_base))
+#define xdr_decoded_length(xdr) \
+ (((size_t)(&xdr)->x_private) - ((size_t)(&xdr)->x_base))
-#define XDR_BYTES_PER_UNIT 4
+#define XDR_BYTES_PER_UNIT 4
/*
On OSX > 10.9
@@ -47,29 +49,28 @@
*/
#if defined(__NetBSD__)
-#define PROC(xdr, res) proc(xdr, res)
+#define PROC(xdr, res) proc(xdr, res)
#else
-#define PROC(xdr, res) proc(xdr, res, 0)
+#define PROC(xdr, res) proc(xdr, res, 0)
#endif
ssize_t
-xdr_serialize_generic (struct iovec outmsg, void *res, xdrproc_t proc);
+xdr_serialize_generic(struct iovec outmsg, void *res, xdrproc_t proc);
ssize_t
-xdr_to_generic (struct iovec inmsg, void *args, xdrproc_t proc);
+xdr_to_generic(struct iovec inmsg, void *args, xdrproc_t proc);
ssize_t
-xdr_to_generic_payload (struct iovec inmsg, void *args, xdrproc_t proc,
- struct iovec *pendingpayload);
-
+xdr_to_generic_payload(struct iovec inmsg, void *args, xdrproc_t proc,
+ struct iovec *pendingpayload);
extern int
-xdr_bytes_round_up (struct iovec *vec, size_t bufsize);
+xdr_bytes_round_up(struct iovec *vec, size_t bufsize);
extern ssize_t
-xdr_length_round_up (size_t len, size_t bufsize);
+xdr_length_round_up(size_t len, size_t bufsize);
void
-xdr_vector_round_up (struct iovec *vec, int vcount, uint32_t count);
+xdr_vector_round_up(struct iovec *vec, int vcount, uint32_t count);
#endif /* !_XDR_GENERIC_H */
diff --git a/rpc/xdr/src/xdr-nfs3.h b/rpc/xdr/src/xdr-nfs3.h
index 3861771e299..b7f5abefffd 100644
--- a/rpc/xdr/src/xdr-nfs3.h
+++ b/rpc/xdr/src/xdr-nfs3.h
@@ -14,25 +14,27 @@
#include <rpc/rpc.h>
#include <sys/types.h>
-#define NFS3_FHSIZE 64
-#define NFS3_COOKIEVERFSIZE 8
-#define NFS3_CREATEVERFSIZE 8
-#define NFS3_WRITEVERFSIZE 8
+#define NFS3_FHSIZE 64
+#define NFS3_COOKIEVERFSIZE 8
+#define NFS3_CREATEVERFSIZE 8
+#define NFS3_WRITEVERFSIZE 8
-#define NFS3_ENTRY3_FIXED_SIZE 24
-#define NFS3_POSTOPATTR_SIZE 88
-#define NFS3_READDIR_RESOK_SIZE (NFS3_POSTOPATTR_SIZE + sizeof (bool_t) + NFS3_COOKIEVERFSIZE)
+#define NFS3_ENTRY3_FIXED_SIZE 24
+#define NFS3_POSTOPATTR_SIZE 88
+#define NFS3_READDIR_RESOK_SIZE \
+ (NFS3_POSTOPATTR_SIZE + sizeof(bool_t) + NFS3_COOKIEVERFSIZE)
/* In size of post_op_fh3, the length of the file handle will have to be
* included separately since we have variable length fh. Here we only account
* for the field for handle_follows and for the file handle length field.
*/
-#define NFS3_POSTOPFH3_FIXED_SIZE (sizeof (bool_t) + sizeof (uint32_t))
+#define NFS3_POSTOPFH3_FIXED_SIZE (sizeof(bool_t) + sizeof(uint32_t))
/* Similarly, the size of the entry will have to include the variable length
* file handle and the length of the entry name.
*/
-#define NFS3_ENTRYP3_FIXED_SIZE (NFS3_ENTRY3_FIXED_SIZE + NFS3_POSTOPATTR_SIZE + NFS3_POSTOPFH3_FIXED_SIZE)
+#define NFS3_ENTRYP3_FIXED_SIZE \
+ (NFS3_ENTRY3_FIXED_SIZE + NFS3_POSTOPATTR_SIZE + NFS3_POSTOPFH3_FIXED_SIZE)
typedef uint64_t uint64;
typedef int64_t int64;
@@ -52,284 +54,284 @@ typedef uint64 offset3;
typedef uint32 mode3;
typedef uint32 count3;
-#define NFS3MODE_SETXUID 0x00800
-#define NFS3MODE_SETXGID 0x00400
-#define NFS3MODE_SAVESWAPTXT 0x00200
-#define NFS3MODE_ROWNER 0x00100
-#define NFS3MODE_WOWNER 0x00080
-#define NFS3MODE_XOWNER 0x00040
-#define NFS3MODE_RGROUP 0x00020
-#define NFS3MODE_WGROUP 0x00010
-#define NFS3MODE_XGROUP 0x00008
-#define NFS3MODE_ROTHER 0x00004
-#define NFS3MODE_WOTHER 0x00002
-#define NFS3MODE_XOTHER 0x00001
+#define NFS3MODE_SETXUID 0x00800
+#define NFS3MODE_SETXGID 0x00400
+#define NFS3MODE_SAVESWAPTXT 0x00200
+#define NFS3MODE_ROWNER 0x00100
+#define NFS3MODE_WOWNER 0x00080
+#define NFS3MODE_XOWNER 0x00040
+#define NFS3MODE_RGROUP 0x00020
+#define NFS3MODE_WGROUP 0x00010
+#define NFS3MODE_XGROUP 0x00008
+#define NFS3MODE_ROTHER 0x00004
+#define NFS3MODE_WOTHER 0x00002
+#define NFS3MODE_XOTHER 0x00001
enum nfsstat3 {
- NFS3_OK = 0,
- NFS3ERR_PERM = 1,
- NFS3ERR_NOENT = 2,
- NFS3ERR_IO = 5,
- NFS3ERR_NXIO = 6,
- NFS3ERR_ACCES = 13,
- NFS3ERR_EXIST = 17,
- NFS3ERR_XDEV = 18,
- NFS3ERR_NODEV = 19,
- NFS3ERR_NOTDIR = 20,
- NFS3ERR_ISDIR = 21,
- NFS3ERR_INVAL = 22,
- NFS3ERR_FBIG = 27,
- NFS3ERR_NOSPC = 28,
- NFS3ERR_ROFS = 30,
- NFS3ERR_MLINK = 31,
- NFS3ERR_NAMETOOLONG = 63,
- NFS3ERR_NOTEMPTY = 66,
- NFS3ERR_DQUOT = 69,
- NFS3ERR_STALE = 70,
- NFS3ERR_REMOTE = 71,
- NFS3ERR_BADHANDLE = 10001,
- NFS3ERR_NOT_SYNC = 10002,
- NFS3ERR_BAD_COOKIE = 10003,
- NFS3ERR_NOTSUPP = 10004,
- NFS3ERR_TOOSMALL = 10005,
- NFS3ERR_SERVERFAULT = 10006,
- NFS3ERR_BADTYPE = 10007,
- NFS3ERR_JUKEBOX = 10008,
- NFS3ERR_END_OF_LIST = -1,
+ NFS3_OK = 0,
+ NFS3ERR_PERM = 1,
+ NFS3ERR_NOENT = 2,
+ NFS3ERR_IO = 5,
+ NFS3ERR_NXIO = 6,
+ NFS3ERR_ACCES = 13,
+ NFS3ERR_EXIST = 17,
+ NFS3ERR_XDEV = 18,
+ NFS3ERR_NODEV = 19,
+ NFS3ERR_NOTDIR = 20,
+ NFS3ERR_ISDIR = 21,
+ NFS3ERR_INVAL = 22,
+ NFS3ERR_FBIG = 27,
+ NFS3ERR_NOSPC = 28,
+ NFS3ERR_ROFS = 30,
+ NFS3ERR_MLINK = 31,
+ NFS3ERR_NAMETOOLONG = 63,
+ NFS3ERR_NOTEMPTY = 66,
+ NFS3ERR_DQUOT = 69,
+ NFS3ERR_STALE = 70,
+ NFS3ERR_REMOTE = 71,
+ NFS3ERR_BADHANDLE = 10001,
+ NFS3ERR_NOT_SYNC = 10002,
+ NFS3ERR_BAD_COOKIE = 10003,
+ NFS3ERR_NOTSUPP = 10004,
+ NFS3ERR_TOOSMALL = 10005,
+ NFS3ERR_SERVERFAULT = 10006,
+ NFS3ERR_BADTYPE = 10007,
+ NFS3ERR_JUKEBOX = 10008,
+ NFS3ERR_END_OF_LIST = -1,
};
typedef enum nfsstat3 nfsstat3;
enum ftype3 {
- NF3REG = 1,
- NF3DIR = 2,
- NF3BLK = 3,
- NF3CHR = 4,
- NF3LNK = 5,
- NF3SOCK = 6,
- NF3FIFO = 7,
+ NF3REG = 1,
+ NF3DIR = 2,
+ NF3BLK = 3,
+ NF3CHR = 4,
+ NF3LNK = 5,
+ NF3SOCK = 6,
+ NF3FIFO = 7,
};
typedef enum ftype3 ftype3;
struct specdata3 {
- uint32 specdata1;
- uint32 specdata2;
+ uint32 specdata1;
+ uint32 specdata2;
};
typedef struct specdata3 specdata3;
struct nfs_fh3 {
- struct {
- u_int data_len;
- char *data_val;
- } data;
+ struct {
+ u_int data_len;
+ char *data_val;
+ } data;
};
typedef struct nfs_fh3 nfs_fh3;
struct nfstime3 {
- uint32 seconds;
- uint32 nseconds;
+ uint32 seconds;
+ uint32 nseconds;
};
typedef struct nfstime3 nfstime3;
struct fattr3 {
- ftype3 type;
- mode3 mode;
- uint32 nlink;
- uid3 uid;
- gid3 gid;
- size3 size;
- size3 used;
- specdata3 rdev;
- uint64 fsid;
- fileid3 fileid;
- nfstime3 atime;
- nfstime3 mtime;
- nfstime3 ctime;
+ ftype3 type;
+ mode3 mode;
+ uint32 nlink;
+ uid3 uid;
+ gid3 gid;
+ size3 size;
+ size3 used;
+ specdata3 rdev;
+ uint64 fsid;
+ fileid3 fileid;
+ nfstime3 atime;
+ nfstime3 mtime;
+ nfstime3 ctime;
};
typedef struct fattr3 fattr3;
struct post_op_attr {
- bool_t attributes_follow;
- union {
- fattr3 attributes;
- } post_op_attr_u;
+ bool_t attributes_follow;
+ union {
+ fattr3 attributes;
+ } post_op_attr_u;
};
typedef struct post_op_attr post_op_attr;
struct wcc_attr {
- size3 size;
- nfstime3 mtime;
- nfstime3 ctime;
+ size3 size;
+ nfstime3 mtime;
+ nfstime3 ctime;
};
typedef struct wcc_attr wcc_attr;
struct pre_op_attr {
- bool_t attributes_follow;
- union {
- wcc_attr attributes;
- } pre_op_attr_u;
+ bool_t attributes_follow;
+ union {
+ wcc_attr attributes;
+ } pre_op_attr_u;
};
typedef struct pre_op_attr pre_op_attr;
struct wcc_data {
- pre_op_attr before;
- post_op_attr after;
+ pre_op_attr before;
+ post_op_attr after;
};
typedef struct wcc_data wcc_data;
struct post_op_fh3 {
- bool_t handle_follows;
- union {
- nfs_fh3 handle;
- } post_op_fh3_u;
+ bool_t handle_follows;
+ union {
+ nfs_fh3 handle;
+ } post_op_fh3_u;
};
typedef struct post_op_fh3 post_op_fh3;
enum time_how {
- DONT_CHANGE = 0,
- SET_TO_SERVER_TIME = 1,
- SET_TO_CLIENT_TIME = 2,
+ DONT_CHANGE = 0,
+ SET_TO_SERVER_TIME = 1,
+ SET_TO_CLIENT_TIME = 2,
};
typedef enum time_how time_how;
struct set_mode3 {
- bool_t set_it;
- union {
- mode3 mode;
- } set_mode3_u;
+ bool_t set_it;
+ union {
+ mode3 mode;
+ } set_mode3_u;
};
typedef struct set_mode3 set_mode3;
struct set_uid3 {
- bool_t set_it;
- union {
- uid3 uid;
- } set_uid3_u;
+ bool_t set_it;
+ union {
+ uid3 uid;
+ } set_uid3_u;
};
typedef struct set_uid3 set_uid3;
struct set_gid3 {
- bool_t set_it;
- union {
- gid3 gid;
- } set_gid3_u;
+ bool_t set_it;
+ union {
+ gid3 gid;
+ } set_gid3_u;
};
typedef struct set_gid3 set_gid3;
struct set_size3 {
- bool_t set_it;
- union {
- size3 size;
- } set_size3_u;
+ bool_t set_it;
+ union {
+ size3 size;
+ } set_size3_u;
};
typedef struct set_size3 set_size3;
struct set_atime {
- time_how set_it;
- union {
- nfstime3 atime;
- } set_atime_u;
+ time_how set_it;
+ union {
+ nfstime3 atime;
+ } set_atime_u;
};
typedef struct set_atime set_atime;
struct set_mtime {
- time_how set_it;
- union {
- nfstime3 mtime;
- } set_mtime_u;
+ time_how set_it;
+ union {
+ nfstime3 mtime;
+ } set_mtime_u;
};
typedef struct set_mtime set_mtime;
struct sattr3 {
- set_mode3 mode;
- set_uid3 uid;
- set_gid3 gid;
- set_size3 size;
- set_atime atime;
- set_mtime mtime;
+ set_mode3 mode;
+ set_uid3 uid;
+ set_gid3 gid;
+ set_size3 size;
+ set_atime atime;
+ set_mtime mtime;
};
typedef struct sattr3 sattr3;
struct diropargs3 {
- nfs_fh3 dir;
- filename3 name;
+ nfs_fh3 dir;
+ filename3 name;
};
typedef struct diropargs3 diropargs3;
struct getattr3args {
- nfs_fh3 object;
+ nfs_fh3 object;
};
typedef struct getattr3args getattr3args;
struct getattr3resok {
- fattr3 obj_attributes;
+ fattr3 obj_attributes;
};
typedef struct getattr3resok getattr3resok;
struct getattr3res {
- nfsstat3 status;
- union {
- getattr3resok resok;
- } getattr3res_u;
+ nfsstat3 status;
+ union {
+ getattr3resok resok;
+ } getattr3res_u;
};
typedef struct getattr3res getattr3res;
struct sattrguard3 {
- bool_t check;
- union {
- nfstime3 obj_ctime;
- } sattrguard3_u;
+ bool_t check;
+ union {
+ nfstime3 obj_ctime;
+ } sattrguard3_u;
};
typedef struct sattrguard3 sattrguard3;
struct setattr3args {
- nfs_fh3 object;
- sattr3 new_attributes;
- sattrguard3 guard;
+ nfs_fh3 object;
+ sattr3 new_attributes;
+ sattrguard3 guard;
};
typedef struct setattr3args setattr3args;
struct setattr3resok {
- wcc_data obj_wcc;
+ wcc_data obj_wcc;
};
typedef struct setattr3resok setattr3resok;
struct setattr3resfail {
- wcc_data obj_wcc;
+ wcc_data obj_wcc;
};
typedef struct setattr3resfail setattr3resfail;
struct setattr3res {
- nfsstat3 status;
- union {
- setattr3resok resok;
- setattr3resfail resfail;
- } setattr3res_u;
+ nfsstat3 status;
+ union {
+ setattr3resok resok;
+ setattr3resfail resfail;
+ } setattr3res_u;
};
typedef struct setattr3res setattr3res;
struct lookup3args {
- diropargs3 what;
+ diropargs3 what;
};
typedef struct lookup3args lookup3args;
struct lookup3resok {
- nfs_fh3 object;
- post_op_attr obj_attributes;
- post_op_attr dir_attributes;
+ nfs_fh3 object;
+ post_op_attr obj_attributes;
+ post_op_attr dir_attributes;
};
typedef struct lookup3resok lookup3resok;
struct lookup3resfail {
- post_op_attr dir_attributes;
+ post_op_attr dir_attributes;
};
typedef struct lookup3resfail lookup3resfail;
struct lookup3res {
- nfsstat3 status;
- union {
- lookup3resok resok;
- lookup3resfail resfail;
- } lookup3res_u;
+ nfsstat3 status;
+ union {
+ lookup3resok resok;
+ lookup3resfail resfail;
+ } lookup3res_u;
};
typedef struct lookup3res lookup3res;
#define ACCESS3_READ 0x0001
@@ -340,104 +342,104 @@ typedef struct lookup3res lookup3res;
#define ACCESS3_EXECUTE 0x0020
struct access3args {
- nfs_fh3 object;
- uint32 access;
+ nfs_fh3 object;
+ uint32 access;
};
typedef struct access3args access3args;
struct access3resok {
- post_op_attr obj_attributes;
- uint32 access;
+ post_op_attr obj_attributes;
+ uint32 access;
};
typedef struct access3resok access3resok;
struct access3resfail {
- post_op_attr obj_attributes;
+ post_op_attr obj_attributes;
};
typedef struct access3resfail access3resfail;
struct access3res {
- nfsstat3 status;
- union {
- access3resok resok;
- access3resfail resfail;
- } access3res_u;
+ nfsstat3 status;
+ union {
+ access3resok resok;
+ access3resfail resfail;
+ } access3res_u;
};
typedef struct access3res access3res;
struct readlink3args {
- nfs_fh3 symlink;
+ nfs_fh3 symlink;
};
typedef struct readlink3args readlink3args;
struct readlink3resok {
- post_op_attr symlink_attributes;
- nfspath3 data;
+ post_op_attr symlink_attributes;
+ nfspath3 data;
};
typedef struct readlink3resok readlink3resok;
struct readlink3resfail {
- post_op_attr symlink_attributes;
+ post_op_attr symlink_attributes;
};
typedef struct readlink3resfail readlink3resfail;
struct readlink3res {
- nfsstat3 status;
- union {
- readlink3resok resok;
- readlink3resfail resfail;
- } readlink3res_u;
+ nfsstat3 status;
+ union {
+ readlink3resok resok;
+ readlink3resfail resfail;
+ } readlink3res_u;
};
typedef struct readlink3res readlink3res;
struct read3args {
- nfs_fh3 file;
- offset3 offset;
- count3 count;
+ nfs_fh3 file;
+ offset3 offset;
+ count3 count;
};
typedef struct read3args read3args;
struct read3resok {
- post_op_attr file_attributes;
- count3 count;
- bool_t eof;
- struct {
- u_int data_len;
- char *data_val;
- } data;
+ post_op_attr file_attributes;
+ count3 count;
+ bool_t eof;
+ struct {
+ u_int data_len;
+ char *data_val;
+ } data;
};
typedef struct read3resok read3resok;
struct read3resfail {
- post_op_attr file_attributes;
+ post_op_attr file_attributes;
};
typedef struct read3resfail read3resfail;
struct read3res {
- nfsstat3 status;
- union {
- read3resok resok;
- read3resfail resfail;
- } read3res_u;
+ nfsstat3 status;
+ union {
+ read3resok resok;
+ read3resfail resfail;
+ } read3res_u;
};
typedef struct read3res read3res;
enum stable_how {
- UNSTABLE = 0,
- DATA_SYNC = 1,
- FILE_SYNC = 2,
+ UNSTABLE = 0,
+ DATA_SYNC = 1,
+ FILE_SYNC = 2,
};
typedef enum stable_how stable_how;
struct write3args {
- nfs_fh3 file;
- offset3 offset;
- count3 count;
- stable_how stable;
- struct {
- u_int data_len;
- char *data_val;
- } data;
+ nfs_fh3 file;
+ offset3 offset;
+ count3 count;
+ stable_how stable;
+ struct {
+ u_int data_len;
+ char *data_val;
+ } data;
};
typedef struct write3args write3args;
@@ -446,393 +448,395 @@ typedef struct write3args write3args;
* sizeof (nfs_fh3) rather than first trying to extract the fh size of the
* network followed by a sized-read of the file handle.
*/
-#define NFS3_WRITE3ARGS_SIZE (sizeof (uint32_t) + NFS3_FHSIZE + sizeof (offset3) + sizeof (count3) + sizeof (uint32_t))
+#define NFS3_WRITE3ARGS_SIZE \
+ (sizeof(uint32_t) + NFS3_FHSIZE + sizeof(offset3) + sizeof(count3) + \
+ sizeof(uint32_t))
struct write3resok {
- wcc_data file_wcc;
- count3 count;
- stable_how committed;
- writeverf3 verf;
+ wcc_data file_wcc;
+ count3 count;
+ stable_how committed;
+ writeverf3 verf;
};
typedef struct write3resok write3resok;
struct write3resfail {
- wcc_data file_wcc;
+ wcc_data file_wcc;
};
typedef struct write3resfail write3resfail;
struct write3res {
- nfsstat3 status;
- union {
- write3resok resok;
- write3resfail resfail;
- } write3res_u;
+ nfsstat3 status;
+ union {
+ write3resok resok;
+ write3resfail resfail;
+ } write3res_u;
};
typedef struct write3res write3res;
enum createmode3 {
- UNCHECKED = 0,
- GUARDED = 1,
- EXCLUSIVE = 2,
+ UNCHECKED = 0,
+ GUARDED = 1,
+ EXCLUSIVE = 2,
};
typedef enum createmode3 createmode3;
struct createhow3 {
- createmode3 mode;
- union {
- sattr3 obj_attributes;
- createverf3 verf;
- } createhow3_u;
+ createmode3 mode;
+ union {
+ sattr3 obj_attributes;
+ createverf3 verf;
+ } createhow3_u;
};
typedef struct createhow3 createhow3;
struct create3args {
- diropargs3 where;
- createhow3 how;
+ diropargs3 where;
+ createhow3 how;
};
typedef struct create3args create3args;
struct create3resok {
- post_op_fh3 obj;
- post_op_attr obj_attributes;
- wcc_data dir_wcc;
+ post_op_fh3 obj;
+ post_op_attr obj_attributes;
+ wcc_data dir_wcc;
};
typedef struct create3resok create3resok;
struct create3resfail {
- wcc_data dir_wcc;
+ wcc_data dir_wcc;
};
typedef struct create3resfail create3resfail;
struct create3res {
- nfsstat3 status;
- union {
- create3resok resok;
- create3resfail resfail;
- } create3res_u;
+ nfsstat3 status;
+ union {
+ create3resok resok;
+ create3resfail resfail;
+ } create3res_u;
};
typedef struct create3res create3res;
struct mkdir3args {
- diropargs3 where;
- sattr3 attributes;
+ diropargs3 where;
+ sattr3 attributes;
};
typedef struct mkdir3args mkdir3args;
struct mkdir3resok {
- post_op_fh3 obj;
- post_op_attr obj_attributes;
- wcc_data dir_wcc;
+ post_op_fh3 obj;
+ post_op_attr obj_attributes;
+ wcc_data dir_wcc;
};
typedef struct mkdir3resok mkdir3resok;
struct mkdir3resfail {
- wcc_data dir_wcc;
+ wcc_data dir_wcc;
};
typedef struct mkdir3resfail mkdir3resfail;
struct mkdir3res {
- nfsstat3 status;
- union {
- mkdir3resok resok;
- mkdir3resfail resfail;
- } mkdir3res_u;
+ nfsstat3 status;
+ union {
+ mkdir3resok resok;
+ mkdir3resfail resfail;
+ } mkdir3res_u;
};
typedef struct mkdir3res mkdir3res;
struct symlinkdata3 {
- sattr3 symlink_attributes;
- nfspath3 symlink_data;
+ sattr3 symlink_attributes;
+ nfspath3 symlink_data;
};
typedef struct symlinkdata3 symlinkdata3;
struct symlink3args {
- diropargs3 where;
- symlinkdata3 symlink;
+ diropargs3 where;
+ symlinkdata3 symlink;
};
typedef struct symlink3args symlink3args;
struct symlink3resok {
- post_op_fh3 obj;
- post_op_attr obj_attributes;
- wcc_data dir_wcc;
+ post_op_fh3 obj;
+ post_op_attr obj_attributes;
+ wcc_data dir_wcc;
};
typedef struct symlink3resok symlink3resok;
struct symlink3resfail {
- wcc_data dir_wcc;
+ wcc_data dir_wcc;
};
typedef struct symlink3resfail symlink3resfail;
struct symlink3res {
- nfsstat3 status;
- union {
- symlink3resok resok;
- symlink3resfail resfail;
- } symlink3res_u;
+ nfsstat3 status;
+ union {
+ symlink3resok resok;
+ symlink3resfail resfail;
+ } symlink3res_u;
};
typedef struct symlink3res symlink3res;
struct devicedata3 {
- sattr3 dev_attributes;
- specdata3 spec;
+ sattr3 dev_attributes;
+ specdata3 spec;
};
typedef struct devicedata3 devicedata3;
struct mknoddata3 {
- ftype3 type;
- union {
- devicedata3 device;
- sattr3 pipe_attributes;
- } mknoddata3_u;
+ ftype3 type;
+ union {
+ devicedata3 device;
+ sattr3 pipe_attributes;
+ } mknoddata3_u;
};
typedef struct mknoddata3 mknoddata3;
struct mknod3args {
- diropargs3 where;
- mknoddata3 what;
+ diropargs3 where;
+ mknoddata3 what;
};
typedef struct mknod3args mknod3args;
struct mknod3resok {
- post_op_fh3 obj;
- post_op_attr obj_attributes;
- wcc_data dir_wcc;
+ post_op_fh3 obj;
+ post_op_attr obj_attributes;
+ wcc_data dir_wcc;
};
typedef struct mknod3resok mknod3resok;
struct mknod3resfail {
- wcc_data dir_wcc;
+ wcc_data dir_wcc;
};
typedef struct mknod3resfail mknod3resfail;
struct mknod3res {
- nfsstat3 status;
- union {
- mknod3resok resok;
- mknod3resfail resfail;
- } mknod3res_u;
+ nfsstat3 status;
+ union {
+ mknod3resok resok;
+ mknod3resfail resfail;
+ } mknod3res_u;
};
typedef struct mknod3res mknod3res;
struct remove3args {
- diropargs3 object;
+ diropargs3 object;
};
typedef struct remove3args remove3args;
struct remove3resok {
- wcc_data dir_wcc;
+ wcc_data dir_wcc;
};
typedef struct remove3resok remove3resok;
struct remove3resfail {
- wcc_data dir_wcc;
+ wcc_data dir_wcc;
};
typedef struct remove3resfail remove3resfail;
struct remove3res {
- nfsstat3 status;
- union {
- remove3resok resok;
- remove3resfail resfail;
- } remove3res_u;
+ nfsstat3 status;
+ union {
+ remove3resok resok;
+ remove3resfail resfail;
+ } remove3res_u;
};
typedef struct remove3res remove3res;
struct rmdir3args {
- diropargs3 object;
+ diropargs3 object;
};
typedef struct rmdir3args rmdir3args;
struct rmdir3resok {
- wcc_data dir_wcc;
+ wcc_data dir_wcc;
};
typedef struct rmdir3resok rmdir3resok;
struct rmdir3resfail {
- wcc_data dir_wcc;
+ wcc_data dir_wcc;
};
typedef struct rmdir3resfail rmdir3resfail;
struct rmdir3res {
- nfsstat3 status;
- union {
- rmdir3resok resok;
- rmdir3resfail resfail;
- } rmdir3res_u;
+ nfsstat3 status;
+ union {
+ rmdir3resok resok;
+ rmdir3resfail resfail;
+ } rmdir3res_u;
};
typedef struct rmdir3res rmdir3res;
struct rename3args {
- diropargs3 from;
- diropargs3 to;
+ diropargs3 from;
+ diropargs3 to;
};
typedef struct rename3args rename3args;
struct rename3resok {
- wcc_data fromdir_wcc;
- wcc_data todir_wcc;
+ wcc_data fromdir_wcc;
+ wcc_data todir_wcc;
};
typedef struct rename3resok rename3resok;
struct rename3resfail {
- wcc_data fromdir_wcc;
- wcc_data todir_wcc;
+ wcc_data fromdir_wcc;
+ wcc_data todir_wcc;
};
typedef struct rename3resfail rename3resfail;
struct rename3res {
- nfsstat3 status;
- union {
- rename3resok resok;
- rename3resfail resfail;
- } rename3res_u;
+ nfsstat3 status;
+ union {
+ rename3resok resok;
+ rename3resfail resfail;
+ } rename3res_u;
};
typedef struct rename3res rename3res;
struct link3args {
- nfs_fh3 file;
- diropargs3 link;
+ nfs_fh3 file;
+ diropargs3 link;
};
typedef struct link3args link3args;
struct link3resok {
- post_op_attr file_attributes;
- wcc_data linkdir_wcc;
+ post_op_attr file_attributes;
+ wcc_data linkdir_wcc;
};
typedef struct link3resok link3resok;
struct link3resfail {
- post_op_attr file_attributes;
- wcc_data linkdir_wcc;
+ post_op_attr file_attributes;
+ wcc_data linkdir_wcc;
};
typedef struct link3resfail link3resfail;
struct link3res {
- nfsstat3 status;
- union {
- link3resok resok;
- link3resfail resfail;
- } link3res_u;
+ nfsstat3 status;
+ union {
+ link3resok resok;
+ link3resfail resfail;
+ } link3res_u;
};
typedef struct link3res link3res;
struct readdir3args {
- nfs_fh3 dir;
- cookie3 cookie;
- cookieverf3 cookieverf;
- count3 count;
+ nfs_fh3 dir;
+ cookie3 cookie;
+ cookieverf3 cookieverf;
+ count3 count;
};
typedef struct readdir3args readdir3args;
struct entry3 {
- fileid3 fileid;
- filename3 name;
- cookie3 cookie;
- struct entry3 *nextentry;
+ fileid3 fileid;
+ filename3 name;
+ cookie3 cookie;
+ struct entry3 *nextentry;
};
typedef struct entry3 entry3;
struct dirlist3 {
- entry3 *entries;
- bool_t eof;
+ entry3 *entries;
+ bool_t eof;
};
typedef struct dirlist3 dirlist3;
struct readdir3resok {
- post_op_attr dir_attributes;
- cookieverf3 cookieverf;
- dirlist3 reply;
+ post_op_attr dir_attributes;
+ cookieverf3 cookieverf;
+ dirlist3 reply;
};
typedef struct readdir3resok readdir3resok;
struct readdir3resfail {
- post_op_attr dir_attributes;
+ post_op_attr dir_attributes;
};
typedef struct readdir3resfail readdir3resfail;
struct readdir3res {
- nfsstat3 status;
- union {
- readdir3resok resok;
- readdir3resfail resfail;
- } readdir3res_u;
+ nfsstat3 status;
+ union {
+ readdir3resok resok;
+ readdir3resfail resfail;
+ } readdir3res_u;
};
typedef struct readdir3res readdir3res;
struct readdirp3args {
- nfs_fh3 dir;
- cookie3 cookie;
- cookieverf3 cookieverf;
- count3 dircount;
- count3 maxcount;
+ nfs_fh3 dir;
+ cookie3 cookie;
+ cookieverf3 cookieverf;
+ count3 dircount;
+ count3 maxcount;
};
typedef struct readdirp3args readdirp3args;
struct entryp3 {
- fileid3 fileid;
- filename3 name;
- cookie3 cookie;
- post_op_attr name_attributes;
- post_op_fh3 name_handle;
- struct entryp3 *nextentry;
+ fileid3 fileid;
+ filename3 name;
+ cookie3 cookie;
+ post_op_attr name_attributes;
+ post_op_fh3 name_handle;
+ struct entryp3 *nextentry;
};
typedef struct entryp3 entryp3;
struct dirlistp3 {
- entryp3 *entries;
- bool_t eof;
+ entryp3 *entries;
+ bool_t eof;
};
typedef struct dirlistp3 dirlistp3;
struct readdirp3resok {
- post_op_attr dir_attributes;
- cookieverf3 cookieverf;
- dirlistp3 reply;
+ post_op_attr dir_attributes;
+ cookieverf3 cookieverf;
+ dirlistp3 reply;
};
typedef struct readdirp3resok readdirp3resok;
struct readdirp3resfail {
- post_op_attr dir_attributes;
+ post_op_attr dir_attributes;
};
typedef struct readdirp3resfail readdirp3resfail;
struct readdirp3res {
- nfsstat3 status;
- union {
- readdirp3resok resok;
- readdirp3resfail resfail;
- } readdirp3res_u;
+ nfsstat3 status;
+ union {
+ readdirp3resok resok;
+ readdirp3resfail resfail;
+ } readdirp3res_u;
};
typedef struct readdirp3res readdirp3res;
struct fsstat3args {
- nfs_fh3 fsroot;
+ nfs_fh3 fsroot;
};
typedef struct fsstat3args fsstat3args;
struct fsstat3resok {
- post_op_attr obj_attributes;
- size3 tbytes;
- size3 fbytes;
- size3 abytes;
- size3 tfiles;
- size3 ffiles;
- size3 afiles;
- uint32 invarsec;
+ post_op_attr obj_attributes;
+ size3 tbytes;
+ size3 fbytes;
+ size3 abytes;
+ size3 tfiles;
+ size3 ffiles;
+ size3 afiles;
+ uint32 invarsec;
};
typedef struct fsstat3resok fsstat3resok;
struct fsstat3resfail {
- post_op_attr obj_attributes;
+ post_op_attr obj_attributes;
};
typedef struct fsstat3resfail fsstat3resfail;
struct fsstat3res {
- nfsstat3 status;
- union {
- fsstat3resok resok;
- fsstat3resfail resfail;
- } fsstat3res_u;
+ nfsstat3 status;
+ union {
+ fsstat3resok resok;
+ fsstat3resfail resfail;
+ } fsstat3res_u;
};
typedef struct fsstat3res fsstat3res;
#define FSF3_LINK 0x0001
@@ -841,93 +845,93 @@ typedef struct fsstat3res fsstat3res;
#define FSF3_CANSETTIME 0x0010
struct fsinfo3args {
- nfs_fh3 fsroot;
+ nfs_fh3 fsroot;
};
typedef struct fsinfo3args fsinfo3args;
struct fsinfo3resok {
- post_op_attr obj_attributes;
- uint32 rtmax;
- uint32 rtpref;
- uint32 rtmult;
- uint32 wtmax;
- uint32 wtpref;
- uint32 wtmult;
- uint32 dtpref;
- size3 maxfilesize;
- nfstime3 time_delta;
- uint32 properties;
+ post_op_attr obj_attributes;
+ uint32 rtmax;
+ uint32 rtpref;
+ uint32 rtmult;
+ uint32 wtmax;
+ uint32 wtpref;
+ uint32 wtmult;
+ uint32 dtpref;
+ size3 maxfilesize;
+ nfstime3 time_delta;
+ uint32 properties;
};
typedef struct fsinfo3resok fsinfo3resok;
struct fsinfo3resfail {
- post_op_attr obj_attributes;
+ post_op_attr obj_attributes;
};
typedef struct fsinfo3resfail fsinfo3resfail;
struct fsinfo3res {
- nfsstat3 status;
- union {
- fsinfo3resok resok;
- fsinfo3resfail resfail;
- } fsinfo3res_u;
+ nfsstat3 status;
+ union {
+ fsinfo3resok resok;
+ fsinfo3resfail resfail;
+ } fsinfo3res_u;
};
typedef struct fsinfo3res fsinfo3res;
struct pathconf3args {
- nfs_fh3 object;
+ nfs_fh3 object;
};
typedef struct pathconf3args pathconf3args;
struct pathconf3resok {
- post_op_attr obj_attributes;
- uint32 linkmax;
- uint32 name_max;
- bool_t no_trunc;
- bool_t chown_restricted;
- bool_t case_insensitive;
- bool_t case_preserving;
+ post_op_attr obj_attributes;
+ uint32 linkmax;
+ uint32 name_max;
+ bool_t no_trunc;
+ bool_t chown_restricted;
+ bool_t case_insensitive;
+ bool_t case_preserving;
};
typedef struct pathconf3resok pathconf3resok;
struct pathconf3resfail {
- post_op_attr obj_attributes;
+ post_op_attr obj_attributes;
};
typedef struct pathconf3resfail pathconf3resfail;
struct pathconf3res {
- nfsstat3 status;
- union {
- pathconf3resok resok;
- pathconf3resfail resfail;
- } pathconf3res_u;
+ nfsstat3 status;
+ union {
+ pathconf3resok resok;
+ pathconf3resfail resfail;
+ } pathconf3res_u;
};
typedef struct pathconf3res pathconf3res;
struct commit3args {
- nfs_fh3 file;
- offset3 offset;
- count3 count;
+ nfs_fh3 file;
+ offset3 offset;
+ count3 count;
};
typedef struct commit3args commit3args;
struct commit3resok {
- wcc_data file_wcc;
- writeverf3 verf;
+ wcc_data file_wcc;
+ writeverf3 verf;
};
typedef struct commit3resok commit3resok;
struct commit3resfail {
- wcc_data file_wcc;
+ wcc_data file_wcc;
};
typedef struct commit3resfail commit3resfail;
struct commit3res {
- nfsstat3 status;
- union {
- commit3resok resok;
- commit3resfail resfail;
- } commit3res_u;
+ nfsstat3 status;
+ union {
+ commit3resok resok;
+ commit3resfail resfail;
+ } commit3res_u;
};
typedef struct commit3res commit3res;
#define MNTPATHLEN 1024
@@ -935,8 +939,8 @@ typedef struct commit3res commit3res;
#define FHSIZE3 NFS3_FHSIZE
typedef struct {
- u_int fhandle3_len;
- char *fhandle3_val;
+ u_int fhandle3_len;
+ char *fhandle3_val;
} fhandle3;
typedef char *dirpath;
@@ -944,257 +948,404 @@ typedef char *dirpath;
typedef char *name;
enum mountstat3 {
- MNT3_OK = 0,
- MNT3ERR_PERM = 1,
- MNT3ERR_NOENT = 2,
- MNT3ERR_IO = 5,
- MNT3ERR_ACCES = 13,
- MNT3ERR_NOTDIR = 20,
- MNT3ERR_INVAL = 22,
- MNT3ERR_NAMETOOLONG = 63,
- MNT3ERR_NOTSUPP = 10004,
- MNT3ERR_SERVERFAULT = 10006,
+ MNT3_OK = 0,
+ MNT3ERR_PERM = 1,
+ MNT3ERR_NOENT = 2,
+ MNT3ERR_IO = 5,
+ MNT3ERR_ACCES = 13,
+ MNT3ERR_NOTDIR = 20,
+ MNT3ERR_INVAL = 22,
+ MNT3ERR_NAMETOOLONG = 63,
+ MNT3ERR_NOTSUPP = 10004,
+ MNT3ERR_SERVERFAULT = 10006,
};
typedef enum mountstat3 mountstat3;
struct mountres3_ok {
- fhandle3 fhandle;
- struct {
- u_int auth_flavors_len;
- int *auth_flavors_val;
- } auth_flavors;
+ fhandle3 fhandle;
+ struct {
+ u_int auth_flavors_len;
+ int *auth_flavors_val;
+ } auth_flavors;
};
typedef struct mountres3_ok mountres3_ok;
struct mountres3 {
- mountstat3 fhs_status;
- union {
- mountres3_ok mountinfo;
- } mountres3_u;
+ mountstat3 fhs_status;
+ union {
+ mountres3_ok mountinfo;
+ } mountres3_u;
};
typedef struct mountres3 mountres3;
typedef struct mountbody *mountlist;
struct mountbody {
- name ml_hostname;
- dirpath ml_directory;
- mountlist ml_next;
+ name ml_hostname;
+ dirpath ml_directory;
+ mountlist ml_next;
};
typedef struct mountbody mountbody;
typedef struct groupnode *groups;
struct groupnode {
- name gr_name;
- groups gr_next;
+ name gr_name;
+ groups gr_next;
};
typedef struct groupnode groupnode;
typedef struct exportnode *exports;
struct exportnode {
- dirpath ex_dir;
- groups ex_groups;
- exports ex_next;
+ dirpath ex_dir;
+ groups ex_groups;
+ exports ex_next;
};
typedef struct exportnode exportnode;
-#define NFS_PROGRAM 100003
-#define NFS_V3 3
-
-#define NFS3_NULL 0
-#define NFS3_GETATTR 1
-#define NFS3_SETATTR 2
-#define NFS3_LOOKUP 3
-#define NFS3_ACCESS 4
-#define NFS3_READLINK 5
-#define NFS3_READ 6
-#define NFS3_WRITE 7
-#define NFS3_CREATE 8
-#define NFS3_MKDIR 9
-#define NFS3_SYMLINK 10
-#define NFS3_MKNOD 11
-#define NFS3_REMOVE 12
-#define NFS3_RMDIR 13
-#define NFS3_RENAME 14
-#define NFS3_LINK 15
-#define NFS3_READDIR 16
-#define NFS3_READDIRP 17
-#define NFS3_FSSTAT 18
-#define NFS3_FSINFO 19
-#define NFS3_PATHCONF 20
-#define NFS3_COMMIT 21
-#define NFS3_PROC_COUNT 22
-
-#define MOUNT_PROGRAM 100005
-#define MOUNT_V3 3
-#define MOUNT_V1 1
-
-#define MOUNT3_NULL 0
-#define MOUNT3_MNT 1
-#define MOUNT3_DUMP 2
-#define MOUNT3_UMNT 3
-#define MOUNT3_UMNTALL 4
-#define MOUNT3_EXPORT 5
-#define MOUNT3_PROC_COUNT 6
-
-#define MOUNT1_NULL 0
-#define MOUNT1_MNT 1
-#define MOUNT1_DUMP 2
-#define MOUNT1_UMNT 3
-#define MOUNT1_UMNTALL 4
-#define MOUNT1_EXPORT 5
-#define MOUNT1_PROC_COUNT 6
+#define NFS_PROGRAM 100003
+#define NFS_V3 3
+
+#define NFS3_NULL 0
+#define NFS3_GETATTR 1
+#define NFS3_SETATTR 2
+#define NFS3_LOOKUP 3
+#define NFS3_ACCESS 4
+#define NFS3_READLINK 5
+#define NFS3_READ 6
+#define NFS3_WRITE 7
+#define NFS3_CREATE 8
+#define NFS3_MKDIR 9
+#define NFS3_SYMLINK 10
+#define NFS3_MKNOD 11
+#define NFS3_REMOVE 12
+#define NFS3_RMDIR 13
+#define NFS3_RENAME 14
+#define NFS3_LINK 15
+#define NFS3_READDIR 16
+#define NFS3_READDIRP 17
+#define NFS3_FSSTAT 18
+#define NFS3_FSINFO 19
+#define NFS3_PATHCONF 20
+#define NFS3_COMMIT 21
+#define NFS3_PROC_COUNT 22
+
+#define MOUNT_PROGRAM 100005
+#define MOUNT_V3 3
+#define MOUNT_V1 1
+
+#define MOUNT3_NULL 0
+#define MOUNT3_MNT 1
+#define MOUNT3_DUMP 2
+#define MOUNT3_UMNT 3
+#define MOUNT3_UMNTALL 4
+#define MOUNT3_EXPORT 5
+#define MOUNT3_PROC_COUNT 6
+
+#define MOUNT1_NULL 0
+#define MOUNT1_MNT 1
+#define MOUNT1_DUMP 2
+#define MOUNT1_UMNT 3
+#define MOUNT1_UMNTALL 4
+#define MOUNT1_EXPORT 5
+#define MOUNT1_PROC_COUNT 6
/* the xdr functions */
-extern bool_t xdr_uint64 (XDR *, uint64*);
-extern bool_t xdr_int64 (XDR *, int64*);
-extern bool_t xdr_uint32 (XDR *, uint32*);
-extern bool_t xdr_int32 (XDR *, int32*);
-extern bool_t xdr_filename3 (XDR *, filename3*);
-extern bool_t xdr_nfspath3 (XDR *, nfspath3*);
-extern bool_t xdr_fileid3 (XDR *, fileid3*);
-extern bool_t xdr_cookie3 (XDR *, cookie3*);
-extern bool_t xdr_cookieverf3 (XDR *, cookieverf3);
-extern bool_t xdr_createverf3 (XDR *, createverf3);
-extern bool_t xdr_writeverf3 (XDR *, writeverf3);
-extern bool_t xdr_uid3 (XDR *, uid3*);
-extern bool_t xdr_gid3 (XDR *, gid3*);
-extern bool_t xdr_size3 (XDR *, size3*);
-extern bool_t xdr_offset3 (XDR *, offset3*);
-extern bool_t xdr_mode3 (XDR *, mode3*);
-extern bool_t xdr_count3 (XDR *, count3*);
-extern bool_t xdr_nfsstat3 (XDR *, nfsstat3*);
-extern bool_t xdr_ftype3 (XDR *, ftype3*);
-extern bool_t xdr_specdata3 (XDR *, specdata3*);
-extern bool_t xdr_nfs_fh3 (XDR *, nfs_fh3*);
-extern bool_t xdr_nfstime3 (XDR *, nfstime3*);
-extern bool_t xdr_fattr3 (XDR *, fattr3*);
-extern bool_t xdr_post_op_attr (XDR *, post_op_attr*);
-extern bool_t xdr_wcc_attr (XDR *, wcc_attr*);
-extern bool_t xdr_pre_op_attr (XDR *, pre_op_attr*);
-extern bool_t xdr_wcc_data (XDR *, wcc_data*);
-extern bool_t xdr_post_op_fh3 (XDR *, post_op_fh3*);
-extern bool_t xdr_time_how (XDR *, time_how*);
-extern bool_t xdr_set_mode3 (XDR *, set_mode3*);
-extern bool_t xdr_set_uid3 (XDR *, set_uid3*);
-extern bool_t xdr_set_gid3 (XDR *, set_gid3*);
-extern bool_t xdr_set_size3 (XDR *, set_size3*);
-extern bool_t xdr_set_atime (XDR *, set_atime*);
-extern bool_t xdr_set_mtime (XDR *, set_mtime*);
-extern bool_t xdr_sattr3 (XDR *, sattr3*);
-extern bool_t xdr_diropargs3 (XDR *, diropargs3*);
-extern bool_t xdr_getattr3args (XDR *, getattr3args*);
-extern bool_t xdr_getattr3resok (XDR *, getattr3resok*);
-extern bool_t xdr_getattr3res (XDR *, getattr3res*);
-extern bool_t xdr_sattrguard3 (XDR *, sattrguard3*);
-extern bool_t xdr_setattr3args (XDR *, setattr3args*);
-extern bool_t xdr_setattr3resok (XDR *, setattr3resok*);
-extern bool_t xdr_setattr3resfail (XDR *, setattr3resfail*);
-extern bool_t xdr_setattr3res (XDR *, setattr3res*);
-extern bool_t xdr_lookup3args (XDR *, lookup3args*);
-extern bool_t xdr_lookup3resok (XDR *, lookup3resok*);
-extern bool_t xdr_lookup3resfail (XDR *, lookup3resfail*);
-extern bool_t xdr_lookup3res (XDR *, lookup3res*);
-extern bool_t xdr_access3args (XDR *, access3args*);
-extern bool_t xdr_access3resok (XDR *, access3resok*);
-extern bool_t xdr_access3resfail (XDR *, access3resfail*);
-extern bool_t xdr_access3res (XDR *, access3res*);
-extern bool_t xdr_readlink3args (XDR *, readlink3args*);
-extern bool_t xdr_readlink3resok (XDR *, readlink3resok*);
-extern bool_t xdr_readlink3resfail (XDR *, readlink3resfail*);
-extern bool_t xdr_readlink3res (XDR *, readlink3res*);
-extern bool_t xdr_read3args (XDR *, read3args*);
-extern bool_t xdr_read3resok (XDR *, read3resok*);
-extern bool_t xdr_read3resfail (XDR *, read3resfail*);
-extern bool_t xdr_read3res (XDR *, read3res*);
-extern bool_t xdr_read3res_nocopy (XDR *xdrs, read3res *objp);
-extern bool_t xdr_stable_how (XDR *, stable_how*);
-extern bool_t xdr_write3args (XDR *, write3args*);
-extern bool_t xdr_write3resok (XDR *, write3resok*);
-extern bool_t xdr_write3resfail (XDR *, write3resfail*);
-extern bool_t xdr_write3res (XDR *, write3res*);
-extern bool_t xdr_createmode3 (XDR *, createmode3*);
-extern bool_t xdr_createhow3 (XDR *, createhow3*);
-extern bool_t xdr_create3args (XDR *, create3args*);
-extern bool_t xdr_create3resok (XDR *, create3resok*);
-extern bool_t xdr_create3resfail (XDR *, create3resfail*);
-extern bool_t xdr_create3res (XDR *, create3res*);
-extern bool_t xdr_mkdir3args (XDR *, mkdir3args*);
-extern bool_t xdr_mkdir3resok (XDR *, mkdir3resok*);
-extern bool_t xdr_mkdir3resfail (XDR *, mkdir3resfail*);
-extern bool_t xdr_mkdir3res (XDR *, mkdir3res*);
-extern bool_t xdr_symlinkdata3 (XDR *, symlinkdata3*);
-extern bool_t xdr_symlink3args (XDR *, symlink3args*);
-extern bool_t xdr_symlink3resok (XDR *, symlink3resok*);
-extern bool_t xdr_symlink3resfail (XDR *, symlink3resfail*);
-extern bool_t xdr_symlink3res (XDR *, symlink3res*);
-extern bool_t xdr_devicedata3 (XDR *, devicedata3*);
-extern bool_t xdr_mknoddata3 (XDR *, mknoddata3*);
-extern bool_t xdr_mknod3args (XDR *, mknod3args*);
-extern bool_t xdr_mknod3resok (XDR *, mknod3resok*);
-extern bool_t xdr_mknod3resfail (XDR *, mknod3resfail*);
-extern bool_t xdr_mknod3res (XDR *, mknod3res*);
-extern bool_t xdr_remove3args (XDR *, remove3args*);
-extern bool_t xdr_remove3resok (XDR *, remove3resok*);
-extern bool_t xdr_remove3resfail (XDR *, remove3resfail*);
-extern bool_t xdr_remove3res (XDR *, remove3res*);
-extern bool_t xdr_rmdir3args (XDR *, rmdir3args*);
-extern bool_t xdr_rmdir3resok (XDR *, rmdir3resok*);
-extern bool_t xdr_rmdir3resfail (XDR *, rmdir3resfail*);
-extern bool_t xdr_rmdir3res (XDR *, rmdir3res*);
-extern bool_t xdr_rename3args (XDR *, rename3args*);
-extern bool_t xdr_rename3resok (XDR *, rename3resok*);
-extern bool_t xdr_rename3resfail (XDR *, rename3resfail*);
-extern bool_t xdr_rename3res (XDR *, rename3res*);
-extern bool_t xdr_link3args (XDR *, link3args*);
-extern bool_t xdr_link3resok (XDR *, link3resok*);
-extern bool_t xdr_link3resfail (XDR *, link3resfail*);
-extern bool_t xdr_link3res (XDR *, link3res*);
-extern bool_t xdr_readdir3args (XDR *, readdir3args*);
-extern bool_t xdr_entry3 (XDR *, entry3*);
-extern bool_t xdr_dirlist3 (XDR *, dirlist3*);
-extern bool_t xdr_readdir3resok (XDR *, readdir3resok*);
-extern bool_t xdr_readdir3resfail (XDR *, readdir3resfail*);
-extern bool_t xdr_readdir3res (XDR *, readdir3res*);
-extern bool_t xdr_readdirp3args (XDR *, readdirp3args*);
-extern bool_t xdr_entryp3 (XDR *, entryp3*);
-extern bool_t xdr_dirlistp3 (XDR *, dirlistp3*);
-extern bool_t xdr_readdirp3resok (XDR *, readdirp3resok*);
-extern bool_t xdr_readdirp3resfail (XDR *, readdirp3resfail*);
-extern bool_t xdr_readdirp3res (XDR *, readdirp3res*);
-extern bool_t xdr_fsstat3args (XDR *, fsstat3args*);
-extern bool_t xdr_fsstat3resok (XDR *, fsstat3resok*);
-extern bool_t xdr_fsstat3resfail (XDR *, fsstat3resfail*);
-extern bool_t xdr_fsstat3res (XDR *, fsstat3res*);
-extern bool_t xdr_fsinfo3args (XDR *, fsinfo3args*);
-extern bool_t xdr_fsinfo3resok (XDR *, fsinfo3resok*);
-extern bool_t xdr_fsinfo3resfail (XDR *, fsinfo3resfail*);
-extern bool_t xdr_fsinfo3res (XDR *, fsinfo3res*);
-extern bool_t xdr_pathconf3args (XDR *, pathconf3args*);
-extern bool_t xdr_pathconf3resok (XDR *, pathconf3resok*);
-extern bool_t xdr_pathconf3resfail (XDR *, pathconf3resfail*);
-extern bool_t xdr_pathconf3res (XDR *, pathconf3res*);
-extern bool_t xdr_commit3args (XDR *, commit3args*);
-extern bool_t xdr_commit3resok (XDR *, commit3resok*);
-extern bool_t xdr_commit3resfail (XDR *, commit3resfail*);
-extern bool_t xdr_commit3res (XDR *, commit3res*);
-extern bool_t xdr_fhandle3 (XDR *, fhandle3*);
-extern bool_t xdr_dirpath (XDR *, dirpath*);
-extern bool_t xdr_name (XDR *, name*);
-extern bool_t xdr_mountstat3 (XDR *, mountstat3*);
-extern bool_t xdr_mountres3_ok (XDR *, mountres3_ok*);
-extern bool_t xdr_mountres3 (XDR *, mountres3*);
-extern bool_t xdr_mountlist (XDR *, mountlist*);
-extern bool_t xdr_mountbody (XDR *, mountbody*);
-extern bool_t xdr_groups (XDR *, groups*);
-extern bool_t xdr_groupnode (XDR *, groupnode*);
-extern bool_t xdr_exports (XDR *, exports*);
-extern bool_t xdr_exportnode (XDR *, exportnode*);
-
-extern void xdr_free_exports_list (struct exportnode *first);
-extern void xdr_free_mountlist (mountlist ml);
-
-extern void xdr_free_write3args_nocopy (write3args *wa);
+extern bool_t
+xdr_uint64(XDR *, uint64 *);
+extern bool_t
+xdr_int64(XDR *, int64 *);
+extern bool_t
+xdr_uint32(XDR *, uint32 *);
+extern bool_t
+xdr_int32(XDR *, int32 *);
+extern bool_t
+xdr_filename3(XDR *, filename3 *);
+extern bool_t
+xdr_nfspath3(XDR *, nfspath3 *);
+extern bool_t
+xdr_fileid3(XDR *, fileid3 *);
+extern bool_t
+xdr_cookie3(XDR *, cookie3 *);
+extern bool_t
+xdr_cookieverf3(XDR *, cookieverf3);
+extern bool_t
+xdr_createverf3(XDR *, createverf3);
+extern bool_t
+xdr_writeverf3(XDR *, writeverf3);
+extern bool_t
+xdr_uid3(XDR *, uid3 *);
+extern bool_t
+xdr_gid3(XDR *, gid3 *);
+extern bool_t
+xdr_size3(XDR *, size3 *);
+extern bool_t
+xdr_offset3(XDR *, offset3 *);
+extern bool_t
+xdr_mode3(XDR *, mode3 *);
+extern bool_t
+xdr_count3(XDR *, count3 *);
+extern bool_t
+xdr_nfsstat3(XDR *, nfsstat3 *);
+extern bool_t
+xdr_ftype3(XDR *, ftype3 *);
+extern bool_t
+xdr_specdata3(XDR *, specdata3 *);
+extern bool_t
+xdr_nfs_fh3(XDR *, nfs_fh3 *);
+extern bool_t
+xdr_nfstime3(XDR *, nfstime3 *);
+extern bool_t
+xdr_fattr3(XDR *, fattr3 *);
+extern bool_t
+xdr_post_op_attr(XDR *, post_op_attr *);
+extern bool_t
+xdr_wcc_attr(XDR *, wcc_attr *);
+extern bool_t
+xdr_pre_op_attr(XDR *, pre_op_attr *);
+extern bool_t
+xdr_wcc_data(XDR *, wcc_data *);
+extern bool_t
+xdr_post_op_fh3(XDR *, post_op_fh3 *);
+extern bool_t
+xdr_time_how(XDR *, time_how *);
+extern bool_t
+xdr_set_mode3(XDR *, set_mode3 *);
+extern bool_t
+xdr_set_uid3(XDR *, set_uid3 *);
+extern bool_t
+xdr_set_gid3(XDR *, set_gid3 *);
+extern bool_t
+xdr_set_size3(XDR *, set_size3 *);
+extern bool_t
+xdr_set_atime(XDR *, set_atime *);
+extern bool_t
+xdr_set_mtime(XDR *, set_mtime *);
+extern bool_t
+xdr_sattr3(XDR *, sattr3 *);
+extern bool_t
+xdr_diropargs3(XDR *, diropargs3 *);
+extern bool_t
+xdr_getattr3args(XDR *, getattr3args *);
+extern bool_t
+xdr_getattr3resok(XDR *, getattr3resok *);
+extern bool_t
+xdr_getattr3res(XDR *, getattr3res *);
+extern bool_t
+xdr_sattrguard3(XDR *, sattrguard3 *);
+extern bool_t
+xdr_setattr3args(XDR *, setattr3args *);
+extern bool_t
+xdr_setattr3resok(XDR *, setattr3resok *);
+extern bool_t
+xdr_setattr3resfail(XDR *, setattr3resfail *);
+extern bool_t
+xdr_setattr3res(XDR *, setattr3res *);
+extern bool_t
+xdr_lookup3args(XDR *, lookup3args *);
+extern bool_t
+xdr_lookup3resok(XDR *, lookup3resok *);
+extern bool_t
+xdr_lookup3resfail(XDR *, lookup3resfail *);
+extern bool_t
+xdr_lookup3res(XDR *, lookup3res *);
+extern bool_t
+xdr_access3args(XDR *, access3args *);
+extern bool_t
+xdr_access3resok(XDR *, access3resok *);
+extern bool_t
+xdr_access3resfail(XDR *, access3resfail *);
+extern bool_t
+xdr_access3res(XDR *, access3res *);
+extern bool_t
+xdr_readlink3args(XDR *, readlink3args *);
+extern bool_t
+xdr_readlink3resok(XDR *, readlink3resok *);
+extern bool_t
+xdr_readlink3resfail(XDR *, readlink3resfail *);
+extern bool_t
+xdr_readlink3res(XDR *, readlink3res *);
+extern bool_t
+xdr_read3args(XDR *, read3args *);
+extern bool_t
+xdr_read3resok(XDR *, read3resok *);
+extern bool_t
+xdr_read3resfail(XDR *, read3resfail *);
+extern bool_t
+xdr_read3res(XDR *, read3res *);
+extern bool_t
+xdr_read3res_nocopy(XDR *xdrs, read3res *objp);
+extern bool_t
+xdr_stable_how(XDR *, stable_how *);
+extern bool_t
+xdr_write3args(XDR *, write3args *);
+extern bool_t
+xdr_write3resok(XDR *, write3resok *);
+extern bool_t
+xdr_write3resfail(XDR *, write3resfail *);
+extern bool_t
+xdr_write3res(XDR *, write3res *);
+extern bool_t
+xdr_createmode3(XDR *, createmode3 *);
+extern bool_t
+xdr_createhow3(XDR *, createhow3 *);
+extern bool_t
+xdr_create3args(XDR *, create3args *);
+extern bool_t
+xdr_create3resok(XDR *, create3resok *);
+extern bool_t
+xdr_create3resfail(XDR *, create3resfail *);
+extern bool_t
+xdr_create3res(XDR *, create3res *);
+extern bool_t
+xdr_mkdir3args(XDR *, mkdir3args *);
+extern bool_t
+xdr_mkdir3resok(XDR *, mkdir3resok *);
+extern bool_t
+xdr_mkdir3resfail(XDR *, mkdir3resfail *);
+extern bool_t
+xdr_mkdir3res(XDR *, mkdir3res *);
+extern bool_t
+xdr_symlinkdata3(XDR *, symlinkdata3 *);
+extern bool_t
+xdr_symlink3args(XDR *, symlink3args *);
+extern bool_t
+xdr_symlink3resok(XDR *, symlink3resok *);
+extern bool_t
+xdr_symlink3resfail(XDR *, symlink3resfail *);
+extern bool_t
+xdr_symlink3res(XDR *, symlink3res *);
+extern bool_t
+xdr_devicedata3(XDR *, devicedata3 *);
+extern bool_t
+xdr_mknoddata3(XDR *, mknoddata3 *);
+extern bool_t
+xdr_mknod3args(XDR *, mknod3args *);
+extern bool_t
+xdr_mknod3resok(XDR *, mknod3resok *);
+extern bool_t
+xdr_mknod3resfail(XDR *, mknod3resfail *);
+extern bool_t
+xdr_mknod3res(XDR *, mknod3res *);
+extern bool_t
+xdr_remove3args(XDR *, remove3args *);
+extern bool_t
+xdr_remove3resok(XDR *, remove3resok *);
+extern bool_t
+xdr_remove3resfail(XDR *, remove3resfail *);
+extern bool_t
+xdr_remove3res(XDR *, remove3res *);
+extern bool_t
+xdr_rmdir3args(XDR *, rmdir3args *);
+extern bool_t
+xdr_rmdir3resok(XDR *, rmdir3resok *);
+extern bool_t
+xdr_rmdir3resfail(XDR *, rmdir3resfail *);
+extern bool_t
+xdr_rmdir3res(XDR *, rmdir3res *);
+extern bool_t
+xdr_rename3args(XDR *, rename3args *);
+extern bool_t
+xdr_rename3resok(XDR *, rename3resok *);
+extern bool_t
+xdr_rename3resfail(XDR *, rename3resfail *);
+extern bool_t
+xdr_rename3res(XDR *, rename3res *);
+extern bool_t
+xdr_link3args(XDR *, link3args *);
+extern bool_t
+xdr_link3resok(XDR *, link3resok *);
+extern bool_t
+xdr_link3resfail(XDR *, link3resfail *);
+extern bool_t
+xdr_link3res(XDR *, link3res *);
+extern bool_t
+xdr_readdir3args(XDR *, readdir3args *);
+extern bool_t
+xdr_entry3(XDR *, entry3 *);
+extern bool_t
+xdr_dirlist3(XDR *, dirlist3 *);
+extern bool_t
+xdr_readdir3resok(XDR *, readdir3resok *);
+extern bool_t
+xdr_readdir3resfail(XDR *, readdir3resfail *);
+extern bool_t
+xdr_readdir3res(XDR *, readdir3res *);
+extern bool_t
+xdr_readdirp3args(XDR *, readdirp3args *);
+extern bool_t
+xdr_entryp3(XDR *, entryp3 *);
+extern bool_t
+xdr_dirlistp3(XDR *, dirlistp3 *);
+extern bool_t
+xdr_readdirp3resok(XDR *, readdirp3resok *);
+extern bool_t
+xdr_readdirp3resfail(XDR *, readdirp3resfail *);
+extern bool_t
+xdr_readdirp3res(XDR *, readdirp3res *);
+extern bool_t
+xdr_fsstat3args(XDR *, fsstat3args *);
+extern bool_t
+xdr_fsstat3resok(XDR *, fsstat3resok *);
+extern bool_t
+xdr_fsstat3resfail(XDR *, fsstat3resfail *);
+extern bool_t
+xdr_fsstat3res(XDR *, fsstat3res *);
+extern bool_t
+xdr_fsinfo3args(XDR *, fsinfo3args *);
+extern bool_t
+xdr_fsinfo3resok(XDR *, fsinfo3resok *);
+extern bool_t
+xdr_fsinfo3resfail(XDR *, fsinfo3resfail *);
+extern bool_t
+xdr_fsinfo3res(XDR *, fsinfo3res *);
+extern bool_t
+xdr_pathconf3args(XDR *, pathconf3args *);
+extern bool_t
+xdr_pathconf3resok(XDR *, pathconf3resok *);
+extern bool_t
+xdr_pathconf3resfail(XDR *, pathconf3resfail *);
+extern bool_t
+xdr_pathconf3res(XDR *, pathconf3res *);
+extern bool_t
+xdr_commit3args(XDR *, commit3args *);
+extern bool_t
+xdr_commit3resok(XDR *, commit3resok *);
+extern bool_t
+xdr_commit3resfail(XDR *, commit3resfail *);
+extern bool_t
+xdr_commit3res(XDR *, commit3res *);
+extern bool_t
+xdr_fhandle3(XDR *, fhandle3 *);
+extern bool_t
+xdr_dirpath(XDR *, dirpath *);
+extern bool_t
+xdr_name(XDR *, name *);
+extern bool_t
+xdr_mountstat3(XDR *, mountstat3 *);
+extern bool_t
+xdr_mountres3_ok(XDR *, mountres3_ok *);
+extern bool_t
+xdr_mountres3(XDR *, mountres3 *);
+extern bool_t
+xdr_mountlist(XDR *, mountlist *);
+extern bool_t
+xdr_mountbody(XDR *, mountbody *);
+extern bool_t
+xdr_groups(XDR *, groups *);
+extern bool_t
+xdr_groupnode(XDR *, groupnode *);
+extern bool_t
+xdr_exports(XDR *, exports *);
+extern bool_t
+xdr_exportnode(XDR *, exportnode *);
+
+extern void
+xdr_free_exports_list(struct exportnode *first);
+extern void
+xdr_free_mountlist(mountlist ml);
+
+extern void
+xdr_free_write3args_nocopy(write3args *wa);
#endif
diff --git a/tests/basic/logchecks-messages.h b/tests/basic/logchecks-messages.h
index 6344037b44a..1ae68646445 100644
--- a/tests/basic/logchecks-messages.h
+++ b/tests/basic/logchecks-messages.h
@@ -35,44 +35,70 @@
* holes.
*/
-#define GLFS_COMP_BASE 1000
-#define GLFS_NUM_MESSAGES 19
-#define GLFS_MSGID_END (GLFS_COMP_BASE + GLFS_NUM_MESSAGES + 1)
+#define GLFS_COMP_BASE 1000
+#define GLFS_NUM_MESSAGES 19
+#define GLFS_MSGID_END (GLFS_COMP_BASE + GLFS_NUM_MESSAGES + 1)
/* Messaged with message IDs */
#define glfs_msg_start_x GLFS_COMP_BASE, "Invalid: Start of messages"
/*------------*/
-#define logchecks_msg_1 (GLFS_COMP_BASE + 1), "Informational: Testing logging" \
- " in gluster"
-#define logchecks_msg_2 (GLFS_COMP_BASE + 2), "Informational: Format testing:" \
- " %d:%s:%x"
-#define logchecks_msg_3 (GLFS_COMP_BASE + 3), "Critical: Testing logging" \
- " in gluster"
-#define logchecks_msg_4 (GLFS_COMP_BASE + 4), "Critical: Format testing:" \
- " %d:%s:%x"
+#define logchecks_msg_1 \
+ (GLFS_COMP_BASE + 1), \
+ "Informational: Testing logging" \
+ " in gluster"
+#define logchecks_msg_2 \
+ (GLFS_COMP_BASE + 2), \
+ "Informational: Format testing:" \
+ " %d:%s:%x"
+#define logchecks_msg_3 \
+ (GLFS_COMP_BASE + 3), \
+ "Critical: Testing logging" \
+ " in gluster"
+#define logchecks_msg_4 \
+ (GLFS_COMP_BASE + 4), \
+ "Critical: Format testing:" \
+ " %d:%s:%x"
#define logchecks_msg_5 (GLFS_COMP_BASE + 5), "Critical: Rotated the log"
#define logchecks_msg_6 (GLFS_COMP_BASE + 6), "Critical: Flushed the log"
#define logchecks_msg_7 (GLFS_COMP_BASE + 7), "Informational: gf_msg_callingfn"
-#define logchecks_msg_8 (GLFS_COMP_BASE + 8), "Informational: " \
- "gf_msg_callingfn: Format testing: %d:%s:%x"
+#define logchecks_msg_8 \
+ (GLFS_COMP_BASE + 8), \
+ "Informational: " \
+ "gf_msg_callingfn: Format testing: %d:%s:%x"
#define logchecks_msg_9 (GLFS_COMP_BASE + 9), "Critical: gf_msg_callingfn"
-#define logchecks_msg_10 (GLFS_COMP_BASE + 10), "Critical: " \
- "gf_msg_callingfn: Format testing: %d:%s:%x"
+#define logchecks_msg_10 \
+ (GLFS_COMP_BASE + 10), \
+ "Critical: " \
+ "gf_msg_callingfn: Format testing: %d:%s:%x"
#define logchecks_msg_11 (GLFS_COMP_BASE + 11), "=========================="
-#define logchecks_msg_12 (GLFS_COMP_BASE + 12), "Test 1: Only stderr and" \
- " partial syslog"
-#define logchecks_msg_13 (GLFS_COMP_BASE + 13), "Test 2: Only checklog and" \
- " partial syslog"
-#define logchecks_msg_14 (GLFS_COMP_BASE + 14), "Test 5: Changing to" \
- " traditional format"
-#define logchecks_msg_15 (GLFS_COMP_BASE + 15), "Test 6: Changing log level" \
- " to critical and above"
+#define logchecks_msg_12 \
+ (GLFS_COMP_BASE + 12), \
+ "Test 1: Only stderr and" \
+ " partial syslog"
+#define logchecks_msg_13 \
+ (GLFS_COMP_BASE + 13), \
+ "Test 2: Only checklog and" \
+ " partial syslog"
+#define logchecks_msg_14 \
+ (GLFS_COMP_BASE + 14), \
+ "Test 5: Changing to" \
+ " traditional format"
+#define logchecks_msg_15 \
+ (GLFS_COMP_BASE + 15), \
+ "Test 6: Changing log level" \
+ " to critical and above"
#define logchecks_msg_16 (GLFS_COMP_BASE + 16), "Test 7: Only to syslog"
-#define logchecks_msg_17 (GLFS_COMP_BASE + 17), "Test 8: Only to syslog," \
- " traditional format"
-#define logchecks_msg_18 (GLFS_COMP_BASE + 18), "Test 9: Only to syslog," \
- " only critical and above"
-#define logchecks_msg_19 (GLFS_COMP_BASE + 19), "Pre init message, not to be" \
- " seen in logs"
+#define logchecks_msg_17 \
+ (GLFS_COMP_BASE + 17), \
+ "Test 8: Only to syslog," \
+ " traditional format"
+#define logchecks_msg_18 \
+ (GLFS_COMP_BASE + 18), \
+ "Test 9: Only to syslog," \
+ " only critical and above"
+#define logchecks_msg_19 \
+ (GLFS_COMP_BASE + 19), \
+ "Pre init message, not to be" \
+ " seen in logs"
/*------------*/
#define glfs_msg_end_x GLFS_MSGID_END, "Invalid: End of messages"
diff --git a/tests/utils/changelog/changelog.h b/tests/utils/changelog/changelog.h
index 14094cf3681..969a1f370c2 100644
--- a/tests/utils/changelog/changelog.h
+++ b/tests/utils/changelog/changelog.h
@@ -16,105 +16,104 @@ struct gf_brick_spec;
/**
* Max bit shiter for event selection
*/
-#define CHANGELOG_EV_SELECTION_RANGE 5
-
-#define CHANGELOG_OP_TYPE_JOURNAL (1<<0)
-#define CHANGELOG_OP_TYPE_OPEN (1<<1)
-#define CHANGELOG_OP_TYPE_CREATE (1<<2)
-#define CHANGELOG_OP_TYPE_RELEASE (1<<3)
-#define CHANGELOG_OP_TYPE_BR_RELEASE (1<<4) /* logical release (last close()),
- sent by bitrot stub */
-#define CHANGELOG_OP_TYPE_MAX (1<<CHANGELOG_EV_SELECTION_RANGE)
+#define CHANGELOG_EV_SELECTION_RANGE 5
+#define CHANGELOG_OP_TYPE_JOURNAL (1 << 0)
+#define CHANGELOG_OP_TYPE_OPEN (1 << 1)
+#define CHANGELOG_OP_TYPE_CREATE (1 << 2)
+#define CHANGELOG_OP_TYPE_RELEASE (1 << 3)
+#define CHANGELOG_OP_TYPE_BR_RELEASE \
+ (1 << 4) /* logical release (last close()), \
+ sent by bitrot stub */
+#define CHANGELOG_OP_TYPE_MAX (1 << CHANGELOG_EV_SELECTION_RANGE)
struct ev_open {
- unsigned char gfid[16];
- int32_t flags;
+ unsigned char gfid[16];
+ int32_t flags;
};
struct ev_creat {
- unsigned char gfid[16];
- int32_t flags;
+ unsigned char gfid[16];
+ int32_t flags;
};
struct ev_release {
- unsigned char gfid[16];
+ unsigned char gfid[16];
};
struct ev_release_br {
- unsigned long version;
- unsigned char gfid[16];
- int32_t sign_info;
+ unsigned long version;
+ unsigned char gfid[16];
+ int32_t sign_info;
};
struct ev_changelog {
- char path[PATH_MAX];
+ char path[PATH_MAX];
};
typedef struct changelog_event {
- unsigned int ev_type;
-
- union {
- struct ev_open open;
- struct ev_creat create;
- struct ev_release release;
- struct ev_changelog journal;
- struct ev_release_br releasebr;
- } u;
+ unsigned int ev_type;
+
+ union {
+ struct ev_open open;
+ struct ev_creat create;
+ struct ev_release release;
+ struct ev_changelog journal;
+ struct ev_release_br releasebr;
+ } u;
} changelog_event_t;
-#define CHANGELOG_EV_SIZE (sizeof (changelog_event_t))
+#define CHANGELOG_EV_SIZE (sizeof(changelog_event_t))
/**
* event callback, connected & disconnection defs
*/
-typedef void (CALLBACK) (void *, char *,
- void *, changelog_event_t *);
-typedef void *(INIT) (void *, struct gf_brick_spec *);
-typedef void (FINI) (void *, char *, void *);
-typedef void (CONNECT) (void *, char *, void *);
-typedef void (DISCONNECT) (void *, char *, void *);
+typedef void(CALLBACK)(void *, char *, void *, changelog_event_t *);
+typedef void *(INIT)(void *, struct gf_brick_spec *);
+typedef void(FINI)(void *, char *, void *);
+typedef void(CONNECT)(void *, char *, void *);
+typedef void(DISCONNECT)(void *, char *, void *);
struct gf_brick_spec {
- char *brick_path;
- unsigned int filter;
+ char *brick_path;
+ unsigned int filter;
- INIT *init;
- FINI *fini;
- CALLBACK *callback;
- CONNECT *connected;
- DISCONNECT *disconnected;
+ INIT *init;
+ FINI *fini;
+ CALLBACK *callback;
+ CONNECT *connected;
+ DISCONNECT *disconnected;
- void *ptr;
+ void *ptr;
};
/* API set */
int
-gf_changelog_register (char *brick_path, char *scratch_dir,
- char *log_file, int log_levl, int max_reconnects);
+gf_changelog_register(char *brick_path, char *scratch_dir, char *log_file,
+ int log_levl, int max_reconnects);
ssize_t
-gf_changelog_scan ();
+gf_changelog_scan();
int
-gf_changelog_start_fresh ();
+gf_changelog_start_fresh();
ssize_t
-gf_changelog_next_change (char *bufptr, size_t maxlen);
+gf_changelog_next_change(char *bufptr, size_t maxlen);
int
-gf_changelog_done (char *file);
+gf_changelog_done(char *file);
/* newer flexible API */
int
-gf_changelog_init (void *xl);
+gf_changelog_init(void *xl);
int
-gf_changelog_register_generic (struct gf_brick_spec *bricks, int count,
- int ordered, char *logfile, int lvl, void *xl);
+gf_changelog_register_generic(struct gf_brick_spec *bricks, int count,
+ int ordered, char *logfile, int lvl, void *xl);
int
-gf_history_changelog (char *changelog_dir, unsigned long start,
- unsigned long end, int n_parallel,
- unsigned long *actual_end);
+gf_history_changelog(char *changelog_dir, unsigned long start,
+ unsigned long end, int n_parallel,
+ unsigned long *actual_end);
#endif
diff --git a/xlators/cluster/afr/src/afr-dir-read.h b/xlators/cluster/afr/src/afr-dir-read.h
index 09456d15949..773e925ec6c 100644
--- a/xlators/cluster/afr/src/afr-dir-read.h
+++ b/xlators/cluster/afr/src/afr-dir-read.h
@@ -11,26 +11,23 @@
#ifndef __DIR_READ_H__
#define __DIR_READ_H__
-
int32_t
-afr_opendir (call_frame_t *frame, xlator_t *this,
- loc_t *loc, fd_t *fd, dict_t *xdata);
+afr_opendir(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd,
+ dict_t *xdata);
int32_t
-afr_releasedir (xlator_t *this, fd_t *fd);
+afr_releasedir(xlator_t *this, fd_t *fd);
int32_t
-afr_readdir (call_frame_t *frame, xlator_t *this,
- fd_t *fd, size_t size, off_t offset, dict_t *xdata);
-
+afr_readdir(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
+ off_t offset, dict_t *xdata);
int32_t
-afr_readdirp (call_frame_t *frame, xlator_t *this,
- fd_t *fd, size_t size, off_t offset, dict_t *dict);
+afr_readdirp(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
+ off_t offset, dict_t *dict);
int32_t
-afr_checksum (call_frame_t *frame, xlator_t *this,
- loc_t *loc, int32_t flags, dict_t *xdata);
-
+afr_checksum(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags,
+ dict_t *xdata);
#endif /* __DIR_READ_H__ */
diff --git a/xlators/cluster/afr/src/afr-dir-write.h b/xlators/cluster/afr/src/afr-dir-write.h
index 02f0a3682d9..1d88c3b9b26 100644
--- a/xlators/cluster/afr/src/afr-dir-write.h
+++ b/xlators/cluster/afr/src/afr-dir-write.h
@@ -12,36 +12,35 @@
#define __DIR_WRITE_H__
int32_t
-afr_create (call_frame_t *frame, xlator_t *this,
- loc_t *loc, int32_t flags, mode_t mode,
- mode_t umask, fd_t *fd, dict_t *xdata);
+afr_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags,
+ mode_t mode, mode_t umask, fd_t *fd, dict_t *xdata);
int32_t
-afr_mknod (call_frame_t *frame, xlator_t *this,
- loc_t *loc, mode_t mode, dev_t dev, mode_t umask, dict_t *xdata);
+afr_mknod(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode,
+ dev_t dev, mode_t umask, dict_t *xdata);
int32_t
-afr_mkdir (call_frame_t *frame, xlator_t *this,
- loc_t *loc, mode_t mode, mode_t umask, dict_t *xdata);
+afr_mkdir(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode,
+ mode_t umask, dict_t *xdata);
int32_t
-afr_unlink (call_frame_t *frame, xlator_t *this,
- loc_t *loc, int xflag, dict_t *xdata);
+afr_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag,
+ dict_t *xdata);
int32_t
-afr_rmdir (call_frame_t *frame, xlator_t *this,
- loc_t *loc, int flags, dict_t *xdata);
+afr_rmdir(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags,
+ dict_t *xdata);
int32_t
-afr_link (call_frame_t *frame, xlator_t *this,
- loc_t *oldloc, loc_t *newloc, dict_t *xdata);
+afr_link(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc,
+ dict_t *xdata);
int32_t
-afr_rename (call_frame_t *frame, xlator_t *this,
- loc_t *oldloc, loc_t *newloc, dict_t *xdata);
+afr_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc,
+ dict_t *xdata);
int
-afr_symlink (call_frame_t *frame, xlator_t *this,
- const char *linkpath, loc_t *oldloc, mode_t umask, dict_t *params);
+afr_symlink(call_frame_t *frame, xlator_t *this, const char *linkpath,
+ loc_t *oldloc, mode_t umask, dict_t *params);
#endif /* __DIR_WRITE_H__ */
diff --git a/xlators/cluster/afr/src/afr-inode-read.h b/xlators/cluster/afr/src/afr-inode-read.h
index d128134ef2a..1627ee2c426 100644
--- a/xlators/cluster/afr/src/afr-inode-read.h
+++ b/xlators/cluster/afr/src/afr-inode-read.h
@@ -12,34 +12,31 @@
#define __INODE_READ_H__
int32_t
-afr_access (call_frame_t *frame, xlator_t *this,
- loc_t *loc, int32_t mask, dict_t *xdata);
+afr_access(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t mask,
+ dict_t *xdata);
int32_t
-afr_stat (call_frame_t *frame, xlator_t *this,
- loc_t *loc, dict_t *xdata);
+afr_stat(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata);
int32_t
-afr_fstat (call_frame_t *frame, xlator_t *this,
- fd_t *fd, dict_t *xdata);
+afr_fstat(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata);
int32_t
-afr_readlink (call_frame_t *frame, xlator_t *this,
- loc_t *loc, size_t size, dict_t *xdata);
+afr_readlink(call_frame_t *frame, xlator_t *this, loc_t *loc, size_t size,
+ dict_t *xdata);
int32_t
-afr_readv (call_frame_t *frame, xlator_t *this,
- fd_t *fd, size_t size, off_t offset, uint32_t flags, dict_t *xdata);
+afr_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
+ off_t offset, uint32_t flags, dict_t *xdata);
int32_t
-afr_getxattr (call_frame_t *frame, xlator_t *this,
- loc_t *loc, const char *name, dict_t *xdata);
+afr_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name,
+ dict_t *xdata);
int32_t
-afr_fgetxattr (call_frame_t *frame, xlator_t *this,
- fd_t *fd, const char *name, dict_t *xdata);
-
+afr_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name,
+ dict_t *xdata);
int
-afr_handle_quota_size (call_frame_t *frame, xlator_t *this);
+afr_handle_quota_size(call_frame_t *frame, xlator_t *this);
#endif /* __INODE_READ_H__ */
diff --git a/xlators/cluster/afr/src/afr-inode-write.h b/xlators/cluster/afr/src/afr-inode-write.h
index 1e8bb5c12b3..a787069b7a1 100644
--- a/xlators/cluster/afr/src/afr-inode-write.h
+++ b/xlators/cluster/afr/src/afr-inode-write.h
@@ -12,83 +12,83 @@
#define __INODE_WRITE_H__
int32_t
-afr_chmod (call_frame_t *frame, xlator_t *this,
- loc_t *loc, mode_t mode, dict_t *xdata);
+afr_chmod(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode,
+ dict_t *xdata);
int32_t
-afr_chown (call_frame_t *frame, xlator_t *this,
- loc_t *loc, uid_t uid, gid_t gid, dict_t *xdata);
+afr_chown(call_frame_t *frame, xlator_t *this, loc_t *loc, uid_t uid, gid_t gid,
+ dict_t *xdata);
int
-afr_fchown (call_frame_t *frame, xlator_t *this,
- fd_t *fd, uid_t uid, gid_t gid, dict_t *xdata);
+afr_fchown(call_frame_t *frame, xlator_t *this, fd_t *fd, uid_t uid, gid_t gid,
+ dict_t *xdata);
int32_t
-afr_fchmod (call_frame_t *frame, xlator_t *this,
- fd_t *fd, mode_t mode, dict_t *xdata);
+afr_fchmod(call_frame_t *frame, xlator_t *this, fd_t *fd, mode_t mode,
+ dict_t *xdata);
int32_t
-afr_writev (call_frame_t *frame, xlator_t *this, fd_t *fd,
- struct iovec *vector, int32_t count, off_t offset,
- uint32_t flags, struct iobref *iobref, dict_t *xdata);
+afr_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector,
+ int32_t count, off_t offset, uint32_t flags, struct iobref *iobref,
+ dict_t *xdata);
int32_t
-afr_truncate (call_frame_t *frame, xlator_t *this,
- loc_t *loc, off_t offset, dict_t *xdata);
+afr_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset,
+ dict_t *xdata);
int32_t
-afr_ftruncate (call_frame_t *frame, xlator_t *this,
- fd_t *fd, off_t offset, dict_t *xdata);
+afr_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
+ dict_t *xdata);
int32_t
-afr_utimens (call_frame_t *frame, xlator_t *this,
- loc_t *loc, struct timespec tv[2], dict_t *xdata);
+afr_utimens(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ struct timespec tv[2], dict_t *xdata);
int
-afr_setattr (call_frame_t *frame, xlator_t *this,
- loc_t *loc, struct iatt *buf, int32_t valid, dict_t *xdata);
+afr_setattr(call_frame_t *frame, xlator_t *this, loc_t *loc, struct iatt *buf,
+ int32_t valid, dict_t *xdata);
int
-afr_fsetattr (call_frame_t *frame, xlator_t *this,
- fd_t *fd, struct iatt *buf, int32_t valid, dict_t *xdata);
+afr_fsetattr(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iatt *buf,
+ int32_t valid, dict_t *xdata);
int32_t
-afr_setxattr (call_frame_t *frame, xlator_t *this,
- loc_t *loc, dict_t *dict, int32_t flags, dict_t *xdata);
+afr_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict,
+ int32_t flags, dict_t *xdata);
int32_t
-afr_fsetxattr (call_frame_t *frame, xlator_t *this,
- fd_t *fd, dict_t *dict, int32_t flags, dict_t *xdata);
+afr_fsetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict,
+ int32_t flags, dict_t *xdata);
int32_t
-afr_removexattr (call_frame_t *frame, xlator_t *this,
- loc_t *loc, const char *name, dict_t *xdata);
+afr_removexattr(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ const char *name, dict_t *xdata);
int32_t
-afr_fremovexattr (call_frame_t *frame, xlator_t *this,
- fd_t *fd, const char *name, dict_t *xdata);
+afr_fremovexattr(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ const char *name, dict_t *xdata);
int
-afr_discard (call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
- size_t len, dict_t *xdata);
+afr_discard(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
+ size_t len, dict_t *xdata);
int
-afr_fallocate (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t mode,
- off_t offset, size_t len, dict_t *xdata);
+afr_fallocate(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t mode,
+ off_t offset, size_t len, dict_t *xdata);
int
afr_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
off_t len, dict_t *xdata);
int32_t
-afr_xattrop (call_frame_t *frame, xlator_t *this, loc_t *loc,
- gf_xattrop_flags_t optype, dict_t *xattr, dict_t *xdata);
+afr_xattrop(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ gf_xattrop_flags_t optype, dict_t *xattr, dict_t *xdata);
int32_t
-afr_fxattrop (call_frame_t *frame, xlator_t *this, fd_t *fd,
- gf_xattrop_flags_t optype, dict_t *xattr, dict_t *xdata);
+afr_fxattrop(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ gf_xattrop_flags_t optype, dict_t *xattr, dict_t *xdata);
int
-afr_fsync (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t datasync,
- dict_t *xdata);
+afr_fsync(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t datasync,
+ dict_t *xdata);
#endif /* __INODE_WRITE_H__ */
diff --git a/xlators/cluster/afr/src/afr-mem-types.h b/xlators/cluster/afr/src/afr-mem-types.h
index 2e1117fc18c..d62f7876bcd 100644
--- a/xlators/cluster/afr/src/afr-mem-types.h
+++ b/xlators/cluster/afr/src/afr-mem-types.h
@@ -8,47 +8,45 @@
cases as published by the Free Software Foundation.
*/
-
#ifndef __AFR_MEM_TYPES_H__
#define __AFR_MEM_TYPES_H__
#include "mem-types.h"
enum gf_afr_mem_types_ {
- gf_afr_mt_iovec = gf_common_mt_end + 1,
- gf_afr_mt_afr_fd_ctx_t,
- gf_afr_mt_afr_private_t,
- gf_afr_mt_int32_t,
- gf_afr_mt_char,
- gf_afr_mt_xattr_key,
- gf_afr_mt_dict_t,
- gf_afr_mt_xlator_t,
- gf_afr_mt_iatt,
- gf_afr_mt_int,
- gf_afr_mt_afr_node_character,
- gf_afr_mt_sh_diff_loop_state,
- gf_afr_mt_uint8_t,
- gf_afr_mt_loc_t,
- gf_afr_mt_entry_name,
- gf_afr_mt_pump_priv,
- gf_afr_mt_locked_fd,
- gf_afr_mt_inode_ctx_t,
- gf_afr_fd_paused_call_t,
- gf_afr_mt_crawl_data_t,
- gf_afr_mt_brick_pos_t,
- gf_afr_mt_shd_bool_t,
- gf_afr_mt_shd_timer_t,
- gf_afr_mt_shd_event_t,
- gf_afr_mt_time_t,
- gf_afr_mt_pos_data_t,
- gf_afr_mt_reply_t,
- gf_afr_mt_subvol_healer_t,
- gf_afr_mt_spbc_timeout_t,
- gf_afr_mt_spb_status_t,
- gf_afr_mt_empty_brick_t,
- gf_afr_mt_child_latency_t,
- gf_afr_mt_atomic_t,
+ gf_afr_mt_iovec = gf_common_mt_end + 1,
+ gf_afr_mt_afr_fd_ctx_t,
+ gf_afr_mt_afr_private_t,
+ gf_afr_mt_int32_t,
+ gf_afr_mt_char,
+ gf_afr_mt_xattr_key,
+ gf_afr_mt_dict_t,
+ gf_afr_mt_xlator_t,
+ gf_afr_mt_iatt,
+ gf_afr_mt_int,
+ gf_afr_mt_afr_node_character,
+ gf_afr_mt_sh_diff_loop_state,
+ gf_afr_mt_uint8_t,
+ gf_afr_mt_loc_t,
+ gf_afr_mt_entry_name,
+ gf_afr_mt_pump_priv,
+ gf_afr_mt_locked_fd,
+ gf_afr_mt_inode_ctx_t,
+ gf_afr_fd_paused_call_t,
+ gf_afr_mt_crawl_data_t,
+ gf_afr_mt_brick_pos_t,
+ gf_afr_mt_shd_bool_t,
+ gf_afr_mt_shd_timer_t,
+ gf_afr_mt_shd_event_t,
+ gf_afr_mt_time_t,
+ gf_afr_mt_pos_data_t,
+ gf_afr_mt_reply_t,
+ gf_afr_mt_subvol_healer_t,
+ gf_afr_mt_spbc_timeout_t,
+ gf_afr_mt_spb_status_t,
+ gf_afr_mt_empty_brick_t,
+ gf_afr_mt_child_latency_t,
+ gf_afr_mt_atomic_t,
gf_afr_mt_end
};
#endif
-
diff --git a/xlators/cluster/afr/src/afr-messages.h b/xlators/cluster/afr/src/afr-messages.h
index 8aa94730158..696336889d3 100644
--- a/xlators/cluster/afr/src/afr-messages.h
+++ b/xlators/cluster/afr/src/afr-messages.h
@@ -23,51 +23,25 @@
* glfs-message-id.h.
*/
-GLFS_MSGID(AFR,
- AFR_MSG_QUORUM_FAIL,
- AFR_MSG_QUORUM_MET,
- AFR_MSG_QUORUM_OVERRIDE,
- AFR_MSG_INVALID_CHILD_UP,
- AFR_MSG_SUBVOL_UP,
- AFR_MSG_SUBVOLS_DOWN,
- AFR_MSG_ENTRY_UNLOCK_FAIL,
- AFR_MSG_SPLIT_BRAIN,
- AFR_MSG_OPEN_FAIL,
- AFR_MSG_UNLOCK_FAIL,
- AFR_MSG_REPLACE_BRICK_STATUS,
- AFR_MSG_GFID_NULL,
- AFR_MSG_FD_CREATE_FAILED,
- AFR_MSG_DICT_SET_FAILED,
- AFR_MSG_EXPUNGING_FILE_OR_DIR,
- AFR_MSG_MIGRATION_IN_PROGRESS,
- AFR_MSG_CHILD_MISCONFIGURED,
- AFR_MSG_VOL_MISCONFIGURED,
- AFR_MSG_BLOCKING_LKS_FAILED,
- AFR_MSG_INVALID_FD,
- AFR_MSG_LOCK_INFO,
- AFR_MSG_LOCK_XLATOR_NOT_LOADED,
- AFR_MSG_FD_CTX_GET_FAILED,
- AFR_MSG_INVALID_SUBVOL,
- AFR_MSG_PUMP_XLATOR_ERROR,
- AFR_MSG_SELF_HEAL_INFO,
- AFR_MSG_READ_SUBVOL_ERROR,
- AFR_MSG_DICT_GET_FAILED,
- AFR_MSG_INFO_COMMON,
- AFR_MSG_SPLIT_BRAIN_CHOICE_ERROR,
- AFR_MSG_LOCAL_CHILD,
- AFR_MSG_INVALID_DATA,
- AFR_MSG_INVALID_ARG,
- AFR_MSG_INDEX_DIR_GET_FAILED,
- AFR_MSG_FSYNC_FAILED,
- AFR_MSG_FAVORITE_CHILD,
- AFR_MSG_SELF_HEAL_FAILED,
- AFR_MSG_SPLIT_BRAIN_STATUS,
- AFR_MSG_ADD_BRICK_STATUS,
- AFR_MSG_NO_CHANGELOG,
- AFR_MSG_TIMER_CREATE_FAIL,
- AFR_MSG_SBRAIN_FAV_CHILD_POLICY,
- AFR_MSG_INODE_CTX_GET_FAILED,
- AFR_MSG_THIN_ARB
-);
+GLFS_MSGID(AFR, AFR_MSG_QUORUM_FAIL, AFR_MSG_QUORUM_MET,
+ AFR_MSG_QUORUM_OVERRIDE, AFR_MSG_INVALID_CHILD_UP, AFR_MSG_SUBVOL_UP,
+ AFR_MSG_SUBVOLS_DOWN, AFR_MSG_ENTRY_UNLOCK_FAIL, AFR_MSG_SPLIT_BRAIN,
+ AFR_MSG_OPEN_FAIL, AFR_MSG_UNLOCK_FAIL, AFR_MSG_REPLACE_BRICK_STATUS,
+ AFR_MSG_GFID_NULL, AFR_MSG_FD_CREATE_FAILED, AFR_MSG_DICT_SET_FAILED,
+ AFR_MSG_EXPUNGING_FILE_OR_DIR, AFR_MSG_MIGRATION_IN_PROGRESS,
+ AFR_MSG_CHILD_MISCONFIGURED, AFR_MSG_VOL_MISCONFIGURED,
+ AFR_MSG_BLOCKING_LKS_FAILED, AFR_MSG_INVALID_FD, AFR_MSG_LOCK_INFO,
+ AFR_MSG_LOCK_XLATOR_NOT_LOADED, AFR_MSG_FD_CTX_GET_FAILED,
+ AFR_MSG_INVALID_SUBVOL, AFR_MSG_PUMP_XLATOR_ERROR,
+ AFR_MSG_SELF_HEAL_INFO, AFR_MSG_READ_SUBVOL_ERROR,
+ AFR_MSG_DICT_GET_FAILED, AFR_MSG_INFO_COMMON,
+ AFR_MSG_SPLIT_BRAIN_CHOICE_ERROR, AFR_MSG_LOCAL_CHILD,
+ AFR_MSG_INVALID_DATA, AFR_MSG_INVALID_ARG,
+ AFR_MSG_INDEX_DIR_GET_FAILED, AFR_MSG_FSYNC_FAILED,
+ AFR_MSG_FAVORITE_CHILD, AFR_MSG_SELF_HEAL_FAILED,
+ AFR_MSG_SPLIT_BRAIN_STATUS, AFR_MSG_ADD_BRICK_STATUS,
+ AFR_MSG_NO_CHANGELOG, AFR_MSG_TIMER_CREATE_FAIL,
+ AFR_MSG_SBRAIN_FAV_CHILD_POLICY, AFR_MSG_INODE_CTX_GET_FAILED,
+ AFR_MSG_THIN_ARB);
#endif /* !_AFR_MESSAGES_H_ */
diff --git a/xlators/cluster/afr/src/afr-self-heal.h b/xlators/cluster/afr/src/afr-self-heal.h
index 9836e2fbc03..545e67f774d 100644
--- a/xlators/cluster/afr/src/afr-self-heal.h
+++ b/xlators/cluster/afr/src/afr-self-heal.h
@@ -8,7 +8,6 @@
cases as published by the Free Software Foundation.
*/
-
#ifndef _AFR_SELFHEAL_H
#define _AFR_SELFHEAL_H
@@ -16,257 +15,257 @@
/* Perform fop on all UP subvolumes and wait for all callbacks to return */
-#define AFR_ONALL(frame, rfn, fop, args ...) do { \
- afr_local_t *__local = frame->local; \
- afr_private_t *__priv = frame->this->private; \
- int __i = 0, __count = 0; \
- unsigned char *__child_up = NULL; \
- \
- __child_up = alloca0 (__priv->child_count); \
- memcpy (__child_up, __priv->child_up, \
- sizeof (*__child_up) * __priv->child_count); \
- __count = AFR_COUNT (__child_up, __priv->child_count); \
- \
- __local->barrier.waitfor = __count; \
- afr_local_replies_wipe (__local, __priv); \
- \
- for (__i = 0; __i < __priv->child_count; __i++) { \
- if (!__child_up[__i]) \
- continue; \
- STACK_WIND_COOKIE (frame, rfn, (void *)(long) __i, \
- __priv->children[__i], \
- __priv->children[__i]->fops->fop, args); \
- } \
- syncbarrier_wait (&__local->barrier, __count); \
- } while (0)
-
+#define AFR_ONALL(frame, rfn, fop, args...) \
+ do { \
+ afr_local_t *__local = frame->local; \
+ afr_private_t *__priv = frame->this->private; \
+ int __i = 0, __count = 0; \
+ unsigned char *__child_up = NULL; \
+ \
+ __child_up = alloca0(__priv->child_count); \
+ memcpy(__child_up, __priv->child_up, \
+ sizeof(*__child_up) * __priv->child_count); \
+ __count = AFR_COUNT(__child_up, __priv->child_count); \
+ \
+ __local->barrier.waitfor = __count; \
+ afr_local_replies_wipe(__local, __priv); \
+ \
+ for (__i = 0; __i < __priv->child_count; __i++) { \
+ if (!__child_up[__i]) \
+ continue; \
+ STACK_WIND_COOKIE(frame, rfn, (void *)(long)__i, \
+ __priv->children[__i], \
+ __priv->children[__i]->fops->fop, args); \
+ } \
+ syncbarrier_wait(&__local->barrier, __count); \
+ } while (0)
/* Perform fop on all subvolumes represented by list[] array and wait
for all callbacks to return */
-#define AFR_ONLIST(list, frame, rfn, fop, args ...) do { \
- afr_local_t *__local = frame->local; \
- afr_private_t *__priv = frame->this->private; \
- int __i = 0; \
- int __count = AFR_COUNT (list, __priv->child_count); \
- \
- __local->barrier.waitfor = __count; \
- afr_local_replies_wipe (__local, __priv); \
- \
- for (__i = 0; __i < __priv->child_count; __i++) { \
- if (!list[__i]) continue; \
- STACK_WIND_COOKIE (frame, rfn, (void *)(long) __i, \
- __priv->children[__i], \
- __priv->children[__i]->fops->fop, args); \
- } \
- syncbarrier_wait (&__local->barrier, __count); \
- } while (0)
-
-
-#define AFR_SEQ(frame, rfn, fop, args ...) do { \
- afr_local_t *__local = frame->local; \
- afr_private_t *__priv = frame->this->private; \
- int __i = 0; \
- \
- afr_local_replies_wipe (__local, __priv); \
- \
- for (__i = 0; __i < __priv->child_count; __i++) { \
- if (!__priv->child_up[__i]) continue; \
- STACK_WIND_COOKIE (frame, rfn, (void *)(long) __i, \
- __priv->children[__i], \
- __priv->children[__i]->fops->fop, args); \
- syncbarrier_wait (&__local->barrier, 1); \
- } \
- } while (0)
-
-
-#define ALLOC_MATRIX(n, type) ({type **__ptr = NULL; \
- int __i; \
- __ptr = alloca0 (n * sizeof(type *)); \
- for (__i = 0; __i < n; __i++) __ptr[__i] = alloca0 (n * sizeof(type)); \
- __ptr;})
-
-
-#define IA_EQUAL(f,s,field) (memcmp (&(f.ia_##field), &(s.ia_##field), sizeof (s.ia_##field)) == 0)
-
-#define SBRAIN_HEAL_NO_GO_MSG "Failed to obtain replies from all bricks of "\
- "the replica (are they up?). Cannot resolve split-brain."
-int
-afr_selfheal (xlator_t *this, uuid_t gfid);
+#define AFR_ONLIST(list, frame, rfn, fop, args...) \
+ do { \
+ afr_local_t *__local = frame->local; \
+ afr_private_t *__priv = frame->this->private; \
+ int __i = 0; \
+ int __count = AFR_COUNT(list, __priv->child_count); \
+ \
+ __local->barrier.waitfor = __count; \
+ afr_local_replies_wipe(__local, __priv); \
+ \
+ for (__i = 0; __i < __priv->child_count; __i++) { \
+ if (!list[__i]) \
+ continue; \
+ STACK_WIND_COOKIE(frame, rfn, (void *)(long)__i, \
+ __priv->children[__i], \
+ __priv->children[__i]->fops->fop, args); \
+ } \
+ syncbarrier_wait(&__local->barrier, __count); \
+ } while (0)
+
+#define AFR_SEQ(frame, rfn, fop, args...) \
+ do { \
+ afr_local_t *__local = frame->local; \
+ afr_private_t *__priv = frame->this->private; \
+ int __i = 0; \
+ \
+ afr_local_replies_wipe(__local, __priv); \
+ \
+ for (__i = 0; __i < __priv->child_count; __i++) { \
+ if (!__priv->child_up[__i]) \
+ continue; \
+ STACK_WIND_COOKIE(frame, rfn, (void *)(long)__i, \
+ __priv->children[__i], \
+ __priv->children[__i]->fops->fop, args); \
+ syncbarrier_wait(&__local->barrier, 1); \
+ } \
+ } while (0)
+
+#define ALLOC_MATRIX(n, type) \
+ ({ \
+ type **__ptr = NULL; \
+ int __i; \
+ __ptr = alloca0(n * sizeof(type *)); \
+ for (__i = 0; __i < n; __i++) \
+ __ptr[__i] = alloca0(n * sizeof(type)); \
+ __ptr; \
+ })
+
+#define IA_EQUAL(f, s, field) \
+ (memcmp(&(f.ia_##field), &(s.ia_##field), sizeof(s.ia_##field)) == 0)
+
+#define SBRAIN_HEAL_NO_GO_MSG \
+ "Failed to obtain replies from all bricks of " \
+ "the replica (are they up?). Cannot resolve split-brain."
+int
+afr_selfheal(xlator_t *this, uuid_t gfid);
gf_boolean_t
-afr_throttled_selfheal (call_frame_t *frame, xlator_t *this);
+afr_throttled_selfheal(call_frame_t *frame, xlator_t *this);
int
-afr_selfheal_name (xlator_t *this, uuid_t gfid, const char *name,
- void *gfid_req, dict_t *xdata);
+afr_selfheal_name(xlator_t *this, uuid_t gfid, const char *name, void *gfid_req,
+ dict_t *xdata);
int
-afr_selfheal_data (call_frame_t *frame, xlator_t *this, fd_t *fd);
+afr_selfheal_data(call_frame_t *frame, xlator_t *this, fd_t *fd);
int
-afr_selfheal_metadata (call_frame_t *frame, xlator_t *this, inode_t *inode);
+afr_selfheal_metadata(call_frame_t *frame, xlator_t *this, inode_t *inode);
int
-afr_selfheal_entry (call_frame_t *frame, xlator_t *this, inode_t *inode);
+afr_selfheal_entry(call_frame_t *frame, xlator_t *this, inode_t *inode);
int
-afr_lookup_and_heal_gfid (xlator_t *this, inode_t *parent, const char *name,
- inode_t *inode, struct afr_reply *replies, int source,
- unsigned char *sources, void *gfid);
+afr_lookup_and_heal_gfid(xlator_t *this, inode_t *parent, const char *name,
+ inode_t *inode, struct afr_reply *replies, int source,
+ unsigned char *sources, void *gfid);
int
-afr_selfheal_inodelk (call_frame_t *frame, xlator_t *this, inode_t *inode,
- char *dom, off_t off, size_t size,
- unsigned char *locked_on);
+afr_selfheal_inodelk(call_frame_t *frame, xlator_t *this, inode_t *inode,
+ char *dom, off_t off, size_t size,
+ unsigned char *locked_on);
int
-afr_selfheal_tryinodelk (call_frame_t *frame, xlator_t *this, inode_t *inode,
- char *dom, off_t off, size_t size,
- unsigned char *locked_on);
+afr_selfheal_tryinodelk(call_frame_t *frame, xlator_t *this, inode_t *inode,
+ char *dom, off_t off, size_t size,
+ unsigned char *locked_on);
int
-afr_selfheal_tie_breaker_inodelk (call_frame_t *frame, xlator_t *this,
- inode_t *inode, char *dom, off_t off,
- size_t size, unsigned char *locked_on);
+afr_selfheal_tie_breaker_inodelk(call_frame_t *frame, xlator_t *this,
+ inode_t *inode, char *dom, off_t off,
+ size_t size, unsigned char *locked_on);
int
-afr_selfheal_uninodelk (call_frame_t *frame, xlator_t *this, inode_t *inode,
- char *dom, off_t off, size_t size,
- const unsigned char *locked_on);
+afr_selfheal_uninodelk(call_frame_t *frame, xlator_t *this, inode_t *inode,
+ char *dom, off_t off, size_t size,
+ const unsigned char *locked_on);
int
-afr_selfheal_entrylk (call_frame_t *frame, xlator_t *this, inode_t *inode,
- char *dom, const char *name, unsigned char *locked_on);
+afr_selfheal_entrylk(call_frame_t *frame, xlator_t *this, inode_t *inode,
+ char *dom, const char *name, unsigned char *locked_on);
int
-afr_selfheal_tryentrylk (call_frame_t *frame, xlator_t *this, inode_t *inode,
- char *dom, const char *name, unsigned char *locked_on);
+afr_selfheal_tryentrylk(call_frame_t *frame, xlator_t *this, inode_t *inode,
+ char *dom, const char *name, unsigned char *locked_on);
int
-afr_selfheal_tie_breaker_entrylk (call_frame_t *frame, xlator_t *this,
- inode_t *inode, char *dom, const char *name,
- unsigned char *locked_on);
+afr_selfheal_tie_breaker_entrylk(call_frame_t *frame, xlator_t *this,
+ inode_t *inode, char *dom, const char *name,
+ unsigned char *locked_on);
int
-afr_selfheal_unentrylk (call_frame_t *frame, xlator_t *this, inode_t *inode,
- char *dom, const char *name, unsigned char *locked_on,
- dict_t *xdata);
+afr_selfheal_unentrylk(call_frame_t *frame, xlator_t *this, inode_t *inode,
+ char *dom, const char *name, unsigned char *locked_on,
+ dict_t *xdata);
int
-afr_selfheal_unlocked_discover (call_frame_t *frame, inode_t *inode,
- uuid_t gfid, struct afr_reply *replies);
+afr_selfheal_unlocked_discover(call_frame_t *frame, inode_t *inode, uuid_t gfid,
+ struct afr_reply *replies);
int
-afr_selfheal_unlocked_discover_on (call_frame_t *frame, inode_t *inode,
+afr_selfheal_unlocked_discover_on(call_frame_t *frame, inode_t *inode,
uuid_t gfid, struct afr_reply *replies,
- unsigned char *discover_on);
+ unsigned char *discover_on);
inode_t *
-afr_selfheal_unlocked_lookup_on (call_frame_t *frame, inode_t *parent,
- const char *name, struct afr_reply *replies,
- unsigned char *lookup_on, dict_t *xattr);
+afr_selfheal_unlocked_lookup_on(call_frame_t *frame, inode_t *parent,
+ const char *name, struct afr_reply *replies,
+ unsigned char *lookup_on, dict_t *xattr);
int
-afr_selfheal_find_direction (call_frame_t *frame, xlator_t *this,
- struct afr_reply *replies,
- afr_transaction_type type,
- unsigned char *locked_on, unsigned char *sources,
- unsigned char *sinks, uint64_t *witness,
- gf_boolean_t *flag);
+afr_selfheal_find_direction(call_frame_t *frame, xlator_t *this,
+ struct afr_reply *replies,
+ afr_transaction_type type, unsigned char *locked_on,
+ unsigned char *sources, unsigned char *sinks,
+ uint64_t *witness, gf_boolean_t *flag);
int
-afr_selfheal_fill_matrix (xlator_t *this, int **matrix, int subvol, int idx,
- dict_t *xdata);
+afr_selfheal_fill_matrix(xlator_t *this, int **matrix, int subvol, int idx,
+ dict_t *xdata);
int
-afr_selfheal_extract_xattr (xlator_t *this, struct afr_reply *replies,
- afr_transaction_type type, int *dirty, int **matrix);
+afr_selfheal_extract_xattr(xlator_t *this, struct afr_reply *replies,
+ afr_transaction_type type, int *dirty, int **matrix);
int
-afr_sh_generic_fop_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int op_ret, int op_errno, struct iatt *pre,
- struct iatt *post, dict_t *xdata);
+afr_sh_generic_fop_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int op_ret, int op_errno, struct iatt *pre,
+ struct iatt *post, dict_t *xdata);
int
-afr_selfheal_restore_time (call_frame_t *frame, xlator_t *this, inode_t *inode,
- int source, unsigned char *healed_sinks,
- struct afr_reply *replies);
+afr_selfheal_restore_time(call_frame_t *frame, xlator_t *this, inode_t *inode,
+ int source, unsigned char *healed_sinks,
+ struct afr_reply *replies);
int
-afr_selfheal_undo_pending (call_frame_t *frame, xlator_t *this, inode_t *inode,
- unsigned char *sources, unsigned char *sinks,
- unsigned char *healed_sinks,
- unsigned char *undid_pending,
- afr_transaction_type type, struct afr_reply *replies,
- unsigned char *locked_on);
+afr_selfheal_undo_pending(call_frame_t *frame, xlator_t *this, inode_t *inode,
+ unsigned char *sources, unsigned char *sinks,
+ unsigned char *healed_sinks,
+ unsigned char *undid_pending,
+ afr_transaction_type type, struct afr_reply *replies,
+ unsigned char *locked_on);
int
-afr_selfheal_recreate_entry (call_frame_t *frame, int dst, int source,
- unsigned char *sources,
- inode_t *dir, const char *name, inode_t *inode,
- struct afr_reply *replies);
+afr_selfheal_recreate_entry(call_frame_t *frame, int dst, int source,
+ unsigned char *sources, inode_t *dir,
+ const char *name, inode_t *inode,
+ struct afr_reply *replies);
int
-afr_selfheal_post_op (call_frame_t *frame, xlator_t *this, inode_t *inode,
- int subvol, dict_t *xattr, dict_t *xdata);
+afr_selfheal_post_op(call_frame_t *frame, xlator_t *this, inode_t *inode,
+ int subvol, dict_t *xattr, dict_t *xdata);
call_frame_t *
-afr_frame_create (xlator_t *this, int32_t *op_errno);
+afr_frame_create(xlator_t *this, int32_t *op_errno);
inode_t *
-afr_inode_find (xlator_t *this, uuid_t gfid);
+afr_inode_find(xlator_t *this, uuid_t gfid);
int
-afr_selfheal_discover_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int op_ret, int op_errno, inode_t *inode,
- struct iatt *buf, dict_t *xdata,
- struct iatt *parbuf);
+afr_selfheal_discover_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int op_ret, int op_errno, inode_t *inode,
+ struct iatt *buf, dict_t *xdata, struct iatt *parbuf);
void
-afr_reply_copy (struct afr_reply *dst, struct afr_reply *src);
+afr_reply_copy(struct afr_reply *dst, struct afr_reply *src);
void
-afr_replies_copy (struct afr_reply *dst, struct afr_reply *src, int count);
+afr_replies_copy(struct afr_reply *dst, struct afr_reply *src, int count);
int
-afr_selfheal_newentry_mark (call_frame_t *frame, xlator_t *this, inode_t *inode,
- int source, struct afr_reply *replies,
- unsigned char *sources, unsigned char *newentry);
+afr_selfheal_newentry_mark(call_frame_t *frame, xlator_t *this, inode_t *inode,
+ int source, struct afr_reply *replies,
+ unsigned char *sources, unsigned char *newentry);
unsigned int
-afr_success_count (struct afr_reply *replies, unsigned int count);
+afr_success_count(struct afr_reply *replies, unsigned int count);
void
-afr_log_selfheal (uuid_t gfid, xlator_t *this, int ret, char *type,
- int source, unsigned char *sources,
- unsigned char *healed_sinks);
+afr_log_selfheal(uuid_t gfid, xlator_t *this, int ret, char *type, int source,
+ unsigned char *sources, unsigned char *healed_sinks);
void
-afr_mark_largest_file_as_source (xlator_t *this, unsigned char *sources,
- struct afr_reply *replies);
+afr_mark_largest_file_as_source(xlator_t *this, unsigned char *sources,
+ struct afr_reply *replies);
void
-afr_mark_active_sinks (xlator_t *this, unsigned char *sources,
- unsigned char *locked_on, unsigned char *sinks);
+afr_mark_active_sinks(xlator_t *this, unsigned char *sources,
+ unsigned char *locked_on, unsigned char *sinks);
gf_boolean_t
-afr_dict_contains_heal_op (call_frame_t *frame);
+afr_dict_contains_heal_op(call_frame_t *frame);
gf_boolean_t
-afr_can_decide_split_brain_source_sinks (struct afr_reply *replies,
- int child_count);
+afr_can_decide_split_brain_source_sinks(struct afr_reply *replies,
+ int child_count);
int
-afr_mark_split_brain_source_sinks (call_frame_t *frame, xlator_t *this,
- inode_t *inode,
- unsigned char *sources,
- unsigned char *sinks,
- unsigned char *healed_sinks,
- unsigned char *locked_on,
- struct afr_reply *replies,
- afr_transaction_type type);
+afr_mark_split_brain_source_sinks(
+ call_frame_t *frame, xlator_t *this, inode_t *inode, unsigned char *sources,
+ unsigned char *sinks, unsigned char *healed_sinks, unsigned char *locked_on,
+ struct afr_reply *replies, afr_transaction_type type);
int
-afr_sh_get_fav_by_policy (xlator_t *this, struct afr_reply *replies,
- inode_t *inode, char **policy_str);
+afr_sh_get_fav_by_policy(xlator_t *this, struct afr_reply *replies,
+ inode_t *inode, char **policy_str);
int
-_afr_fav_child_reset_sink_xattrs (call_frame_t *frame, xlator_t *this,
+_afr_fav_child_reset_sink_xattrs(call_frame_t *frame, xlator_t *this,
inode_t *inode, int source,
unsigned char *healed_sinks,
unsigned char *undid_pending,
@@ -275,86 +274,77 @@ _afr_fav_child_reset_sink_xattrs (call_frame_t *frame, xlator_t *this,
struct afr_reply *replies);
int
-afr_get_child_index_from_name (xlator_t *this, char *name);
+afr_get_child_index_from_name(xlator_t *this, char *name);
gf_boolean_t
-afr_does_witness_exist (xlator_t *this, uint64_t *witness);
+afr_does_witness_exist(xlator_t *this, uint64_t *witness);
int
-__afr_selfheal_data_prepare (call_frame_t *frame, xlator_t *this,
- inode_t *inode, unsigned char *locked_on,
- unsigned char *sources,
- unsigned char *sinks, unsigned char *healed_sinks,
- unsigned char *undid_pending,
- struct afr_reply *replies, gf_boolean_t *flag);
+__afr_selfheal_data_prepare(call_frame_t *frame, xlator_t *this, inode_t *inode,
+ unsigned char *locked_on, unsigned char *sources,
+ unsigned char *sinks, unsigned char *healed_sinks,
+ unsigned char *undid_pending,
+ struct afr_reply *replies, gf_boolean_t *flag);
int
-__afr_selfheal_metadata_prepare (call_frame_t *frame, xlator_t *this,
- inode_t *inode, unsigned char *locked_on,
- unsigned char *sources,
- unsigned char *sinks,
- unsigned char *healed_sinks,
- unsigned char *undid_pending,
- struct afr_reply *replies,
- gf_boolean_t *flag);
+__afr_selfheal_metadata_prepare(call_frame_t *frame, xlator_t *this,
+ inode_t *inode, unsigned char *locked_on,
+ unsigned char *sources, unsigned char *sinks,
+ unsigned char *healed_sinks,
+ unsigned char *undid_pending,
+ struct afr_reply *replies, gf_boolean_t *flag);
int
-__afr_selfheal_entry_prepare (call_frame_t *frame, xlator_t *this,
- inode_t *inode, unsigned char *locked_on,
- unsigned char *sources,
- unsigned char *sinks,
- unsigned char *healed_sinks,
- struct afr_reply *replies, int *source_p,
- gf_boolean_t *flag);
+__afr_selfheal_entry_prepare(call_frame_t *frame, xlator_t *this,
+ inode_t *inode, unsigned char *locked_on,
+ unsigned char *sources, unsigned char *sinks,
+ unsigned char *healed_sinks,
+ struct afr_reply *replies, int *source_p,
+ gf_boolean_t *flag);
int
-afr_selfheal_unlocked_inspect (call_frame_t *frame, xlator_t *this,
- uuid_t gfid, inode_t **link_inode,
- gf_boolean_t *data_selfheal,
- gf_boolean_t *metadata_selfheal,
- gf_boolean_t *entry_selfheal);
+afr_selfheal_unlocked_inspect(call_frame_t *frame, xlator_t *this, uuid_t gfid,
+ inode_t **link_inode, gf_boolean_t *data_selfheal,
+ gf_boolean_t *metadata_selfheal,
+ gf_boolean_t *entry_selfheal);
int
-afr_selfheal_do (call_frame_t *frame, xlator_t *this, uuid_t gfid);
+afr_selfheal_do(call_frame_t *frame, xlator_t *this, uuid_t gfid);
int
-afr_selfheal_lock_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int op_ret, int op_errno, dict_t *xdata);
+afr_selfheal_lock_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int op_ret, int op_errno, dict_t *xdata);
int
-afr_locked_fill (call_frame_t *frame, xlator_t *this,
- unsigned char *locked_on);
+afr_locked_fill(call_frame_t *frame, xlator_t *this, unsigned char *locked_on);
int
-afr_choose_source_by_policy (afr_private_t *priv, unsigned char *sources,
- afr_transaction_type type);
+afr_choose_source_by_policy(afr_private_t *priv, unsigned char *sources,
+ afr_transaction_type type);
int
-afr_selfheal_metadata_by_stbuf (xlator_t *this, struct iatt *stbuf);
+afr_selfheal_metadata_by_stbuf(xlator_t *this, struct iatt *stbuf);
int
-afr_sh_fav_by_size (xlator_t *this, struct afr_reply *replies,
- inode_t *inode);
+afr_sh_fav_by_size(xlator_t *this, struct afr_reply *replies, inode_t *inode);
int
-afr_sh_fav_by_mtime (xlator_t *this, struct afr_reply *replies,
- inode_t *inode);
+afr_sh_fav_by_mtime(xlator_t *this, struct afr_reply *replies, inode_t *inode);
int
-afr_sh_fav_by_ctime (xlator_t *this, struct afr_reply *replies,
- inode_t *inode);
+afr_sh_fav_by_ctime(xlator_t *this, struct afr_reply *replies, inode_t *inode);
int
-afr_gfid_split_brain_source (xlator_t *this, struct afr_reply *replies,
- inode_t *inode, uuid_t pargfid, const char *bname,
- int src_idx, int child_idx,
- unsigned char *locked_on, int *src, dict_t *xdata);
+afr_gfid_split_brain_source(xlator_t *this, struct afr_reply *replies,
+ inode_t *inode, uuid_t pargfid, const char *bname,
+ int src_idx, int child_idx,
+ unsigned char *locked_on, int *src, dict_t *xdata);
int
-afr_mark_source_sinks_if_file_empty (xlator_t *this, unsigned char *sources,
- unsigned char *sinks,
- unsigned char *healed_sinks,
- unsigned char *locked_on,
- struct afr_reply *replies,
- afr_transaction_type type);
+afr_mark_source_sinks_if_file_empty(xlator_t *this, unsigned char *sources,
+ unsigned char *sinks,
+ unsigned char *healed_sinks,
+ unsigned char *locked_on,
+ struct afr_reply *replies,
+ afr_transaction_type type);
gf_boolean_t
-afr_is_file_empty_on_all_children (afr_private_t *priv,
- struct afr_reply *replies);
+afr_is_file_empty_on_all_children(afr_private_t *priv,
+ struct afr_reply *replies);
#endif /* !_AFR_SELFHEAL_H */
diff --git a/xlators/cluster/afr/src/afr-self-heald.h b/xlators/cluster/afr/src/afr-self-heald.h
index 4ac1d32f58a..7de7c431460 100644
--- a/xlators/cluster/afr/src/afr-self-heald.h
+++ b/xlators/cluster/afr/src/afr-self-heald.h
@@ -8,74 +8,71 @@
cases as published by the Free Software Foundation.
*/
-
#ifndef _AFR_SELF_HEALD_H
#define _AFR_SELF_HEALD_H
#include <pthread.h>
-
typedef struct {
- int child;
- char *path;
+ int child;
+ char *path;
} shd_event_t;
typedef struct {
- int child;
- uint64_t healed_count;
- uint64_t split_brain_count;
- uint64_t heal_failed_count;
-
- /* If start_time is 0, it means crawler is not in progress
- and stats are not valid */
- time_t start_time;
- /* If start_time is NOT 0 and end_time is 0, it means
- cralwer is in progress */
- time_t end_time;
- char *crawl_type;
+ int child;
+ uint64_t healed_count;
+ uint64_t split_brain_count;
+ uint64_t heal_failed_count;
+
+ /* If start_time is 0, it means crawler is not in progress
+ and stats are not valid */
+ time_t start_time;
+ /* If start_time is NOT 0 and end_time is 0, it means
+ cralwer is in progress */
+ time_t end_time;
+ char *crawl_type;
} crawl_event_t;
struct subvol_healer {
- xlator_t *this;
- int subvol;
- gf_boolean_t local;
- gf_boolean_t running;
- gf_boolean_t rerun;
- crawl_event_t crawl_event;
- pthread_mutex_t mutex;
- pthread_cond_t cond;
- pthread_t thread;
+ xlator_t *this;
+ int subvol;
+ gf_boolean_t local;
+ gf_boolean_t running;
+ gf_boolean_t rerun;
+ crawl_event_t crawl_event;
+ pthread_mutex_t mutex;
+ pthread_cond_t cond;
+ pthread_t thread;
};
typedef struct {
- gf_boolean_t iamshd;
- gf_boolean_t enabled;
- int timeout;
- struct subvol_healer *index_healers;
- struct subvol_healer *full_healers;
-
- eh_t *split_brain;
- eh_t **statistics;
- uint32_t max_threads;
- uint32_t wait_qlength;
- uint32_t halo_max_latency_msec;
+ gf_boolean_t iamshd;
+ gf_boolean_t enabled;
+ int timeout;
+ struct subvol_healer *index_healers;
+ struct subvol_healer *full_healers;
+
+ eh_t *split_brain;
+ eh_t **statistics;
+ uint32_t max_threads;
+ uint32_t wait_qlength;
+ uint32_t halo_max_latency_msec;
} afr_self_heald_t;
-
int
-afr_selfheal_childup (xlator_t *this, int subvol);
+afr_selfheal_childup(xlator_t *this, int subvol);
int
-afr_selfheal_daemon_init (xlator_t *this);
+afr_selfheal_daemon_init(xlator_t *this);
int
-afr_xl_op (xlator_t *this, dict_t *input, dict_t *output);
+afr_xl_op(xlator_t *this, dict_t *input, dict_t *output);
int
-afr_shd_gfid_to_path (xlator_t *this, xlator_t *subvol, uuid_t gfid,
- char **path_p);
+afr_shd_gfid_to_path(xlator_t *this, xlator_t *subvol, uuid_t gfid,
+ char **path_p);
int
-afr_shd_index_purge (xlator_t *subvol, inode_t *inode, char *name,
- ia_type_t type);
+afr_shd_index_purge(xlator_t *subvol, inode_t *inode, char *name,
+ ia_type_t type);
#endif /* !_AFR_SELF_HEALD_H */
diff --git a/xlators/cluster/afr/src/afr-transaction.h b/xlators/cluster/afr/src/afr-transaction.h
index fe0f45f2f93..fff8c65e976 100644
--- a/xlators/cluster/afr/src/afr-transaction.h
+++ b/xlators/cluster/afr/src/afr-transaction.h
@@ -14,51 +14,57 @@
#include "afr.h"
void
-afr_transaction_fop_failed (call_frame_t *frame, xlator_t *this,
- int child_index);
+afr_transaction_fop_failed(call_frame_t *frame, xlator_t *this,
+ int child_index);
int32_t
-afr_transaction (call_frame_t *frame, xlator_t *this, afr_transaction_type type);
+afr_transaction(call_frame_t *frame, xlator_t *this, afr_transaction_type type);
int
-afr_set_pending_dict (afr_private_t *priv, dict_t *xattr, int32_t **pending);
+afr_set_pending_dict(afr_private_t *priv, dict_t *xattr, int32_t **pending);
void
-afr_delayed_changelog_wake_up (xlator_t *this, fd_t *fd);
+afr_delayed_changelog_wake_up(xlator_t *this, fd_t *fd);
void
-__mark_all_success (call_frame_t *frame, xlator_t *this);
+__mark_all_success(call_frame_t *frame, xlator_t *this);
gf_boolean_t
-afr_txn_nothing_failed (call_frame_t *frame, xlator_t *this);
+afr_txn_nothing_failed(call_frame_t *frame, xlator_t *this);
-int afr_read_txn (call_frame_t *frame, xlator_t *this, inode_t *inode,
- afr_read_txn_wind_t readfn, afr_transaction_type type);
+int
+afr_read_txn(call_frame_t *frame, xlator_t *this, inode_t *inode,
+ afr_read_txn_wind_t readfn, afr_transaction_type type);
-int afr_read_txn_continue (call_frame_t *frame, xlator_t *this, int subvol);
+int
+afr_read_txn_continue(call_frame_t *frame, xlator_t *this, int subvol);
void
-afr_pending_read_increment (afr_private_t *priv, int child_index);
+afr_pending_read_increment(afr_private_t *priv, int child_index);
void
-afr_pending_read_decrement (afr_private_t *priv, int child_index);
+afr_pending_read_decrement(afr_private_t *priv, int child_index);
-call_frame_t *afr_transaction_detach_fop_frame (call_frame_t *frame);
-gf_boolean_t afr_has_quorum (unsigned char *subvols, xlator_t *this);
-gf_boolean_t afr_needs_changelog_update (afr_local_t *local);
-void afr_zero_fill_stat (afr_local_t *local);
+call_frame_t *
+afr_transaction_detach_fop_frame(call_frame_t *frame);
+gf_boolean_t
+afr_has_quorum(unsigned char *subvols, xlator_t *this);
+gf_boolean_t
+afr_needs_changelog_update(afr_local_t *local);
+void
+afr_zero_fill_stat(afr_local_t *local);
void
-afr_pick_error_xdata (afr_local_t *local, afr_private_t *priv,
- inode_t *inode1, unsigned char *readable1,
- inode_t *inode2, unsigned char *readable2);
+afr_pick_error_xdata(afr_local_t *local, afr_private_t *priv, inode_t *inode1,
+ unsigned char *readable1, inode_t *inode2,
+ unsigned char *readable2);
int
-afr_transaction_resume (call_frame_t *frame, xlator_t *this);
+afr_transaction_resume(call_frame_t *frame, xlator_t *this);
int
-afr_lock (call_frame_t *frame, xlator_t *this);
+afr_lock(call_frame_t *frame, xlator_t *this);
void
-afr_delayed_changelog_wake_up_cbk (void *data);
+afr_delayed_changelog_wake_up_cbk(void *data);
#endif /* __TRANSACTION_H__ */
diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h
index f7b636cb3d9..3395507ab90 100644
--- a/xlators/cluster/afr/src/afr.h
+++ b/xlators/cluster/afr/src/afr.h
@@ -8,7 +8,6 @@
cases as published by the Free Software Foundation.
*/
-
#ifndef __AFR_H__
#define __AFR_H__
@@ -27,11 +26,11 @@
#define AFR_SH_READDIR_SIZE_KEY "self-heal-readdir-size"
#define AFR_SH_DATA_DOMAIN_FMT "%s:self-heal"
#define AFR_DIRTY_DEFAULT AFR_XATTR_PREFIX ".dirty"
-#define AFR_DIRTY (((afr_private_t *) (THIS->private))->afr_dirty)
+#define AFR_DIRTY (((afr_private_t *)(THIS->private))->afr_dirty)
-#define AFR_LOCKEE_COUNT_MAX 3
-#define AFR_DOM_COUNT_MAX 3
-#define AFR_NUM_CHANGE_LOGS 3 /*data + metadata + entry*/
+#define AFR_LOCKEE_COUNT_MAX 3
+#define AFR_DOM_COUNT_MAX 3
+#define AFR_NUM_CHANGE_LOGS 3 /*data + metadata + entry*/
#define AFR_DEFAULT_SPB_CHOICE_TIMEOUT 300 /*in seconds*/
#define ARBITER_BRICK_INDEX 2
@@ -40,160 +39,185 @@
#define AFR_TA_DOM_MODIFY "afr.ta.dom-modify"
#define AFR_HALO_MAX_LATENCY 99999
-typedef int (*afr_lock_cbk_t) (call_frame_t *frame, xlator_t *this);
-
-typedef int (*afr_read_txn_wind_t) (call_frame_t *frame, xlator_t *this, int subvol);
-
-typedef int (*afr_inode_refresh_cbk_t) (call_frame_t *frame, xlator_t *this, int err);
-
-typedef int (*afr_changelog_resume_t) (call_frame_t *frame, xlator_t *this);
-
-#define AFR_COUNT(array,max) ({int __i; int __res = 0; for (__i = 0; __i < max; __i++) if (array[__i]) __res++; __res;})
-#define AFR_INTERSECT(dst,src1,src2,max) ({int __i; for (__i = 0; __i < max; __i++) dst[__i] = src1[__i] && src2[__i];})
-#define AFR_CMP(a1,a2,len) ({int __cmp = 0; int __i; for (__i = 0; __i < len; __i++) if (a1[__i] != a2[__i]) { __cmp = 1; break;} __cmp;})
-#define AFR_IS_ARBITER_BRICK(priv, index) ((priv->arbiter_count == 1) && (index == ARBITER_BRICK_INDEX))
+typedef int (*afr_lock_cbk_t)(call_frame_t *frame, xlator_t *this);
+
+typedef int (*afr_read_txn_wind_t)(call_frame_t *frame, xlator_t *this,
+ int subvol);
+
+typedef int (*afr_inode_refresh_cbk_t)(call_frame_t *frame, xlator_t *this,
+ int err);
+
+typedef int (*afr_changelog_resume_t)(call_frame_t *frame, xlator_t *this);
+
+#define AFR_COUNT(array, max) \
+ ({ \
+ int __i; \
+ int __res = 0; \
+ for (__i = 0; __i < max; __i++) \
+ if (array[__i]) \
+ __res++; \
+ __res; \
+ })
+#define AFR_INTERSECT(dst, src1, src2, max) \
+ ({ \
+ int __i; \
+ for (__i = 0; __i < max; __i++) \
+ dst[__i] = src1[__i] && src2[__i]; \
+ })
+#define AFR_CMP(a1, a2, len) \
+ ({ \
+ int __cmp = 0; \
+ int __i; \
+ for (__i = 0; __i < len; __i++) \
+ if (a1[__i] != a2[__i]) { \
+ __cmp = 1; \
+ break; \
+ } \
+ __cmp; \
+ })
+#define AFR_IS_ARBITER_BRICK(priv, index) \
+ ((priv->arbiter_count == 1) && (index == ARBITER_BRICK_INDEX))
#define AFR_SET_ERROR_AND_CHECK_SPLIT_BRAIN(ret, errnum) \
- do { \
- local->op_ret = ret; \
- local->op_errno = errnum; \
- if (local->op_errno == EIO) \
- gf_msg (this->name, GF_LOG_ERROR, local->op_errno, \
- AFR_MSG_SPLIT_BRAIN, "Failing %s on gfid %s: " \
- "split-brain observed.", \
- gf_fop_list[local->op], \
- uuid_utoa (local->inode->gfid)); \
- } while (0)
+ do { \
+ local->op_ret = ret; \
+ local->op_errno = errnum; \
+ if (local->op_errno == EIO) \
+ gf_msg(this->name, GF_LOG_ERROR, local->op_errno, \
+ AFR_MSG_SPLIT_BRAIN, \
+ "Failing %s on gfid %s: " \
+ "split-brain observed.", \
+ gf_fop_list[local->op], uuid_utoa(local->inode->gfid)); \
+ } while (0)
typedef enum {
- AFR_FAV_CHILD_NONE,
- AFR_FAV_CHILD_BY_SIZE,
- AFR_FAV_CHILD_BY_CTIME,
- AFR_FAV_CHILD_BY_MTIME,
- AFR_FAV_CHILD_BY_MAJORITY,
- AFR_FAV_CHILD_POLICY_MAX,
+ AFR_FAV_CHILD_NONE,
+ AFR_FAV_CHILD_BY_SIZE,
+ AFR_FAV_CHILD_BY_CTIME,
+ AFR_FAV_CHILD_BY_MTIME,
+ AFR_FAV_CHILD_BY_MAJORITY,
+ AFR_FAV_CHILD_POLICY_MAX,
} afr_favorite_child_policy;
typedef enum {
- AFR_CHILD_UNKNOWN = -1,
- AFR_CHILD_ZERO,
- AFR_CHILD_ONE,
+ AFR_CHILD_UNKNOWN = -1,
+ AFR_CHILD_ZERO,
+ AFR_CHILD_ONE,
} afr_child_index;
struct afr_nfsd {
- gf_boolean_t iamnfsd;
- uint32_t halo_max_latency_msec;
+ gf_boolean_t iamnfsd;
+ uint32_t halo_max_latency_msec;
};
typedef struct _afr_private {
- gf_lock_t lock; /* to guard access to child_count, etc */
- unsigned int child_count; /* total number of children */
- unsigned int arbiter_count; /*subset of child_count.
- Has to be 0 or 1.*/
-
- xlator_t **children;
-
- inode_t *root_inode;
-
- /* For thin-arbiter. */
- unsigned int thin_arbiter_count; /* 0 or 1 at the moment.*/
- uuid_t ta_gfid;
- int ta_bad_child_index;
- off_t ta_notify_dom_lock_offset;
-
- unsigned char *child_up;
- int64_t *child_latency;
- unsigned char *local;
-
- char **pending_key;
-
- char *data_self_heal; /* on/off/open */
- char * data_self_heal_algorithm; /* name of algorithm */
- unsigned int data_self_heal_window_size; /* max number of pipelined
- read/writes */
-
- struct list_head heal_waiting; /*queue for files that need heal*/
- uint32_t heal_wait_qlen; /*configurable queue length for heal_waiting*/
- int32_t heal_waiters; /* No. of elements currently in wait queue.*/
-
- struct list_head healing;/* queue for files that are undergoing
- background heal*/
- uint32_t background_self_heal_count;/*configurable queue length for
- healing queue*/
- int32_t healers;/* No. of elements currently undergoing background
- heal*/
-
- gf_boolean_t metadata_self_heal; /* on/off */
- gf_boolean_t entry_self_heal; /* on/off */
-
- gf_boolean_t metadata_splitbrain_forced_heal; /* on/off */
- int read_child; /* read-subvolume */
- unsigned int hash_mode; /* for when read_child is not set */
- gf_atomic_t *pending_reads; /*No. of pending read cbks per child.*/
- int favorite_child; /* subvolume to be preferred in resolving
- split-brain cases */
-
- afr_favorite_child_policy fav_child_policy;/*Policy to use for automatic
- resolution of split-brains.*/
-
- unsigned int wait_count; /* # of servers to wait for success */
-
- gf_timer_t *timer; /* launched when parent up is received */
-
- gf_boolean_t optimistic_change_log;
- gf_boolean_t eager_lock;
- gf_boolean_t pre_op_compat; /* on/off */
- uint32_t post_op_delay_secs;
- unsigned int quorum_count;
-
- char vol_uuid[UUID_SIZE + 1];
- int32_t *last_event;
-
- /* @event_generation: Keeps count of number of events received which can
- potentially impact consistency decisions. The events are CHILD_UP
- and CHILD_DOWN, when we have to recalculate the freshness/staleness
- of copies to detect if changes had happened while the other server
- was down. CHILD_DOWN and CHILD_UP can also be received on network
- disconnect/reconnects and not necessarily server going down/up.
- Recalculating freshness/staleness on network events is equally
- important as we might have had a network split brain.
- */
- uint32_t event_generation;
-
- gf_boolean_t choose_local;
- gf_boolean_t did_discovery;
- uint64_t sh_readdir_size;
- gf_boolean_t ensure_durability;
- char *sh_domain;
- char *afr_dirty;
- gf_boolean_t halo_enabled;
-
- uint32_t halo_max_latency_msec;
- uint32_t halo_max_replicas;
- uint32_t halo_min_replicas;
-
- afr_self_heald_t shd;
- struct afr_nfsd nfsd;
-
- gf_boolean_t consistent_metadata;
- uint64_t spb_choice_timeout;
- gf_boolean_t need_heal;
-
- /* pump dependencies */
- void *pump_private;
- gf_boolean_t use_afr_in_pump;
- char *locking_scheme;
- gf_boolean_t full_lock;
- gf_boolean_t esh_granular;
- gf_boolean_t consistent_io;
+ gf_lock_t lock; /* to guard access to child_count, etc */
+ unsigned int child_count; /* total number of children */
+ unsigned int arbiter_count; /*subset of child_count.
+ Has to be 0 or 1.*/
+
+ xlator_t **children;
+
+ inode_t *root_inode;
+
+ /* For thin-arbiter. */
+ unsigned int thin_arbiter_count; /* 0 or 1 at the moment.*/
+ uuid_t ta_gfid;
+ int ta_bad_child_index;
+ off_t ta_notify_dom_lock_offset;
+
+ unsigned char *child_up;
+ int64_t *child_latency;
+ unsigned char *local;
+
+ char **pending_key;
+
+ char *data_self_heal; /* on/off/open */
+ char *data_self_heal_algorithm; /* name of algorithm */
+ unsigned int data_self_heal_window_size; /* max number of pipelined
+ read/writes */
+
+ struct list_head heal_waiting; /*queue for files that need heal*/
+ uint32_t heal_wait_qlen; /*configurable queue length for heal_waiting*/
+ int32_t heal_waiters; /* No. of elements currently in wait queue.*/
+
+ struct list_head healing; /* queue for files that are undergoing
+ background heal*/
+ uint32_t background_self_heal_count; /*configurable queue length for
+ healing queue*/
+ int32_t healers; /* No. of elements currently undergoing background
+ heal*/
+
+ gf_boolean_t metadata_self_heal; /* on/off */
+ gf_boolean_t entry_self_heal; /* on/off */
+
+ gf_boolean_t metadata_splitbrain_forced_heal; /* on/off */
+ int read_child; /* read-subvolume */
+ unsigned int hash_mode; /* for when read_child is not set */
+ gf_atomic_t *pending_reads; /*No. of pending read cbks per child.*/
+ int favorite_child; /* subvolume to be preferred in resolving
+ split-brain cases */
+
+ afr_favorite_child_policy fav_child_policy; /*Policy to use for automatic
+ resolution of split-brains.*/
+
+ unsigned int wait_count; /* # of servers to wait for success */
+
+ gf_timer_t *timer; /* launched when parent up is received */
+
+ gf_boolean_t optimistic_change_log;
+ gf_boolean_t eager_lock;
+ gf_boolean_t pre_op_compat; /* on/off */
+ uint32_t post_op_delay_secs;
+ unsigned int quorum_count;
+
+ char vol_uuid[UUID_SIZE + 1];
+ int32_t *last_event;
+
+ /* @event_generation: Keeps count of number of events received which can
+ potentially impact consistency decisions. The events are CHILD_UP
+ and CHILD_DOWN, when we have to recalculate the freshness/staleness
+ of copies to detect if changes had happened while the other server
+ was down. CHILD_DOWN and CHILD_UP can also be received on network
+ disconnect/reconnects and not necessarily server going down/up.
+ Recalculating freshness/staleness on network events is equally
+ important as we might have had a network split brain.
+ */
+ uint32_t event_generation;
+
+ gf_boolean_t choose_local;
+ gf_boolean_t did_discovery;
+ uint64_t sh_readdir_size;
+ gf_boolean_t ensure_durability;
+ char *sh_domain;
+ char *afr_dirty;
+ gf_boolean_t halo_enabled;
+
+ uint32_t halo_max_latency_msec;
+ uint32_t halo_max_replicas;
+ uint32_t halo_min_replicas;
+
+ afr_self_heald_t shd;
+ struct afr_nfsd nfsd;
+
+ gf_boolean_t consistent_metadata;
+ uint64_t spb_choice_timeout;
+ gf_boolean_t need_heal;
+
+ /* pump dependencies */
+ void *pump_private;
+ gf_boolean_t use_afr_in_pump;
+ char *locking_scheme;
+ gf_boolean_t full_lock;
+ gf_boolean_t esh_granular;
+ gf_boolean_t consistent_io;
} afr_private_t;
-
typedef enum {
- AFR_DATA_TRANSACTION, /* truncate, write, ... */
- AFR_METADATA_TRANSACTION, /* chmod, chown, ... */
- AFR_ENTRY_TRANSACTION, /* create, rmdir, ... */
- AFR_ENTRY_RENAME_TRANSACTION, /* rename */
+ AFR_DATA_TRANSACTION, /* truncate, write, ... */
+ AFR_METADATA_TRANSACTION, /* chmod, chown, ... */
+ AFR_ENTRY_TRANSACTION, /* create, rmdir, ... */
+ AFR_ENTRY_RENAME_TRANSACTION, /* rename */
} afr_transaction_type;
/*
@@ -204,914 +228,909 @@ typedef enum {
*/
static inline int
-afr_index_for_transaction_type (afr_transaction_type type)
+afr_index_for_transaction_type(afr_transaction_type type)
{
- switch (type) {
-
+ switch (type) {
case AFR_DATA_TRANSACTION:
- return 0;
+ return 0;
case AFR_METADATA_TRANSACTION:
- return 1;
+ return 1;
case AFR_ENTRY_TRANSACTION:
case AFR_ENTRY_RENAME_TRANSACTION:
- return 2;
- }
+ return 2;
+ }
- return -1; /* make gcc happy */
+ return -1; /* make gcc happy */
}
static inline int
-afr_index_from_ia_type (ia_type_t type)
+afr_index_from_ia_type(ia_type_t type)
{
- switch (type) {
+ switch (type) {
case IA_IFDIR:
- return afr_index_for_transaction_type (AFR_ENTRY_TRANSACTION);
+ return afr_index_for_transaction_type(AFR_ENTRY_TRANSACTION);
case IA_IFREG:
- return afr_index_for_transaction_type (AFR_DATA_TRANSACTION);
- default: return -1;
- }
+ return afr_index_for_transaction_type(AFR_DATA_TRANSACTION);
+ default:
+ return -1;
+ }
}
typedef struct {
- loc_t loc;
- char *basename;
- unsigned char *locked_nodes;
- int locked_count;
+ loc_t loc;
+ char *basename;
+ unsigned char *locked_nodes;
+ int locked_count;
} afr_entry_lockee_t;
int
-afr_entry_lockee_cmp (const void *l1, const void *l2);
+afr_entry_lockee_cmp(const void *l1, const void *l2);
typedef struct {
- loc_t *lk_loc;
+ loc_t *lk_loc;
- int lockee_count;
- afr_entry_lockee_t lockee[AFR_LOCKEE_COUNT_MAX];
+ int lockee_count;
+ afr_entry_lockee_t lockee[AFR_LOCKEE_COUNT_MAX];
- struct gf_flock flock;
- const char *lk_basename;
- const char *lower_basename;
- const char *higher_basename;
- char lower_locked;
- char higher_locked;
+ struct gf_flock flock;
+ const char *lk_basename;
+ const char *lower_basename;
+ const char *higher_basename;
+ char lower_locked;
+ char higher_locked;
- unsigned char *locked_nodes;
- unsigned char *lower_locked_nodes;
+ unsigned char *locked_nodes;
+ unsigned char *lower_locked_nodes;
- int32_t lock_count;
- int32_t entrylk_lock_count;
+ int32_t lock_count;
+ int32_t entrylk_lock_count;
- int32_t lk_call_count;
- int32_t lk_expected_count;
- int32_t lk_attempted_count;
+ int32_t lk_call_count;
+ int32_t lk_expected_count;
+ int32_t lk_attempted_count;
- int32_t lock_op_ret;
- int32_t lock_op_errno;
- afr_lock_cbk_t lock_cbk;
- char *domain; /* Domain on which inode/entry lock/unlock in progress.*/
+ int32_t lock_op_ret;
+ int32_t lock_op_errno;
+ afr_lock_cbk_t lock_cbk;
+ char *domain; /* Domain on which inode/entry lock/unlock in progress.*/
} afr_internal_lock_t;
struct afr_reply {
- int valid;
- int32_t op_ret;
- int32_t op_errno;
- dict_t *xattr;/*For xattrop*/
- dict_t *xdata;
- struct iatt poststat;
- struct iatt postparent;
- struct iatt prestat;
- struct iatt preparent;
- struct iatt preparent2;
- struct iatt postparent2;
- /* For rchecksum */
- uint8_t checksum[SHA256_DIGEST_LENGTH];
- gf_boolean_t buf_has_zeroes;
- gf_boolean_t fips_mode_rchecksum;
- /* For lookup */
- int8_t need_heal;
+ int valid;
+ int32_t op_ret;
+ int32_t op_errno;
+ dict_t *xattr; /*For xattrop*/
+ dict_t *xdata;
+ struct iatt poststat;
+ struct iatt postparent;
+ struct iatt prestat;
+ struct iatt preparent;
+ struct iatt preparent2;
+ struct iatt postparent2;
+ /* For rchecksum */
+ uint8_t checksum[SHA256_DIGEST_LENGTH];
+ gf_boolean_t buf_has_zeroes;
+ gf_boolean_t fips_mode_rchecksum;
+ /* For lookup */
+ int8_t need_heal;
};
typedef enum {
- AFR_FD_NOT_OPENED,
- AFR_FD_OPENED,
- AFR_FD_OPENING
+ AFR_FD_NOT_OPENED,
+ AFR_FD_OPENED,
+ AFR_FD_OPENING
} afr_fd_open_status_t;
typedef struct {
- afr_fd_open_status_t *opened_on; /* which subvolumes the fd is open on */
- int flags;
-
- /* the subvolume on which the latest sequence of readdirs (starting
- at offset 0) has begun. Till the next readdir request with 0 offset
- arrives, we continue to read off this subvol.
- */
- int readdir_subvol;
+ afr_fd_open_status_t *opened_on; /* which subvolumes the fd is open on */
+ int flags;
+
+ /* the subvolume on which the latest sequence of readdirs (starting
+ at offset 0) has begun. Till the next readdir request with 0 offset
+ arrives, we continue to read off this subvol.
+ */
+ int readdir_subvol;
} afr_fd_ctx_t;
typedef enum {
- AFR_FOP_LOCK_PARALLEL,
- AFR_FOP_LOCK_SERIAL,
- AFR_FOP_LOCK_QUORUM_FAILED,
+ AFR_FOP_LOCK_PARALLEL,
+ AFR_FOP_LOCK_SERIAL,
+ AFR_FOP_LOCK_QUORUM_FAILED,
} afr_fop_lock_state_t;
typedef struct _afr_inode_lock_t {
- unsigned int event_generation;
- gf_boolean_t release;
- gf_boolean_t acquired;
- gf_timer_t *delay_timer;
- struct list_head owners; /*Transactions that are performing fop*/
- struct list_head post_op;/*Transactions that are done with the fop
- *So can not conflict with the fops*/
- struct list_head waiting;/*Transaction that are waiting for
- *conflicting transactions to complete*/
- struct list_head frozen;/*Transactions that need to go as part of
- * next batch of eager-lock*/
+ unsigned int event_generation;
+ gf_boolean_t release;
+ gf_boolean_t acquired;
+ gf_timer_t *delay_timer;
+ struct list_head owners; /*Transactions that are performing fop*/
+ struct list_head post_op; /*Transactions that are done with the fop
+ *So can not conflict with the fops*/
+ struct list_head waiting; /*Transaction that are waiting for
+ *conflicting transactions to complete*/
+ struct list_head frozen; /*Transactions that need to go as part of
+ * next batch of eager-lock*/
} afr_lock_t;
typedef struct _afr_inode_ctx {
- uint64_t read_subvol;
- uint64_t write_subvol;
- int lock_count;
- int spb_choice;
- gf_timer_t *timer;
- gf_boolean_t need_refresh;
- unsigned int *pre_op_done[AFR_NUM_CHANGE_LOGS];
- int inherited[AFR_NUM_CHANGE_LOGS];
- int on_disk[AFR_NUM_CHANGE_LOGS];
-
- /* set if any write on this fd was a non stable write
- (i.e, without O_SYNC or O_DSYNC)
- */
- gf_boolean_t witnessed_unstable_write;
-
- /* @open_fd_count:
- Number of open FDs queried from the server, as queried through
- xdata in FOPs. Currently, used to decide if eager-locking must be
- temporarily disabled.
- */
- uint32_t open_fd_count;
- /*Only 2 types of transactions support eager-locks now. DATA/METADATA*/
- afr_lock_t lock[2];
+ uint64_t read_subvol;
+ uint64_t write_subvol;
+ int lock_count;
+ int spb_choice;
+ gf_timer_t *timer;
+ gf_boolean_t need_refresh;
+ unsigned int *pre_op_done[AFR_NUM_CHANGE_LOGS];
+ int inherited[AFR_NUM_CHANGE_LOGS];
+ int on_disk[AFR_NUM_CHANGE_LOGS];
+
+ /* set if any write on this fd was a non stable write
+ (i.e, without O_SYNC or O_DSYNC)
+ */
+ gf_boolean_t witnessed_unstable_write;
+
+ /* @open_fd_count:
+ Number of open FDs queried from the server, as queried through
+ xdata in FOPs. Currently, used to decide if eager-locking must be
+ temporarily disabled.
+ */
+ uint32_t open_fd_count;
+ /*Only 2 types of transactions support eager-locks now. DATA/METADATA*/
+ afr_lock_t lock[2];
} afr_inode_ctx_t;
-
typedef struct _afr_local {
- glusterfs_fop_t op;
- unsigned int call_count;
+ glusterfs_fop_t op;
+ unsigned int call_count;
- /* @event_generation: copy of priv->event_generation taken at the
- time of starting the transaction. The copy is made so that we
- have a stable value through the various phases of the transaction.
- */
- unsigned int event_generation;
+ /* @event_generation: copy of priv->event_generation taken at the
+ time of starting the transaction. The copy is made so that we
+ have a stable value through the various phases of the transaction.
+ */
+ unsigned int event_generation;
- uint32_t open_fd_count;
- gf_boolean_t update_open_fd_count;
+ uint32_t open_fd_count;
+ gf_boolean_t update_open_fd_count;
- gf_lkowner_t saved_lk_owner;
+ gf_lkowner_t saved_lk_owner;
- int32_t op_ret;
- int32_t op_errno;
+ int32_t op_ret;
+ int32_t op_errno;
- int32_t **pending;
+ int32_t **pending;
- int dirty[AFR_NUM_CHANGE_LOGS];
+ int dirty[AFR_NUM_CHANGE_LOGS];
- loc_t loc;
- loc_t newloc;
+ loc_t loc;
+ loc_t newloc;
- fd_t *fd;
- afr_fd_ctx_t *fd_ctx;
+ fd_t *fd;
+ afr_fd_ctx_t *fd_ctx;
- /* @child_up: copy of priv->child_up taken at the time of transaction
- start. The copy is taken so that we have a stable child_up array
- through the phases of the transaction as priv->child_up[i] can keep
- changing through time.
- */
- unsigned char *child_up;
+ /* @child_up: copy of priv->child_up taken at the time of transaction
+ start. The copy is taken so that we have a stable child_up array
+ through the phases of the transaction as priv->child_up[i] can keep
+ changing through time.
+ */
+ unsigned char *child_up;
- /* @read_attempted:
- array of flags representing subvolumes where read operations of
- the read transaction have already been attempted. The array is
- first pre-filled with down subvolumes, and as reads are performed
- on other subvolumes, those are set as well. This way if the read
- operation fails we do not retry on that subvolume again.
- */
- unsigned char *read_attempted;
+ /* @read_attempted:
+ array of flags representing subvolumes where read operations of
+ the read transaction have already been attempted. The array is
+ first pre-filled with down subvolumes, and as reads are performed
+ on other subvolumes, those are set as well. This way if the read
+ operation fails we do not retry on that subvolume again.
+ */
+ unsigned char *read_attempted;
- /* @readfn:
+ /* @readfn:
- pointer to function which will perform the read operation on a given
- subvolume. Used in read transactions.
- */
+ pointer to function which will perform the read operation on a given
+ subvolume. Used in read transactions.
+ */
- afr_read_txn_wind_t readfn;
+ afr_read_txn_wind_t readfn;
- /* @refreshed:
+ /* @refreshed:
- the inode was "refreshed" (i.e, pending xattrs from all subvols
- freshly inspected and inode ctx updated accordingly) as part of
- this transaction already.
- */
- gf_boolean_t refreshed;
+ the inode was "refreshed" (i.e, pending xattrs from all subvols
+ freshly inspected and inode ctx updated accordingly) as part of
+ this transaction already.
+ */
+ gf_boolean_t refreshed;
- /* @inode:
+ /* @inode:
- the inode on which the read txn is performed on. ref'ed and copied
- from either fd->inode or loc.inode
- */
+ the inode on which the read txn is performed on. ref'ed and copied
+ from either fd->inode or loc.inode
+ */
- inode_t *inode;
+ inode_t *inode;
- /* @parent[2]:
+ /* @parent[2]:
- parent inode[s] on which directory transactions are performed.
- */
+ parent inode[s] on which directory transactions are performed.
+ */
- inode_t *parent;
- inode_t *parent2;
+ inode_t *parent;
+ inode_t *parent2;
- /* @readable:
+ /* @readable:
- array of flags representing servers from which a read can be
- performed. This is the output of afr_inode_refresh()
- */
- unsigned char *readable;
- unsigned char *readable2; /*For rename transaction*/
+ array of flags representing servers from which a read can be
+ performed. This is the output of afr_inode_refresh()
+ */
+ unsigned char *readable;
+ unsigned char *readable2; /*For rename transaction*/
- int read_subvol; /* Current read subvolume */
+ int read_subvol; /* Current read subvolume */
- afr_inode_refresh_cbk_t refreshfn;
+ afr_inode_refresh_cbk_t refreshfn;
- /* @refreshinode:
+ /* @refreshinode:
- Inode currently getting refreshed.
- */
- inode_t *refreshinode;
+ Inode currently getting refreshed.
+ */
+ inode_t *refreshinode;
- /*To handle setattr/setxattr on yet to be linked inode from dht*/
- uuid_t refreshgfid;
+ /*To handle setattr/setxattr on yet to be linked inode from dht*/
+ uuid_t refreshgfid;
- /*
- @pre_op_compat:
+ /*
+ @pre_op_compat:
- compatibility mode of pre-op. send a separate pre-op and
- op operations as part of transaction, rather than combining
- */
+ compatibility mode of pre-op. send a separate pre-op and
+ op operations as part of transaction, rather than combining
+ */
- gf_boolean_t pre_op_compat;
+ gf_boolean_t pre_op_compat;
- dict_t *xattr_req;
+ dict_t *xattr_req;
- afr_internal_lock_t internal_lock;
+ afr_internal_lock_t internal_lock;
- dict_t *dict;
+ dict_t *dict;
- int optimistic_change_log;
+ int optimistic_change_log;
- /* Is the current writev() going to perform a stable write?
- i.e, is fd->flags or @flags writev param have O_SYNC or
- O_DSYNC?
- */
- gf_boolean_t stable_write;
+ /* Is the current writev() going to perform a stable write?
+ i.e, is fd->flags or @flags writev param have O_SYNC or
+ O_DSYNC?
+ */
+ gf_boolean_t stable_write;
- /* This write appended to the file. Nnot necessarily O_APPEND,
- just means the offset of write was at the end of file.
- */
- gf_boolean_t append_write;
+ /* This write appended to the file. Nnot necessarily O_APPEND,
+ just means the offset of write was at the end of file.
+ */
+ gf_boolean_t append_write;
- /*
- This struct contains the arguments for the "continuation"
- (scheme-like) of fops
- */
+ /*
+ This struct contains the arguments for the "continuation"
+ (scheme-like) of fops
+ */
+ struct {
struct {
- struct {
- gf_boolean_t needs_fresh_lookup;
- uuid_t gfid_req;
- } lookup;
-
- struct {
- unsigned char buf_set;
- struct statvfs buf;
- } statfs;
-
- struct {
- int32_t flags;
- fd_t *fd;
- } open;
-
- struct {
- int32_t cmd;
- struct gf_flock user_flock;
- struct gf_flock ret_flock;
- unsigned char *locked_nodes;
- } lk;
-
- /* inode read */
-
- struct {
- int32_t mask;
- int last_index; /* index of the child we tried previously */
- } access;
-
- struct {
- int last_index;
- } stat;
-
- struct {
- int last_index;
- } fstat;
-
- struct {
- size_t size;
- int last_index;
- } readlink;
-
- struct {
- char *name;
- int last_index;
- long xattr_len;
- } getxattr;
-
- struct {
- size_t size;
- off_t offset;
- int last_index;
- uint32_t flags;
- } readv;
-
- /* dir read */
-
- struct {
- int success_count;
- int32_t op_ret;
- int32_t op_errno;
-
- uint32_t *checksum;
- } opendir;
-
- struct {
- int32_t op_ret;
- int32_t op_errno;
- size_t size;
- off_t offset;
- dict_t *dict;
- gf_boolean_t failed;
- int last_index;
- } readdir;
- /* inode write */
-
- struct {
- struct iatt prebuf;
- struct iatt postbuf;
- } inode_wfop; //common structure for all inode-write-fops
-
- struct {
- int32_t op_ret;
-
- struct iovec *vector;
- struct iobref *iobref;
- int32_t count;
- off_t offset;
- uint32_t flags;
- } writev;
-
- struct {
- off_t offset;
- } truncate;
-
- struct {
- off_t offset;
- } ftruncate;
-
- struct {
- struct iatt in_buf;
- int32_t valid;
- } setattr;
-
- struct {
- struct iatt in_buf;
- int32_t valid;
- } fsetattr;
-
- struct {
- dict_t *dict;
- int32_t flags;
- } setxattr;
-
- struct {
- dict_t *dict;
- int32_t flags;
- } fsetxattr;
-
- struct {
- char *name;
- } removexattr;
-
- struct {
- dict_t *xattr;
- gf_xattrop_flags_t optype;
- } xattrop;
-
- /* dir write */
-
- struct {
- inode_t *inode;
- struct iatt buf;
- struct iatt preparent;
- struct iatt postparent;
- struct iatt prenewparent;
- struct iatt postnewparent;
- } dir_fop; //common structure for all dir fops
-
- struct {
- fd_t *fd;
- dict_t *params;
- int32_t flags;
- mode_t mode;
- } create;
-
- struct {
- dev_t dev;
- mode_t mode;
- dict_t *params;
- } mknod;
-
- struct {
- int32_t mode;
- dict_t *params;
- } mkdir;
-
- struct {
- int flags;
- } rmdir;
-
- struct {
- dict_t *params;
- char *linkpath;
- } symlink;
-
- struct {
- int32_t mode;
- off_t offset;
- size_t len;
- } fallocate;
-
- struct {
- off_t offset;
- size_t len;
- } discard;
-
- struct {
- off_t offset;
- off_t len;
- struct iatt prebuf;
- struct iatt postbuf;
- } zerofill;
-
- struct {
- char *volume;
- int32_t cmd;
- int32_t in_cmd;
- struct gf_flock in_flock;
- struct gf_flock flock;
- void *xdata;
- } inodelk;
-
- struct {
- char *volume;
- char *basename;
- entrylk_cmd in_cmd;
- entrylk_cmd cmd;
- entrylk_type type;
- void *xdata;
- } entrylk;
-
- struct {
- off_t offset;
- gf_seek_what_t what;
- } seek;
-
- struct {
- int32_t datasync;
- } fsync;
-
- struct {
- struct gf_lease user_lease;
- struct gf_lease ret_lease;
- unsigned char *locked_nodes;
- } lease;
-
-
- } cont;
+ gf_boolean_t needs_fresh_lookup;
+ uuid_t gfid_req;
+ } lookup;
struct {
- off_t start, len;
+ unsigned char buf_set;
+ struct statvfs buf;
+ } statfs;
- gf_boolean_t eager_lock_on;
- gf_boolean_t do_eager_unlock;
+ struct {
+ int32_t flags;
+ fd_t *fd;
+ } open;
- char *basename;
- char *new_basename;
+ struct {
+ int32_t cmd;
+ struct gf_flock user_flock;
+ struct gf_flock ret_flock;
+ unsigned char *locked_nodes;
+ } lk;
- loc_t parent_loc;
- loc_t new_parent_loc;
+ /* inode read */
- afr_transaction_type type;
+ struct {
+ int32_t mask;
+ int last_index; /* index of the child we tried previously */
+ } access;
- /* stub to resume on destruction
- of the transaction frame */
- call_stub_t *resume_stub;
+ struct {
+ int last_index;
+ } stat;
- struct list_head owner_list;
- struct list_head wait_list;
+ struct {
+ int last_index;
+ } fstat;
- unsigned char *pre_op;
+ struct {
+ size_t size;
+ int last_index;
+ } readlink;
- /* Changelog xattr dict for [f]xattrop*/
- dict_t **changelog_xdata;
- unsigned char *pre_op_sources;
+ struct {
+ char *name;
+ int last_index;
+ long xattr_len;
+ } getxattr;
- /* @failed_subvols: subvolumes on which a pre-op or a
- FOP failed. */
- unsigned char *failed_subvols;
+ struct {
+ size_t size;
+ off_t offset;
+ int last_index;
+ uint32_t flags;
+ } readv;
- /* @dirtied: flag which indicates whether we set dirty flag
- in the OP. Typically true when we are performing operation
- on more than one subvol and optimistic changelog is disabled
+ /* dir read */
- A 'true' value set in @dirtied flag means an 'undirtying'
- has to be done in POST-OP phase.
- */
- gf_boolean_t dirtied;
+ struct {
+ int success_count;
+ int32_t op_ret;
+ int32_t op_errno;
- /* @inherited: flag which indicates that the dirty flags
- of the previous transaction were inherited
- */
- gf_boolean_t inherited;
+ uint32_t *checksum;
+ } opendir;
- /*
- @no_uninherit: flag which indicates that a pre_op_uninherit()
- must _not_ be attempted (and returned as failure) always. This
- flag is set when a hard pre-op is performed, but not accounted
- for it in fd_ctx->on_disk[]. Such transactions are "isolated"
- from the pre-op piggybacking entirely and therefore uninherit
- must not be attempted.
- */
- gf_boolean_t no_uninherit;
+ struct {
+ int32_t op_ret;
+ int32_t op_errno;
+ size_t size;
+ off_t offset;
+ dict_t *dict;
+ gf_boolean_t failed;
+ int last_index;
+ } readdir;
+ /* inode write */
- /* @uninherit_done:
- @uninherit_value:
+ struct {
+ struct iatt prebuf;
+ struct iatt postbuf;
+ } inode_wfop; // common structure for all inode-write-fops
- The above pair variables make pre_op_uninherit() idempotent.
- Both are FALSE initially. The first call to pre_op_uninherit
- sets @uninherit_done to TRUE and the return value to
- @uninherit_value. Further calls will check for @uninherit_done
- to be TRUE and if so will simply return @uninherit_value.
- */
- gf_boolean_t uninherit_done;
- gf_boolean_t uninherit_value;
+ struct {
+ int32_t op_ret;
- gf_boolean_t in_flight_sb; /* Indicator for occurrence of
- split-brain while in the middle of
- a txn. */
- int32_t in_flight_sb_errno; /* This is where the cause of the
- failure on the last good copy of
- the file is stored.
- */
+ struct iovec *vector;
+ struct iobref *iobref;
+ int32_t count;
+ off_t offset;
+ uint32_t flags;
+ } writev;
- /* @changelog_resume: function to be called after changlogging
- (either pre-op or post-op) is done
- */
- afr_changelog_resume_t changelog_resume;
+ struct {
+ off_t offset;
+ } truncate;
- call_frame_t *main_frame; /*Fop frame*/
- call_frame_t *frame; /*Transaction frame*/
+ struct {
+ off_t offset;
+ } ftruncate;
- int (*wind) (call_frame_t *frame, xlator_t *this, int subvol);
+ struct {
+ struct iatt in_buf;
+ int32_t valid;
+ } setattr;
- int (*unwind) (call_frame_t *frame, xlator_t *this);
+ struct {
+ struct iatt in_buf;
+ int32_t valid;
+ } fsetattr;
- /* post-op hook */
- } transaction;
+ struct {
+ dict_t *dict;
+ int32_t flags;
+ } setxattr;
- syncbarrier_t barrier;
+ struct {
+ dict_t *dict;
+ int32_t flags;
+ } fsetxattr;
- /* extra data for fops */
- dict_t *xdata_req;
- dict_t *xdata_rsp;
+ struct {
+ char *name;
+ } removexattr;
- dict_t *xattr_rsp; /*for [f]xattrop*/
+ struct {
+ dict_t *xattr;
+ gf_xattrop_flags_t optype;
+ } xattrop;
- mode_t umask;
- int xflag;
- gf_boolean_t do_discovery;
- struct afr_reply *replies;
+ /* dir write */
- /* For client side background heals. */
- struct list_head healer;
- call_frame_t *heal_frame;
+ struct {
+ inode_t *inode;
+ struct iatt buf;
+ struct iatt preparent;
+ struct iatt postparent;
+ struct iatt prenewparent;
+ struct iatt postnewparent;
+ } dir_fop; // common structure for all dir fops
- gf_boolean_t need_full_crawl;
- afr_fop_lock_state_t fop_lock_state;
+ struct {
+ fd_t *fd;
+ dict_t *params;
+ int32_t flags;
+ mode_t mode;
+ } create;
- gf_boolean_t is_read_txn;
- afr_inode_ctx_t *inode_ctx;
-} afr_local_t;
+ struct {
+ dev_t dev;
+ mode_t mode;
+ dict_t *params;
+ } mknod;
+
+ struct {
+ int32_t mode;
+ dict_t *params;
+ } mkdir;
+
+ struct {
+ int flags;
+ } rmdir;
+
+ struct {
+ dict_t *params;
+ char *linkpath;
+ } symlink;
+
+ struct {
+ int32_t mode;
+ off_t offset;
+ size_t len;
+ } fallocate;
+
+ struct {
+ off_t offset;
+ size_t len;
+ } discard;
+ struct {
+ off_t offset;
+ off_t len;
+ struct iatt prebuf;
+ struct iatt postbuf;
+ } zerofill;
+
+ struct {
+ char *volume;
+ int32_t cmd;
+ int32_t in_cmd;
+ struct gf_flock in_flock;
+ struct gf_flock flock;
+ void *xdata;
+ } inodelk;
+
+ struct {
+ char *volume;
+ char *basename;
+ entrylk_cmd in_cmd;
+ entrylk_cmd cmd;
+ entrylk_type type;
+ void *xdata;
+ } entrylk;
+
+ struct {
+ off_t offset;
+ gf_seek_what_t what;
+ } seek;
+
+ struct {
+ int32_t datasync;
+ } fsync;
+
+ struct {
+ struct gf_lease user_lease;
+ struct gf_lease ret_lease;
+ unsigned char *locked_nodes;
+ } lease;
+
+ } cont;
+
+ struct {
+ off_t start, len;
+
+ gf_boolean_t eager_lock_on;
+ gf_boolean_t do_eager_unlock;
+
+ char *basename;
+ char *new_basename;
+
+ loc_t parent_loc;
+ loc_t new_parent_loc;
+
+ afr_transaction_type type;
+
+ /* stub to resume on destruction
+ of the transaction frame */
+ call_stub_t *resume_stub;
+
+ struct list_head owner_list;
+ struct list_head wait_list;
+
+ unsigned char *pre_op;
+
+ /* Changelog xattr dict for [f]xattrop*/
+ dict_t **changelog_xdata;
+ unsigned char *pre_op_sources;
+
+ /* @failed_subvols: subvolumes on which a pre-op or a
+ FOP failed. */
+ unsigned char *failed_subvols;
+
+ /* @dirtied: flag which indicates whether we set dirty flag
+ in the OP. Typically true when we are performing operation
+ on more than one subvol and optimistic changelog is disabled
+
+ A 'true' value set in @dirtied flag means an 'undirtying'
+ has to be done in POST-OP phase.
+ */
+ gf_boolean_t dirtied;
+
+ /* @inherited: flag which indicates that the dirty flags
+ of the previous transaction were inherited
+ */
+ gf_boolean_t inherited;
+
+ /*
+ @no_uninherit: flag which indicates that a pre_op_uninherit()
+ must _not_ be attempted (and returned as failure) always. This
+ flag is set when a hard pre-op is performed, but not accounted
+ for it in fd_ctx->on_disk[]. Such transactions are "isolated"
+ from the pre-op piggybacking entirely and therefore uninherit
+ must not be attempted.
+ */
+ gf_boolean_t no_uninherit;
+
+ /* @uninherit_done:
+ @uninherit_value:
+
+ The above pair variables make pre_op_uninherit() idempotent.
+ Both are FALSE initially. The first call to pre_op_uninherit
+ sets @uninherit_done to TRUE and the return value to
+ @uninherit_value. Further calls will check for @uninherit_done
+ to be TRUE and if so will simply return @uninherit_value.
+ */
+ gf_boolean_t uninherit_done;
+ gf_boolean_t uninherit_value;
+
+ gf_boolean_t in_flight_sb; /* Indicator for occurrence of
+ split-brain while in the middle of
+ a txn. */
+ int32_t in_flight_sb_errno; /* This is where the cause of the
+ failure on the last good copy of
+ the file is stored.
+ */
+
+ /* @changelog_resume: function to be called after changlogging
+ (either pre-op or post-op) is done
+ */
+ afr_changelog_resume_t changelog_resume;
+
+ call_frame_t *main_frame; /*Fop frame*/
+ call_frame_t *frame; /*Transaction frame*/
+
+ int (*wind)(call_frame_t *frame, xlator_t *this, int subvol);
+
+ int (*unwind)(call_frame_t *frame, xlator_t *this);
+
+ /* post-op hook */
+ } transaction;
+
+ syncbarrier_t barrier;
+
+ /* extra data for fops */
+ dict_t *xdata_req;
+ dict_t *xdata_rsp;
+
+ dict_t *xattr_rsp; /*for [f]xattrop*/
+
+ mode_t umask;
+ int xflag;
+ gf_boolean_t do_discovery;
+ struct afr_reply *replies;
+
+ /* For client side background heals. */
+ struct list_head healer;
+ call_frame_t *heal_frame;
+
+ gf_boolean_t need_full_crawl;
+ afr_fop_lock_state_t fop_lock_state;
+
+ gf_boolean_t is_read_txn;
+ afr_inode_ctx_t *inode_ctx;
+} afr_local_t;
typedef struct afr_spbc_timeout {
- call_frame_t *frame;
- gf_boolean_t d_spb;
- gf_boolean_t m_spb;
- loc_t *loc;
- int spb_child_index;
+ call_frame_t *frame;
+ gf_boolean_t d_spb;
+ gf_boolean_t m_spb;
+ loc_t *loc;
+ int spb_child_index;
} afr_spbc_timeout_t;
typedef struct afr_spb_status {
- call_frame_t *frame;
- loc_t *loc;
+ call_frame_t *frame;
+ loc_t *loc;
} afr_spb_status_t;
typedef struct afr_empty_brick_args {
- call_frame_t *frame;
- loc_t loc;
- int empty_index;
- char *op_type;
+ call_frame_t *frame;
+ loc_t loc;
+ int empty_index;
+ char *op_type;
} afr_empty_brick_args_t;
typedef struct afr_read_subvol_args {
- ia_type_t ia_type;
- uuid_t gfid;
+ ia_type_t ia_type;
+ uuid_t gfid;
} afr_read_subvol_args_t;
typedef struct afr_granular_esh_args {
- fd_t *heal_fd;
- xlator_t *xl;
- call_frame_t *frame;
- gf_boolean_t mismatch; /* flag to represent occurrence of type/gfid
- mismatch */
+ fd_t *heal_fd;
+ xlator_t *xl;
+ call_frame_t *frame;
+ gf_boolean_t mismatch; /* flag to represent occurrence of type/gfid
+ mismatch */
} afr_granular_esh_args_t;
int
-afr_inode_get_readable (call_frame_t *frame, inode_t *inode, xlator_t *this,
- unsigned char *readable, int *event_p, int type);
+afr_inode_get_readable(call_frame_t *frame, inode_t *inode, xlator_t *this,
+ unsigned char *readable, int *event_p, int type);
int
-afr_inode_read_subvol_get (inode_t *inode, xlator_t *this,
- unsigned char *data_subvols,
- unsigned char *metadata_subvols,
- int *event_generation);
+afr_inode_read_subvol_get(inode_t *inode, xlator_t *this,
+ unsigned char *data_subvols,
+ unsigned char *metadata_subvols,
+ int *event_generation);
int
-__afr_inode_read_subvol_get (inode_t *inode, xlator_t *this,
- unsigned char *data_subvols,
- unsigned char *metadata_subvols,
- int *event_generation);
+__afr_inode_read_subvol_get(inode_t *inode, xlator_t *this,
+ unsigned char *data_subvols,
+ unsigned char *metadata_subvols,
+ int *event_generation);
int
-__afr_inode_read_subvol_set (inode_t *inode, xlator_t *this,
- unsigned char *data_subvols,
- unsigned char *metadata_subvol,
- int event_generation);
+__afr_inode_read_subvol_set(inode_t *inode, xlator_t *this,
+ unsigned char *data_subvols,
+ unsigned char *metadata_subvol,
+ int event_generation);
int
-afr_inode_read_subvol_set (inode_t *inode, xlator_t *this,
- unsigned char *data_subvols,
- unsigned char *metadata_subvols,
- int event_generation);
+afr_inode_read_subvol_set(inode_t *inode, xlator_t *this,
+ unsigned char *data_subvols,
+ unsigned char *metadata_subvols,
+ int event_generation);
int
-afr_inode_event_gen_reset (inode_t *inode, xlator_t *this);
+afr_inode_event_gen_reset(inode_t *inode, xlator_t *this);
int
-afr_read_subvol_select_by_policy (inode_t *inode, xlator_t *this,
- unsigned char *readable,
- afr_read_subvol_args_t *args);
+afr_read_subvol_select_by_policy(inode_t *inode, xlator_t *this,
+ unsigned char *readable,
+ afr_read_subvol_args_t *args);
int
-afr_inode_read_subvol_type_get (inode_t *inode, xlator_t *this,
- unsigned char *readable, int *event_p,
- int type);
+afr_inode_read_subvol_type_get(inode_t *inode, xlator_t *this,
+ unsigned char *readable, int *event_p, int type);
int
-afr_read_subvol_get (inode_t *inode, xlator_t *this, int *subvol_p,
- unsigned char *readables,
- int *event_p, afr_transaction_type type,
- afr_read_subvol_args_t *args);
+afr_read_subvol_get(inode_t *inode, xlator_t *this, int *subvol_p,
+ unsigned char *readables, int *event_p,
+ afr_transaction_type type, afr_read_subvol_args_t *args);
-#define afr_data_subvol_get(i, t, s, r, e, a) \
- afr_read_subvol_get(i, t, s, r, e, AFR_DATA_TRANSACTION, a)
+#define afr_data_subvol_get(i, t, s, r, e, a) \
+ afr_read_subvol_get(i, t, s, r, e, AFR_DATA_TRANSACTION, a)
-#define afr_metadata_subvol_get(i, t, s, r, e, a) \
- afr_read_subvol_get(i, t, s, r, e, AFR_METADATA_TRANSACTION, a)
+#define afr_metadata_subvol_get(i, t, s, r, e, a) \
+ afr_read_subvol_get(i, t, s, r, e, AFR_METADATA_TRANSACTION, a)
int
-afr_inode_refresh (call_frame_t *frame, xlator_t *this, inode_t *inode,
- uuid_t gfid, afr_inode_refresh_cbk_t cbk);
+afr_inode_refresh(call_frame_t *frame, xlator_t *this, inode_t *inode,
+ uuid_t gfid, afr_inode_refresh_cbk_t cbk);
int32_t
-afr_notify (xlator_t *this, int32_t event, void *data, void *data2);
+afr_notify(xlator_t *this, int32_t event, void *data, void *data2);
int
-xattr_is_equal (dict_t *this, char *key1, data_t *value1, void *data);
+xattr_is_equal(dict_t *this, char *key1, data_t *value1, void *data);
int
-afr_init_entry_lockee (afr_entry_lockee_t *lockee, afr_local_t *local,
- loc_t *loc, char *basename, int child_count);
+afr_init_entry_lockee(afr_entry_lockee_t *lockee, afr_local_t *local,
+ loc_t *loc, char *basename, int child_count);
void
-afr_entry_lockee_cleanup (afr_internal_lock_t *int_lock);
+afr_entry_lockee_cleanup(afr_internal_lock_t *int_lock);
int
-afr_attempt_lock_recovery (xlator_t *this, int32_t child_index);
+afr_attempt_lock_recovery(xlator_t *this, int32_t child_index);
int
-afr_mark_locked_nodes (xlator_t *this, fd_t *fd,
- unsigned char *locked_nodes);
+afr_mark_locked_nodes(xlator_t *this, fd_t *fd, unsigned char *locked_nodes);
void
-afr_set_lk_owner (call_frame_t *frame, xlator_t *this, void *lk_owner);
+afr_set_lk_owner(call_frame_t *frame, xlator_t *this, void *lk_owner);
int
-afr_set_lock_number (call_frame_t *frame, xlator_t *this);
+afr_set_lock_number(call_frame_t *frame, xlator_t *this);
int32_t
-afr_unlock (call_frame_t *frame, xlator_t *this);
+afr_unlock(call_frame_t *frame, xlator_t *this);
int
-afr_nonblocking_entrylk (call_frame_t *frame, xlator_t *this);
+afr_nonblocking_entrylk(call_frame_t *frame, xlator_t *this);
int
-afr_nonblocking_inodelk (call_frame_t *frame, xlator_t *this);
+afr_nonblocking_inodelk(call_frame_t *frame, xlator_t *this);
int
-afr_blocking_lock (call_frame_t *frame, xlator_t *this);
+afr_blocking_lock(call_frame_t *frame, xlator_t *this);
int
-afr_internal_lock_finish (call_frame_t *frame, xlator_t *this);
+afr_internal_lock_finish(call_frame_t *frame, xlator_t *this);
int
-__afr_fd_ctx_set (xlator_t *this, fd_t *fd);
+__afr_fd_ctx_set(xlator_t *this, fd_t *fd);
afr_fd_ctx_t *
-afr_fd_ctx_get (fd_t *fd, xlator_t *this);
+afr_fd_ctx_get(fd_t *fd, xlator_t *this);
int
-afr_build_parent_loc (loc_t *parent, loc_t *child, int32_t *op_errno);
+afr_build_parent_loc(loc_t *parent, loc_t *child, int32_t *op_errno);
int
-afr_locked_nodes_count (unsigned char *locked_nodes, int child_count);
+afr_locked_nodes_count(unsigned char *locked_nodes, int child_count);
int
-afr_replies_interpret (call_frame_t *frame, xlator_t *this, inode_t *inode,
- gf_boolean_t *start_heal);
+afr_replies_interpret(call_frame_t *frame, xlator_t *this, inode_t *inode,
+ gf_boolean_t *start_heal);
void
-afr_local_replies_wipe (afr_local_t *local, afr_private_t *priv);
+afr_local_replies_wipe(afr_local_t *local, afr_private_t *priv);
void
-afr_local_cleanup (afr_local_t *local, xlator_t *this);
+afr_local_cleanup(afr_local_t *local, xlator_t *this);
int
-afr_frame_return (call_frame_t *frame);
+afr_frame_return(call_frame_t *frame);
int
-afr_open (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags,
- fd_t *fd, dict_t *xdata);
+afr_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags,
+ fd_t *fd, dict_t *xdata);
void
-afr_local_transaction_cleanup (afr_local_t *local, xlator_t *this);
+afr_local_transaction_cleanup(afr_local_t *local, xlator_t *this);
int
-afr_cleanup_fd_ctx (xlator_t *this, fd_t *fd);
-
-#define AFR_STACK_UNWIND(fop, frame, op_ret, op_errno, params ...)\
- do { \
- afr_local_t *__local = NULL; \
- xlator_t *__this = NULL; \
- int32_t __op_ret = 0; \
- int32_t __op_errno = 0; \
- \
- __op_ret = op_ret; \
- __op_errno = op_errno; \
- if (frame) { \
- __local = frame->local; \
- __this = frame->this; \
- afr_handle_inconsistent_fop (frame, &__op_ret,\
- &__op_errno);\
- if (__local && __local->is_read_txn) \
- afr_pending_read_decrement (__this->private, __local->read_subvol); \
- frame->local = NULL; \
- } \
- \
- STACK_UNWIND_STRICT (fop, frame, __op_ret, \
- __op_errno, params); \
- if (__local) { \
- afr_local_cleanup (__local, __this); \
- mem_put (__local); \
- } \
- } while (0)
-
-#define AFR_STACK_DESTROY(frame) \
- do { \
- afr_local_t *__local = NULL; \
- xlator_t *__this = NULL; \
- __local = frame->local; \
- __this = frame->this; \
- frame->local = NULL; \
- STACK_DESTROY (frame->root); \
- if (__local) { \
- afr_local_cleanup (__local, __this); \
- mem_put (__local); \
- } \
- } while (0);
-
-#define AFR_FRAME_INIT(frame, op_errno) \
- ({frame->local = mem_get0 (THIS->local_pool); \
- if (afr_local_init (frame->local, THIS->private, &op_errno)) { \
- afr_local_cleanup (frame->local, THIS); \
- mem_put (frame->local); \
- frame->local = NULL; }; \
- frame->local; })
-
-#define AFR_STACK_RESET(frame) \
- do { \
- afr_local_t *__local = NULL; \
- xlator_t *__this = NULL; \
- __local = frame->local; \
- __this = frame->this; \
- frame->local = NULL; \
- int __opr; \
- STACK_RESET (frame->root); \
- if (__local) { \
- afr_local_cleanup (__local, __this); \
- mem_put (__local); \
- } \
- AFR_FRAME_INIT (frame, __opr); \
- } while (0)
+afr_cleanup_fd_ctx(xlator_t *this, fd_t *fd);
+
+#define AFR_STACK_UNWIND(fop, frame, op_ret, op_errno, params...) \
+ do { \
+ afr_local_t *__local = NULL; \
+ xlator_t *__this = NULL; \
+ int32_t __op_ret = 0; \
+ int32_t __op_errno = 0; \
+ \
+ __op_ret = op_ret; \
+ __op_errno = op_errno; \
+ if (frame) { \
+ __local = frame->local; \
+ __this = frame->this; \
+ afr_handle_inconsistent_fop(frame, &__op_ret, &__op_errno); \
+ if (__local && __local->is_read_txn) \
+ afr_pending_read_decrement(__this->private, \
+ __local->read_subvol); \
+ frame->local = NULL; \
+ } \
+ \
+ STACK_UNWIND_STRICT(fop, frame, __op_ret, __op_errno, params); \
+ if (__local) { \
+ afr_local_cleanup(__local, __this); \
+ mem_put(__local); \
+ } \
+ } while (0)
+
+#define AFR_STACK_DESTROY(frame) \
+ do { \
+ afr_local_t *__local = NULL; \
+ xlator_t *__this = NULL; \
+ __local = frame->local; \
+ __this = frame->this; \
+ frame->local = NULL; \
+ STACK_DESTROY(frame->root); \
+ if (__local) { \
+ afr_local_cleanup(__local, __this); \
+ mem_put(__local); \
+ } \
+ } while (0);
+
+#define AFR_FRAME_INIT(frame, op_errno) \
+ ({ \
+ frame->local = mem_get0(THIS->local_pool); \
+ if (afr_local_init(frame->local, THIS->private, &op_errno)) { \
+ afr_local_cleanup(frame->local, THIS); \
+ mem_put(frame->local); \
+ frame->local = NULL; \
+ }; \
+ frame->local; \
+ })
+
+#define AFR_STACK_RESET(frame) \
+ do { \
+ afr_local_t *__local = NULL; \
+ xlator_t *__this = NULL; \
+ __local = frame->local; \
+ __this = frame->this; \
+ frame->local = NULL; \
+ int __opr; \
+ STACK_RESET(frame->root); \
+ if (__local) { \
+ afr_local_cleanup(__local, __this); \
+ mem_put(__local); \
+ } \
+ AFR_FRAME_INIT(frame, __opr); \
+ } while (0)
/* allocate and return a string that is the basename of argument */
static inline char *
-AFR_BASENAME (const char *str)
+AFR_BASENAME(const char *str)
{
- char *__tmp_str = NULL;
- char *__basename_str = NULL;
- __tmp_str = gf_strdup (str);
- __basename_str = gf_strdup (basename (__tmp_str));
- GF_FREE (__tmp_str);
- return __basename_str;
+ char *__tmp_str = NULL;
+ char *__basename_str = NULL;
+ __tmp_str = gf_strdup(str);
+ __basename_str = gf_strdup(basename(__tmp_str));
+ GF_FREE(__tmp_str);
+ return __basename_str;
}
call_frame_t *
-afr_copy_frame (call_frame_t *base);
+afr_copy_frame(call_frame_t *base);
int
-afr_transaction_local_init (afr_local_t *local, xlator_t *this);
+afr_transaction_local_init(afr_local_t *local, xlator_t *this);
int32_t
-afr_marker_getxattr (call_frame_t *frame, xlator_t *this,
- loc_t *loc, const char *name,afr_local_t *local, afr_private_t *priv );
+afr_marker_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ const char *name, afr_local_t *local, afr_private_t *priv);
int
-afr_local_init (afr_local_t *local, afr_private_t *priv, int32_t *op_errno);
+afr_local_init(afr_local_t *local, afr_private_t *priv, int32_t *op_errno);
int
-afr_internal_lock_init (afr_internal_lock_t *lk, size_t child_count);
+afr_internal_lock_init(afr_internal_lock_t *lk, size_t child_count);
int
-afr_higher_errno (int32_t old_errno, int32_t new_errno);
+afr_higher_errno(int32_t old_errno, int32_t new_errno);
int
-afr_final_errno (afr_local_t *local, afr_private_t *priv);
+afr_final_errno(afr_local_t *local, afr_private_t *priv);
int
-afr_xattr_req_prepare (xlator_t *this, dict_t *xattr_req);
+afr_xattr_req_prepare(xlator_t *this, dict_t *xattr_req);
void
-afr_fix_open (fd_t *fd, xlator_t *this);
+afr_fix_open(fd_t *fd, xlator_t *this);
afr_fd_ctx_t *
-afr_fd_ctx_get (fd_t *fd, xlator_t *this);
+afr_fd_ctx_get(fd_t *fd, xlator_t *this);
void
-afr_set_low_priority (call_frame_t *frame);
+afr_set_low_priority(call_frame_t *frame);
int
-afr_child_fd_ctx_set (xlator_t *this, fd_t *fd, int32_t child,
- int flags);
+afr_child_fd_ctx_set(xlator_t *this, fd_t *fd, int32_t child, int flags);
void
-afr_matrix_cleanup (int32_t **pending, unsigned int m);
+afr_matrix_cleanup(int32_t **pending, unsigned int m);
-int32_t**
-afr_matrix_create (unsigned int m, unsigned int n);
+int32_t **
+afr_matrix_create(unsigned int m, unsigned int n);
-int**
-afr_mark_pending_changelog (afr_private_t *priv, unsigned char *pending,
- dict_t *xattr, ia_type_t iat);
+int **
+afr_mark_pending_changelog(afr_private_t *priv, unsigned char *pending,
+ dict_t *xattr, ia_type_t iat);
void
-afr_filter_xattrs (dict_t *xattr);
+afr_filter_xattrs(dict_t *xattr);
/*
* Special value indicating we should use the "auto" quorum method instead of
@@ -1120,139 +1139,139 @@ afr_filter_xattrs (dict_t *xattr);
#define AFR_QUORUM_AUTO INT_MAX
int
-afr_fd_report_unstable_write (xlator_t *this, afr_local_t *local);
+afr_fd_report_unstable_write(xlator_t *this, afr_local_t *local);
gf_boolean_t
-afr_fd_has_witnessed_unstable_write (xlator_t *this, inode_t *inode);
+afr_fd_has_witnessed_unstable_write(xlator_t *this, inode_t *inode);
void
-afr_reply_wipe (struct afr_reply *reply);
+afr_reply_wipe(struct afr_reply *reply);
void
-afr_replies_wipe (struct afr_reply *replies, int count);
+afr_replies_wipe(struct afr_reply *replies, int count);
gf_boolean_t
-afr_xattrs_are_equal (dict_t *dict1, dict_t *dict2);
+afr_xattrs_are_equal(dict_t *dict1, dict_t *dict2);
gf_boolean_t
-afr_is_xattr_ignorable (char *key);
+afr_is_xattr_ignorable(char *key);
int
-afr_get_heal_info (call_frame_t *frame, xlator_t *this, loc_t *loc);
+afr_get_heal_info(call_frame_t *frame, xlator_t *this, loc_t *loc);
int
afr_heal_splitbrain_file(call_frame_t *frame, xlator_t *this, loc_t *loc);
int
-afr_get_split_brain_status (void *opaque);
+afr_get_split_brain_status(void *opaque);
int
-afr_get_split_brain_status_cbk (int ret, call_frame_t *frame, void *opaque);
+afr_get_split_brain_status_cbk(int ret, call_frame_t *frame, void *opaque);
int
-afr_inode_split_brain_choice_set (inode_t *inode, xlator_t *this,
- int spb_choice);
+afr_inode_split_brain_choice_set(inode_t *inode, xlator_t *this,
+ int spb_choice);
int
-afr_inode_split_brain_choice_get (inode_t *inode, xlator_t *this,
- int *spb_choice);
+afr_inode_split_brain_choice_get(inode_t *inode, xlator_t *this,
+ int *spb_choice);
int
-afr_get_child_index_from_name (xlator_t *this, char *name);
+afr_get_child_index_from_name(xlator_t *this, char *name);
int
-afr_is_split_brain (call_frame_t *frame, xlator_t *this, inode_t *inode,
- uuid_t gfid, gf_boolean_t *d_spb, gf_boolean_t *m_spb);
+afr_is_split_brain(call_frame_t *frame, xlator_t *this, inode_t *inode,
+ uuid_t gfid, gf_boolean_t *d_spb, gf_boolean_t *m_spb);
int
-afr_spb_choice_timeout_cancel (xlator_t *this, inode_t *inode);
+afr_spb_choice_timeout_cancel(xlator_t *this, inode_t *inode);
int
-afr_set_split_brain_choice (int ret, call_frame_t *frame, void *opaque);
+afr_set_split_brain_choice(int ret, call_frame_t *frame, void *opaque);
gf_boolean_t
-afr_get_need_heal (xlator_t *this);
+afr_get_need_heal(xlator_t *this);
void
-afr_set_need_heal (xlator_t *this, afr_local_t *local);
+afr_set_need_heal(xlator_t *this, afr_local_t *local);
int
-afr_selfheal_data_open (xlator_t *this, inode_t *inode, fd_t **fd);
+afr_selfheal_data_open(xlator_t *this, inode_t *inode, fd_t **fd);
int
-afr_get_msg_id (char *op_type);
+afr_get_msg_id(char *op_type);
int
-afr_set_in_flight_sb_status (xlator_t *this, call_frame_t *frame,
- inode_t *inode);
+afr_set_in_flight_sb_status(xlator_t *this, call_frame_t *frame,
+ inode_t *inode);
int32_t
-afr_quorum_errno (afr_private_t *priv);
+afr_quorum_errno(afr_private_t *priv);
gf_boolean_t
-afr_is_consistent_io_possible (afr_local_t *local, afr_private_t *priv,
- int32_t *op_errno);
+afr_is_consistent_io_possible(afr_local_t *local, afr_private_t *priv,
+ int32_t *op_errno);
void
-afr_handle_inconsistent_fop (call_frame_t *frame, int32_t *op_ret,
- int32_t *op_errno);
+afr_handle_inconsistent_fop(call_frame_t *frame, int32_t *op_ret,
+ int32_t *op_errno);
void
-afr_inode_write_fill (call_frame_t *frame, xlator_t *this, int child_index,
+afr_inode_write_fill(call_frame_t *frame, xlator_t *this, int child_index,
int32_t op_ret, int32_t op_errno, struct iatt *prebuf,
struct iatt *postbuf, dict_t *xdata);
void
-afr_process_post_writev (call_frame_t *frame, xlator_t *this);
+afr_process_post_writev(call_frame_t *frame, xlator_t *this);
void
-afr_writev_unwind (call_frame_t *frame, xlator_t *this);
+afr_writev_unwind(call_frame_t *frame, xlator_t *this);
void
-afr_writev_copy_outvars (call_frame_t *src_frame, call_frame_t *dst_frame);
+afr_writev_copy_outvars(call_frame_t *src_frame, call_frame_t *dst_frame);
void
-afr_update_uninodelk (afr_local_t *local, afr_internal_lock_t *int_lock,
- int32_t child_index);
+afr_update_uninodelk(afr_local_t *local, afr_internal_lock_t *int_lock,
+ int32_t child_index);
int
afr_is_inodelk_transaction(afr_transaction_type type);
afr_fd_ctx_t *
-__afr_fd_ctx_get (fd_t *fd, xlator_t *this);
+__afr_fd_ctx_get(fd_t *fd, xlator_t *this);
gf_boolean_t
-afr_is_inode_refresh_reqd (inode_t *inode, xlator_t *this,
- int event_gen1, int event_gen2);
+afr_is_inode_refresh_reqd(inode_t *inode, xlator_t *this, int event_gen1,
+ int event_gen2);
int
-afr_serialize_xattrs_with_delimiter (call_frame_t *frame, xlator_t *this,
- char *buf, const char *default_str,
- int32_t *serz_len, char delimiter);
+afr_serialize_xattrs_with_delimiter(call_frame_t *frame, xlator_t *this,
+ char *buf, const char *default_str,
+ int32_t *serz_len, char delimiter);
gf_boolean_t
-afr_is_symmetric_error (call_frame_t *frame, xlator_t *this);
+afr_is_symmetric_error(call_frame_t *frame, xlator_t *this);
int
-__afr_inode_ctx_get (xlator_t *this, inode_t *inode, afr_inode_ctx_t **ctx);
+__afr_inode_ctx_get(xlator_t *this, inode_t *inode, afr_inode_ctx_t **ctx);
uint64_t
-afr_write_subvol_get (call_frame_t *frame, xlator_t *this);
+afr_write_subvol_get(call_frame_t *frame, xlator_t *this);
int
-afr_write_subvol_set (call_frame_t *frame, xlator_t *this);
+afr_write_subvol_set(call_frame_t *frame, xlator_t *this);
int
-afr_write_subvol_reset (call_frame_t *frame, xlator_t *this);
+afr_write_subvol_reset(call_frame_t *frame, xlator_t *this);
int
-afr_set_inode_local (xlator_t *this, afr_local_t *local, inode_t *inode);
+afr_set_inode_local(xlator_t *this, afr_local_t *local, inode_t *inode);
int
-afr_fill_ta_loc (xlator_t *this, loc_t *loc);
+afr_fill_ta_loc(xlator_t *this, loc_t *loc);
int
-afr_ta_post_op_lock (xlator_t *this, loc_t *loc);
+afr_ta_post_op_lock(xlator_t *this, loc_t *loc);
int
-afr_ta_post_op_unlock (xlator_t *this, loc_t *loc);
+afr_ta_post_op_unlock(xlator_t *this, loc_t *loc);
gf_boolean_t
-afr_is_pending_set (xlator_t *this, dict_t *xdata, int type);
+afr_is_pending_set(xlator_t *this, dict_t *xdata, int type);
-call_frame_t*
-afr_ta_frame_create (xlator_t *this);
+call_frame_t *
+afr_ta_frame_create(xlator_t *this);
#endif /* __AFR_H__ */
diff --git a/xlators/cluster/dht/src/dht-common.h b/xlators/cluster/dht/src/dht-common.h
index 86b3eb3cbd2..bd30fd84b88 100644
--- a/xlators/cluster/dht/src/dht-common.h
+++ b/xlators/cluster/dht/src/dht-common.h
@@ -25,141 +25,136 @@
#ifndef _DHT_H
#define _DHT_H
-#define GF_XATTR_FIX_LAYOUT_KEY "distribute.fix.layout"
-#define GF_XATTR_TIER_LAYOUT_FIXED_KEY "trusted.tier.fix.layout.complete"
-#define GF_XATTR_FILE_MIGRATE_KEY "trusted.distribute.migrate-data"
-#define DHT_MDS_STR "mds"
-#define GF_DHT_LOOKUP_UNHASHED_OFF 0
-#define GF_DHT_LOOKUP_UNHASHED_ON 1
-#define GF_DHT_LOOKUP_UNHASHED_AUTO 2
-#define DHT_PATHINFO_HEADER "DISTRIBUTE:"
-#define DHT_FILE_MIGRATE_DOMAIN "dht.file.migrate"
+#define GF_XATTR_FIX_LAYOUT_KEY "distribute.fix.layout"
+#define GF_XATTR_TIER_LAYOUT_FIXED_KEY "trusted.tier.fix.layout.complete"
+#define GF_XATTR_FILE_MIGRATE_KEY "trusted.distribute.migrate-data"
+#define DHT_MDS_STR "mds"
+#define GF_DHT_LOOKUP_UNHASHED_OFF 0
+#define GF_DHT_LOOKUP_UNHASHED_ON 1
+#define GF_DHT_LOOKUP_UNHASHED_AUTO 2
+#define DHT_PATHINFO_HEADER "DISTRIBUTE:"
+#define DHT_FILE_MIGRATE_DOMAIN "dht.file.migrate"
/* Layout synchronization */
-#define DHT_LAYOUT_HEAL_DOMAIN "dht.layout.heal"
+#define DHT_LAYOUT_HEAL_DOMAIN "dht.layout.heal"
/* Namespace synchronization */
-#define DHT_ENTRY_SYNC_DOMAIN "dht.entry.sync"
-#define TIERING_MIGRATION_KEY "tiering.migration"
-#define DHT_LAYOUT_HASH_INVALID 1
-#define MAX_REBAL_THREADS sysconf(_SC_NPROCESSORS_ONLN)
-
-#define DHT_DIR_STAT_BLOCKS 8
-#define DHT_DIR_STAT_SIZE 4096
+#define DHT_ENTRY_SYNC_DOMAIN "dht.entry.sync"
+#define TIERING_MIGRATION_KEY "tiering.migration"
+#define DHT_LAYOUT_HASH_INVALID 1
+#define MAX_REBAL_THREADS sysconf(_SC_NPROCESSORS_ONLN)
+#define DHT_DIR_STAT_BLOCKS 8
+#define DHT_DIR_STAT_SIZE 4096
/* Virtual xattrs for debugging */
-#define DHT_DBG_HASHED_SUBVOL_PATTERN "dht.file.hashed-subvol.*"
-#define DHT_DBG_HASHED_SUBVOL_KEY "dht.file.hashed-subvol."
-
+#define DHT_DBG_HASHED_SUBVOL_PATTERN "dht.file.hashed-subvol.*"
+#define DHT_DBG_HASHED_SUBVOL_KEY "dht.file.hashed-subvol."
/* Array to hold custom xattr keys
-*/
+ */
extern char *xattrs_to_heal[];
/* Rebalance nodeuuid flags */
-#define REBAL_NODEUUID_MINE 0x01
+#define REBAL_NODEUUID_MINE 0x01
+typedef int (*dht_selfheal_dir_cbk_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, dict_t *xdata);
+typedef int (*dht_defrag_cbk_fn_t)(xlator_t *this, xlator_t *dst_node,
+ call_frame_t *frame, int ret);
-typedef int (*dht_selfheal_dir_cbk_t) (call_frame_t *frame, void *cookie,
- xlator_t *this,
- int32_t op_ret, int32_t op_errno,
- dict_t *xdata);
-typedef int (*dht_defrag_cbk_fn_t) (xlator_t *this, xlator_t *dst_node,
- call_frame_t *frame, int ret);
-
-typedef int (*dht_refresh_layout_unlock) (call_frame_t *frame, xlator_t *this,
+typedef int (*dht_refresh_layout_unlock)(call_frame_t *frame, xlator_t *this,
int op_ret, int invoke_cbk);
-typedef int (*dht_refresh_layout_done_handle) (call_frame_t *frame);
+typedef int (*dht_refresh_layout_done_handle)(call_frame_t *frame);
struct dht_layout {
- int spread_cnt; /* layout spread count per directory,
- is controlled by 'setxattr()' with
- special key */
- int cnt;
- int preset;
- /*
- * The last *configuration* state for which this directory was known
- * to be in balance. The corresponding vol_commit_hash changes
- * whenever bricks are added or removed. This value changes when a
- * (full) rebalance is complete. If they match, it's safe to assume
- * that every file is where it should be and there's no need to do
- * lookups for files elsewhere. If they don't, then we have to do a
- * global lookup to be sure.
- */
- uint32_t commit_hash;
- /*
- * The *runtime* state of the volume, changes when connections to
- * bricks are made or lost.
- */
- int gen;
- int type;
- gf_atomic_t ref; /* use with dht_conf_t->layout_lock */
- uint32_t search_unhashed;
- struct {
- int err; /* 0 = normal
- -1 = dir exists and no xattr
- >0 = dir lookup failed with errno
- */
- uint32_t start;
- uint32_t stop;
- uint32_t commit_hash;
- xlator_t *xlator;
- } list[];
+ int spread_cnt; /* layout spread count per directory,
+ is controlled by 'setxattr()' with
+ special key */
+ int cnt;
+ int preset;
+ /*
+ * The last *configuration* state for which this directory was known
+ * to be in balance. The corresponding vol_commit_hash changes
+ * whenever bricks are added or removed. This value changes when a
+ * (full) rebalance is complete. If they match, it's safe to assume
+ * that every file is where it should be and there's no need to do
+ * lookups for files elsewhere. If they don't, then we have to do a
+ * global lookup to be sure.
+ */
+ uint32_t commit_hash;
+ /*
+ * The *runtime* state of the volume, changes when connections to
+ * bricks are made or lost.
+ */
+ int gen;
+ int type;
+ gf_atomic_t ref; /* use with dht_conf_t->layout_lock */
+ uint32_t search_unhashed;
+ struct {
+ int err; /* 0 = normal
+ -1 = dir exists and no xattr
+ >0 = dir lookup failed with errno
+ */
+ uint32_t start;
+ uint32_t stop;
+ uint32_t commit_hash;
+ xlator_t *xlator;
+ } list[];
};
-typedef struct dht_layout dht_layout_t;
+typedef struct dht_layout dht_layout_t;
struct dht_stat_time {
- uint32_t atime;
- uint32_t atime_nsec;
- uint32_t ctime;
- uint32_t ctime_nsec;
- uint32_t mtime;
- uint32_t mtime_nsec;
+ uint32_t atime;
+ uint32_t atime_nsec;
+ uint32_t ctime;
+ uint32_t ctime_nsec;
+ uint32_t mtime;
+ uint32_t mtime_nsec;
};
typedef struct dht_stat_time dht_stat_time_t;
struct dht_inode_ctx {
- dht_layout_t *layout;
- dht_stat_time_t time;
- xlator_t *lock_subvol;
- xlator_t *mds_subvol; /* This is only used for directories */
+ dht_layout_t *layout;
+ dht_stat_time_t time;
+ xlator_t *lock_subvol;
+ xlator_t *mds_subvol; /* This is only used for directories */
};
typedef struct dht_inode_ctx dht_inode_ctx_t;
-
typedef enum {
- DHT_HASH_TYPE_DM,
- DHT_HASH_TYPE_DM_USER,
+ DHT_HASH_TYPE_DM,
+ DHT_HASH_TYPE_DM_USER,
} dht_hashfn_type_t;
typedef enum {
- DHT_INODELK,
- DHT_ENTRYLK,
+ DHT_INODELK,
+ DHT_ENTRYLK,
} dht_lock_type_t;
/* rebalance related */
struct dht_rebalance_ {
- xlator_t *from_subvol;
- xlator_t *target_node;
- off_t offset;
- size_t size;
- int32_t flags;
- int count;
- struct iobref *iobref;
- struct iovec *vector;
- struct iatt stbuf;
- struct iatt prebuf;
- struct iatt postbuf;
- dht_defrag_cbk_fn_t target_op_fn;
- dict_t *xdata;
- dict_t *xattr;
- dict_t *dict;
- int32_t set;
- struct gf_flock flock;
- int lock_cmd;
+ xlator_t *from_subvol;
+ xlator_t *target_node;
+ off_t offset;
+ size_t size;
+ int32_t flags;
+ int count;
+ struct iobref *iobref;
+ struct iovec *vector;
+ struct iatt stbuf;
+ struct iatt prebuf;
+ struct iatt postbuf;
+ dht_defrag_cbk_fn_t target_op_fn;
+ dict_t *xdata;
+ dict_t *xattr;
+ dict_t *dict;
+ int32_t set;
+ struct gf_flock flock;
+ int lock_cmd;
};
/**
@@ -167,63 +162,62 @@ struct dht_rebalance_ {
* events
**/
typedef enum {
- qdstatfs_action_OFF = 0,
- qdstatfs_action_REPLACE,
- qdstatfs_action_NEGLECT,
- qdstatfs_action_COMPARE,
+ qdstatfs_action_OFF = 0,
+ qdstatfs_action_REPLACE,
+ qdstatfs_action_NEGLECT,
+ qdstatfs_action_COMPARE,
} qdstatfs_action_t;
typedef enum {
- REACTION_INVALID,
- FAIL_ON_ANY_ERROR,
- IGNORE_ENOENT_ESTALE,
- IGNORE_ENOENT_ESTALE_EIO,
+ REACTION_INVALID,
+ FAIL_ON_ANY_ERROR,
+ IGNORE_ENOENT_ESTALE,
+ IGNORE_ENOENT_ESTALE_EIO,
} dht_reaction_type_t;
struct dht_skip_linkto_unlink {
-
- gf_boolean_t handle_valid_link;
- int opend_fd_count;
- xlator_t *hash_links_to;
- uuid_t cached_gfid;
- uuid_t hashed_gfid;
+ gf_boolean_t handle_valid_link;
+ int opend_fd_count;
+ xlator_t *hash_links_to;
+ uuid_t cached_gfid;
+ uuid_t hashed_gfid;
};
typedef struct {
- xlator_t *xl;
- loc_t loc; /* contains/points to inode to lock on. */
- short type; /* read/write lock. */
- char *domain; /* Only locks within a single domain
- * contend with each other
- */
- char *basename; /* Required for entrylk */
- gf_lkowner_t lk_owner;
- gf_boolean_t locked;
- dht_reaction_type_t do_on_failure;
+ xlator_t *xl;
+ loc_t loc; /* contains/points to inode to lock on. */
+ short type; /* read/write lock. */
+ char *domain; /* Only locks within a single domain
+ * contend with each other
+ */
+ char *basename; /* Required for entrylk */
+ gf_lkowner_t lk_owner;
+ gf_boolean_t locked;
+ dht_reaction_type_t do_on_failure;
} dht_lock_t;
/* The lock structure represents inodelk. */
typedef struct {
- fop_inodelk_cbk_t inodelk_cbk;
- dht_lock_t **locks;
- int lk_count;
- dht_reaction_type_t reaction;
-
- /* whether locking failed on _any_ of the "locks" above */
- int op_ret;
- int op_errno;
+ fop_inodelk_cbk_t inodelk_cbk;
+ dht_lock_t **locks;
+ int lk_count;
+ dht_reaction_type_t reaction;
+
+ /* whether locking failed on _any_ of the "locks" above */
+ int op_ret;
+ int op_errno;
} dht_ilock_wrap_t;
/* The lock structure represents entrylk. */
typedef struct {
- fop_entrylk_cbk_t entrylk_cbk;
- dht_lock_t **locks;
- int lk_count;
- dht_reaction_type_t reaction;
-
- /* whether locking failed on _any_ of the "locks" above */
- int op_ret;
- int op_errno;
+ fop_entrylk_cbk_t entrylk_cbk;
+ dht_lock_t **locks;
+ int lk_count;
+ dht_reaction_type_t reaction;
+
+ /* whether locking failed on _any_ of the "locks" above */
+ int op_ret;
+ int op_errno;
} dht_elock_wrap_t;
/* The first member of dht_dir_transaction_t should be of type dht_ilock_wrap_t.
@@ -232,1263 +226,1280 @@ typedef struct {
* lock[0].ns.parent_layout (like in dht_local_wipe).
*/
typedef union {
- union {
- dht_ilock_wrap_t my_layout;
- dht_ilock_wrap_t parent_layout;
- } layout;
- struct dht_namespace {
- dht_ilock_wrap_t parent_layout;
- dht_elock_wrap_t directory_ns;
- fop_entrylk_cbk_t ns_cbk;
- } ns;
+ union {
+ dht_ilock_wrap_t my_layout;
+ dht_ilock_wrap_t parent_layout;
+ } layout;
+ struct dht_namespace {
+ dht_ilock_wrap_t parent_layout;
+ dht_elock_wrap_t directory_ns;
+ fop_entrylk_cbk_t ns_cbk;
+ } ns;
} dht_dir_transaction_t;
-typedef
-int (*dht_selfheal_layout_t)(call_frame_t *frame, loc_t *loc,
- dht_layout_t *layout);
+typedef int (*dht_selfheal_layout_t)(call_frame_t *frame, loc_t *loc,
+ dht_layout_t *layout);
-typedef
-gf_boolean_t (*dht_need_heal_t)(call_frame_t *frame, dht_layout_t **inmem,
- dht_layout_t **ondisk);
+typedef gf_boolean_t (*dht_need_heal_t)(call_frame_t *frame,
+ dht_layout_t **inmem,
+ dht_layout_t **ondisk);
typedef struct {
- uint64_t blocks_used;
- uint64_t pblocks_used;
- uint64_t files_used;
- uint64_t pfiles_used;
- uint64_t unhashed_blocks_used;
- uint64_t unhashed_pblocks_used;
- uint64_t unhashed_files_used;
- uint64_t unhashed_pfiles_used;
- uint64_t unhashed_fsid;
- uint64_t hashed_fsid;
+ uint64_t blocks_used;
+ uint64_t pblocks_used;
+ uint64_t files_used;
+ uint64_t pfiles_used;
+ uint64_t unhashed_blocks_used;
+ uint64_t unhashed_pblocks_used;
+ uint64_t unhashed_files_used;
+ uint64_t unhashed_pfiles_used;
+ uint64_t unhashed_fsid;
+ uint64_t hashed_fsid;
} tier_statvfs_t;
struct dht_local {
- int call_cnt;
- loc_t loc;
- loc_t loc2;
- int op_ret;
- int op_errno;
- int layout_mismatch;
- /* Use stbuf as the postbuf, when we require both
- * pre and post attrs */
- struct iatt stbuf;
- struct iatt mds_stbuf;
- struct iatt prebuf;
- struct iatt preoldparent;
- struct iatt postoldparent;
- struct iatt preparent;
- struct iatt postparent;
- struct statvfs statvfs;
- tier_statvfs_t tier_statvfs;
- fd_t *fd;
- inode_t *inode;
- dict_t *params;
- dict_t *xattr;
- dict_t *mds_xattr;
- dict_t *xdata; /* dict used to save xdata response by xattr fop */
- dict_t *xattr_req;
- dht_layout_t *layout;
- size_t size;
- ino_t ia_ino;
- xlator_t *src_hashed, *src_cached;
- xlator_t *dst_hashed, *dst_cached;
- xlator_t *cached_subvol;
- xlator_t *hashed_subvol;
- xlator_t *mds_subvol; /* This is use for dir only */
- char need_selfheal;
- char need_xattr_heal;
- char need_attrheal;
- int file_count;
- int dir_count;
- call_frame_t *main_frame;
- int fop_succeeded;
- struct {
- fop_mknod_cbk_t linkfile_cbk;
- struct iatt stbuf;
- loc_t loc;
- inode_t *inode;
- dict_t *xattr;
- xlator_t *srcvol;
- } linkfile;
- struct {
- uint32_t hole_cnt;
- uint32_t overlaps_cnt;
- uint32_t down;
- uint32_t misc;
- uint32_t missing_cnt;
- dht_selfheal_dir_cbk_t dir_cbk;
- dht_selfheal_layout_t healer;
- dht_need_heal_t should_heal;
- gf_boolean_t force_mkdir;
- dht_layout_t *layout, *refreshed_layout;
- } selfheal;
-
- dht_refresh_layout_unlock refresh_layout_unlock;
- dht_refresh_layout_done_handle refresh_layout_done;
-
- uint32_t uid;
- uint32_t gid;
-
- /* needed by nufa */
- int32_t flags;
- mode_t mode;
- dev_t rdev;
- mode_t umask;
-
- /* need for file-info */
- char *xattr_val;
- char *key;
-
- /* which xattr request? */
- char xsel[256];
- int32_t alloc_len;
-
- /* gfid related */
- uuid_t gfid;
-
- /* flag used to make sure we need to return estale in
- {lookup,revalidate}_cbk */
- char return_estale;
- char need_lookup_everywhere;
-
- glusterfs_fop_t fop;
-
- gf_boolean_t linked;
- xlator_t *link_subvol;
-
- struct dht_rebalance_ rebalance;
- xlator_t *first_up_subvol;
-
- gf_boolean_t quota_deem_statfs;
-
- gf_boolean_t added_link;
- gf_boolean_t is_linkfile;
-
- struct dht_skip_linkto_unlink skip_unlink;
-
- dht_dir_transaction_t lock[2], *current;
-
- /* inodelks during filerename for backward compatibility */
- dht_lock_t **rename_inodelk_backward_compatible;
- int rename_inodelk_bc_count;
-
- short lock_type;
-
- call_stub_t *stub;
- int32_t parent_disk_layout[4];
-
- /* rename rollback */
- int *ret_cache ;
-
- /* fd open check */
- gf_boolean_t fd_checked;
- /* This is use only for directory operation */
- int32_t valid;
- gf_boolean_t heal_layout;
- int32_t mds_heal_fresh_lookup;
- loc_t loc2_copy;
- gf_boolean_t locked;
- gf_boolean_t dont_create_linkto;
+ int call_cnt;
+ loc_t loc;
+ loc_t loc2;
+ int op_ret;
+ int op_errno;
+ int layout_mismatch;
+ /* Use stbuf as the postbuf, when we require both
+ * pre and post attrs */
+ struct iatt stbuf;
+ struct iatt mds_stbuf;
+ struct iatt prebuf;
+ struct iatt preoldparent;
+ struct iatt postoldparent;
+ struct iatt preparent;
+ struct iatt postparent;
+ struct statvfs statvfs;
+ tier_statvfs_t tier_statvfs;
+ fd_t *fd;
+ inode_t *inode;
+ dict_t *params;
+ dict_t *xattr;
+ dict_t *mds_xattr;
+ dict_t *xdata; /* dict used to save xdata response by xattr fop */
+ dict_t *xattr_req;
+ dht_layout_t *layout;
+ size_t size;
+ ino_t ia_ino;
+ xlator_t *src_hashed, *src_cached;
+ xlator_t *dst_hashed, *dst_cached;
+ xlator_t *cached_subvol;
+ xlator_t *hashed_subvol;
+ xlator_t *mds_subvol; /* This is use for dir only */
+ char need_selfheal;
+ char need_xattr_heal;
+ char need_attrheal;
+ int file_count;
+ int dir_count;
+ call_frame_t *main_frame;
+ int fop_succeeded;
+ struct {
+ fop_mknod_cbk_t linkfile_cbk;
+ struct iatt stbuf;
+ loc_t loc;
+ inode_t *inode;
+ dict_t *xattr;
+ xlator_t *srcvol;
+ } linkfile;
+ struct {
+ uint32_t hole_cnt;
+ uint32_t overlaps_cnt;
+ uint32_t down;
+ uint32_t misc;
+ uint32_t missing_cnt;
+ dht_selfheal_dir_cbk_t dir_cbk;
+ dht_selfheal_layout_t healer;
+ dht_need_heal_t should_heal;
+ gf_boolean_t force_mkdir;
+ dht_layout_t *layout, *refreshed_layout;
+ } selfheal;
+
+ dht_refresh_layout_unlock refresh_layout_unlock;
+ dht_refresh_layout_done_handle refresh_layout_done;
+
+ uint32_t uid;
+ uint32_t gid;
+
+ /* needed by nufa */
+ int32_t flags;
+ mode_t mode;
+ dev_t rdev;
+ mode_t umask;
+
+ /* need for file-info */
+ char *xattr_val;
+ char *key;
+
+ /* which xattr request? */
+ char xsel[256];
+ int32_t alloc_len;
+
+ /* gfid related */
+ uuid_t gfid;
+
+ /* flag used to make sure we need to return estale in
+ {lookup,revalidate}_cbk */
+ char return_estale;
+ char need_lookup_everywhere;
+
+ glusterfs_fop_t fop;
+
+ gf_boolean_t linked;
+ xlator_t *link_subvol;
+
+ struct dht_rebalance_ rebalance;
+ xlator_t *first_up_subvol;
+
+ gf_boolean_t quota_deem_statfs;
+
+ gf_boolean_t added_link;
+ gf_boolean_t is_linkfile;
+
+ struct dht_skip_linkto_unlink skip_unlink;
+
+ dht_dir_transaction_t lock[2], *current;
+
+ /* inodelks during filerename for backward compatibility */
+ dht_lock_t **rename_inodelk_backward_compatible;
+ int rename_inodelk_bc_count;
+
+ short lock_type;
+
+ call_stub_t *stub;
+ int32_t parent_disk_layout[4];
+
+ /* rename rollback */
+ int *ret_cache;
+
+ /* fd open check */
+ gf_boolean_t fd_checked;
+ /* This is use only for directory operation */
+ int32_t valid;
+ gf_boolean_t heal_layout;
+ int32_t mds_heal_fresh_lookup;
+ loc_t loc2_copy;
+ gf_boolean_t locked;
+ gf_boolean_t dont_create_linkto;
};
typedef struct dht_local dht_local_t;
/* du - disk-usage */
struct dht_du {
- double avail_percent;
- double avail_inodes;
- uint64_t avail_space;
- uint32_t log;
- uint32_t chunks;
- uint32_t total_blocks;
- uint32_t avail_blocks;
- uint32_t frsize; /*fragment size*/
+ double avail_percent;
+ double avail_inodes;
+ uint64_t avail_space;
+ uint32_t log;
+ uint32_t chunks;
+ uint32_t total_blocks;
+ uint32_t avail_blocks;
+ uint32_t frsize; /*fragment size*/
};
typedef struct dht_du dht_du_t;
enum gf_defrag_type {
- GF_DEFRAG_CMD_NONE = 0,
- GF_DEFRAG_CMD_START = 1,
- GF_DEFRAG_CMD_STOP = 1 + 1,
- GF_DEFRAG_CMD_STATUS = 1 + 2,
- GF_DEFRAG_CMD_START_LAYOUT_FIX = 1 + 3,
- GF_DEFRAG_CMD_START_FORCE = 1 + 4,
- GF_DEFRAG_CMD_START_TIER = 1 + 5,
- GF_DEFRAG_CMD_STATUS_TIER = 1 + 6,
- GF_DEFRAG_CMD_START_DETACH_TIER = 1 + 7,
- GF_DEFRAG_CMD_STOP_DETACH_TIER = 1 + 8,
- GF_DEFRAG_CMD_PAUSE_TIER = 1 + 9,
- GF_DEFRAG_CMD_RESUME_TIER = 1 + 10,
- GF_DEFRAG_CMD_DETACH_STATUS = 1 + 11,
- GF_DEFRAG_CMD_STOP_TIER = 1 + 12,
- GF_DEFRAG_CMD_DETACH_START = 1 + 13,
- GF_DEFRAG_CMD_DETACH_COMMIT = 1 + 14,
- GF_DEFRAG_CMD_DETACH_COMMIT_FORCE = 1 + 15,
- GF_DEFRAG_CMD_DETACH_STOP = 1 + 16,
- /* new labels are used so it will help
- * while removing old labels by easily differentiating.
- * A few labels are added so that the count remains same
- * between this enum and the ones on the xdr file.
- * different values for the same enum cause errors and
- * confusion.
- */
+ GF_DEFRAG_CMD_NONE = 0,
+ GF_DEFRAG_CMD_START = 1,
+ GF_DEFRAG_CMD_STOP = 1 + 1,
+ GF_DEFRAG_CMD_STATUS = 1 + 2,
+ GF_DEFRAG_CMD_START_LAYOUT_FIX = 1 + 3,
+ GF_DEFRAG_CMD_START_FORCE = 1 + 4,
+ GF_DEFRAG_CMD_START_TIER = 1 + 5,
+ GF_DEFRAG_CMD_STATUS_TIER = 1 + 6,
+ GF_DEFRAG_CMD_START_DETACH_TIER = 1 + 7,
+ GF_DEFRAG_CMD_STOP_DETACH_TIER = 1 + 8,
+ GF_DEFRAG_CMD_PAUSE_TIER = 1 + 9,
+ GF_DEFRAG_CMD_RESUME_TIER = 1 + 10,
+ GF_DEFRAG_CMD_DETACH_STATUS = 1 + 11,
+ GF_DEFRAG_CMD_STOP_TIER = 1 + 12,
+ GF_DEFRAG_CMD_DETACH_START = 1 + 13,
+ GF_DEFRAG_CMD_DETACH_COMMIT = 1 + 14,
+ GF_DEFRAG_CMD_DETACH_COMMIT_FORCE = 1 + 15,
+ GF_DEFRAG_CMD_DETACH_STOP = 1 + 16,
+ /* new labels are used so it will help
+ * while removing old labels by easily differentiating.
+ * A few labels are added so that the count remains same
+ * between this enum and the ones on the xdr file.
+ * different values for the same enum cause errors and
+ * confusion.
+ */
};
typedef enum gf_defrag_type gf_defrag_type;
enum gf_defrag_status_t {
- GF_DEFRAG_STATUS_NOT_STARTED,
- GF_DEFRAG_STATUS_STARTED,
- GF_DEFRAG_STATUS_STOPPED,
- GF_DEFRAG_STATUS_COMPLETE,
- GF_DEFRAG_STATUS_FAILED,
- GF_DEFRAG_STATUS_LAYOUT_FIX_STARTED,
- GF_DEFRAG_STATUS_LAYOUT_FIX_STOPPED,
- GF_DEFRAG_STATUS_LAYOUT_FIX_COMPLETE,
- GF_DEFRAG_STATUS_LAYOUT_FIX_FAILED,
+ GF_DEFRAG_STATUS_NOT_STARTED,
+ GF_DEFRAG_STATUS_STARTED,
+ GF_DEFRAG_STATUS_STOPPED,
+ GF_DEFRAG_STATUS_COMPLETE,
+ GF_DEFRAG_STATUS_FAILED,
+ GF_DEFRAG_STATUS_LAYOUT_FIX_STARTED,
+ GF_DEFRAG_STATUS_LAYOUT_FIX_STOPPED,
+ GF_DEFRAG_STATUS_LAYOUT_FIX_COMPLETE,
+ GF_DEFRAG_STATUS_LAYOUT_FIX_FAILED,
};
typedef enum gf_defrag_status_t gf_defrag_status_t;
typedef struct gf_defrag_pattern_list gf_defrag_pattern_list_t;
struct gf_defrag_pattern_list {
- char path_pattern[256];
- uint64_t size;
- gf_defrag_pattern_list_t *next;
+ char path_pattern[256];
+ uint64_t size;
+ gf_defrag_pattern_list_t *next;
};
struct dht_container {
- union {
- struct list_head list;
- struct {
- struct _gf_dirent_t *next;
- struct _gf_dirent_t *prev;
- };
+ union {
+ struct list_head list;
+ struct {
+ struct _gf_dirent_t *next;
+ struct _gf_dirent_t *prev;
};
- gf_dirent_t *df_entry;
- xlator_t *this;
- loc_t *parent_loc;
- dict_t *migrate_data;
- int local_subvol_index;
+ };
+ gf_dirent_t *df_entry;
+ xlator_t *this;
+ loc_t *parent_loc;
+ dict_t *migrate_data;
+ int local_subvol_index;
};
typedef enum tier_mode_ {
- TIER_MODE_NONE = 0,
- TIER_MODE_TEST,
- TIER_MODE_WM
+ TIER_MODE_NONE = 0,
+ TIER_MODE_TEST,
+ TIER_MODE_WM
} tier_mode_t;
typedef enum tier_pause_state_ {
- TIER_RUNNING = 0,
- TIER_REQUEST_PAUSE,
- TIER_PAUSED
+ TIER_RUNNING = 0,
+ TIER_REQUEST_PAUSE,
+ TIER_PAUSED
} tier_pause_state_t;
/* This Structure is only used in tiering fixlayout */
typedef struct gf_tier_fix_layout_arg {
- xlator_t *this;
- dict_t *fix_layout;
- pthread_t thread_id;
+ xlator_t *this;
+ dict_t *fix_layout;
+ pthread_t thread_id;
} gf_tier_fix_layout_arg_t;
typedef struct gf_tier_conf {
- int is_tier;
- int watermark_hi;
- int watermark_low;
- int watermark_last;
- unsigned long block_size;
- fsblkcnt_t blocks_total;
- fsblkcnt_t blocks_used;
- int percent_full;
- uint64_t max_migrate_bytes;
- int max_migrate_files;
- int query_limit;
- tier_mode_t mode;
- /* These flags are only used for tier-compact */
- gf_boolean_t compact_active;
- /* These 3 flags are set to true when the client changes the */
- /* compaction mode on the command line. */
- /* When they are set, the daemon will trigger compaction as */
- /* soon as possible to activate or deactivate compaction. */
- /* If in the middle of a compaction, then the switches take */
- /* effect on the next compaction, not the current one. */
- /* If the user switches it off, we want to avoid needless */
- /* compactions. */
- /* If the user switches it on, they want to compact as soon */
- /* as possible. */
- gf_boolean_t compact_mode_switched;
- gf_boolean_t compact_mode_switched_hot;
- gf_boolean_t compact_mode_switched_cold;
- int tier_max_promote_size;
- int tier_promote_frequency;
- int tier_demote_frequency;
- int tier_compact_hot_frequency;
- int tier_compact_cold_frequency;
- uint64_t st_last_promoted_size;
- uint64_t st_last_demoted_size;
- tier_pause_state_t pause_state;
- struct synctask *pause_synctask;
- gf_timer_t *pause_timer;
- pthread_mutex_t pause_mutex;
- int promote_in_progress;
- int demote_in_progress;
- /* This Structure is only used in tiering fixlayout */
- gf_tier_fix_layout_arg_t tier_fix_layout_arg;
- /* Indicates the index of the first queryfile picked
- * in the last cycle of promote or demote */
- int32_t last_promote_qfile_index;
- int32_t last_demote_qfile_index;
- char volname[GD_VOLUME_NAME_MAX + 1];
+ int is_tier;
+ int watermark_hi;
+ int watermark_low;
+ int watermark_last;
+ unsigned long block_size;
+ fsblkcnt_t blocks_total;
+ fsblkcnt_t blocks_used;
+ int percent_full;
+ uint64_t max_migrate_bytes;
+ int max_migrate_files;
+ int query_limit;
+ tier_mode_t mode;
+ /* These flags are only used for tier-compact */
+ gf_boolean_t compact_active;
+ /* These 3 flags are set to true when the client changes the */
+ /* compaction mode on the command line. */
+ /* When they are set, the daemon will trigger compaction as */
+ /* soon as possible to activate or deactivate compaction. */
+ /* If in the middle of a compaction, then the switches take */
+ /* effect on the next compaction, not the current one. */
+ /* If the user switches it off, we want to avoid needless */
+ /* compactions. */
+ /* If the user switches it on, they want to compact as soon */
+ /* as possible. */
+ gf_boolean_t compact_mode_switched;
+ gf_boolean_t compact_mode_switched_hot;
+ gf_boolean_t compact_mode_switched_cold;
+ int tier_max_promote_size;
+ int tier_promote_frequency;
+ int tier_demote_frequency;
+ int tier_compact_hot_frequency;
+ int tier_compact_cold_frequency;
+ uint64_t st_last_promoted_size;
+ uint64_t st_last_demoted_size;
+ tier_pause_state_t pause_state;
+ struct synctask *pause_synctask;
+ gf_timer_t *pause_timer;
+ pthread_mutex_t pause_mutex;
+ int promote_in_progress;
+ int demote_in_progress;
+ /* This Structure is only used in tiering fixlayout */
+ gf_tier_fix_layout_arg_t tier_fix_layout_arg;
+ /* Indicates the index of the first queryfile picked
+ * in the last cycle of promote or demote */
+ int32_t last_promote_qfile_index;
+ int32_t last_demote_qfile_index;
+ char volname[GD_VOLUME_NAME_MAX + 1];
} gf_tier_conf_t;
typedef struct nodeuuid_info {
- char info; /* Set to 1 is this is my node's uuid*/
- uuid_t uuid; /* Store the nodeuuid as well for debugging*/
+ char info; /* Set to 1 is this is my node's uuid*/
+ uuid_t uuid; /* Store the nodeuuid as well for debugging*/
} nodeuuid_info_t;
typedef struct subvol_nodeuuids_info {
- nodeuuid_info_t *elements;
- int count;
+ nodeuuid_info_t *elements;
+ int count;
} subvol_nodeuuids_info_t;
-
struct gf_defrag_info_ {
- uint64_t total_files;
- uint64_t total_data;
- uint64_t num_files_lookedup;
- uint64_t total_failures;
- uint64_t skipped;
- uint64_t num_dirs_processed;
- uint64_t size_processed;
- gf_lock_t lock;
- int cmd;
- pthread_t th;
- gf_defrag_status_t defrag_status;
- struct rpc_clnt *rpc;
- uint32_t connected;
- uint32_t is_exiting;
- pid_t pid;
- inode_t *root_inode;
- uuid_t node_uuid;
- struct timeval start_time;
- gf_boolean_t stats;
- uint32_t new_commit_hash;
- gf_defrag_pattern_list_t *defrag_pattern;
- gf_tier_conf_t tier_conf;
-
- /*Data Tiering params for scanner*/
- uint64_t total_files_promoted;
- uint64_t total_files_demoted;
- int write_freq_threshold;
- int read_freq_threshold;
-
- pthread_cond_t parallel_migration_cond;
- pthread_mutex_t dfq_mutex;
- pthread_cond_t rebalance_crawler_alarm;
- int32_t q_entry_count;
- int32_t global_error;
- struct dht_container *queue;
- int32_t crawl_done;
- int32_t abort;
- int32_t wakeup_crawler;
-
- /*Throttle params*/
- /*stands for reconfigured thread count*/
- int32_t recon_thread_count;
- /*stands for current running thread count*/
- int32_t current_thread_count;
- pthread_cond_t df_wakeup_thread;
-
- /* lock migration flag */
- gf_boolean_t lock_migration_enabled;
-
- /* backpointer to make it easier to write functions for rebalance */
- xlator_t *this;
-
- pthread_cond_t fc_wakeup_cond;
- pthread_mutex_t fc_mutex;
+ uint64_t total_files;
+ uint64_t total_data;
+ uint64_t num_files_lookedup;
+ uint64_t total_failures;
+ uint64_t skipped;
+ uint64_t num_dirs_processed;
+ uint64_t size_processed;
+ gf_lock_t lock;
+ int cmd;
+ pthread_t th;
+ gf_defrag_status_t defrag_status;
+ struct rpc_clnt *rpc;
+ uint32_t connected;
+ uint32_t is_exiting;
+ pid_t pid;
+ inode_t *root_inode;
+ uuid_t node_uuid;
+ struct timeval start_time;
+ gf_boolean_t stats;
+ uint32_t new_commit_hash;
+ gf_defrag_pattern_list_t *defrag_pattern;
+ gf_tier_conf_t tier_conf;
+
+ /*Data Tiering params for scanner*/
+ uint64_t total_files_promoted;
+ uint64_t total_files_demoted;
+ int write_freq_threshold;
+ int read_freq_threshold;
+
+ pthread_cond_t parallel_migration_cond;
+ pthread_mutex_t dfq_mutex;
+ pthread_cond_t rebalance_crawler_alarm;
+ int32_t q_entry_count;
+ int32_t global_error;
+ struct dht_container *queue;
+ int32_t crawl_done;
+ int32_t abort;
+ int32_t wakeup_crawler;
+
+ /*Throttle params*/
+ /*stands for reconfigured thread count*/
+ int32_t recon_thread_count;
+ /*stands for current running thread count*/
+ int32_t current_thread_count;
+ pthread_cond_t df_wakeup_thread;
+
+ /* lock migration flag */
+ gf_boolean_t lock_migration_enabled;
+
+ /* backpointer to make it easier to write functions for rebalance */
+ xlator_t *this;
+
+ pthread_cond_t fc_wakeup_cond;
+ pthread_mutex_t fc_mutex;
};
typedef struct gf_defrag_info_ gf_defrag_info_t;
struct dht_methods_s {
- int32_t (*migration_get_dst_subvol)(xlator_t *this,
- dht_local_t *local);
- int32_t (*migration_other)(xlator_t *this,
- gf_defrag_info_t *defrag);
- int32_t (*migration_needed)(xlator_t *this);
- xlator_t* (*layout_search)(xlator_t *this,
- dht_layout_t *layout,
- const char *name);
+ int32_t (*migration_get_dst_subvol)(xlator_t *this, dht_local_t *local);
+ int32_t (*migration_other)(xlator_t *this, gf_defrag_info_t *defrag);
+ int32_t (*migration_needed)(xlator_t *this);
+ xlator_t *(*layout_search)(xlator_t *this, dht_layout_t *layout,
+ const char *name);
};
typedef struct dht_methods_s dht_methods_t;
struct dht_conf {
- gf_lock_t subvolume_lock;
- int subvolume_cnt;
- xlator_t **subvolumes;
- char *subvolume_status;
- int *last_event;
- dht_layout_t **file_layouts;
- dht_layout_t **dir_layouts;
- unsigned int search_unhashed;
- gf_boolean_t lookup_optimize;
- int gen;
- dht_du_t *du_stats;
- double min_free_disk;
- double min_free_inodes;
- char disk_unit;
- int32_t refresh_interval;
- gf_boolean_t unhashed_sticky_bit;
- struct timeval last_stat_fetch;
- gf_lock_t layout_lock;
- dict_t *leaf_to_subvol;
- void *private; /* Can be used by wrapper xlators over
- dht */
- gf_boolean_t use_readdirp;
- char vol_uuid[UUID_SIZE + 1];
- gf_boolean_t assert_no_child_down;
- time_t *subvol_up_time;
-
- /* This is the count used as the distribute layout for a directory */
- /* Will be a global flag to control the layout spread count */
- uint32_t dir_spread_cnt;
-
- /* to keep track of nodes which are decommissioned */
- xlator_t **decommissioned_bricks;
- int decommission_in_progress;
- int decommission_subvols_cnt;
-
- /* defrag related */
- gf_defrag_info_t *defrag;
-
- /* Request to filter directory entries in readdir request */
-
- gf_boolean_t readdir_optimize;
-
- /* Support regex-based name reinterpretation. */
- regex_t rsync_regex;
- gf_boolean_t rsync_regex_valid;
- regex_t extra_regex;
- gf_boolean_t extra_regex_valid;
-
- /* Support variable xattr names. */
- char *xattr_name;
- char *mds_xattr_key;
- char *link_xattr_name;
- char *commithash_xattr_name;
- char *wild_xattr_name;
-
- /* Support size-weighted rebalancing (heterogeneous bricks). */
- gf_boolean_t do_weighting;
- gf_boolean_t randomize_by_gfid;
- int dthrottle;
-
- dht_methods_t methods;
-
- struct mem_pool *lock_pool;
-
- /*local subvol storage for rebalance*/
- xlator_t **local_subvols;
- subvol_nodeuuids_info_t *local_nodeuuids;
- int32_t local_subvols_cnt;
-
- /*
- * "Commit hash" for this volume topology. Changed whenever bricks
- * are added or removed.
- */
- uint32_t vol_commit_hash;
- gf_boolean_t vch_forced;
-
- /* lock migration */
-
- gf_boolean_t lock_migration_enabled;
- gf_lock_t lock;
-
- /* Hard link handle requirement for migration triggered from client*/
- synclock_t link_lock;
-
- gf_boolean_t use_fallocate;
-
- gf_boolean_t force_migration;
+ gf_lock_t subvolume_lock;
+ int subvolume_cnt;
+ xlator_t **subvolumes;
+ char *subvolume_status;
+ int *last_event;
+ dht_layout_t **file_layouts;
+ dht_layout_t **dir_layouts;
+ unsigned int search_unhashed;
+ gf_boolean_t lookup_optimize;
+ int gen;
+ dht_du_t *du_stats;
+ double min_free_disk;
+ double min_free_inodes;
+ char disk_unit;
+ int32_t refresh_interval;
+ gf_boolean_t unhashed_sticky_bit;
+ struct timeval last_stat_fetch;
+ gf_lock_t layout_lock;
+ dict_t *leaf_to_subvol;
+ void *private; /* Can be used by wrapper xlators over
+ dht */
+ gf_boolean_t use_readdirp;
+ char vol_uuid[UUID_SIZE + 1];
+ gf_boolean_t assert_no_child_down;
+ time_t *subvol_up_time;
+
+ /* This is the count used as the distribute layout for a directory */
+ /* Will be a global flag to control the layout spread count */
+ uint32_t dir_spread_cnt;
+
+ /* to keep track of nodes which are decommissioned */
+ xlator_t **decommissioned_bricks;
+ int decommission_in_progress;
+ int decommission_subvols_cnt;
+
+ /* defrag related */
+ gf_defrag_info_t *defrag;
+
+ /* Request to filter directory entries in readdir request */
+
+ gf_boolean_t readdir_optimize;
+
+ /* Support regex-based name reinterpretation. */
+ regex_t rsync_regex;
+ gf_boolean_t rsync_regex_valid;
+ regex_t extra_regex;
+ gf_boolean_t extra_regex_valid;
+
+ /* Support variable xattr names. */
+ char *xattr_name;
+ char *mds_xattr_key;
+ char *link_xattr_name;
+ char *commithash_xattr_name;
+ char *wild_xattr_name;
+
+ /* Support size-weighted rebalancing (heterogeneous bricks). */
+ gf_boolean_t do_weighting;
+ gf_boolean_t randomize_by_gfid;
+ int dthrottle;
+
+ dht_methods_t methods;
+
+ struct mem_pool *lock_pool;
+
+ /*local subvol storage for rebalance*/
+ xlator_t **local_subvols;
+ subvol_nodeuuids_info_t *local_nodeuuids;
+ int32_t local_subvols_cnt;
+
+ /*
+ * "Commit hash" for this volume topology. Changed whenever bricks
+ * are added or removed.
+ */
+ uint32_t vol_commit_hash;
+ gf_boolean_t vch_forced;
+
+ /* lock migration */
+
+ gf_boolean_t lock_migration_enabled;
+ gf_lock_t lock;
+
+ /* Hard link handle requirement for migration triggered from client*/
+ synclock_t link_lock;
+
+ gf_boolean_t use_fallocate;
+
+ gf_boolean_t force_migration;
};
typedef struct dht_conf dht_conf_t;
struct dht_dfoffset_ctx {
- xlator_t *this;
- off_t offset;
- int32_t readdir_done;
+ xlator_t *this;
+ off_t offset;
+ int32_t readdir_done;
};
typedef struct dht_dfoffset_ctx dht_dfoffset_ctx_t;
struct dht_disk_layout {
- uint32_t cnt;
- uint32_t type;
- struct {
- uint32_t start;
- uint32_t stop;
- } list[1];
+ uint32_t cnt;
+ uint32_t type;
+ struct {
+ uint32_t start;
+ uint32_t stop;
+ } list[1];
};
typedef struct dht_disk_layout dht_disk_layout_t;
typedef enum {
- GF_DHT_MIGRATE_DATA,
- GF_DHT_MIGRATE_DATA_EVEN_IF_LINK_EXISTS,
- GF_DHT_MIGRATE_HARDLINK,
- GF_DHT_MIGRATE_HARDLINK_IN_PROGRESS
+ GF_DHT_MIGRATE_DATA,
+ GF_DHT_MIGRATE_DATA_EVEN_IF_LINK_EXISTS,
+ GF_DHT_MIGRATE_HARDLINK,
+ GF_DHT_MIGRATE_HARDLINK_IN_PROGRESS
} gf_dht_migrate_data_type_t;
typedef enum {
- GF_DHT_EQUAL_DISTRIBUTION,
- GF_DHT_WEIGHTED_DISTRIBUTION
+ GF_DHT_EQUAL_DISTRIBUTION,
+ GF_DHT_WEIGHTED_DISTRIBUTION
} dht_distribution_type_t;
struct dir_dfmeta {
- gf_dirent_t *equeue;
- dht_dfoffset_ctx_t *offset_var;
- struct list_head **head;
- struct list_head **iterator;
- int *fetch_entries;
+ gf_dirent_t *equeue;
+ dht_dfoffset_ctx_t *offset_var;
+ struct list_head **head;
+ struct list_head **iterator;
+ int *fetch_entries;
};
typedef struct dht_migrate_info {
- xlator_t *src_subvol;
- xlator_t *dst_subvol;
- GF_REF_DECL;
+ xlator_t *src_subvol;
+ xlator_t *dst_subvol;
+ GF_REF_DECL;
} dht_migrate_info_t;
-
-
typedef struct dht_fd_ctx {
- uint64_t opened_on_dst;
- GF_REF_DECL;
+ uint64_t opened_on_dst;
+ GF_REF_DECL;
} dht_fd_ctx_t;
-
#define ENTRY_MISSING(op_ret, op_errno) (op_ret == -1 && op_errno == ENOENT)
-#define is_revalidate(loc) (dht_inode_ctx_layout_get ((loc)->inode, this, NULL) == 0)
+#define is_revalidate(loc) \
+ (dht_inode_ctx_layout_get((loc)->inode, this, NULL) == 0)
#define is_last_call(cnt) (cnt == 0)
#define DHT_MIGRATION_IN_PROGRESS 1
-#define DHT_MIGRATION_COMPLETED 2
+#define DHT_MIGRATION_COMPLETED 2
-#define check_is_linkfile(i,s,x,n) (IS_DHT_LINKFILE_MODE (s) && dict_get (x, n))
+#define check_is_linkfile(i, s, x, n) \
+ (IS_DHT_LINKFILE_MODE(s) && dict_get(x, n))
-#define IS_DHT_MIGRATION_PHASE2(buf) ( \
- IA_ISREG ((buf)->ia_type) && \
- ((st_mode_from_ia ((buf)->ia_prot, (buf)->ia_type) & \
- ~S_IFMT) == DHT_LINKFILE_MODE))
+#define IS_DHT_MIGRATION_PHASE2(buf) \
+ (IA_ISREG((buf)->ia_type) && \
+ ((st_mode_from_ia((buf)->ia_prot, (buf)->ia_type) & ~S_IFMT) == \
+ DHT_LINKFILE_MODE))
-#define IS_DHT_MIGRATION_PHASE1(buf) ( \
- IA_ISREG ((buf)->ia_type) && \
- ((buf)->ia_prot.sticky == 1) && \
- ((buf)->ia_prot.sgid == 1))
+#define IS_DHT_MIGRATION_PHASE1(buf) \
+ (IA_ISREG((buf)->ia_type) && ((buf)->ia_prot.sticky == 1) && \
+ ((buf)->ia_prot.sgid == 1))
-#define DHT_STRIP_PHASE1_FLAGS(buf) do { \
- if ((buf) && IS_DHT_MIGRATION_PHASE1(buf)) { \
- (buf)->ia_prot.sticky = 0; \
- (buf)->ia_prot.sgid = 0; \
- } \
- } while (0)
+#define DHT_STRIP_PHASE1_FLAGS(buf) \
+ do { \
+ if ((buf) && IS_DHT_MIGRATION_PHASE1(buf)) { \
+ (buf)->ia_prot.sticky = 0; \
+ (buf)->ia_prot.sgid = 0; \
+ } \
+ } while (0)
#define dht_inode_missing(op_errno) (op_errno == ENOENT || op_errno == ESTALE)
-#define check_is_dir(i,s,x) (IA_ISDIR(s->ia_type))
+#define check_is_dir(i, s, x) (IA_ISDIR(s->ia_type))
#define layout_is_sane(layout) ((layout) && (layout->cnt > 0))
-#define we_are_not_migrating(x) ((x) == 1)
-
-#define DHT_STACK_UNWIND(fop, frame, params ...) do { \
- dht_local_t *__local = NULL; \
- xlator_t *__xl = NULL; \
- if (frame) { \
- __xl = frame->this; \
- __local = frame->local; \
- frame->local = NULL; \
- } \
- STACK_UNWIND_STRICT (fop, frame, params); \
- dht_local_wipe (__xl, __local); \
- } while (0)
-
-#define DHT_STACK_DESTROY(frame) do { \
- dht_local_t *__local = NULL; \
- xlator_t *__xl = NULL; \
- __xl = frame->this; \
- __local = frame->local; \
- frame->local = NULL; \
- STACK_DESTROY (frame->root); \
- dht_local_wipe (__xl, __local); \
- } while (0)
-
-#define DHT_UPDATE_TIME(ctx_sec, ctx_nsec, new_sec, new_nsec, inode, post) do {\
- LOCK (&inode->lock); \
- { \
- if (ctx_sec == new_sec) \
- new_nsec = max (new_nsec, ctx_nsec); \
- else if (ctx_sec > new_sec) { \
- new_sec = ctx_sec; \
- new_nsec = ctx_nsec; \
- } \
- if (post) { \
- ctx_sec = new_sec; \
- ctx_nsec = new_nsec; \
- } \
- } \
- UNLOCK (&inode->lock); \
- } while (0)
-
-#define is_greater_time(a, an, b, bn) (((a) < (b)) || (((a) == (b)) && ((an) < (bn))))
-
-#define DHT_MARK_FOP_INTERNAL(xattr) do { \
- int tmp = -1; \
- if (!xattr) { \
- xattr = dict_new (); \
- if (!xattr) \
- break; \
- } \
- tmp = dict_set_str (xattr, GLUSTERFS_INTERNAL_FOP_KEY, "yes"); \
- if (tmp) { \
- gf_msg (this->name, GF_LOG_ERROR, 0, \
- DHT_MSG_DICT_SET_FAILED, \
- "Failed to set dictionary value: key = %s," \
- " path = %s", GLUSTERFS_INTERNAL_FOP_KEY, \
- local->loc.path); \
- } \
- } while (0)
-
-dht_layout_t *dht_layout_new (xlator_t *this, int cnt);
-dht_layout_t *dht_layout_get (xlator_t *this, inode_t *inode);
-dht_layout_t *dht_layout_for_subvol (xlator_t *this, xlator_t *subvol);
-xlator_t *dht_layout_search (xlator_t *this, dht_layout_t *layout,
- const char *name);
+#define we_are_not_migrating(x) ((x) == 1)
+
+#define DHT_STACK_UNWIND(fop, frame, params...) \
+ do { \
+ dht_local_t *__local = NULL; \
+ xlator_t *__xl = NULL; \
+ if (frame) { \
+ __xl = frame->this; \
+ __local = frame->local; \
+ frame->local = NULL; \
+ } \
+ STACK_UNWIND_STRICT(fop, frame, params); \
+ dht_local_wipe(__xl, __local); \
+ } while (0)
+
+#define DHT_STACK_DESTROY(frame) \
+ do { \
+ dht_local_t *__local = NULL; \
+ xlator_t *__xl = NULL; \
+ __xl = frame->this; \
+ __local = frame->local; \
+ frame->local = NULL; \
+ STACK_DESTROY(frame->root); \
+ dht_local_wipe(__xl, __local); \
+ } while (0)
+
+#define DHT_UPDATE_TIME(ctx_sec, ctx_nsec, new_sec, new_nsec, inode, post) \
+ do { \
+ LOCK(&inode->lock); \
+ { \
+ if (ctx_sec == new_sec) \
+ new_nsec = max(new_nsec, ctx_nsec); \
+ else if (ctx_sec > new_sec) { \
+ new_sec = ctx_sec; \
+ new_nsec = ctx_nsec; \
+ } \
+ if (post) { \
+ ctx_sec = new_sec; \
+ ctx_nsec = new_nsec; \
+ } \
+ } \
+ UNLOCK(&inode->lock); \
+ } while (0)
+
+#define is_greater_time(a, an, b, bn) \
+ (((a) < (b)) || (((a) == (b)) && ((an) < (bn))))
+
+#define DHT_MARK_FOP_INTERNAL(xattr) \
+ do { \
+ int tmp = -1; \
+ if (!xattr) { \
+ xattr = dict_new(); \
+ if (!xattr) \
+ break; \
+ } \
+ tmp = dict_set_str(xattr, GLUSTERFS_INTERNAL_FOP_KEY, "yes"); \
+ if (tmp) { \
+ gf_msg(this->name, GF_LOG_ERROR, 0, DHT_MSG_DICT_SET_FAILED, \
+ "Failed to set dictionary value: key = %s," \
+ " path = %s", \
+ GLUSTERFS_INTERNAL_FOP_KEY, local->loc.path); \
+ } \
+ } while (0)
+
+dht_layout_t *
+dht_layout_new(xlator_t *this, int cnt);
+dht_layout_t *
+dht_layout_get(xlator_t *this, inode_t *inode);
+dht_layout_t *
+dht_layout_for_subvol(xlator_t *this, xlator_t *subvol);
+xlator_t *
+dht_layout_search(xlator_t *this, dht_layout_t *layout, const char *name);
int32_t
-dht_migration_get_dst_subvol(xlator_t *this, dht_local_t *local);
+dht_migration_get_dst_subvol(xlator_t *this, dht_local_t *local);
int32_t
dht_migration_needed(xlator_t *this);
-int dht_layout_normalize (xlator_t *this, loc_t *loc, dht_layout_t *layout);
-int dht_layout_anomalies (xlator_t *this, loc_t *loc, dht_layout_t *layout,
- uint32_t *holes_p, uint32_t *overlaps_p,
- uint32_t *missing_p, uint32_t *down_p,
- uint32_t *misc_p, uint32_t *no_space_p);
-int dht_layout_dir_mismatch (xlator_t *this, dht_layout_t *layout,
- xlator_t *subvol, loc_t *loc, dict_t *xattr);
+int
+dht_layout_normalize(xlator_t *this, loc_t *loc, dht_layout_t *layout);
+int
+dht_layout_anomalies(xlator_t *this, loc_t *loc, dht_layout_t *layout,
+ uint32_t *holes_p, uint32_t *overlaps_p,
+ uint32_t *missing_p, uint32_t *down_p, uint32_t *misc_p,
+ uint32_t *no_space_p);
+int
+dht_layout_dir_mismatch(xlator_t *this, dht_layout_t *layout, xlator_t *subvol,
+ loc_t *loc, dict_t *xattr);
-xlator_t *dht_linkfile_subvol (xlator_t *this, inode_t *inode,
- struct iatt *buf, dict_t *xattr);
-int dht_linkfile_unlink (call_frame_t *frame, xlator_t *this,
- xlator_t *subvol, loc_t *loc);
+xlator_t *
+dht_linkfile_subvol(xlator_t *this, inode_t *inode, struct iatt *buf,
+ dict_t *xattr);
+int
+dht_linkfile_unlink(call_frame_t *frame, xlator_t *this, xlator_t *subvol,
+ loc_t *loc);
-int dht_layouts_init (xlator_t *this, dht_conf_t *conf);
-int dht_layout_merge (xlator_t *this, dht_layout_t *layout, xlator_t *subvol,
- int op_ret, int op_errno, dict_t *xattr);
+int
+dht_layouts_init(xlator_t *this, dht_conf_t *conf);
+int
+dht_layout_merge(xlator_t *this, dht_layout_t *layout, xlator_t *subvol,
+ int op_ret, int op_errno, dict_t *xattr);
-int dht_disk_layout_extract (xlator_t *this, dht_layout_t *layout,
- int pos, int32_t **disk_layout_p);
-int dht_disk_layout_merge (xlator_t *this, dht_layout_t *layout,
- int pos, void *disk_layout_raw, int disk_layout_len);
int
-dht_disk_layout_extract_for_subvol (xlator_t *this, dht_layout_t *layout,
- xlator_t *subvol, int32_t **disk_layout_p);
+dht_disk_layout_extract(xlator_t *this, dht_layout_t *layout, int pos,
+ int32_t **disk_layout_p);
+int
+dht_disk_layout_merge(xlator_t *this, dht_layout_t *layout, int pos,
+ void *disk_layout_raw, int disk_layout_len);
+int
+dht_disk_layout_extract_for_subvol(xlator_t *this, dht_layout_t *layout,
+ xlator_t *subvol, int32_t **disk_layout_p);
-int dht_frame_return (call_frame_t *frame);
+int
+dht_frame_return(call_frame_t *frame);
-int dht_deitransform (xlator_t *this, uint64_t y, xlator_t **subvol);
+int
+dht_deitransform(xlator_t *this, uint64_t y, xlator_t **subvol);
-void dht_local_wipe (xlator_t *this, dht_local_t *local);
-dht_local_t *dht_local_init (call_frame_t *frame, loc_t *loc, fd_t *fd,
- glusterfs_fop_t fop);
-int dht_iatt_merge (xlator_t *this, struct iatt *to, struct iatt *from);
+void
+dht_local_wipe(xlator_t *this, dht_local_t *local);
+dht_local_t *
+dht_local_init(call_frame_t *frame, loc_t *loc, fd_t *fd, glusterfs_fop_t fop);
+int
+dht_iatt_merge(xlator_t *this, struct iatt *to, struct iatt *from);
-xlator_t *dht_subvol_get_hashed (xlator_t *this, loc_t *loc);
-xlator_t *dht_subvol_get_cached (xlator_t *this, inode_t *inode);
-xlator_t *dht_subvol_next (xlator_t *this, xlator_t *prev);
-xlator_t *dht_subvol_next_available (xlator_t *this, xlator_t *prev);
-int dht_subvol_cnt (xlator_t *this, xlator_t *subvol);
+xlator_t *
+dht_subvol_get_hashed(xlator_t *this, loc_t *loc);
+xlator_t *
+dht_subvol_get_cached(xlator_t *this, inode_t *inode);
+xlator_t *
+dht_subvol_next(xlator_t *this, xlator_t *prev);
+xlator_t *
+dht_subvol_next_available(xlator_t *this, xlator_t *prev);
+int
+dht_subvol_cnt(xlator_t *this, xlator_t *subvol);
-int dht_hash_compute (xlator_t *this, int type, const char *name, uint32_t *hash_p);
+int
+dht_hash_compute(xlator_t *this, int type, const char *name, uint32_t *hash_p);
-int dht_linkfile_create (call_frame_t *frame, fop_mknod_cbk_t linkfile_cbk,
- xlator_t *this, xlator_t *tovol,
- xlator_t *fromvol, loc_t *loc);
-int dht_lookup_directory (call_frame_t *frame, xlator_t *this, loc_t *loc);
-int dht_lookup_everywhere (call_frame_t *frame, xlator_t *this, loc_t *loc);
int
-dht_selfheal_directory (call_frame_t *frame, dht_selfheal_dir_cbk_t cbk,
- loc_t *loc, dht_layout_t *layout);
+dht_linkfile_create(call_frame_t *frame, fop_mknod_cbk_t linkfile_cbk,
+ xlator_t *this, xlator_t *tovol, xlator_t *fromvol,
+ loc_t *loc);
+int
+dht_lookup_directory(call_frame_t *frame, xlator_t *this, loc_t *loc);
+int
+dht_lookup_everywhere(call_frame_t *frame, xlator_t *this, loc_t *loc);
+int
+dht_selfheal_directory(call_frame_t *frame, dht_selfheal_dir_cbk_t cbk,
+ loc_t *loc, dht_layout_t *layout);
int
-dht_selfheal_directory_for_nameless_lookup (call_frame_t *frame,
- dht_selfheal_dir_cbk_t cbk,
- loc_t *loc, dht_layout_t *layout);
+dht_selfheal_directory_for_nameless_lookup(call_frame_t *frame,
+ dht_selfheal_dir_cbk_t cbk,
+ loc_t *loc, dht_layout_t *layout);
int
-dht_selfheal_new_directory (call_frame_t *frame, dht_selfheal_dir_cbk_t cbk,
- dht_layout_t *layout);
+dht_selfheal_new_directory(call_frame_t *frame, dht_selfheal_dir_cbk_t cbk,
+ dht_layout_t *layout);
int
-dht_selfheal_restore (call_frame_t *frame, dht_selfheal_dir_cbk_t cbk,
- loc_t *loc, dht_layout_t *layout);
+dht_selfheal_restore(call_frame_t *frame, dht_selfheal_dir_cbk_t cbk,
+ loc_t *loc, dht_layout_t *layout);
int
-dht_layout_sort_volname (dht_layout_t *layout);
+dht_layout_sort_volname(dht_layout_t *layout);
-int dht_get_du_info (call_frame_t *frame, xlator_t *this, loc_t *loc);
+int
+dht_get_du_info(call_frame_t *frame, xlator_t *this, loc_t *loc);
-gf_boolean_t dht_is_subvol_filled (xlator_t *this, xlator_t *subvol);
-xlator_t *dht_free_disk_available_subvol (xlator_t *this, xlator_t *subvol,
- dht_local_t *layout);
-int dht_get_du_info_for_subvol (xlator_t *this, int subvol_idx);
+gf_boolean_t
+dht_is_subvol_filled(xlator_t *this, xlator_t *subvol);
+xlator_t *
+dht_free_disk_available_subvol(xlator_t *this, xlator_t *subvol,
+ dht_local_t *layout);
+int
+dht_get_du_info_for_subvol(xlator_t *this, int subvol_idx);
-int dht_layout_preset (xlator_t *this, xlator_t *subvol, inode_t *inode);
-int dht_layout_index_for_subvol (dht_layout_t *layout, xlator_t *subvol);
-int dht_layout_set (xlator_t *this, inode_t *inode, dht_layout_t *layout);;
-void dht_layout_unref (xlator_t *this, dht_layout_t *layout);
-dht_layout_t *dht_layout_ref (xlator_t *this, dht_layout_t *layout);
-xlator_t *dht_first_up_subvol (xlator_t *this);
-xlator_t *dht_last_up_subvol (xlator_t *this);
+int
+dht_layout_preset(xlator_t *this, xlator_t *subvol, inode_t *inode);
+int
+dht_layout_index_for_subvol(dht_layout_t *layout, xlator_t *subvol);
+int
+dht_layout_set(xlator_t *this, inode_t *inode, dht_layout_t *layout);
+;
+void
+dht_layout_unref(xlator_t *this, dht_layout_t *layout);
+dht_layout_t *
+dht_layout_ref(xlator_t *this, dht_layout_t *layout);
+xlator_t *
+dht_first_up_subvol(xlator_t *this);
+xlator_t *
+dht_last_up_subvol(xlator_t *this);
-int dht_build_child_loc (xlator_t *this, loc_t *child, loc_t *parent, char *name);
+int
+dht_build_child_loc(xlator_t *this, loc_t *child, loc_t *parent, char *name);
-int dht_filter_loc_subvol_key (xlator_t *this, loc_t *loc, loc_t *new_loc,
- xlator_t **subvol);
+int
+dht_filter_loc_subvol_key(xlator_t *this, loc_t *loc, loc_t *new_loc,
+ xlator_t **subvol);
-int dht_rename_cleanup (call_frame_t *frame);
-int dht_rename_link_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno,
- inode_t *inode, struct iatt *stbuf,
- struct iatt *preparent, struct iatt *postparent,
- dict_t *xdata);
+int
+dht_rename_cleanup(call_frame_t *frame);
+int
+dht_rename_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, inode_t *inode,
+ struct iatt *stbuf, struct iatt *preparent,
+ struct iatt *postparent, dict_t *xdata);
-int dht_update_commit_hash_for_layout (call_frame_t *frame);
-int dht_fix_directory_layout (call_frame_t *frame,
- dht_selfheal_dir_cbk_t dir_cbk,
- dht_layout_t *layout);
+int
+dht_update_commit_hash_for_layout(call_frame_t *frame);
+int
+dht_fix_directory_layout(call_frame_t *frame, dht_selfheal_dir_cbk_t dir_cbk,
+ dht_layout_t *layout);
-int dht_init_subvolumes (xlator_t *this, dht_conf_t *conf);
+int
+dht_init_subvolumes(xlator_t *this, dht_conf_t *conf);
/* migration/rebalance */
-int dht_start_rebalance_task (xlator_t *this, call_frame_t *frame);
+int
+dht_start_rebalance_task(xlator_t *this, call_frame_t *frame);
-int dht_rebalance_in_progress_check (xlator_t *this, call_frame_t *frame);
-int dht_rebalance_complete_check (xlator_t *this, call_frame_t *frame);
+int
+dht_rebalance_in_progress_check(xlator_t *this, call_frame_t *frame);
+int
+dht_rebalance_complete_check(xlator_t *this, call_frame_t *frame);
int
-dht_init_local_subvolumes (xlator_t *this, dht_conf_t *conf);
+dht_init_local_subvolumes(xlator_t *this, dht_conf_t *conf);
/* FOPS */
-int32_t dht_lookup (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc,
- dict_t *xattr_req);
-
-int32_t dht_stat (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc, dict_t *xdata);
-
-int32_t dht_fstat (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd, dict_t *xdata);
-
-int32_t dht_truncate (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc,
- off_t offset, dict_t *xdata);
-
-int32_t dht_ftruncate (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- off_t offset, dict_t *xdata);
-
-int32_t dht_access (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc,
- int32_t mask, dict_t *xdata);
-
-int32_t dht_readlink (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc,
- size_t size, dict_t *xdata);
-
-int32_t dht_mknod (call_frame_t *frame, xlator_t *this, loc_t *loc,
- mode_t mode, dev_t rdev, mode_t umask, dict_t *xdata);
-
-int32_t dht_mkdir (call_frame_t *frame, xlator_t *this,
- loc_t *loc, mode_t mode, mode_t umask, dict_t *xdata);
-
-int32_t dht_unlink (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc, int xflag, dict_t *xdata);
-
-int32_t dht_rmdir (call_frame_t *frame, xlator_t *this,
- loc_t *loc, int flags, dict_t *xdata);
-
-int32_t dht_symlink (call_frame_t *frame, xlator_t *this,
- const char *linkpath, loc_t *loc, mode_t umask,
- dict_t *xdata);
-
-int32_t dht_rename (call_frame_t *frame,
- xlator_t *this,
- loc_t *oldloc,
- loc_t *newloc, dict_t *xdata);
-
-int32_t dht_link (call_frame_t *frame,
- xlator_t *this,
- loc_t *oldloc,
- loc_t *newloc, dict_t *xdata);
-
-int32_t dht_create (call_frame_t *frame, xlator_t *this,
- loc_t *loc, int32_t flags, mode_t mode,
- mode_t umask, fd_t *fd, dict_t *params);
-
-int32_t dht_open (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc,
- int32_t flags, fd_t *fd, dict_t *xdata);
-
-int32_t dht_readv (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- size_t size,
- off_t offset, uint32_t flags, dict_t *xdata);
-
-int32_t dht_writev (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- struct iovec *vector,
- int32_t count,
- off_t offset,
- uint32_t flags,
- struct iobref *iobref, dict_t *xdata);
-
-int32_t dht_flush (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd, dict_t *xdata);
-
-int32_t dht_fsync (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- int32_t datasync, dict_t *xdata);
-
-int32_t dht_opendir (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc, fd_t *fd, dict_t *xdata);
-
-int32_t dht_fsyncdir (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- int32_t datasync, dict_t *xdata);
-
-int32_t dht_statfs (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc, dict_t *xdata);
-
-int32_t dht_setxattr (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc,
- dict_t *dict,
- int32_t flags, dict_t *xdata);
-
-int32_t dht_getxattr (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc,
- const char *name, dict_t *xdata);
-
-int32_t dht_fsetxattr (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- dict_t *dict,
- int32_t flags, dict_t *xdata);
-
-int32_t dht_fgetxattr (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- const char *name, dict_t *xdata);
-
-int32_t dht_removexattr (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc,
- const char *name, dict_t *xdata);
-int32_t dht_fremovexattr (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- const char *name, dict_t *xdata);
-
-int32_t dht_lk (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- int32_t cmd,
- struct gf_flock *flock, dict_t *xdata);
-
-int32_t dht_lease (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc,
- struct gf_lease *lease, dict_t *xdata);
-
-int32_t dht_inodelk (call_frame_t *frame, xlator_t *this,
- const char *volume, loc_t *loc, int32_t cmd,
- struct gf_flock *flock, dict_t *xdata);
-
-int32_t dht_finodelk (call_frame_t *frame, xlator_t *this,
- const char *volume, fd_t *fd, int32_t cmd,
- struct gf_flock *flock, dict_t *xdata);
-
-int32_t dht_entrylk (call_frame_t *frame, xlator_t *this,
- const char *volume, loc_t *loc, const char *basename,
- entrylk_cmd cmd, entrylk_type type, dict_t *xdata);
-
-int32_t dht_fentrylk (call_frame_t *frame, xlator_t *this,
- const char *volume, fd_t *fd, const char *basename,
- entrylk_cmd cmd, entrylk_type type, dict_t *xdata);
-
-int32_t dht_readdir (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- size_t size, off_t off, dict_t *xdata);
-
-int32_t dht_readdirp (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- size_t size, off_t off, dict_t *dict);
-
-int32_t dht_xattrop (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc,
- gf_xattrop_flags_t flags,
- dict_t *dict, dict_t *xdata);
-
-int32_t dht_fxattrop (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- gf_xattrop_flags_t flags,
- dict_t *dict, dict_t *xdata);
-
-int32_t dht_forget (xlator_t *this, inode_t *inode);
-int32_t dht_setattr (call_frame_t *frame, xlator_t *this, loc_t *loc,
- struct iatt *stbuf, int32_t valid, dict_t *xdata);
-int32_t dht_fsetattr (call_frame_t *frame, xlator_t *this, fd_t *fd,
- struct iatt *stbuf, int32_t valid, dict_t *xdata);
-int32_t dht_fallocate(call_frame_t *frame, xlator_t *this, fd_t *fd,
- int32_t mode, off_t offset, size_t len, dict_t *xdata);
-int32_t dht_discard(call_frame_t *frame, xlator_t *this, fd_t *fd,
- off_t offset, size_t len, dict_t *xdata);
-int32_t dht_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd,
- off_t offset, off_t len, dict_t *xdata);
-int32_t dht_ipc (call_frame_t *frame, xlator_t *this, int32_t op,
- dict_t *xdata);
+int32_t
+dht_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xattr_req);
+
+int32_t
+dht_stat(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata);
+
+int32_t
+dht_fstat(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata);
+
+int32_t
+dht_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset,
+ dict_t *xdata);
+
+int32_t
+dht_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
+ dict_t *xdata);
+
+int32_t
+dht_access(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t mask,
+ dict_t *xdata);
+
+int32_t
+dht_readlink(call_frame_t *frame, xlator_t *this, loc_t *loc, size_t size,
+ dict_t *xdata);
+
+int32_t
+dht_mknod(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode,
+ dev_t rdev, mode_t umask, dict_t *xdata);
+
+int32_t
+dht_mkdir(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode,
+ mode_t umask, dict_t *xdata);
+
+int32_t
+dht_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag,
+ dict_t *xdata);
+
+int32_t
+dht_rmdir(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags,
+ dict_t *xdata);
+
+int32_t
+dht_symlink(call_frame_t *frame, xlator_t *this, const char *linkpath,
+ loc_t *loc, mode_t umask, dict_t *xdata);
+
+int32_t
+dht_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc,
+ dict_t *xdata);
+
+int32_t
+dht_link(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc,
+ dict_t *xdata);
+
+int32_t
+dht_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags,
+ mode_t mode, mode_t umask, fd_t *fd, dict_t *params);
+
+int32_t
+dht_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags,
+ fd_t *fd, dict_t *xdata);
+
+int32_t
+dht_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
+ off_t offset, uint32_t flags, dict_t *xdata);
+
+int32_t
+dht_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector,
+ int32_t count, off_t offset, uint32_t flags, struct iobref *iobref,
+ dict_t *xdata);
+
+int32_t
+dht_flush(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata);
+
+int32_t
+dht_fsync(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t datasync,
+ dict_t *xdata);
+
+int32_t
+dht_opendir(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd,
+ dict_t *xdata);
+
+int32_t
+dht_fsyncdir(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t datasync,
+ dict_t *xdata);
+
+int32_t
+dht_statfs(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata);
+
+int32_t
+dht_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict,
+ int32_t flags, dict_t *xdata);
+
+int32_t
+dht_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name,
+ dict_t *xdata);
+
+int32_t
+dht_fsetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict,
+ int32_t flags, dict_t *xdata);
+
+int32_t
+dht_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name,
+ dict_t *xdata);
+
+int32_t
+dht_removexattr(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ const char *name, dict_t *xdata);
+int32_t
+dht_fremovexattr(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ const char *name, dict_t *xdata);
+
+int32_t
+dht_lk(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd,
+ struct gf_flock *flock, dict_t *xdata);
+
+int32_t
+dht_lease(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ struct gf_lease *lease, dict_t *xdata);
+
+int32_t
+dht_inodelk(call_frame_t *frame, xlator_t *this, const char *volume, loc_t *loc,
+ int32_t cmd, struct gf_flock *flock, dict_t *xdata);
+
+int32_t
+dht_finodelk(call_frame_t *frame, xlator_t *this, const char *volume, fd_t *fd,
+ int32_t cmd, struct gf_flock *flock, dict_t *xdata);
+
+int32_t
+dht_entrylk(call_frame_t *frame, xlator_t *this, const char *volume, loc_t *loc,
+ const char *basename, entrylk_cmd cmd, entrylk_type type,
+ dict_t *xdata);
+
+int32_t
+dht_fentrylk(call_frame_t *frame, xlator_t *this, const char *volume, fd_t *fd,
+ const char *basename, entrylk_cmd cmd, entrylk_type type,
+ dict_t *xdata);
+
+int32_t
+dht_readdir(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
+ off_t off, dict_t *xdata);
+
+int32_t
+dht_readdirp(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
+ off_t off, dict_t *dict);
+
+int32_t
+dht_xattrop(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ gf_xattrop_flags_t flags, dict_t *dict, dict_t *xdata);
+
+int32_t
+dht_fxattrop(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ gf_xattrop_flags_t flags, dict_t *dict, dict_t *xdata);
+
+int32_t
+dht_forget(xlator_t *this, inode_t *inode);
+int32_t
+dht_setattr(call_frame_t *frame, xlator_t *this, loc_t *loc, struct iatt *stbuf,
+ int32_t valid, dict_t *xdata);
+int32_t
+dht_fsetattr(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iatt *stbuf,
+ int32_t valid, dict_t *xdata);
+int32_t
+dht_fallocate(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t mode,
+ off_t offset, size_t len, dict_t *xdata);
+int32_t
+dht_discard(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
+ size_t len, dict_t *xdata);
+int32_t
+dht_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
+ off_t len, dict_t *xdata);
+int32_t
+dht_ipc(call_frame_t *frame, xlator_t *this, int32_t op, dict_t *xdata);
int
dht_set_subvol_range(xlator_t *this);
-int32_t dht_init (xlator_t *this);
-void dht_fini (xlator_t *this);
-int dht_reconfigure (xlator_t *this, dict_t *options);
-int32_t dht_notify (xlator_t *this, int32_t event, void *data, ...);
+int32_t
+dht_init(xlator_t *this);
+void
+dht_fini(xlator_t *this);
+int
+dht_reconfigure(xlator_t *this, dict_t *options);
+int32_t
+dht_notify(xlator_t *this, int32_t event, void *data, ...);
/* definitions for nufa/switch */
-int dht_revalidate_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int op_ret, int op_errno, inode_t *inode,
- struct iatt *stbuf, dict_t *xattr,
- struct iatt *postparent);
-int dht_lookup_dir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
+int
+dht_revalidate_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int op_ret, int op_errno, inode_t *inode, struct iatt *stbuf,
+ dict_t *xattr, struct iatt *postparent);
+int
+dht_lookup_dir_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int op_ret, int op_errno, inode_t *inode, struct iatt *stbuf,
+ dict_t *xattr, struct iatt *postparent);
+int
+dht_lookup_linkfile_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
int op_ret, int op_errno, inode_t *inode,
struct iatt *stbuf, dict_t *xattr,
struct iatt *postparent);
-int dht_lookup_linkfile_cbk (call_frame_t *frame, void *cookie,
- xlator_t *this, int op_ret, int op_errno,
- inode_t *inode, struct iatt *stbuf, dict_t *xattr,
- struct iatt *postparent);
-int dht_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int op_ret, int op_errno,
- inode_t *inode, struct iatt *stbuf, dict_t *xattr,
- struct iatt *postparent);
-int dht_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int op_ret, int op_errno,
- fd_t *fd, inode_t *inode, struct iatt *stbuf,
- struct iatt *preparent, struct iatt *postparent,
- dict_t *xdata);
-int dht_newfile_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int op_ret, int op_errno,
- inode_t *inode, struct iatt *stbuf, struct iatt *preparent,
- struct iatt *postparent, dict_t *xdata);
-
-int
-gf_defrag_status_get (dht_conf_t *conf, dict_t *dict);
+int
+dht_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret,
+ int op_errno, inode_t *inode, struct iatt *stbuf, dict_t *xattr,
+ struct iatt *postparent);
+int
+dht_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret,
+ int op_errno, fd_t *fd, inode_t *inode, struct iatt *stbuf,
+ struct iatt *preparent, struct iatt *postparent, dict_t *xdata);
+int
+dht_newfile_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret,
+ int op_errno, inode_t *inode, struct iatt *stbuf,
+ struct iatt *preparent, struct iatt *postparent, dict_t *xdata);
+
+int
+gf_defrag_status_get(dht_conf_t *conf, dict_t *dict);
void
-gf_defrag_set_pause_state (gf_tier_conf_t *tier_conf, tier_pause_state_t state);
+gf_defrag_set_pause_state(gf_tier_conf_t *tier_conf, tier_pause_state_t state);
tier_pause_state_t
-gf_defrag_get_pause_state (gf_tier_conf_t *tier_conf);
+gf_defrag_get_pause_state(gf_tier_conf_t *tier_conf);
int
-gf_defrag_pause_tier (xlator_t *this, gf_defrag_info_t *defrag);
+gf_defrag_pause_tier(xlator_t *this, gf_defrag_info_t *defrag);
tier_pause_state_t
-gf_defrag_check_pause_tier (gf_tier_conf_t *defrag);
+gf_defrag_check_pause_tier(gf_tier_conf_t *defrag);
int
-gf_defrag_resume_tier (xlator_t *this, gf_defrag_info_t *defrag);
+gf_defrag_resume_tier(xlator_t *this, gf_defrag_info_t *defrag);
int
-gf_defrag_start_detach_tier (gf_defrag_info_t *defrag);
+gf_defrag_start_detach_tier(gf_defrag_info_t *defrag);
int
-gf_defrag_stop (dht_conf_t *conf, gf_defrag_status_t status,
- dict_t *output);
+gf_defrag_stop(dht_conf_t *conf, gf_defrag_status_t status, dict_t *output);
-void*
-gf_defrag_start (void *this);
+void *
+gf_defrag_start(void *this);
int32_t
-gf_defrag_handle_hardlink (xlator_t *this, loc_t *loc, int *fop_errno);
+gf_defrag_handle_hardlink(xlator_t *this, loc_t *loc, int *fop_errno);
int
-dht_migrate_file (xlator_t *this, loc_t *loc, xlator_t *from, xlator_t *to,
+dht_migrate_file(xlator_t *this, loc_t *loc, xlator_t *from, xlator_t *to,
int flag, int *fop_errno);
int
-dht_inode_ctx_layout_get (inode_t *inode, xlator_t *this,
- dht_layout_t **layout_int);
+dht_inode_ctx_layout_get(inode_t *inode, xlator_t *this,
+ dht_layout_t **layout_int);
int
-dht_inode_ctx_layout_set (inode_t *inode, xlator_t *this,
- dht_layout_t* layout_int);
+dht_inode_ctx_layout_set(inode_t *inode, xlator_t *this,
+ dht_layout_t *layout_int);
int
-dht_inode_ctx_time_update (inode_t *inode, xlator_t *this, struct iatt *stat,
- int32_t update_ctx);
-void dht_inode_ctx_time_set (inode_t *inode, xlator_t *this, struct iatt *stat);
+dht_inode_ctx_time_update(inode_t *inode, xlator_t *this, struct iatt *stat,
+ int32_t update_ctx);
+void
+dht_inode_ctx_time_set(inode_t *inode, xlator_t *this, struct iatt *stat);
-int dht_inode_ctx_get (inode_t *inode, xlator_t *this, dht_inode_ctx_t **ctx);
-int dht_inode_ctx_set (inode_t *inode, xlator_t *this, dht_inode_ctx_t *ctx);
int
-dht_dir_attr_heal (void *data);
+dht_inode_ctx_get(inode_t *inode, xlator_t *this, dht_inode_ctx_t **ctx);
int
-dht_dir_attr_heal_done (int ret, call_frame_t *sync_frame, void *data);
+dht_inode_ctx_set(inode_t *inode, xlator_t *this, dht_inode_ctx_t *ctx);
int
-dht_dir_has_layout (dict_t *xattr, char *name);
+dht_dir_attr_heal(void *data);
+int
+dht_dir_attr_heal_done(int ret, call_frame_t *sync_frame, void *data);
+int
+dht_dir_has_layout(dict_t *xattr, char *name);
gf_boolean_t
-dht_is_subvol_in_layout (dht_layout_t *layout, xlator_t *xlator);
+dht_is_subvol_in_layout(dht_layout_t *layout, xlator_t *xlator);
xlator_t *
-dht_subvol_with_free_space_inodes (xlator_t *this, xlator_t *subvol, xlator_t *ignore,
- dht_layout_t *layout, uint64_t filesize);
+dht_subvol_with_free_space_inodes(xlator_t *this, xlator_t *subvol,
+ xlator_t *ignore, dht_layout_t *layout,
+ uint64_t filesize);
xlator_t *
-dht_subvol_maxspace_nonzeroinode (xlator_t *this, xlator_t *subvol,
- dht_layout_t *layout);
+dht_subvol_maxspace_nonzeroinode(xlator_t *this, xlator_t *subvol,
+ dht_layout_t *layout);
int
-dht_linkfile_attr_heal (call_frame_t *frame, xlator_t *this);
+dht_linkfile_attr_heal(call_frame_t *frame, xlator_t *this);
void
-dht_layout_dump (dht_layout_t *layout, const char *prefix);
+dht_layout_dump(dht_layout_t *layout, const char *prefix);
int32_t
-dht_priv_dump (xlator_t *this);
+dht_priv_dump(xlator_t *this);
int32_t
-dht_inodectx_dump (xlator_t *this, inode_t *inode);
+dht_inodectx_dump(xlator_t *this, inode_t *inode);
int
-dht_inode_ctx_get_mig_info (xlator_t *this, inode_t *inode,
- xlator_t **src_subvol, xlator_t **dst_subvol);
+dht_inode_ctx_get_mig_info(xlator_t *this, inode_t *inode,
+ xlator_t **src_subvol, xlator_t **dst_subvol);
gf_boolean_t
-dht_mig_info_is_invalid (xlator_t *current, xlator_t *src_subvol,
- xlator_t *dst_subvol);
+dht_mig_info_is_invalid(xlator_t *current, xlator_t *src_subvol,
+ xlator_t *dst_subvol);
int
-dht_subvol_status (dht_conf_t *conf, xlator_t *subvol);
+dht_subvol_status(dht_conf_t *conf, xlator_t *subvol);
void
-dht_log_new_layout_for_dir_selfheal (xlator_t *this, loc_t *loc,
- dht_layout_t *layout);
+dht_log_new_layout_for_dir_selfheal(xlator_t *this, loc_t *loc,
+ dht_layout_t *layout);
int
-dht_lookup_everywhere_done (call_frame_t *frame, xlator_t *this);
+dht_lookup_everywhere_done(call_frame_t *frame, xlator_t *this);
int
-dht_fill_dict_to_avoid_unlink_of_migrating_file (dict_t *dict);
+dht_fill_dict_to_avoid_unlink_of_migrating_file(dict_t *dict);
int
-dht_layout_sort (dht_layout_t *layout);
+dht_layout_sort(dht_layout_t *layout);
int
-dht_heal_full_path (void *data);
+dht_heal_full_path(void *data);
int
-dht_heal_full_path_done (int op_ret, call_frame_t *frame, void *data);
+dht_heal_full_path_done(int op_ret, call_frame_t *frame, void *data);
int
-dht_layout_missing_dirs (dht_layout_t *layout);
+dht_layout_missing_dirs(dht_layout_t *layout);
int
-dht_refresh_layout (call_frame_t *frame);
+dht_refresh_layout(call_frame_t *frame);
gf_boolean_t
-dht_is_tier_xlator (xlator_t *this);
+dht_is_tier_xlator(xlator_t *this);
int
-dht_build_parent_loc (xlator_t *this, loc_t *parent, loc_t *child,
- int32_t *op_errno);
+dht_build_parent_loc(xlator_t *this, loc_t *parent, loc_t *child,
+ int32_t *op_errno);
int32_t
-dht_set_local_rebalance (xlator_t *this, dht_local_t *local,
- struct iatt *stbuf,
- struct iatt *prebuf,
- struct iatt *postbuf, dict_t *xdata);
+dht_set_local_rebalance(xlator_t *this, dht_local_t *local, struct iatt *stbuf,
+ struct iatt *prebuf, struct iatt *postbuf,
+ dict_t *xdata);
void
-dht_build_root_loc (inode_t *inode, loc_t *loc);
+dht_build_root_loc(inode_t *inode, loc_t *loc);
gf_boolean_t
-dht_fd_open_on_dst (xlator_t *this, fd_t *fd, xlator_t *dst);
+dht_fd_open_on_dst(xlator_t *this, fd_t *fd, xlator_t *dst);
int32_t
-dht_fd_ctx_destroy (xlator_t *this, fd_t *fd);
+dht_fd_ctx_destroy(xlator_t *this, fd_t *fd);
int32_t
-dht_release (xlator_t *this, fd_t *fd);
-
+dht_release(xlator_t *this, fd_t *fd);
int32_t
-dht_set_fixed_dir_stat (struct iatt *stat);
+dht_set_fixed_dir_stat(struct iatt *stat);
-xlator_t*
-dht_get_lock_subvolume (xlator_t *this, struct gf_flock *lock,
- dht_local_t *local);
+xlator_t *
+dht_get_lock_subvolume(xlator_t *this, struct gf_flock *lock,
+ dht_local_t *local);
int
-dht_lk_inode_unref (call_frame_t *frame, int32_t op_ret);
+dht_lk_inode_unref(call_frame_t *frame, int32_t op_ret);
void
-dht_normalize_stats (struct statvfs *buf, unsigned long bsize,
- unsigned long frsize);
+dht_normalize_stats(struct statvfs *buf, unsigned long bsize,
+ unsigned long frsize);
int
add_opt(char **optsp, const char *opt);
int
-dht_aggregate_split_brain_xattr (dict_t *dst, char *key, data_t *value);
+dht_aggregate_split_brain_xattr(dict_t *dst, char *key, data_t *value);
int
-dht_remove_stale_linkto (void *data);
+dht_remove_stale_linkto(void *data);
int
-dht_remove_stale_linkto_cbk (int ret, call_frame_t *sync_frame, void *data);
+dht_remove_stale_linkto_cbk(int ret, call_frame_t *sync_frame, void *data);
int
-dht_fd_ctx_set (xlator_t *this, fd_t *fd, xlator_t *subvol);
+dht_fd_ctx_set(xlator_t *this, fd_t *fd, xlator_t *subvol);
int
-dht_check_and_open_fd_on_subvol (xlator_t *this, call_frame_t *frame);
+dht_check_and_open_fd_on_subvol(xlator_t *this, call_frame_t *frame);
/* FD fop callbacks */
int
-dht_writev_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int op_ret, int op_errno, struct iatt *prebuf,
- struct iatt *postbuf, dict_t *xdata);
+dht_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret,
+ int op_errno, struct iatt *prebuf, struct iatt *postbuf,
+ dict_t *xdata);
int
-dht_flush_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int op_ret, int op_errno, dict_t *xdata);
+dht_flush_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret,
+ int op_errno, dict_t *xdata);
int
-dht_file_setattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int op_ret, int op_errno, struct iatt *prebuf,
- struct iatt *postbuf, dict_t *xdata);
+dht_file_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int op_ret, int op_errno, struct iatt *prebuf,
+ struct iatt *postbuf, dict_t *xdata);
int
-dht_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
- int op_ret, int op_errno, struct iatt *prebuf,
- struct iatt *postbuf, dict_t *xdata);
+dht_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret,
+ int op_errno, struct iatt *prebuf, struct iatt *postbuf,
+ dict_t *xdata);
int
-dht_discard_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
- int op_ret, int op_errno, struct iatt *prebuf,
- struct iatt *postbuf, dict_t *xdata);
+dht_discard_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret,
+ int op_errno, struct iatt *prebuf, struct iatt *postbuf,
+ dict_t *xdata);
int
-dht_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
- int op_ret, int op_errno, struct iatt *prebuf,
- struct iatt *postbuf, dict_t *xdata);
+dht_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret,
+ int op_errno, struct iatt *prebuf, struct iatt *postbuf,
+ dict_t *xdata);
int
-dht_truncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int op_ret, int op_errno, struct iatt *prebuf,
- struct iatt *postbuf, dict_t *xdata);
+dht_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret,
+ int op_errno, struct iatt *prebuf, struct iatt *postbuf,
+ dict_t *xdata);
int
-dht_fsync_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int op_ret,
- int op_errno, struct iatt *prebuf, struct iatt *postbuf,
- dict_t *xdata);
-
+dht_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret,
+ int op_errno, struct iatt *prebuf, struct iatt *postbuf,
+ dict_t *xdata);
int
-dht_readv_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int op_ret, int op_errno,
- struct iovec *vector, int count, struct iatt *stbuf,
- struct iobref *iobref, dict_t *xdata);
+dht_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret,
+ int op_errno, struct iovec *vector, int count, struct iatt *stbuf,
+ struct iobref *iobref, dict_t *xdata);
int
-dht_file_attr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int op_ret, int op_errno, struct iatt *stbuf, dict_t *xdata);
+dht_file_attr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret,
+ int op_errno, struct iatt *stbuf, dict_t *xdata);
int
-dht_file_removexattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int op_ret, int op_errno, dict_t *xdata);
+dht_file_removexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int op_ret, int op_errno, dict_t *xdata);
int
-dht_file_setxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int op_ret, int op_errno, dict_t *xdata);
+dht_file_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int op_ret, int op_errno, dict_t *xdata);
/* All custom xattr heal functions */
int
-dht_dir_heal_xattrs (void *data);
+dht_dir_heal_xattrs(void *data);
int
-dht_dir_heal_xattrs_done (int ret, call_frame_t *sync_frame, void *data);
+dht_dir_heal_xattrs_done(int ret, call_frame_t *sync_frame, void *data);
void
-dht_aggregate_xattr (dict_t *dst, dict_t *src);
+dht_aggregate_xattr(dict_t *dst, dict_t *src);
int32_t
dht_dict_set_array(dict_t *dict, char *key, int32_t value[], int32_t size);
int
-dht_set_user_xattr (dict_t *dict, char *k, data_t *v, void *data);
+dht_set_user_xattr(dict_t *dict, char *k, data_t *v, void *data);
void
-dht_dir_set_heal_xattr (xlator_t *this, dht_local_t *local, dict_t *dst,
- dict_t *src, int *uret, int *uflag);
+dht_dir_set_heal_xattr(xlator_t *this, dht_local_t *local, dict_t *dst,
+ dict_t *src, int *uret, int *uflag);
int
-dht_dir_xattr_heal (xlator_t *this, dht_local_t *local);
+dht_dir_xattr_heal(xlator_t *this, dht_local_t *local);
int32_t
-dht_dict_get_array (dict_t *dict, char *key, int32_t value[], int32_t size, int *errst);
+dht_dict_get_array(dict_t *dict, char *key, int32_t value[], int32_t size,
+ int *errst);
xlator_t *
-dht_inode_get_hashed_subvol (inode_t *inode, xlator_t *this, loc_t *loc);
+dht_inode_get_hashed_subvol(inode_t *inode, xlator_t *this, loc_t *loc);
int
-dht_common_mark_mdsxattr (call_frame_t *frame, int *errst, int flag);
+dht_common_mark_mdsxattr(call_frame_t *frame, int *errst, int flag);
int
-dht_common_mark_mdsxattr_cbk (call_frame_t *frame, void *cookie,
- xlator_t *this, int op_ret, int op_errno,
- dict_t *xdata);
+dht_common_mark_mdsxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int op_ret, int op_errno, dict_t *xdata);
int
-dht_inode_ctx_mdsvol_set (inode_t *inode, xlator_t *this,
- xlator_t *mds_subvol);
+dht_inode_ctx_mdsvol_set(inode_t *inode, xlator_t *this, xlator_t *mds_subvol);
int
-dht_inode_ctx_mdsvol_get (inode_t *inode, xlator_t *this,
- xlator_t **mdsvol);
+dht_inode_ctx_mdsvol_get(inode_t *inode, xlator_t *this, xlator_t **mdsvol);
int
-dht_selfheal_dir_setattr (call_frame_t *frame, loc_t *loc, struct iatt *stbuf,
- int32_t valid, dht_layout_t *layout);
+dht_selfheal_dir_setattr(call_frame_t *frame, loc_t *loc, struct iatt *stbuf,
+ int32_t valid, dht_layout_t *layout);
/* Abstract out the DHT-IATT-IN-DICT */
+int
+dht_request_iatt_in_xdata(xlator_t *this, dict_t *xattr_req);
-int dht_request_iatt_in_xdata (xlator_t *this, dict_t *xattr_req);
-
-int dht_read_iatt_from_xdata (xlator_t *this, dict_t *xdata,
- struct iatt *stbuf);
+int
+dht_read_iatt_from_xdata(xlator_t *this, dict_t *xdata, struct iatt *stbuf);
int
-is_permission_different (ia_prot_t *prot1, ia_prot_t *prot2);
-#endif/* _DHT_H */
+is_permission_different(ia_prot_t *prot1, ia_prot_t *prot2);
+#endif /* _DHT_H */
diff --git a/xlators/cluster/dht/src/dht-lock.h b/xlators/cluster/dht/src/dht-lock.h
index f36bf3fd685..802970adb3b 100644
--- a/xlators/cluster/dht/src/dht-lock.h
+++ b/xlators/cluster/dht/src/dht-lock.h
@@ -15,32 +15,32 @@
#include "dht-common.h"
void
-dht_lock_array_free (dht_lock_t **lk_array, int count);
+dht_lock_array_free(dht_lock_t **lk_array, int count);
int32_t
-dht_lock_count (dht_lock_t **lk_array, int lk_count);
+dht_lock_count(dht_lock_t **lk_array, int lk_count);
dht_lock_t *
-dht_lock_new (xlator_t *this, xlator_t *xl, loc_t *loc, short type,
- const char *domain, const char *basename,
- dht_reaction_type_t do_on_failure);
+dht_lock_new(xlator_t *this, xlator_t *xl, loc_t *loc, short type,
+ const char *domain, const char *basename,
+ dht_reaction_type_t do_on_failure);
int32_t
-dht_unlock_entrylk_wrapper (call_frame_t *, dht_elock_wrap_t *);
+dht_unlock_entrylk_wrapper(call_frame_t *, dht_elock_wrap_t *);
void
-dht_blocking_entrylk_rec (call_frame_t *frame, int i);
+dht_blocking_entrylk_rec(call_frame_t *frame, int i);
int
-dht_blocking_entrylk (call_frame_t *frame, dht_lock_t **lk_array,
- int lk_count, fop_inodelk_cbk_t entrylk_cbk);
+dht_blocking_entrylk(call_frame_t *frame, dht_lock_t **lk_array, int lk_count,
+ fop_inodelk_cbk_t entrylk_cbk);
int32_t
-dht_unlock_inodelk (call_frame_t *frame, dht_lock_t **lk_array, int lk_count,
- fop_inodelk_cbk_t inodelk_cbk);
+dht_unlock_inodelk(call_frame_t *frame, dht_lock_t **lk_array, int lk_count,
+ fop_inodelk_cbk_t inodelk_cbk);
int32_t
-dht_unlock_inodelk_wrapper (call_frame_t *, dht_ilock_wrap_t *);
+dht_unlock_inodelk_wrapper(call_frame_t *, dht_ilock_wrap_t *);
/* Acquire non-blocking inodelk on a list of xlators.
*
@@ -57,11 +57,11 @@ dht_unlock_inodelk_wrapper (call_frame_t *, dht_ilock_wrap_t *);
*/
int
-dht_nonblocking_inodelk (call_frame_t *frame, dht_lock_t **lk_array,
- int lk_count, fop_inodelk_cbk_t inodelk_cbk);
+dht_nonblocking_inodelk(call_frame_t *frame, dht_lock_t **lk_array,
+ int lk_count, fop_inodelk_cbk_t inodelk_cbk);
void
-dht_blocking_inodelk_rec (call_frame_t *frame, int i);
+dht_blocking_inodelk_rec(call_frame_t *frame, int i);
/* same as dht_nonblocking_inodelk, but issues sequential blocking locks on
* @lk_array directly. locks are issued on some order which remains same
@@ -69,25 +69,24 @@ dht_blocking_inodelk_rec (call_frame_t *frame, int i);
*/
int
-dht_blocking_inodelk (call_frame_t *frame, dht_lock_t **lk_array,
- int lk_count, fop_inodelk_cbk_t inodelk_cbk);
+dht_blocking_inodelk(call_frame_t *frame, dht_lock_t **lk_array, int lk_count,
+ fop_inodelk_cbk_t inodelk_cbk);
int32_t
-dht_blocking_entrylk_after_inodelk (call_frame_t *frame, void *cookie,
- xlator_t *this, int32_t op_ret,
- int32_t op_errno, dict_t *xdata);
+dht_blocking_entrylk_after_inodelk(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, dict_t *xdata);
int32_t
-dht_blocking_entrylk_after_inodelk_rename (call_frame_t *frame, void *cookie,
- xlator_t *this, int32_t op_ret,
- int32_t op_errno, dict_t *xdata);
+dht_blocking_entrylk_after_inodelk_rename(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, dict_t *xdata);
void
-dht_unlock_namespace (call_frame_t *, dht_dir_transaction_t *);
+dht_unlock_namespace(call_frame_t *, dht_dir_transaction_t *);
int
-dht_protect_namespace (call_frame_t *frame, loc_t *loc, xlator_t *subvol,
- struct dht_namespace *ns,
- fop_entrylk_cbk_t ns_cbk);
+dht_protect_namespace(call_frame_t *frame, loc_t *loc, xlator_t *subvol,
+ struct dht_namespace *ns, fop_entrylk_cbk_t ns_cbk);
-#endif /* _DHT_LOCK_H */
+#endif /* _DHT_LOCK_H */
diff --git a/xlators/cluster/dht/src/dht-mem-types.h b/xlators/cluster/dht/src/dht-mem-types.h
index 19cccef537b..5b728f86c95 100644
--- a/xlators/cluster/dht/src/dht-mem-types.h
+++ b/xlators/cluster/dht/src/dht-mem-types.h
@@ -8,38 +8,37 @@
cases as published by the Free Software Foundation.
*/
-
#ifndef __DHT_MEM_TYPES_H__
#define __DHT_MEM_TYPES_H__
#include "mem-types.h"
enum gf_dht_mem_types_ {
- gf_dht_mt_dht_du_t = gf_common_mt_end + 1,
- gf_dht_mt_dht_conf_t,
- gf_dht_mt_char,
- gf_dht_mt_int32_t,
- gf_dht_mt_xlator_t,
- gf_dht_mt_dht_layout_t,
- gf_switch_mt_dht_conf_t,
- gf_switch_mt_dht_du_t,
- gf_switch_mt_switch_sched_array,
- gf_switch_mt_switch_struct,
- gf_dht_mt_subvol_time,
- gf_dht_mt_loc_t,
- gf_defrag_info_mt,
- gf_dht_mt_inode_ctx_t,
- gf_dht_mt_ctx_stat_time_t,
- gf_dht_mt_dirent_t,
- gf_dht_mt_container_t,
- gf_dht_mt_octx_t,
- gf_dht_mt_miginfo_t,
- gf_tier_mt_bricklist_t,
- gf_tier_mt_ipc_ctr_params_t,
- gf_dht_mt_fd_ctx_t,
- gf_tier_mt_qfile_array_t,
- gf_dht_ret_cache_t,
- gf_dht_nodeuuids_t,
- gf_dht_mt_end
+ gf_dht_mt_dht_du_t = gf_common_mt_end + 1,
+ gf_dht_mt_dht_conf_t,
+ gf_dht_mt_char,
+ gf_dht_mt_int32_t,
+ gf_dht_mt_xlator_t,
+ gf_dht_mt_dht_layout_t,
+ gf_switch_mt_dht_conf_t,
+ gf_switch_mt_dht_du_t,
+ gf_switch_mt_switch_sched_array,
+ gf_switch_mt_switch_struct,
+ gf_dht_mt_subvol_time,
+ gf_dht_mt_loc_t,
+ gf_defrag_info_mt,
+ gf_dht_mt_inode_ctx_t,
+ gf_dht_mt_ctx_stat_time_t,
+ gf_dht_mt_dirent_t,
+ gf_dht_mt_container_t,
+ gf_dht_mt_octx_t,
+ gf_dht_mt_miginfo_t,
+ gf_tier_mt_bricklist_t,
+ gf_tier_mt_ipc_ctr_params_t,
+ gf_dht_mt_fd_ctx_t,
+ gf_tier_mt_qfile_array_t,
+ gf_dht_ret_cache_t,
+ gf_dht_nodeuuids_t,
+ gf_dht_mt_end
};
#endif
diff --git a/xlators/cluster/dht/src/dht-messages.h b/xlators/cluster/dht/src/dht-messages.h
index bdea5a092b7..005ab57b505 100644
--- a/xlators/cluster/dht/src/dht-messages.h
+++ b/xlators/cluster/dht/src/dht-messages.h
@@ -22,136 +22,63 @@
* glfs-message-id.h.
*/
-GLFS_MSGID(DHT,
- DHT_MSG_CACHED_SUBVOL_GET_FAILED,
- DHT_MSG_CREATE_LINK_FAILED,
- DHT_MSG_DICT_SET_FAILED,
- DHT_MSG_DIR_ATTR_HEAL_FAILED,
- DHT_MSG_DIR_SELFHEAL_FAILED,
- DHT_MSG_DIR_SELFHEAL_XATTR_FAILED,
- DHT_MSG_FILE_ON_MULT_SUBVOL,
- DHT_MSG_FILE_TYPE_MISMATCH,
- DHT_MSG_GFID_MISMATCH,
- DHT_MSG_GFID_NULL,
- DHT_MSG_HASHED_SUBVOL_GET_FAILED,
- DHT_MSG_INIT_FAILED,
- DHT_MSG_INVALID_CONFIGURATION,
- DHT_MSG_INVALID_DISK_LAYOUT,
- DHT_MSG_INVALID_OPTION,
- DHT_MSG_LAYOUT_FIX_FAILED,
- DHT_MSG_LAYOUT_MERGE_FAILED,
- DHT_MSG_LAYOUT_MISMATCH,
- DHT_MSG_LAYOUT_NULL,
- DHT_MSG_MIGRATE_DATA_COMPLETE,
- DHT_MSG_MIGRATE_DATA_FAILED,
- DHT_MSG_MIGRATE_FILE_COMPLETE,
- DHT_MSG_MIGRATE_FILE_FAILED,
- DHT_MSG_NO_MEMORY,
- DHT_MSG_OPENDIR_FAILED,
- DHT_MSG_REBALANCE_FAILED,
- DHT_MSG_REBALANCE_START_FAILED,
- DHT_MSG_REBALANCE_STATUS,
- DHT_MSG_REBALANCE_STOPPED,
- DHT_MSG_RENAME_FAILED,
- DHT_MSG_SETATTR_FAILED,
- DHT_MSG_SUBVOL_INSUFF_INODES,
- DHT_MSG_SUBVOL_INSUFF_SPACE,
- DHT_MSG_UNLINK_FAILED,
- DHT_MSG_LAYOUT_SET_FAILED,
- DHT_MSG_LOG_FIXED_LAYOUT,
- DHT_MSG_LOG_TIER_ERROR,
- DHT_MSG_LOG_TIER_STATUS,
- DHT_MSG_GET_XATTR_FAILED,
- DHT_MSG_FILE_LOOKUP_FAILED,
- DHT_MSG_OPEN_FD_FAILED,
- DHT_MSG_SET_INODE_CTX_FAILED,
- DHT_MSG_UNLOCKING_FAILED,
- DHT_MSG_DISK_LAYOUT_NULL,
- DHT_MSG_SUBVOL_INFO,
- DHT_MSG_CHUNK_SIZE_INFO,
- DHT_MSG_LAYOUT_FORM_FAILED,
- DHT_MSG_SUBVOL_ERROR,
- DHT_MSG_LAYOUT_SORT_FAILED,
- DHT_MSG_REGEX_INFO,
- DHT_MSG_FOPEN_FAILED,
- DHT_MSG_SET_HOSTNAME_FAILED,
- DHT_MSG_BRICK_ERROR,
- DHT_MSG_SYNCOP_FAILED,
- DHT_MSG_MIGRATE_INFO,
- DHT_MSG_SOCKET_ERROR,
- DHT_MSG_CREATE_FD_FAILED,
- DHT_MSG_READDIR_ERROR,
- DHT_MSG_CHILD_LOC_BUILD_FAILED,
- DHT_MSG_SET_SWITCH_PATTERN_ERROR,
- DHT_MSG_COMPUTE_HASH_FAILED,
- DHT_MSG_FIND_LAYOUT_ANOMALIES_ERROR,
- DHT_MSG_ANOMALIES_INFO,
- DHT_MSG_LAYOUT_INFO,
- DHT_MSG_INODE_LK_ERROR,
- DHT_MSG_RENAME_INFO,
- DHT_MSG_DATA_NULL,
- DHT_MSG_AGGREGATE_QUOTA_XATTR_FAILED,
- DHT_MSG_UNLINK_LOOKUP_INFO,
- DHT_MSG_LINK_FILE_LOOKUP_INFO,
- DHT_MSG_OPERATION_NOT_SUP,
- DHT_MSG_NOT_LINK_FILE_ERROR,
- DHT_MSG_CHILD_DOWN,
- DHT_MSG_UUID_PARSE_ERROR,
- DHT_MSG_GET_DISK_INFO_ERROR,
- DHT_MSG_INVALID_VALUE,
- DHT_MSG_SWITCH_PATTERN_INFO,
- DHT_MSG_SUBVOL_OP_FAILED,
- DHT_MSG_LAYOUT_PRESET_FAILED,
- DHT_MSG_INVALID_LINKFILE,
- DHT_MSG_FIX_LAYOUT_INFO,
- DHT_MSG_GET_HOSTNAME_FAILED,
- DHT_MSG_WRITE_FAILED,
- DHT_MSG_MIGRATE_HARDLINK_FILE_FAILED,
- DHT_MSG_FSYNC_FAILED,
- DHT_MSG_SUBVOL_DECOMMISSION_INFO,
- DHT_MSG_BRICK_QUERY_FAILED,
- DHT_MSG_SUBVOL_NO_LAYOUT_INFO,
- DHT_MSG_OPEN_FD_ON_DST_FAILED,
- DHT_MSG_SUBVOL_NOT_FOUND,
- DHT_MSG_FILE_LOOKUP_ON_DST_FAILED,
- DHT_MSG_DISK_LAYOUT_MISSING,
- DHT_MSG_DICT_GET_FAILED,
- DHT_MSG_REVALIDATE_CBK_INFO,
- DHT_MSG_UPGRADE_BRICKS,
- DHT_MSG_LK_ARRAY_INFO,
- DHT_MSG_RENAME_NOT_LOCAL,
- DHT_MSG_RECONFIGURE_INFO,
- DHT_MSG_INIT_LOCAL_SUBVOL_FAILED,
- DHT_MSG_SYS_CALL_GET_TIME_FAILED,
- DHT_MSG_NO_DISK_USAGE_STATUS,
- DHT_MSG_SUBVOL_DOWN_ERROR,
- DHT_MSG_REBAL_THROTTLE_INFO,
- DHT_MSG_COMMIT_HASH_INFO,
- DHT_MSG_REBAL_STRUCT_SET,
- DHT_MSG_HAS_MIGINFO,
- DHT_MSG_LOG_IPC_TIER_ERROR,
- DHT_MSG_TIER_PAUSED,
- DHT_MSG_TIER_RESUME,
- DHT_MSG_SETTLE_HASH_FAILED,
- DHT_MSG_DEFRAG_PROCESS_DIR_FAILED,
- DHT_MSG_FD_CTX_SET_FAILED,
- DHT_MSG_STALE_LOOKUP,
- DHT_MSG_PARENT_LAYOUT_CHANGED,
- DHT_MSG_LOCK_MIGRATION_FAILED,
- DHT_MSG_LOCK_INODE_UNREF_FAILED,
- DHT_MSG_ASPRINTF_FAILED,
- DHT_MSG_DIR_LOOKUP_FAILED,
- DHT_MSG_INODELK_FAILED,
- DHT_MSG_LOCK_FRAME_FAILED,
- DHT_MSG_LOCAL_LOCK_INIT_FAILED,
- DHT_MSG_ENTRYLK_ERROR,
- DHT_MSG_INODELK_ERROR,
- DHT_MSG_LOC_FAILED,
- DHT_MSG_UNKNOWN_FOP,
- DHT_MSG_MIGRATE_FILE_SKIPPED,
- DHT_MSG_DIR_XATTR_HEAL_FAILED,
- DHT_MSG_HASHED_SUBVOL_DOWN,
- DHT_MSG_NON_HASHED_SUBVOL_DOWN
-);
+GLFS_MSGID(
+ DHT, DHT_MSG_CACHED_SUBVOL_GET_FAILED, DHT_MSG_CREATE_LINK_FAILED,
+ DHT_MSG_DICT_SET_FAILED, DHT_MSG_DIR_ATTR_HEAL_FAILED,
+ DHT_MSG_DIR_SELFHEAL_FAILED, DHT_MSG_DIR_SELFHEAL_XATTR_FAILED,
+ DHT_MSG_FILE_ON_MULT_SUBVOL, DHT_MSG_FILE_TYPE_MISMATCH,
+ DHT_MSG_GFID_MISMATCH, DHT_MSG_GFID_NULL, DHT_MSG_HASHED_SUBVOL_GET_FAILED,
+ DHT_MSG_INIT_FAILED, DHT_MSG_INVALID_CONFIGURATION,
+ DHT_MSG_INVALID_DISK_LAYOUT, DHT_MSG_INVALID_OPTION,
+ DHT_MSG_LAYOUT_FIX_FAILED, DHT_MSG_LAYOUT_MERGE_FAILED,
+ DHT_MSG_LAYOUT_MISMATCH, DHT_MSG_LAYOUT_NULL, DHT_MSG_MIGRATE_DATA_COMPLETE,
+ DHT_MSG_MIGRATE_DATA_FAILED, DHT_MSG_MIGRATE_FILE_COMPLETE,
+ DHT_MSG_MIGRATE_FILE_FAILED, DHT_MSG_NO_MEMORY, DHT_MSG_OPENDIR_FAILED,
+ DHT_MSG_REBALANCE_FAILED, DHT_MSG_REBALANCE_START_FAILED,
+ DHT_MSG_REBALANCE_STATUS, DHT_MSG_REBALANCE_STOPPED, DHT_MSG_RENAME_FAILED,
+ DHT_MSG_SETATTR_FAILED, DHT_MSG_SUBVOL_INSUFF_INODES,
+ DHT_MSG_SUBVOL_INSUFF_SPACE, DHT_MSG_UNLINK_FAILED,
+ DHT_MSG_LAYOUT_SET_FAILED, DHT_MSG_LOG_FIXED_LAYOUT, DHT_MSG_LOG_TIER_ERROR,
+ DHT_MSG_LOG_TIER_STATUS, DHT_MSG_GET_XATTR_FAILED,
+ DHT_MSG_FILE_LOOKUP_FAILED, DHT_MSG_OPEN_FD_FAILED,
+ DHT_MSG_SET_INODE_CTX_FAILED, DHT_MSG_UNLOCKING_FAILED,
+ DHT_MSG_DISK_LAYOUT_NULL, DHT_MSG_SUBVOL_INFO, DHT_MSG_CHUNK_SIZE_INFO,
+ DHT_MSG_LAYOUT_FORM_FAILED, DHT_MSG_SUBVOL_ERROR,
+ DHT_MSG_LAYOUT_SORT_FAILED, DHT_MSG_REGEX_INFO, DHT_MSG_FOPEN_FAILED,
+ DHT_MSG_SET_HOSTNAME_FAILED, DHT_MSG_BRICK_ERROR, DHT_MSG_SYNCOP_FAILED,
+ DHT_MSG_MIGRATE_INFO, DHT_MSG_SOCKET_ERROR, DHT_MSG_CREATE_FD_FAILED,
+ DHT_MSG_READDIR_ERROR, DHT_MSG_CHILD_LOC_BUILD_FAILED,
+ DHT_MSG_SET_SWITCH_PATTERN_ERROR, DHT_MSG_COMPUTE_HASH_FAILED,
+ DHT_MSG_FIND_LAYOUT_ANOMALIES_ERROR, DHT_MSG_ANOMALIES_INFO,
+ DHT_MSG_LAYOUT_INFO, DHT_MSG_INODE_LK_ERROR, DHT_MSG_RENAME_INFO,
+ DHT_MSG_DATA_NULL, DHT_MSG_AGGREGATE_QUOTA_XATTR_FAILED,
+ DHT_MSG_UNLINK_LOOKUP_INFO, DHT_MSG_LINK_FILE_LOOKUP_INFO,
+ DHT_MSG_OPERATION_NOT_SUP, DHT_MSG_NOT_LINK_FILE_ERROR, DHT_MSG_CHILD_DOWN,
+ DHT_MSG_UUID_PARSE_ERROR, DHT_MSG_GET_DISK_INFO_ERROR,
+ DHT_MSG_INVALID_VALUE, DHT_MSG_SWITCH_PATTERN_INFO,
+ DHT_MSG_SUBVOL_OP_FAILED, DHT_MSG_LAYOUT_PRESET_FAILED,
+ DHT_MSG_INVALID_LINKFILE, DHT_MSG_FIX_LAYOUT_INFO,
+ DHT_MSG_GET_HOSTNAME_FAILED, DHT_MSG_WRITE_FAILED,
+ DHT_MSG_MIGRATE_HARDLINK_FILE_FAILED, DHT_MSG_FSYNC_FAILED,
+ DHT_MSG_SUBVOL_DECOMMISSION_INFO, DHT_MSG_BRICK_QUERY_FAILED,
+ DHT_MSG_SUBVOL_NO_LAYOUT_INFO, DHT_MSG_OPEN_FD_ON_DST_FAILED,
+ DHT_MSG_SUBVOL_NOT_FOUND, DHT_MSG_FILE_LOOKUP_ON_DST_FAILED,
+ DHT_MSG_DISK_LAYOUT_MISSING, DHT_MSG_DICT_GET_FAILED,
+ DHT_MSG_REVALIDATE_CBK_INFO, DHT_MSG_UPGRADE_BRICKS, DHT_MSG_LK_ARRAY_INFO,
+ DHT_MSG_RENAME_NOT_LOCAL, DHT_MSG_RECONFIGURE_INFO,
+ DHT_MSG_INIT_LOCAL_SUBVOL_FAILED, DHT_MSG_SYS_CALL_GET_TIME_FAILED,
+ DHT_MSG_NO_DISK_USAGE_STATUS, DHT_MSG_SUBVOL_DOWN_ERROR,
+ DHT_MSG_REBAL_THROTTLE_INFO, DHT_MSG_COMMIT_HASH_INFO,
+ DHT_MSG_REBAL_STRUCT_SET, DHT_MSG_HAS_MIGINFO, DHT_MSG_LOG_IPC_TIER_ERROR,
+ DHT_MSG_TIER_PAUSED, DHT_MSG_TIER_RESUME, DHT_MSG_SETTLE_HASH_FAILED,
+ DHT_MSG_DEFRAG_PROCESS_DIR_FAILED, DHT_MSG_FD_CTX_SET_FAILED,
+ DHT_MSG_STALE_LOOKUP, DHT_MSG_PARENT_LAYOUT_CHANGED,
+ DHT_MSG_LOCK_MIGRATION_FAILED, DHT_MSG_LOCK_INODE_UNREF_FAILED,
+ DHT_MSG_ASPRINTF_FAILED, DHT_MSG_DIR_LOOKUP_FAILED, DHT_MSG_INODELK_FAILED,
+ DHT_MSG_LOCK_FRAME_FAILED, DHT_MSG_LOCAL_LOCK_INIT_FAILED,
+ DHT_MSG_ENTRYLK_ERROR, DHT_MSG_INODELK_ERROR, DHT_MSG_LOC_FAILED,
+ DHT_MSG_UNKNOWN_FOP, DHT_MSG_MIGRATE_FILE_SKIPPED,
+ DHT_MSG_DIR_XATTR_HEAL_FAILED, DHT_MSG_HASHED_SUBVOL_DOWN,
+ DHT_MSG_NON_HASHED_SUBVOL_DOWN);
#endif /* _DHT_MESSAGES_H_ */
diff --git a/xlators/cluster/dht/src/tier-common.h b/xlators/cluster/dht/src/tier-common.h
index 26e01d7f141..b1ebaa8004d 100644
--- a/xlators/cluster/dht/src/tier-common.h
+++ b/xlators/cluster/dht/src/tier-common.h
@@ -12,57 +12,44 @@
#define _TIER_COMMON_H_
/* Function definitions */
int
-tier_create_unlink_stale_linkto_cbk (call_frame_t *frame, void *cookie,
- xlator_t *this, int op_ret, int op_errno,
- struct iatt *preparent,
- struct iatt *postparent, dict_t *xdata);
+tier_create_unlink_stale_linkto_cbk(call_frame_t *frame, void *cookie,
+ xlator_t *this, int op_ret, int op_errno,
+ struct iatt *preparent,
+ struct iatt *postparent, dict_t *xdata);
int
-tier_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int op_ret, int op_errno,
- fd_t *fd, inode_t *inode, struct iatt *stbuf,
- struct iatt *preparent, struct iatt *postparent,
- dict_t *xdata);
+tier_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret,
+ int op_errno, fd_t *fd, inode_t *inode, struct iatt *stbuf,
+ struct iatt *preparent, struct iatt *postparent, dict_t *xdata);
int
-tier_create_linkfile_create_cbk (call_frame_t *frame, void *cookie,
- xlator_t *this,
- int32_t op_ret, int32_t op_errno,
- inode_t *inode, struct iatt *stbuf,
- struct iatt *preparent,
- struct iatt *postparent,
- dict_t *xdata);
+tier_create_linkfile_create_cbk(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, inode_t *inode,
+ struct iatt *stbuf, struct iatt *preparent,
+ struct iatt *postparent, dict_t *xdata);
int
-tier_create (call_frame_t *frame, xlator_t *this,
- loc_t *loc, int32_t flags, mode_t mode,
- mode_t umask, fd_t *fd, dict_t *params);
+tier_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags,
+ mode_t mode, mode_t umask, fd_t *fd, dict_t *params);
int32_t
-tier_unlink (call_frame_t *frame, xlator_t *this,
- loc_t *loc, int xflag, dict_t *xdata);
+tier_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag,
+ dict_t *xdata);
int32_t
-tier_readdirp (call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- size_t size, off_t off, dict_t *dict);
+tier_readdirp(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
+ off_t off, dict_t *dict);
int
-tier_readdir (call_frame_t *frame,
- xlator_t *this, fd_t *fd, size_t size,
- off_t yoff, dict_t *xdata);
-
-
+tier_readdir(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
+ off_t yoff, dict_t *xdata);
int
-tier_link (call_frame_t *frame, xlator_t *this,
- loc_t *oldloc, loc_t *newloc, dict_t *xdata);
-
+tier_link(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc,
+ dict_t *xdata);
int
-tier_statfs (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata);
-
+tier_statfs(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata);
#endif
-
diff --git a/xlators/cluster/dht/src/tier.h b/xlators/cluster/dht/src/tier.h
index ce08fb5a669..f0ffdfcd769 100644
--- a/xlators/cluster/dht/src/tier.h
+++ b/xlators/cluster/dht/src/tier.h
@@ -11,7 +11,6 @@
#ifndef _TIER_H_
#define _TIER_H_
-
/******************************************************************************/
/* This is from dht-rebalancer.c as we don't have dht-rebalancer.h */
#include "dht-common.h"
@@ -33,80 +32,79 @@
#define PROMOTION_QFILE "promotequeryfile"
#define DEMOTION_QFILE "demotequeryfile"
-#define TIER_HASHED_SUBVOL conf->subvolumes[0]
-#define TIER_UNHASHED_SUBVOL conf->subvolumes[1]
+#define TIER_HASHED_SUBVOL conf->subvolumes[0]
+#define TIER_UNHASHED_SUBVOL conf->subvolumes[1]
-#define GET_QFILE_PATH(is_promotion)\
- (is_promotion) ? promotion_qfile : demotion_qfile
+#define GET_QFILE_PATH(is_promotion) \
+ (is_promotion) ? promotion_qfile : demotion_qfile
typedef struct tier_qfile_array {
- int *fd_array;
- ssize_t array_size;
- ssize_t next_index;
- /* Indicate the number of exhuasted FDs*/
- ssize_t exhausted_count;
+ int *fd_array;
+ ssize_t array_size;
+ ssize_t next_index;
+ /* Indicate the number of exhuasted FDs*/
+ ssize_t exhausted_count;
} tier_qfile_array_t;
-
typedef struct _query_cbk_args {
- xlator_t *this;
- gf_defrag_info_t *defrag;
- /* This is write */
- int query_fd;
- int is_promotion;
- int is_compaction;
- /* This is for read */
- tier_qfile_array_t *qfile_array;
+ xlator_t *this;
+ gf_defrag_info_t *defrag;
+ /* This is write */
+ int query_fd;
+ int is_promotion;
+ int is_compaction;
+ /* This is for read */
+ tier_qfile_array_t *qfile_array;
} query_cbk_args_t;
int
gf_run_tier(xlator_t *this, gf_defrag_info_t *defrag);
typedef struct gfdb_brick_info {
- gfdb_time_t *time_stamp;
- gf_boolean_t _gfdb_promote;
- query_cbk_args_t *_query_cbk_args;
+ gfdb_time_t *time_stamp;
+ gf_boolean_t _gfdb_promote;
+ query_cbk_args_t *_query_cbk_args;
} gfdb_brick_info_t;
typedef struct brick_list {
- xlator_t *xlator;
- char *brick_db_path;
- char brick_name[NAME_MAX];
- char qfile_path[PATH_MAX];
- struct list_head list;
+ xlator_t *xlator;
+ char *brick_db_path;
+ char brick_name[NAME_MAX];
+ char qfile_path[PATH_MAX];
+ struct list_head list;
} tier_brick_list_t;
typedef struct _dm_thread_args {
- xlator_t *this;
- gf_defrag_info_t *defrag;
- struct list_head *brick_list;
- int freq_time;
- int return_value;
- int is_promotion;
- int is_compaction;
- gf_boolean_t is_hot_tier;
+ xlator_t *this;
+ gf_defrag_info_t *defrag;
+ struct list_head *brick_list;
+ int freq_time;
+ int return_value;
+ int is_promotion;
+ int is_compaction;
+ gf_boolean_t is_hot_tier;
} migration_args_t;
typedef enum tier_watermark_op_ {
- TIER_WM_NONE = 0,
- TIER_WM_LOW,
- TIER_WM_HI,
- TIER_WM_MID
+ TIER_WM_NONE = 0,
+ TIER_WM_LOW,
+ TIER_WM_HI,
+ TIER_WM_MID
} tier_watermark_op_t;
-#define DEFAULT_PROMOTE_FREQ_SEC 120
-#define DEFAULT_DEMOTE_FREQ_SEC 120
-#define DEFAULT_HOT_COMPACT_FREQ_SEC 604800
-#define DEFAULT_COLD_COMPACT_FREQ_SEC 604800
-#define DEFAULT_DEMOTE_DEGRADED 1
-#define DEFAULT_WRITE_FREQ_SEC 0
-#define DEFAULT_READ_FREQ_SEC 0
-#define DEFAULT_WM_LOW 75
-#define DEFAULT_WM_HI 90
-#define DEFAULT_TIER_MODE TIER_MODE_TEST
-#define DEFAULT_COMP_MODE _gf_true
-#define DEFAULT_TIER_MAX_MIGRATE_MB 1000
+#define DEFAULT_PROMOTE_FREQ_SEC 120
+#define DEFAULT_DEMOTE_FREQ_SEC 120
+#define DEFAULT_HOT_COMPACT_FREQ_SEC 604800
+#define DEFAULT_COLD_COMPACT_FREQ_SEC 604800
+#define DEFAULT_DEMOTE_DEGRADED 1
+#define DEFAULT_WRITE_FREQ_SEC 0
+#define DEFAULT_READ_FREQ_SEC 0
+#define DEFAULT_WM_LOW 75
+#define DEFAULT_WM_HI 90
+#define DEFAULT_TIER_MODE TIER_MODE_TEST
+#define DEFAULT_COMP_MODE _gf_true
+#define DEFAULT_TIER_MAX_MIGRATE_MB 1000
#define DEFAULT_TIER_MAX_MIGRATE_FILES 5000
-#define DEFAULT_TIER_QUERY_LIMIT 100
+#define DEFAULT_TIER_QUERY_LIMIT 100
#endif
diff --git a/xlators/cluster/ec/src/ec-code-c.h b/xlators/cluster/ec/src/ec-code-c.h
index 92e8070e514..42b5a064eb8 100644
--- a/xlators/cluster/ec/src/ec-code-c.h
+++ b/xlators/cluster/ec/src/ec-code-c.h
@@ -13,12 +13,15 @@
#include "ec-types.h"
-void ec_code_c_prepare(ec_gf_t *gf, uint32_t *values, uint32_t count);
+void
+ec_code_c_prepare(ec_gf_t *gf, uint32_t *values, uint32_t count);
-void ec_code_c_linear(void *dst, void *src, uint64_t offset, uint32_t *values,
- uint32_t count);
+void
+ec_code_c_linear(void *dst, void *src, uint64_t offset, uint32_t *values,
+ uint32_t count);
-void ec_code_c_interleaved(void *dst, void **src, uint64_t offset,
- uint32_t *values, uint32_t count);
+void
+ec_code_c_interleaved(void *dst, void **src, uint64_t offset, uint32_t *values,
+ uint32_t count);
#endif /* __EC_CODE_C_H__ */
diff --git a/xlators/cluster/ec/src/ec-code-intel.h b/xlators/cluster/ec/src/ec-code-intel.h
index 903d023f962..3fa4a174765 100644
--- a/xlators/cluster/ec/src/ec-code-intel.h
+++ b/xlators/cluster/ec/src/ec-code-intel.h
@@ -76,109 +76,116 @@ enum _ec_code_vex_opcode {
struct _ec_code_intel_buffer {
uint32_t bytes;
union {
- uint8_t data[4];
+ uint8_t data[4];
uint32_t value;
};
};
struct _ec_code_intel_sib {
gf_boolean_t present;
- uint32_t base;
- uint32_t index;
- uint32_t scale;
+ uint32_t base;
+ uint32_t index;
+ uint32_t scale;
};
struct _ec_code_intel_modrm {
gf_boolean_t present;
- uint32_t mod;
- uint32_t rm;
- uint32_t reg;
+ uint32_t mod;
+ uint32_t rm;
+ uint32_t reg;
};
struct _ec_code_intel_rex {
gf_boolean_t present;
- uint32_t w;
- uint32_t r;
- uint32_t x;
- uint32_t b;
+ uint32_t w;
+ uint32_t r;
+ uint32_t x;
+ uint32_t b;
};
struct _ec_code_intel {
- gf_boolean_t invalid;
+ gf_boolean_t invalid;
ec_code_intel_buffer_t prefix;
ec_code_intel_buffer_t opcode;
ec_code_intel_buffer_t offset;
ec_code_intel_buffer_t immediate;
ec_code_intel_buffer_t vex;
- ec_code_intel_rex_t rex;
- ec_code_intel_modrm_t modrm;
- ec_code_intel_sib_t sib;
- uint32_t reg;
+ ec_code_intel_rex_t rex;
+ ec_code_intel_modrm_t modrm;
+ ec_code_intel_sib_t sib;
+ uint32_t reg;
};
-void ec_code_intel_op_push_r(ec_code_builder_t *builder,
- ec_code_intel_reg_t reg);
-void ec_code_intel_op_pop_r(ec_code_builder_t *builder,
- ec_code_intel_reg_t reg);
-void ec_code_intel_op_ret(ec_code_builder_t *builder, uint32_t size);
-
-void ec_code_intel_op_mov_r2r(ec_code_builder_t *builder,
- ec_code_intel_reg_t src,
- ec_code_intel_reg_t dst);
-void ec_code_intel_op_mov_r2m(ec_code_builder_t *builder,
- ec_code_intel_reg_t src,
- ec_code_intel_reg_t base,
- ec_code_intel_reg_t index, uint32_t scale,
- int32_t offset);
-void ec_code_intel_op_mov_m2r(ec_code_builder_t *builder,
- ec_code_intel_reg_t base,
- ec_code_intel_reg_t index, uint32_t scale,
- int32_t offset, ec_code_intel_reg_t dst);
-void ec_code_intel_op_xor_r2r(ec_code_builder_t *builder,
- ec_code_intel_reg_t src,
- ec_code_intel_reg_t dst);
-void ec_code_intel_op_xor_m2r(ec_code_builder_t *builder,
- ec_code_intel_reg_t base,
- ec_code_intel_reg_t index, uint32_t scale,
- int32_t offset, ec_code_intel_reg_t dst);
-void ec_code_intel_op_add_i2r(ec_code_builder_t *builder, int32_t value,
- ec_code_intel_reg_t reg);
-void ec_code_intel_op_test_i2r(ec_code_builder_t *builder, uint32_t value,
- ec_code_intel_reg_t reg);
-void ec_code_intel_op_jne(ec_code_builder_t *builder, uint32_t address);
-
-void ec_code_intel_op_mov_sse2sse(ec_code_builder_t *builder, uint32_t src,
- uint32_t dst);
-void ec_code_intel_op_mov_sse2m(ec_code_builder_t *builder, uint32_t src,
- ec_code_intel_reg_t base,
- ec_code_intel_reg_t index, uint32_t scale,
- int32_t offset);
-void ec_code_intel_op_mov_m2sse(ec_code_builder_t *builder,
- ec_code_intel_reg_t base,
- ec_code_intel_reg_t index, uint32_t scale,
- int32_t offset, uint32_t dst);
-void ec_code_intel_op_xor_sse2sse(ec_code_builder_t *builder, uint32_t src,
- uint32_t dst);
-void ec_code_intel_op_xor_m2sse(ec_code_builder_t *builder,
- ec_code_intel_reg_t base,
- ec_code_intel_reg_t index, uint32_t scale,
- int32_t offset, uint32_t dst);
-
-void ec_code_intel_op_mov_avx2avx(ec_code_builder_t *builder, uint32_t src,
- uint32_t dst);
-void ec_code_intel_op_mov_avx2m(ec_code_builder_t *builder, uint32_t src,
- ec_code_intel_reg_t base,
- ec_code_intel_reg_t index, uint32_t scale,
- int32_t offset);
-void ec_code_intel_op_mov_m2avx(ec_code_builder_t *builder,
- ec_code_intel_reg_t base,
- ec_code_intel_reg_t index, uint32_t scale,
- int32_t offset, uint32_t dst);
-void ec_code_intel_op_xor_avx2avx(ec_code_builder_t *builder, uint32_t src,
- uint32_t dst);
-void ec_code_intel_op_xor_m2avx(ec_code_builder_t *builder,
- ec_code_intel_reg_t base,
- ec_code_intel_reg_t index, uint32_t scale,
- int32_t offset, uint32_t dst);
+void
+ec_code_intel_op_push_r(ec_code_builder_t *builder, ec_code_intel_reg_t reg);
+void
+ec_code_intel_op_pop_r(ec_code_builder_t *builder, ec_code_intel_reg_t reg);
+void
+ec_code_intel_op_ret(ec_code_builder_t *builder, uint32_t size);
+
+void
+ec_code_intel_op_mov_r2r(ec_code_builder_t *builder, ec_code_intel_reg_t src,
+ ec_code_intel_reg_t dst);
+void
+ec_code_intel_op_mov_r2m(ec_code_builder_t *builder, ec_code_intel_reg_t src,
+ ec_code_intel_reg_t base, ec_code_intel_reg_t index,
+ uint32_t scale, int32_t offset);
+void
+ec_code_intel_op_mov_m2r(ec_code_builder_t *builder, ec_code_intel_reg_t base,
+ ec_code_intel_reg_t index, uint32_t scale,
+ int32_t offset, ec_code_intel_reg_t dst);
+void
+ec_code_intel_op_xor_r2r(ec_code_builder_t *builder, ec_code_intel_reg_t src,
+ ec_code_intel_reg_t dst);
+void
+ec_code_intel_op_xor_m2r(ec_code_builder_t *builder, ec_code_intel_reg_t base,
+ ec_code_intel_reg_t index, uint32_t scale,
+ int32_t offset, ec_code_intel_reg_t dst);
+void
+ec_code_intel_op_add_i2r(ec_code_builder_t *builder, int32_t value,
+ ec_code_intel_reg_t reg);
+void
+ec_code_intel_op_test_i2r(ec_code_builder_t *builder, uint32_t value,
+ ec_code_intel_reg_t reg);
+void
+ec_code_intel_op_jne(ec_code_builder_t *builder, uint32_t address);
+
+void
+ec_code_intel_op_mov_sse2sse(ec_code_builder_t *builder, uint32_t src,
+ uint32_t dst);
+void
+ec_code_intel_op_mov_sse2m(ec_code_builder_t *builder, uint32_t src,
+ ec_code_intel_reg_t base, ec_code_intel_reg_t index,
+ uint32_t scale, int32_t offset);
+void
+ec_code_intel_op_mov_m2sse(ec_code_builder_t *builder, ec_code_intel_reg_t base,
+ ec_code_intel_reg_t index, uint32_t scale,
+ int32_t offset, uint32_t dst);
+void
+ec_code_intel_op_xor_sse2sse(ec_code_builder_t *builder, uint32_t src,
+ uint32_t dst);
+void
+ec_code_intel_op_xor_m2sse(ec_code_builder_t *builder, ec_code_intel_reg_t base,
+ ec_code_intel_reg_t index, uint32_t scale,
+ int32_t offset, uint32_t dst);
+
+void
+ec_code_intel_op_mov_avx2avx(ec_code_builder_t *builder, uint32_t src,
+ uint32_t dst);
+void
+ec_code_intel_op_mov_avx2m(ec_code_builder_t *builder, uint32_t src,
+ ec_code_intel_reg_t base, ec_code_intel_reg_t index,
+ uint32_t scale, int32_t offset);
+void
+ec_code_intel_op_mov_m2avx(ec_code_builder_t *builder, ec_code_intel_reg_t base,
+ ec_code_intel_reg_t index, uint32_t scale,
+ int32_t offset, uint32_t dst);
+void
+ec_code_intel_op_xor_avx2avx(ec_code_builder_t *builder, uint32_t src,
+ uint32_t dst);
+void
+ec_code_intel_op_xor_m2avx(ec_code_builder_t *builder, ec_code_intel_reg_t base,
+ ec_code_intel_reg_t index, uint32_t scale,
+ int32_t offset, uint32_t dst);
#endif /* __EC_CODE_INTEL_H__ */
diff --git a/xlators/cluster/ec/src/ec-combine.h b/xlators/cluster/ec/src/ec-combine.h
index 19a42ded706..1010cc3be26 100644
--- a/xlators/cluster/ec/src/ec-combine.h
+++ b/xlators/cluster/ec/src/ec-combine.h
@@ -11,28 +11,34 @@
#ifndef __EC_COMBINE_H__
#define __EC_COMBINE_H__
-#define EC_COMBINE_DICT 0
+#define EC_COMBINE_DICT 0
#define EC_COMBINE_XDATA 1
-typedef int32_t (* ec_combine_f)(ec_fop_data_t * fop, ec_cbk_data_t * dst,
- ec_cbk_data_t * src);
+typedef int32_t (*ec_combine_f)(ec_fop_data_t *fop, ec_cbk_data_t *dst,
+ ec_cbk_data_t *src);
-void ec_iatt_rebuild(ec_t * ec, struct iatt * iatt, int32_t count,
- int32_t answers);
+void
+ec_iatt_rebuild(ec_t *ec, struct iatt *iatt, int32_t count, int32_t answers);
-int32_t ec_iatt_combine(ec_fop_data_t *fop, struct iatt *dst, struct iatt *src,
- int32_t count);
-int32_t ec_dict_compare(dict_t * dict1, dict_t * dict2);
-int32_t ec_vector_compare(struct iovec * dst_vector, int32_t dst_count,
- struct iovec * src_vector, int32_t src_count);
-int32_t ec_flock_compare(struct gf_flock * dst, struct gf_flock * src);
-void ec_statvfs_combine(struct statvfs * dst, struct statvfs * src);
+int32_t
+ec_iatt_combine(ec_fop_data_t *fop, struct iatt *dst, struct iatt *src,
+ int32_t count);
+int32_t
+ec_dict_compare(dict_t *dict1, dict_t *dict2);
+int32_t
+ec_vector_compare(struct iovec *dst_vector, int32_t dst_count,
+ struct iovec *src_vector, int32_t src_count);
+int32_t
+ec_flock_compare(struct gf_flock *dst, struct gf_flock *src);
+void
+ec_statvfs_combine(struct statvfs *dst, struct statvfs *src);
-int32_t ec_dict_combine(ec_cbk_data_t * cbk, int32_t which);
+int32_t
+ec_dict_combine(ec_cbk_data_t *cbk, int32_t which);
-void ec_combine(ec_cbk_data_t * cbk, ec_combine_f combine);
+void
+ec_combine(ec_cbk_data_t *cbk, ec_combine_f combine);
int32_t
-ec_combine_write (ec_fop_data_t *fop, ec_cbk_data_t *dst,
- ec_cbk_data_t *src);
+ec_combine_write(ec_fop_data_t *fop, ec_cbk_data_t *dst, ec_cbk_data_t *src);
#endif /* __EC_COMBINE_H__ */
diff --git a/xlators/cluster/ec/src/ec-common.h b/xlators/cluster/ec/src/ec-common.h
index a92752952ad..bea0c045a47 100644
--- a/xlators/cluster/ec/src/ec-common.h
+++ b/xlators/cluster/ec/src/ec-common.h
@@ -15,29 +15,26 @@
#include "ec-data.h"
-typedef enum {
- EC_DATA_TXN,
- EC_METADATA_TXN
-} ec_txn_t;
+typedef enum { EC_DATA_TXN, EC_METADATA_TXN } ec_txn_t;
-#define EC_FOP_HEAL -1
-#define EC_FOP_FHEAL -2
+#define EC_FOP_HEAL -1
+#define EC_FOP_FHEAL -2
#define EC_CONFIG_VERSION 0
#define EC_CONFIG_ALGORITHM 0
-#define EC_FLAG_LOCK_SHARED 0x0001
+#define EC_FLAG_LOCK_SHARED 0x0001
enum _ec_xattrop_flags {
- EC_FLAG_XATTROP,
- EC_FLAG_DATA_DIRTY,
- EC_FLAG_METADATA_DIRTY,
+ EC_FLAG_XATTROP,
+ EC_FLAG_DATA_DIRTY,
+ EC_FLAG_METADATA_DIRTY,
- /* Add any new flag here, before EC_FLAG_MAX. The maximum number of
- * flags that can be defined is 16. */
+ /* Add any new flag here, before EC_FLAG_MAX. The maximum number of
+ * flags that can be defined is 16. */
- EC_FLAG_MAX
+ EC_FLAG_MAX
};
/* We keep two sets of flags. One to determine what's really providing the
@@ -57,57 +54,63 @@ enum _ec_xattrop_flags {
#define EC_SELFHEAL_BIT 62
-#define EC_MINIMUM_ONE -1
-#define EC_MINIMUM_MIN -2
-#define EC_MINIMUM_ALL -3
-
-#define EC_UPDATE_DATA 1
-#define EC_UPDATE_META 2
-#define EC_QUERY_INFO 4
-#define EC_INODE_SIZE 8
-
-#define EC_STATE_START 0
-#define EC_STATE_END 0
-#define EC_STATE_INIT 1
-#define EC_STATE_LOCK 2
-#define EC_STATE_DISPATCH 3
-#define EC_STATE_PREPARE_ANSWER 4
-#define EC_STATE_REPORT 5
-#define EC_STATE_LOCK_REUSE 6
-#define EC_STATE_UNLOCK 7
-
-#define EC_STATE_DELAYED_START 100
-
-#define EC_STATE_HEAL_ENTRY_LOOKUP 200
-#define EC_STATE_HEAL_ENTRY_PREPARE 201
-#define EC_STATE_HEAL_PRE_INODELK_LOCK 202
-#define EC_STATE_HEAL_PRE_INODE_LOOKUP 203
-#define EC_STATE_HEAL_XATTRIBUTES_REMOVE 204
-#define EC_STATE_HEAL_XATTRIBUTES_SET 205
-#define EC_STATE_HEAL_ATTRIBUTES 206
-#define EC_STATE_HEAL_OPEN 207
-#define EC_STATE_HEAL_REOPEN_FD 208
-#define EC_STATE_HEAL_UNLOCK 209
-#define EC_STATE_HEAL_UNLOCK_ENTRY 210
-#define EC_STATE_HEAL_DATA_LOCK 211
-#define EC_STATE_HEAL_DATA_COPY 212
-#define EC_STATE_HEAL_DATA_UNLOCK 213
-#define EC_STATE_HEAL_POST_INODELK_LOCK 214
-#define EC_STATE_HEAL_POST_INODE_LOOKUP 215
-#define EC_STATE_HEAL_SETATTR 216
-#define EC_STATE_HEAL_POST_INODELK_UNLOCK 217
-#define EC_STATE_HEAL_DISPATCH 218
-
-gf_boolean_t ec_dispatch_one_retry (ec_fop_data_t *fop, ec_cbk_data_t **cbk);
-void ec_dispatch_next(ec_fop_data_t * fop, uint32_t idx);
-
-void ec_complete(ec_fop_data_t *fop);
-
-void ec_update_good(ec_fop_data_t *fop, uintptr_t good);
-
-void ec_fop_set_error(ec_fop_data_t *fop, int32_t error);
-
-void __ec_fop_set_error(ec_fop_data_t *fop, int32_t error);
+#define EC_MINIMUM_ONE -1
+#define EC_MINIMUM_MIN -2
+#define EC_MINIMUM_ALL -3
+
+#define EC_UPDATE_DATA 1
+#define EC_UPDATE_META 2
+#define EC_QUERY_INFO 4
+#define EC_INODE_SIZE 8
+
+#define EC_STATE_START 0
+#define EC_STATE_END 0
+#define EC_STATE_INIT 1
+#define EC_STATE_LOCK 2
+#define EC_STATE_DISPATCH 3
+#define EC_STATE_PREPARE_ANSWER 4
+#define EC_STATE_REPORT 5
+#define EC_STATE_LOCK_REUSE 6
+#define EC_STATE_UNLOCK 7
+
+#define EC_STATE_DELAYED_START 100
+
+#define EC_STATE_HEAL_ENTRY_LOOKUP 200
+#define EC_STATE_HEAL_ENTRY_PREPARE 201
+#define EC_STATE_HEAL_PRE_INODELK_LOCK 202
+#define EC_STATE_HEAL_PRE_INODE_LOOKUP 203
+#define EC_STATE_HEAL_XATTRIBUTES_REMOVE 204
+#define EC_STATE_HEAL_XATTRIBUTES_SET 205
+#define EC_STATE_HEAL_ATTRIBUTES 206
+#define EC_STATE_HEAL_OPEN 207
+#define EC_STATE_HEAL_REOPEN_FD 208
+#define EC_STATE_HEAL_UNLOCK 209
+#define EC_STATE_HEAL_UNLOCK_ENTRY 210
+#define EC_STATE_HEAL_DATA_LOCK 211
+#define EC_STATE_HEAL_DATA_COPY 212
+#define EC_STATE_HEAL_DATA_UNLOCK 213
+#define EC_STATE_HEAL_POST_INODELK_LOCK 214
+#define EC_STATE_HEAL_POST_INODE_LOOKUP 215
+#define EC_STATE_HEAL_SETATTR 216
+#define EC_STATE_HEAL_POST_INODELK_UNLOCK 217
+#define EC_STATE_HEAL_DISPATCH 218
+
+gf_boolean_t
+ec_dispatch_one_retry(ec_fop_data_t *fop, ec_cbk_data_t **cbk);
+void
+ec_dispatch_next(ec_fop_data_t *fop, uint32_t idx);
+
+void
+ec_complete(ec_fop_data_t *fop);
+
+void
+ec_update_good(ec_fop_data_t *fop, uintptr_t good);
+
+void
+ec_fop_set_error(ec_fop_data_t *fop, int32_t error);
+
+void
+__ec_fop_set_error(ec_fop_data_t *fop, int32_t error);
ec_cbk_data_t *
ec_fop_prepare_answer(ec_fop_data_t *fop, gf_boolean_t ro);
@@ -115,55 +118,73 @@ ec_fop_prepare_answer(ec_fop_data_t *fop, gf_boolean_t ro);
gf_boolean_t
ec_cbk_set_error(ec_cbk_data_t *cbk, int32_t error, gf_boolean_t ro);
-void ec_lock_prepare_inode(ec_fop_data_t *fop, loc_t *loc, uint32_t flags,
- off_t fl_start, size_t fl_size);
-void ec_lock_prepare_parent_inode(ec_fop_data_t *fop, loc_t *loc, loc_t *base,
- uint32_t flags);
-void ec_lock_prepare_fd(ec_fop_data_t *fop, fd_t *fd, uint32_t flags,
- off_t fl_start, size_t fl_size);
-void ec_lock(ec_fop_data_t * fop);
-void ec_lock_reuse(ec_fop_data_t *fop);
-void ec_unlock(ec_fop_data_t * fop);
-void ec_lock_release(ec_t *ec, inode_t *inode);
-
-gf_boolean_t ec_get_inode_size(ec_fop_data_t *fop, inode_t *inode,
- uint64_t *size);
-gf_boolean_t __ec_get_inode_size(ec_fop_data_t *fop, inode_t *inode,
- uint64_t *size);
-gf_boolean_t ec_set_inode_size(ec_fop_data_t *fop, inode_t *inode,
- uint64_t size);
-gf_boolean_t __ec_set_inode_size(ec_fop_data_t *fop, inode_t *inode,
- uint64_t size);
-void ec_clear_inode_info(ec_fop_data_t *fop, inode_t *inode);
-
-void ec_flush_size_version(ec_fop_data_t * fop);
-
-void ec_dispatch_all(ec_fop_data_t * fop);
-void ec_dispatch_inc(ec_fop_data_t * fop);
-void ec_dispatch_min(ec_fop_data_t * fop);
-void ec_dispatch_one(ec_fop_data_t * fop);
-
-void ec_sleep(ec_fop_data_t *fop);
-void ec_resume(ec_fop_data_t * fop, int32_t error);
-void ec_resume_parent(ec_fop_data_t * fop, int32_t error);
-
-void ec_manager(ec_fop_data_t * fop, int32_t error);
-gf_boolean_t ec_is_recoverable_error (int32_t op_errno);
-void ec_handle_healers_done (ec_fop_data_t *fop);
+void
+ec_lock_prepare_inode(ec_fop_data_t *fop, loc_t *loc, uint32_t flags,
+ off_t fl_start, size_t fl_size);
+void
+ec_lock_prepare_parent_inode(ec_fop_data_t *fop, loc_t *loc, loc_t *base,
+ uint32_t flags);
+void
+ec_lock_prepare_fd(ec_fop_data_t *fop, fd_t *fd, uint32_t flags, off_t fl_start,
+ size_t fl_size);
+void
+ec_lock(ec_fop_data_t *fop);
+void
+ec_lock_reuse(ec_fop_data_t *fop);
+void
+ec_unlock(ec_fop_data_t *fop);
+void
+ec_lock_release(ec_t *ec, inode_t *inode);
+
+gf_boolean_t
+ec_get_inode_size(ec_fop_data_t *fop, inode_t *inode, uint64_t *size);
+gf_boolean_t
+__ec_get_inode_size(ec_fop_data_t *fop, inode_t *inode, uint64_t *size);
+gf_boolean_t
+ec_set_inode_size(ec_fop_data_t *fop, inode_t *inode, uint64_t size);
+gf_boolean_t
+__ec_set_inode_size(ec_fop_data_t *fop, inode_t *inode, uint64_t size);
+void
+ec_clear_inode_info(ec_fop_data_t *fop, inode_t *inode);
+
+void
+ec_flush_size_version(ec_fop_data_t *fop);
+
+void
+ec_dispatch_all(ec_fop_data_t *fop);
+void
+ec_dispatch_inc(ec_fop_data_t *fop);
+void
+ec_dispatch_min(ec_fop_data_t *fop);
+void
+ec_dispatch_one(ec_fop_data_t *fop);
+
+void
+ec_sleep(ec_fop_data_t *fop);
+void
+ec_resume(ec_fop_data_t *fop, int32_t error);
+void
+ec_resume_parent(ec_fop_data_t *fop, int32_t error);
+
+void
+ec_manager(ec_fop_data_t *fop, int32_t error);
+gf_boolean_t
+ec_is_recoverable_error(int32_t op_errno);
+void
+ec_handle_healers_done(ec_fop_data_t *fop);
int32_t
-ec_heal_inspect (call_frame_t *frame, ec_t *ec,
- inode_t *inode, unsigned char *locked_on,
- gf_boolean_t self_locked, gf_boolean_t thorough,
- ec_heal_need_t *need_heal);
+ec_heal_inspect(call_frame_t *frame, ec_t *ec, inode_t *inode,
+ unsigned char *locked_on, gf_boolean_t self_locked,
+ gf_boolean_t thorough, ec_heal_need_t *need_heal);
int32_t
-ec_get_heal_info (xlator_t *this, loc_t *loc, dict_t **dict);
+ec_get_heal_info(xlator_t *this, loc_t *loc, dict_t **dict);
-int32_t ec_lock_unlocked(call_frame_t *frame, void *cookie,
- xlator_t *this, int32_t op_ret, int32_t op_errno,
- dict_t *xdata);
+int32_t
+ec_lock_unlocked(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *xdata);
void
-ec_update_fd_status (fd_t *fd, xlator_t *xl,
- int child_index, int32_t ret_status);
+ec_update_fd_status(fd_t *fd, xlator_t *xl, int child_index,
+ int32_t ret_status);
#endif /* __EC_COMMON_H__ */
diff --git a/xlators/cluster/ec/src/ec-data.h b/xlators/cluster/ec/src/ec-data.h
index 965bc1e25ef..112536d554c 100644
--- a/xlators/cluster/ec/src/ec-data.h
+++ b/xlators/cluster/ec/src/ec-data.h
@@ -13,20 +13,23 @@
#include "ec-types.h"
-ec_cbk_data_t * ec_cbk_data_allocate(call_frame_t * frame, xlator_t * this,
- ec_fop_data_t * fop, int32_t id,
- int32_t idx, int32_t op_ret,
- int32_t op_errno);
-ec_fop_data_t * ec_fop_data_allocate(call_frame_t * frame, xlator_t * this,
- int32_t id, uint32_t flags,
- uintptr_t target, int32_t minimum,
- ec_wind_f wind, ec_handler_f handler,
- ec_cbk_t cbks, void * data);
-void ec_fop_data_acquire(ec_fop_data_t * fop);
-void ec_fop_data_release(ec_fop_data_t * fop);
+ec_cbk_data_t *
+ec_cbk_data_allocate(call_frame_t *frame, xlator_t *this, ec_fop_data_t *fop,
+ int32_t id, int32_t idx, int32_t op_ret, int32_t op_errno);
+ec_fop_data_t *
+ec_fop_data_allocate(call_frame_t *frame, xlator_t *this, int32_t id,
+ uint32_t flags, uintptr_t target, int32_t minimum,
+ ec_wind_f wind, ec_handler_f handler, ec_cbk_t cbks,
+ void *data);
+void
+ec_fop_data_acquire(ec_fop_data_t *fop);
+void
+ec_fop_data_release(ec_fop_data_t *fop);
-void ec_fop_cleanup(ec_fop_data_t *fop);
+void
+ec_fop_cleanup(ec_fop_data_t *fop);
-void ec_pending_fops_completed(ec_t *ec);
+void
+ec_pending_fops_completed(ec_t *ec);
#endif /* __EC_DATA_H__ */
diff --git a/xlators/cluster/ec/src/ec-fops.h b/xlators/cluster/ec/src/ec-fops.h
index 4a926cf4802..2858d829c73 100644
--- a/xlators/cluster/ec/src/ec-fops.h
+++ b/xlators/cluster/ec/src/ec-fops.h
@@ -16,199 +16,235 @@
#include "ec-types.h"
#include "ec-common.h"
-void ec_access(call_frame_t * frame, xlator_t * this, uintptr_t target,
- int32_t minimum, fop_access_cbk_t func, void *data, loc_t * loc,
- int32_t mask, dict_t * xdata);
-
-void ec_create(call_frame_t * frame, xlator_t * this, uintptr_t target,
- int32_t minimum, fop_create_cbk_t func, void *data, loc_t * loc,
- int32_t flags, mode_t mode, mode_t umask, fd_t * fd,
- dict_t * xdata);
-
-void ec_entrylk(call_frame_t * frame, xlator_t * this, uintptr_t target,
- int32_t minimum, fop_entrylk_cbk_t func, void *data,
- const char * volume, loc_t * loc, const char * basename,
- entrylk_cmd cmd, entrylk_type type, dict_t * xdata);
-
-void ec_fentrylk(call_frame_t * frame, xlator_t * this, uintptr_t target,
- int32_t minimum, fop_fentrylk_cbk_t func, void *data,
- const char * volume, fd_t * fd, const char * basename,
- entrylk_cmd cmd, entrylk_type type, dict_t * xdata);
-
-void ec_flush(call_frame_t * frame, xlator_t * this, uintptr_t target,
- int32_t minimum, fop_flush_cbk_t func, void *data, fd_t * fd,
- dict_t * xdata);
-
-void ec_fsync(call_frame_t * frame, xlator_t * this, uintptr_t target,
- int32_t minimum, fop_fsync_cbk_t func, void *data, fd_t * fd,
- int32_t datasync, dict_t * xdata);
-
-void ec_fsyncdir(call_frame_t * frame, xlator_t * this, uintptr_t target,
- int32_t minimum, fop_fsyncdir_cbk_t func, void *data,
- fd_t * fd, int32_t datasync, dict_t * xdata);
-
-void ec_getxattr(call_frame_t * frame, xlator_t * this, uintptr_t target,
- int32_t minimum, fop_getxattr_cbk_t func, void *data,
- loc_t * loc, const char * name, dict_t * xdata);
-
-void ec_fgetxattr(call_frame_t * frame, xlator_t * this, uintptr_t target,
- int32_t minimum, fop_fgetxattr_cbk_t func, void *data,
- fd_t * fd, const char * name, dict_t * xdata);
-
-void ec_heal(call_frame_t * frame, xlator_t * this, uintptr_t target,
- int32_t minimum, fop_heal_cbk_t func, void *data, loc_t * loc,
- int32_t partial, dict_t *xdata);
-
-void ec_fheal(call_frame_t * frame, xlator_t * this, uintptr_t target,
- int32_t minimum, fop_fheal_cbk_t func, void *data, fd_t * fd,
- int32_t partial, dict_t *xdata);
-
-void ec_inodelk (call_frame_t *frame, xlator_t *this, gf_lkowner_t *owner,
- uintptr_t target, int32_t minimum, fop_inodelk_cbk_t func,
- void *data, const char *volume, loc_t *loc, int32_t cmd,
- struct gf_flock * flock, dict_t * xdata);
-
-void ec_finodelk(call_frame_t *frame, xlator_t *this, gf_lkowner_t *owner,
- uintptr_t target, int32_t minimum, fop_finodelk_cbk_t func,
- void *data, const char *volume, fd_t *fd, int32_t cmd,
- struct gf_flock *flock, dict_t *xdata);
-
-void ec_link(call_frame_t * frame, xlator_t * this, uintptr_t target,
- int32_t minimum, fop_link_cbk_t func, void *data, loc_t * oldloc,
- loc_t * newloc, dict_t * xdata);
-
-void ec_lk(call_frame_t * frame, xlator_t * this, uintptr_t target,
- int32_t minimum, fop_lk_cbk_t func, void *data, fd_t * fd,
- int32_t cmd, struct gf_flock * flock, dict_t * xdata);
-
-void ec_lookup(call_frame_t * frame, xlator_t * this, uintptr_t target,
- int32_t minimum, fop_lookup_cbk_t func, void *data, loc_t * loc,
- dict_t * xdata);
-
-void ec_mkdir(call_frame_t * frame, xlator_t * this, uintptr_t target,
- int32_t minimum, fop_mkdir_cbk_t func, void *data, loc_t * loc,
- mode_t mode, mode_t umask, dict_t * xdata);
-
-void ec_mknod(call_frame_t * frame, xlator_t * this, uintptr_t target,
- int32_t minimum, fop_mknod_cbk_t func, void *data, loc_t * loc,
- mode_t mode, dev_t rdev, mode_t umask, dict_t * xdata);
-
-void ec_open(call_frame_t * frame, xlator_t * this, uintptr_t target,
- int32_t minimum, fop_open_cbk_t func, void *data, loc_t * loc,
- int32_t flags, fd_t * fd, dict_t * xdata);
-
-void ec_opendir(call_frame_t * frame, xlator_t * this, uintptr_t target,
- int32_t minimum, fop_opendir_cbk_t func, void *data,
- loc_t * loc, fd_t * fd, dict_t * xdata);
-
-void ec_readdir(call_frame_t * frame, xlator_t * this, uintptr_t target,
- int32_t minimum, fop_readdir_cbk_t func, void *data, fd_t * fd,
- size_t size, off_t offset, dict_t * xdata);
-
-void ec_readdirp(call_frame_t * frame, xlator_t * this, uintptr_t target,
- int32_t minimum, fop_readdirp_cbk_t func, void *data,
- fd_t * fd, size_t size, off_t offset, dict_t * xdata);
-
-void ec_readlink(call_frame_t * frame, xlator_t * this, uintptr_t target,
- int32_t minimum, fop_readlink_cbk_t func, void *data,
- loc_t * loc, size_t size, dict_t * xdata);
-
-void ec_readv(call_frame_t * frame, xlator_t * this, uintptr_t target,
- int32_t minimum, fop_readv_cbk_t func, void *data, fd_t * fd,
- size_t size, off_t offset, uint32_t flags, dict_t * xdata);
-
-void ec_removexattr(call_frame_t * frame, xlator_t * this, uintptr_t target,
- int32_t minimum, fop_removexattr_cbk_t func, void *data,
- loc_t * loc, const char * name, dict_t * xdata);
-
-void ec_fremovexattr(call_frame_t * frame, xlator_t * this, uintptr_t target,
- int32_t minimum, fop_fremovexattr_cbk_t func, void *data,
- fd_t * fd, const char * name, dict_t * xdata);
-
-void ec_rename(call_frame_t * frame, xlator_t * this, uintptr_t target,
- int32_t minimum, fop_rename_cbk_t func, void *data,
- loc_t * oldloc, loc_t * newloc, dict_t * xdata);
-
-void ec_rmdir(call_frame_t * frame, xlator_t * this, uintptr_t target,
- int32_t minimum, fop_rmdir_cbk_t func, void *data, loc_t * loc,
- int xflags, dict_t * xdata);
-
-void ec_setattr(call_frame_t * frame, xlator_t * this, uintptr_t target,
- int32_t minimum, fop_setattr_cbk_t func, void *data,
- loc_t * loc, struct iatt * stbuf, int32_t valid,
- dict_t * xdata);
-
-void ec_fsetattr(call_frame_t * frame, xlator_t * this, uintptr_t target,
- int32_t minimum, fop_fsetattr_cbk_t func, void *data,
- fd_t * fd, struct iatt * stbuf, int32_t valid,
- dict_t * xdata);
-
-void ec_setxattr(call_frame_t * frame, xlator_t * this, uintptr_t target,
- int32_t minimum, fop_setxattr_cbk_t func, void *data,
- loc_t * loc, dict_t * dict, int32_t flags, dict_t * xdata);
-
-void ec_fsetxattr(call_frame_t * frame, xlator_t * this, uintptr_t target,
- int32_t minimum, fop_fsetxattr_cbk_t func, void *data,
- fd_t * fd, dict_t * dict, int32_t flags, dict_t * xdata);
-
-void ec_stat(call_frame_t * frame, xlator_t * this, uintptr_t target,
- int32_t minimum, fop_stat_cbk_t func, void *data, loc_t * loc,
- dict_t * xdata);
-
-void ec_fstat(call_frame_t * frame, xlator_t * this, uintptr_t target,
- int32_t minimum, fop_fstat_cbk_t func, void *data, fd_t * fd,
- dict_t * xdata);
-
-void ec_statfs(call_frame_t * frame, xlator_t * this, uintptr_t target,
- int32_t minimum, fop_statfs_cbk_t func, void *data, loc_t * loc,
- dict_t * xdata);
-
-void ec_symlink(call_frame_t * frame, xlator_t * this, uintptr_t target,
- int32_t minimum, fop_symlink_cbk_t func, void *data,
- const char * linkname, loc_t * loc, mode_t umask,
- dict_t * xdata);
-
-void ec_fallocate(call_frame_t *frame, xlator_t *this, uintptr_t target,
- int32_t minimum, fop_fallocate_cbk_t func, void *data, fd_t *fd,
- int32_t mode, off_t offset, size_t len, dict_t *xdata);
-
-void ec_discard(call_frame_t *frame, xlator_t *this, uintptr_t target,
- int32_t minimum, fop_discard_cbk_t func, void *data, fd_t *fd,
- off_t offset, size_t len, dict_t *xdata);
-
-void ec_truncate(call_frame_t * frame, xlator_t * this, uintptr_t target,
- int32_t minimum, fop_truncate_cbk_t func, void *data,
- loc_t * loc, off_t offset, dict_t * xdata);
-
-void ec_ftruncate(call_frame_t * frame, xlator_t * this, uintptr_t target,
- int32_t minimum, fop_ftruncate_cbk_t func, void *data,
- fd_t * fd, off_t offset, dict_t * xdata);
-
-void ec_unlink(call_frame_t * frame, xlator_t * this, uintptr_t target,
- int32_t minimum, fop_unlink_cbk_t func, void *data, loc_t * loc,
- int xflags, dict_t * xdata);
-
-void ec_writev(call_frame_t * frame, xlator_t * this, uintptr_t target,
- int32_t minimum, fop_writev_cbk_t func, void *data, fd_t * fd,
- struct iovec * vector, int32_t count, off_t offset,
- uint32_t flags, struct iobref * iobref, dict_t * xdata);
-
-void ec_xattrop(call_frame_t * frame, xlator_t * this, uintptr_t target,
- int32_t minimum, fop_xattrop_cbk_t func, void *data,
- loc_t * loc, gf_xattrop_flags_t optype, dict_t * xattr,
- dict_t * xdata);
-
-void ec_fxattrop(call_frame_t * frame, xlator_t * this, uintptr_t target,
- int32_t minimum, fop_fxattrop_cbk_t func, void *data,
- fd_t * fd, gf_xattrop_flags_t optype, dict_t * xattr,
- dict_t * xdata);
-
-void ec_seek(call_frame_t *frame, xlator_t *this, uintptr_t target,
- int32_t minimum, fop_seek_cbk_t func, void *data, fd_t *fd,
- off_t offset, gf_seek_what_t what, dict_t *xdata);
-
-void ec_ipc(call_frame_t *frame, xlator_t *this, uintptr_t target,
- int32_t minimum, fop_ipc_cbk_t func, void *data, int32_t op,
- dict_t *xdata);
+void
+ec_access(call_frame_t *frame, xlator_t *this, uintptr_t target,
+ int32_t minimum, fop_access_cbk_t func, void *data, loc_t *loc,
+ int32_t mask, dict_t *xdata);
+
+void
+ec_create(call_frame_t *frame, xlator_t *this, uintptr_t target,
+ int32_t minimum, fop_create_cbk_t func, void *data, loc_t *loc,
+ int32_t flags, mode_t mode, mode_t umask, fd_t *fd, dict_t *xdata);
+
+void
+ec_entrylk(call_frame_t *frame, xlator_t *this, uintptr_t target,
+ int32_t minimum, fop_entrylk_cbk_t func, void *data,
+ const char *volume, loc_t *loc, const char *basename,
+ entrylk_cmd cmd, entrylk_type type, dict_t *xdata);
+
+void
+ec_fentrylk(call_frame_t *frame, xlator_t *this, uintptr_t target,
+ int32_t minimum, fop_fentrylk_cbk_t func, void *data,
+ const char *volume, fd_t *fd, const char *basename, entrylk_cmd cmd,
+ entrylk_type type, dict_t *xdata);
+
+void
+ec_flush(call_frame_t *frame, xlator_t *this, uintptr_t target, int32_t minimum,
+ fop_flush_cbk_t func, void *data, fd_t *fd, dict_t *xdata);
+
+void
+ec_fsync(call_frame_t *frame, xlator_t *this, uintptr_t target, int32_t minimum,
+ fop_fsync_cbk_t func, void *data, fd_t *fd, int32_t datasync,
+ dict_t *xdata);
+
+void
+ec_fsyncdir(call_frame_t *frame, xlator_t *this, uintptr_t target,
+ int32_t minimum, fop_fsyncdir_cbk_t func, void *data, fd_t *fd,
+ int32_t datasync, dict_t *xdata);
+
+void
+ec_getxattr(call_frame_t *frame, xlator_t *this, uintptr_t target,
+ int32_t minimum, fop_getxattr_cbk_t func, void *data, loc_t *loc,
+ const char *name, dict_t *xdata);
+
+void
+ec_fgetxattr(call_frame_t *frame, xlator_t *this, uintptr_t target,
+ int32_t minimum, fop_fgetxattr_cbk_t func, void *data, fd_t *fd,
+ const char *name, dict_t *xdata);
+
+void
+ec_heal(call_frame_t *frame, xlator_t *this, uintptr_t target, int32_t minimum,
+ fop_heal_cbk_t func, void *data, loc_t *loc, int32_t partial,
+ dict_t *xdata);
+
+void
+ec_fheal(call_frame_t *frame, xlator_t *this, uintptr_t target, int32_t minimum,
+ fop_fheal_cbk_t func, void *data, fd_t *fd, int32_t partial,
+ dict_t *xdata);
+
+void
+ec_inodelk(call_frame_t *frame, xlator_t *this, gf_lkowner_t *owner,
+ uintptr_t target, int32_t minimum, fop_inodelk_cbk_t func,
+ void *data, const char *volume, loc_t *loc, int32_t cmd,
+ struct gf_flock *flock, dict_t *xdata);
+
+void
+ec_finodelk(call_frame_t *frame, xlator_t *this, gf_lkowner_t *owner,
+ uintptr_t target, int32_t minimum, fop_finodelk_cbk_t func,
+ void *data, const char *volume, fd_t *fd, int32_t cmd,
+ struct gf_flock *flock, dict_t *xdata);
+
+void
+ec_link(call_frame_t *frame, xlator_t *this, uintptr_t target, int32_t minimum,
+ fop_link_cbk_t func, void *data, loc_t *oldloc, loc_t *newloc,
+ dict_t *xdata);
+
+void
+ec_lk(call_frame_t *frame, xlator_t *this, uintptr_t target, int32_t minimum,
+ fop_lk_cbk_t func, void *data, fd_t *fd, int32_t cmd,
+ struct gf_flock *flock, dict_t *xdata);
+
+void
+ec_lookup(call_frame_t *frame, xlator_t *this, uintptr_t target,
+ int32_t minimum, fop_lookup_cbk_t func, void *data, loc_t *loc,
+ dict_t *xdata);
+
+void
+ec_mkdir(call_frame_t *frame, xlator_t *this, uintptr_t target, int32_t minimum,
+ fop_mkdir_cbk_t func, void *data, loc_t *loc, mode_t mode,
+ mode_t umask, dict_t *xdata);
+
+void
+ec_mknod(call_frame_t *frame, xlator_t *this, uintptr_t target, int32_t minimum,
+ fop_mknod_cbk_t func, void *data, loc_t *loc, mode_t mode, dev_t rdev,
+ mode_t umask, dict_t *xdata);
+
+void
+ec_open(call_frame_t *frame, xlator_t *this, uintptr_t target, int32_t minimum,
+ fop_open_cbk_t func, void *data, loc_t *loc, int32_t flags, fd_t *fd,
+ dict_t *xdata);
+
+void
+ec_opendir(call_frame_t *frame, xlator_t *this, uintptr_t target,
+ int32_t minimum, fop_opendir_cbk_t func, void *data, loc_t *loc,
+ fd_t *fd, dict_t *xdata);
+
+void
+ec_readdir(call_frame_t *frame, xlator_t *this, uintptr_t target,
+ int32_t minimum, fop_readdir_cbk_t func, void *data, fd_t *fd,
+ size_t size, off_t offset, dict_t *xdata);
+
+void
+ec_readdirp(call_frame_t *frame, xlator_t *this, uintptr_t target,
+ int32_t minimum, fop_readdirp_cbk_t func, void *data, fd_t *fd,
+ size_t size, off_t offset, dict_t *xdata);
+
+void
+ec_readlink(call_frame_t *frame, xlator_t *this, uintptr_t target,
+ int32_t minimum, fop_readlink_cbk_t func, void *data, loc_t *loc,
+ size_t size, dict_t *xdata);
+
+void
+ec_readv(call_frame_t *frame, xlator_t *this, uintptr_t target, int32_t minimum,
+ fop_readv_cbk_t func, void *data, fd_t *fd, size_t size, off_t offset,
+ uint32_t flags, dict_t *xdata);
+
+void
+ec_removexattr(call_frame_t *frame, xlator_t *this, uintptr_t target,
+ int32_t minimum, fop_removexattr_cbk_t func, void *data,
+ loc_t *loc, const char *name, dict_t *xdata);
+
+void
+ec_fremovexattr(call_frame_t *frame, xlator_t *this, uintptr_t target,
+ int32_t minimum, fop_fremovexattr_cbk_t func, void *data,
+ fd_t *fd, const char *name, dict_t *xdata);
+
+void
+ec_rename(call_frame_t *frame, xlator_t *this, uintptr_t target,
+ int32_t minimum, fop_rename_cbk_t func, void *data, loc_t *oldloc,
+ loc_t *newloc, dict_t *xdata);
+
+void
+ec_rmdir(call_frame_t *frame, xlator_t *this, uintptr_t target, int32_t minimum,
+ fop_rmdir_cbk_t func, void *data, loc_t *loc, int xflags,
+ dict_t *xdata);
+
+void
+ec_setattr(call_frame_t *frame, xlator_t *this, uintptr_t target,
+ int32_t minimum, fop_setattr_cbk_t func, void *data, loc_t *loc,
+ struct iatt *stbuf, int32_t valid, dict_t *xdata);
+
+void
+ec_fsetattr(call_frame_t *frame, xlator_t *this, uintptr_t target,
+ int32_t minimum, fop_fsetattr_cbk_t func, void *data, fd_t *fd,
+ struct iatt *stbuf, int32_t valid, dict_t *xdata);
+
+void
+ec_setxattr(call_frame_t *frame, xlator_t *this, uintptr_t target,
+ int32_t minimum, fop_setxattr_cbk_t func, void *data, loc_t *loc,
+ dict_t *dict, int32_t flags, dict_t *xdata);
+
+void
+ec_fsetxattr(call_frame_t *frame, xlator_t *this, uintptr_t target,
+ int32_t minimum, fop_fsetxattr_cbk_t func, void *data, fd_t *fd,
+ dict_t *dict, int32_t flags, dict_t *xdata);
+
+void
+ec_stat(call_frame_t *frame, xlator_t *this, uintptr_t target, int32_t minimum,
+ fop_stat_cbk_t func, void *data, loc_t *loc, dict_t *xdata);
+
+void
+ec_fstat(call_frame_t *frame, xlator_t *this, uintptr_t target, int32_t minimum,
+ fop_fstat_cbk_t func, void *data, fd_t *fd, dict_t *xdata);
+
+void
+ec_statfs(call_frame_t *frame, xlator_t *this, uintptr_t target,
+ int32_t minimum, fop_statfs_cbk_t func, void *data, loc_t *loc,
+ dict_t *xdata);
+
+void
+ec_symlink(call_frame_t *frame, xlator_t *this, uintptr_t target,
+ int32_t minimum, fop_symlink_cbk_t func, void *data,
+ const char *linkname, loc_t *loc, mode_t umask, dict_t *xdata);
+
+void
+ec_fallocate(call_frame_t *frame, xlator_t *this, uintptr_t target,
+ int32_t minimum, fop_fallocate_cbk_t func, void *data, fd_t *fd,
+ int32_t mode, off_t offset, size_t len, dict_t *xdata);
+
+void
+ec_discard(call_frame_t *frame, xlator_t *this, uintptr_t target,
+ int32_t minimum, fop_discard_cbk_t func, void *data, fd_t *fd,
+ off_t offset, size_t len, dict_t *xdata);
+
+void
+ec_truncate(call_frame_t *frame, xlator_t *this, uintptr_t target,
+ int32_t minimum, fop_truncate_cbk_t func, void *data, loc_t *loc,
+ off_t offset, dict_t *xdata);
+
+void
+ec_ftruncate(call_frame_t *frame, xlator_t *this, uintptr_t target,
+ int32_t minimum, fop_ftruncate_cbk_t func, void *data, fd_t *fd,
+ off_t offset, dict_t *xdata);
+
+void
+ec_unlink(call_frame_t *frame, xlator_t *this, uintptr_t target,
+ int32_t minimum, fop_unlink_cbk_t func, void *data, loc_t *loc,
+ int xflags, dict_t *xdata);
+
+void
+ec_writev(call_frame_t *frame, xlator_t *this, uintptr_t target,
+ int32_t minimum, fop_writev_cbk_t func, void *data, fd_t *fd,
+ struct iovec *vector, int32_t count, off_t offset, uint32_t flags,
+ struct iobref *iobref, dict_t *xdata);
+
+void
+ec_xattrop(call_frame_t *frame, xlator_t *this, uintptr_t target,
+ int32_t minimum, fop_xattrop_cbk_t func, void *data, loc_t *loc,
+ gf_xattrop_flags_t optype, dict_t *xattr, dict_t *xdata);
+
+void
+ec_fxattrop(call_frame_t *frame, xlator_t *this, uintptr_t target,
+ int32_t minimum, fop_fxattrop_cbk_t func, void *data, fd_t *fd,
+ gf_xattrop_flags_t optype, dict_t *xattr, dict_t *xdata);
+
+void
+ec_seek(call_frame_t *frame, xlator_t *this, uintptr_t target, int32_t minimum,
+ fop_seek_cbk_t func, void *data, fd_t *fd, off_t offset,
+ gf_seek_what_t what, dict_t *xdata);
+
+void
+ec_ipc(call_frame_t *frame, xlator_t *this, uintptr_t target, int32_t minimum,
+ fop_ipc_cbk_t func, void *data, int32_t op, dict_t *xdata);
#endif /* __EC_FOPS_H__ */
diff --git a/xlators/cluster/ec/src/ec-galois.h b/xlators/cluster/ec/src/ec-galois.h
index 02e6b6c1bc2..ed55d53e419 100644
--- a/xlators/cluster/ec/src/ec-galois.h
+++ b/xlators/cluster/ec/src/ec-galois.h
@@ -15,12 +15,18 @@
#include "ec-types.h"
-ec_gf_t *ec_gf_prepare(uint32_t bits, uint32_t mod);
-void ec_gf_destroy(ec_gf_t *gf);
+ec_gf_t *
+ec_gf_prepare(uint32_t bits, uint32_t mod);
+void
+ec_gf_destroy(ec_gf_t *gf);
-uint32_t ec_gf_add(ec_gf_t *gf, uint32_t a, uint32_t b);
-uint32_t ec_gf_mul(ec_gf_t *gf, uint32_t a, uint32_t b);
-uint32_t ec_gf_div(ec_gf_t *gf, uint32_t a, uint32_t b);
-uint32_t ec_gf_exp(ec_gf_t *gf, uint32_t a, uint32_t b);
+uint32_t
+ec_gf_add(ec_gf_t *gf, uint32_t a, uint32_t b);
+uint32_t
+ec_gf_mul(ec_gf_t *gf, uint32_t a, uint32_t b);
+uint32_t
+ec_gf_div(ec_gf_t *gf, uint32_t a, uint32_t b);
+uint32_t
+ec_gf_exp(ec_gf_t *gf, uint32_t a, uint32_t b);
#endif /* __EC_GALOIS_H__ */
diff --git a/xlators/cluster/ec/src/ec-heald.h b/xlators/cluster/ec/src/ec-heald.h
index 2a8488124c4..4d141d767e5 100644
--- a/xlators/cluster/ec/src/ec-heald.h
+++ b/xlators/cluster/ec/src/ec-heald.h
@@ -16,10 +16,10 @@
#include "ec-types.h"
int
-ec_xl_op (xlator_t *this, dict_t *input, dict_t *output);
+ec_xl_op(xlator_t *this, dict_t *input, dict_t *output);
int
-ec_selfheal_daemon_init (xlator_t *this);
+ec_selfheal_daemon_init(xlator_t *this);
void
ec_shd_index_healer_wake(ec_t *ec);
diff --git a/xlators/cluster/ec/src/ec-helpers.h b/xlators/cluster/ec/src/ec-helpers.h
index b548f802361..015db514e05 100644
--- a/xlators/cluster/ec/src/ec-helpers.h
+++ b/xlators/cluster/ec/src/ec-helpers.h
@@ -17,60 +17,77 @@
#define EC_IS_ERR(_x) (((uintptr_t)(_x) & ~0xfffULL) == ~0xfffULL)
#define EC_GET_ERR(_x) ((int32_t)(intptr_t)(_x))
-#define EC_ALIGN_CHECK(_ptr, _align) \
- ((((uintptr_t)(_ptr)) & ((_align) - 1)) == 0)
-
-const char * ec_bin(char * str, size_t size, uint64_t value, int32_t digits);
-const char * ec_fop_name(int32_t id);
-void ec_trace(const char * event, ec_fop_data_t * fop, const char * fmt, ...);
-int32_t ec_bits_consume(uint64_t * n);
-size_t ec_iov_copy_to(void * dst, struct iovec * vector, int32_t count,
- off_t offset, size_t size);
-int32_t ec_buffer_alloc(xlator_t *xl, size_t size, struct iobref **piobref,
- void **ptr);
-int32_t ec_dict_set_array(dict_t *dict, char *key,
- uint64_t *value, int32_t size);
-int32_t ec_dict_get_array (dict_t *dict, char *key, uint64_t value[],
- int32_t size);
-
-int32_t ec_dict_del_array(dict_t *dict, char *key,
- uint64_t *value, int32_t size);
-int32_t ec_dict_set_number(dict_t * dict, char * key, uint64_t value);
-int32_t ec_dict_del_number(dict_t * dict, char * key, uint64_t * value);
-int32_t ec_dict_set_config(dict_t * dict, char * key, ec_config_t * config);
-int32_t ec_dict_del_config(dict_t * dict, char * key, ec_config_t * config);
-
-int32_t ec_loc_parent(xlator_t *xl, loc_t *loc, loc_t *parent);
-int32_t ec_loc_update(xlator_t *xl, loc_t *loc, inode_t *inode,
- struct iatt *iatt);
-
-int32_t ec_loc_from_fd(xlator_t * xl, loc_t * loc, fd_t * fd);
-int32_t ec_loc_from_loc(xlator_t * xl, loc_t * dst, loc_t * src);
-
-void ec_owner_set(call_frame_t * frame, void * owner);
-void ec_owner_copy(call_frame_t * frame, gf_lkowner_t * owner);
-
-ec_inode_t * __ec_inode_get(inode_t * inode, xlator_t * xl);
-ec_inode_t * ec_inode_get(inode_t * inode, xlator_t * xl);
-ec_fd_t * __ec_fd_get(fd_t * fd, xlator_t * xl);
-ec_fd_t * ec_fd_get(fd_t * fd, xlator_t * xl);
+#define EC_ALIGN_CHECK(_ptr, _align) ((((uintptr_t)(_ptr)) & ((_align)-1)) == 0)
+
+const char *
+ec_bin(char *str, size_t size, uint64_t value, int32_t digits);
+const char *
+ec_fop_name(int32_t id);
+void
+ec_trace(const char *event, ec_fop_data_t *fop, const char *fmt, ...);
+int32_t
+ec_bits_consume(uint64_t *n);
+size_t
+ec_iov_copy_to(void *dst, struct iovec *vector, int32_t count, off_t offset,
+ size_t size);
+int32_t
+ec_buffer_alloc(xlator_t *xl, size_t size, struct iobref **piobref, void **ptr);
+int32_t
+ec_dict_set_array(dict_t *dict, char *key, uint64_t *value, int32_t size);
+int32_t
+ec_dict_get_array(dict_t *dict, char *key, uint64_t value[], int32_t size);
+
+int32_t
+ec_dict_del_array(dict_t *dict, char *key, uint64_t *value, int32_t size);
+int32_t
+ec_dict_set_number(dict_t *dict, char *key, uint64_t value);
+int32_t
+ec_dict_del_number(dict_t *dict, char *key, uint64_t *value);
+int32_t
+ec_dict_set_config(dict_t *dict, char *key, ec_config_t *config);
+int32_t
+ec_dict_del_config(dict_t *dict, char *key, ec_config_t *config);
+
+int32_t
+ec_loc_parent(xlator_t *xl, loc_t *loc, loc_t *parent);
+int32_t
+ec_loc_update(xlator_t *xl, loc_t *loc, inode_t *inode, struct iatt *iatt);
+
+int32_t
+ec_loc_from_fd(xlator_t *xl, loc_t *loc, fd_t *fd);
+int32_t
+ec_loc_from_loc(xlator_t *xl, loc_t *dst, loc_t *src);
+
+void
+ec_owner_set(call_frame_t *frame, void *owner);
+void
+ec_owner_copy(call_frame_t *frame, gf_lkowner_t *owner);
+
+ec_inode_t *
+__ec_inode_get(inode_t *inode, xlator_t *xl);
+ec_inode_t *
+ec_inode_get(inode_t *inode, xlator_t *xl);
+ec_fd_t *
+__ec_fd_get(fd_t *fd, xlator_t *xl);
+ec_fd_t *
+ec_fd_get(fd_t *fd, xlator_t *xl);
static inline uint32_t
ec_adjust_size_down(ec_t *ec, uint64_t *value, gf_boolean_t scale)
{
- uint64_t head, tmp;
+ uint64_t head, tmp;
- tmp = *value;
- head = tmp % ec->stripe_size;
- tmp -= head;
+ tmp = *value;
+ head = tmp % ec->stripe_size;
+ tmp -= head;
- if (scale) {
- tmp /= ec->fragments;
- }
+ if (scale) {
+ tmp /= ec->fragments;
+ }
- *value = tmp;
+ *value = tmp;
- return (uint32_t)head;
+ return (uint32_t)head;
}
/* This function can cause an overflow if the passed value is too near to the
@@ -79,35 +96,35 @@ ec_adjust_size_down(ec_t *ec, uint64_t *value, gf_boolean_t scale)
static inline int32_t
ec_adjust_size_up(ec_t *ec, uint64_t *value, gf_boolean_t scale)
{
- uint64_t tmp;
- int32_t tail;
-
- tmp = *value;
- /* We first adjust the value down. This never causes overflow. */
- tail = ec_adjust_size_down(ec, &tmp, scale);
-
- /* If the value was already aligned, tail will be 0 and nothing else
- * needs to be done. */
- if (tail != 0) {
- /* Otherwise, we need to compute the real tail and adjust the
- * returned value to the next stripe. */
- tail = ec->stripe_size - tail;
- if (scale) {
- tmp += ec->fragment_size;
- } else {
- tmp += ec->stripe_size;
- /* If no scaling is requested there's a possibility of
- * overflow. */
- if (tmp < ec->stripe_size) {
- tmp = UINT64_MAX;
- tail = -tail;
- }
- }
+ uint64_t tmp;
+ int32_t tail;
+
+ tmp = *value;
+ /* We first adjust the value down. This never causes overflow. */
+ tail = ec_adjust_size_down(ec, &tmp, scale);
+
+ /* If the value was already aligned, tail will be 0 and nothing else
+ * needs to be done. */
+ if (tail != 0) {
+ /* Otherwise, we need to compute the real tail and adjust the
+ * returned value to the next stripe. */
+ tail = ec->stripe_size - tail;
+ if (scale) {
+ tmp += ec->fragment_size;
+ } else {
+ tmp += ec->stripe_size;
+ /* If no scaling is requested there's a possibility of
+ * overflow. */
+ if (tmp < ec->stripe_size) {
+ tmp = UINT64_MAX;
+ tail = -tail;
+ }
}
+ }
- *value = tmp;
+ *value = tmp;
- return tail;
+ return tail;
}
/* This function is equivalent to ec_adjust_size_down() but with a potentially
@@ -115,19 +132,19 @@ ec_adjust_size_up(ec_t *ec, uint64_t *value, gf_boolean_t scale)
static inline uint32_t
ec_adjust_offset_down(ec_t *ec, off_t *value, gf_boolean_t scale)
{
- off_t head, tmp;
+ off_t head, tmp;
- tmp = *value;
- head = tmp % ec->stripe_size;
- tmp -= head;
+ tmp = *value;
+ head = tmp % ec->stripe_size;
+ tmp -= head;
- if (scale) {
- tmp /= ec->fragments;
- }
+ if (scale) {
+ tmp /= ec->fragments;
+ }
- *value = tmp;
+ *value = tmp;
- return (uint32_t)head;
+ return (uint32_t)head;
}
/* This function is equivalent to ec_adjust_size_up() but with a potentially
@@ -135,48 +152,49 @@ ec_adjust_offset_down(ec_t *ec, off_t *value, gf_boolean_t scale)
static inline int32_t
ec_adjust_offset_up(ec_t *ec, off_t *value, gf_boolean_t scale)
{
- uint64_t tail, tmp;
-
- /* An offset is a signed type that can only have positive values, so
- * we take advantage of this to avoid overflows. We simply convert it
- * to an unsigned integer and operate normally. This won't cause an
- * overflow. Overflow is only checked when converting back to an
- * off_t. */
- tmp = *value;
- tail = ec->stripe_size;
- tail -= (tmp + tail - 1) % tail + 1;
- tmp += tail;
- if (scale) {
- /* If we are scaling, we'll never get an overflow. */
- tmp /= ec->fragments;
- } else {
- /* Check if there has been an overflow. */
- if ((off_t)tmp < 0) {
- tmp = GF_OFF_MAX;
- tail = -tail;
- }
+ uint64_t tail, tmp;
+
+ /* An offset is a signed type that can only have positive values, so
+ * we take advantage of this to avoid overflows. We simply convert it
+ * to an unsigned integer and operate normally. This won't cause an
+ * overflow. Overflow is only checked when converting back to an
+ * off_t. */
+ tmp = *value;
+ tail = ec->stripe_size;
+ tail -= (tmp + tail - 1) % tail + 1;
+ tmp += tail;
+ if (scale) {
+ /* If we are scaling, we'll never get an overflow. */
+ tmp /= ec->fragments;
+ } else {
+ /* Check if there has been an overflow. */
+ if ((off_t)tmp < 0) {
+ tmp = GF_OFF_MAX;
+ tail = -tail;
}
+ }
- *value = (off_t)tmp;
+ *value = (off_t)tmp;
- return (int32_t)tail;
+ return (int32_t)tail;
}
-static inline int32_t ec_is_power_of_2(uint32_t value)
+static inline int32_t
+ec_is_power_of_2(uint32_t value)
{
return (value != 0) && ((value & (value - 1)) == 0);
}
gf_boolean_t
-ec_is_internal_xattr (dict_t *dict, char *key, data_t *value, void *data);
+ec_is_internal_xattr(dict_t *dict, char *key, data_t *value, void *data);
void
-ec_filter_internal_xattrs (dict_t *xattr);
+ec_filter_internal_xattrs(dict_t *xattr);
gf_boolean_t
-ec_is_data_fop (glusterfs_fop_t fop);
+ec_is_data_fop(glusterfs_fop_t fop);
int32_t
-ec_launch_replace_heal (ec_t *ec);
+ec_launch_replace_heal(ec_t *ec);
#endif /* __EC_HELPERS_H__ */
diff --git a/xlators/cluster/ec/src/ec-mem-types.h b/xlators/cluster/ec/src/ec-mem-types.h
index 8109a422d9d..fc33d09ea33 100644
--- a/xlators/cluster/ec/src/ec-mem-types.h
+++ b/xlators/cluster/ec/src/ec-mem-types.h
@@ -13,8 +13,7 @@
#include "mem-types.h"
-enum gf_ec_mem_types_
-{
+enum gf_ec_mem_types_ {
ec_mt_ec_t = gf_common_mt_end + 1,
ec_mt_xlator_t,
ec_mt_ec_inode_t,
diff --git a/xlators/cluster/ec/src/ec-messages.h b/xlators/cluster/ec/src/ec-messages.h
index f5138ad8e57..5f673d69aa4 100644
--- a/xlators/cluster/ec/src/ec-messages.h
+++ b/xlators/cluster/ec/src/ec-messages.h
@@ -23,83 +23,38 @@
* glfs-message-id.h.
*/
-GLFS_MSGID(EC,
- EC_MSG_INVALID_CONFIG,
- EC_MSG_HEAL_FAIL,
- EC_MSG_DICT_COMBINE_FAIL,
- EC_MSG_STIME_COMBINE_FAIL,
- EC_MSG_INVALID_DICT_NUMS,
- EC_MSG_IATT_COMBINE_FAIL,
- EC_MSG_INVALID_FORMAT,
- EC_MSG_DICT_GET_FAILED,
- EC_MSG_UNHANDLED_STATE,
- EC_MSG_FILE_DESC_REF_FAIL,
- EC_MSG_LOC_COPY_FAIL,
- EC_MSG_BUF_REF_FAIL,
- EC_MSG_DICT_REF_FAIL,
- EC_MSG_LK_UNLOCK_FAILED,
- EC_MSG_UNLOCK_FAILED,
- EC_MSG_LOC_PARENT_INODE_MISSING,
- EC_MSG_INVALID_LOC_NAME,
- EC_MSG_NO_MEMORY,
- EC_MSG_GFID_MISMATCH,
- EC_MSG_UNSUPPORTED_VERSION,
- EC_MSG_FD_CREATE_FAIL,
- EC_MSG_READDIRP_REQ_PREP_FAIL,
- EC_MSG_LOOKUP_REQ_PREP_FAIL,
- EC_MSG_INODE_REF_FAIL,
- EC_MSG_LOOKUP_READAHEAD_FAIL,
- EC_MSG_FRAME_MISMATCH,
- EC_MSG_XLATOR_MISMATCH,
- EC_MSG_VECTOR_MISMATCH,
- EC_MSG_IATT_MISMATCH,
- EC_MSG_FD_MISMATCH,
- EC_MSG_DICT_MISMATCH,
- EC_MSG_INDEX_DIR_GET_FAIL,
- EC_MSG_PREOP_LOCK_FAILED,
- EC_MSG_CHILDS_INSUFFICIENT,
- EC_MSG_OP_EXEC_UNAVAIL,
- EC_MSG_UNLOCK_DELAY_FAILED,
- EC_MSG_SIZE_VERS_UPDATE_FAIL,
- EC_MSG_INVALID_REQUEST,
- EC_MSG_INVALID_LOCK_TYPE,
- EC_MSG_SIZE_VERS_GET_FAIL,
- EC_MSG_FILE_SIZE_GET_FAIL,
- EC_MSG_FOP_MISMATCH,
- EC_MSG_SUBVOL_ID_DICT_SET_FAIL,
- EC_MSG_SUBVOL_BUILD_FAIL,
- EC_MSG_XLATOR_INIT_FAIL,
- EC_MSG_NO_PARENTS,
- EC_MSG_TIMER_CREATE_FAIL,
- EC_MSG_TOO_MANY_SUBVOLS,
- EC_MSG_DATA_UNAVAILABLE,
- EC_MSG_INODE_REMOVE_FAIL,
- EC_MSG_INVALID_REDUNDANCY,
- EC_MSG_XLATOR_PARSE_OPT_FAIL,
- EC_MSG_OP_FAIL_ON_SUBVOLS,
- EC_MSG_INVALID_INODE,
- EC_MSG_LOCK_MISMATCH,
- EC_MSG_XDATA_MISMATCH,
- EC_MSG_HEALING_INFO,
- EC_MSG_HEAL_SUCCESS,
- EC_MSG_FULL_SWEEP_START,
- EC_MSG_FULL_SWEEP_STOP,
- EC_MSG_INVALID_FOP,
- EC_MSG_EC_UP,
- EC_MSG_EC_DOWN,
- EC_MSG_SIZE_XATTR_GET_FAIL,
- EC_MSG_VER_XATTR_GET_FAIL,
- EC_MSG_CONFIG_XATTR_GET_FAIL,
- EC_MSG_CONFIG_XATTR_INVALID,
- EC_MSG_EXTENSION,
- EC_MSG_EXTENSION_NONE,
- EC_MSG_EXTENSION_UNKNOWN,
- EC_MSG_EXTENSION_UNSUPPORTED,
- EC_MSG_EXTENSION_FAILED,
- EC_MSG_NO_GF,
- EC_MSG_MATRIX_FAILED,
- EC_MSG_DYN_CREATE_FAILED,
- EC_MSG_DYN_CODEGEN_FAILED
-);
+GLFS_MSGID(EC, EC_MSG_INVALID_CONFIG, EC_MSG_HEAL_FAIL,
+ EC_MSG_DICT_COMBINE_FAIL, EC_MSG_STIME_COMBINE_FAIL,
+ EC_MSG_INVALID_DICT_NUMS, EC_MSG_IATT_COMBINE_FAIL,
+ EC_MSG_INVALID_FORMAT, EC_MSG_DICT_GET_FAILED,
+ EC_MSG_UNHANDLED_STATE, EC_MSG_FILE_DESC_REF_FAIL,
+ EC_MSG_LOC_COPY_FAIL, EC_MSG_BUF_REF_FAIL, EC_MSG_DICT_REF_FAIL,
+ EC_MSG_LK_UNLOCK_FAILED, EC_MSG_UNLOCK_FAILED,
+ EC_MSG_LOC_PARENT_INODE_MISSING, EC_MSG_INVALID_LOC_NAME,
+ EC_MSG_NO_MEMORY, EC_MSG_GFID_MISMATCH, EC_MSG_UNSUPPORTED_VERSION,
+ EC_MSG_FD_CREATE_FAIL, EC_MSG_READDIRP_REQ_PREP_FAIL,
+ EC_MSG_LOOKUP_REQ_PREP_FAIL, EC_MSG_INODE_REF_FAIL,
+ EC_MSG_LOOKUP_READAHEAD_FAIL, EC_MSG_FRAME_MISMATCH,
+ EC_MSG_XLATOR_MISMATCH, EC_MSG_VECTOR_MISMATCH, EC_MSG_IATT_MISMATCH,
+ EC_MSG_FD_MISMATCH, EC_MSG_DICT_MISMATCH, EC_MSG_INDEX_DIR_GET_FAIL,
+ EC_MSG_PREOP_LOCK_FAILED, EC_MSG_CHILDS_INSUFFICIENT,
+ EC_MSG_OP_EXEC_UNAVAIL, EC_MSG_UNLOCK_DELAY_FAILED,
+ EC_MSG_SIZE_VERS_UPDATE_FAIL, EC_MSG_INVALID_REQUEST,
+ EC_MSG_INVALID_LOCK_TYPE, EC_MSG_SIZE_VERS_GET_FAIL,
+ EC_MSG_FILE_SIZE_GET_FAIL, EC_MSG_FOP_MISMATCH,
+ EC_MSG_SUBVOL_ID_DICT_SET_FAIL, EC_MSG_SUBVOL_BUILD_FAIL,
+ EC_MSG_XLATOR_INIT_FAIL, EC_MSG_NO_PARENTS, EC_MSG_TIMER_CREATE_FAIL,
+ EC_MSG_TOO_MANY_SUBVOLS, EC_MSG_DATA_UNAVAILABLE,
+ EC_MSG_INODE_REMOVE_FAIL, EC_MSG_INVALID_REDUNDANCY,
+ EC_MSG_XLATOR_PARSE_OPT_FAIL, EC_MSG_OP_FAIL_ON_SUBVOLS,
+ EC_MSG_INVALID_INODE, EC_MSG_LOCK_MISMATCH, EC_MSG_XDATA_MISMATCH,
+ EC_MSG_HEALING_INFO, EC_MSG_HEAL_SUCCESS, EC_MSG_FULL_SWEEP_START,
+ EC_MSG_FULL_SWEEP_STOP, EC_MSG_INVALID_FOP, EC_MSG_EC_UP,
+ EC_MSG_EC_DOWN, EC_MSG_SIZE_XATTR_GET_FAIL,
+ EC_MSG_VER_XATTR_GET_FAIL, EC_MSG_CONFIG_XATTR_GET_FAIL,
+ EC_MSG_CONFIG_XATTR_INVALID, EC_MSG_EXTENSION, EC_MSG_EXTENSION_NONE,
+ EC_MSG_EXTENSION_UNKNOWN, EC_MSG_EXTENSION_UNSUPPORTED,
+ EC_MSG_EXTENSION_FAILED, EC_MSG_NO_GF, EC_MSG_MATRIX_FAILED,
+ EC_MSG_DYN_CREATE_FAILED, EC_MSG_DYN_CODEGEN_FAILED);
#endif /* !_EC_MESSAGES_H_ */
diff --git a/xlators/cluster/ec/src/ec-method.h b/xlators/cluster/ec/src/ec-method.h
index 9ba5069ff0e..3d6393bed06 100644
--- a/xlators/cluster/ec/src/ec-method.h
+++ b/xlators/cluster/ec/src/ec-method.h
@@ -24,7 +24,7 @@
/* Determines the maximum size of the matrix used to encode/decode data */
#define EC_METHOD_MAX_FRAGMENTS 16
/* Determines the maximum number of usable elements in the Galois Field */
-#define EC_METHOD_MAX_NODES (EC_GF_SIZE - 1)
+#define EC_METHOD_MAX_NODES (EC_GF_SIZE - 1)
#define EC_METHOD_WORD_SIZE 64
@@ -34,7 +34,8 @@ int32_t
ec_method_init(xlator_t *xl, ec_matrix_list_t *list, uint32_t columns,
uint32_t rows, uint32_t max, const char *gen);
-void ec_method_fini(ec_matrix_list_t *list);
+void
+ec_method_fini(ec_matrix_list_t *list);
int32_t
ec_method_update(xlator_t *xl, ec_matrix_list_t *list, const char *gen);
diff --git a/xlators/cluster/ec/src/ec-types.h b/xlators/cluster/ec/src/ec-types.h
index 3a0267bf176..80d9c0d4014 100644
--- a/xlators/cluster/ec/src/ec-types.h
+++ b/xlators/cluster/ec/src/ec-types.h
@@ -128,75 +128,59 @@ typedef void (*ec_wind_f)(ec_t *, ec_fop_data_t *, int32_t);
typedef int32_t (*ec_handler_f)(ec_fop_data_t *, int32_t);
typedef void (*ec_resume_f)(ec_fop_data_t *, int32_t);
-enum _ec_read_policy {
- EC_ROUND_ROBIN,
- EC_GFID_HASH,
- EC_READ_POLICY_MAX
-};
+enum _ec_read_policy { EC_ROUND_ROBIN, EC_GFID_HASH, EC_READ_POLICY_MAX };
-enum _ec_heal_need {
- EC_HEAL_NONEED,
- EC_HEAL_MAYBE,
- EC_HEAL_MUST
-};
+enum _ec_heal_need { EC_HEAL_NONEED, EC_HEAL_MAYBE, EC_HEAL_MUST };
-enum _ec_stripe_part {
- EC_STRIPE_HEAD,
- EC_STRIPE_TAIL
-};
+enum _ec_stripe_part { EC_STRIPE_HEAD, EC_STRIPE_TAIL };
/* Enumartions to indicate FD status. */
-typedef enum {
- EC_FD_NOT_OPENED,
- EC_FD_OPENED,
- EC_FD_OPENING
-} ec_fd_status_t;
+typedef enum { EC_FD_NOT_OPENED, EC_FD_OPENED, EC_FD_OPENING } ec_fd_status_t;
struct _ec_config {
uint32_t version;
- uint8_t algorithm;
- uint8_t gf_word_size;
- uint8_t bricks;
- uint8_t redundancy;
+ uint8_t algorithm;
+ uint8_t gf_word_size;
+ uint8_t bricks;
+ uint8_t redundancy;
uint32_t chunk_size;
};
struct _ec_fd {
- loc_t loc;
+ loc_t loc;
uintptr_t open;
- int32_t flags;
+ int32_t flags;
ec_fd_status_t fd_status[0];
};
struct _ec_stripe {
- struct list_head lru; /* LRU list member */
- uint64_t frag_offset; /* Fragment offset of this stripe */
- char data[]; /* Contents of the stripe */
+ struct list_head lru; /* LRU list member */
+ uint64_t frag_offset; /* Fragment offset of this stripe */
+ char data[]; /* Contents of the stripe */
};
struct _ec_stripe_list {
- struct list_head lru;
- uint32_t count;
- uint32_t max;
+ struct list_head lru;
+ uint32_t count;
+ uint32_t max;
};
struct _ec_inode {
- ec_lock_t *inode_lock;
- gf_boolean_t have_info;
- gf_boolean_t have_config;
- gf_boolean_t have_version;
- gf_boolean_t have_size;
- ec_config_t config;
- uint64_t pre_version[2];
- uint64_t post_version[2];
- uint64_t pre_size;
- uint64_t post_size;
- uint64_t dirty[2];
- struct list_head heal;
- ec_stripe_list_t stripe_cache;
+ ec_lock_t *inode_lock;
+ gf_boolean_t have_info;
+ gf_boolean_t have_config;
+ gf_boolean_t have_version;
+ gf_boolean_t have_size;
+ ec_config_t config;
+ uint64_t pre_version[2];
+ uint64_t post_version[2];
+ uint64_t pre_size;
+ uint64_t post_size;
+ uint64_t dirty[2];
+ struct list_head heal;
+ ec_stripe_list_t stripe_cache;
};
-
typedef int32_t (*fop_heal_cbk_t)(call_frame_t *, void *, xlator_t *, int32_t,
int32_t, uintptr_t, uintptr_t, uintptr_t,
dict_t *);
@@ -205,105 +189,105 @@ typedef int32_t (*fop_fheal_cbk_t)(call_frame_t *, void *, xlator_t *, int32_t,
dict_t *);
union _ec_cbk {
- fop_access_cbk_t access;
- fop_create_cbk_t create;
- fop_discard_cbk_t discard;
- fop_entrylk_cbk_t entrylk;
- fop_fentrylk_cbk_t fentrylk;
- fop_fallocate_cbk_t fallocate;
- fop_flush_cbk_t flush;
- fop_fsync_cbk_t fsync;
- fop_fsyncdir_cbk_t fsyncdir;
- fop_getxattr_cbk_t getxattr;
- fop_fgetxattr_cbk_t fgetxattr;
- fop_heal_cbk_t heal;
- fop_fheal_cbk_t fheal;
- fop_inodelk_cbk_t inodelk;
- fop_finodelk_cbk_t finodelk;
- fop_link_cbk_t link;
- fop_lk_cbk_t lk;
- fop_lookup_cbk_t lookup;
- fop_mkdir_cbk_t mkdir;
- fop_mknod_cbk_t mknod;
- fop_open_cbk_t open;
- fop_opendir_cbk_t opendir;
- fop_readdir_cbk_t readdir;
- fop_readdirp_cbk_t readdirp;
- fop_readlink_cbk_t readlink;
- fop_readv_cbk_t readv;
- fop_removexattr_cbk_t removexattr;
+ fop_access_cbk_t access;
+ fop_create_cbk_t create;
+ fop_discard_cbk_t discard;
+ fop_entrylk_cbk_t entrylk;
+ fop_fentrylk_cbk_t fentrylk;
+ fop_fallocate_cbk_t fallocate;
+ fop_flush_cbk_t flush;
+ fop_fsync_cbk_t fsync;
+ fop_fsyncdir_cbk_t fsyncdir;
+ fop_getxattr_cbk_t getxattr;
+ fop_fgetxattr_cbk_t fgetxattr;
+ fop_heal_cbk_t heal;
+ fop_fheal_cbk_t fheal;
+ fop_inodelk_cbk_t inodelk;
+ fop_finodelk_cbk_t finodelk;
+ fop_link_cbk_t link;
+ fop_lk_cbk_t lk;
+ fop_lookup_cbk_t lookup;
+ fop_mkdir_cbk_t mkdir;
+ fop_mknod_cbk_t mknod;
+ fop_open_cbk_t open;
+ fop_opendir_cbk_t opendir;
+ fop_readdir_cbk_t readdir;
+ fop_readdirp_cbk_t readdirp;
+ fop_readlink_cbk_t readlink;
+ fop_readv_cbk_t readv;
+ fop_removexattr_cbk_t removexattr;
fop_fremovexattr_cbk_t fremovexattr;
- fop_rename_cbk_t rename;
- fop_rmdir_cbk_t rmdir;
- fop_setattr_cbk_t setattr;
- fop_fsetattr_cbk_t fsetattr;
- fop_setxattr_cbk_t setxattr;
- fop_fsetxattr_cbk_t fsetxattr;
- fop_stat_cbk_t stat;
- fop_fstat_cbk_t fstat;
- fop_statfs_cbk_t statfs;
- fop_symlink_cbk_t symlink;
- fop_truncate_cbk_t truncate;
- fop_ftruncate_cbk_t ftruncate;
- fop_unlink_cbk_t unlink;
- fop_writev_cbk_t writev;
- fop_xattrop_cbk_t xattrop;
- fop_fxattrop_cbk_t fxattrop;
- fop_zerofill_cbk_t zerofill;
- fop_seek_cbk_t seek;
- fop_ipc_cbk_t ipc;
+ fop_rename_cbk_t rename;
+ fop_rmdir_cbk_t rmdir;
+ fop_setattr_cbk_t setattr;
+ fop_fsetattr_cbk_t fsetattr;
+ fop_setxattr_cbk_t setxattr;
+ fop_fsetxattr_cbk_t fsetxattr;
+ fop_stat_cbk_t stat;
+ fop_fstat_cbk_t fstat;
+ fop_statfs_cbk_t statfs;
+ fop_symlink_cbk_t symlink;
+ fop_truncate_cbk_t truncate;
+ fop_ftruncate_cbk_t ftruncate;
+ fop_unlink_cbk_t unlink;
+ fop_writev_cbk_t writev;
+ fop_xattrop_cbk_t xattrop;
+ fop_fxattrop_cbk_t fxattrop;
+ fop_zerofill_cbk_t zerofill;
+ fop_seek_cbk_t seek;
+ fop_ipc_cbk_t ipc;
};
struct _ec_lock {
- ec_inode_t *ctx;
- gf_timer_t *timer;
+ ec_inode_t *ctx;
+ gf_timer_t *timer;
/* List of owners of this lock. All fops added to this list are running
* concurrently. */
- struct list_head owners;
+ struct list_head owners;
/* List of fops waiting to be an owner of the lock. Fops are added to this
* list when the current owner has an incompatible access (conflicting lock)
* or the lock is not acquired yet. */
- struct list_head waiting;
+ struct list_head waiting;
/* List of fops that will wait until the next unlock/lock cycle. This
* happens when the currently acquired lock is decided to be released as
* soon as possible. In this case, all frozen fops will be continued only
* after the lock is reacquired. */
- struct list_head frozen;
-
- uintptr_t mask;
- uintptr_t good_mask;
- uintptr_t healing;
- uint32_t refs_owners; /* Refs for fops owning the lock */
- uint32_t refs_pending; /* Refs assigned to fops being prepared */
- uint32_t waiting_flags; /*Track xattrop/dirty marking*/
- gf_boolean_t acquired;
- gf_boolean_t unlock_now;
- gf_boolean_t release;
- gf_boolean_t query;
- fd_t *fd;
- loc_t loc;
+ struct list_head frozen;
+
+ uintptr_t mask;
+ uintptr_t good_mask;
+ uintptr_t healing;
+ uint32_t refs_owners; /* Refs for fops owning the lock */
+ uint32_t refs_pending; /* Refs assigned to fops being prepared */
+ uint32_t waiting_flags; /*Track xattrop/dirty marking*/
+ gf_boolean_t acquired;
+ gf_boolean_t unlock_now;
+ gf_boolean_t release;
+ gf_boolean_t query;
+ fd_t *fd;
+ loc_t loc;
union {
- entrylk_type type;
- struct gf_flock flock;
+ entrylk_type type;
+ struct gf_flock flock;
};
};
struct _ec_lock_link {
- ec_lock_t *lock;
- ec_fop_data_t *fop;
- struct list_head owner_list;
- struct list_head wait_list;
- gf_boolean_t update[2];
- gf_boolean_t dirty[2];
- gf_boolean_t optimistic_changelog;
- loc_t *base;
- uint64_t size;
- uint32_t waiting_flags;
- off_t fl_start;
- off_t fl_end;
+ ec_lock_t *lock;
+ ec_fop_data_t *fop;
+ struct list_head owner_list;
+ struct list_head wait_list;
+ gf_boolean_t update[2];
+ gf_boolean_t dirty[2];
+ gf_boolean_t optimistic_changelog;
+ loc_t *base;
+ uint64_t size;
+ uint32_t waiting_flags;
+ off_t fl_start;
+ off_t fl_end;
};
/* This structure keeps a range of fragment offsets affected by a fop. Since
@@ -320,113 +304,113 @@ struct _ec_fragment_range {
/* EC xlator data structure to collect all the data required to perform
* the file operation.*/
struct _ec_fop_data {
- int32_t id; /* ID of the file operation */
- int32_t refs;
- int32_t state;
- int32_t minimum; /* Minimum number of successful
- operation required to conclude a
- fop as successful */
- int32_t expected;
- int32_t winds;
- int32_t jobs;
- int32_t error;
- ec_fop_data_t *parent;
- xlator_t *xl; /* points to EC xlator */
- call_frame_t *req_frame; /* frame of the calling xlator */
- call_frame_t *frame; /* frame used by this fop */
- struct list_head cbk_list; /* sorted list of groups of answers */
- struct list_head answer_list; /* list of answers */
- struct list_head pending_list; /* member of ec_t.pending_fops */
- ec_cbk_data_t *answer; /* accepted answer */
- int32_t lock_count;
- int32_t locked;
- ec_lock_link_t locks[2];
- int32_t first_lock;
- gf_lock_t lock;
-
- uint32_t flags;
- uint32_t first;
- uintptr_t mask;
- uintptr_t healing; /*Dispatch is done but call is successful only
- if fop->minimum number of subvolumes succeed
- which are not healing*/
- uintptr_t remaining;
- uintptr_t received; /* Mask of responses */
- uintptr_t good;
-
- uid_t uid;
- gid_t gid;
-
- ec_wind_f wind; /* Function to wind to */
- ec_handler_f handler; /* FOP manager function */
- ec_resume_f resume;
- ec_cbk_t cbks; /* Callback function for this FOP */
- void *data;
- ec_heal_t *heal;
- struct list_head healer;
-
- uint64_t user_size;
- uint32_t head;
-
- int32_t use_fd; /* Indicates whether this FOP uses FD or
- not */
-
- dict_t *xdata;
- dict_t *dict;
- int32_t int32;
- uint32_t uint32;
- uint64_t size;
- off_t offset;
- mode_t mode[2];
- entrylk_cmd entrylk_cmd;
- entrylk_type entrylk_type;
+ int32_t id; /* ID of the file operation */
+ int32_t refs;
+ int32_t state;
+ int32_t minimum; /* Minimum number of successful
+ operation required to conclude a
+ fop as successful */
+ int32_t expected;
+ int32_t winds;
+ int32_t jobs;
+ int32_t error;
+ ec_fop_data_t *parent;
+ xlator_t *xl; /* points to EC xlator */
+ call_frame_t *req_frame; /* frame of the calling xlator */
+ call_frame_t *frame; /* frame used by this fop */
+ struct list_head cbk_list; /* sorted list of groups of answers */
+ struct list_head answer_list; /* list of answers */
+ struct list_head pending_list; /* member of ec_t.pending_fops */
+ ec_cbk_data_t *answer; /* accepted answer */
+ int32_t lock_count;
+ int32_t locked;
+ ec_lock_link_t locks[2];
+ int32_t first_lock;
+ gf_lock_t lock;
+
+ uint32_t flags;
+ uint32_t first;
+ uintptr_t mask;
+ uintptr_t healing; /*Dispatch is done but call is successful only
+ if fop->minimum number of subvolumes succeed
+ which are not healing*/
+ uintptr_t remaining;
+ uintptr_t received; /* Mask of responses */
+ uintptr_t good;
+
+ uid_t uid;
+ gid_t gid;
+
+ ec_wind_f wind; /* Function to wind to */
+ ec_handler_f handler; /* FOP manager function */
+ ec_resume_f resume;
+ ec_cbk_t cbks; /* Callback function for this FOP */
+ void *data;
+ ec_heal_t *heal;
+ struct list_head healer;
+
+ uint64_t user_size;
+ uint32_t head;
+
+ int32_t use_fd; /* Indicates whether this FOP uses FD or
+ not */
+
+ dict_t *xdata;
+ dict_t *dict;
+ int32_t int32;
+ uint32_t uint32;
+ uint64_t size;
+ off_t offset;
+ mode_t mode[2];
+ entrylk_cmd entrylk_cmd;
+ entrylk_type entrylk_type;
gf_xattrop_flags_t xattrop_flags;
- dev_t dev;
- inode_t *inode;
- fd_t *fd; /* FD of the file on which FOP is
- being carried upon */
- struct iatt iatt;
- char *str[2];
- loc_t loc[2]; /* Holds the location details for
- the file */
- struct gf_flock flock;
- struct iovec *vector;
- struct iobref *buffers;
- gf_seek_what_t seek;
- ec_fragment_range_t frag_range; /* This will hold the range of stripes
- affected by the fop. */
- char *errstr; /*String of fop name, path and gfid
+ dev_t dev;
+ inode_t *inode;
+ fd_t *fd; /* FD of the file on which FOP is
+ being carried upon */
+ struct iatt iatt;
+ char *str[2];
+ loc_t loc[2]; /* Holds the location details for
+ the file */
+ struct gf_flock flock;
+ struct iovec *vector;
+ struct iobref *buffers;
+ gf_seek_what_t seek;
+ ec_fragment_range_t frag_range; /* This will hold the range of stripes
+ affected by the fop. */
+ char *errstr; /*String of fop name, path and gfid
to be used in gf_msg. */
};
struct _ec_cbk_data {
- struct list_head list; /* item in the sorted list of groups */
- struct list_head answer_list; /* item in the list of answers */
- ec_fop_data_t *fop;
- ec_cbk_data_t *next; /* next answer in the same group */
- uint32_t idx;
- int32_t op_ret;
- int32_t op_errno;
- int32_t count;
- uintptr_t mask;
-
- dict_t *xdata;
- dict_t *dict;
- int32_t int32;
- uintptr_t uintptr[3];
- uint64_t size;
- uint64_t version[2];
- inode_t *inode;
- fd_t *fd;
- struct statvfs statvfs;
- struct iatt iatt[5];
- struct gf_flock flock;
- struct iovec *vector;
- struct iobref *buffers;
- char *str;
- gf_dirent_t entries;
- off_t offset;
- gf_seek_what_t what;
+ struct list_head list; /* item in the sorted list of groups */
+ struct list_head answer_list; /* item in the list of answers */
+ ec_fop_data_t *fop;
+ ec_cbk_data_t *next; /* next answer in the same group */
+ uint32_t idx;
+ int32_t op_ret;
+ int32_t op_errno;
+ int32_t count;
+ uintptr_t mask;
+
+ dict_t *xdata;
+ dict_t *dict;
+ int32_t int32;
+ uintptr_t uintptr[3];
+ uint64_t size;
+ uint64_t version[2];
+ inode_t *inode;
+ fd_t *fd;
+ struct statvfs statvfs;
+ struct iatt iatt[5];
+ struct gf_flock flock;
+ struct iovec *vector;
+ struct iobref *buffers;
+ char *str;
+ gf_dirent_t entries;
+ off_t offset;
+ gf_seek_what_t what;
};
enum _ec_gf_opcode {
@@ -441,26 +425,26 @@ enum _ec_gf_opcode {
struct _ec_gf_op {
ec_gf_opcode_t op;
- uint32_t arg1;
- uint32_t arg2;
- uint32_t arg3;
+ uint32_t arg1;
+ uint32_t arg2;
+ uint32_t arg3;
};
struct _ec_gf_mul {
- uint32_t regs;
- uint32_t map[EC_GF_MAX_REGS];
+ uint32_t regs;
+ uint32_t map[EC_GF_MAX_REGS];
ec_gf_op_t *ops;
};
struct _ec_gf {
- uint32_t bits;
- uint32_t size;
- uint32_t mod;
- uint32_t min_ops;
- uint32_t max_ops;
- uint32_t avg_ops;
- uint32_t *log;
- uint32_t *pow;
+ uint32_t bits;
+ uint32_t size;
+ uint32_t mod;
+ uint32_t min_ops;
+ uint32_t max_ops;
+ uint32_t avg_ops;
+ uint32_t *log;
+ uint32_t *pow;
ec_gf_mul_t **table;
};
@@ -483,207 +467,206 @@ struct _ec_code_gen {
};
struct _ec_code {
- gf_lock_t lock;
- struct list_head spaces;
- ec_gf_t *gf;
- ec_code_gen_t *gen;
+ gf_lock_t lock;
+ struct list_head spaces;
+ ec_gf_t *gf;
+ ec_code_gen_t *gen;
};
struct _ec_code_arg {
- uint32_t value;
+ uint32_t value;
};
struct _ec_code_op {
- ec_gf_opcode_t op;
- ec_code_arg_t arg1;
- ec_code_arg_t arg2;
- ec_code_arg_t arg3;
+ ec_gf_opcode_t op;
+ ec_code_arg_t arg1;
+ ec_code_arg_t arg2;
+ ec_code_arg_t arg3;
};
struct _ec_code_builder {
- ec_code_t *code;
- uint64_t address;
- uint8_t *data;
- uint32_t size;
- int32_t error;
- uint32_t regs;
- uint32_t bits;
- uint32_t width;
- uint32_t count;
- uint32_t base;
- uint32_t map[EC_GF_MAX_REGS];
- gf_boolean_t linear;
- uint64_t loop;
- ec_code_op_t ops[0];
+ ec_code_t *code;
+ uint64_t address;
+ uint8_t *data;
+ uint32_t size;
+ int32_t error;
+ uint32_t regs;
+ uint32_t bits;
+ uint32_t width;
+ uint32_t count;
+ uint32_t base;
+ uint32_t map[EC_GF_MAX_REGS];
+ gf_boolean_t linear;
+ uint64_t loop;
+ ec_code_op_t ops[0];
};
struct _ec_code_chunk {
- struct list_head list;
- size_t size;
- ec_code_space_t *space;
+ struct list_head list;
+ size_t size;
+ ec_code_space_t *space;
};
struct _ec_code_space {
- struct list_head list;
- struct list_head chunks;
- ec_code_t *code;
- void *exec;
- size_t size;
+ struct list_head list;
+ struct list_head chunks;
+ ec_code_t *code;
+ void *exec;
+ size_t size;
};
-
union _ec_code_func {
- ec_code_func_linear_t linear;
+ ec_code_func_linear_t linear;
ec_code_func_interleaved_t interleaved;
};
struct _ec_matrix_row {
- ec_code_func_t func;
- uint32_t *values;
+ ec_code_func_t func;
+ uint32_t *values;
};
struct _ec_matrix {
struct list_head lru;
- uint32_t refs;
- uint32_t columns;
- uint32_t rows;
- uintptr_t mask;
- ec_code_t *code;
- uint32_t *values;
- ec_matrix_row_t row_data[0];
+ uint32_t refs;
+ uint32_t columns;
+ uint32_t rows;
+ uintptr_t mask;
+ ec_code_t *code;
+ uint32_t *values;
+ ec_matrix_row_t row_data[0];
};
struct _ec_matrix_list {
- struct list_head lru;
- gf_lock_t lock;
- uint32_t columns;
- uint32_t rows;
- uint32_t max;
- uint32_t count;
- uint32_t stripe;
- struct mem_pool *pool;
- ec_gf_t *gf;
- ec_code_t *code;
- ec_matrix_t *encode;
- ec_matrix_t **objects;
+ struct list_head lru;
+ gf_lock_t lock;
+ uint32_t columns;
+ uint32_t rows;
+ uint32_t max;
+ uint32_t count;
+ uint32_t stripe;
+ struct mem_pool *pool;
+ ec_gf_t *gf;
+ ec_code_t *code;
+ ec_matrix_t *encode;
+ ec_matrix_t **objects;
};
struct _ec_heal {
- struct list_head list;
- gf_lock_t lock;
- xlator_t *xl;
- ec_fop_data_t *fop;
- void *data;
- ec_fop_data_t *lookup;
- loc_t loc;
- struct iatt iatt;
- char *symlink;
- fd_t *fd;
- int32_t partial;
- int32_t done;
- int32_t error;
- gf_boolean_t nameheal;
- uintptr_t available;
- uintptr_t good;
- uintptr_t bad;
- uintptr_t open;
- uintptr_t fixed;
- uint64_t offset;
- uint64_t size;
- uint64_t total_size;
- uint64_t version[2];
- uint64_t raw_size;
+ struct list_head list;
+ gf_lock_t lock;
+ xlator_t *xl;
+ ec_fop_data_t *fop;
+ void *data;
+ ec_fop_data_t *lookup;
+ loc_t loc;
+ struct iatt iatt;
+ char *symlink;
+ fd_t *fd;
+ int32_t partial;
+ int32_t done;
+ int32_t error;
+ gf_boolean_t nameheal;
+ uintptr_t available;
+ uintptr_t good;
+ uintptr_t bad;
+ uintptr_t open;
+ uintptr_t fixed;
+ uint64_t offset;
+ uint64_t size;
+ uint64_t total_size;
+ uint64_t version[2];
+ uint64_t raw_size;
};
struct subvol_healer {
- xlator_t *this;
- int subvol;
- gf_boolean_t running;
- gf_boolean_t rerun;
- pthread_mutex_t mutex;
- pthread_cond_t cond;
- pthread_t thread;
+ xlator_t *this;
+ int subvol;
+ gf_boolean_t running;
+ gf_boolean_t rerun;
+ pthread_mutex_t mutex;
+ pthread_cond_t cond;
+ pthread_t thread;
};
struct _ec_self_heald {
- gf_boolean_t iamshd;
- gf_boolean_t enabled;
- int timeout;
- uint32_t max_threads;
- uint32_t wait_qlength;
- struct subvol_healer *index_healers;
- struct subvol_healer *full_healers;
+ gf_boolean_t iamshd;
+ gf_boolean_t enabled;
+ int timeout;
+ uint32_t max_threads;
+ uint32_t wait_qlength;
+ struct subvol_healer *index_healers;
+ struct subvol_healer *full_healers;
};
struct _ec_statistics {
- struct {
- gf_atomic_t hits; /* Cache hits. */
- gf_atomic_t misses; /* Cache misses. */
- gf_atomic_t updates; /* Number of times an existing stripe has
- been updated with new content. */
- gf_atomic_t invals; /* Number of times an existing stripe has
- been invalidated because of truncates
- or discards. */
- gf_atomic_t evicts; /* Number of times that an existing entry
- has been evicted to make room for newer
- entries. */
- gf_atomic_t allocs; /* Number of memory allocations made to
- store stripes. */
- gf_atomic_t errors; /* Number of errors that have caused extra
- requests. (Basically memory allocation
- errors). */
- } stripe_cache;
+ struct {
+ gf_atomic_t hits; /* Cache hits. */
+ gf_atomic_t misses; /* Cache misses. */
+ gf_atomic_t updates; /* Number of times an existing stripe has
+ been updated with new content. */
+ gf_atomic_t invals; /* Number of times an existing stripe has
+ been invalidated because of truncates
+ or discards. */
+ gf_atomic_t evicts; /* Number of times that an existing entry
+ has been evicted to make room for newer
+ entries. */
+ gf_atomic_t allocs; /* Number of memory allocations made to
+ store stripes. */
+ gf_atomic_t errors; /* Number of errors that have caused extra
+ requests. (Basically memory allocation
+ errors). */
+ } stripe_cache;
};
struct _ec {
- xlator_t *xl;
- int32_t healers;
- int32_t heal_waiters;
- int32_t nodes; /* Total number of bricks(n) */
- int32_t bits_for_nodes;
- int32_t fragments; /* Data bricks(k) */
- int32_t redundancy; /* Redundant bricks(m) */
- uint32_t fragment_size; /* Size of fragment/chunk on a
- brick. */
- uint32_t stripe_size; /* (fragment_size * fragments)
- maximum size of user data
- stored in one stripe. */
- int32_t up; /* Represents whether EC volume is
- up or not. */
- uint32_t idx;
- uint32_t xl_up_count; /* Number of UP bricks. */
- uintptr_t xl_up; /* Bit flag representing UP
- bricks */
- uint32_t xl_notify_count; /* Number of notifications. */
- uintptr_t xl_notify; /* Bit flag representing
- notification for bricks. */
- uintptr_t node_mask;
- xlator_t **xl_list;
- gf_lock_t lock;
- gf_timer_t *timer;
- gf_boolean_t shutdown;
- gf_boolean_t eager_lock;
- gf_boolean_t other_eager_lock;
- gf_boolean_t optimistic_changelog;
- gf_boolean_t parallel_writes;
- uint32_t stripe_cache;
- uint32_t background_heals;
- uint32_t heal_wait_qlen;
- uint32_t self_heal_window_size; /* max size of read/writes */
- uint32_t eager_lock_timeout;
- uint32_t other_eager_lock_timeout;
- struct list_head pending_fops;
- struct list_head heal_waiting;
- struct list_head healing;
- struct mem_pool *fop_pool;
- struct mem_pool *cbk_pool;
- struct mem_pool *lock_pool;
- ec_self_heald_t shd;
- char vol_uuid[UUID_SIZE + 1];
- dict_t *leaf_to_subvolid;
- ec_read_policy_t read_policy;
- ec_matrix_list_t matrix;
- ec_statistics_t stats;
+ xlator_t *xl;
+ int32_t healers;
+ int32_t heal_waiters;
+ int32_t nodes; /* Total number of bricks(n) */
+ int32_t bits_for_nodes;
+ int32_t fragments; /* Data bricks(k) */
+ int32_t redundancy; /* Redundant bricks(m) */
+ uint32_t fragment_size; /* Size of fragment/chunk on a
+ brick. */
+ uint32_t stripe_size; /* (fragment_size * fragments)
+ maximum size of user data
+ stored in one stripe. */
+ int32_t up; /* Represents whether EC volume is
+ up or not. */
+ uint32_t idx;
+ uint32_t xl_up_count; /* Number of UP bricks. */
+ uintptr_t xl_up; /* Bit flag representing UP
+ bricks */
+ uint32_t xl_notify_count; /* Number of notifications. */
+ uintptr_t xl_notify; /* Bit flag representing
+ notification for bricks. */
+ uintptr_t node_mask;
+ xlator_t **xl_list;
+ gf_lock_t lock;
+ gf_timer_t *timer;
+ gf_boolean_t shutdown;
+ gf_boolean_t eager_lock;
+ gf_boolean_t other_eager_lock;
+ gf_boolean_t optimistic_changelog;
+ gf_boolean_t parallel_writes;
+ uint32_t stripe_cache;
+ uint32_t background_heals;
+ uint32_t heal_wait_qlen;
+ uint32_t self_heal_window_size; /* max size of read/writes */
+ uint32_t eager_lock_timeout;
+ uint32_t other_eager_lock_timeout;
+ struct list_head pending_fops;
+ struct list_head heal_waiting;
+ struct list_head healing;
+ struct mem_pool *fop_pool;
+ struct mem_pool *cbk_pool;
+ struct mem_pool *lock_pool;
+ ec_self_heald_t shd;
+ char vol_uuid[UUID_SIZE + 1];
+ dict_t *leaf_to_subvolid;
+ ec_read_policy_t read_policy;
+ ec_matrix_list_t matrix;
+ ec_statistics_t stats;
};
#endif /* __EC_TYPES_H__ */
diff --git a/xlators/cluster/ec/src/ec.h b/xlators/cluster/ec/src/ec.h
index e2ec9cf04f5..1b210d9adc1 100644
--- a/xlators/cluster/ec/src/ec.h
+++ b/xlators/cluster/ec/src/ec.h
@@ -13,15 +13,15 @@
#include "ec-method.h"
-#define EC_XATTR_PREFIX "trusted.ec."
-#define EC_XATTR_CONFIG EC_XATTR_PREFIX"config"
-#define EC_XATTR_SIZE EC_XATTR_PREFIX"size"
-#define EC_XATTR_VERSION EC_XATTR_PREFIX"version"
-#define EC_XATTR_HEAL EC_XATTR_PREFIX"heal"
-#define EC_XATTR_DIRTY EC_XATTR_PREFIX"dirty"
-#define EC_STRIPE_CACHE_MAX_SIZE 10
+#define EC_XATTR_PREFIX "trusted.ec."
+#define EC_XATTR_CONFIG EC_XATTR_PREFIX "config"
+#define EC_XATTR_SIZE EC_XATTR_PREFIX "size"
+#define EC_XATTR_VERSION EC_XATTR_PREFIX "version"
+#define EC_XATTR_HEAL EC_XATTR_PREFIX "heal"
+#define EC_XATTR_DIRTY EC_XATTR_PREFIX "dirty"
+#define EC_STRIPE_CACHE_MAX_SIZE 10
#define EC_VERSION_SIZE 2
-#define EC_SHD_INODE_LRU_LIMIT 10
+#define EC_SHD_INODE_LRU_LIMIT 10
#define EC_MAX_FRAGMENTS EC_METHOD_MAX_FRAGMENTS
/* The maximum number of nodes is derived from the maximum allowed fragments
diff --git a/xlators/cluster/stripe/src/stripe-mem-types.h b/xlators/cluster/stripe/src/stripe-mem-types.h
index e9ac9cf4648..dcbef31212b 100644
--- a/xlators/cluster/stripe/src/stripe-mem-types.h
+++ b/xlators/cluster/stripe/src/stripe-mem-types.h
@@ -8,24 +8,22 @@
cases as published by the Free Software Foundation.
*/
-
#ifndef __STRIPE_MEM_TYPES_H__
#define __STRIPE_MEM_TYPES_H__
#include "mem-types.h"
enum gf_stripe_mem_types_ {
- gf_stripe_mt_iovec = gf_common_mt_end + 1,
- gf_stripe_mt_stripe_replies,
- gf_stripe_mt_stripe_fd_ctx_t,
- gf_stripe_mt_char,
- gf_stripe_mt_int8_t,
- gf_stripe_mt_int32_t,
- gf_stripe_mt_xlator_t,
- gf_stripe_mt_stripe_private_t,
- gf_stripe_mt_stripe_options,
- gf_stripe_mt_xattr_sort_t,
- gf_stripe_mt_end
+ gf_stripe_mt_iovec = gf_common_mt_end + 1,
+ gf_stripe_mt_stripe_replies,
+ gf_stripe_mt_stripe_fd_ctx_t,
+ gf_stripe_mt_char,
+ gf_stripe_mt_int8_t,
+ gf_stripe_mt_int32_t,
+ gf_stripe_mt_xlator_t,
+ gf_stripe_mt_stripe_private_t,
+ gf_stripe_mt_stripe_options,
+ gf_stripe_mt_xattr_sort_t,
+ gf_stripe_mt_end
};
#endif
-
diff --git a/xlators/cluster/stripe/src/stripe.h b/xlators/cluster/stripe/src/stripe.h
index 1e2fcb4e659..103c96491ff 100644
--- a/xlators/cluster/stripe/src/stripe.h
+++ b/xlators/cluster/stripe/src/stripe.h
@@ -8,7 +8,6 @@
cases as published by the Free Software Foundation.
*/
-
#ifndef _STRIPE_H_
#define _STRIPE_H_
@@ -24,53 +23,55 @@
#include <signal.h>
#define STRIPE_PATHINFO_HEADER "STRIPE:"
-#define STRIPE_MIN_BLOCK_SIZE (16*GF_UNIT_KB)
-
-#define STRIPE_STACK_UNWIND(fop, frame, params ...) do { \
- stripe_local_t *__local = NULL; \
- if (frame) { \
- __local = frame->local; \
- frame->local = NULL; \
- } \
- STACK_UNWIND_STRICT (fop, frame, params); \
- if (__local) { \
- stripe_local_wipe(__local); \
- mem_put (__local); \
- } \
- } while (0)
-
-#define STRIPE_STACK_DESTROY(frame) do { \
- stripe_local_t *__local = NULL; \
- __local = frame->local; \
- frame->local = NULL; \
- STACK_DESTROY (frame->root); \
- if (__local) { \
- stripe_local_wipe (__local); \
- mem_put (__local); \
- } \
- } while (0)
-
-#define STRIPE_VALIDATE_FCTX(fctx, label) do { \
- int idx = 0; \
- if (!fctx) { \
- op_errno = EINVAL; \
- goto label; \
- } \
- for (idx = 0; idx < fctx->stripe_count; idx++) { \
- if (!fctx->xl_array[idx]) { \
- gf_log (this->name, GF_LOG_ERROR, \
- "fctx->xl_array[%d] is NULL", \
- idx); \
- op_errno = ESTALE; \
- goto label; \
- } \
- } \
- } while (0)
+#define STRIPE_MIN_BLOCK_SIZE (16 * GF_UNIT_KB)
+
+#define STRIPE_STACK_UNWIND(fop, frame, params...) \
+ do { \
+ stripe_local_t *__local = NULL; \
+ if (frame) { \
+ __local = frame->local; \
+ frame->local = NULL; \
+ } \
+ STACK_UNWIND_STRICT(fop, frame, params); \
+ if (__local) { \
+ stripe_local_wipe(__local); \
+ mem_put(__local); \
+ } \
+ } while (0)
+
+#define STRIPE_STACK_DESTROY(frame) \
+ do { \
+ stripe_local_t *__local = NULL; \
+ __local = frame->local; \
+ frame->local = NULL; \
+ STACK_DESTROY(frame->root); \
+ if (__local) { \
+ stripe_local_wipe(__local); \
+ mem_put(__local); \
+ } \
+ } while (0)
+
+#define STRIPE_VALIDATE_FCTX(fctx, label) \
+ do { \
+ int idx = 0; \
+ if (!fctx) { \
+ op_errno = EINVAL; \
+ goto label; \
+ } \
+ for (idx = 0; idx < fctx->stripe_count; idx++) { \
+ if (!fctx->xl_array[idx]) { \
+ gf_log(this->name, GF_LOG_ERROR, "fctx->xl_array[%d] is NULL", \
+ idx); \
+ op_errno = ESTALE; \
+ goto label; \
+ } \
+ } \
+ } while (0)
typedef struct stripe_xattr_sort {
- int pos;
- int xattr_len;
- char *xattr_value;
+ int pos;
+ int xattr_len;
+ char *xattr_value;
} stripe_xattr_sort_t;
/**
@@ -78,204 +79,213 @@ typedef struct stripe_xattr_sort {
* information, which is used for striping on a file.
*/
struct stripe_options {
- struct stripe_options *next;
- char path_pattern[256];
- uint64_t block_size;
+ struct stripe_options *next;
+ char path_pattern[256];
+ uint64_t block_size;
};
/**
* Private structure for stripe translator
*/
struct stripe_private {
- struct stripe_options *pattern;
- xlator_t **xl_array;
- uint64_t block_size;
- gf_lock_t lock;
- uint8_t nodes_down;
- int8_t first_child_down;
- int *last_event;
- int8_t child_count;
- gf_boolean_t xattr_supported; /* default yes */
- gf_boolean_t coalesce;
- char vol_uuid[UUID_SIZE + 1];
+ struct stripe_options *pattern;
+ xlator_t **xl_array;
+ uint64_t block_size;
+ gf_lock_t lock;
+ uint8_t nodes_down;
+ int8_t first_child_down;
+ int *last_event;
+ int8_t child_count;
+ gf_boolean_t xattr_supported; /* default yes */
+ gf_boolean_t coalesce;
+ char vol_uuid[UUID_SIZE + 1];
};
/**
* Used to keep info about the replies received from readv/writev calls
*/
struct stripe_replies {
- struct iovec *vector;
- int32_t count; //count of vector
- int32_t op_ret; //op_ret of readv
- int32_t op_errno;
- int32_t requested_size;
- struct iatt stbuf; /* 'stbuf' is also a part of reply */
+ struct iovec *vector;
+ int32_t count; // count of vector
+ int32_t op_ret; // op_ret of readv
+ int32_t op_errno;
+ int32_t requested_size;
+ struct iatt stbuf; /* 'stbuf' is also a part of reply */
};
typedef struct _stripe_fd_ctx {
- off_t stripe_size;
- int stripe_count;
- int stripe_coalesce;
- int static_array;
- xlator_t **xl_array;
+ off_t stripe_size;
+ int stripe_count;
+ int stripe_coalesce;
+ int static_array;
+ xlator_t **xl_array;
} stripe_fd_ctx_t;
-
/**
* Local structure to be passed with all the frames in case of STACK_WIND
*/
struct stripe_local; /* this itself is used inside the structure; */
struct stripe_local {
- struct stripe_local *next;
- call_frame_t *orig_frame;
-
- stripe_fd_ctx_t *fctx;
-
- /* Used by _cbk functions */
- struct iatt stbuf;
- struct iatt pre_buf;
- struct iatt post_buf;
- struct iatt preparent;
- struct iatt postparent;
-
- off_t stbuf_size;
- off_t prebuf_size;
- off_t postbuf_size;
- off_t preparent_size;
- off_t postparent_size;
-
- blkcnt_t stbuf_blocks;
- blkcnt_t prebuf_blocks;
- blkcnt_t postbuf_blocks;
- blkcnt_t preparent_blocks;
- blkcnt_t postparent_blocks;
-
- struct stripe_replies *replies;
- struct statvfs statvfs_buf;
- dir_entry_t *entry;
-
- int8_t revalidate;
- int8_t failed;
- int8_t unwind;
-
- size_t readv_size;
- int32_t entry_count;
- int32_t node_index;
- int32_t call_count;
- int32_t wind_count; /* used instead of child_cound
- in case of read and write */
- int32_t op_ret;
- int32_t op_errno;
- int32_t count;
- int32_t flags;
- char *name;
- inode_t *inode;
-
- loc_t loc;
- loc_t loc2;
-
- mode_t mode;
- dev_t rdev;
- /* For File I/O fops */
- dict_t *xdata;
-
- stripe_xattr_sort_t *xattr_list;
- int32_t xattr_total_len;
- int32_t nallocs;
- char xsel[256];
-
- /* General usage */
- off_t offset;
- off_t stripe_size;
-
- int xattr_self_heal_needed;
- int entry_self_heal_needed;
-
- int8_t *list;
- struct gf_flock lock;
- fd_t *fd;
- void *value;
- struct iobref *iobref;
- gf_dirent_t entries;
- gf_dirent_t *dirent;
- dict_t *xattr;
- uuid_t ia_gfid;
-
- int xflag;
- mode_t umask;
+ struct stripe_local *next;
+ call_frame_t *orig_frame;
+
+ stripe_fd_ctx_t *fctx;
+
+ /* Used by _cbk functions */
+ struct iatt stbuf;
+ struct iatt pre_buf;
+ struct iatt post_buf;
+ struct iatt preparent;
+ struct iatt postparent;
+
+ off_t stbuf_size;
+ off_t prebuf_size;
+ off_t postbuf_size;
+ off_t preparent_size;
+ off_t postparent_size;
+
+ blkcnt_t stbuf_blocks;
+ blkcnt_t prebuf_blocks;
+ blkcnt_t postbuf_blocks;
+ blkcnt_t preparent_blocks;
+ blkcnt_t postparent_blocks;
+
+ struct stripe_replies *replies;
+ struct statvfs statvfs_buf;
+ dir_entry_t *entry;
+
+ int8_t revalidate;
+ int8_t failed;
+ int8_t unwind;
+
+ size_t readv_size;
+ int32_t entry_count;
+ int32_t node_index;
+ int32_t call_count;
+ int32_t wind_count; /* used instead of child_cound
+ in case of read and write */
+ int32_t op_ret;
+ int32_t op_errno;
+ int32_t count;
+ int32_t flags;
+ char *name;
+ inode_t *inode;
+
+ loc_t loc;
+ loc_t loc2;
+
+ mode_t mode;
+ dev_t rdev;
+ /* For File I/O fops */
+ dict_t *xdata;
+
+ stripe_xattr_sort_t *xattr_list;
+ int32_t xattr_total_len;
+ int32_t nallocs;
+ char xsel[256];
+
+ /* General usage */
+ off_t offset;
+ off_t stripe_size;
+
+ int xattr_self_heal_needed;
+ int entry_self_heal_needed;
+
+ int8_t *list;
+ struct gf_flock lock;
+ fd_t *fd;
+ void *value;
+ struct iobref *iobref;
+ gf_dirent_t entries;
+ gf_dirent_t *dirent;
+ dict_t *xattr;
+ uuid_t ia_gfid;
+
+ int xflag;
+ mode_t umask;
};
-typedef struct stripe_local stripe_local_t;
+typedef struct stripe_local stripe_local_t;
typedef struct stripe_private stripe_private_t;
/*
* Determine the stripe index of a particular frame based on the translator.
*/
-static inline int32_t stripe_get_frame_index(stripe_fd_ctx_t *fctx,
- call_frame_t *prev)
+static inline int32_t
+stripe_get_frame_index(stripe_fd_ctx_t *fctx, call_frame_t *prev)
{
- int32_t i, idx = -1;
+ int32_t i, idx = -1;
- for (i = 0; i < fctx->stripe_count; i++) {
- if (fctx->xl_array[i] == prev->this) {
- idx = i;
- break;
- }
- }
+ for (i = 0; i < fctx->stripe_count; i++) {
+ if (fctx->xl_array[i] == prev->this) {
+ idx = i;
+ break;
+ }
+ }
- return idx;
+ return idx;
}
-static inline void stripe_copy_xl_array(xlator_t **dst, xlator_t **src,
- int count)
+static inline void
+stripe_copy_xl_array(xlator_t **dst, xlator_t **src, int count)
{
- int i;
+ int i;
- for (i = 0; i < count; i++)
- dst[i] = src[i];
+ for (i = 0; i < count; i++)
+ dst[i] = src[i];
}
-void stripe_local_wipe (stripe_local_t *local);
-int32_t stripe_ctx_handle (xlator_t *this, call_frame_t *prev,
- stripe_local_t *local, dict_t *dict);
-void stripe_aggregate_xattr (dict_t *dst, dict_t *src);
-int32_t stripe_xattr_request_build (xlator_t *this, dict_t *dict,
- uint64_t stripe_size, uint32_t stripe_count,
- uint32_t stripe_index,
- uint32_t stripe_coalesce);
-int32_t stripe_get_matching_bs (const char *path, stripe_private_t *priv);
-int set_stripe_block_size (xlator_t *this, stripe_private_t *priv, char *data);
-int32_t stripe_iatt_merge (struct iatt *from, struct iatt *to);
-int32_t stripe_fill_pathinfo_xattr (xlator_t *this, stripe_local_t *local,
- char **xattr_serz);
-int32_t stripe_free_xattr_str (stripe_local_t *local);
-int32_t stripe_xattr_aggregate (char *buffer, stripe_local_t *local,
- int32_t *total);
-off_t coalesced_offset(off_t offset, uint64_t stripe_size, int stripe_count);
-off_t uncoalesced_size(off_t size, uint64_t stripe_size, int stripe_count,
- int stripe_index);
+void
+stripe_local_wipe(stripe_local_t *local);
+int32_t
+stripe_ctx_handle(xlator_t *this, call_frame_t *prev, stripe_local_t *local,
+ dict_t *dict);
+void
+stripe_aggregate_xattr(dict_t *dst, dict_t *src);
+int32_t
+stripe_xattr_request_build(xlator_t *this, dict_t *dict, uint64_t stripe_size,
+ uint32_t stripe_count, uint32_t stripe_index,
+ uint32_t stripe_coalesce);
+int32_t
+stripe_get_matching_bs(const char *path, stripe_private_t *priv);
+int
+set_stripe_block_size(xlator_t *this, stripe_private_t *priv, char *data);
+int32_t
+stripe_iatt_merge(struct iatt *from, struct iatt *to);
+int32_t
+stripe_fill_pathinfo_xattr(xlator_t *this, stripe_local_t *local,
+ char **xattr_serz);
+int32_t
+stripe_free_xattr_str(stripe_local_t *local);
+int32_t
+stripe_xattr_aggregate(char *buffer, stripe_local_t *local, int32_t *total);
+off_t
+coalesced_offset(off_t offset, uint64_t stripe_size, int stripe_count);
+off_t
+uncoalesced_size(off_t size, uint64_t stripe_size, int stripe_count,
+ int stripe_index);
int32_t
-stripe_fill_lockinfo_xattr (xlator_t *this, stripe_local_t *local,
- void **xattr_serz);
+stripe_fill_lockinfo_xattr(xlator_t *this, stripe_local_t *local,
+ void **xattr_serz);
/*
* Adjust the size attribute for files if coalesce is enabled.
*/
-static inline void correct_file_size(struct iatt *buf, stripe_fd_ctx_t *fctx,
- call_frame_t *prev)
+static inline void
+correct_file_size(struct iatt *buf, stripe_fd_ctx_t *fctx, call_frame_t *prev)
{
- int index;
+ int index;
- if (!IA_ISREG(buf->ia_type))
- return;
+ if (!IA_ISREG(buf->ia_type))
+ return;
- if (!fctx || !fctx->stripe_coalesce)
- return;
+ if (!fctx || !fctx->stripe_coalesce)
+ return;
- index = stripe_get_frame_index(fctx, prev);
- buf->ia_size = uncoalesced_size(buf->ia_size, fctx->stripe_size,
- fctx->stripe_count, index);
+ index = stripe_get_frame_index(fctx, prev);
+ buf->ia_size = uncoalesced_size(buf->ia_size, fctx->stripe_size,
+ fctx->stripe_count, index);
}
#endif /* _STRIPE_H_ */
diff --git a/xlators/debug/delay-gen/src/delay-gen-mem-types.h b/xlators/debug/delay-gen/src/delay-gen-mem-types.h
index 8c54f5f922e..63a15a70da3 100644
--- a/xlators/debug/delay-gen/src/delay-gen-mem-types.h
+++ b/xlators/debug/delay-gen/src/delay-gen-mem-types.h
@@ -8,15 +8,14 @@
* cases as published by the Free Software Foundation.
*/
-
#ifndef __DELAY_GEN_MEM_TYPES_H__
#define __DELAY_GEN_MEM_TYPES_H__
#include "mem-types.h"
enum gf_delay_gen_mem_types_ {
- gf_delay_gen_mt_dg_t = gf_common_mt_end + 1,
- gf_delay_gen_mt_end
+ gf_delay_gen_mt_dg_t = gf_common_mt_end + 1,
+ gf_delay_gen_mt_end
};
#endif /* __DELAY_GEN_MEM_TYPES_H__ */
diff --git a/xlators/debug/delay-gen/src/delay-gen.h b/xlators/debug/delay-gen/src/delay-gen.h
index e1111c782e2..5e4d179f0b4 100644
--- a/xlators/debug/delay-gen/src/delay-gen.h
+++ b/xlators/debug/delay-gen/src/delay-gen.h
@@ -8,7 +8,6 @@
* cases as published by the Free Software Foundation.
*/
-
#ifndef __DELAY_GEN_H__
#define __DELAY_GEN_H__
@@ -19,10 +18,10 @@
#include "defaults.h"
typedef struct {
- int enable[GF_FOP_MAXVALUE];
- int op_count;
- int delay_ppm;
- int delay_duration;
+ int enable[GF_FOP_MAXVALUE];
+ int op_count;
+ int delay_ppm;
+ int delay_duration;
} dg_t;
#endif /* __DELAY_GEN_H__ */
diff --git a/xlators/debug/error-gen/src/error-gen-mem-types.h b/xlators/debug/error-gen/src/error-gen-mem-types.h
index f02280535df..2facd6b27cb 100644
--- a/xlators/debug/error-gen/src/error-gen-mem-types.h
+++ b/xlators/debug/error-gen/src/error-gen-mem-types.h
@@ -14,7 +14,7 @@
#include "mem-types.h"
enum gf_error_gen_mem_types_ {
- gf_error_gen_mt_eg_t = gf_common_mt_end + 1,
- gf_error_gen_mt_end
+ gf_error_gen_mt_eg_t = gf_common_mt_end + 1,
+ gf_error_gen_mt_end
};
#endif
diff --git a/xlators/debug/error-gen/src/error-gen.h b/xlators/debug/error-gen/src/error-gen.h
index 2cd95de335a..ffa09252d0f 100644
--- a/xlators/debug/error-gen/src/error-gen.h
+++ b/xlators/debug/error-gen/src/error-gen.h
@@ -22,29 +22,29 @@
* range.
*/
enum GF_PSEUDO_ERRORS {
- GF_ERROR_SHORT_WRITE = 1000, /* short writev return value */
- GF_ERROR_MAX
+ GF_ERROR_SHORT_WRITE = 1000, /* short writev return value */
+ GF_ERROR_MAX
};
typedef struct {
- int enable[GF_FOP_MAXVALUE];
- int op_count;
- /*
- * This is only an iteration number in the random-failure case. For
- * the normal controlled-probability case, it's actually a numerator
- * for the failure probability (see FAILURE_GRANULARITY declaration).
- * It's just not worth blowing up the diff by changing it.
- */
- int failure_iter_no;
- char *error_no;
- int error_no_int;
- gf_boolean_t random_failure;
- gf_lock_t lock;
+ int enable[GF_FOP_MAXVALUE];
+ int op_count;
+ /*
+ * This is only an iteration number in the random-failure case. For
+ * the normal controlled-probability case, it's actually a numerator
+ * for the failure probability (see FAILURE_GRANULARITY declaration).
+ * It's just not worth blowing up the diff by changing it.
+ */
+ int failure_iter_no;
+ char *error_no;
+ int error_no_int;
+ gf_boolean_t random_failure;
+ gf_lock_t lock;
} eg_t;
typedef struct {
- int error_no_count;
- int error_no[20];
+ int error_no_count;
+ int error_no[20];
} sys_error_t;
#endif
diff --git a/xlators/debug/io-stats/src/io-stats-mem-types.h b/xlators/debug/io-stats/src/io-stats-mem-types.h
index 9dde9373264..bc25fd2ca4e 100644
--- a/xlators/debug/io-stats/src/io-stats-mem-types.h
+++ b/xlators/debug/io-stats/src/io-stats-mem-types.h
@@ -16,13 +16,12 @@
extern const char *__progname;
enum gf_io_stats_mem_types_ {
- gf_io_stats_mt_ios_conf = gf_common_mt_end + 1,
- gf_io_stats_mt_ios_fd,
- gf_io_stats_mt_ios_stat,
- gf_io_stats_mt_ios_stat_list,
- gf_io_stats_mt_ios_sample_buf,
- gf_io_stats_mt_ios_sample,
- gf_io_stats_mt_end
+ gf_io_stats_mt_ios_conf = gf_common_mt_end + 1,
+ gf_io_stats_mt_ios_fd,
+ gf_io_stats_mt_ios_stat,
+ gf_io_stats_mt_ios_stat_list,
+ gf_io_stats_mt_ios_sample_buf,
+ gf_io_stats_mt_ios_sample,
+ gf_io_stats_mt_end
};
#endif
-
diff --git a/xlators/debug/trace/src/trace-mem-types.h b/xlators/debug/trace/src/trace-mem-types.h
index 9fa7d97c2ca..cf05a77b9f1 100644
--- a/xlators/debug/trace/src/trace-mem-types.h
+++ b/xlators/debug/trace/src/trace-mem-types.h
@@ -8,14 +8,13 @@
cases as published by the Free Software Foundation.
*/
-
#ifndef __TRACE_MEM_TYPES_H__
#define __TRACE_MEM_TYPES_H__
#include "mem-types.h"
enum gf_trace_mem_types_ {
- gf_trace_mt_trace_conf_t = gf_common_mt_end + 1,
- gf_trace_mt_end
+ gf_trace_mt_trace_conf_t = gf_common_mt_end + 1,
+ gf_trace_mt_end
};
#endif
diff --git a/xlators/debug/trace/src/trace.h b/xlators/debug/trace/src/trace.h
index 3b5f7891d00..815647c05be 100644
--- a/xlators/debug/trace/src/trace.h
+++ b/xlators/debug/trace/src/trace.h
@@ -22,35 +22,34 @@
#define TRACE_DEFAULT_HISTORY_SIZE 1024
typedef struct {
- /* Since the longest fop name is fremovexattr i.e 12 characters, array size
- * is kept 24, i.e double of the maximum.
- */
- char name[24];
- int enabled;
+ /* Since the longest fop name is fremovexattr i.e 12 characters, array size
+ * is kept 24, i.e double of the maximum.
+ */
+ char name[24];
+ int enabled;
} trace_fop_name_t;
trace_fop_name_t trace_fop_names[GF_FOP_MAXVALUE];
typedef struct {
- gf_boolean_t log_file;
- gf_boolean_t log_history;
- size_t history_size;
- int trace_log_level;
+ gf_boolean_t log_file;
+ gf_boolean_t log_history;
+ size_t history_size;
+ int trace_log_level;
} trace_conf_t;
-#define TRACE_STACK_UNWIND(op, frame, params ...) \
- do { \
- frame->local = NULL; \
- STACK_UNWIND_STRICT (op, frame, params); \
- } while (0);
-
-#define LOG_ELEMENT(_conf, _string) \
- do { \
- if (_conf) { \
- if ((_conf->log_history) == _gf_true) \
- gf_log_eh ("%s", _string); \
- if ((_conf->log_file) == _gf_true) \
- gf_log (THIS->name, _conf->trace_log_level, \
- "%s", _string); \
- } \
- } while (0);
+#define TRACE_STACK_UNWIND(op, frame, params...) \
+ do { \
+ frame->local = NULL; \
+ STACK_UNWIND_STRICT(op, frame, params); \
+ } while (0);
+
+#define LOG_ELEMENT(_conf, _string) \
+ do { \
+ if (_conf) { \
+ if ((_conf->log_history) == _gf_true) \
+ gf_log_eh("%s", _string); \
+ if ((_conf->log_file) == _gf_true) \
+ gf_log(THIS->name, _conf->trace_log_level, "%s", _string); \
+ } \
+ } while (0);
diff --git a/xlators/encryption/crypt/src/crypt-common.h b/xlators/encryption/crypt/src/crypt-common.h
index 7c212ad5d25..123d5c2a631 100644
--- a/xlators/encryption/crypt/src/crypt-common.h
+++ b/xlators/encryption/crypt/src/crypt-common.h
@@ -12,75 +12,79 @@
#define __CRYPT_COMMON_H__
#define INVAL_SUBVERSION_NUMBER (0xff)
-#define CRYPT_INVAL_OP (GF_FOP_NULL)
-
-#define CRYPTO_FORMAT_PREFIX "trusted.glusterfs.crypt.att.cfmt"
-#define FSIZE_XATTR_PREFIX "trusted.glusterfs.crypt.att.size"
-#define SUBREQ_PREFIX "trusted.glusterfs.crypt.msg.sreq"
-#define FSIZE_MSG_PREFIX "trusted.glusterfs.crypt.msg.size"
-#define DE_MSG_PREFIX "trusted.glusterfs.crypt.msg.dent"
-#define REQUEST_ID_PREFIX "trusted.glusterfs.crypt.msg.rqid"
-#define MSGFLAGS_PREFIX "trusted.glusterfs.crypt.msg.xfgs"
+#define CRYPT_INVAL_OP (GF_FOP_NULL)
+#define CRYPTO_FORMAT_PREFIX "trusted.glusterfs.crypt.att.cfmt"
+#define FSIZE_XATTR_PREFIX "trusted.glusterfs.crypt.att.size"
+#define SUBREQ_PREFIX "trusted.glusterfs.crypt.msg.sreq"
+#define FSIZE_MSG_PREFIX "trusted.glusterfs.crypt.msg.size"
+#define DE_MSG_PREFIX "trusted.glusterfs.crypt.msg.dent"
+#define REQUEST_ID_PREFIX "trusted.glusterfs.crypt.msg.rqid"
+#define MSGFLAGS_PREFIX "trusted.glusterfs.crypt.msg.xfgs"
/* messages for crypt_open() */
-#define MSGFLAGS_REQUEST_MTD_RLOCK 1 /* take read lock and don't unlock */
-#define MSGFLAGS_REQUEST_MTD_WLOCK 2 /* take write lock and don't unlock */
+#define MSGFLAGS_REQUEST_MTD_RLOCK 1 /* take read lock and don't unlock */
+#define MSGFLAGS_REQUEST_MTD_WLOCK 2 /* take write lock and don't unlock */
#define AES_BLOCK_BITS (4) /* AES_BLOCK_SIZE == 1 << AES_BLOCK_BITS */
-#define noop do {; } while (0)
-#define cassert(cond) ({ switch (-1) { case (cond): case 0: break; } })
+#define noop \
+ do { \
+ ; \
+ } while (0)
+#define cassert(cond) \
+ ({ \
+ switch (-1) { \
+ case (cond): \
+ case 0: \
+ break; \
+ } \
+ })
#define __round_mask(x, y) ((__typeof__(x))((y)-1))
-#define round_up(x, y) ((((x)-1) | __round_mask(x, y))+1)
+#define round_up(x, y) ((((x)-1) | __round_mask(x, y)) + 1)
/*
* Format of file's metadata
*/
struct crypt_format {
- uint8_t loader_id; /* version of metadata loader */
- uint8_t versioned[0]; /* file's metadata of specific version */
+ uint8_t loader_id; /* version of metadata loader */
+ uint8_t versioned[0]; /* file's metadata of specific version */
} __attribute__((packed));
-typedef enum {
- AES_CIPHER_ALG,
- LAST_CIPHER_ALG
-} cipher_alg_t;
+typedef enum { AES_CIPHER_ALG, LAST_CIPHER_ALG } cipher_alg_t;
-typedef enum {
- XTS_CIPHER_MODE,
- LAST_CIPHER_MODE
-} cipher_mode_t;
+typedef enum { XTS_CIPHER_MODE, LAST_CIPHER_MODE } cipher_mode_t;
-typedef enum {
- MTD_LOADER_V1,
- LAST_MTD_LOADER
-} mtd_loader_id;
+typedef enum { MTD_LOADER_V1, LAST_MTD_LOADER } mtd_loader_id;
-static inline void msgflags_set_mtd_rlock(uint32_t *flags)
+static inline void
+msgflags_set_mtd_rlock(uint32_t *flags)
{
- *flags |= MSGFLAGS_REQUEST_MTD_RLOCK;
+ *flags |= MSGFLAGS_REQUEST_MTD_RLOCK;
}
-static inline void msgflags_set_mtd_wlock(uint32_t *flags)
+static inline void
+msgflags_set_mtd_wlock(uint32_t *flags)
{
- *flags |= MSGFLAGS_REQUEST_MTD_WLOCK;
+ *flags |= MSGFLAGS_REQUEST_MTD_WLOCK;
}
-static inline gf_boolean_t msgflags_check_mtd_rlock(uint32_t *flags)
+static inline gf_boolean_t
+msgflags_check_mtd_rlock(uint32_t *flags)
{
- return *flags & MSGFLAGS_REQUEST_MTD_RLOCK;
+ return *flags & MSGFLAGS_REQUEST_MTD_RLOCK;
}
-static inline gf_boolean_t msgflags_check_mtd_wlock(uint32_t *flags)
+static inline gf_boolean_t
+msgflags_check_mtd_wlock(uint32_t *flags)
{
- return *flags & MSGFLAGS_REQUEST_MTD_WLOCK;
+ return *flags & MSGFLAGS_REQUEST_MTD_WLOCK;
}
-static inline gf_boolean_t msgflags_check_mtd_lock(uint32_t *flags)
+static inline gf_boolean_t
+msgflags_check_mtd_lock(uint32_t *flags)
{
- return msgflags_check_mtd_rlock(flags) ||
- msgflags_check_mtd_wlock(flags);
+ return msgflags_check_mtd_rlock(flags) || msgflags_check_mtd_wlock(flags);
}
/*
@@ -88,10 +92,10 @@ static inline gf_boolean_t msgflags_check_mtd_lock(uint32_t *flags)
* (maybe partially) by @count bytes
* at offset @start.
*/
-static inline off_t logical_blocks_occupied(uint64_t start, off_t count,
- int blkbits)
+static inline off_t
+logical_blocks_occupied(uint64_t start, off_t count, int blkbits)
{
- return ((start + count - 1) >> blkbits) - (start >> blkbits) + 1;
+ return ((start + count - 1) >> blkbits) - (start >> blkbits) + 1;
}
/*
@@ -99,32 +103,20 @@ static inline off_t logical_blocks_occupied(uint64_t start, off_t count,
* and @off2 respectively) in the same logical
* block.
*/
-static inline int in_same_lblock(uint64_t off1, uint64_t off2,
- int blkbits)
+static inline int
+in_same_lblock(uint64_t off1, uint64_t off2, int blkbits)
{
- return off1 >> blkbits == off2 >> blkbits;
+ return off1 >> blkbits == off2 >> blkbits;
}
-static inline void dump_cblock(xlator_t *this, unsigned char *buf)
+static inline void
+dump_cblock(xlator_t *this, unsigned char *buf)
{
- gf_log(this->name, GF_LOG_DEBUG,
- "dump cblock: %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x",
- (buf)[0],
- (buf)[1],
- (buf)[2],
- (buf)[3],
- (buf)[4],
- (buf)[5],
- (buf)[6],
- (buf)[7],
- (buf)[8],
- (buf)[9],
- (buf)[10],
- (buf)[11],
- (buf)[12],
- (buf)[13],
- (buf)[14],
- (buf)[15]);
+ gf_log(this->name, GF_LOG_DEBUG,
+ "dump cblock: %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x",
+ (buf)[0], (buf)[1], (buf)[2], (buf)[3], (buf)[4], (buf)[5], (buf)[6],
+ (buf)[7], (buf)[8], (buf)[9], (buf)[10], (buf)[11], (buf)[12],
+ (buf)[13], (buf)[14], (buf)[15]);
}
#endif /* __CRYPT_COMMON_H__ */
diff --git a/xlators/encryption/crypt/src/crypt-mem-types.h b/xlators/encryption/crypt/src/crypt-mem-types.h
index 1954c579423..7e9fb90ed43 100644
--- a/xlators/encryption/crypt/src/crypt-mem-types.h
+++ b/xlators/encryption/crypt/src/crypt-mem-types.h
@@ -8,24 +8,23 @@
cases as published by the Free Software Foundation.
*/
-
#ifndef __CRYPT_MEM_TYPES_H__
#define __CRYPT_MEM_TYPES_H__
#include "mem-types.h"
enum gf_crypt_mem_types_ {
- gf_crypt_mt_priv = gf_common_mt_end + 1,
- gf_crypt_mt_inode,
- gf_crypt_mt_data,
- gf_crypt_mt_mtd,
- gf_crypt_mt_loc,
- gf_crypt_mt_iatt,
- gf_crypt_mt_key,
- gf_crypt_mt_iovec,
- gf_crypt_mt_char,
- gf_crypt_mt_local,
- gf_crypt_mt_end,
+ gf_crypt_mt_priv = gf_common_mt_end + 1,
+ gf_crypt_mt_inode,
+ gf_crypt_mt_data,
+ gf_crypt_mt_mtd,
+ gf_crypt_mt_loc,
+ gf_crypt_mt_iatt,
+ gf_crypt_mt_key,
+ gf_crypt_mt_iovec,
+ gf_crypt_mt_char,
+ gf_crypt_mt_local,
+ gf_crypt_mt_end,
};
#endif /* __CRYPT_MEM_TYPES_H__ */
@@ -40,6 +39,3 @@ enum gf_crypt_mem_types_ {
scroll-step: 1
End:
*/
-
-
-
diff --git a/xlators/encryption/crypt/src/crypt.h b/xlators/encryption/crypt/src/crypt.h
index 5a2b1a9cc3b..390eee831b1 100644
--- a/xlators/encryption/crypt/src/crypt.h
+++ b/xlators/encryption/crypt/src/crypt.h
@@ -20,11 +20,11 @@
#include "crypt-mem-types.h"
#include "compat.h"
-#define CRYPT_XLATOR_ID (0)
+#define CRYPT_XLATOR_ID (0)
#define MAX_IOVEC_BITS (3)
#define MAX_IOVEC (1 << MAX_IOVEC_BITS)
-#define KEY_FACTOR_BITS (6)
+#define KEY_FACTOR_BITS (6)
#define DEBUG_CRYPT (0)
#define TRIVIAL_TFM (0)
@@ -40,8 +40,8 @@ typedef off_t loff_t;
#endif
struct crypt_key {
- uint32_t len;
- const char *label;
+ uint32_t len;
+ const char *label;
};
/*
@@ -49,113 +49,110 @@ struct crypt_key {
* enumeration but before LAST_KEY_TYPE
*/
typedef enum {
- MASTER_VOL_KEY,
- NMTD_VOL_KEY,
- NMTD_LINK_KEY,
- EMTD_FILE_KEY,
- DATA_FILE_KEY_256,
- DATA_FILE_KEY_512,
- LAST_KEY_TYPE
-}crypt_key_type;
+ MASTER_VOL_KEY,
+ NMTD_VOL_KEY,
+ NMTD_LINK_KEY,
+ EMTD_FILE_KEY,
+ DATA_FILE_KEY_256,
+ DATA_FILE_KEY_512,
+ LAST_KEY_TYPE
+} crypt_key_type;
struct kderive_context {
- const unsigned char *pkey;/* parent key */
- uint32_t pkey_len; /* parent key size, bits */
- uint32_t ckey_len; /* child key size, bits */
- unsigned char *fid; /* fixed input data, NIST 800-108, 5.1 */
- uint32_t fid_len; /* fid len, bytes */
- unsigned char *out; /* contains child keying material */
- uint32_t out_len; /* out len, bytes */
+ const unsigned char *pkey; /* parent key */
+ uint32_t pkey_len; /* parent key size, bits */
+ uint32_t ckey_len; /* child key size, bits */
+ unsigned char *fid; /* fixed input data, NIST 800-108, 5.1 */
+ uint32_t fid_len; /* fid len, bytes */
+ unsigned char *out; /* contains child keying material */
+ uint32_t out_len; /* out len, bytes */
};
-typedef enum {
- DATA_ATOM,
- HOLE_ATOM,
- LAST_DATA_TYPE
-}atom_data_type;
+typedef enum { DATA_ATOM, HOLE_ATOM, LAST_DATA_TYPE } atom_data_type;
typedef enum {
- HEAD_ATOM,
- TAIL_ATOM,
- FULL_ATOM,
- LAST_LOCALITY_TYPE
-}atom_locality_type;
+ HEAD_ATOM,
+ TAIL_ATOM,
+ FULL_ATOM,
+ LAST_LOCALITY_TYPE
+} atom_locality_type;
typedef enum {
- MTD_CREATE,
- MTD_APPEND,
- MTD_OVERWRITE,
- MTD_CUT,
- MTD_LAST_OP
+ MTD_CREATE,
+ MTD_APPEND,
+ MTD_OVERWRITE,
+ MTD_CUT,
+ MTD_LAST_OP
} mtd_op_t;
struct xts128_context {
- void *key1, *key2;
- block128_f block1,block2;
+ void *key1, *key2;
+ block128_f block1, block2;
};
struct object_cipher_info {
- cipher_alg_t o_alg;
- cipher_mode_t o_mode;
- uint32_t o_block_bits;
- uint32_t o_dkey_size; /* raw data key size in bits */
- union {
- struct {
- unsigned char ivec[16];
- AES_KEY dkey[2];
- AES_KEY tkey; /* key used for tweaking */
- XTS128_CONTEXT xts;
- } aes_xts;
- } u;
+ cipher_alg_t o_alg;
+ cipher_mode_t o_mode;
+ uint32_t o_block_bits;
+ uint32_t o_dkey_size; /* raw data key size in bits */
+ union {
+ struct {
+ unsigned char ivec[16];
+ AES_KEY dkey[2];
+ AES_KEY tkey; /* key used for tweaking */
+ XTS128_CONTEXT xts;
+ } aes_xts;
+ } u;
};
struct master_cipher_info {
- /*
- * attributes inherited by newly created regular files
- */
- cipher_alg_t m_alg;
- cipher_mode_t m_mode;
- uint32_t m_block_bits;
- uint32_t m_dkey_size; /* raw key size in bits */
- /*
- * master key
- */
- unsigned char m_key[MASTER_VOL_KEY_SIZE];
- /*
- * volume key for oid authentication
- */
- unsigned char m_nmtd_key[NMTD_VOL_KEY_SIZE];
+ /*
+ * attributes inherited by newly created regular files
+ */
+ cipher_alg_t m_alg;
+ cipher_mode_t m_mode;
+ uint32_t m_block_bits;
+ uint32_t m_dkey_size; /* raw key size in bits */
+ /*
+ * master key
+ */
+ unsigned char m_key[MASTER_VOL_KEY_SIZE];
+ /*
+ * volume key for oid authentication
+ */
+ unsigned char m_nmtd_key[NMTD_VOL_KEY_SIZE];
};
/*
-* This info is not changed during file's life
+ * This info is not changed during file's life
*/
struct crypt_inode_info {
#if DEBUG_CRYPT
- loc_t *loc; /* pathname that the file has been
- opened, or created with */
+ loc_t *loc; /* pathname that the file has been
+ opened, or created with */
#endif
- uint16_t nr_minor;
- uuid_t oid;
- struct object_cipher_info cinfo;
+ uint16_t nr_minor;
+ uuid_t oid;
+ struct object_cipher_info cinfo;
};
/*
* this should locate in secure memory
*/
typedef struct {
- struct master_cipher_info master;
+ struct master_cipher_info master;
} crypt_private_t;
-static inline struct master_cipher_info *get_master_cinfo(crypt_private_t *priv)
+static inline struct master_cipher_info *
+get_master_cinfo(crypt_private_t *priv)
{
- return &priv->master;
+ return &priv->master;
}
-static inline struct object_cipher_info *get_object_cinfo(struct crypt_inode_info
- *info)
+static inline struct object_cipher_info *
+get_object_cinfo(struct crypt_inode_info *info)
{
- return &info->cinfo;
+ return &info->cinfo;
}
/*
@@ -163,518 +160,531 @@ static inline struct object_cipher_info *get_object_cinfo(struct crypt_inode_inf
* of atoms in an aligned vector
*/
struct avec_config {
- uint32_t atom_size;
- atom_data_type type;
- size_t orig_size;
- off_t orig_offset;
- size_t expanded_size;
- off_t aligned_offset;
-
- uint32_t off_in_head;
- uint32_t off_in_tail;
- uint32_t gap_in_tail;
- uint32_t nr_full_blocks;
-
- struct iovec *avec; /* aligned vector */
- uint32_t acount; /* number of avec components. The same
- * as number of occupied logical blocks */
- char **pool;
- uint32_t blocks_in_pool;
- uint32_t cursor; /* makes sense only for ordered writes,
- * so there is no races on this counter.
- *
- * Cursor is per-config object, we don't
- * reset cursor for atoms of different
- * localities (head, tail, full)
- */
+ uint32_t atom_size;
+ atom_data_type type;
+ size_t orig_size;
+ off_t orig_offset;
+ size_t expanded_size;
+ off_t aligned_offset;
+
+ uint32_t off_in_head;
+ uint32_t off_in_tail;
+ uint32_t gap_in_tail;
+ uint32_t nr_full_blocks;
+
+ struct iovec *avec; /* aligned vector */
+ uint32_t acount; /* number of avec components. The same
+ * as number of occupied logical blocks */
+ char **pool;
+ uint32_t blocks_in_pool;
+ uint32_t cursor; /* makes sense only for ordered writes,
+ * so there is no races on this counter.
+ *
+ * Cursor is per-config object, we don't
+ * reset cursor for atoms of different
+ * localities (head, tail, full)
+ */
};
-
typedef struct {
- glusterfs_fop_t fop; /* code of FOP this local info built for */
- fd_t *fd;
- inode_t *inode;
- loc_t *loc;
- int32_t mac_idx;
- loc_t *newloc;
- int32_t flags;
- int32_t wbflags;
- struct crypt_inode_info *info;
- struct iobref *iobref;
- struct iobref *iobref_data;
- off_t offset;
-
- uint64_t old_file_size; /* per FOP, retrieved under lock held */
- uint64_t cur_file_size; /* per iteration, before issuing IOs */
- uint64_t new_file_size; /* per iteration, after issuing IOs */
-
- uint64_t io_offset; /* offset of IOs issued per iteration */
- uint64_t io_offset_nopad; /* offset of user's data in the atom */
- uint32_t io_size; /* size of IOs issued per iteration */
- uint32_t io_size_nopad; /* size of user's data in the IOs */
- uint32_t eof_padding_size; /* size od EOF padding in the IOs */
-
- gf_lock_t call_lock; /* protect nr_calls from many cbks */
- int32_t nr_calls;
-
- atom_data_type active_setup; /* which setup (hole or date)
- is currently active */
- /* data setup */
- struct avec_config data_conf;
-
- /* hole setup */
- int hole_conv_in_proggress;
- gf_lock_t hole_lock; /* protect hole config from many cbks */
- int hole_handled;
- struct avec_config hole_conf;
- struct iatt buf;
- struct iatt prebuf;
- struct iatt postbuf;
- struct iatt *prenewparent;
- struct iatt *postnewparent;
- int32_t op_ret;
- int32_t op_errno;
- int32_t rw_count; /* total read or written */
- gf_lock_t rw_count_lock; /* protect the counter above */
- unsigned char *format; /* for create, update format string */
- uint32_t format_size;
- uint32_t msgflags; /* messages for crypt_open() */
- dict_t *xdata;
- dict_t *xattr;
- struct iovec vec; /* contains last file's atom for
- read-prune-write sequence */
- gf_boolean_t custom_mtd;
- /*
- * the next 3 fields are used by readdir and friends
- */
- gf_dirent_t *de; /* directory entry */
- char *de_path; /* pathname of directory entry */
- uint32_t de_prefix_len; /* length of the parent's pathname */
- gf_dirent_t *entries;
-
- uint32_t update_disk_file_size:1;
+ glusterfs_fop_t fop; /* code of FOP this local info built for */
+ fd_t *fd;
+ inode_t *inode;
+ loc_t *loc;
+ int32_t mac_idx;
+ loc_t *newloc;
+ int32_t flags;
+ int32_t wbflags;
+ struct crypt_inode_info *info;
+ struct iobref *iobref;
+ struct iobref *iobref_data;
+ off_t offset;
+
+ uint64_t old_file_size; /* per FOP, retrieved under lock held */
+ uint64_t cur_file_size; /* per iteration, before issuing IOs */
+ uint64_t new_file_size; /* per iteration, after issuing IOs */
+
+ uint64_t io_offset; /* offset of IOs issued per iteration */
+ uint64_t io_offset_nopad; /* offset of user's data in the atom */
+ uint32_t io_size; /* size of IOs issued per iteration */
+ uint32_t io_size_nopad; /* size of user's data in the IOs */
+ uint32_t eof_padding_size; /* size od EOF padding in the IOs */
+
+ gf_lock_t call_lock; /* protect nr_calls from many cbks */
+ int32_t nr_calls;
+
+ atom_data_type active_setup; /* which setup (hole or date)
+ is currently active */
+ /* data setup */
+ struct avec_config data_conf;
+
+ /* hole setup */
+ int hole_conv_in_proggress;
+ gf_lock_t hole_lock; /* protect hole config from many cbks */
+ int hole_handled;
+ struct avec_config hole_conf;
+ struct iatt buf;
+ struct iatt prebuf;
+ struct iatt postbuf;
+ struct iatt *prenewparent;
+ struct iatt *postnewparent;
+ int32_t op_ret;
+ int32_t op_errno;
+ int32_t rw_count; /* total read or written */
+ gf_lock_t rw_count_lock; /* protect the counter above */
+ unsigned char *format; /* for create, update format string */
+ uint32_t format_size;
+ uint32_t msgflags; /* messages for crypt_open() */
+ dict_t *xdata;
+ dict_t *xattr;
+ struct iovec vec; /* contains last file's atom for
+ read-prune-write sequence */
+ gf_boolean_t custom_mtd;
+ /*
+ * the next 3 fields are used by readdir and friends
+ */
+ gf_dirent_t *de; /* directory entry */
+ char *de_path; /* pathname of directory entry */
+ uint32_t de_prefix_len; /* length of the parent's pathname */
+ gf_dirent_t *entries;
+
+ uint32_t update_disk_file_size : 1;
} crypt_local_t;
/* This represents a (read)modify-write atom */
struct rmw_atom {
- atom_locality_type locality;
- /*
- * read-modify-write sequence of the atom
- */
- int32_t (*rmw)(call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno,
- struct iovec *vec,
- int32_t count,
- struct iatt *stbuf,
- struct iobref *iobref,
- dict_t *xdata);
- /*
- * offset of the logical block in a file
- */
- loff_t (*offset_at)(call_frame_t *frame,
- struct object_cipher_info *object);
- /*
- * IO offset in an atom
- */
- uint32_t (*offset_in)(call_frame_t *frame,
- struct object_cipher_info *object);
- /*
- * number of bytes of plain text of this atom that user
- * wants to read/write.
- * It can be smaller than atom_size in the case of head
- * or tail atoms.
- */
- uint32_t (*io_size_nopad)(call_frame_t *frame,
- struct object_cipher_info *object);
- /*
- * which iovec represents the atom
- */
- struct iovec *(*get_iovec)(call_frame_t *frame, uint32_t count);
- /*
- * how many bytes of partial block should be uptodated by
- * reading from disk.
- * This is used to perform a read component of RMW (read-modify-write).
- */
- uint32_t (*count_to_uptodate)(call_frame_t *frame, struct object_cipher_info *object);
- struct avec_config *(*get_config)(call_frame_t *frame);
+ atom_locality_type locality;
+ /*
+ * read-modify-write sequence of the atom
+ */
+ int32_t (*rmw)(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, struct iovec *vec,
+ int32_t count, struct iatt *stbuf, struct iobref *iobref,
+ dict_t *xdata);
+ /*
+ * offset of the logical block in a file
+ */
+ loff_t (*offset_at)(call_frame_t *frame, struct object_cipher_info *object);
+ /*
+ * IO offset in an atom
+ */
+ uint32_t (*offset_in)(call_frame_t *frame,
+ struct object_cipher_info *object);
+ /*
+ * number of bytes of plain text of this atom that user
+ * wants to read/write.
+ * It can be smaller than atom_size in the case of head
+ * or tail atoms.
+ */
+ uint32_t (*io_size_nopad)(call_frame_t *frame,
+ struct object_cipher_info *object);
+ /*
+ * which iovec represents the atom
+ */
+ struct iovec *(*get_iovec)(call_frame_t *frame, uint32_t count);
+ /*
+ * how many bytes of partial block should be uptodated by
+ * reading from disk.
+ * This is used to perform a read component of RMW (read-modify-write).
+ */
+ uint32_t (*count_to_uptodate)(call_frame_t *frame,
+ struct object_cipher_info *object);
+ struct avec_config *(*get_config)(call_frame_t *frame);
};
struct data_cipher_alg {
- gf_boolean_t atomic; /* true means that algorithm requires
- to pad data before cipher transform */
- gf_boolean_t should_pad; /* true means that algorithm requires
- to pad the end of file with extra-data */
- uint32_t blkbits; /* blksize = 1 << blkbits */
- /*
- * any preliminary sanity checks goes here
- */
- int32_t (*init)(void);
- /*
- * set alg-mode specific inode info
- */
- int32_t (*set_private)(struct crypt_inode_info *info,
- struct master_cipher_info *master);
- /*
- * check alg-mode specific data key
- */
- int32_t (*check_key)(uint32_t key_size);
- void (*set_iv)(off_t offset, struct object_cipher_info *object);
- int32_t (*encrypt)(const unsigned char *from, unsigned char *to,
- size_t length, off_t offset, const int enc,
- struct object_cipher_info *object);
+ gf_boolean_t atomic; /* true means that algorithm requires
+ to pad data before cipher transform */
+ gf_boolean_t should_pad; /* true means that algorithm requires
+ to pad the end of file with extra-data */
+ uint32_t blkbits; /* blksize = 1 << blkbits */
+ /*
+ * any preliminary sanity checks goes here
+ */
+ int32_t (*init)(void);
+ /*
+ * set alg-mode specific inode info
+ */
+ int32_t (*set_private)(struct crypt_inode_info *info,
+ struct master_cipher_info *master);
+ /*
+ * check alg-mode specific data key
+ */
+ int32_t (*check_key)(uint32_t key_size);
+ void (*set_iv)(off_t offset, struct object_cipher_info *object);
+ int32_t (*encrypt)(const unsigned char *from, unsigned char *to,
+ size_t length, off_t offset, const int enc,
+ struct object_cipher_info *object);
};
/*
* version-dependent metadata loader
*/
struct crypt_mtd_loader {
- /*
- * return core format size
- */
- size_t (*format_size)(mtd_op_t op, size_t old_size);
- /*
- * pack version-specific metadata of an object
- * at ->create()
- */
- int32_t (*create_format)(unsigned char *wire,
- loc_t *loc,
- struct crypt_inode_info *info,
- struct master_cipher_info *master);
- /*
- * extract version-specific metadata of an object
- * at ->open() time
- */
- int32_t (*open_format)(unsigned char *wire,
- int32_t len,
- loc_t *loc,
- struct crypt_inode_info *info,
- struct master_cipher_info *master,
- crypt_local_t *local,
- gf_boolean_t load_info);
- int32_t (*update_format)(unsigned char *new,
- unsigned char *old,
- size_t old_len,
- int32_t mac_idx,
- mtd_op_t op,
- loc_t *loc,
- struct crypt_inode_info *info,
- struct master_cipher_info *master,
- crypt_local_t *local);
+ /*
+ * return core format size
+ */
+ size_t (*format_size)(mtd_op_t op, size_t old_size);
+ /*
+ * pack version-specific metadata of an object
+ * at ->create()
+ */
+ int32_t (*create_format)(unsigned char *wire, loc_t *loc,
+ struct crypt_inode_info *info,
+ struct master_cipher_info *master);
+ /*
+ * extract version-specific metadata of an object
+ * at ->open() time
+ */
+ int32_t (*open_format)(unsigned char *wire, int32_t len, loc_t *loc,
+ struct crypt_inode_info *info,
+ struct master_cipher_info *master,
+ crypt_local_t *local, gf_boolean_t load_info);
+ int32_t (*update_format)(unsigned char *new, unsigned char *old,
+ size_t old_len, int32_t mac_idx, mtd_op_t op,
+ loc_t *loc, struct crypt_inode_info *info,
+ struct master_cipher_info *master,
+ crypt_local_t *local);
};
-typedef int32_t (*end_writeback_handler_t)(call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno,
- struct iatt *prebuf,
- struct iatt *postbuf,
- dict_t *xdata);
+typedef int32_t (*end_writeback_handler_t)(call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno,
+ struct iatt *prebuf,
+ struct iatt *postbuf, dict_t *xdata);
typedef void (*linkop_wind_handler_t)(call_frame_t *frame, xlator_t *this);
typedef void (*linkop_unwind_handler_t)(call_frame_t *frame);
-
/* Declarations */
/* keys.c */
extern struct crypt_key crypt_keys[LAST_KEY_TYPE];
-int32_t get_nmtd_vol_key(struct master_cipher_info *master);
-int32_t get_nmtd_link_key(loc_t *loc,
- struct master_cipher_info *master,
- unsigned char *result);
-int32_t get_emtd_file_key(struct crypt_inode_info *info,
- struct master_cipher_info *master,
- unsigned char *result);
-int32_t get_data_file_key(struct crypt_inode_info *info,
- struct master_cipher_info *master,
- uint32_t keysize,
- unsigned char *key);
+int32_t
+get_nmtd_vol_key(struct master_cipher_info *master);
+int32_t
+get_nmtd_link_key(loc_t *loc, struct master_cipher_info *master,
+ unsigned char *result);
+int32_t
+get_emtd_file_key(struct crypt_inode_info *info,
+ struct master_cipher_info *master, unsigned char *result);
+int32_t
+get_data_file_key(struct crypt_inode_info *info,
+ struct master_cipher_info *master, uint32_t keysize,
+ unsigned char *key);
/* data.c */
-extern struct data_cipher_alg data_cipher_algs[LAST_CIPHER_ALG][LAST_CIPHER_MODE];
-void encrypt_aligned_iov(struct object_cipher_info *object,
- struct iovec *vec,
- int count,
- off_t off);
-void decrypt_aligned_iov(struct object_cipher_info *object,
- struct iovec *vec,
- int count,
- off_t off);
-int32_t align_iov_by_atoms(xlator_t *this,
- crypt_local_t *local,
- struct object_cipher_info *object,
- struct iovec *vec /* input vector */,
- int32_t count /* number of vec components */,
- struct iovec *avec /* aligned vector */,
- char **blocks /* pool of blocks */,
- uint32_t *blocks_allocated,
- struct avec_config *conf);
-int32_t set_config_avec_data(xlator_t *this,
- crypt_local_t *local,
- struct avec_config *conf,
- struct object_cipher_info *object,
- struct iovec *vec,
- int32_t vec_count);
-int32_t set_config_avec_hole(xlator_t *this,
- crypt_local_t *local,
- struct avec_config *conf,
- struct object_cipher_info *object,
- glusterfs_fop_t fop);
-void set_gap_at_end(call_frame_t *frame, struct object_cipher_info *object,
- struct avec_config *conf, atom_data_type dtype);
-void set_config_offsets(call_frame_t *frame,
- xlator_t *this,
- uint64_t offset,
- uint64_t count,
- atom_data_type dtype,
- int32_t setup_gap_in_tail);
+extern struct data_cipher_alg data_cipher_algs[LAST_CIPHER_ALG]
+ [LAST_CIPHER_MODE];
+void
+encrypt_aligned_iov(struct object_cipher_info *object, struct iovec *vec,
+ int count, off_t off);
+void
+decrypt_aligned_iov(struct object_cipher_info *object, struct iovec *vec,
+ int count, off_t off);
+int32_t
+align_iov_by_atoms(xlator_t *this, crypt_local_t *local,
+ struct object_cipher_info *object,
+ struct iovec *vec /* input vector */,
+ int32_t count /* number of vec components */,
+ struct iovec *avec /* aligned vector */,
+ char **blocks /* pool of blocks */,
+ uint32_t *blocks_allocated, struct avec_config *conf);
+int32_t
+set_config_avec_data(xlator_t *this, crypt_local_t *local,
+ struct avec_config *conf,
+ struct object_cipher_info *object, struct iovec *vec,
+ int32_t vec_count);
+int32_t
+set_config_avec_hole(xlator_t *this, crypt_local_t *local,
+ struct avec_config *conf,
+ struct object_cipher_info *object, glusterfs_fop_t fop);
+void
+set_gap_at_end(call_frame_t *frame, struct object_cipher_info *object,
+ struct avec_config *conf, atom_data_type dtype);
+void
+set_config_offsets(call_frame_t *frame, xlator_t *this, uint64_t offset,
+ uint64_t count, atom_data_type dtype,
+ int32_t setup_gap_in_tail);
/* metadata.c */
-extern struct crypt_mtd_loader mtd_loaders [LAST_MTD_LOADER];
-
-int32_t alloc_format(crypt_local_t *local, size_t size);
-int32_t alloc_format_create(crypt_local_t *local);
-void free_format(crypt_local_t *local);
-size_t format_size(mtd_op_t op, size_t old_size);
-size_t new_format_size(void);
-int32_t open_format(unsigned char *str, int32_t len, loc_t *loc,
- struct crypt_inode_info *info,
- struct master_cipher_info *master, crypt_local_t *local,
- gf_boolean_t load_info);
-int32_t update_format(unsigned char *new, unsigned char *old,
- size_t old_len, int32_t mac_idx, mtd_op_t op, loc_t *loc,
- struct crypt_inode_info *info,
- struct master_cipher_info *master,
- crypt_local_t *local);
-int32_t create_format(unsigned char *wire,
- loc_t *loc,
- struct crypt_inode_info *info,
- struct master_cipher_info *master);
+extern struct crypt_mtd_loader mtd_loaders[LAST_MTD_LOADER];
+
+int32_t
+alloc_format(crypt_local_t *local, size_t size);
+int32_t
+alloc_format_create(crypt_local_t *local);
+void
+free_format(crypt_local_t *local);
+size_t
+format_size(mtd_op_t op, size_t old_size);
+size_t
+new_format_size(void);
+int32_t
+open_format(unsigned char *str, int32_t len, loc_t *loc,
+ struct crypt_inode_info *info, struct master_cipher_info *master,
+ crypt_local_t *local, gf_boolean_t load_info);
+int32_t
+update_format(unsigned char *new, unsigned char *old, size_t old_len,
+ int32_t mac_idx, mtd_op_t op, loc_t *loc,
+ struct crypt_inode_info *info, struct master_cipher_info *master,
+ crypt_local_t *local);
+int32_t
+create_format(unsigned char *wire, loc_t *loc, struct crypt_inode_info *info,
+ struct master_cipher_info *master);
/* atom.c */
-struct rmw_atom *atom_by_types(atom_data_type data,
- atom_locality_type locality);
-void submit_partial(call_frame_t *frame,
- xlator_t *this,
- fd_t *fd,
- atom_locality_type ltype);
-void submit_full(call_frame_t *frame, xlator_t *this);
+struct rmw_atom *
+atom_by_types(atom_data_type data, atom_locality_type locality);
+void
+submit_partial(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ atom_locality_type ltype);
+void
+submit_full(call_frame_t *frame, xlator_t *this);
/* crypt.c */
-end_writeback_handler_t dispatch_end_writeback(glusterfs_fop_t fop);
-void set_local_io_params_writev(call_frame_t *frame,
- struct object_cipher_info *object,
- struct rmw_atom *atom, off_t io_offset,
- uint32_t io_size);
-void link_wind(call_frame_t *frame, xlator_t *this);
-void unlink_wind(call_frame_t *frame, xlator_t *this);
-void link_unwind(call_frame_t *frame);
-void unlink_unwind(call_frame_t *frame);
-void rename_wind(call_frame_t *frame, xlator_t *this);
-void rename_unwind(call_frame_t *frame);
+end_writeback_handler_t
+dispatch_end_writeback(glusterfs_fop_t fop);
+void
+set_local_io_params_writev(call_frame_t *frame,
+ struct object_cipher_info *object,
+ struct rmw_atom *atom, off_t io_offset,
+ uint32_t io_size);
+void
+link_wind(call_frame_t *frame, xlator_t *this);
+void
+unlink_wind(call_frame_t *frame, xlator_t *this);
+void
+link_unwind(call_frame_t *frame);
+void
+unlink_unwind(call_frame_t *frame);
+void
+rename_wind(call_frame_t *frame, xlator_t *this);
+void
+rename_unwind(call_frame_t *frame);
/* Inline functions */
-static inline int32_t crypt_xlator_id(void)
+static inline int32_t
+crypt_xlator_id(void)
{
- return CRYPT_XLATOR_ID;
+ return CRYPT_XLATOR_ID;
}
-static inline mtd_loader_id current_mtd_loader(void)
+static inline mtd_loader_id
+current_mtd_loader(void)
{
- return MTD_LOADER_V1;
+ return MTD_LOADER_V1;
}
-static inline uint32_t master_key_size (void)
+static inline uint32_t
+master_key_size(void)
{
- return crypt_keys[MASTER_VOL_KEY].len >> 3;
+ return crypt_keys[MASTER_VOL_KEY].len >> 3;
}
-static inline uint32_t nmtd_vol_key_size (void)
+static inline uint32_t
+nmtd_vol_key_size(void)
{
- return crypt_keys[NMTD_VOL_KEY].len >> 3;
+ return crypt_keys[NMTD_VOL_KEY].len >> 3;
}
-static inline uint32_t alg_mode_blkbits(cipher_alg_t alg,
- cipher_mode_t mode)
+static inline uint32_t
+alg_mode_blkbits(cipher_alg_t alg, cipher_mode_t mode)
{
- return data_cipher_algs[alg][mode].blkbits;
+ return data_cipher_algs[alg][mode].blkbits;
}
-static inline uint32_t alg_mode_blksize(cipher_alg_t alg,
- cipher_mode_t mode)
+static inline uint32_t
+alg_mode_blksize(cipher_alg_t alg, cipher_mode_t mode)
{
- return 1 << alg_mode_blkbits(alg, mode);
+ return 1 << alg_mode_blkbits(alg, mode);
}
-static inline gf_boolean_t alg_mode_atomic(cipher_alg_t alg,
- cipher_mode_t mode)
+static inline gf_boolean_t
+alg_mode_atomic(cipher_alg_t alg, cipher_mode_t mode)
{
- return data_cipher_algs[alg][mode].atomic;
+ return data_cipher_algs[alg][mode].atomic;
}
-static inline gf_boolean_t alg_mode_should_pad(cipher_alg_t alg,
- cipher_mode_t mode)
+static inline gf_boolean_t
+alg_mode_should_pad(cipher_alg_t alg, cipher_mode_t mode)
{
- return data_cipher_algs[alg][mode].should_pad;
+ return data_cipher_algs[alg][mode].should_pad;
}
-static inline uint32_t master_alg_blksize(struct master_cipher_info *mr)
+static inline uint32_t
+master_alg_blksize(struct master_cipher_info *mr)
{
- return alg_mode_blksize(mr->m_alg, mr->m_mode);
+ return alg_mode_blksize(mr->m_alg, mr->m_mode);
}
-static inline uint32_t master_alg_blkbits(struct master_cipher_info *mr)
+static inline uint32_t
+master_alg_blkbits(struct master_cipher_info *mr)
{
- return alg_mode_blkbits(mr->m_alg, mr->m_mode);
+ return alg_mode_blkbits(mr->m_alg, mr->m_mode);
}
-static inline gf_boolean_t master_alg_atomic(struct master_cipher_info *mr)
+static inline gf_boolean_t
+master_alg_atomic(struct master_cipher_info *mr)
{
- return alg_mode_atomic(mr->m_alg, mr->m_mode);
+ return alg_mode_atomic(mr->m_alg, mr->m_mode);
}
-static inline gf_boolean_t master_alg_should_pad(struct master_cipher_info *mr)
+static inline gf_boolean_t
+master_alg_should_pad(struct master_cipher_info *mr)
{
- return alg_mode_should_pad(mr->m_alg, mr->m_mode);
+ return alg_mode_should_pad(mr->m_alg, mr->m_mode);
}
-static inline uint32_t object_alg_blksize(struct object_cipher_info *ob)
+static inline uint32_t
+object_alg_blksize(struct object_cipher_info *ob)
{
- return alg_mode_blksize(ob->o_alg, ob->o_mode);
+ return alg_mode_blksize(ob->o_alg, ob->o_mode);
}
-static inline uint32_t object_alg_blkbits(struct object_cipher_info *ob)
+static inline uint32_t
+object_alg_blkbits(struct object_cipher_info *ob)
{
- return alg_mode_blkbits(ob->o_alg, ob->o_mode);
+ return alg_mode_blkbits(ob->o_alg, ob->o_mode);
}
-static inline gf_boolean_t object_alg_atomic(struct object_cipher_info *ob)
+static inline gf_boolean_t
+object_alg_atomic(struct object_cipher_info *ob)
{
- return alg_mode_atomic(ob->o_alg, ob->o_mode);
+ return alg_mode_atomic(ob->o_alg, ob->o_mode);
}
-static inline gf_boolean_t object_alg_should_pad(struct object_cipher_info *ob)
+static inline gf_boolean_t
+object_alg_should_pad(struct object_cipher_info *ob)
{
- return alg_mode_should_pad(ob->o_alg, ob->o_mode);
+ return alg_mode_should_pad(ob->o_alg, ob->o_mode);
}
-static inline uint32_t aes_raw_key_size(struct master_cipher_info *master)
+static inline uint32_t
+aes_raw_key_size(struct master_cipher_info *master)
{
- return master->m_dkey_size >> 3;
+ return master->m_dkey_size >> 3;
}
-static inline struct avec_config *get_hole_conf(call_frame_t *frame)
+static inline struct avec_config *
+get_hole_conf(call_frame_t *frame)
{
- return &(((crypt_local_t *)frame->local)->hole_conf);
+ return &(((crypt_local_t *)frame->local)->hole_conf);
}
-static inline struct avec_config *get_data_conf(call_frame_t *frame)
+static inline struct avec_config *
+get_data_conf(call_frame_t *frame)
{
- return &(((crypt_local_t *)frame->local)->data_conf);
+ return &(((crypt_local_t *)frame->local)->data_conf);
}
-static inline int32_t get_atom_bits (struct object_cipher_info *object)
+static inline int32_t
+get_atom_bits(struct object_cipher_info *object)
{
- return object->o_block_bits;
+ return object->o_block_bits;
}
-static inline int32_t get_atom_size (struct object_cipher_info *object)
+static inline int32_t
+get_atom_size(struct object_cipher_info *object)
{
- return 1 << get_atom_bits(object);
+ return 1 << get_atom_bits(object);
}
-static inline int32_t has_head_block(struct avec_config *conf)
+static inline int32_t
+has_head_block(struct avec_config *conf)
{
- return conf->off_in_head ||
- (conf->acount == 1 && conf->off_in_tail);
+ return conf->off_in_head || (conf->acount == 1 && conf->off_in_tail);
}
-static inline int32_t has_tail_block(struct avec_config *conf)
+static inline int32_t
+has_tail_block(struct avec_config *conf)
{
- return conf->off_in_tail && conf->acount > 1;
+ return conf->off_in_tail && conf->acount > 1;
}
-static inline int32_t has_full_blocks(struct avec_config *conf)
+static inline int32_t
+has_full_blocks(struct avec_config *conf)
{
- return conf->nr_full_blocks;
+ return conf->nr_full_blocks;
}
-static inline int32_t should_submit_head_block(struct avec_config *conf)
+static inline int32_t
+should_submit_head_block(struct avec_config *conf)
{
- return has_head_block(conf) && (conf->cursor == 0);
+ return has_head_block(conf) && (conf->cursor == 0);
}
-static inline int32_t should_submit_tail_block(struct avec_config *conf)
+static inline int32_t
+should_submit_tail_block(struct avec_config *conf)
{
- return has_tail_block(conf) && (conf->cursor == conf->acount - 1);
+ return has_tail_block(conf) && (conf->cursor == conf->acount - 1);
}
-static inline int32_t should_submit_full_block(struct avec_config *conf)
+static inline int32_t
+should_submit_full_block(struct avec_config *conf)
{
- uint32_t start = has_head_block(conf) ? 1 : 0;
+ uint32_t start = has_head_block(conf) ? 1 : 0;
- return has_full_blocks(conf) &&
- conf->cursor >= start &&
- conf->cursor < start + conf->nr_full_blocks;
+ return has_full_blocks(conf) && conf->cursor >= start &&
+ conf->cursor < start + conf->nr_full_blocks;
}
#if DEBUG_CRYPT
-static inline void crypt_check_input_len(size_t len,
- struct object_cipher_info *object)
+static inline void
+crypt_check_input_len(size_t len, struct object_cipher_info *object)
{
- if (object_alg_should_pad(object) && (len & (object_alg_blksize(object) - 1)))
- gf_log ("crypt", GF_LOG_DEBUG, "bad input len: %d", (int)len);
+ if (object_alg_should_pad(object) &&
+ (len & (object_alg_blksize(object) - 1)))
+ gf_log("crypt", GF_LOG_DEBUG, "bad input len: %d", (int)len);
}
-static inline void check_head_block(struct avec_config *conf)
+static inline void
+check_head_block(struct avec_config *conf)
{
- if (!has_head_block(conf))
- gf_log("crypt", GF_LOG_DEBUG, "not a head atom");
+ if (!has_head_block(conf))
+ gf_log("crypt", GF_LOG_DEBUG, "not a head atom");
}
-static inline void check_tail_block(struct avec_config *conf)
+static inline void
+check_tail_block(struct avec_config *conf)
{
- if (!has_tail_block(conf))
- gf_log("crypt", GF_LOG_DEBUG, "not a tail atom");
+ if (!has_tail_block(conf))
+ gf_log("crypt", GF_LOG_DEBUG, "not a tail atom");
}
-static inline void check_full_block(struct avec_config *conf)
+static inline void
+check_full_block(struct avec_config *conf)
{
- if (!has_full_blocks(conf))
- gf_log("crypt", GF_LOG_DEBUG, "not a full atom");
+ if (!has_full_blocks(conf))
+ gf_log("crypt", GF_LOG_DEBUG, "not a full atom");
}
-static inline void check_cursor_head(struct avec_config *conf)
+static inline void
+check_cursor_head(struct avec_config *conf)
{
- if (!has_head_block(conf))
- gf_log("crypt",
- GF_LOG_DEBUG, "Illegal call of head atom method");
- else if (conf->cursor != 0)
- gf_log("crypt",
- GF_LOG_DEBUG, "Cursor (%d) is not at head atom",
- conf->cursor);
+ if (!has_head_block(conf))
+ gf_log("crypt", GF_LOG_DEBUG, "Illegal call of head atom method");
+ else if (conf->cursor != 0)
+ gf_log("crypt", GF_LOG_DEBUG, "Cursor (%d) is not at head atom",
+ conf->cursor);
}
-static inline void check_cursor_full(struct avec_config *conf)
+static inline void
+check_cursor_full(struct avec_config *conf)
{
- if (!has_full_blocks(conf))
- gf_log("crypt",
- GF_LOG_DEBUG, "Illegal call of full atom method");
- if (has_head_block(conf) && (conf->cursor == 0))
- gf_log("crypt",
- GF_LOG_DEBUG, "Cursor is not at full atom");
+ if (!has_full_blocks(conf))
+ gf_log("crypt", GF_LOG_DEBUG, "Illegal call of full atom method");
+ if (has_head_block(conf) && (conf->cursor == 0))
+ gf_log("crypt", GF_LOG_DEBUG, "Cursor is not at full atom");
}
/*
* FIXME: use avec->iov_len to check setup
*/
-static inline int data_local_invariant(crypt_local_t *local)
+static inline int
+data_local_invariant(crypt_local_t *local)
{
- return 0;
+ return 0;
}
#else
@@ -687,207 +697,225 @@ static inline int data_local_invariant(crypt_local_t *local)
#endif /* DEBUG_CRYPT */
-static inline struct avec_config *conf_by_type(call_frame_t *frame,
- atom_data_type dtype)
+static inline struct avec_config *
+conf_by_type(call_frame_t *frame, atom_data_type dtype)
{
- struct avec_config *conf = NULL;
+ struct avec_config *conf = NULL;
- switch (dtype) {
- case HOLE_ATOM:
- conf = get_hole_conf(frame);
- break;
- case DATA_ATOM:
- conf = get_data_conf(frame);
- break;
- default:
- gf_log("crypt", GF_LOG_DEBUG, "bad atom type");
- }
- return conf;
+ switch (dtype) {
+ case HOLE_ATOM:
+ conf = get_hole_conf(frame);
+ break;
+ case DATA_ATOM:
+ conf = get_data_conf(frame);
+ break;
+ default:
+ gf_log("crypt", GF_LOG_DEBUG, "bad atom type");
+ }
+ return conf;
}
-static inline uint32_t nr_calls_head(struct avec_config *conf)
+static inline uint32_t
+nr_calls_head(struct avec_config *conf)
{
- return has_head_block(conf) ? 1 : 0;
+ return has_head_block(conf) ? 1 : 0;
}
-static inline uint32_t nr_calls_tail(struct avec_config *conf)
+static inline uint32_t
+nr_calls_tail(struct avec_config *conf)
{
- return has_tail_block(conf) ? 1 : 0;
+ return has_tail_block(conf) ? 1 : 0;
}
-static inline uint32_t nr_calls_full(struct avec_config *conf)
+static inline uint32_t
+nr_calls_full(struct avec_config *conf)
{
- switch(conf->type) {
- case HOLE_ATOM:
- return has_full_blocks(conf);
- case DATA_ATOM:
- return has_full_blocks(conf) ?
- logical_blocks_occupied(0,
- conf->nr_full_blocks,
- MAX_IOVEC_BITS) : 0;
- default:
- gf_log("crypt", GF_LOG_DEBUG, "bad atom data type");
- return 0;
- }
+ switch (conf->type) {
+ case HOLE_ATOM:
+ return has_full_blocks(conf);
+ case DATA_ATOM:
+ return has_full_blocks(conf)
+ ? logical_blocks_occupied(0, conf->nr_full_blocks,
+ MAX_IOVEC_BITS)
+ : 0;
+ default:
+ gf_log("crypt", GF_LOG_DEBUG, "bad atom data type");
+ return 0;
+ }
}
-static inline uint32_t nr_calls(struct avec_config *conf)
+static inline uint32_t
+nr_calls(struct avec_config *conf)
{
- return nr_calls_head(conf) + nr_calls_tail(conf) + nr_calls_full(conf);
+ return nr_calls_head(conf) + nr_calls_tail(conf) + nr_calls_full(conf);
}
-static inline uint32_t nr_calls_data(call_frame_t *frame)
+static inline uint32_t
+nr_calls_data(call_frame_t *frame)
{
- return nr_calls(get_data_conf(frame));
+ return nr_calls(get_data_conf(frame));
}
-static inline uint32_t nr_calls_hole(call_frame_t *frame)
+static inline uint32_t
+nr_calls_hole(call_frame_t *frame)
{
- return nr_calls(get_hole_conf(frame));
+ return nr_calls(get_hole_conf(frame));
}
-static inline void get_one_call_nolock(call_frame_t *frame)
+static inline void
+get_one_call_nolock(call_frame_t *frame)
{
- crypt_local_t *local = frame->local;
+ crypt_local_t *local = frame->local;
- ++local->nr_calls;
+ ++local->nr_calls;
- //gf_log("crypt", GF_LOG_DEBUG, "get %d calls", 1);
+ // gf_log("crypt", GF_LOG_DEBUG, "get %d calls", 1);
}
-static inline void get_one_call(call_frame_t *frame)
+static inline void
+get_one_call(call_frame_t *frame)
{
- crypt_local_t *local = frame->local;
+ crypt_local_t *local = frame->local;
- LOCK(&local->call_lock);
- get_one_call_nolock(frame);
- UNLOCK(&local->call_lock);
+ LOCK(&local->call_lock);
+ get_one_call_nolock(frame);
+ UNLOCK(&local->call_lock);
}
-static inline void get_nr_calls_nolock(call_frame_t *frame, int32_t nr)
+static inline void
+get_nr_calls_nolock(call_frame_t *frame, int32_t nr)
{
- crypt_local_t *local = frame->local;
+ crypt_local_t *local = frame->local;
- local->nr_calls += nr;
+ local->nr_calls += nr;
- //gf_log("crypt", GF_LOG_DEBUG, "get %d calls", nr);
+ // gf_log("crypt", GF_LOG_DEBUG, "get %d calls", nr);
}
-static inline void get_nr_calls(call_frame_t *frame, int32_t nr)
+static inline void
+get_nr_calls(call_frame_t *frame, int32_t nr)
{
- crypt_local_t *local = frame->local;
+ crypt_local_t *local = frame->local;
- LOCK(&local->call_lock);
- get_nr_calls_nolock(frame, nr);
- UNLOCK(&local->call_lock);
+ LOCK(&local->call_lock);
+ get_nr_calls_nolock(frame, nr);
+ UNLOCK(&local->call_lock);
}
-static inline int put_one_call(crypt_local_t *local)
+static inline int
+put_one_call(crypt_local_t *local)
{
- uint32_t last = 0;
+ uint32_t last = 0;
- LOCK(&local->call_lock);
- if (--local->nr_calls == 0)
- last = 1;
+ LOCK(&local->call_lock);
+ if (--local->nr_calls == 0)
+ last = 1;
- //gf_log("crypt", GF_LOG_DEBUG, "put %d calls", 1);
+ // gf_log("crypt", GF_LOG_DEBUG, "put %d calls", 1);
- UNLOCK(&local->call_lock);
- return last;
+ UNLOCK(&local->call_lock);
+ return last;
}
-static inline int is_appended_write(call_frame_t *frame)
+static inline int
+is_appended_write(call_frame_t *frame)
{
- crypt_local_t *local = frame->local;
- struct avec_config *conf = get_data_conf(frame);
+ crypt_local_t *local = frame->local;
+ struct avec_config *conf = get_data_conf(frame);
- return conf->orig_offset + conf->orig_size > local->old_file_size;
+ return conf->orig_offset + conf->orig_size > local->old_file_size;
}
-static inline int is_ordered_mode(call_frame_t *frame)
+static inline int
+is_ordered_mode(call_frame_t *frame)
{
#if 0
crypt_local_t *local = frame->local;
return local->fop == GF_FOP_FTRUNCATE ||
(local->fop == GF_FOP_WRITE && is_appended_write(frame));
#endif
- return 1;
+ return 1;
}
-static inline int32_t hole_conv_completed(crypt_local_t *local)
+static inline int32_t
+hole_conv_completed(crypt_local_t *local)
{
- struct avec_config *conf = &local->hole_conf;
- return conf->cursor == conf->acount;
+ struct avec_config *conf = &local->hole_conf;
+ return conf->cursor == conf->acount;
}
-static inline int32_t data_write_in_progress(crypt_local_t *local)
+static inline int32_t
+data_write_in_progress(crypt_local_t *local)
{
- return local->active_setup == DATA_ATOM;
+ return local->active_setup == DATA_ATOM;
}
-static inline int32_t parent_is_crypt_xlator(call_frame_t *frame,
- xlator_t *this)
+static inline int32_t
+parent_is_crypt_xlator(call_frame_t *frame, xlator_t *this)
{
- return frame->parent->this == this;
+ return frame->parent->this == this;
}
-static inline linkop_wind_handler_t linkop_wind_dispatch(glusterfs_fop_t fop)
+static inline linkop_wind_handler_t
+linkop_wind_dispatch(glusterfs_fop_t fop)
{
- switch(fop){
- case GF_FOP_LINK:
- return link_wind;
- case GF_FOP_UNLINK:
- return unlink_wind;
- case GF_FOP_RENAME:
- return rename_wind;
- default:
- gf_log("crypt", GF_LOG_ERROR, "Bad link operation %d", fop);
- return NULL;
- }
+ switch (fop) {
+ case GF_FOP_LINK:
+ return link_wind;
+ case GF_FOP_UNLINK:
+ return unlink_wind;
+ case GF_FOP_RENAME:
+ return rename_wind;
+ default:
+ gf_log("crypt", GF_LOG_ERROR, "Bad link operation %d", fop);
+ return NULL;
+ }
}
-static inline linkop_unwind_handler_t linkop_unwind_dispatch(glusterfs_fop_t fop)
+static inline linkop_unwind_handler_t
+linkop_unwind_dispatch(glusterfs_fop_t fop)
{
- switch(fop){
- case GF_FOP_LINK:
- return link_unwind;
- case GF_FOP_UNLINK:
- return unlink_unwind;
- case GF_FOP_RENAME:
- return rename_unwind;
- default:
- gf_log("crypt", GF_LOG_ERROR, "Bad link operation %d", fop);
- return NULL;
- }
+ switch (fop) {
+ case GF_FOP_LINK:
+ return link_unwind;
+ case GF_FOP_UNLINK:
+ return unlink_unwind;
+ case GF_FOP_RENAME:
+ return rename_unwind;
+ default:
+ gf_log("crypt", GF_LOG_ERROR, "Bad link operation %d", fop);
+ return NULL;
+ }
}
-static inline mtd_op_t linkop_mtdop_dispatch(glusterfs_fop_t fop)
+static inline mtd_op_t
+linkop_mtdop_dispatch(glusterfs_fop_t fop)
{
- switch (fop) {
- case GF_FOP_LINK:
- return MTD_APPEND;
- case GF_FOP_UNLINK:
- return MTD_CUT;
- case GF_FOP_RENAME:
- return MTD_OVERWRITE;
- default:
- gf_log("crypt", GF_LOG_WARNING, "Bad link operation %d", fop);
- return MTD_LAST_OP;
- }
+ switch (fop) {
+ case GF_FOP_LINK:
+ return MTD_APPEND;
+ case GF_FOP_UNLINK:
+ return MTD_CUT;
+ case GF_FOP_RENAME:
+ return MTD_OVERWRITE;
+ default:
+ gf_log("crypt", GF_LOG_WARNING, "Bad link operation %d", fop);
+ return MTD_LAST_OP;
+ }
}
-#define CRYPT_STACK_UNWIND(fop, frame, params ...) \
- do { \
- crypt_local_t *__local = NULL; \
- if (frame) { \
- __local = frame->local; \
- frame->local = NULL; \
- } \
- STACK_UNWIND_STRICT (fop, frame, params); \
- if (__local) { \
- GF_FREE (__local); \
- } \
- } while (0)
+#define CRYPT_STACK_UNWIND(fop, frame, params...) \
+ do { \
+ crypt_local_t *__local = NULL; \
+ if (frame) { \
+ __local = frame->local; \
+ frame->local = NULL; \
+ } \
+ STACK_UNWIND_STRICT(fop, frame, params); \
+ if (__local) { \
+ GF_FREE(__local); \
+ } \
+ } while (0)
#endif /* __CRYPT_H__ */
diff --git a/xlators/encryption/crypt/src/metadata.h b/xlators/encryption/crypt/src/metadata.h
index b67ae25b58c..0bcee1b18c8 100644
--- a/xlators/encryption/crypt/src/metadata.h
+++ b/xlators/encryption/crypt/src/metadata.h
@@ -11,11 +11,11 @@
#ifndef __METADATA_H__
#define __METADATA_H__
-#define NMTD_8_MAC_SIZE (8)
-#define EMTD_8_MAC_SIZE (8)
+#define NMTD_8_MAC_SIZE (8)
+#define EMTD_8_MAC_SIZE (8)
typedef uint8_t nmtd_8_mac_t[NMTD_8_MAC_SIZE];
-typedef uint8_t emtd_8_mac_t[EMTD_8_MAC_SIZE] ;
+typedef uint8_t emtd_8_mac_t[EMTD_8_MAC_SIZE];
/*
* Version "v1" of file's metadata.
@@ -28,17 +28,17 @@ typedef uint8_t emtd_8_mac_t[EMTD_8_MAC_SIZE] ;
* exactly one MAC)
*/
struct mtd_format_v1 {
- /* EMTD, encrypted part of meta-data */
- uint8_t alg_id; /* cipher algorithm id (only AES for now) */
- uint8_t mode_id; /* cipher mode id; (only XTS for now) */
- uint8_t block_bits; /* encoded block size */
- uint8_t minor_id; /* client translator id */
- uint8_t dkey_factor; /* encoded size of the data key */
- /* MACs */
- emtd_8_mac_t gmac; /* MAC of the encrypted meta-data, 8 bytes */
- nmtd_8_mac_t omac; /* per-link MACs of the non-encrypted
- * meta-data: at least one such MAC is always
- * present */
+ /* EMTD, encrypted part of meta-data */
+ uint8_t alg_id; /* cipher algorithm id (only AES for now) */
+ uint8_t mode_id; /* cipher mode id; (only XTS for now) */
+ uint8_t block_bits; /* encoded block size */
+ uint8_t minor_id; /* client translator id */
+ uint8_t dkey_factor; /* encoded size of the data key */
+ /* MACs */
+ emtd_8_mac_t gmac; /* MAC of the encrypted meta-data, 8 bytes */
+ nmtd_8_mac_t omac; /* per-link MACs of the non-encrypted
+ * meta-data: at least one such MAC is always
+ * present */
} __attribute__((packed));
/*
@@ -46,29 +46,34 @@ struct mtd_format_v1 {
* is file's gfid, which is generated on trusted machines.
*/
#define SIZE_OF_NMTD_V1 (sizeof(uuid_t))
-#define SIZE_OF_EMTD_V1 (offsetof(struct mtd_format_v1, gmac) - \
- offsetof(struct mtd_format_v1, alg_id))
+#define SIZE_OF_EMTD_V1 \
+ (offsetof(struct mtd_format_v1, gmac) - \
+ offsetof(struct mtd_format_v1, alg_id))
#define SIZE_OF_NMTD_V1_MAC (NMTD_8_MAC_SIZE)
#define SIZE_OF_EMTD_V1_MAC (EMTD_8_MAC_SIZE)
-static inline unsigned char *get_EMTD_V1(struct mtd_format_v1 *format)
+static inline unsigned char *
+get_EMTD_V1(struct mtd_format_v1 *format)
{
- return &format->alg_id;
+ return &format->alg_id;
}
-static inline unsigned char *get_NMTD_V1(struct crypt_inode_info *info)
+static inline unsigned char *
+get_NMTD_V1(struct crypt_inode_info *info)
{
- return info->oid;
+ return info->oid;
}
-static inline unsigned char *get_EMTD_V1_MAC(struct mtd_format_v1 *format)
+static inline unsigned char *
+get_EMTD_V1_MAC(struct mtd_format_v1 *format)
{
- return format->gmac;
+ return format->gmac;
}
-static inline unsigned char *get_NMTD_V1_MAC(struct mtd_format_v1 *format)
+static inline unsigned char *
+get_NMTD_V1_MAC(struct mtd_format_v1 *format)
{
- return format->omac;
+ return format->omac;
}
#endif /* __METADATA_H__ */
diff --git a/xlators/encryption/rot-13/src/rot-13.h b/xlators/encryption/rot-13/src/rot-13.h
index a2017513437..edbc99798b4 100644
--- a/xlators/encryption/rot-13/src/rot-13.h
+++ b/xlators/encryption/rot-13/src/rot-13.h
@@ -11,8 +11,8 @@
#define __ROT_13_H__
typedef struct {
- gf_boolean_t encrypt_write;
- gf_boolean_t decrypt_read;
+ gf_boolean_t encrypt_write;
+ gf_boolean_t decrypt_read;
} rot_13_private_t;
#endif /* __ROT_13_H__ */
diff --git a/xlators/experimental/fdl/src/fdl.h b/xlators/experimental/fdl/src/fdl.h
index 32e38c93f2d..827db9f1246 100644
--- a/xlators/experimental/fdl/src/fdl.h
+++ b/xlators/experimental/fdl/src/fdl.h
@@ -11,20 +11,20 @@
#ifndef _FDL_H_
#define _FDL_H_
-#define NEW_REQUEST (uint8_t)'N'
+#define NEW_REQUEST (uint8_t)'N'
typedef struct {
- uint8_t event_type; /* e.g. NEW_REQUEST */
- uint8_t fop_type; /* e.g. GF_FOP_SETATTR */
- uint16_t request_id;
- uint32_t ext_length;
+ uint8_t event_type; /* e.g. NEW_REQUEST */
+ uint8_t fop_type; /* e.g. GF_FOP_SETATTR */
+ uint16_t request_id;
+ uint32_t ext_length;
} event_header_t;
enum {
- FDL_IPC_BASE = 0xfeedbee5, /* ... and they make honey */
- FDL_IPC_CHANGE_TERM,
- FDL_IPC_GET_TERMS,
- FDL_IPC_JBR_SERVER_ROLLBACK
+ FDL_IPC_BASE = 0xfeedbee5, /* ... and they make honey */
+ FDL_IPC_CHANGE_TERM,
+ FDL_IPC_GET_TERMS,
+ FDL_IPC_JBR_SERVER_ROLLBACK
};
#endif /* _FDL_H_ */
diff --git a/xlators/experimental/jbr-client/src/jbr-messages.h b/xlators/experimental/jbr-client/src/jbr-messages.h
index 9f210184d81..ecbf569ec13 100644
--- a/xlators/experimental/jbr-client/src/jbr-messages.h
+++ b/xlators/experimental/jbr-client/src/jbr-messages.h
@@ -23,17 +23,8 @@
* glfs-message-id.h.
*/
-GLFS_MSGID(JBR,
- J_MSG_INIT_FAIL,
- J_MSG_RETRY_MSG,
- J_MSG_MEM_ERR,
- J_MSG_DICT_FLR,
- J_MSG_GENERIC,
- J_MSG_INVALID,
- J_MSG_NO_DATA,
- J_MSG_SYS_CALL_FAILURE,
- J_MSG_QUORUM_NOT_MET,
- J_MSG_LOCK_FAILURE
-);
+GLFS_MSGID(JBR, J_MSG_INIT_FAIL, J_MSG_RETRY_MSG, J_MSG_MEM_ERR, J_MSG_DICT_FLR,
+ J_MSG_GENERIC, J_MSG_INVALID, J_MSG_NO_DATA, J_MSG_SYS_CALL_FAILURE,
+ J_MSG_QUORUM_NOT_MET, J_MSG_LOCK_FAILURE);
#endif /* _JBR_MESSAGES_H_ */
diff --git a/xlators/experimental/jbr-client/src/jbrc.h b/xlators/experimental/jbr-client/src/jbrc.h
index c83259ca1bd..f99178402b3 100644
--- a/xlators/experimental/jbr-client/src/jbrc.h
+++ b/xlators/experimental/jbr-client/src/jbrc.h
@@ -12,16 +12,16 @@
#define _JBRC_H_
typedef struct {
- xlator_t *active;
- uint8_t up_children;
- uint8_t n_children;
- uint32_t kid_state;
+ xlator_t *active;
+ uint8_t up_children;
+ uint8_t n_children;
+ uint32_t kid_state;
} jbrc_private_t;
typedef struct {
- call_stub_t *stub;
- xlator_t *curr_xl;
- uint16_t scars;
+ call_stub_t *stub;
+ xlator_t *curr_xl;
+ uint16_t scars;
} jbrc_local_t;
#endif /* _JBRC_H_ */
diff --git a/xlators/experimental/jbr-server/src/jbr-internal.h b/xlators/experimental/jbr-server/src/jbr-internal.h
index 46a29910d1f..f225e988a5f 100644
--- a/xlators/experimental/jbr-server/src/jbr-internal.h
+++ b/xlators/experimental/jbr-server/src/jbr-internal.h
@@ -11,82 +11,82 @@
#include <sys/stat.h>
#include <sys/types.h>
-#define LEADER_XATTR "user.jbr.leader"
-#define SECOND_CHILD(xl) (xl->children->next->xlator)
-#define RECONCILER_PATH JBR_SCRIPT_PREFIX"/reconciler.py"
-#define CHANGELOG_ENTRY_SIZE 128
+#define LEADER_XATTR "user.jbr.leader"
+#define SECOND_CHILD(xl) (xl->children->next->xlator)
+#define RECONCILER_PATH JBR_SCRIPT_PREFIX "/reconciler.py"
+#define CHANGELOG_ENTRY_SIZE 128
enum {
- gf_mt_jbr_private_t = gf_common_mt_end + 1,
- gf_mt_jbr_fd_ctx_t,
- gf_mt_jbr_inode_ctx_t,
- gf_mt_jbr_dirty_t,
- gf_mt_jbr_end
+ gf_mt_jbr_private_t = gf_common_mt_end + 1,
+ gf_mt_jbr_fd_ctx_t,
+ gf_mt_jbr_inode_ctx_t,
+ gf_mt_jbr_dirty_t,
+ gf_mt_jbr_end
};
typedef enum jbr_recon_notify_ev_id_t {
- JBR_RECON_SET_LEADER = 1,
- JBR_RECON_ADD_CHILD = 2
+ JBR_RECON_SET_LEADER = 1,
+ JBR_RECON_ADD_CHILD = 2
} jbr_recon_notify_ev_id_t;
typedef struct _jbr_recon_notify_ev_s {
- jbr_recon_notify_ev_id_t id;
- uint32_t index; /* in case of add */
- struct list_head list;
+ jbr_recon_notify_ev_id_t id;
+ uint32_t index; /* in case of add */
+ struct list_head list;
} jbr_recon_notify_ev_t;
typedef struct {
- /*
- * This is a hack to allow a non-leader to accept requests while the
- * leader is down, and it only works for n=2. The way it works is that
- * "config_leader" indicates the state from our options (via init or
- * reconfigure) but "leader" is what the fop code actually looks at. If
- * config_leader is true, then leader will *always* be true as well,
- * giving that brick precedence. If config_leader is false, then
- * leader will only be true if there is no connection to the other
- * brick (tracked in jbr_notify).
- *
- * TBD: implement real leader election
- */
- gf_boolean_t config_leader;
- gf_boolean_t leader;
- uint8_t up_children;
- uint8_t n_children;
- char *vol_file;
- uint32_t current_term;
- uint32_t kid_state;
- gf_lock_t dirty_lock;
- struct list_head dirty_fds;
- uint32_t index;
- gf_lock_t index_lock;
- double quorum_pct;
- int term_fd;
- long term_total;
- long term_read;
- /*
- * This is a super-duper hack, but it will do for now. The reason it's
- * a hack is that we pass this to dict_set_static_bin, so we don't have
- * to mess around with allocating and freeing it on every single IPC
- * request, but it's totally not thread-safe. On the other hand, there
- * should only be one reconciliation thread running and calling these
- * functions at a time, so maybe that doesn't matter.
- *
- * TBD: re-evaluate how to manage this
- */
- char term_buf[CHANGELOG_ENTRY_SIZE];
- gf_boolean_t child_up; /* To maintain the state of *
- * the translator */
+ /*
+ * This is a hack to allow a non-leader to accept requests while the
+ * leader is down, and it only works for n=2. The way it works is that
+ * "config_leader" indicates the state from our options (via init or
+ * reconfigure) but "leader" is what the fop code actually looks at. If
+ * config_leader is true, then leader will *always* be true as well,
+ * giving that brick precedence. If config_leader is false, then
+ * leader will only be true if there is no connection to the other
+ * brick (tracked in jbr_notify).
+ *
+ * TBD: implement real leader election
+ */
+ gf_boolean_t config_leader;
+ gf_boolean_t leader;
+ uint8_t up_children;
+ uint8_t n_children;
+ char *vol_file;
+ uint32_t current_term;
+ uint32_t kid_state;
+ gf_lock_t dirty_lock;
+ struct list_head dirty_fds;
+ uint32_t index;
+ gf_lock_t index_lock;
+ double quorum_pct;
+ int term_fd;
+ long term_total;
+ long term_read;
+ /*
+ * This is a super-duper hack, but it will do for now. The reason it's
+ * a hack is that we pass this to dict_set_static_bin, so we don't have
+ * to mess around with allocating and freeing it on every single IPC
+ * request, but it's totally not thread-safe. On the other hand, there
+ * should only be one reconciliation thread running and calling these
+ * functions at a time, so maybe that doesn't matter.
+ *
+ * TBD: re-evaluate how to manage this
+ */
+ char term_buf[CHANGELOG_ENTRY_SIZE];
+ gf_boolean_t child_up; /* To maintain the state of *
+ * the translator */
} jbr_private_t;
typedef struct {
- call_stub_t *stub;
- call_stub_t *qstub;
- uint32_t call_count;
- uint32_t successful_acks;
- uint32_t successful_op_ret;
- fd_t *fd;
- struct list_head qlinks;
- dict_t *xdata;
+ call_stub_t *stub;
+ call_stub_t *qstub;
+ uint32_t call_count;
+ uint32_t successful_acks;
+ uint32_t successful_op_ret;
+ fd_t *fd;
+ struct list_head qlinks;
+ dict_t *xdata;
} jbr_local_t;
/*
@@ -96,22 +96,23 @@ typedef struct {
typedef uint32_t log_id_t;
typedef struct {
- struct list_head links;
- log_id_t id;
+ struct list_head links;
+ log_id_t id;
} jbr_dirty_list_t;
typedef struct {
- fd_t *fd;
- struct list_head dirty_list;
- struct list_head fd_list;
+ fd_t *fd;
+ struct list_head dirty_list;
+ struct list_head fd_list;
} jbr_fd_ctx_t;
typedef struct {
- gf_lock_t lock;
- uint32_t active;
- struct list_head aqueue;
- uint32_t pending;
- struct list_head pqueue;
+ gf_lock_t lock;
+ uint32_t active;
+ struct list_head aqueue;
+ uint32_t pending;
+ struct list_head pqueue;
} jbr_inode_ctx_t;
-void jbr_start_reconciler (xlator_t *this);
+void
+jbr_start_reconciler(xlator_t *this);
diff --git a/xlators/features/arbiter/src/arbiter-mem-types.h b/xlators/features/arbiter/src/arbiter-mem-types.h
index ccf864cdef0..0f77cfd05f4 100644
--- a/xlators/features/arbiter/src/arbiter-mem-types.h
+++ b/xlators/features/arbiter/src/arbiter-mem-types.h
@@ -12,7 +12,7 @@
#include "mem-types.h"
typedef enum gf_arbiter_mem_types_ {
- gf_arbiter_mt_inode_ctx_t = gf_common_mt_end + 1,
- gf_arbiter_mt_end
+ gf_arbiter_mt_inode_ctx_t = gf_common_mt_end + 1,
+ gf_arbiter_mt_end
} gf_arbiter_mem_types_t;
#endif
diff --git a/xlators/features/arbiter/src/arbiter.h b/xlators/features/arbiter/src/arbiter.h
index f52b45fad20..ce1c909f70f 100644
--- a/xlators/features/arbiter/src/arbiter.h
+++ b/xlators/features/arbiter/src/arbiter.h
@@ -15,7 +15,7 @@
#include "common-utils.h"
typedef struct arbiter_inode_ctx_ {
- struct iatt iattbuf;
+ struct iatt iattbuf;
} arbiter_inode_ctx_t;
#endif /* _ARBITER_H */
diff --git a/xlators/features/barrier/src/barrier-mem-types.h b/xlators/features/barrier/src/barrier-mem-types.h
index 36647a66966..93ccab633ce 100644
--- a/xlators/features/barrier/src/barrier-mem-types.h
+++ b/xlators/features/barrier/src/barrier-mem-types.h
@@ -14,7 +14,7 @@
#include "mem-types.h"
enum gf_barrier_mem_types_ {
- gf_barrier_mt_priv_t = gf_common_mt_end + 1,
- gf_barrier_mt_end
+ gf_barrier_mt_priv_t = gf_common_mt_end + 1,
+ gf_barrier_mt_end
};
#endif
diff --git a/xlators/features/barrier/src/barrier.h b/xlators/features/barrier/src/barrier.h
index 0d646f90474..d11d71d151e 100644
--- a/xlators/features/barrier/src/barrier.h
+++ b/xlators/features/barrier/src/barrier.h
@@ -16,67 +16,73 @@
#include "timer.h"
#include "call-stub.h"
-#define BARRIER_FOP_CBK(fop_name, label, frame, this, params ...) \
- do { \
- barrier_priv_t *_priv = NULL; \
- call_stub_t *_stub = NULL; \
- gf_boolean_t _barrier_enabled= _gf_false; \
- struct list_head queue = {0, }; \
- \
- INIT_LIST_HEAD (&queue); \
- \
- _priv = this->private; \
- GF_ASSERT (_priv); \
- \
- LOCK (&_priv->lock); \
- { \
- if (_priv->barrier_enabled) { \
- _barrier_enabled = _priv->barrier_enabled;\
- \
- _stub = fop_##fop_name##_cbk_stub \
- (frame, \
- barrier_##fop_name##_cbk_resume,\
- params); \
- if (!_stub) { \
- __barrier_disable (this, &queue);\
- goto unlock; \
- } \
- \
- __barrier_enqueue (this, _stub); \
- } \
- } \
-unlock: \
- UNLOCK (&_priv->lock); \
- \
- if (_stub) \
- goto label; \
- \
- if (_barrier_enabled && !_stub) { \
- gf_log (this->name, GF_LOG_CRITICAL, \
- "Failed to barrier FOPs, disabling " \
- "barrier. FOP: %s, ERROR: %s", \
- #fop_name, strerror (ENOMEM)); \
- barrier_dequeue_all (this, &queue); \
- } \
- barrier_local_free_gfid (frame); \
- STACK_UNWIND_STRICT (fop_name, frame, params); \
- goto label; \
- } while (0)
+#define BARRIER_FOP_CBK(fop_name, label, frame, this, params...) \
+ do { \
+ barrier_priv_t *_priv = NULL; \
+ call_stub_t *_stub = NULL; \
+ gf_boolean_t _barrier_enabled = _gf_false; \
+ struct list_head queue = { \
+ 0, \
+ }; \
+ \
+ INIT_LIST_HEAD(&queue); \
+ \
+ _priv = this->private; \
+ GF_ASSERT(_priv); \
+ \
+ LOCK(&_priv->lock); \
+ { \
+ if (_priv->barrier_enabled) { \
+ _barrier_enabled = _priv->barrier_enabled; \
+ \
+ _stub = fop_##fop_name##_cbk_stub( \
+ frame, barrier_##fop_name##_cbk_resume, params); \
+ if (!_stub) { \
+ __barrier_disable(this, &queue); \
+ goto unlock; \
+ } \
+ \
+ __barrier_enqueue(this, _stub); \
+ } \
+ } \
+ unlock: \
+ UNLOCK(&_priv->lock); \
+ \
+ if (_stub) \
+ goto label; \
+ \
+ if (_barrier_enabled && !_stub) { \
+ gf_log(this->name, GF_LOG_CRITICAL, \
+ "Failed to barrier FOPs, disabling " \
+ "barrier. FOP: %s, ERROR: %s", \
+ #fop_name, strerror(ENOMEM)); \
+ barrier_dequeue_all(this, &queue); \
+ } \
+ barrier_local_free_gfid(frame); \
+ STACK_UNWIND_STRICT(fop_name, frame, params); \
+ goto label; \
+ } while (0)
typedef struct {
- gf_timer_t *timer;
- gf_boolean_t barrier_enabled;
- gf_lock_t lock;
- struct list_head queue;
- struct timespec timeout;
- uint32_t queue_size;
+ gf_timer_t *timer;
+ gf_boolean_t barrier_enabled;
+ gf_lock_t lock;
+ struct list_head queue;
+ struct timespec timeout;
+ uint32_t queue_size;
} barrier_priv_t;
-int __barrier_enable (xlator_t *this, barrier_priv_t *priv);
-void __barrier_enqueue (xlator_t *this, call_stub_t *stub);
-void __barrier_disable (xlator_t *this, struct list_head *queue);
-void barrier_timeout (void *data);
-void barrier_dequeue_all (xlator_t *this, struct list_head *queue);
-call_stub_t *__barrier_dequeue (xlator_t *this, struct list_head *queue);
+int
+__barrier_enable(xlator_t *this, barrier_priv_t *priv);
+void
+__barrier_enqueue(xlator_t *this, call_stub_t *stub);
+void
+__barrier_disable(xlator_t *this, struct list_head *queue);
+void
+barrier_timeout(void *data);
+void
+barrier_dequeue_all(xlator_t *this, struct list_head *queue);
+call_stub_t *
+__barrier_dequeue(xlator_t *this, struct list_head *queue);
#endif
diff --git a/xlators/features/bit-rot/src/bitd/bit-rot-bitd-messages.h b/xlators/features/bit-rot/src/bitd/bit-rot-bitd-messages.h
index 89a67cc10b1..6f59933a31d 100644
--- a/xlators/features/bit-rot/src/bitd/bit-rot-bitd-messages.h
+++ b/xlators/features/bit-rot/src/bitd/bit-rot-bitd-messages.h
@@ -23,62 +23,30 @@
* glfs-message-id.h.
*/
-GLFS_MSGID(BITROT_BITD,
- BRB_MSG_FD_CREATE_FAILED,
- BRB_MSG_READV_FAILED,
- BRB_MSG_BLOCK_READ_FAILED,
- BRB_MSG_CALC_CHECKSUM_FAILED,
- BRB_MSG_NO_MEMORY,
- BRB_MSG_GET_SIGN_FAILED,
- BRB_MSG_SET_SIGN_FAILED,
- BRB_MSG_OP_FAILED,
- BRB_MSG_READ_AND_SIGN_FAILED,
- BRB_MSG_SIGN_FAILED,
- BRB_MSG_GET_SUBVOL_FAILED,
- BRB_MSG_SET_TIMER_FAILED,
- BRB_MSG_GET_INFO_FAILED,
- BRB_MSG_PATH_FAILED,
- BRB_MSG_MARK_BAD_FILE,
- BRB_MSG_TRIGGER_SIGN,
- BRB_MSG_REGISTER_FAILED,
- BRB_MSG_CRAWLING_START,
- BRB_MSG_SPAWN_FAILED,
- BRB_MSG_INVALID_SUBVOL_CHILD,
- BRB_MSG_SKIP_OBJECT,
- BRB_MSG_NO_CHILD,
- BRB_MSG_CHECKSUM_MISMATCH,
- BRB_MSG_MARK_CORRUPTED,
- BRB_MSG_CRAWLING_FINISH,
- BRB_MSG_CALC_ERROR,
- BRB_MSG_LOOKUP_FAILED,
- BRB_MSG_PARTIAL_VERSION_PRESENCE,
- BRB_MSG_MEM_ACNT_FAILED,
- BRB_MSG_TIMER_WHEEL_UNAVAILABLE,
- BRB_MSG_BITROT_LOADED,
- BRB_MSG_SCALE_DOWN_FAILED,
- BRB_MSG_SCALE_UP_FAILED,
- BRB_MSG_SCALE_DOWN_SCRUBBER,
- BRB_MSG_SCALING_UP_SCRUBBER,
- BRB_MSG_UNKNOWN_THROTTLE,
- BRB_MSG_RATE_LIMIT_INFO,
- BRB_MSG_SCRUB_INFO,
- BRB_MSG_CONNECTED_TO_BRICK,
- BRB_MSG_BRICK_INFO,
- BRB_MSG_SUBVOL_CONNECT_FAILED,
- BRB_MSG_INVALID_SUBVOL,
- BRB_MSG_RESCHEDULE_SCRUBBER_FAILED,
- BRB_MSG_SCRUB_START,
- BRB_MSG_SCRUB_FINISH,
- BRB_MSG_SCRUB_RUNNING,
- BRB_MSG_SCRUB_RESCHEDULED,
- BRB_MSG_SCRUB_TUNABLE,
- BRB_MSG_SCRUB_THREAD_CLEANUP,
- BRB_MSG_SCRUBBER_CLEANED,
- BRB_MSG_GENERIC_SSM_INFO,
- BRB_MSG_ZERO_TIMEOUT_BUG,
- BRB_MSG_BAD_OBJ_READDIR_FAIL,
- BRB_MSG_SSM_FAILED,
- BRB_MSG_SCRUB_WAIT_FAILED
-);
+GLFS_MSGID(BITROT_BITD, BRB_MSG_FD_CREATE_FAILED, BRB_MSG_READV_FAILED,
+ BRB_MSG_BLOCK_READ_FAILED, BRB_MSG_CALC_CHECKSUM_FAILED,
+ BRB_MSG_NO_MEMORY, BRB_MSG_GET_SIGN_FAILED, BRB_MSG_SET_SIGN_FAILED,
+ BRB_MSG_OP_FAILED, BRB_MSG_READ_AND_SIGN_FAILED, BRB_MSG_SIGN_FAILED,
+ BRB_MSG_GET_SUBVOL_FAILED, BRB_MSG_SET_TIMER_FAILED,
+ BRB_MSG_GET_INFO_FAILED, BRB_MSG_PATH_FAILED, BRB_MSG_MARK_BAD_FILE,
+ BRB_MSG_TRIGGER_SIGN, BRB_MSG_REGISTER_FAILED,
+ BRB_MSG_CRAWLING_START, BRB_MSG_SPAWN_FAILED,
+ BRB_MSG_INVALID_SUBVOL_CHILD, BRB_MSG_SKIP_OBJECT, BRB_MSG_NO_CHILD,
+ BRB_MSG_CHECKSUM_MISMATCH, BRB_MSG_MARK_CORRUPTED,
+ BRB_MSG_CRAWLING_FINISH, BRB_MSG_CALC_ERROR, BRB_MSG_LOOKUP_FAILED,
+ BRB_MSG_PARTIAL_VERSION_PRESENCE, BRB_MSG_MEM_ACNT_FAILED,
+ BRB_MSG_TIMER_WHEEL_UNAVAILABLE, BRB_MSG_BITROT_LOADED,
+ BRB_MSG_SCALE_DOWN_FAILED, BRB_MSG_SCALE_UP_FAILED,
+ BRB_MSG_SCALE_DOWN_SCRUBBER, BRB_MSG_SCALING_UP_SCRUBBER,
+ BRB_MSG_UNKNOWN_THROTTLE, BRB_MSG_RATE_LIMIT_INFO,
+ BRB_MSG_SCRUB_INFO, BRB_MSG_CONNECTED_TO_BRICK, BRB_MSG_BRICK_INFO,
+ BRB_MSG_SUBVOL_CONNECT_FAILED, BRB_MSG_INVALID_SUBVOL,
+ BRB_MSG_RESCHEDULE_SCRUBBER_FAILED, BRB_MSG_SCRUB_START,
+ BRB_MSG_SCRUB_FINISH, BRB_MSG_SCRUB_RUNNING,
+ BRB_MSG_SCRUB_RESCHEDULED, BRB_MSG_SCRUB_TUNABLE,
+ BRB_MSG_SCRUB_THREAD_CLEANUP, BRB_MSG_SCRUBBER_CLEANED,
+ BRB_MSG_GENERIC_SSM_INFO, BRB_MSG_ZERO_TIMEOUT_BUG,
+ BRB_MSG_BAD_OBJ_READDIR_FAIL, BRB_MSG_SSM_FAILED,
+ BRB_MSG_SCRUB_WAIT_FAILED);
#endif /* !_BITROT_BITD_MESSAGES_H_ */
diff --git a/xlators/features/bit-rot/src/bitd/bit-rot-scrub-status.h b/xlators/features/bit-rot/src/bitd/bit-rot-scrub-status.h
index 02bd0fab04e..24128b90a66 100644
--- a/xlators/features/bit-rot/src/bitd/bit-rot-scrub-status.h
+++ b/xlators/features/bit-rot/src/bitd/bit-rot-scrub-status.h
@@ -16,33 +16,33 @@
#include <pthread.h>
struct br_scrub_stats {
- uint64_t scrubbed_files; /* Total number of scrubbed file */
+ uint64_t scrubbed_files; /* Total number of scrubbed file */
- uint64_t unsigned_files; /* Total number of unsigned file */
+ uint64_t unsigned_files; /* Total number of unsigned file */
- uint64_t scrub_duration; /* Duration of last scrub */
+ uint64_t scrub_duration; /* Duration of last scrub */
- char last_scrub_time[1024]; /*last scrub completion time */
+ char last_scrub_time[1024]; /*last scrub completion time */
- struct timeval scrub_start_tv; /* Scrubbing starting time*/
+ struct timeval scrub_start_tv; /* Scrubbing starting time*/
- struct timeval scrub_end_tv; /* Scrubbing finishing time */
+ struct timeval scrub_end_tv; /* Scrubbing finishing time */
- int8_t scrub_running; /* Scrub running or not */
+ int8_t scrub_running; /* Scrub running or not */
- pthread_mutex_t lock;
+ pthread_mutex_t lock;
};
typedef struct br_scrub_stats br_scrub_stats_t;
void
-br_inc_unsigned_file_count (br_scrub_stats_t *scrub_stat);
+br_inc_unsigned_file_count(br_scrub_stats_t *scrub_stat);
void
-br_inc_scrubbed_file (br_scrub_stats_t *scrub_stat);
+br_inc_scrubbed_file(br_scrub_stats_t *scrub_stat);
void
-br_update_scrub_start_time (br_scrub_stats_t *scrub_stat, struct timeval *tv);
+br_update_scrub_start_time(br_scrub_stats_t *scrub_stat, struct timeval *tv);
void
-br_update_scrub_finish_time (br_scrub_stats_t *scrub_stat, char *timestr,
- struct timeval *tv);
+br_update_scrub_finish_time(br_scrub_stats_t *scrub_stat, char *timestr,
+ struct timeval *tv);
#endif /* __BIT_ROT_SCRUB_STATUS_H__ */
diff --git a/xlators/features/bit-rot/src/bitd/bit-rot-scrub.h b/xlators/features/bit-rot/src/bitd/bit-rot-scrub.h
index 8cc88ec153e..7a3c14abb93 100644
--- a/xlators/features/bit-rot/src/bitd/bit-rot-scrub.h
+++ b/xlators/features/bit-rot/src/bitd/bit-rot-scrub.h
@@ -14,24 +14,33 @@
#include "xlator.h"
#include "bit-rot.h"
-void *br_fsscanner (void *);
+void *
+br_fsscanner(void *);
-int32_t br_fsscan_schedule (xlator_t *);
-int32_t br_fsscan_reschedule (xlator_t *);
-int32_t br_fsscan_activate (xlator_t *);
-int32_t br_fsscan_deactivate (xlator_t *);
-int32_t br_fsscan_ondemand (xlator_t *);
+int32_t
+br_fsscan_schedule(xlator_t *);
+int32_t
+br_fsscan_reschedule(xlator_t *);
+int32_t
+br_fsscan_activate(xlator_t *);
+int32_t
+br_fsscan_deactivate(xlator_t *);
+int32_t
+br_fsscan_ondemand(xlator_t *);
-int32_t br_scrubber_handle_options (xlator_t *, br_private_t *, dict_t *);
+int32_t
+br_scrubber_handle_options(xlator_t *, br_private_t *, dict_t *);
int32_t
-br_scrubber_monitor_init (xlator_t *, br_private_t *);
+br_scrubber_monitor_init(xlator_t *, br_private_t *);
-int32_t br_scrubber_init (xlator_t *, br_private_t *);
+int32_t
+br_scrubber_init(xlator_t *, br_private_t *);
-int32_t br_collect_bad_objects_from_children (xlator_t *this, dict_t *dict);
+int32_t
+br_collect_bad_objects_from_children(xlator_t *this, dict_t *dict);
void
-br_child_set_scrub_state (br_child_t *, gf_boolean_t);
+br_child_set_scrub_state(br_child_t *, gf_boolean_t);
#endif /* __BIT_ROT_SCRUB_H__ */
diff --git a/xlators/features/bit-rot/src/bitd/bit-rot-ssm.h b/xlators/features/bit-rot/src/bitd/bit-rot-ssm.h
index 8609477180b..f3fbe2928b7 100644
--- a/xlators/features/bit-rot/src/bitd/bit-rot-ssm.h
+++ b/xlators/features/bit-rot/src/bitd/bit-rot-ssm.h
@@ -14,24 +14,25 @@
#include "xlator.h"
typedef enum br_scrub_state {
- BR_SCRUB_STATE_INACTIVE = 0,
- BR_SCRUB_STATE_PENDING,
- BR_SCRUB_STATE_ACTIVE,
- BR_SCRUB_STATE_PAUSED,
- BR_SCRUB_STATE_IPAUSED,
- BR_SCRUB_STATE_STALLED,
- BR_SCRUB_MAXSTATES,
+ BR_SCRUB_STATE_INACTIVE = 0,
+ BR_SCRUB_STATE_PENDING,
+ BR_SCRUB_STATE_ACTIVE,
+ BR_SCRUB_STATE_PAUSED,
+ BR_SCRUB_STATE_IPAUSED,
+ BR_SCRUB_STATE_STALLED,
+ BR_SCRUB_MAXSTATES,
} br_scrub_state_t;
typedef enum br_scrub_event {
- BR_SCRUB_EVENT_SCHEDULE = 0,
- BR_SCRUB_EVENT_PAUSE,
- BR_SCRUB_EVENT_ONDEMAND,
- BR_SCRUB_MAXEVENTS,
+ BR_SCRUB_EVENT_SCHEDULE = 0,
+ BR_SCRUB_EVENT_PAUSE,
+ BR_SCRUB_EVENT_ONDEMAND,
+ BR_SCRUB_MAXEVENTS,
} br_scrub_event_t;
struct br_monitor;
-int32_t br_scrub_state_machine (xlator_t *, gf_boolean_t);
+int32_t
+br_scrub_state_machine(xlator_t *, gf_boolean_t);
#endif /* __BIT_ROT_SSM_H__ */
diff --git a/xlators/features/bit-rot/src/bitd/bit-rot.h b/xlators/features/bit-rot/src/bitd/bit-rot.h
index 670060c8d88..962b4d717e6 100644
--- a/xlators/features/bit-rot/src/bitd/bit-rot.h
+++ b/xlators/features/bit-rot/src/bitd/bit-rot.h
@@ -37,271 +37,270 @@
#define BR_WORKERS 4
typedef enum scrub_throttle {
- BR_SCRUB_THROTTLE_VOID = -1,
- BR_SCRUB_THROTTLE_LAZY = 0,
- BR_SCRUB_THROTTLE_NORMAL = 1,
- BR_SCRUB_THROTTLE_AGGRESSIVE = 2,
- BR_SCRUB_THROTTLE_STALLED = 3,
+ BR_SCRUB_THROTTLE_VOID = -1,
+ BR_SCRUB_THROTTLE_LAZY = 0,
+ BR_SCRUB_THROTTLE_NORMAL = 1,
+ BR_SCRUB_THROTTLE_AGGRESSIVE = 2,
+ BR_SCRUB_THROTTLE_STALLED = 3,
} scrub_throttle_t;
typedef enum scrub_freq {
- BR_FSSCRUB_FREQ_HOURLY = 1,
- BR_FSSCRUB_FREQ_DAILY,
- BR_FSSCRUB_FREQ_WEEKLY,
- BR_FSSCRUB_FREQ_BIWEEKLY,
- BR_FSSCRUB_FREQ_MONTHLY,
- BR_FSSCRUB_FREQ_MINUTE,
- BR_FSSCRUB_FREQ_STALLED,
+ BR_FSSCRUB_FREQ_HOURLY = 1,
+ BR_FSSCRUB_FREQ_DAILY,
+ BR_FSSCRUB_FREQ_WEEKLY,
+ BR_FSSCRUB_FREQ_BIWEEKLY,
+ BR_FSSCRUB_FREQ_MONTHLY,
+ BR_FSSCRUB_FREQ_MINUTE,
+ BR_FSSCRUB_FREQ_STALLED,
} scrub_freq_t;
-#define signature_size(hl) (sizeof (br_isignature_t) + hl + 1)
+#define signature_size(hl) (sizeof(br_isignature_t) + hl + 1)
struct br_scanfs {
- gf_lock_t entrylock;
+ gf_lock_t entrylock;
- pthread_mutex_t waitlock;
- pthread_cond_t waitcond;
+ pthread_mutex_t waitlock;
+ pthread_cond_t waitcond;
- unsigned int entries;
- struct list_head queued;
- struct list_head ready;
+ unsigned int entries;
+ struct list_head queued;
+ struct list_head ready;
};
/* just need three states to track child status */
typedef enum br_child_state {
- BR_CHILD_STATE_CONNECTED = 1,
- BR_CHILD_STATE_INITIALIZING,
- BR_CHILD_STATE_CONNFAILED,
- BR_CHILD_STATE_DISCONNECTED,
+ BR_CHILD_STATE_CONNECTED = 1,
+ BR_CHILD_STATE_INITIALIZING,
+ BR_CHILD_STATE_CONNFAILED,
+ BR_CHILD_STATE_DISCONNECTED,
} br_child_state_t;
struct br_child {
- pthread_mutex_t lock; /* protects child state */
- char witnessed; /* witnessed at least one successful
- connection */
- br_child_state_t c_state; /* current state of this child */
+ pthread_mutex_t lock; /* protects child state */
+ char witnessed; /* witnessed at least one successful
+ connection */
+ br_child_state_t c_state; /* current state of this child */
- char child_up; /* Indicates whether this child is
- up or not */
- xlator_t *xl; /* client xlator corresponding to
- this child */
- inode_table_t *table; /* inode table for this child */
- char brick_path[PATH_MAX]; /* brick export directory of this
- child */
- struct list_head list; /* hook to attach to the list of
- UP children */
- xlator_t *this; /* Bit rot xlator */
+ char child_up; /* Indicates whether this child is
+ up or not */
+ xlator_t *xl; /* client xlator corresponding to
+ this child */
+ inode_table_t *table; /* inode table for this child */
+ char brick_path[PATH_MAX]; /* brick export directory of this
+ child */
+ struct list_head list; /* hook to attach to the list of
+ UP children */
+ xlator_t *this; /* Bit rot xlator */
- pthread_t thread; /* initial crawler for unsigned
- object(s) or scrub crawler */
- int threadrunning; /* active thread */
+ pthread_t thread; /* initial crawler for unsigned
+ object(s) or scrub crawler */
+ int threadrunning; /* active thread */
- struct mem_pool *timer_pool; /* timer-wheel's timer mem-pool */
+ struct mem_pool *timer_pool; /* timer-wheel's timer mem-pool */
- struct timeval tv;
+ struct timeval tv;
- struct br_scanfs fsscan; /* per subvolume FS scanner */
+ struct br_scanfs fsscan; /* per subvolume FS scanner */
- gf_boolean_t active_scrubbing; /* Actively scrubbing or not */
+ gf_boolean_t active_scrubbing; /* Actively scrubbing or not */
};
typedef struct br_child br_child_t;
struct br_obj_n_workers {
- struct list_head objects; /* queue of objects expired from the
- timer wheel and ready to be picked
- up for signing */
- pthread_t workers[BR_WORKERS]; /* Threads which pick up the objects
- from the above queue and start
- signing each object */
+ struct list_head objects; /* queue of objects expired from the
+ timer wheel and ready to be picked
+ up for signing */
+ pthread_t workers[BR_WORKERS]; /* Threads which pick up the objects
+ from the above queue and start
+ signing each object */
};
struct br_scrubber {
- xlator_t *this;
+ xlator_t *this;
- scrub_throttle_t throttle;
+ scrub_throttle_t throttle;
- /**
- * frequency of scanning for this subvolume. this should
- * normally be per-child, but since all children follow the
- * same frequency for a volume, this option ends up here
- * instead of br_child_t.
- */
- scrub_freq_t frequency;
+ /**
+ * frequency of scanning for this subvolume. this should
+ * normally be per-child, but since all children follow the
+ * same frequency for a volume, this option ends up here
+ * instead of br_child_t.
+ */
+ scrub_freq_t frequency;
- gf_boolean_t frequency_reconf;
- gf_boolean_t throttle_reconf;
+ gf_boolean_t frequency_reconf;
+ gf_boolean_t throttle_reconf;
- pthread_mutex_t mutex;
- pthread_cond_t cond;
+ pthread_mutex_t mutex;
+ pthread_cond_t cond;
- unsigned int nr_scrubbers;
- struct list_head scrubbers;
+ unsigned int nr_scrubbers;
+ struct list_head scrubbers;
- /**
- * list of "rotatable" subvolume(s) undergoing scrubbing
- */
- struct list_head scrublist;
+ /**
+ * list of "rotatable" subvolume(s) undergoing scrubbing
+ */
+ struct list_head scrublist;
};
struct br_monitor {
- gf_lock_t lock;
- pthread_t thread; /* Monitor thread */
-
- gf_boolean_t inited;
- pthread_mutex_t mutex;
- pthread_cond_t cond; /* Thread starts and will be waiting on cond.
- First child which is up wakes this up */
-
- xlator_t *this;
- /* scheduler */
- uint32_t boot;
-
- int32_t active_child_count; /* Number of children currently scrubbing */
- gf_boolean_t kick; /* This variable tracks the scrubber is
- * kicked or not. Both 'kick' and
- * 'active_child_count' uses the same pair
- * of mutex-cond variable, i.e, wakelock and
- * wakecond. */
-
- pthread_mutex_t wakelock;
- pthread_cond_t wakecond;
-
- gf_boolean_t done;
- pthread_mutex_t donelock;
- pthread_cond_t donecond;
-
- struct gf_tw_timer_list *timer;
- br_scrub_state_t state; /* current scrub state */
+ gf_lock_t lock;
+ pthread_t thread; /* Monitor thread */
+
+ gf_boolean_t inited;
+ pthread_mutex_t mutex;
+ pthread_cond_t cond; /* Thread starts and will be waiting on cond.
+ First child which is up wakes this up */
+
+ xlator_t *this;
+ /* scheduler */
+ uint32_t boot;
+
+ int32_t active_child_count; /* Number of children currently scrubbing */
+ gf_boolean_t kick; /* This variable tracks the scrubber is
+ * kicked or not. Both 'kick' and
+ * 'active_child_count' uses the same pair
+ * of mutex-cond variable, i.e, wakelock and
+ * wakecond. */
+
+ pthread_mutex_t wakelock;
+ pthread_cond_t wakecond;
+
+ gf_boolean_t done;
+ pthread_mutex_t donelock;
+ pthread_cond_t donecond;
+
+ struct gf_tw_timer_list *timer;
+ br_scrub_state_t state; /* current scrub state */
};
typedef struct br_obj_n_workers br_obj_n_workers_t;
typedef struct br_private br_private_t;
-typedef void (*br_scrubbed_file_update) (br_private_t *priv);
+typedef void (*br_scrubbed_file_update)(br_private_t *priv);
struct br_private {
- pthread_mutex_t lock;
+ pthread_mutex_t lock;
- struct list_head bricks; /* list of bricks from which enents
- have been received */
+ struct list_head bricks; /* list of bricks from which enents
+ have been received */
- struct list_head signing;
+ struct list_head signing;
- pthread_cond_t object_cond; /* handling signing of objects */
- int child_count;
- br_child_t *children; /* list of subvolumes */
- int up_children;
+ pthread_cond_t object_cond; /* handling signing of objects */
+ int child_count;
+ br_child_t *children; /* list of subvolumes */
+ int up_children;
- pthread_cond_t cond; /* handling CHILD_UP notifications */
- pthread_t thread; /* thread for connecting each UP
- child with changelog */
+ pthread_cond_t cond; /* handling CHILD_UP notifications */
+ pthread_t thread; /* thread for connecting each UP
+ child with changelog */
- struct tvec_base *timer_wheel; /* timer wheel where the objects which
- changelog has sent sits and waits
- for expiry */
- br_obj_n_workers_t *obj_queue; /* place holder for all the objects
- that are expired from timer wheel
- and ready to be picked up for
- signing and the workers which sign
- the objects */
+ struct tvec_base *timer_wheel; /* timer wheel where the objects which
+ changelog has sent sits and waits
+ for expiry */
+ br_obj_n_workers_t *obj_queue; /* place holder for all the objects
+ that are expired from timer wheel
+ and ready to be picked up for
+ signing and the workers which sign
+ the objects */
- uint32_t expiry_time; /* objects "wait" time */
+ uint32_t expiry_time; /* objects "wait" time */
- tbf_t *tbf; /* token bucket filter */
+ tbf_t *tbf; /* token bucket filter */
- gf_boolean_t iamscrubber; /* function as a fs scrubber */
+ gf_boolean_t iamscrubber; /* function as a fs scrubber */
- struct br_scrub_stats scrub_stat; /* statistics of scrub*/
+ struct br_scrub_stats scrub_stat; /* statistics of scrub*/
- struct br_scrubber fsscrub; /* scrubbers for this subvolume */
+ struct br_scrubber fsscrub; /* scrubbers for this subvolume */
- struct br_monitor scrub_monitor; /* scrubber monitor */
+ struct br_monitor scrub_monitor; /* scrubber monitor */
};
struct br_object {
- xlator_t *this;
+ xlator_t *this;
- uuid_t gfid;
+ uuid_t gfid;
- unsigned long signedversion; /* version against which this object will
- be signed */
- br_child_t *child; /* object's subvolume */
+ unsigned long signedversion; /* version against which this object will
+ be signed */
+ br_child_t *child; /* object's subvolume */
- int sign_info;
+ int sign_info;
- struct list_head list; /* hook to add to the queue once the
- object is expired from timer wheel */
- void *data;
+ struct list_head list; /* hook to add to the queue once the
+ object is expired from timer wheel */
+ void *data;
};
typedef struct br_object br_object_t;
-typedef int32_t (br_scrub_ssm_call) (xlator_t *);
+typedef int32_t(br_scrub_ssm_call)(xlator_t *);
void
-br_log_object (xlator_t *, char *, uuid_t, int32_t);
+br_log_object(xlator_t *, char *, uuid_t, int32_t);
void
-br_log_object_path (xlator_t *, char *, const char *, int32_t);
+br_log_object_path(xlator_t *, char *, const char *, int32_t);
int32_t
-br_calculate_obj_checksum (unsigned char *,
- br_child_t *, fd_t *, struct iatt *);
+br_calculate_obj_checksum(unsigned char *, br_child_t *, fd_t *, struct iatt *);
int32_t
-br_prepare_loc (xlator_t *, br_child_t *, loc_t *, gf_dirent_t *, loc_t *);
+br_prepare_loc(xlator_t *, br_child_t *, loc_t *, gf_dirent_t *, loc_t *);
gf_boolean_t
-bitd_is_bad_file (xlator_t *, br_child_t *, loc_t *, fd_t *);
+bitd_is_bad_file(xlator_t *, br_child_t *, loc_t *, fd_t *);
static inline void
-_br_set_child_state (br_child_t *child, br_child_state_t state)
+_br_set_child_state(br_child_t *child, br_child_state_t state)
{
- child->c_state = state;
+ child->c_state = state;
}
static inline int
-_br_is_child_connected (br_child_t *child)
+_br_is_child_connected(br_child_t *child)
{
- return (child->c_state == BR_CHILD_STATE_CONNECTED);
+ return (child->c_state == BR_CHILD_STATE_CONNECTED);
}
static inline int
-_br_is_child_scrub_active (br_child_t *child)
+_br_is_child_scrub_active(br_child_t *child)
{
- return child->active_scrubbing;
+ return child->active_scrubbing;
}
static inline int
-_br_child_failed_conn (br_child_t *child)
+_br_child_failed_conn(br_child_t *child)
{
- return (child->c_state == BR_CHILD_STATE_CONNFAILED);
+ return (child->c_state == BR_CHILD_STATE_CONNFAILED);
}
static inline int
-_br_child_witnessed_connection (br_child_t *child)
+_br_child_witnessed_connection(br_child_t *child)
{
- return (child->witnessed == 1);
+ return (child->witnessed == 1);
}
/* scrub state */
static inline void
-_br_monitor_set_scrub_state (struct br_monitor *scrub_monitor,
- br_scrub_state_t state)
+_br_monitor_set_scrub_state(struct br_monitor *scrub_monitor,
+ br_scrub_state_t state)
{
- scrub_monitor->state = state;
+ scrub_monitor->state = state;
}
static inline br_scrub_event_t
-_br_child_get_scrub_event (struct br_scrubber *fsscrub)
+_br_child_get_scrub_event(struct br_scrubber *fsscrub)
{
- return (fsscrub->frequency == BR_FSSCRUB_FREQ_STALLED)
- ? BR_SCRUB_EVENT_PAUSE : BR_SCRUB_EVENT_SCHEDULE;
+ return (fsscrub->frequency == BR_FSSCRUB_FREQ_STALLED)
+ ? BR_SCRUB_EVENT_PAUSE
+ : BR_SCRUB_EVENT_SCHEDULE;
}
int32_t
-br_get_bad_objects_list (xlator_t *this, dict_t **dict);
-
+br_get_bad_objects_list(xlator_t *this, dict_t **dict);
#endif /* __BIT_ROT_H__ */
diff --git a/xlators/features/bit-rot/src/stub/bit-rot-common.h b/xlators/features/bit-rot/src/stub/bit-rot-common.h
index 2afc9f47c29..ef683ac7f9f 100644
--- a/xlators/features/bit-rot/src/stub/bit-rot-common.h
+++ b/xlators/features/bit-rot/src/stub/bit-rot-common.h
@@ -14,71 +14,71 @@
#include "glusterfs.h"
#include "bit-rot-object-version.h"
-#define BR_VXATTR_VERSION (1 << 0)
+#define BR_VXATTR_VERSION (1 << 0)
#define BR_VXATTR_SIGNATURE (1 << 1)
#define BR_VXATTR_SIGN_MISSING (BR_VXATTR_SIGNATURE)
-#define BR_VXATTR_ALL_MISSING \
- (BR_VXATTR_VERSION | BR_VXATTR_SIGNATURE)
+#define BR_VXATTR_ALL_MISSING (BR_VXATTR_VERSION | BR_VXATTR_SIGNATURE)
-#define BR_BAD_OBJ_CONTAINER (uuid_t){0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8}
+#define BR_BAD_OBJ_CONTAINER \
+ (uuid_t) { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8 }
typedef enum br_vxattr_state {
- BR_VXATTR_STATUS_FULL = 0,
- BR_VXATTR_STATUS_MISSING = 1,
- BR_VXATTR_STATUS_UNSIGNED = 2,
- BR_VXATTR_STATUS_INVALID = 3,
+ BR_VXATTR_STATUS_FULL = 0,
+ BR_VXATTR_STATUS_MISSING = 1,
+ BR_VXATTR_STATUS_UNSIGNED = 2,
+ BR_VXATTR_STATUS_INVALID = 3,
} br_vxattr_status_t;
typedef enum br_sign_state {
- BR_SIGN_INVALID = -1,
- BR_SIGN_NORMAL = 0,
- BR_SIGN_REOPEN_WAIT = 1,
- BR_SIGN_QUICK = 2,
+ BR_SIGN_INVALID = -1,
+ BR_SIGN_NORMAL = 0,
+ BR_SIGN_REOPEN_WAIT = 1,
+ BR_SIGN_QUICK = 2,
} br_sign_state_t;
static inline br_vxattr_status_t
-br_version_xattr_state (dict_t *xattr, br_version_t **obuf,
- br_signature_t **sbuf, gf_boolean_t *objbad)
+br_version_xattr_state(dict_t *xattr, br_version_t **obuf,
+ br_signature_t **sbuf, gf_boolean_t *objbad)
{
- int32_t ret = 0;
- int32_t vxattr = 0;
- br_vxattr_status_t status;
- void *data = NULL;
-
- /**
- * The key being present in the dict indicates the xattr was set on
- * disk. The presence of xattr itself as of now is suffecient to say
- * the the object is bad.
- */
- *objbad = _gf_false;
- ret = dict_get_bin (xattr, BITROT_OBJECT_BAD_KEY, (void **)&data);
- if (!ret)
- *objbad = _gf_true;
-
- ret = dict_get_bin (xattr, BITROT_CURRENT_VERSION_KEY, (void **)obuf);
- if (ret)
- vxattr |= BR_VXATTR_VERSION;
-
- ret = dict_get_bin (xattr, BITROT_SIGNING_VERSION_KEY, (void **)sbuf);
- if (ret)
- vxattr |= BR_VXATTR_SIGNATURE;
-
- switch (vxattr) {
+ int32_t ret = 0;
+ int32_t vxattr = 0;
+ br_vxattr_status_t status;
+ void *data = NULL;
+
+ /**
+ * The key being present in the dict indicates the xattr was set on
+ * disk. The presence of xattr itself as of now is suffecient to say
+ * the the object is bad.
+ */
+ *objbad = _gf_false;
+ ret = dict_get_bin(xattr, BITROT_OBJECT_BAD_KEY, (void **)&data);
+ if (!ret)
+ *objbad = _gf_true;
+
+ ret = dict_get_bin(xattr, BITROT_CURRENT_VERSION_KEY, (void **)obuf);
+ if (ret)
+ vxattr |= BR_VXATTR_VERSION;
+
+ ret = dict_get_bin(xattr, BITROT_SIGNING_VERSION_KEY, (void **)sbuf);
+ if (ret)
+ vxattr |= BR_VXATTR_SIGNATURE;
+
+ switch (vxattr) {
case 0:
- status = BR_VXATTR_STATUS_FULL;
- break;
+ status = BR_VXATTR_STATUS_FULL;
+ break;
case BR_VXATTR_SIGN_MISSING:
- status = BR_VXATTR_STATUS_UNSIGNED;
- break;
+ status = BR_VXATTR_STATUS_UNSIGNED;
+ break;
case BR_VXATTR_ALL_MISSING:
- status = BR_VXATTR_STATUS_MISSING;
- break;
+ status = BR_VXATTR_STATUS_MISSING;
+ break;
default:
- status = BR_VXATTR_STATUS_INVALID;
- }
+ status = BR_VXATTR_STATUS_INVALID;
+ }
- return status;
+ return status;
}
/**
@@ -86,13 +86,13 @@ br_version_xattr_state (dict_t *xattr, br_version_t **obuf,
* signing.
*/
typedef struct br_isignature_in {
- int8_t signaturetype; /* signature type */
+ int8_t signaturetype; /* signature type */
- unsigned long signedversion; /* version against which the
- object was signed */
+ unsigned long signedversion; /* version against which the
+ object was signed */
- size_t signaturelen; /* signature length */
- char signature[0]; /* object signature */
+ size_t signaturelen; /* signature length */
+ char signature[0]; /* object signature */
} br_isignature_t;
/**
@@ -100,80 +100,79 @@ typedef struct br_isignature_in {
* verification.
*/
typedef struct br_isignature_out {
- char stale; /* stale signature? */
+ char stale; /* stale signature? */
- unsigned long version; /* current signed version */
+ unsigned long version; /* current signed version */
- uint32_t time[2]; /* time when the object
- got dirtied */
+ uint32_t time[2]; /* time when the object
+ got dirtied */
- int8_t signaturetype; /* hash type */
- size_t signaturelen; /* signature length */
- char signature[0]; /* signature (hash) */
+ int8_t signaturetype; /* hash type */
+ size_t signaturelen; /* signature length */
+ char signature[0]; /* signature (hash) */
} br_isignature_out_t;
typedef struct br_stub_init {
- uint32_t timebuf[2];
- char export[PATH_MAX];
+ uint32_t timebuf[2];
+ char export[PATH_MAX];
} br_stub_init_t;
typedef enum {
- BR_SIGNATURE_TYPE_VOID = -1, /* object is not signed */
- BR_SIGNATURE_TYPE_ZERO = 0, /* min boundary */
- BR_SIGNATURE_TYPE_SHA256 = 1, /* signed with SHA256 */
- BR_SIGNATURE_TYPE_MAX = 2, /* max boundary */
+ BR_SIGNATURE_TYPE_VOID = -1, /* object is not signed */
+ BR_SIGNATURE_TYPE_ZERO = 0, /* min boundary */
+ BR_SIGNATURE_TYPE_SHA256 = 1, /* signed with SHA256 */
+ BR_SIGNATURE_TYPE_MAX = 2, /* max boundary */
} br_signature_type;
/* BitRot stub start time (virtual xattr) */
-#define GLUSTERFS_GET_BR_STUB_INIT_TIME "trusted.glusterfs.bit-rot.stub-init"
+#define GLUSTERFS_GET_BR_STUB_INIT_TIME "trusted.glusterfs.bit-rot.stub-init"
/* signing/reopen hint */
#define BR_OBJECT_RESIGN 0
-#define BR_OBJECT_REOPEN 1
-#define BR_REOPEN_SIGN_HINT_KEY "trusted.glusterfs.bit-rot.reopen-hint"
+#define BR_OBJECT_REOPEN 1
+#define BR_REOPEN_SIGN_HINT_KEY "trusted.glusterfs.bit-rot.reopen-hint"
static inline int
-br_is_signature_type_valid (int8_t signaturetype)
+br_is_signature_type_valid(int8_t signaturetype)
{
- return ((signaturetype > BR_SIGNATURE_TYPE_ZERO)
- && (signaturetype < BR_SIGNATURE_TYPE_MAX));
+ return ((signaturetype > BR_SIGNATURE_TYPE_ZERO) &&
+ (signaturetype < BR_SIGNATURE_TYPE_MAX));
}
static inline void
-br_set_default_ongoingversion (br_version_t *buf, uint32_t *tv)
+br_set_default_ongoingversion(br_version_t *buf, uint32_t *tv)
{
- buf->ongoingversion = BITROT_DEFAULT_CURRENT_VERSION;
- buf->timebuf[0] = tv[0];
- buf->timebuf[1] = tv[1];
+ buf->ongoingversion = BITROT_DEFAULT_CURRENT_VERSION;
+ buf->timebuf[0] = tv[0];
+ buf->timebuf[1] = tv[1];
}
static inline void
-br_set_default_signature (br_signature_t *buf, size_t *size)
+br_set_default_signature(br_signature_t *buf, size_t *size)
{
- buf->signaturetype = (int8_t) BR_SIGNATURE_TYPE_VOID;
- buf->signedversion = BITROT_DEFAULT_SIGNING_VERSION;
+ buf->signaturetype = (int8_t)BR_SIGNATURE_TYPE_VOID;
+ buf->signedversion = BITROT_DEFAULT_SIGNING_VERSION;
- *size = sizeof (br_signature_t); /* no signature */
+ *size = sizeof(br_signature_t); /* no signature */
}
static inline void
-br_set_ongoingversion (br_version_t *buf,
- unsigned long version, uint32_t *tv)
+br_set_ongoingversion(br_version_t *buf, unsigned long version, uint32_t *tv)
{
- buf->ongoingversion = version;
- buf->timebuf[0] = tv[0];
- buf->timebuf[1] = tv[1];
+ buf->ongoingversion = version;
+ buf->timebuf[0] = tv[0];
+ buf->timebuf[1] = tv[1];
}
static inline void
-br_set_signature (br_signature_t *buf,
- br_isignature_t *sign, size_t signaturelen, size_t *size)
+br_set_signature(br_signature_t *buf, br_isignature_t *sign,
+ size_t signaturelen, size_t *size)
{
- buf->signaturetype = sign->signaturetype;
- buf->signedversion = ntohl (sign->signedversion);
+ buf->signaturetype = sign->signaturetype;
+ buf->signedversion = ntohl(sign->signedversion);
- memcpy (buf->signature, sign->signature, signaturelen);
- *size = sizeof (br_signature_t) + signaturelen;
+ memcpy(buf->signature, sign->signature, signaturelen);
+ *size = sizeof(br_signature_t) + signaturelen;
}
#endif /* __BIT_ROT_COMMON_H__ */
diff --git a/xlators/features/bit-rot/src/stub/bit-rot-object-version.h b/xlators/features/bit-rot/src/stub/bit-rot-object-version.h
index 1f2497aebe9..7ae6a5200df 100644
--- a/xlators/features/bit-rot/src/stub/bit-rot-object-version.h
+++ b/xlators/features/bit-rot/src/stub/bit-rot-object-version.h
@@ -15,16 +15,16 @@
* on-disk formats for ongoing version and object signature.
*/
typedef struct br_version {
- unsigned long ongoingversion;
- uint32_t timebuf[2];
+ unsigned long ongoingversion;
+ uint32_t timebuf[2];
} br_version_t;
-typedef struct __attribute__ ((__packed__)) br_signature {
- int8_t signaturetype;
+typedef struct __attribute__((__packed__)) br_signature {
+ int8_t signaturetype;
- unsigned long signedversion;
+ unsigned long signedversion;
- char signature[0];
+ char signature[0];
} br_signature_t;
#endif
diff --git a/xlators/features/bit-rot/src/stub/bit-rot-stub-mem-types.h b/xlators/features/bit-rot/src/stub/bit-rot-stub-mem-types.h
index 1652a3ebf8d..a3e7b03291e 100644
--- a/xlators/features/bit-rot/src/stub/bit-rot-stub-mem-types.h
+++ b/xlators/features/bit-rot/src/stub/bit-rot-stub-mem-types.h
@@ -14,22 +14,22 @@
#include "mem-types.h"
enum br_mem_types {
- gf_br_stub_mt_private_t = gf_common_mt_end + 1,
- gf_br_stub_mt_version_t,
- gf_br_stub_mt_inode_ctx_t,
- gf_br_stub_mt_signature_t,
- gf_br_mt_br_private_t,
- gf_br_mt_br_child_t,
- gf_br_mt_br_object_t,
- gf_br_mt_br_ob_n_wk_t,
- gf_br_mt_br_scrubber_t,
- gf_br_mt_br_fsscan_entry_t,
- gf_br_stub_mt_br_stub_fd_t,
- gf_br_stub_mt_br_scanner_freq_t,
- gf_br_stub_mt_sigstub_t,
- gf_br_mt_br_child_event_t,
- gf_br_stub_mt_misc,
- gf_br_stub_mt_end,
+ gf_br_stub_mt_private_t = gf_common_mt_end + 1,
+ gf_br_stub_mt_version_t,
+ gf_br_stub_mt_inode_ctx_t,
+ gf_br_stub_mt_signature_t,
+ gf_br_mt_br_private_t,
+ gf_br_mt_br_child_t,
+ gf_br_mt_br_object_t,
+ gf_br_mt_br_ob_n_wk_t,
+ gf_br_mt_br_scrubber_t,
+ gf_br_mt_br_fsscan_entry_t,
+ gf_br_stub_mt_br_stub_fd_t,
+ gf_br_stub_mt_br_scanner_freq_t,
+ gf_br_stub_mt_sigstub_t,
+ gf_br_mt_br_child_event_t,
+ gf_br_stub_mt_misc,
+ gf_br_stub_mt_end,
};
#endif
diff --git a/xlators/features/bit-rot/src/stub/bit-rot-stub-messages.h b/xlators/features/bit-rot/src/stub/bit-rot-stub-messages.h
index 2ade4f03997..cccc3b9c599 100644
--- a/xlators/features/bit-rot/src/stub/bit-rot-stub-messages.h
+++ b/xlators/features/bit-rot/src/stub/bit-rot-stub-messages.h
@@ -23,40 +23,22 @@
* glfs-message-id.h.
*/
-GLFS_MSGID(BITROT_STUB,
- BRS_MSG_NO_MEMORY,
- BRS_MSG_SET_EVENT_FAILED,
- BRS_MSG_MEM_ACNT_FAILED,
- BRS_MSG_CREATE_FRAME_FAILED,
- BRS_MSG_SET_CONTEXT_FAILED,
- BRS_MSG_CHANGE_VERSION_FAILED,
- BRS_MSG_ADD_FD_TO_LIST_FAILED,
- BRS_MSG_SET_FD_CONTEXT_FAILED,
- BRS_MSG_CREATE_ANONYMOUS_FD_FAILED,
- BRS_MSG_NO_CHILD,
- BRS_MSG_STUB_ALLOC_FAILED,
- BRS_MSG_GET_INODE_CONTEXT_FAILED,
- BRS_MSG_CANCEL_SIGN_THREAD_FAILED,
- BRS_MSG_ADD_FD_TO_INODE,
- BRS_MSG_SIGN_VERSION_ERROR,
- BRS_MSG_BAD_OBJ_MARK_FAIL,
- BRS_MSG_NON_SCRUB_BAD_OBJ_MARK,
- BRS_MSG_REMOVE_INTERNAL_XATTR,
- BRS_MSG_SET_INTERNAL_XATTR,
- BRS_MSG_BAD_OBJECT_ACCESS,
- BRS_MSG_BAD_CONTAINER_FAIL,
- BRS_MSG_BAD_OBJECT_DIR_FAIL,
- BRS_MSG_BAD_OBJECT_DIR_SEEK_FAIL,
- BRS_MSG_BAD_OBJECT_DIR_TELL_FAIL,
- BRS_MSG_BAD_OBJECT_DIR_READ_FAIL,
- BRS_MSG_GET_FD_CONTEXT_FAILED,
- BRS_MSG_BAD_HANDLE_DIR_NULL,
- BRS_MSG_BAD_OBJ_THREAD_FAIL,
- BRS_MSG_BAD_OBJ_DIR_CLOSE_FAIL,
- BRS_MSG_LINK_FAIL,
- BRS_MSG_BAD_OBJ_UNLINK_FAIL,
- BRS_MSG_DICT_SET_FAILED,
- BRS_MSG_PATH_GET_FAILED
-);
+GLFS_MSGID(BITROT_STUB, BRS_MSG_NO_MEMORY, BRS_MSG_SET_EVENT_FAILED,
+ BRS_MSG_MEM_ACNT_FAILED, BRS_MSG_CREATE_FRAME_FAILED,
+ BRS_MSG_SET_CONTEXT_FAILED, BRS_MSG_CHANGE_VERSION_FAILED,
+ BRS_MSG_ADD_FD_TO_LIST_FAILED, BRS_MSG_SET_FD_CONTEXT_FAILED,
+ BRS_MSG_CREATE_ANONYMOUS_FD_FAILED, BRS_MSG_NO_CHILD,
+ BRS_MSG_STUB_ALLOC_FAILED, BRS_MSG_GET_INODE_CONTEXT_FAILED,
+ BRS_MSG_CANCEL_SIGN_THREAD_FAILED, BRS_MSG_ADD_FD_TO_INODE,
+ BRS_MSG_SIGN_VERSION_ERROR, BRS_MSG_BAD_OBJ_MARK_FAIL,
+ BRS_MSG_NON_SCRUB_BAD_OBJ_MARK, BRS_MSG_REMOVE_INTERNAL_XATTR,
+ BRS_MSG_SET_INTERNAL_XATTR, BRS_MSG_BAD_OBJECT_ACCESS,
+ BRS_MSG_BAD_CONTAINER_FAIL, BRS_MSG_BAD_OBJECT_DIR_FAIL,
+ BRS_MSG_BAD_OBJECT_DIR_SEEK_FAIL, BRS_MSG_BAD_OBJECT_DIR_TELL_FAIL,
+ BRS_MSG_BAD_OBJECT_DIR_READ_FAIL, BRS_MSG_GET_FD_CONTEXT_FAILED,
+ BRS_MSG_BAD_HANDLE_DIR_NULL, BRS_MSG_BAD_OBJ_THREAD_FAIL,
+ BRS_MSG_BAD_OBJ_DIR_CLOSE_FAIL, BRS_MSG_LINK_FAIL,
+ BRS_MSG_BAD_OBJ_UNLINK_FAIL, BRS_MSG_DICT_SET_FAILED,
+ BRS_MSG_PATH_GET_FAILED);
#endif /* !_BITROT_STUB_MESSAGES_H_ */
diff --git a/xlators/features/bit-rot/src/stub/bit-rot-stub.h b/xlators/features/bit-rot/src/stub/bit-rot-stub.h
index e15f1cecbc0..a15667e323a 100644
--- a/xlators/features/bit-rot/src/stub/bit-rot-stub.h
+++ b/xlators/features/bit-rot/src/stub/bit-rot-stub.h
@@ -1,11 +1,11 @@
- /*
- Copyright (c) 2015 Red Hat, Inc. <http://www.redhat.com>
- This file is part of GlusterFS.
-
- This file is licensed to you under your choice of the GNU Lesser
- General Public License, version 3 or any later version (LGPLv3 or
- later), or the GNU General Public License, version 2 (GPLv2), in all
- cases as published by the Free Software Foundation.
+/*
+ Copyright (c) 2015 Red Hat, Inc. <http://www.redhat.com>
+ This file is part of GlusterFS.
+
+ This file is licensed to you under your choice of the GNU Lesser
+ General Public License, version 3 or any later version (LGPLv3 or
+ later), or the GNU General Public License, version 2 (GPLv2), in all
+ cases as published by the Free Software Foundation.
*/
#ifndef __BIT_ROT_STUB_H__
#define __BIT_ROT_STUB_H__
@@ -25,305 +25,302 @@
#include "syncop.h"
#include "syncop-utils.h"
-#define BAD_OBJECT_THREAD_STACK_SIZE ((size_t)(1024*1024))
+#define BAD_OBJECT_THREAD_STACK_SIZE ((size_t)(1024 * 1024))
#define BR_STUB_DUMP_STR_SIZE 65536
-#define BR_PATH_MAX_EXTRA (PATH_MAX+1024)
-#define BR_PATH_MAX_PLUS (PATH_MAX+2048)
+#define BR_PATH_MAX_EXTRA (PATH_MAX + 1024)
+#define BR_PATH_MAX_PLUS (PATH_MAX + 2048)
/*
* Oops. Spelling mistake. Correcting it
*/
-#define OLD_BR_STUB_QUARANTINE_DIR GF_HIDDEN_PATH"/quanrantine"
-#define BR_STUB_QUARANTINE_DIR GF_HIDDEN_PATH"/quarantine"
+#define OLD_BR_STUB_QUARANTINE_DIR GF_HIDDEN_PATH "/quanrantine"
+#define BR_STUB_QUARANTINE_DIR GF_HIDDEN_PATH "/quarantine"
/* do not reference frame->local in cbk unless initialized.
* Assigned 0x1 marks verisoning flag between call path and
* cbk path.
*/
-#define BR_STUB_VER_NOT_ACTIVE_THEN_GOTO(frame, priv, label) do { \
- if (priv->do_versioning) \
- frame->local = (void *)0x1; \
- else \
- goto label; \
- } while (0)
-
-#define BR_STUB_VER_COND_GOTO(priv, cond, label) do { \
- if (!priv->do_versioning || cond) \
- goto label; \
- } while (0)
-
-#define BR_STUB_VER_ENABLED_IN_CALLPATH(frame, flag) do { \
- if (frame->local) \
- flag = _gf_true; \
- if (frame->local == (void *) 0x1) \
- frame->local = NULL; \
- } while (0)
-
-#define BR_STUB_RESET_LOCAL_NULL(frame) do { \
- if (frame->local == (void *)0x1) \
- frame->local = NULL; \
- } while (0)
-
-typedef int (br_stub_version_cbk) (call_frame_t *, void *,
- xlator_t *, int32_t, int32_t, dict_t *);
+#define BR_STUB_VER_NOT_ACTIVE_THEN_GOTO(frame, priv, label) \
+ do { \
+ if (priv->do_versioning) \
+ frame->local = (void *)0x1; \
+ else \
+ goto label; \
+ } while (0)
+
+#define BR_STUB_VER_COND_GOTO(priv, cond, label) \
+ do { \
+ if (!priv->do_versioning || cond) \
+ goto label; \
+ } while (0)
+
+#define BR_STUB_VER_ENABLED_IN_CALLPATH(frame, flag) \
+ do { \
+ if (frame->local) \
+ flag = _gf_true; \
+ if (frame->local == (void *)0x1) \
+ frame->local = NULL; \
+ } while (0)
+
+#define BR_STUB_RESET_LOCAL_NULL(frame) \
+ do { \
+ if (frame->local == (void *)0x1) \
+ frame->local = NULL; \
+ } while (0)
+
+typedef int(br_stub_version_cbk)(call_frame_t *, void *, xlator_t *, int32_t,
+ int32_t, dict_t *);
typedef struct br_stub_inode_ctx {
- int need_writeback; /* does the inode need
- a writeback to disk? */
- unsigned long currentversion; /* ongoing version */
-
- int info_sign;
- struct list_head fd_list; /* list of open fds or fds participating in
- write operations */
- gf_boolean_t bad_object;
+ int need_writeback; /* does the inode need
+ a writeback to disk? */
+ unsigned long currentversion; /* ongoing version */
+
+ int info_sign;
+ struct list_head fd_list; /* list of open fds or fds participating in
+ write operations */
+ gf_boolean_t bad_object;
} br_stub_inode_ctx_t;
typedef struct br_stub_fd {
- fd_t *fd;
- struct list_head list;
- struct bad_object_dir {
- DIR *dir;
- off_t dir_eof;
- } bad_object;
+ fd_t *fd;
+ struct list_head list;
+ struct bad_object_dir {
+ DIR *dir;
+ off_t dir_eof;
+ } bad_object;
} br_stub_fd_t;
-#define I_DIRTY (1<<0) /* inode needs writeback */
-#define I_MODIFIED (1<<1)
-#define WRITEBACK_DURABLE 1 /* writeback is durable */
+#define I_DIRTY (1 << 0) /* inode needs writeback */
+#define I_MODIFIED (1 << 1)
+#define WRITEBACK_DURABLE 1 /* writeback is durable */
/**
* This could just have been a plain struct without unions and all,
* but we may need additional things in the future.
*/
typedef struct br_stub_local {
- call_stub_t *fopstub; /* stub for original fop */
-
- int versioningtype; /* not much used atm */
-
- union {
- struct br_stub_ctx {
- fd_t *fd;
- uuid_t gfid;
- inode_t *inode;
- unsigned long version;
- } context;
- } u;
+ call_stub_t *fopstub; /* stub for original fop */
+
+ int versioningtype; /* not much used atm */
+
+ union {
+ struct br_stub_ctx {
+ fd_t *fd;
+ uuid_t gfid;
+ inode_t *inode;
+ unsigned long version;
+ } context;
+ } u;
} br_stub_local_t;
#define BR_STUB_NO_VERSIONING (1 << 0)
#define BR_STUB_INCREMENTAL_VERSIONING (1 << 1)
typedef struct br_stub_private {
- gf_boolean_t do_versioning;
+ gf_boolean_t do_versioning;
- uint32_t boot[2];
- char export[PATH_MAX];
+ uint32_t boot[2];
+ char export[PATH_MAX];
- pthread_mutex_t lock;
- pthread_cond_t cond;
+ pthread_mutex_t lock;
+ pthread_cond_t cond;
- struct list_head squeue; /* ordered signing queue */
- pthread_t signth;
- struct bad_objects_container {
- pthread_t thread;
- pthread_mutex_t bad_lock;
- pthread_cond_t bad_cond;
- struct list_head bad_queue;
- } container;
- struct mem_pool *local_pool;
+ struct list_head squeue; /* ordered signing queue */
+ pthread_t signth;
+ struct bad_objects_container {
+ pthread_t thread;
+ pthread_mutex_t bad_lock;
+ pthread_cond_t bad_cond;
+ struct list_head bad_queue;
+ } container;
+ struct mem_pool *local_pool;
- char stub_basepath[BR_PATH_MAX_EXTRA];
+ char stub_basepath[BR_PATH_MAX_EXTRA];
- uuid_t bad_object_dir_gfid;
+ uuid_t bad_object_dir_gfid;
} br_stub_private_t;
br_stub_fd_t *
-br_stub_fd_new (void);
-
+br_stub_fd_new(void);
int
-__br_stub_fd_ctx_set (xlator_t *this, fd_t *fd, br_stub_fd_t *br_stub_fd);
+__br_stub_fd_ctx_set(xlator_t *this, fd_t *fd, br_stub_fd_t *br_stub_fd);
br_stub_fd_t *
-__br_stub_fd_ctx_get (xlator_t *this, fd_t *fd);
+__br_stub_fd_ctx_get(xlator_t *this, fd_t *fd);
br_stub_fd_t *
-br_stub_fd_ctx_get (xlator_t *this, fd_t *fd);
+br_stub_fd_ctx_get(xlator_t *this, fd_t *fd);
int32_t
-br_stub_fd_ctx_set (xlator_t *this, fd_t *fd, br_stub_fd_t *br_stub_fd);
+br_stub_fd_ctx_set(xlator_t *this, fd_t *fd, br_stub_fd_t *br_stub_fd);
static inline gf_boolean_t
-__br_stub_is_bad_object (br_stub_inode_ctx_t *ctx)
+__br_stub_is_bad_object(br_stub_inode_ctx_t *ctx)
{
- return ctx->bad_object;
+ return ctx->bad_object;
}
static inline void
-__br_stub_mark_object_bad (br_stub_inode_ctx_t *ctx)
+__br_stub_mark_object_bad(br_stub_inode_ctx_t *ctx)
{
- ctx->bad_object = _gf_true;
+ ctx->bad_object = _gf_true;
}
/* inode writeback helpers */
static inline void
-__br_stub_mark_inode_dirty (br_stub_inode_ctx_t *ctx)
+__br_stub_mark_inode_dirty(br_stub_inode_ctx_t *ctx)
{
- ctx->need_writeback |= I_DIRTY;
+ ctx->need_writeback |= I_DIRTY;
}
static inline void
-__br_stub_mark_inode_synced (br_stub_inode_ctx_t *ctx)
+__br_stub_mark_inode_synced(br_stub_inode_ctx_t *ctx)
{
- ctx->need_writeback &= ~I_DIRTY;
+ ctx->need_writeback &= ~I_DIRTY;
}
static inline int
-__br_stub_is_inode_dirty (br_stub_inode_ctx_t *ctx)
+__br_stub_is_inode_dirty(br_stub_inode_ctx_t *ctx)
{
- return (ctx->need_writeback & I_DIRTY);
+ return (ctx->need_writeback & I_DIRTY);
}
/* inode mofification markers */
static inline void
-__br_stub_set_inode_modified (br_stub_inode_ctx_t *ctx)
+__br_stub_set_inode_modified(br_stub_inode_ctx_t *ctx)
{
- ctx->need_writeback |= I_MODIFIED;
+ ctx->need_writeback |= I_MODIFIED;
}
static inline void
-__br_stub_unset_inode_modified (br_stub_inode_ctx_t *ctx)
+__br_stub_unset_inode_modified(br_stub_inode_ctx_t *ctx)
{
- ctx->need_writeback &= ~I_MODIFIED;
+ ctx->need_writeback &= ~I_MODIFIED;
}
static inline int
-__br_stub_is_inode_modified (br_stub_inode_ctx_t *ctx)
+__br_stub_is_inode_modified(br_stub_inode_ctx_t *ctx)
{
- return (ctx->need_writeback & I_MODIFIED);
+ return (ctx->need_writeback & I_MODIFIED);
}
-
static inline int
-br_stub_require_release_call (xlator_t *this, fd_t *fd, br_stub_fd_t **fd_ctx)
+br_stub_require_release_call(xlator_t *this, fd_t *fd, br_stub_fd_t **fd_ctx)
{
- int32_t ret = 0;
- br_stub_fd_t *br_stub_fd = NULL;
+ int32_t ret = 0;
+ br_stub_fd_t *br_stub_fd = NULL;
- br_stub_fd = br_stub_fd_new ();
- if (!br_stub_fd)
- return -1;
+ br_stub_fd = br_stub_fd_new();
+ if (!br_stub_fd)
+ return -1;
- br_stub_fd->fd = fd;
- INIT_LIST_HEAD (&br_stub_fd->list);
+ br_stub_fd->fd = fd;
+ INIT_LIST_HEAD(&br_stub_fd->list);
- ret = br_stub_fd_ctx_set (this, fd, br_stub_fd);
- if (ret)
- gf_msg (this->name, GF_LOG_WARNING, 0,
- BRS_MSG_SET_CONTEXT_FAILED,
- "could not set fd context (for release callback");
- else
- *fd_ctx = br_stub_fd;
+ ret = br_stub_fd_ctx_set(this, fd, br_stub_fd);
+ if (ret)
+ gf_msg(this->name, GF_LOG_WARNING, 0, BRS_MSG_SET_CONTEXT_FAILED,
+ "could not set fd context (for release callback");
+ else
+ *fd_ctx = br_stub_fd;
- return ret;
+ return ret;
}
/* get/set inode context helpers */
static inline int
-__br_stub_get_inode_ctx (xlator_t *this,
- inode_t *inode, uint64_t *ctx)
+__br_stub_get_inode_ctx(xlator_t *this, inode_t *inode, uint64_t *ctx)
{
- return __inode_ctx_get (inode, this, ctx);
+ return __inode_ctx_get(inode, this, ctx);
}
static inline int
-br_stub_get_inode_ctx (xlator_t *this,
- inode_t *inode, uint64_t *ctx)
+br_stub_get_inode_ctx(xlator_t *this, inode_t *inode, uint64_t *ctx)
{
- int ret = -1;
+ int ret = -1;
- LOCK (&inode->lock);
- {
- ret = __br_stub_get_inode_ctx (this, inode, ctx);
- }
- UNLOCK (&inode->lock);
+ LOCK(&inode->lock);
+ {
+ ret = __br_stub_get_inode_ctx(this, inode, ctx);
+ }
+ UNLOCK(&inode->lock);
- return ret;
+ return ret;
}
static inline int
-br_stub_set_inode_ctx (xlator_t *this,
- inode_t *inode, br_stub_inode_ctx_t *ctx)
+br_stub_set_inode_ctx(xlator_t *this, inode_t *inode, br_stub_inode_ctx_t *ctx)
{
- uint64_t ctx_addr = (uint64_t) ctx;
- return inode_ctx_set (inode, this, &ctx_addr);
+ uint64_t ctx_addr = (uint64_t)ctx;
+ return inode_ctx_set(inode, this, &ctx_addr);
}
/* version get/set helpers */
static inline unsigned long
-__br_stub_writeback_version (br_stub_inode_ctx_t *ctx)
+__br_stub_writeback_version(br_stub_inode_ctx_t *ctx)
{
- return (ctx->currentversion + 1);
+ return (ctx->currentversion + 1);
}
static inline void
-__br_stub_set_ongoing_version (br_stub_inode_ctx_t *ctx, unsigned long version)
+__br_stub_set_ongoing_version(br_stub_inode_ctx_t *ctx, unsigned long version)
{
- if (ctx->currentversion < version)
- ctx->currentversion = version;
- else
- gf_msg ("bit-rot-stub", GF_LOG_WARNING, 0,
- BRS_MSG_CHANGE_VERSION_FAILED, "current version: %lu"
- "new version: %lu", ctx->currentversion, version);
+ if (ctx->currentversion < version)
+ ctx->currentversion = version;
+ else
+ gf_msg("bit-rot-stub", GF_LOG_WARNING, 0, BRS_MSG_CHANGE_VERSION_FAILED,
+ "current version: %lu"
+ "new version: %lu",
+ ctx->currentversion, version);
}
static inline int
-__br_stub_can_trigger_release (inode_t *inode,
- br_stub_inode_ctx_t *ctx, unsigned long *version)
+__br_stub_can_trigger_release(inode_t *inode, br_stub_inode_ctx_t *ctx,
+ unsigned long *version)
{
- /**
- * If the inode is modified, then it has to be dirty. An inode is
- * marked dirty once version is increased. Its marked as modified
- * when the modification call (write/truncate) which triggered
- * the versioning is successful.
- */
- if (__br_stub_is_inode_modified (ctx)
- && list_empty (&ctx->fd_list)
- && (ctx->info_sign != BR_SIGN_REOPEN_WAIT)) {
-
- GF_ASSERT (__br_stub_is_inode_dirty (ctx) == 0);
-
- if (version)
- *version = htonl (ctx->currentversion);
- return 1;
- }
-
- return 0;
+ /**
+ * If the inode is modified, then it has to be dirty. An inode is
+ * marked dirty once version is increased. Its marked as modified
+ * when the modification call (write/truncate) which triggered
+ * the versioning is successful.
+ */
+ if (__br_stub_is_inode_modified(ctx) && list_empty(&ctx->fd_list) &&
+ (ctx->info_sign != BR_SIGN_REOPEN_WAIT)) {
+ GF_ASSERT(__br_stub_is_inode_dirty(ctx) == 0);
+
+ if (version)
+ *version = htonl(ctx->currentversion);
+ return 1;
+ }
+
+ return 0;
}
static inline int32_t
-br_stub_get_ongoing_version (xlator_t *this,
- inode_t *inode, unsigned long *version)
+br_stub_get_ongoing_version(xlator_t *this, inode_t *inode,
+ unsigned long *version)
{
- int32_t ret = 0;
- uint64_t ctx_addr = 0;
- br_stub_inode_ctx_t *ctx = NULL;
-
- LOCK (&inode->lock);
- {
- ret = __inode_ctx_get (inode, this, &ctx_addr);
- if (ret < 0)
- goto unblock;
- ctx = (br_stub_inode_ctx_t *) (long) ctx_addr;
- *version = ctx->currentversion;
- }
- unblock:
- UNLOCK (&inode->lock);
-
- return ret;
+ int32_t ret = 0;
+ uint64_t ctx_addr = 0;
+ br_stub_inode_ctx_t *ctx = NULL;
+
+ LOCK(&inode->lock);
+ {
+ ret = __inode_ctx_get(inode, this, &ctx_addr);
+ if (ret < 0)
+ goto unblock;
+ ctx = (br_stub_inode_ctx_t *)(long)ctx_addr;
+ *version = ctx->currentversion;
+ }
+unblock:
+ UNLOCK(&inode->lock);
+
+ return ret;
}
/**
@@ -332,45 +329,44 @@ br_stub_get_ongoing_version (xlator_t *this,
* *needs* to be valid in the caller.
*/
static inline br_stub_inode_ctx_t *
-__br_stub_get_ongoing_version_ctx (xlator_t *this,
- inode_t *inode, unsigned long *version)
+__br_stub_get_ongoing_version_ctx(xlator_t *this, inode_t *inode,
+ unsigned long *version)
{
- int32_t ret = 0;
- uint64_t ctx_addr = 0;
- br_stub_inode_ctx_t *ctx = NULL;
-
- ret = __inode_ctx_get (inode, this, &ctx_addr);
- if (ret < 0)
- return NULL;
- ctx = (br_stub_inode_ctx_t *) (long) ctx_addr;
- if (version)
- *version = ctx->currentversion;
-
- return ctx;
+ int32_t ret = 0;
+ uint64_t ctx_addr = 0;
+ br_stub_inode_ctx_t *ctx = NULL;
+
+ ret = __inode_ctx_get(inode, this, &ctx_addr);
+ if (ret < 0)
+ return NULL;
+ ctx = (br_stub_inode_ctx_t *)(long)ctx_addr;
+ if (version)
+ *version = ctx->currentversion;
+
+ return ctx;
}
/* filter for xattr fetch */
static inline int
-br_stub_is_internal_xattr (const char *name)
+br_stub_is_internal_xattr(const char *name)
{
- if (name
- && ((strncmp (name, BITROT_CURRENT_VERSION_KEY,
- SLEN (BITROT_CURRENT_VERSION_KEY)) == 0)
- || (strncmp (name, BITROT_SIGNING_VERSION_KEY,
- SLEN (BITROT_SIGNING_VERSION_KEY)) == 0)))
- return 1;
- return 0;
+ if (name && ((strncmp(name, BITROT_CURRENT_VERSION_KEY,
+ SLEN(BITROT_CURRENT_VERSION_KEY)) == 0) ||
+ (strncmp(name, BITROT_SIGNING_VERSION_KEY,
+ SLEN(BITROT_SIGNING_VERSION_KEY)) == 0)))
+ return 1;
+ return 0;
}
static inline void
-br_stub_remove_vxattrs (dict_t *xattr)
+br_stub_remove_vxattrs(dict_t *xattr)
{
- if (xattr) {
- dict_del (xattr, BITROT_OBJECT_BAD_KEY);
- dict_del (xattr, BITROT_CURRENT_VERSION_KEY);
- dict_del (xattr, BITROT_SIGNING_VERSION_KEY);
- dict_del (xattr, BITROT_SIGNING_XATTR_SIZE_KEY);
- }
+ if (xattr) {
+ dict_del(xattr, BITROT_OBJECT_BAD_KEY);
+ dict_del(xattr, BITROT_CURRENT_VERSION_KEY);
+ dict_del(xattr, BITROT_SIGNING_VERSION_KEY);
+ dict_del(xattr, BITROT_SIGNING_XATTR_SIZE_KEY);
+ }
}
/**
@@ -384,64 +380,63 @@ br_stub_remove_vxattrs (dict_t *xattr)
* errors can be made into enums.
*/
static inline int
-br_stub_is_bad_object (xlator_t *this, inode_t *inode)
+br_stub_is_bad_object(xlator_t *this, inode_t *inode)
{
- int bad_object = 0;
- gf_boolean_t tmp = _gf_false;
- uint64_t ctx_addr = 0;
- br_stub_inode_ctx_t *ctx = NULL;
- int32_t ret = -1;
-
- ret = br_stub_get_inode_ctx (this, inode, &ctx_addr);
- if (ret) {
- gf_msg (this->name, GF_LOG_ERROR, 0,
- BRS_MSG_GET_INODE_CONTEXT_FAILED,
- "failed to get the inode context for the inode %s",
- uuid_utoa (inode->gfid));
- bad_object = -1;
- goto out;
- }
-
- ctx = (br_stub_inode_ctx_t *)(long)ctx_addr;
-
- LOCK (&inode->lock);
- {
- tmp = __br_stub_is_bad_object (ctx);
- if (tmp)
- bad_object = -2;
- }
- UNLOCK (&inode->lock);
+ int bad_object = 0;
+ gf_boolean_t tmp = _gf_false;
+ uint64_t ctx_addr = 0;
+ br_stub_inode_ctx_t *ctx = NULL;
+ int32_t ret = -1;
+
+ ret = br_stub_get_inode_ctx(this, inode, &ctx_addr);
+ if (ret) {
+ gf_msg(this->name, GF_LOG_ERROR, 0, BRS_MSG_GET_INODE_CONTEXT_FAILED,
+ "failed to get the inode context for the inode %s",
+ uuid_utoa(inode->gfid));
+ bad_object = -1;
+ goto out;
+ }
+
+ ctx = (br_stub_inode_ctx_t *)(long)ctx_addr;
+
+ LOCK(&inode->lock);
+ {
+ tmp = __br_stub_is_bad_object(ctx);
+ if (tmp)
+ bad_object = -2;
+ }
+ UNLOCK(&inode->lock);
out:
- return bad_object;
+ return bad_object;
}
static inline int32_t
-br_stub_mark_object_bad (xlator_t *this, inode_t *inode)
+br_stub_mark_object_bad(xlator_t *this, inode_t *inode)
{
- int32_t ret = -1;
- uint64_t ctx_addr = 0;
- br_stub_inode_ctx_t *ctx = NULL;
-
- ret = br_stub_get_inode_ctx (this, inode, &ctx_addr);
- if (ret) {
- gf_msg (this->name, GF_LOG_ERROR, 0,
- BRS_MSG_GET_INODE_CONTEXT_FAILED, "failed to get the "
- "inode context for the inode %s",
- uuid_utoa (inode->gfid));
- goto out;
- }
-
- ctx = (br_stub_inode_ctx_t *)(long)ctx_addr;
-
- LOCK (&inode->lock);
- {
- __br_stub_mark_object_bad (ctx);
- }
- UNLOCK (&inode->lock);
+ int32_t ret = -1;
+ uint64_t ctx_addr = 0;
+ br_stub_inode_ctx_t *ctx = NULL;
+
+ ret = br_stub_get_inode_ctx(this, inode, &ctx_addr);
+ if (ret) {
+ gf_msg(this->name, GF_LOG_ERROR, 0, BRS_MSG_GET_INODE_CONTEXT_FAILED,
+ "failed to get the "
+ "inode context for the inode %s",
+ uuid_utoa(inode->gfid));
+ goto out;
+ }
+
+ ctx = (br_stub_inode_ctx_t *)(long)ctx_addr;
+
+ LOCK(&inode->lock);
+ {
+ __br_stub_mark_object_bad(ctx);
+ }
+ UNLOCK(&inode->lock);
out:
- return ret;
+ return ret;
}
/**
@@ -449,68 +444,68 @@ out:
* given to the caller and the caller has to decide what to do.
*/
static inline int32_t
-br_stub_mark_xdata_bad_object (xlator_t *this, inode_t *inode, dict_t *xdata)
+br_stub_mark_xdata_bad_object(xlator_t *this, inode_t *inode, dict_t *xdata)
{
- int32_t ret = 0;
+ int32_t ret = 0;
- if (br_stub_is_bad_object (this, inode) == -2)
- ret = dict_set_int32 (xdata, GLUSTERFS_BAD_INODE, 1);
+ if (br_stub_is_bad_object(this, inode) == -2)
+ ret = dict_set_int32(xdata, GLUSTERFS_BAD_INODE, 1);
- return ret;
+ return ret;
}
int32_t
-br_stub_add_fd_to_inode (xlator_t *this, fd_t *fd, br_stub_inode_ctx_t *ctx);
+br_stub_add_fd_to_inode(xlator_t *this, fd_t *fd, br_stub_inode_ctx_t *ctx);
br_sign_state_t
-__br_stub_inode_sign_state (br_stub_inode_ctx_t *ctx, glusterfs_fop_t fop,
- fd_t *fd);
+__br_stub_inode_sign_state(br_stub_inode_ctx_t *ctx, glusterfs_fop_t fop,
+ fd_t *fd);
int
-br_stub_dir_create (xlator_t *this, br_stub_private_t *priv);
+br_stub_dir_create(xlator_t *this, br_stub_private_t *priv);
int
-br_stub_add (xlator_t *this, uuid_t gfid);
+br_stub_add(xlator_t *this, uuid_t gfid);
int32_t
-br_stub_create_stub_gfid (xlator_t *this, char *stub_gfid_path, uuid_t gfid);
+br_stub_create_stub_gfid(xlator_t *this, char *stub_gfid_path, uuid_t gfid);
int
-br_stub_dir_create (xlator_t *this, br_stub_private_t *priv);
+br_stub_dir_create(xlator_t *this, br_stub_private_t *priv);
call_stub_t *
-__br_stub_dequeue (struct list_head *callstubs);
+__br_stub_dequeue(struct list_head *callstubs);
void
-__br_stub_enqueue (struct list_head *callstubs, call_stub_t *stub);
+__br_stub_enqueue(struct list_head *callstubs, call_stub_t *stub);
void
-br_stub_worker_enqueue (xlator_t *this, call_stub_t *stub);
+br_stub_worker_enqueue(xlator_t *this, call_stub_t *stub);
void *
-br_stub_worker (void *data);
+br_stub_worker(void *data);
int32_t
-br_stub_lookup_wrapper (call_frame_t *frame, xlator_t *this,
- loc_t *loc, dict_t *xattr_req);
+br_stub_lookup_wrapper(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ dict_t *xattr_req);
int32_t
-br_stub_readdir_wrapper (call_frame_t *frame, xlator_t *this,
- fd_t *fd, size_t size, off_t off, dict_t *xdata);
+br_stub_readdir_wrapper(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ size_t size, off_t off, dict_t *xdata);
int
-br_stub_del (xlator_t *this, uuid_t gfid);
+br_stub_del(xlator_t *this, uuid_t gfid);
int
-br_stub_bad_objects_path (xlator_t *this, fd_t *fd, gf_dirent_t *entries,
- dict_t **dict);
+br_stub_bad_objects_path(xlator_t *this, fd_t *fd, gf_dirent_t *entries,
+ dict_t **dict);
void
-br_stub_entry_xattr_fill (xlator_t *this, char *hpath, gf_dirent_t *entry,
- dict_t *dict);
+br_stub_entry_xattr_fill(xlator_t *this, char *hpath, gf_dirent_t *entry,
+ dict_t *dict);
int
-br_stub_get_path_of_gfid (xlator_t *this, inode_t *parent, inode_t *inode,
- uuid_t gfid, char **path);
+br_stub_get_path_of_gfid(xlator_t *this, inode_t *parent, inode_t *inode,
+ uuid_t gfid, char **path);
#endif /* __BIT_ROT_STUB_H__ */
diff --git a/xlators/features/changelog/lib/src/changelog-lib-messages.h b/xlators/features/changelog/lib/src/changelog-lib-messages.h
index 2061217b801..32b3497d89d 100644
--- a/xlators/features/changelog/lib/src/changelog-lib-messages.h
+++ b/xlators/features/changelog/lib/src/changelog-lib-messages.h
@@ -23,39 +23,26 @@
* glfs-message-id.h.
*/
-GLFS_MSGID(CHANGELOG_LIB,
- CHANGELOG_LIB_MSG_OPEN_FAILED,
- CHANGELOG_LIB_MSG_FAILED_TO_RMDIR,
- CHANGELOG_LIB_MSG_SCRATCH_DIR_ENTRIES_CREATION_ERROR,
- CHANGELOG_LIB_MSG_THREAD_CREATION_FAILED,
- CHANGELOG_LIB_MSG_OPENDIR_ERROR,
- CHANGELOG_LIB_MSG_RENAME_FAILED,
- CHANGELOG_LIB_MSG_READ_ERROR,
- CHANGELOG_LIB_MSG_HTIME_ERROR,
- CHANGELOG_LIB_MSG_GET_TIME_ERROR,
- CHANGELOG_LIB_MSG_WRITE_FAILED,
- CHANGELOG_LIB_MSG_PTHREAD_ERROR,
- CHANGELOG_LIB_MSG_MMAP_FAILED,
- CHANGELOG_LIB_MSG_MUNMAP_FAILED,
- CHANGELOG_LIB_MSG_ASCII_ERROR,
- CHANGELOG_LIB_MSG_STAT_FAILED,
- CHANGELOG_LIB_MSG_GET_XATTR_FAILED,
- CHANGELOG_LIB_MSG_PUBLISH_ERROR,
- CHANGELOG_LIB_MSG_PARSE_ERROR,
- CHANGELOG_LIB_MSG_TOTAL_LOG_INFO,
- CHANGELOG_LIB_MSG_CLEANUP_ERROR,
- CHANGELOG_LIB_MSG_UNLINK_FAILED,
- CHANGELOG_LIB_MSG_NOTIFY_REGISTER_FAILED,
- CHANGELOG_LIB_MSG_INVOKE_RPC_FAILED,
- CHANGELOG_LIB_MSG_DRAINING_EVENT_INFO,
- CHANGELOG_LIB_MSG_CLEANING_BRICK_ENTRY_INFO,
- CHANGELOG_LIB_MSG_FREEING_ENTRY_INFO,
- CHANGELOG_LIB_MSG_XDR_DECODING_FAILED,
- CHANGELOG_LIB_MSG_NOTIFY_REGISTER_INFO,
- CHANGELOG_LIB_MSG_THREAD_CLEANUP_WARNING,
- CHANGELOG_LIB_MSG_COPY_FROM_BUFFER_FAILED,
- CHANGELOG_LIB_MSG_PTHREAD_JOIN_FAILED,
- CHANGELOG_LIB_MSG_HIST_FAILED
-);
+GLFS_MSGID(
+ CHANGELOG_LIB, CHANGELOG_LIB_MSG_OPEN_FAILED,
+ CHANGELOG_LIB_MSG_FAILED_TO_RMDIR,
+ CHANGELOG_LIB_MSG_SCRATCH_DIR_ENTRIES_CREATION_ERROR,
+ CHANGELOG_LIB_MSG_THREAD_CREATION_FAILED, CHANGELOG_LIB_MSG_OPENDIR_ERROR,
+ CHANGELOG_LIB_MSG_RENAME_FAILED, CHANGELOG_LIB_MSG_READ_ERROR,
+ CHANGELOG_LIB_MSG_HTIME_ERROR, CHANGELOG_LIB_MSG_GET_TIME_ERROR,
+ CHANGELOG_LIB_MSG_WRITE_FAILED, CHANGELOG_LIB_MSG_PTHREAD_ERROR,
+ CHANGELOG_LIB_MSG_MMAP_FAILED, CHANGELOG_LIB_MSG_MUNMAP_FAILED,
+ CHANGELOG_LIB_MSG_ASCII_ERROR, CHANGELOG_LIB_MSG_STAT_FAILED,
+ CHANGELOG_LIB_MSG_GET_XATTR_FAILED, CHANGELOG_LIB_MSG_PUBLISH_ERROR,
+ CHANGELOG_LIB_MSG_PARSE_ERROR, CHANGELOG_LIB_MSG_TOTAL_LOG_INFO,
+ CHANGELOG_LIB_MSG_CLEANUP_ERROR, CHANGELOG_LIB_MSG_UNLINK_FAILED,
+ CHANGELOG_LIB_MSG_NOTIFY_REGISTER_FAILED,
+ CHANGELOG_LIB_MSG_INVOKE_RPC_FAILED, CHANGELOG_LIB_MSG_DRAINING_EVENT_INFO,
+ CHANGELOG_LIB_MSG_CLEANING_BRICK_ENTRY_INFO,
+ CHANGELOG_LIB_MSG_FREEING_ENTRY_INFO, CHANGELOG_LIB_MSG_XDR_DECODING_FAILED,
+ CHANGELOG_LIB_MSG_NOTIFY_REGISTER_INFO,
+ CHANGELOG_LIB_MSG_THREAD_CLEANUP_WARNING,
+ CHANGELOG_LIB_MSG_COPY_FROM_BUFFER_FAILED,
+ CHANGELOG_LIB_MSG_PTHREAD_JOIN_FAILED, CHANGELOG_LIB_MSG_HIST_FAILED);
#endif /* !_CHANGELOG_MESSAGES_H_ */
diff --git a/xlators/features/changelog/lib/src/gf-changelog-helpers.h b/xlators/features/changelog/lib/src/gf-changelog-helpers.h
index b05628ee70d..cfb26a0081e 100644
--- a/xlators/features/changelog/lib/src/gf-changelog-helpers.h
+++ b/xlators/features/changelog/lib/src/gf-changelog-helpers.h
@@ -23,27 +23,28 @@
#include "changelog-rpc-common.h"
#include "gf-changelog-journal.h"
-#define GF_CHANGELOG_TRACKER "tracker"
+#define GF_CHANGELOG_TRACKER "tracker"
-#define GF_CHANGELOG_CURRENT_DIR ".current"
-#define GF_CHANGELOG_PROCESSED_DIR ".processed"
+#define GF_CHANGELOG_CURRENT_DIR ".current"
+#define GF_CHANGELOG_PROCESSED_DIR ".processed"
#define GF_CHANGELOG_PROCESSING_DIR ".processing"
-#define GF_CHANGELOG_HISTORY_DIR ".history"
+#define GF_CHANGELOG_HISTORY_DIR ".history"
#define TIMESTAMP_LENGTH 10
#ifndef MAXLINE
#define MAXLINE 4096
#endif
-#define GF_CHANGELOG_FILL_BUFFER(ptr, ascii, off, len) do { \
- memcpy (ascii + off, ptr, len); \
- off += len; \
- } while (0)
+#define GF_CHANGELOG_FILL_BUFFER(ptr, ascii, off, len) \
+ do { \
+ memcpy(ascii + off, ptr, len); \
+ off += len; \
+ } while (0)
typedef struct read_line {
- int rl_cnt;
- char *rl_bufptr;
- char rl_buf[MAXLINE];
+ int rl_cnt;
+ char *rl_bufptr;
+ char rl_buf[MAXLINE];
} read_line_t;
struct gf_changelog;
@@ -55,51 +56,50 @@ struct gf_event;
* ->next_seq holds the next _expected_ sequence number.
*/
struct gf_event_list {
- pthread_mutex_t lock; /* protects this structure */
- pthread_cond_t cond;
+ pthread_mutex_t lock; /* protects this structure */
+ pthread_cond_t cond;
- pthread_t invoker;
+ pthread_t invoker;
- unsigned long next_seq; /* next sequence number expected:
- zero during bootstrap */
+ unsigned long next_seq; /* next sequence number expected:
+ zero during bootstrap */
- struct gf_changelog *entry; /* backpointer to it's brick
- encapsulator (entry) */
- struct list_head events; /* list of events */
+ struct gf_changelog *entry; /* backpointer to it's brick
+ encapsulator (entry) */
+ struct list_head events; /* list of events */
};
/**
* include a refcount if it's of use by additional layers
*/
struct gf_event {
- int count;
+ int count;
- unsigned long seq;
+ unsigned long seq;
- struct list_head list;
+ struct list_head list;
- struct iovec iov[0];
+ struct iovec iov[0];
};
-#define GF_EVENT_CALLOC_SIZE(cnt, len) \
- (sizeof (struct gf_event) + (cnt * sizeof (struct iovec)) + len)
+#define GF_EVENT_CALLOC_SIZE(cnt, len) \
+ (sizeof(struct gf_event) + (cnt * sizeof(struct iovec)) + len)
/**
* assign the base address of the IO vector to the correct memory
o * area and set it's addressable length.
*/
-#define GF_EVENT_ASSIGN_IOVEC(vec, event, len, pos) \
- do { \
- vec->iov_base = ((char *)event) + \
- sizeof (struct gf_event) + \
- (event->count * sizeof (struct iovec)) + pos; \
- vec->iov_len = len; \
- pos += len; \
- } while (0)
+#define GF_EVENT_ASSIGN_IOVEC(vec, event, len, pos) \
+ do { \
+ vec->iov_base = ((char *)event) + sizeof(struct gf_event) + \
+ (event->count * sizeof(struct iovec)) + pos; \
+ vec->iov_len = len; \
+ pos += len; \
+ } while (0)
typedef enum gf_changelog_conn_state {
- GF_CHANGELOG_CONN_STATE_PENDING = 0,
- GF_CHANGELOG_CONN_STATE_ACCEPTED,
- GF_CHANGELOG_CONN_STATE_DISCONNECTED,
+ GF_CHANGELOG_CONN_STATE_PENDING = 0,
+ GF_CHANGELOG_CONN_STATE_ACCEPTED,
+ GF_CHANGELOG_CONN_STATE_DISCONNECTED,
} gf_changelog_conn_state_t;
/**
@@ -107,153 +107,152 @@ typedef enum gf_changelog_conn_state {
* notifications are streamed.
*/
typedef struct gf_changelog {
- gf_lock_t statelock;
- gf_changelog_conn_state_t connstate;
+ gf_lock_t statelock;
+ gf_changelog_conn_state_t connstate;
- xlator_t *this;
+ xlator_t *this;
- struct list_head list; /* list of instances */
+ struct list_head list; /* list of instances */
- char brick[PATH_MAX]; /* brick path for this end-point */
+ char brick[PATH_MAX]; /* brick path for this end-point */
- changelog_rpc_t grpc; /* rpc{-clnt,svc} for this brick */
-#define RPC_PROBER(ent) ent->grpc.rpc
-#define RPC_REBORP(ent) ent->grpc.svc
-#define RPC_SOCK(ent) ent->grpc.sock
+ changelog_rpc_t grpc; /* rpc{-clnt,svc} for this brick */
+#define RPC_PROBER(ent) ent->grpc.rpc
+#define RPC_REBORP(ent) ent->grpc.svc
+#define RPC_SOCK(ent) ent->grpc.sock
- unsigned int notify; /* notification flag(s) */
+ unsigned int notify; /* notification flag(s) */
- FINI *fini; /* destructor callback */
- CALLBACK *callback; /* event callback dispatcher */
- CONNECT *connected; /* connect callback */
- DISCONNECT *disconnected; /* disconnection callback */
+ FINI *fini; /* destructor callback */
+ CALLBACK *callback; /* event callback dispatcher */
+ CONNECT *connected; /* connect callback */
+ DISCONNECT *disconnected; /* disconnection callback */
- void *ptr; /* owner specific private data */
- xlator_t *invokerxl; /* consumers _this_, if valid,
- assigned to THIS before cbk is
- invoked */
+ void *ptr; /* owner specific private data */
+ xlator_t *invokerxl; /* consumers _this_, if valid,
+ assigned to THIS before cbk is
+ invoked */
- gf_boolean_t ordered;
+ gf_boolean_t ordered;
- void (*queueevent) (struct gf_event_list *, struct gf_event *);
- void (*pickevent) (struct gf_event_list *, struct gf_event **);
+ void (*queueevent)(struct gf_event_list *, struct gf_event *);
+ void (*pickevent)(struct gf_event_list *, struct gf_event **);
- struct gf_event_list event;
+ struct gf_event_list event;
} gf_changelog_t;
static inline int
-gf_changelog_filter_check (gf_changelog_t *entry, changelog_event_t *event)
+gf_changelog_filter_check(gf_changelog_t *entry, changelog_event_t *event)
{
- if (event->ev_type & entry->notify)
- return 1;
- return 0;
+ if (event->ev_type & entry->notify)
+ return 1;
+ return 0;
}
-#define GF_NEED_ORDERED_EVENTS(ent) (ent->ordered == _gf_true)
+#define GF_NEED_ORDERED_EVENTS(ent) (ent->ordered == _gf_true)
/** private structure */
typedef struct gf_private {
- pthread_mutex_t lock; /* protects ->connections, cleanups */
- pthread_cond_t cond;
+ pthread_mutex_t lock; /* protects ->connections, cleanups */
+ pthread_cond_t cond;
- void *api; /* pointer for API access */
+ void *api; /* pointer for API access */
- pthread_t poller; /* event poller thread */
- pthread_t connectionjanitor; /* connection cleaner */
+ pthread_t poller; /* event poller thread */
+ pthread_t connectionjanitor; /* connection cleaner */
- struct list_head connections; /* list of connections */
- struct list_head cleanups; /* list of connection to be
- cleaned up */
+ struct list_head connections; /* list of connections */
+ struct list_head cleanups; /* list of connection to be
+ cleaned up */
} gf_private_t;
-#define GF_CHANGELOG_GET_API_PTR(this) (((gf_private_t *) this->private)->api)
+#define GF_CHANGELOG_GET_API_PTR(this) (((gf_private_t *)this->private)->api)
/**
* upcall: invoke callback with _correct_ THIS
*/
-#define GF_CHANGELOG_INVOKE_CBK(this, cbk, brick, args ...) \
- do { \
- xlator_t *old_this = NULL; \
- xlator_t *invokerxl = NULL; \
- \
- invokerxl = entry->invokerxl; \
- old_this = this; \
- \
- if (invokerxl) { \
- THIS = invokerxl; \
- } \
- \
- cbk (invokerxl, brick, args); \
- THIS = old_this; \
- \
- } while (0)
-
-#define SAVE_THIS(xl) \
- do { \
- old_this = xl; \
- THIS = master; \
- } while (0)
-
-#define RESTORE_THIS() \
- do { \
- if (old_this) \
- THIS = old_this; \
- } while (0)
+#define GF_CHANGELOG_INVOKE_CBK(this, cbk, brick, args...) \
+ do { \
+ xlator_t *old_this = NULL; \
+ xlator_t *invokerxl = NULL; \
+ \
+ invokerxl = entry->invokerxl; \
+ old_this = this; \
+ \
+ if (invokerxl) { \
+ THIS = invokerxl; \
+ } \
+ \
+ cbk(invokerxl, brick, args); \
+ THIS = old_this; \
+ \
+ } while (0)
+
+#define SAVE_THIS(xl) \
+ do { \
+ old_this = xl; \
+ THIS = master; \
+ } while (0)
+
+#define RESTORE_THIS() \
+ do { \
+ if (old_this) \
+ THIS = old_this; \
+ } while (0)
/** APIs and the rest */
void *
-gf_changelog_process (void *data);
+gf_changelog_process(void *data);
ssize_t
-gf_changelog_read_path (int fd, char *buffer, size_t bufsize);
+gf_changelog_read_path(int fd, char *buffer, size_t bufsize);
void
-gf_rfc3986_encode_space_newline (unsigned char *s, char *enc, char *estr);
+gf_rfc3986_encode_space_newline(unsigned char *s, char *enc, char *estr);
size_t
-gf_changelog_write (int fd, char *buffer, size_t len);
+gf_changelog_write(int fd, char *buffer, size_t len);
ssize_t
-gf_readline (int fd, void *vptr, size_t maxlen);
+gf_readline(int fd, void *vptr, size_t maxlen);
int
-gf_ftruncate (int fd, off_t length);
+gf_ftruncate(int fd, off_t length);
off_t
-gf_lseek (int fd, off_t offset, int whence);
+gf_lseek(int fd, off_t offset, int whence);
int
-gf_changelog_consume (xlator_t *this,
- gf_changelog_journal_t *jnl,
- char *from_path, gf_boolean_t no_publish);
+gf_changelog_consume(xlator_t *this, gf_changelog_journal_t *jnl,
+ char *from_path, gf_boolean_t no_publish);
int
-gf_changelog_publish (xlator_t *this,
- gf_changelog_journal_t *jnl, char *from_path);
+gf_changelog_publish(xlator_t *this, gf_changelog_journal_t *jnl,
+ char *from_path);
int
-gf_thread_cleanup (xlator_t *this, pthread_t thread);
+gf_thread_cleanup(xlator_t *this, pthread_t thread);
void *
-gf_changelog_callback_invoker (void *arg);
+gf_changelog_callback_invoker(void *arg);
int
-gf_cleanup_event (xlator_t *, struct gf_event_list *);
+gf_cleanup_event(xlator_t *, struct gf_event_list *);
/* (un)ordered event queueing */
void
-queue_ordered_event (struct gf_event_list *, struct gf_event *);
+queue_ordered_event(struct gf_event_list *, struct gf_event *);
void
-queue_unordered_event (struct gf_event_list *, struct gf_event *);
+queue_unordered_event(struct gf_event_list *, struct gf_event *);
/* (un)ordered event picking */
void
-pick_event_ordered (struct gf_event_list *, struct gf_event **);
+pick_event_ordered(struct gf_event_list *, struct gf_event **);
void
-pick_event_unordered (struct gf_event_list *, struct gf_event **);
+pick_event_unordered(struct gf_event_list *, struct gf_event **);
/* connection janitor thread */
void *
-gf_changelog_connection_janitor (void *);
+gf_changelog_connection_janitor(void *);
#endif
diff --git a/xlators/features/changelog/lib/src/gf-changelog-journal.h b/xlators/features/changelog/lib/src/gf-changelog-journal.h
index 46d50f159d9..ba5b9bf827e 100644
--- a/xlators/features/changelog/lib/src/gf-changelog-journal.h
+++ b/xlators/features/changelog/lib/src/gf-changelog-journal.h
@@ -17,91 +17,91 @@
#include "changelog.h"
enum api_conn {
- JNL_API_CONNECTED,
- JNL_API_CONN_INPROGESS,
- JNL_API_DISCONNECTED,
+ JNL_API_CONNECTED,
+ JNL_API_CONN_INPROGESS,
+ JNL_API_DISCONNECTED,
};
typedef struct gf_changelog_entry {
- char path[PATH_MAX];
+ char path[PATH_MAX];
- struct list_head list;
+ struct list_head list;
} gf_changelog_entry_t;
typedef struct gf_changelog_processor {
- pthread_mutex_t lock; /* protects ->entries */
- pthread_cond_t cond; /* waiter during empty list */
- gf_boolean_t waiting;
+ pthread_mutex_t lock; /* protects ->entries */
+ pthread_cond_t cond; /* waiter during empty list */
+ gf_boolean_t waiting;
- pthread_t processor; /* thread-id of journal processing thread */
+ pthread_t processor; /* thread-id of journal processing thread */
- struct list_head entries;
+ struct list_head entries;
} gf_changelog_processor_t;
typedef struct gf_changelog_journal {
- DIR *jnl_dir; /* 'processing' directory stream */
+ DIR *jnl_dir; /* 'processing' directory stream */
- int jnl_fd; /* fd to the tracker file */
+ int jnl_fd; /* fd to the tracker file */
- char jnl_brickpath[PATH_MAX]; /* brick path for this end-point */
+ char jnl_brickpath[PATH_MAX]; /* brick path for this end-point */
- gf_changelog_processor_t *jnl_proc;
+ gf_changelog_processor_t *jnl_proc;
- char *jnl_working_dir; /* scratch directory */
+ char *jnl_working_dir; /* scratch directory */
- char jnl_current_dir[PATH_MAX];
- char jnl_processed_dir[PATH_MAX];
- char jnl_processing_dir[PATH_MAX];
+ char jnl_current_dir[PATH_MAX];
+ char jnl_processed_dir[PATH_MAX];
+ char jnl_processing_dir[PATH_MAX];
- char rfc3986_space_newline[256]; /* RFC 3986 string encoding */
+ char rfc3986_space_newline[256]; /* RFC 3986 string encoding */
- struct gf_changelog_journal *hist_jnl;
- int hist_done; /* holds 0 done scanning,
- 1 keep scanning and -1 error */
+ struct gf_changelog_journal *hist_jnl;
+ int hist_done; /* holds 0 done scanning,
+ 1 keep scanning and -1 error */
- pthread_spinlock_t lock;
- int connected;
- xlator_t *this;
+ pthread_spinlock_t lock;
+ int connected;
+ xlator_t *this;
} gf_changelog_journal_t;
-#define JNL_SET_API_STATE(jnl, state) (jnl->connected = state)
-#define JNL_IS_API_DISCONNECTED(jnl) (jnl->connected == JNL_API_DISCONNECTED)
+#define JNL_SET_API_STATE(jnl, state) (jnl->connected = state)
+#define JNL_IS_API_DISCONNECTED(jnl) (jnl->connected == JNL_API_DISCONNECTED)
/* History API */
typedef struct gf_changelog_history_data {
- int len;
+ int len;
- int htime_fd;
+ int htime_fd;
- /* parallelism count */
- int n_parallel;
+ /* parallelism count */
+ int n_parallel;
- /* history from, to indexes */
- unsigned long from;
- unsigned long to;
- xlator_t *this;
+ /* history from, to indexes */
+ unsigned long from;
+ unsigned long to;
+ xlator_t *this;
} gf_changelog_history_data_t;
typedef struct gf_changelog_consume_data {
- /** set of inputs */
+ /** set of inputs */
- /* fd to read from */
- int fd;
+ /* fd to read from */
+ int fd;
- /* from @offset */
- off_t offset;
+ /* from @offset */
+ off_t offset;
- xlator_t *this;
+ xlator_t *this;
- gf_changelog_journal_t *jnl;
+ gf_changelog_journal_t *jnl;
- /** set of outputs */
+ /** set of outputs */
- /* return value */
- int retval;
+ /* return value */
+ int retval;
- /* journal processed */
- char changelog[PATH_MAX];
+ /* journal processed */
+ char changelog[PATH_MAX];
} gf_changelog_consume_data_t;
/* event handler */
diff --git a/xlators/features/changelog/lib/src/gf-changelog-rpc.h b/xlators/features/changelog/lib/src/gf-changelog-rpc.h
index 1c982eef809..975307b99d3 100644
--- a/xlators/features/changelog/lib/src/gf-changelog-rpc.h
+++ b/xlators/features/changelog/lib/src/gf-changelog-rpc.h
@@ -16,11 +16,13 @@
#include "gf-changelog-helpers.h"
#include "changelog-rpc-common.h"
-struct rpc_clnt *gf_changelog_rpc_init (xlator_t *, gf_changelog_t *);
+struct rpc_clnt *
+gf_changelog_rpc_init(xlator_t *, gf_changelog_t *);
-int gf_changelog_invoke_rpc (xlator_t *, gf_changelog_t *, int);
+int
+gf_changelog_invoke_rpc(xlator_t *, gf_changelog_t *, int);
rpcsvc_t *
-gf_changelog_reborp_init_rpc_listner (xlator_t *, char *, char *, void *);
+gf_changelog_reborp_init_rpc_listner(xlator_t *, char *, char *, void *);
#endif
diff --git a/xlators/features/changelog/src/changelog-encoders.h b/xlators/features/changelog/src/changelog-encoders.h
index d6a50cc9ef7..ca42c4c4fe0 100644
--- a/xlators/features/changelog/src/changelog-encoders.h
+++ b/xlators/features/changelog/src/changelog-encoders.h
@@ -16,36 +16,34 @@
#include "changelog-helpers.h"
-#define CHANGELOG_STORE_ASCII(priv, buf, off, gfid, gfid_len, cld) do { \
- CHANGELOG_FILL_BUFFER (buffer, off, \
- priv->maps[cld->cld_type], 1); \
- CHANGELOG_FILL_BUFFER (buffer, \
- off, gfid, gfid_len); \
- } while (0)
-
-#define CHANGELOG_STORE_BINARY(priv, buf, off, gfid, cld) do { \
- CHANGELOG_FILL_BUFFER (buffer, off, \
- priv->maps[cld->cld_type], 1); \
- CHANGELOG_FILL_BUFFER (buffer, \
- off, gfid, sizeof (uuid_t)); \
- } while (0)
+#define CHANGELOG_STORE_ASCII(priv, buf, off, gfid, gfid_len, cld) \
+ do { \
+ CHANGELOG_FILL_BUFFER(buffer, off, priv->maps[cld->cld_type], 1); \
+ CHANGELOG_FILL_BUFFER(buffer, off, gfid, gfid_len); \
+ } while (0)
+
+#define CHANGELOG_STORE_BINARY(priv, buf, off, gfid, cld) \
+ do { \
+ CHANGELOG_FILL_BUFFER(buffer, off, priv->maps[cld->cld_type], 1); \
+ CHANGELOG_FILL_BUFFER(buffer, off, gfid, sizeof(uuid_t)); \
+ } while (0)
size_t
-entry_fn (void *data, char *buffer, gf_boolean_t encode);
+entry_fn(void *data, char *buffer, gf_boolean_t encode);
size_t
-del_entry_fn (void *data, char *buffer, gf_boolean_t encode);
+del_entry_fn(void *data, char *buffer, gf_boolean_t encode);
size_t
-fop_fn (void *data, char *buffer, gf_boolean_t encode);
+fop_fn(void *data, char *buffer, gf_boolean_t encode);
size_t
-number_fn (void *data, char *buffer, gf_boolean_t encode);
+number_fn(void *data, char *buffer, gf_boolean_t encode);
void
-entry_free_fn (void *data);
+entry_free_fn(void *data);
void
-del_entry_free_fn (void *data);
+del_entry_free_fn(void *data);
int
-changelog_encode_binary (xlator_t *, changelog_log_data_t *);
+changelog_encode_binary(xlator_t *, changelog_log_data_t *);
int
-changelog_encode_ascii (xlator_t *, changelog_log_data_t *);
+changelog_encode_ascii(xlator_t *, changelog_log_data_t *);
void
changelog_encode_change(changelog_priv_t *);
diff --git a/xlators/features/changelog/src/changelog-ev-handle.h b/xlators/features/changelog/src/changelog-ev-handle.h
index e89af8793a8..7e543a0edb3 100644
--- a/xlators/features/changelog/src/changelog-ev-handle.h
+++ b/xlators/features/changelog/src/changelog-ev-handle.h
@@ -20,59 +20,58 @@
struct changelog_clnt;
typedef struct changelog_rpc_clnt {
- xlator_t *this;
+ xlator_t *this;
- gf_lock_t lock;
+ gf_lock_t lock;
- gf_atomic_t ref;
- gf_boolean_t disconnected;
+ gf_atomic_t ref;
+ gf_boolean_t disconnected;
- unsigned int filter;
- char sock[UNIX_PATH_MAX];
+ unsigned int filter;
+ char sock[UNIX_PATH_MAX];
- struct changelog_clnt *c_clnt; /* back pointer to list holder */
+ struct changelog_clnt *c_clnt; /* back pointer to list holder */
- struct rpc_clnt *rpc; /* RPC client endpoint */
+ struct rpc_clnt *rpc; /* RPC client endpoint */
- struct list_head list; /* ->pending, ->waitq, ->active */
+ struct list_head list; /* ->pending, ->waitq, ->active */
- void (*cleanup)
- (struct changelog_rpc_clnt *); /* cleanup handler */
+ void (*cleanup)(struct changelog_rpc_clnt *); /* cleanup handler */
} changelog_rpc_clnt_t;
static inline void
-changelog_rpc_clnt_ref (changelog_rpc_clnt_t *crpc)
+changelog_rpc_clnt_ref(changelog_rpc_clnt_t *crpc)
{
- GF_ATOMIC_INC (crpc->ref);
+ GF_ATOMIC_INC(crpc->ref);
}
static inline void
-changelog_set_disconnect_flag (changelog_rpc_clnt_t *crpc, gf_boolean_t flag)
+changelog_set_disconnect_flag(changelog_rpc_clnt_t *crpc, gf_boolean_t flag)
{
- crpc->disconnected = flag;
+ crpc->disconnected = flag;
}
static inline int
-changelog_rpc_clnt_is_disconnected (changelog_rpc_clnt_t *crpc)
+changelog_rpc_clnt_is_disconnected(changelog_rpc_clnt_t *crpc)
{
- return (crpc->disconnected == _gf_true);
+ return (crpc->disconnected == _gf_true);
}
static inline void
-changelog_rpc_clnt_unref (changelog_rpc_clnt_t *crpc)
+changelog_rpc_clnt_unref(changelog_rpc_clnt_t *crpc)
{
- gf_boolean_t gone = _gf_false;
- uint64_t ref = 0;
+ gf_boolean_t gone = _gf_false;
+ uint64_t ref = 0;
- ref = GF_ATOMIC_DEC (crpc->ref);
+ ref = GF_ATOMIC_DEC(crpc->ref);
- if (!ref && changelog_rpc_clnt_is_disconnected (crpc)) {
- list_del (&crpc->list);
- gone = _gf_true;
- }
+ if (!ref && changelog_rpc_clnt_is_disconnected(crpc)) {
+ list_del(&crpc->list);
+ gone = _gf_true;
+ }
- if (gone)
- crpc->cleanup (crpc);
+ if (gone)
+ crpc->cleanup(crpc);
}
/**
@@ -100,35 +99,36 @@ changelog_rpc_clnt_unref (changelog_rpc_clnt_t *crpc)
*/
typedef struct changelog_clnt {
- xlator_t *this;
+ xlator_t *this;
- /* pending connections */
- pthread_mutex_t pending_lock;
- pthread_cond_t pending_cond;
- struct list_head pending;
+ /* pending connections */
+ pthread_mutex_t pending_lock;
+ pthread_cond_t pending_cond;
+ struct list_head pending;
- /* current active connections */
- gf_lock_t active_lock;
- struct list_head active;
+ /* current active connections */
+ gf_lock_t active_lock;
+ struct list_head active;
- gf_lock_t wait_lock;
- struct list_head waitq;
+ gf_lock_t wait_lock;
+ struct list_head waitq;
- /* consumer part of rot-buffs */
- rbuf_t *rbuf;
- unsigned long sequence;
+ /* consumer part of rot-buffs */
+ rbuf_t *rbuf;
+ unsigned long sequence;
} changelog_clnt_t;
-void *changelog_ev_connector (void *);
+void *
+changelog_ev_connector(void *);
-void *changelog_ev_dispatch (void *);
+void *
+changelog_ev_dispatch(void *);
/* APIs */
void
-changelog_ev_queue_connection (changelog_clnt_t *, changelog_rpc_clnt_t *);
+changelog_ev_queue_connection(changelog_clnt_t *, changelog_rpc_clnt_t *);
void
-changelog_ev_cleanup_connections (xlator_t *, changelog_clnt_t *);
+changelog_ev_cleanup_connections(xlator_t *, changelog_clnt_t *);
#endif
-
diff --git a/xlators/features/changelog/src/changelog-helpers.h b/xlators/features/changelog/src/changelog-helpers.h
index 1551337c16f..10d457e8cf5 100644
--- a/xlators/features/changelog/src/changelog-helpers.h
+++ b/xlators/features/changelog/src/changelog-helpers.h
@@ -30,44 +30,44 @@
* the changelog entry
*/
typedef struct changelog_log_data {
- /* rollover related */
- unsigned long cld_roll_time;
+ /* rollover related */
+ unsigned long cld_roll_time;
- /* reopen changelog? */
- gf_boolean_t cld_finale;
+ /* reopen changelog? */
+ gf_boolean_t cld_finale;
- changelog_log_type cld_type;
+ changelog_log_type cld_type;
- /**
- * sincd gfid is _always_ a necessity, it's not a part
- * of the iobuf. by doing this we do not add any overhead
- * for data and metadata related fops.
- */
- uuid_t cld_gfid;
+ /**
+ * sincd gfid is _always_ a necessity, it's not a part
+ * of the iobuf. by doing this we do not add any overhead
+ * for data and metadata related fops.
+ */
+ uuid_t cld_gfid;
- /**
- * iobufs are used for optionals records: pargfid, path,
- * write offsets etc.. It's the fop implementers job
- * to allocate (iobuf_get() in the fop) and get unref'ed
- * in the callback (CHANGELOG_STACK_UNWIND).
- */
- struct iobuf *cld_iobuf;
+ /**
+ * iobufs are used for optionals records: pargfid, path,
+ * write offsets etc.. It's the fop implementers job
+ * to allocate (iobuf_get() in the fop) and get unref'ed
+ * in the callback (CHANGELOG_STACK_UNWIND).
+ */
+ struct iobuf *cld_iobuf;
#define cld_ptr cld_iobuf->ptr
- /**
- * after allocation you can point this to the length of
- * usable data, but make sure it does not exceed the
- * the size of the requested iobuf.
- */
- size_t cld_iobuf_len;
+ /**
+ * after allocation you can point this to the length of
+ * usable data, but make sure it does not exceed the
+ * the size of the requested iobuf.
+ */
+ size_t cld_iobuf_len;
#define cld_ptr_len cld_iobuf_len
- /**
- * number of optional records
- */
- int cld_xtra_records;
+ /**
+ * number of optional records
+ */
+ int cld_xtra_records;
} changelog_log_data_t;
/**
@@ -77,55 +77,54 @@ typedef struct changelog_log_data {
typedef struct changelog_priv changelog_priv_t;
typedef struct changelog_dispatcher {
- void *cd_data;
- int (*dispatchfn) (xlator_t *, changelog_priv_t *, void *,
- changelog_log_data_t *, changelog_log_data_t *);
+ void *cd_data;
+ int (*dispatchfn)(xlator_t *, changelog_priv_t *, void *,
+ changelog_log_data_t *, changelog_log_data_t *);
} changelog_dispatcher_t;
struct changelog_bootstrap {
- changelog_mode_t mode;
- int (*ctor) (xlator_t *, changelog_dispatcher_t *);
- int (*dtor) (xlator_t *, changelog_dispatcher_t *);
+ changelog_mode_t mode;
+ int (*ctor)(xlator_t *, changelog_dispatcher_t *);
+ int (*dtor)(xlator_t *, changelog_dispatcher_t *);
};
struct changelog_encoder {
- changelog_encoder_t encoder;
- int (*encode) (xlator_t *, changelog_log_data_t *);
+ changelog_encoder_t encoder;
+ int (*encode)(xlator_t *, changelog_log_data_t *);
};
-
/* xlator private */
typedef struct changelog_time_slice {
- /**
- * just in case we need nanosecond granularity some day.
- * field is unused as of now (maybe we'd need it later).
- */
- struct timeval tv_start;
-
- /**
- * version of changelog file, incremented each time changes
- * rollover.
- */
- unsigned long changelog_version[CHANGELOG_MAX_TYPE];
+ /**
+ * just in case we need nanosecond granularity some day.
+ * field is unused as of now (maybe we'd need it later).
+ */
+ struct timeval tv_start;
+
+ /**
+ * version of changelog file, incremented each time changes
+ * rollover.
+ */
+ unsigned long changelog_version[CHANGELOG_MAX_TYPE];
} changelog_time_slice_t;
typedef struct changelog_rollover {
- /* rollover thread */
- pthread_t rollover_th;
+ /* rollover thread */
+ pthread_t rollover_th;
- xlator_t *this;
+ xlator_t *this;
- pthread_mutex_t lock;
- pthread_cond_t cond;
- gf_boolean_t notify;
+ pthread_mutex_t lock;
+ pthread_cond_t cond;
+ gf_boolean_t notify;
} changelog_rollover_t;
typedef struct changelog_fsync {
- /* fsync() thread */
- pthread_t fsync_th;
+ /* fsync() thread */
+ pthread_t fsync_th;
- xlator_t *this;
+ xlator_t *this;
} changelog_fsync_t;
/* Draining during changelog rollover (for geo-rep snapshot dependency):
@@ -145,198 +144,197 @@ typedef struct changelog_fsync {
*/
typedef enum chlog_fop_color {
- FOP_COLOR_BLACK,
- FOP_COLOR_WHITE
+ FOP_COLOR_BLACK,
+ FOP_COLOR_WHITE
} chlog_fop_color_t;
/* Barrier notify variable */
typedef struct barrier_notify {
- pthread_mutex_t bnotify_mutex;
- pthread_cond_t bnotify_cond;
- gf_boolean_t bnotify;
- gf_boolean_t bnotify_error;
+ pthread_mutex_t bnotify_mutex;
+ pthread_cond_t bnotify_cond;
+ gf_boolean_t bnotify;
+ gf_boolean_t bnotify_error;
} barrier_notify_t;
/* Two separate mutex and conditional variable set is used
* to drain white and black fops. */
typedef struct drain_mgmt {
- pthread_mutex_t drain_black_mutex;
- pthread_cond_t drain_black_cond;
- pthread_mutex_t drain_white_mutex;
- pthread_cond_t drain_white_cond;
- /* Represents black fops count in-transit */
- unsigned long black_fop_cnt;
- /* Represents white fops count in-transit */
- unsigned long white_fop_cnt;
- gf_boolean_t drain_wait_black;
- gf_boolean_t drain_wait_white;
+ pthread_mutex_t drain_black_mutex;
+ pthread_cond_t drain_black_cond;
+ pthread_mutex_t drain_white_mutex;
+ pthread_cond_t drain_white_cond;
+ /* Represents black fops count in-transit */
+ unsigned long black_fop_cnt;
+ /* Represents white fops count in-transit */
+ unsigned long white_fop_cnt;
+ gf_boolean_t drain_wait_black;
+ gf_boolean_t drain_wait_white;
} drain_mgmt_t;
/* External barrier as a result of snap on/off indicating flag*/
typedef struct barrier_flags {
- gf_lock_t lock;
- gf_boolean_t barrier_ext;
+ gf_lock_t lock;
+ gf_boolean_t barrier_ext;
} barrier_flags_t;
/* Event selection */
typedef struct changelog_ev_selector {
- gf_lock_t reflock;
+ gf_lock_t reflock;
- /**
- * Array of references for each selection bit.
- */
- unsigned int ref[CHANGELOG_EV_SELECTION_RANGE];
+ /**
+ * Array of references for each selection bit.
+ */
+ unsigned int ref[CHANGELOG_EV_SELECTION_RANGE];
} changelog_ev_selector_t;
-
/* changelog's private structure */
struct changelog_priv {
- gf_boolean_t active;
+ gf_boolean_t active;
- /* to generate unique socket file per brick */
- char *changelog_brick;
+ /* to generate unique socket file per brick */
+ char *changelog_brick;
- /* logging directory */
- char *changelog_dir;
+ /* logging directory */
+ char *changelog_dir;
- /* htime directory */
- char *htime_dir;
+ /* htime directory */
+ char *htime_dir;
- /* one file for all changelog types */
- int changelog_fd;
+ /* one file for all changelog types */
+ int changelog_fd;
- /* htime fd for current changelog session */
- int htime_fd;
+ /* htime fd for current changelog session */
+ int htime_fd;
- /* c_snap_fd is fd for call-path changelog */
- int c_snap_fd;
+ /* c_snap_fd is fd for call-path changelog */
+ int c_snap_fd;
- /* rollover_count used by htime */
- int rollover_count;
+ /* rollover_count used by htime */
+ int rollover_count;
- gf_lock_t lock;
+ gf_lock_t lock;
- /* lock to synchronize CSNAP updation */
- gf_lock_t c_snap_lock;
+ /* lock to synchronize CSNAP updation */
+ gf_lock_t c_snap_lock;
- /* written end of the pipe */
- int wfd;
+ /* written end of the pipe */
+ int wfd;
- /* rollover time */
- int32_t rollover_time;
+ /* rollover time */
+ int32_t rollover_time;
- /* fsync() interval */
- int32_t fsync_interval;
+ /* fsync() interval */
+ int32_t fsync_interval;
- /* changelog type maps */
- const char *maps[CHANGELOG_MAX_TYPE];
+ /* changelog type maps */
+ const char *maps[CHANGELOG_MAX_TYPE];
- /* time slicer */
- changelog_time_slice_t slice;
+ /* time slicer */
+ changelog_time_slice_t slice;
- /* context of the updater */
- changelog_dispatcher_t cd;
+ /* context of the updater */
+ changelog_dispatcher_t cd;
- /* context of the rollover thread */
- changelog_rollover_t cr;
+ /* context of the rollover thread */
+ changelog_rollover_t cr;
- /* context of fsync thread */
- changelog_fsync_t cf;
+ /* context of fsync thread */
+ changelog_fsync_t cf;
- /* operation mode */
- changelog_mode_t op_mode;
+ /* operation mode */
+ changelog_mode_t op_mode;
- /* bootstrap routine for 'current' logger */
- struct changelog_bootstrap *cb;
+ /* bootstrap routine for 'current' logger */
+ struct changelog_bootstrap *cb;
- /* encoder mode */
- changelog_encoder_t encode_mode;
+ /* encoder mode */
+ changelog_encoder_t encode_mode;
- /* encoder */
- struct changelog_encoder *ce;
+ /* encoder */
+ struct changelog_encoder *ce;
- /**
- * snapshot dependency changes
- */
+ /**
+ * snapshot dependency changes
+ */
- /* Draining of fops*/
- drain_mgmt_t dm;
+ /* Draining of fops*/
+ drain_mgmt_t dm;
- /* Represents the active color. Initially by default black */
- chlog_fop_color_t current_color;
+ /* Represents the active color. Initially by default black */
+ chlog_fop_color_t current_color;
- /* flag to determine explicit rollover is triggered */
- gf_boolean_t explicit_rollover;
+ /* flag to determine explicit rollover is triggered */
+ gf_boolean_t explicit_rollover;
- /* barrier notification variable protected by mutex */
- barrier_notify_t bn;
+ /* barrier notification variable protected by mutex */
+ barrier_notify_t bn;
- /* barrier on/off indicating flags */
- barrier_flags_t bflags;
+ /* barrier on/off indicating flags */
+ barrier_flags_t bflags;
- /* changelog barrier on/off indicating flag */
- gf_boolean_t barrier_enabled;
- struct list_head queue;
- uint32_t queue_size;
- gf_timer_t *timer;
- struct timespec timeout;
+ /* changelog barrier on/off indicating flag */
+ gf_boolean_t barrier_enabled;
+ struct list_head queue;
+ uint32_t queue_size;
+ gf_timer_t *timer;
+ struct timespec timeout;
- /**
- * buffers, RPC, event selection, notifications and other
- * beasts.
- */
+ /**
+ * buffers, RPC, event selection, notifications and other
+ * beasts.
+ */
- /* epoll pthread */
- pthread_t poller;
+ /* epoll pthread */
+ pthread_t poller;
- /* rotational buffer */
- rbuf_t *rbuf;
+ /* rotational buffer */
+ rbuf_t *rbuf;
- /* changelog RPC server */
- rpcsvc_t *rpc;
+ /* changelog RPC server */
+ rpcsvc_t *rpc;
- /* event selection */
- changelog_ev_selector_t ev_selection;
+ /* event selection */
+ changelog_ev_selector_t ev_selection;
- /* client handling (reverse connection) */
- pthread_t connector;
+ /* client handling (reverse connection) */
+ pthread_t connector;
- int nr_dispatchers;
- pthread_t *ev_dispatcher;
+ int nr_dispatchers;
+ pthread_t *ev_dispatcher;
- changelog_clnt_t connections;
+ changelog_clnt_t connections;
- /* glusterfind dependency to capture paths on deleted entries*/
- gf_boolean_t capture_del_path;
+ /* glusterfind dependency to capture paths on deleted entries*/
+ gf_boolean_t capture_del_path;
};
struct changelog_local {
- inode_t *inode;
- gf_boolean_t update_no_check;
+ inode_t *inode;
+ gf_boolean_t update_no_check;
- changelog_log_data_t cld;
+ changelog_log_data_t cld;
- /**
- * ->prev_entry is used in cases when there needs to be
- * additional changelog entry for the parent (eg. rename)
- * It's analogous to ->next in single linked list world,
- * but we call it as ->prev_entry... ha ha ha
- */
- struct changelog_local *prev_entry;
+ /**
+ * ->prev_entry is used in cases when there needs to be
+ * additional changelog entry for the parent (eg. rename)
+ * It's analogous to ->next in single linked list world,
+ * but we call it as ->prev_entry... ha ha ha
+ */
+ struct changelog_local *prev_entry;
- /* snap dependency changes */
- chlog_fop_color_t color;
+ /* snap dependency changes */
+ chlog_fop_color_t color;
};
typedef struct changelog_local changelog_local_t;
/* inode version is stored in inode ctx */
typedef struct changelog_inode_ctx {
- unsigned long iversion[CHANGELOG_MAX_TYPE];
+ unsigned long iversion[CHANGELOG_MAX_TYPE];
} changelog_inode_ctx_t;
-#define CHANGELOG_INODE_VERSION_TYPE(ctx, type) &(ctx->iversion[type])
+#define CHANGELOG_INODE_VERSION_TYPE(ctx, type) &(ctx->iversion[type])
/**
* Optional Records:
@@ -344,269 +342,279 @@ typedef struct changelog_inode_ctx {
* @changelog_opt_t struct. The array is allocated via @iobufs.
*/
typedef enum {
- CHANGELOG_OPT_REC_FOP,
- CHANGELOG_OPT_REC_ENTRY,
- CHANGELOG_OPT_REC_UINT32,
+ CHANGELOG_OPT_REC_FOP,
+ CHANGELOG_OPT_REC_ENTRY,
+ CHANGELOG_OPT_REC_UINT32,
} changelog_optional_rec_type_t;
struct changelog_entry_fields {
- uuid_t cef_uuid;
- char *cef_bname;
- char *cef_path;
+ uuid_t cef_uuid;
+ char *cef_bname;
+ char *cef_path;
};
typedef struct {
- /**
- * @co_covert can be used to do post-processing of the record before
- * it's persisted to the CHANGELOG. If this is NULL, then the record
- * is persisted as per it's in memory format.
- */
- size_t (*co_convert) (void *data, char *buffer, gf_boolean_t encode);
-
- /* release routines */
- void (*co_free) (void *data);
-
- /* type of the field */
- changelog_optional_rec_type_t co_type;
-
- /**
- * sizeof of the 'valid' field in the union. This field is not used if
- * @co_convert is specified.
- */
- size_t co_len;
-
- union {
- unsigned int co_uint32;
- glusterfs_fop_t co_fop;
- struct changelog_entry_fields co_entry;
- };
+ /**
+ * @co_covert can be used to do post-processing of the record before
+ * it's persisted to the CHANGELOG. If this is NULL, then the record
+ * is persisted as per it's in memory format.
+ */
+ size_t (*co_convert)(void *data, char *buffer, gf_boolean_t encode);
+
+ /* release routines */
+ void (*co_free)(void *data);
+
+ /* type of the field */
+ changelog_optional_rec_type_t co_type;
+
+ /**
+ * sizeof of the 'valid' field in the union. This field is not used if
+ * @co_convert is specified.
+ */
+ size_t co_len;
+
+ union {
+ unsigned int co_uint32;
+ glusterfs_fop_t co_fop;
+ struct changelog_entry_fields co_entry;
+ };
} changelog_opt_t;
-#define CHANGELOG_OPT_RECORD_LEN sizeof (changelog_opt_t)
+#define CHANGELOG_OPT_RECORD_LEN sizeof(changelog_opt_t)
/**
* helpers routines
*/
int
-changelog_thread_cleanup (xlator_t *this, pthread_t thr_id);
+changelog_thread_cleanup(xlator_t *this, pthread_t thr_id);
void *
-changelog_get_usable_buffer (changelog_local_t *local);
+changelog_get_usable_buffer(changelog_local_t *local);
void
-changelog_set_usable_record_and_length (changelog_local_t *local,
- size_t len, int xr);
+changelog_set_usable_record_and_length(changelog_local_t *local, size_t len,
+ int xr);
void
-changelog_local_cleanup (xlator_t *xl, changelog_local_t *local);
+changelog_local_cleanup(xlator_t *xl, changelog_local_t *local);
changelog_local_t *
-changelog_local_init (xlator_t *this, inode_t *inode, uuid_t gfid,
- int xtra_records, gf_boolean_t update_flag);
+changelog_local_init(xlator_t *this, inode_t *inode, uuid_t gfid,
+ int xtra_records, gf_boolean_t update_flag);
int
-changelog_start_next_change (xlator_t *this,
- changelog_priv_t *priv,
- unsigned long ts, gf_boolean_t finale);
+changelog_start_next_change(xlator_t *this, changelog_priv_t *priv,
+ unsigned long ts, gf_boolean_t finale);
int
-changelog_open_journal (xlator_t *this, changelog_priv_t *priv);
+changelog_open_journal(xlator_t *this, changelog_priv_t *priv);
int
-changelog_fill_rollover_data (changelog_log_data_t *cld, gf_boolean_t is_last);
+changelog_fill_rollover_data(changelog_log_data_t *cld, gf_boolean_t is_last);
int
-changelog_inject_single_event (xlator_t *this,
- changelog_priv_t *priv,
- changelog_log_data_t *cld);
+changelog_inject_single_event(xlator_t *this, changelog_priv_t *priv,
+ changelog_log_data_t *cld);
size_t
-changelog_entry_length ();
+changelog_entry_length();
int
-changelog_write (int fd, char *buffer, size_t len);
+changelog_write(int fd, char *buffer, size_t len);
int
-changelog_write_change (changelog_priv_t *priv, char *buffer, size_t len);
+changelog_write_change(changelog_priv_t *priv, char *buffer, size_t len);
int
-changelog_handle_change (xlator_t *this,
- changelog_priv_t *priv, changelog_log_data_t *cld);
+changelog_handle_change(xlator_t *this, changelog_priv_t *priv,
+ changelog_log_data_t *cld);
void
-changelog_update (xlator_t *this, changelog_priv_t *priv,
- changelog_local_t *local, changelog_log_type type);
+changelog_update(xlator_t *this, changelog_priv_t *priv,
+ changelog_local_t *local, changelog_log_type type);
void *
-changelog_rollover (void *data);
+changelog_rollover(void *data);
void *
-changelog_fsync_thread (void *data);
+changelog_fsync_thread(void *data);
int
-changelog_forget (xlator_t *this, inode_t *inode);
+changelog_forget(xlator_t *this, inode_t *inode);
int
-htime_update (xlator_t *this, changelog_priv_t *priv,
- unsigned long ts, char * buffer);
+htime_update(xlator_t *this, changelog_priv_t *priv, unsigned long ts,
+ char *buffer);
int
-htime_open (xlator_t *this, changelog_priv_t *priv, unsigned long ts);
+htime_open(xlator_t *this, changelog_priv_t *priv, unsigned long ts);
int
-htime_create (xlator_t *this, changelog_priv_t *priv, unsigned long ts);
+htime_create(xlator_t *this, changelog_priv_t *priv, unsigned long ts);
/* Geo-Rep snapshot dependency changes */
void
-changelog_color_fop_and_inc_cnt (xlator_t *this, changelog_priv_t *priv,
- changelog_local_t *local);
+changelog_color_fop_and_inc_cnt(xlator_t *this, changelog_priv_t *priv,
+ changelog_local_t *local);
void
-changelog_inc_fop_cnt (xlator_t *this, changelog_priv_t *priv,
- changelog_local_t *local);
+changelog_inc_fop_cnt(xlator_t *this, changelog_priv_t *priv,
+ changelog_local_t *local);
void
-changelog_dec_fop_cnt (xlator_t *this, changelog_priv_t *priv,
- changelog_local_t *local);
+changelog_dec_fop_cnt(xlator_t *this, changelog_priv_t *priv,
+ changelog_local_t *local);
int
-changelog_barrier_notify (changelog_priv_t *priv, char* buf);
+changelog_barrier_notify(changelog_priv_t *priv, char *buf);
void
-changelog_barrier_cleanup (xlator_t *this, changelog_priv_t *priv,
- struct list_head *queue);
+changelog_barrier_cleanup(xlator_t *this, changelog_priv_t *priv,
+ struct list_head *queue);
void
-changelog_drain_white_fops (xlator_t *this, changelog_priv_t *priv);
+changelog_drain_white_fops(xlator_t *this, changelog_priv_t *priv);
void
-changelog_drain_black_fops (xlator_t *this, changelog_priv_t *priv);
+changelog_drain_black_fops(xlator_t *this, changelog_priv_t *priv);
/* Crash consistency of changelog wrt snapshot */
int
-changelog_snap_logging_stop ( xlator_t *this, changelog_priv_t *priv);
+changelog_snap_logging_stop(xlator_t *this, changelog_priv_t *priv);
int
-changelog_snap_logging_start ( xlator_t *this, changelog_priv_t *priv);
+changelog_snap_logging_start(xlator_t *this, changelog_priv_t *priv);
int
-changelog_snap_open ( xlator_t *this, changelog_priv_t *priv);
+changelog_snap_open(xlator_t *this, changelog_priv_t *priv);
int
-changelog_snap_handle_ascii_change (xlator_t *this,
- changelog_log_data_t *cld);
+changelog_snap_handle_ascii_change(xlator_t *this, changelog_log_data_t *cld);
int
-changelog_snap_write_change (changelog_priv_t *priv, char *buffer, size_t len);
+changelog_snap_write_change(changelog_priv_t *priv, char *buffer, size_t len);
/* Changelog barrier routines */
-void __chlog_barrier_enqueue (xlator_t *this, call_stub_t *stub);
-void __chlog_barrier_disable (xlator_t *this, struct list_head *queue);
-void chlog_barrier_dequeue_all (xlator_t *this, struct list_head *queue);
-call_stub_t *__chlog_barrier_dequeue (xlator_t *this, struct list_head *queue);
-int __chlog_barrier_enable (xlator_t *this, changelog_priv_t *priv);
+void
+__chlog_barrier_enqueue(xlator_t *this, call_stub_t *stub);
+void
+__chlog_barrier_disable(xlator_t *this, struct list_head *queue);
+void
+chlog_barrier_dequeue_all(xlator_t *this, struct list_head *queue);
+call_stub_t *
+__chlog_barrier_dequeue(xlator_t *this, struct list_head *queue);
+int
+__chlog_barrier_enable(xlator_t *this, changelog_priv_t *priv);
int32_t
-changelog_fill_entry_buf (call_frame_t *frame, xlator_t *this,
- loc_t *loc, changelog_local_t **local);
+changelog_fill_entry_buf(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ changelog_local_t **local);
/* event selection routines */
-void changelog_select_event (xlator_t *,
- changelog_ev_selector_t *, unsigned int);
-void changelog_deselect_event (xlator_t *,
- changelog_ev_selector_t *, unsigned int);
-int changelog_init_event_selection (xlator_t *,
- changelog_ev_selector_t *);
-int changelog_cleanup_event_selection (xlator_t *,
- changelog_ev_selector_t *);
-int changelog_ev_selected (xlator_t *,
- changelog_ev_selector_t *, unsigned int);
void
-changelog_dispatch_event (xlator_t *, changelog_priv_t *, changelog_event_t *);
+changelog_select_event(xlator_t *, changelog_ev_selector_t *, unsigned int);
+void
+changelog_deselect_event(xlator_t *, changelog_ev_selector_t *, unsigned int);
+int
+changelog_init_event_selection(xlator_t *, changelog_ev_selector_t *);
+int
+changelog_cleanup_event_selection(xlator_t *, changelog_ev_selector_t *);
+int
+changelog_ev_selected(xlator_t *, changelog_ev_selector_t *, unsigned int);
+void
+changelog_dispatch_event(xlator_t *, changelog_priv_t *, changelog_event_t *);
changelog_inode_ctx_t *
-__changelog_inode_ctx_get (xlator_t *, inode_t *, unsigned long **,
- unsigned long *, changelog_log_type);
+__changelog_inode_ctx_get(xlator_t *, inode_t *, unsigned long **,
+ unsigned long *, changelog_log_type);
int
-resolve_pargfid_to_path (xlator_t *this, const uuid_t gfid, char **path,
- char *bname);
+resolve_pargfid_to_path(xlator_t *this, const uuid_t gfid, char **path,
+ char *bname);
/* macros */
-#define CHANGELOG_STACK_UNWIND(fop, frame, params ...) do { \
- changelog_local_t *__local = NULL; \
- xlator_t *__xl = NULL; \
- if (frame) { \
- __local = frame->local; \
- __xl = frame->this; \
- frame->local = NULL; \
- } \
- STACK_UNWIND_STRICT (fop, frame, params); \
- if (__local && __local->prev_entry) \
- changelog_local_cleanup (__xl, \
- __local->prev_entry); \
- changelog_local_cleanup (__xl, __local); \
- } while (0)
-
-#define CHANGELOG_IOBUF_REF(iobuf) do { \
- if (iobuf) \
- iobuf_ref (iobuf); \
- } while (0)
-
-#define CHANGELOG_IOBUF_UNREF(iobuf) do { \
- if (iobuf) \
- iobuf_unref (iobuf); \
- } while (0)
-
-#define CHANGELOG_FILL_BUFFER(buffer, off, val, len) do { \
- memcpy (buffer + off, val, len); \
- off += len; \
- } while (0)
-
-#define SLICE_VERSION_UPDATE(slice) do { \
- int i = 0; \
- for (; i < CHANGELOG_MAX_TYPE; i++) { \
- slice->changelog_version[i]++; \
- } \
- } while (0)
-
-#define CHANGELOG_FILL_UINT32(co, number, converter, xlen) do { \
- co->co_convert = converter; \
- co->co_free = NULL; \
- co->co_type = CHANGELOG_OPT_REC_UINT32; \
- co->co_uint32 = number; \
- xlen += sizeof (unsigned int); \
- } while (0)
-
-#define CHANGLOG_FILL_FOP_NUMBER(co, fop, converter, xlen) do { \
- co->co_convert = converter; \
- co->co_free = NULL; \
- co->co_type = CHANGELOG_OPT_REC_FOP; \
- co->co_fop = fop; \
- xlen += sizeof (fop); \
- } while (0)
-
-#define CHANGELOG_FILL_ENTRY(co, pargfid, bname, \
- converter, freefn, xlen, label) \
- do { \
- co->co_convert = converter; \
- co->co_free = freefn; \
- co->co_type = CHANGELOG_OPT_REC_ENTRY; \
- gf_uuid_copy (co->co_entry.cef_uuid, pargfid); \
- co->co_entry.cef_bname = gf_strdup(bname); \
- if (!co->co_entry.cef_bname) \
- goto label; \
- xlen += (UUID_CANONICAL_FORM_LEN + strlen (bname)); \
- } while (0)
-
-#define CHANGELOG_FILL_ENTRY_DIR_PATH(co, pargfid, bname, converter, \
- del_freefn, xlen, label, capture_del) \
- do { \
- co->co_convert = converter; \
- co->co_free = del_freefn; \
- co->co_type = CHANGELOG_OPT_REC_ENTRY; \
- gf_uuid_copy (co->co_entry.cef_uuid, pargfid); \
- co->co_entry.cef_bname = gf_strdup(bname); \
- if (!co->co_entry.cef_bname) \
- goto label; \
- xlen += (UUID_CANONICAL_FORM_LEN + strlen (bname)); \
- if (!capture_del || resolve_pargfid_to_path (this, pargfid, \
- &(co->co_entry.cef_path), co->co_entry.cef_bname)) { \
- co->co_entry.cef_path = gf_strdup ("\0"); \
- xlen += 1; \
- } else { \
- xlen += (strlen (co->co_entry.cef_path)); \
- } \
- } while (0)
-
-#define CHANGELOG_INIT(this, local, inode, gfid, xrec) \
- local = changelog_local_init (this, inode, gfid, xrec, _gf_false)
-
-#define CHANGELOG_INIT_NOCHECK(this, local, inode, gfid, xrec) \
- local = changelog_local_init (this, inode, gfid, xrec, _gf_true)
-
-#define CHANGELOG_NOT_ACTIVE_THEN_GOTO(frame, priv, label) do { \
- if (!priv->active) \
- goto label; \
- /* ignore rebalance process's activity. */ \
- if ((frame->root->pid == GF_CLIENT_PID_DEFRAG) || \
- (frame->root->pid == GF_CLIENT_PID_TIER_DEFRAG)) \
- goto label; \
- } while (0)
+#define CHANGELOG_STACK_UNWIND(fop, frame, params...) \
+ do { \
+ changelog_local_t *__local = NULL; \
+ xlator_t *__xl = NULL; \
+ if (frame) { \
+ __local = frame->local; \
+ __xl = frame->this; \
+ frame->local = NULL; \
+ } \
+ STACK_UNWIND_STRICT(fop, frame, params); \
+ if (__local && __local->prev_entry) \
+ changelog_local_cleanup(__xl, __local->prev_entry); \
+ changelog_local_cleanup(__xl, __local); \
+ } while (0)
+
+#define CHANGELOG_IOBUF_REF(iobuf) \
+ do { \
+ if (iobuf) \
+ iobuf_ref(iobuf); \
+ } while (0)
+
+#define CHANGELOG_IOBUF_UNREF(iobuf) \
+ do { \
+ if (iobuf) \
+ iobuf_unref(iobuf); \
+ } while (0)
+
+#define CHANGELOG_FILL_BUFFER(buffer, off, val, len) \
+ do { \
+ memcpy(buffer + off, val, len); \
+ off += len; \
+ } while (0)
+
+#define SLICE_VERSION_UPDATE(slice) \
+ do { \
+ int i = 0; \
+ for (; i < CHANGELOG_MAX_TYPE; i++) { \
+ slice->changelog_version[i]++; \
+ } \
+ } while (0)
+
+#define CHANGELOG_FILL_UINT32(co, number, converter, xlen) \
+ do { \
+ co->co_convert = converter; \
+ co->co_free = NULL; \
+ co->co_type = CHANGELOG_OPT_REC_UINT32; \
+ co->co_uint32 = number; \
+ xlen += sizeof(unsigned int); \
+ } while (0)
+
+#define CHANGLOG_FILL_FOP_NUMBER(co, fop, converter, xlen) \
+ do { \
+ co->co_convert = converter; \
+ co->co_free = NULL; \
+ co->co_type = CHANGELOG_OPT_REC_FOP; \
+ co->co_fop = fop; \
+ xlen += sizeof(fop); \
+ } while (0)
+
+#define CHANGELOG_FILL_ENTRY(co, pargfid, bname, converter, freefn, xlen, \
+ label) \
+ do { \
+ co->co_convert = converter; \
+ co->co_free = freefn; \
+ co->co_type = CHANGELOG_OPT_REC_ENTRY; \
+ gf_uuid_copy(co->co_entry.cef_uuid, pargfid); \
+ co->co_entry.cef_bname = gf_strdup(bname); \
+ if (!co->co_entry.cef_bname) \
+ goto label; \
+ xlen += (UUID_CANONICAL_FORM_LEN + strlen(bname)); \
+ } while (0)
+
+#define CHANGELOG_FILL_ENTRY_DIR_PATH(co, pargfid, bname, converter, \
+ del_freefn, xlen, label, capture_del) \
+ do { \
+ co->co_convert = converter; \
+ co->co_free = del_freefn; \
+ co->co_type = CHANGELOG_OPT_REC_ENTRY; \
+ gf_uuid_copy(co->co_entry.cef_uuid, pargfid); \
+ co->co_entry.cef_bname = gf_strdup(bname); \
+ if (!co->co_entry.cef_bname) \
+ goto label; \
+ xlen += (UUID_CANONICAL_FORM_LEN + strlen(bname)); \
+ if (!capture_del || \
+ resolve_pargfid_to_path(this, pargfid, &(co->co_entry.cef_path), \
+ co->co_entry.cef_bname)) { \
+ co->co_entry.cef_path = gf_strdup("\0"); \
+ xlen += 1; \
+ } else { \
+ xlen += (strlen(co->co_entry.cef_path)); \
+ } \
+ } while (0)
+
+#define CHANGELOG_INIT(this, local, inode, gfid, xrec) \
+ local = changelog_local_init(this, inode, gfid, xrec, _gf_false)
+
+#define CHANGELOG_INIT_NOCHECK(this, local, inode, gfid, xrec) \
+ local = changelog_local_init(this, inode, gfid, xrec, _gf_true)
+
+#define CHANGELOG_NOT_ACTIVE_THEN_GOTO(frame, priv, label) \
+ do { \
+ if (!priv->active) \
+ goto label; \
+ /* ignore rebalance process's activity. */ \
+ if ((frame->root->pid == GF_CLIENT_PID_DEFRAG) || \
+ (frame->root->pid == GF_CLIENT_PID_TIER_DEFRAG)) \
+ goto label; \
+ } while (0)
/* If it is a METADATA entry and fop num being GF_FOP_NULL, don't
* log in the changelog as it is of no use. And also if it is
@@ -615,78 +623,80 @@ resolve_pargfid_to_path (xlator_t *this, const uuid_t gfid, char **path,
* to same changelog will be missed. Hence check for boundary
* condition.
*/
-#define CHANGELOG_OP_BOUNDARY_CHECK(frame, label) do { \
- if (frame->root->op <= GF_FOP_NULL || \
- frame->root->op >= GF_FOP_MAXVALUE) \
- goto label; \
- } while (0)
+#define CHANGELOG_OP_BOUNDARY_CHECK(frame, label) \
+ do { \
+ if (frame->root->op <= GF_FOP_NULL || \
+ frame->root->op >= GF_FOP_MAXVALUE) \
+ goto label; \
+ } while (0)
/**
* ignore internal fops for all clients except AFR self-heal daemon
*/
-#define CHANGELOG_IF_INTERNAL_FOP_THEN_GOTO(frame, dict, label) do { \
- if ((frame->root->pid != GF_CLIENT_PID_SELF_HEALD) \
- && dict \
- && dict_get (dict, GLUSTERFS_INTERNAL_FOP_KEY)) \
- goto label; \
- } while (0)
-
-#define CHANGELOG_COND_GOTO(priv, cond, label) do { \
- if (!priv->active || cond) \
- goto label; \
- } while (0)
+#define CHANGELOG_IF_INTERNAL_FOP_THEN_GOTO(frame, dict, label) \
+ do { \
+ if ((frame->root->pid != GF_CLIENT_PID_SELF_HEALD) && dict && \
+ dict_get(dict, GLUSTERFS_INTERNAL_FOP_KEY)) \
+ goto label; \
+ } while (0)
+
+#define CHANGELOG_COND_GOTO(priv, cond, label) \
+ do { \
+ if (!priv->active || cond) \
+ goto label; \
+ } while (0)
/* Begin: Geo-Rep snapshot dependency changes */
-#define DICT_ERROR -1
-#define BARRIER_OFF 0
-#define BARRIER_ON 1
-#define DICT_DEFAULT 2
-
-#define CHANGELOG_NOT_ON_THEN_GOTO(priv, ret, label) do { \
- if (!priv->active) { \
- gf_msg (this->name, GF_LOG_WARNING, 0, \
- CHANGELOG_MSG_NOT_ACTIVE, \
- "Changelog is not active, return success"); \
- ret = 0; \
- goto label; \
- } \
- } while (0)
+#define DICT_ERROR -1
+#define BARRIER_OFF 0
+#define BARRIER_ON 1
+#define DICT_DEFAULT 2
+
+#define CHANGELOG_NOT_ON_THEN_GOTO(priv, ret, label) \
+ do { \
+ if (!priv->active) { \
+ gf_msg(this->name, GF_LOG_WARNING, 0, CHANGELOG_MSG_NOT_ACTIVE, \
+ "Changelog is not active, return success"); \
+ ret = 0; \
+ goto label; \
+ } \
+ } while (0)
/* Log pthread error and goto label */
-#define CHANGELOG_PTHREAD_ERROR_HANDLE_0(ret, label) do { \
- if (ret) { \
- gf_smsg (this->name, GF_LOG_ERROR, \
- 0, CHANGELOG_MSG_PTHREAD_ERROR, \
- "pthread error", "error=%d", ret, NULL); \
- ret = -1; \
- goto label; \
- } \
- } while (0);
+#define CHANGELOG_PTHREAD_ERROR_HANDLE_0(ret, label) \
+ do { \
+ if (ret) { \
+ gf_smsg(this->name, GF_LOG_ERROR, 0, CHANGELOG_MSG_PTHREAD_ERROR, \
+ "pthread error", "error=%d", ret, NULL); \
+ ret = -1; \
+ goto label; \
+ } \
+ } while (0);
/* Log pthread error, set flag and goto label */
-#define CHANGELOG_PTHREAD_ERROR_HANDLE_1(ret, label, flag) do { \
- if (ret) { \
- gf_smsg (this->name, GF_LOG_ERROR, 0, \
- CHANGELOG_MSG_PTHREAD_ERROR, \
- "pthread error", "error=%d", ret, NULL); \
- ret = -1; \
- flag = _gf_true; \
- goto label; \
- } \
- } while (0)
+#define CHANGELOG_PTHREAD_ERROR_HANDLE_1(ret, label, flag) \
+ do { \
+ if (ret) { \
+ gf_smsg(this->name, GF_LOG_ERROR, 0, CHANGELOG_MSG_PTHREAD_ERROR, \
+ "pthread error", "error=%d", ret, NULL); \
+ ret = -1; \
+ flag = _gf_true; \
+ goto label; \
+ } \
+ } while (0)
/* Log pthread error, unlock mutex and goto label */
-#define CHANGELOG_PTHREAD_ERROR_HANDLE_2(ret, label, mutex) do { \
- if (ret) { \
- gf_smsg (this->name, GF_LOG_ERROR, \
- 0, CHANGELOG_MSG_PTHREAD_ERROR, \
- "pthread error", "error=%d", ret, NULL); \
- ret = -1; \
- pthread_mutex_unlock (&mutex); \
- goto label; \
- } \
- } while (0)
+#define CHANGELOG_PTHREAD_ERROR_HANDLE_2(ret, label, mutex) \
+ do { \
+ if (ret) { \
+ gf_smsg(this->name, GF_LOG_ERROR, 0, CHANGELOG_MSG_PTHREAD_ERROR, \
+ "pthread error", "error=%d", ret, NULL); \
+ ret = -1; \
+ pthread_mutex_unlock(&mutex); \
+ goto label; \
+ } \
+ } while (0)
/* End: Geo-Rep snapshot dependency changes */
diff --git a/xlators/features/changelog/src/changelog-mem-types.h b/xlators/features/changelog/src/changelog-mem-types.h
index 33fea31b979..1e3786c6298 100644
--- a/xlators/features/changelog/src/changelog-mem-types.h
+++ b/xlators/features/changelog/src/changelog-mem-types.h
@@ -14,21 +14,21 @@
#include "mem-types.h"
enum gf_changelog_mem_types {
- gf_changelog_mt_priv_t = gf_common_mt_end + 1,
- gf_changelog_mt_str_t = gf_common_mt_end + 2,
- gf_changelog_mt_batch_t = gf_common_mt_end + 3,
- gf_changelog_mt_rt_t = gf_common_mt_end + 4,
- gf_changelog_mt_inode_ctx_t = gf_common_mt_end + 5,
- gf_changelog_mt_rpc_clnt_t = gf_common_mt_end + 6,
- gf_changelog_mt_libgfchangelog_t = gf_common_mt_end + 7,
- gf_changelog_mt_libgfchangelog_entry_t = gf_common_mt_end + 8,
- gf_changelog_mt_libgfchangelog_rl_t = gf_common_mt_end + 9,
- gf_changelog_mt_changelog_buffer_t = gf_common_mt_end + 10,
- gf_changelog_mt_history_data_t = gf_common_mt_end + 11,
- gf_changelog_mt_libgfchangelog_call_pool_t = gf_common_mt_end + 12,
- gf_changelog_mt_libgfchangelog_event_t = gf_common_mt_end + 13,
- gf_changelog_mt_ev_dispatcher_t = gf_common_mt_end + 14,
- gf_changelog_mt_end
+ gf_changelog_mt_priv_t = gf_common_mt_end + 1,
+ gf_changelog_mt_str_t = gf_common_mt_end + 2,
+ gf_changelog_mt_batch_t = gf_common_mt_end + 3,
+ gf_changelog_mt_rt_t = gf_common_mt_end + 4,
+ gf_changelog_mt_inode_ctx_t = gf_common_mt_end + 5,
+ gf_changelog_mt_rpc_clnt_t = gf_common_mt_end + 6,
+ gf_changelog_mt_libgfchangelog_t = gf_common_mt_end + 7,
+ gf_changelog_mt_libgfchangelog_entry_t = gf_common_mt_end + 8,
+ gf_changelog_mt_libgfchangelog_rl_t = gf_common_mt_end + 9,
+ gf_changelog_mt_changelog_buffer_t = gf_common_mt_end + 10,
+ gf_changelog_mt_history_data_t = gf_common_mt_end + 11,
+ gf_changelog_mt_libgfchangelog_call_pool_t = gf_common_mt_end + 12,
+ gf_changelog_mt_libgfchangelog_event_t = gf_common_mt_end + 13,
+ gf_changelog_mt_ev_dispatcher_t = gf_common_mt_end + 14,
+ gf_changelog_mt_end
};
#endif
diff --git a/xlators/features/changelog/src/changelog-messages.h b/xlators/features/changelog/src/changelog-messages.h
index bbef2f2bde5..dbf133ec836 100644
--- a/xlators/features/changelog/src/changelog-messages.h
+++ b/xlators/features/changelog/src/changelog-messages.h
@@ -23,63 +23,35 @@
* glfs-message-id.h.
*/
-GLFS_MSGID(CHANGELOG,
- CHANGELOG_MSG_OPEN_FAILED,
- CHANGELOG_MSG_NO_MEMORY,
- CHANGELOG_MSG_VOL_MISCONFIGURED,
- CHANGELOG_MSG_RENAME_ERROR,
- CHANGELOG_MSG_READ_ERROR,
- CHANGELOG_MSG_HTIME_ERROR,
- CHANGELOG_MSG_PTHREAD_MUTEX_INIT_FAILED,
- CHANGELOG_MSG_PTHREAD_COND_INIT_FAILED,
- CHANGELOG_MSG_CHILD_MISCONFIGURED,
- CHANGELOG_MSG_DIR_OPTIONS_NOT_SET,
- CHANGELOG_MSG_CLOSE_ERROR,
- CHANGELOG_MSG_PIPE_CREATION_ERROR,
- CHANGELOG_MSG_DICT_GET_FAILED,
- CHANGELOG_MSG_BARRIER_INFO,
- CHANGELOG_MSG_BARRIER_ERROR,
- CHANGELOG_MSG_GET_TIME_OP_FAILED,
- CHANGELOG_MSG_WRITE_FAILED,
- CHANGELOG_MSG_PTHREAD_ERROR,
- CHANGELOG_MSG_INODE_NOT_FOUND,
- CHANGELOG_MSG_FSYNC_OP_FAILED,
- CHANGELOG_MSG_TOTAL_LOG_INFO,
- CHANGELOG_MSG_SNAP_INFO,
- CHANGELOG_MSG_SELECT_FAILED,
- CHANGELOG_MSG_FCNTL_FAILED,
- CHANGELOG_MSG_BNOTIFY_INFO,
- CHANGELOG_MSG_ENTRY_BUF_INFO,
- CHANGELOG_MSG_NOT_ACTIVE,
- CHANGELOG_MSG_LOCAL_INIT_FAILED,
- CHANGELOG_MSG_NOTIFY_REGISTER_FAILED,
- CHANGELOG_MSG_PROGRAM_NAME_REG_FAILED,
- CHANGELOG_MSG_HANDLE_PROBE_ERROR,
- CHANGELOG_MSG_SET_FD_CONTEXT,
- CHANGELOG_MSG_FREEUP_FAILED,
- CHANGELOG_MSG_HTIME_INFO,
- CHANGELOG_MSG_RPC_SUBMIT_REPLY_FAILED,
- CHANGELOG_MSG_RPC_BUILD_ERROR,
- CHANGELOG_MSG_RPC_CONNECT_ERROR,
- CHANGELOG_MSG_RPC_START_ERROR,
- CHANGELOG_MSG_BUFFER_STARVATION_ERROR,
- CHANGELOG_MSG_SCAN_DIR_FAILED,
- CHANGELOG_MSG_FSETXATTR_FAILED,
- CHANGELOG_MSG_FGETXATTR_FAILED,
- CHANGELOG_MSG_CLEANUP_ON_ACTIVE_REF,
- CHANGELOG_MSG_DISPATCH_EVENT_FAILED,
- CHANGELOG_MSG_PUT_BUFFER_FAILED,
- CHANGELOG_MSG_PTHREAD_COND_WAIT_FAILED,
- CHANGELOG_MSG_PTHREAD_CANCEL_FAILED,
- CHANGELOG_MSG_INJECT_FSYNC_FAILED,
- CHANGELOG_MSG_CREATE_FRAME_FAILED,
- CHANGELOG_MSG_FSTAT_OP_FAILED,
- CHANGELOG_MSG_LSEEK_OP_FAILED,
- CHANGELOG_MSG_STRSTR_OP_FAILED,
- CHANGELOG_MSG_UNLINK_OP_FAILED,
- CHANGELOG_MSG_DETECT_EMPTY_CHANGELOG_FAILED,
- CHANGELOG_MSG_READLINK_OP_FAILED,
- CHANGELOG_MSG_EXPLICIT_ROLLOVER_FAILED
-);
+GLFS_MSGID(
+ CHANGELOG, CHANGELOG_MSG_OPEN_FAILED, CHANGELOG_MSG_NO_MEMORY,
+ CHANGELOG_MSG_VOL_MISCONFIGURED, CHANGELOG_MSG_RENAME_ERROR,
+ CHANGELOG_MSG_READ_ERROR, CHANGELOG_MSG_HTIME_ERROR,
+ CHANGELOG_MSG_PTHREAD_MUTEX_INIT_FAILED,
+ CHANGELOG_MSG_PTHREAD_COND_INIT_FAILED, CHANGELOG_MSG_CHILD_MISCONFIGURED,
+ CHANGELOG_MSG_DIR_OPTIONS_NOT_SET, CHANGELOG_MSG_CLOSE_ERROR,
+ CHANGELOG_MSG_PIPE_CREATION_ERROR, CHANGELOG_MSG_DICT_GET_FAILED,
+ CHANGELOG_MSG_BARRIER_INFO, CHANGELOG_MSG_BARRIER_ERROR,
+ CHANGELOG_MSG_GET_TIME_OP_FAILED, CHANGELOG_MSG_WRITE_FAILED,
+ CHANGELOG_MSG_PTHREAD_ERROR, CHANGELOG_MSG_INODE_NOT_FOUND,
+ CHANGELOG_MSG_FSYNC_OP_FAILED, CHANGELOG_MSG_TOTAL_LOG_INFO,
+ CHANGELOG_MSG_SNAP_INFO, CHANGELOG_MSG_SELECT_FAILED,
+ CHANGELOG_MSG_FCNTL_FAILED, CHANGELOG_MSG_BNOTIFY_INFO,
+ CHANGELOG_MSG_ENTRY_BUF_INFO, CHANGELOG_MSG_NOT_ACTIVE,
+ CHANGELOG_MSG_LOCAL_INIT_FAILED, CHANGELOG_MSG_NOTIFY_REGISTER_FAILED,
+ CHANGELOG_MSG_PROGRAM_NAME_REG_FAILED, CHANGELOG_MSG_HANDLE_PROBE_ERROR,
+ CHANGELOG_MSG_SET_FD_CONTEXT, CHANGELOG_MSG_FREEUP_FAILED,
+ CHANGELOG_MSG_HTIME_INFO, CHANGELOG_MSG_RPC_SUBMIT_REPLY_FAILED,
+ CHANGELOG_MSG_RPC_BUILD_ERROR, CHANGELOG_MSG_RPC_CONNECT_ERROR,
+ CHANGELOG_MSG_RPC_START_ERROR, CHANGELOG_MSG_BUFFER_STARVATION_ERROR,
+ CHANGELOG_MSG_SCAN_DIR_FAILED, CHANGELOG_MSG_FSETXATTR_FAILED,
+ CHANGELOG_MSG_FGETXATTR_FAILED, CHANGELOG_MSG_CLEANUP_ON_ACTIVE_REF,
+ CHANGELOG_MSG_DISPATCH_EVENT_FAILED, CHANGELOG_MSG_PUT_BUFFER_FAILED,
+ CHANGELOG_MSG_PTHREAD_COND_WAIT_FAILED, CHANGELOG_MSG_PTHREAD_CANCEL_FAILED,
+ CHANGELOG_MSG_INJECT_FSYNC_FAILED, CHANGELOG_MSG_CREATE_FRAME_FAILED,
+ CHANGELOG_MSG_FSTAT_OP_FAILED, CHANGELOG_MSG_LSEEK_OP_FAILED,
+ CHANGELOG_MSG_STRSTR_OP_FAILED, CHANGELOG_MSG_UNLINK_OP_FAILED,
+ CHANGELOG_MSG_DETECT_EMPTY_CHANGELOG_FAILED,
+ CHANGELOG_MSG_READLINK_OP_FAILED, CHANGELOG_MSG_EXPLICIT_ROLLOVER_FAILED);
#endif /* !_CHANGELOG_MESSAGES_H_ */
diff --git a/xlators/features/changelog/src/changelog-misc.h b/xlators/features/changelog/src/changelog-misc.h
index e96533f7365..04d1bdeba03 100644
--- a/xlators/features/changelog/src/changelog-misc.h
+++ b/xlators/features/changelog/src/changelog-misc.h
@@ -14,7 +14,7 @@
#include "glusterfs.h"
#include "common-utils.h"
-#define CHANGELOG_MAX_TYPE 4
+#define CHANGELOG_MAX_TYPE 4
#define CHANGELOG_FILE_NAME "CHANGELOG"
#define HTIME_FILE_NAME "HTIME"
#define CSNAP_FILE_NAME "CHANGELOG.SNAP"
@@ -22,111 +22,110 @@
#define HTIME_CURRENT "trusted.glusterfs.current_htime"
#define HTIME_INITIAL_VALUE "0:0"
-#define CHANGELOG_VERSION_MAJOR 1
-#define CHANGELOG_VERSION_MINOR 2
+#define CHANGELOG_VERSION_MAJOR 1
+#define CHANGELOG_VERSION_MINOR 2
-#define CHANGELOG_UNIX_SOCK DEFAULT_VAR_RUN_DIRECTORY"/changelog-%s.sock"
-#define CHANGELOG_TMP_UNIX_SOCK DEFAULT_VAR_RUN_DIRECTORY"/.%s%lu.sock"
+#define CHANGELOG_UNIX_SOCK DEFAULT_VAR_RUN_DIRECTORY "/changelog-%s.sock"
+#define CHANGELOG_TMP_UNIX_SOCK DEFAULT_VAR_RUN_DIRECTORY "/.%s%lu.sock"
/**
* header starts with the version and the format of the changelog.
* 'version' not much of a use now.
*/
-#define CHANGELOG_HEADER \
- "GlusterFS Changelog | version: v%d.%d | encoding : %d\n"
-
-#define CHANGELOG_MAKE_SOCKET_PATH(brick_path, sockpath, len) do { \
- char xxh64[GF_XXH64_DIGEST_LENGTH*2+1] = {0,}; \
- gf_xxh64_wrapper ((unsigned char *)brick_path, \
- strlen(brick_path), \
- GF_XXHSUM64_DEFAULT_SEED, xxh64); \
- (void) snprintf (sockpath, len, \
- CHANGELOG_UNIX_SOCK, xxh64); \
- } while (0)
-
-#define CHANGELOG_MAKE_TMP_SOCKET_PATH(brick_path, sockpath, len) do { \
- unsigned long pid = 0; \
- char xxh64[GF_XXH64_DIGEST_LENGTH*2+1] = {0,}; \
- pid = (unsigned long) getpid (); \
- gf_xxh64_wrapper ((unsigned char *)brick_path, \
- strlen(brick_path), \
- GF_XXHSUM64_DEFAULT_SEED, xxh64); \
- (void) snprintf (sockpath, \
- len, CHANGELOG_TMP_UNIX_SOCK, \
- xxh64, pid); \
- } while (0)
-
+#define CHANGELOG_HEADER \
+ "GlusterFS Changelog | version: v%d.%d | encoding : %d\n"
+
+#define CHANGELOG_MAKE_SOCKET_PATH(brick_path, sockpath, len) \
+ do { \
+ char xxh64[GF_XXH64_DIGEST_LENGTH * 2 + 1] = { \
+ 0, \
+ }; \
+ gf_xxh64_wrapper((unsigned char *)brick_path, strlen(brick_path), \
+ GF_XXHSUM64_DEFAULT_SEED, xxh64); \
+ (void)snprintf(sockpath, len, CHANGELOG_UNIX_SOCK, xxh64); \
+ } while (0)
+
+#define CHANGELOG_MAKE_TMP_SOCKET_PATH(brick_path, sockpath, len) \
+ do { \
+ unsigned long pid = 0; \
+ char xxh64[GF_XXH64_DIGEST_LENGTH * 2 + 1] = { \
+ 0, \
+ }; \
+ pid = (unsigned long)getpid(); \
+ gf_xxh64_wrapper((unsigned char *)brick_path, strlen(brick_path), \
+ GF_XXHSUM64_DEFAULT_SEED, xxh64); \
+ (void)snprintf(sockpath, len, CHANGELOG_TMP_UNIX_SOCK, xxh64, pid); \
+ } while (0)
/**
* ... used by libgfchangelog.
*/
-#define CHANGELOG_GET_HEADER_INFO(fd, buffer, len, enc, maj, min, elen) do { \
- FILE *fp; \
- int fd_dup; \
- \
- enc = -1; \
- maj = -1; \
- min = -1; \
- fd_dup = dup (fd); \
- \
- if (fd_dup != -1) { \
- fp = fdopen (fd_dup, "r"); \
- if (fp) { \
- if (fgets (buffer, len, fp)) { \
- elen = strlen (buffer); \
- sscanf (buffer, \
- CHANGELOG_HEADER, \
- &maj, &min, &enc); \
- } \
- fclose (fp); \
- } else { \
- sys_close (fd_dup); \
- } \
- } \
- } while (0)
-
-#define CHANGELOG_FILL_HTIME_DIR(changelog_dir, path) do { \
- snprintf (path, sizeof (path), "%s/htime", \
- changelog_dir); \
- } while(0)
-
-#define CHANGELOG_FILL_CSNAP_DIR(changelog_dir, path) do { \
- snprintf (path, sizeof (path), "%s/csnap", \
- changelog_dir); \
- } while(0)
+#define CHANGELOG_GET_HEADER_INFO(fd, buffer, len, enc, maj, min, elen) \
+ do { \
+ FILE *fp; \
+ int fd_dup; \
+ \
+ enc = -1; \
+ maj = -1; \
+ min = -1; \
+ fd_dup = dup(fd); \
+ \
+ if (fd_dup != -1) { \
+ fp = fdopen(fd_dup, "r"); \
+ if (fp) { \
+ if (fgets(buffer, len, fp)) { \
+ elen = strlen(buffer); \
+ sscanf(buffer, CHANGELOG_HEADER, &maj, &min, &enc); \
+ } \
+ fclose(fp); \
+ } else { \
+ sys_close(fd_dup); \
+ } \
+ } \
+ } while (0)
+
+#define CHANGELOG_FILL_HTIME_DIR(changelog_dir, path) \
+ do { \
+ snprintf(path, sizeof(path), "%s/htime", changelog_dir); \
+ } while (0)
+
+#define CHANGELOG_FILL_CSNAP_DIR(changelog_dir, path) \
+ do { \
+ snprintf(path, sizeof(path), "%s/csnap", changelog_dir); \
+ } while (0)
/**
* everything after 'CHANGELOG_TYPE_METADATA_XATTR' are internal types
* (ie. none of the fops trigger this type of event), hence
* CHANGELOG_MAX_TYPE = 4
*/
typedef enum {
- CHANGELOG_TYPE_DATA = 0,
- CHANGELOG_TYPE_METADATA,
- CHANGELOG_TYPE_ENTRY,
- CHANGELOG_TYPE_METADATA_XATTR,
- CHANGELOG_TYPE_ROLLOVER,
- CHANGELOG_TYPE_FSYNC,
+ CHANGELOG_TYPE_DATA = 0,
+ CHANGELOG_TYPE_METADATA,
+ CHANGELOG_TYPE_ENTRY,
+ CHANGELOG_TYPE_METADATA_XATTR,
+ CHANGELOG_TYPE_ROLLOVER,
+ CHANGELOG_TYPE_FSYNC,
} changelog_log_type;
/* operation modes - RT for now */
typedef enum {
- CHANGELOG_MODE_RT = 0,
+ CHANGELOG_MODE_RT = 0,
} changelog_mode_t;
/* encoder types */
typedef enum {
- CHANGELOG_ENCODE_MIN = 0,
- CHANGELOG_ENCODE_BINARY,
- CHANGELOG_ENCODE_ASCII,
- CHANGELOG_ENCODE_MAX,
+ CHANGELOG_ENCODE_MIN = 0,
+ CHANGELOG_ENCODE_BINARY,
+ CHANGELOG_ENCODE_ASCII,
+ CHANGELOG_ENCODE_MAX,
} changelog_encoder_t;
-#define CHANGELOG_VALID_ENCODING(enc) \
- (enc > CHANGELOG_ENCODE_MIN && enc < CHANGELOG_ENCODE_MAX)
+#define CHANGELOG_VALID_ENCODING(enc) \
+ (enc > CHANGELOG_ENCODE_MIN && enc < CHANGELOG_ENCODE_MAX)
-#define CHANGELOG_TYPE_IS_ENTRY(type) (type == CHANGELOG_TYPE_ENTRY)
-#define CHANGELOG_TYPE_IS_ROLLOVER(type) (type == CHANGELOG_TYPE_ROLLOVER)
-#define CHANGELOG_TYPE_IS_FSYNC(type) (type == CHANGELOG_TYPE_FSYNC)
+#define CHANGELOG_TYPE_IS_ENTRY(type) (type == CHANGELOG_TYPE_ENTRY)
+#define CHANGELOG_TYPE_IS_ROLLOVER(type) (type == CHANGELOG_TYPE_ROLLOVER)
+#define CHANGELOG_TYPE_IS_FSYNC(type) (type == CHANGELOG_TYPE_FSYNC)
#endif /* _CHANGELOG_MISC_H */
diff --git a/xlators/features/changelog/src/changelog-rpc-common.h b/xlators/features/changelog/src/changelog-rpc-common.h
index 1a630536924..2d3f06e60c0 100644
--- a/xlators/features/changelog/src/changelog-rpc-common.h
+++ b/xlators/features/changelog/src/changelog-rpc-common.h
@@ -24,61 +24,62 @@
/**
* Let's keep this non-configurable for now.
*/
-#define NR_ROTT_BUFFS 4
+#define NR_ROTT_BUFFS 4
#define NR_DISPATCHERS (NR_ROTT_BUFFS - 1)
enum changelog_rpc_procnum {
- CHANGELOG_RPC_PROC_NULL = 0,
- CHANGELOG_RPC_PROBE_FILTER = 1,
- CHANGELOG_RPC_PROC_MAX = 2,
+ CHANGELOG_RPC_PROC_NULL = 0,
+ CHANGELOG_RPC_PROBE_FILTER = 1,
+ CHANGELOG_RPC_PROC_MAX = 2,
};
-#define CHANGELOG_RPC_PROGNUM 1885957735
-#define CHANGELOG_RPC_PROGVER 1
+#define CHANGELOG_RPC_PROGNUM 1885957735
+#define CHANGELOG_RPC_PROGVER 1
/**
* reverse connection: data xfer path
*/
enum changelog_reverse_rpc_procnum {
- CHANGELOG_REV_PROC_NULL = 0,
- CHANGELOG_REV_PROC_EVENT = 1,
- CHANGELOG_REV_PROC_MAX = 2,
+ CHANGELOG_REV_PROC_NULL = 0,
+ CHANGELOG_REV_PROC_EVENT = 1,
+ CHANGELOG_REV_PROC_MAX = 2,
};
-#define CHANGELOG_REV_RPC_PROCNUM 1886350951
-#define CHANGELOG_REV_RPC_PROCVER 1
+#define CHANGELOG_REV_RPC_PROCNUM 1886350951
+#define CHANGELOG_REV_RPC_PROCVER 1
typedef struct changelog_rpc {
- rpcsvc_t *svc;
- struct rpc_clnt *rpc;
- char sock[UNIX_PATH_MAX]; /* tied to server */
+ rpcsvc_t *svc;
+ struct rpc_clnt *rpc;
+ char sock[UNIX_PATH_MAX]; /* tied to server */
} changelog_rpc_t;
/* event poller */
-void *changelog_rpc_poller (void *);
+void *
+changelog_rpc_poller(void *);
/* CLIENT API */
struct rpc_clnt *
-changelog_rpc_client_init (xlator_t *, void *, char *, rpc_clnt_notify_t);
+changelog_rpc_client_init(xlator_t *, void *, char *, rpc_clnt_notify_t);
int
-changelog_rpc_sumbit_req (struct rpc_clnt *, void *, call_frame_t *,
- rpc_clnt_prog_t *, int , struct iovec *, int,
- struct iobref *, xlator_t *, fop_cbk_fn_t, xdrproc_t);
+changelog_rpc_sumbit_req(struct rpc_clnt *, void *, call_frame_t *,
+ rpc_clnt_prog_t *, int, struct iovec *, int,
+ struct iobref *, xlator_t *, fop_cbk_fn_t, xdrproc_t);
int
-changelog_invoke_rpc (xlator_t *, struct rpc_clnt *,
- rpc_clnt_prog_t *, int , void *);
+changelog_invoke_rpc(xlator_t *, struct rpc_clnt *, rpc_clnt_prog_t *, int,
+ void *);
/* SERVER API */
int
-changelog_rpc_sumbit_reply (rpcsvc_request_t *, void *,
- struct iovec *, int, struct iobref *, xdrproc_t);
+changelog_rpc_sumbit_reply(rpcsvc_request_t *, void *, struct iovec *, int,
+ struct iobref *, xdrproc_t);
rpcsvc_t *
-changelog_rpc_server_init (xlator_t *, char *, void*,
- rpcsvc_notify_t, struct rpcsvc_program **);
+changelog_rpc_server_init(xlator_t *, char *, void *, rpcsvc_notify_t,
+ struct rpcsvc_program **);
void
-changelog_rpc_server_destroy (xlator_t *, rpcsvc_t *, char *,
- rpcsvc_notify_t, struct rpcsvc_program **);
+changelog_rpc_server_destroy(xlator_t *, rpcsvc_t *, char *, rpcsvc_notify_t,
+ struct rpcsvc_program **);
#endif
diff --git a/xlators/features/changelog/src/changelog-rpc.h b/xlators/features/changelog/src/changelog-rpc.h
index 9f1e2d223a3..8002cea5091 100644
--- a/xlators/features/changelog/src/changelog-rpc.h
+++ b/xlators/features/changelog/src/changelog-rpc.h
@@ -18,14 +18,14 @@
#include "socket.h"
#include "changelog-rpc-common.h"
-#define CHANGELOG_RPC_PROGNAME "GlusterFS Changelog"
+#define CHANGELOG_RPC_PROGNAME "GlusterFS Changelog"
rpcsvc_t *
-changelog_init_rpc_listener (xlator_t *, changelog_priv_t *, rbuf_t *, int);
+changelog_init_rpc_listener(xlator_t *, changelog_priv_t *, rbuf_t *, int);
void
-changelog_destroy_rpc_listner (xlator_t *, changelog_priv_t *);
+changelog_destroy_rpc_listner(xlator_t *, changelog_priv_t *);
int
-changelog_cleanup_rpc_threads (xlator_t *this, changelog_priv_t *priv);
+changelog_cleanup_rpc_threads(xlator_t *this, changelog_priv_t *priv);
#endif
diff --git a/xlators/features/changelog/src/changelog-rt.h b/xlators/features/changelog/src/changelog-rt.h
index 1fc2bbc5bb9..df0d5b03487 100644
--- a/xlators/features/changelog/src/changelog-rt.h
+++ b/xlators/features/changelog/src/changelog-rt.h
@@ -19,15 +19,15 @@
/* unused as of now - may be you would need it later */
typedef struct changelog_rt {
- gf_lock_t lock;
+ gf_lock_t lock;
} changelog_rt_t;
int
-changelog_rt_init (xlator_t *this, changelog_dispatcher_t *cd);
+changelog_rt_init(xlator_t *this, changelog_dispatcher_t *cd);
int
-changelog_rt_fini (xlator_t *this, changelog_dispatcher_t *cd);
+changelog_rt_fini(xlator_t *this, changelog_dispatcher_t *cd);
int
-changelog_rt_enqueue (xlator_t *this, changelog_priv_t *priv, void *cbatch,
- changelog_log_data_t *cld_0, changelog_log_data_t *cld_1);
+changelog_rt_enqueue(xlator_t *this, changelog_priv_t *priv, void *cbatch,
+ changelog_log_data_t *cld_0, changelog_log_data_t *cld_1);
#endif /* _CHANGELOG_RT_H */
diff --git a/xlators/features/changetimerecorder/src/ctr-helper.h b/xlators/features/changetimerecorder/src/ctr-helper.h
index f821201d3a5..3268c9d2fb9 100644
--- a/xlators/features/changetimerecorder/src/ctr-helper.h
+++ b/xlators/features/changetimerecorder/src/ctr-helper.h
@@ -11,7 +11,6 @@
#ifndef __CTR_HELPER_H
#define __CTR_HELPER_H
-
#include "xlator.h"
#include "ctr_mem_types.h"
#include "iatt.h"
@@ -28,37 +27,34 @@
#include "ctr-xlator-ctx.h"
#include "ctr-messages.h"
-#define CTR_DEFAULT_HARDLINK_EXP_PERIOD 300 /* Five mins */
-#define CTR_DEFAULT_INODE_EXP_PERIOD 300 /* Five mins */
-
+#define CTR_DEFAULT_HARDLINK_EXP_PERIOD 300 /* Five mins */
+#define CTR_DEFAULT_INODE_EXP_PERIOD 300 /* Five mins */
typedef struct ctr_query_cbk_args {
- int query_fd;
- int count;
+ int query_fd;
+ int count;
} ctr_query_cbk_args_t;
-
/*CTR Xlator Private structure*/
typedef struct gf_ctr_private {
- gf_boolean_t enabled;
- char *ctr_db_path;
- gf_boolean_t ctr_hot_brick;
- gf_boolean_t ctr_record_wind;
- gf_boolean_t ctr_record_unwind;
- gf_boolean_t ctr_record_counter;
- gf_boolean_t ctr_record_metadata_heat;
- gf_boolean_t ctr_link_consistency;
- gfdb_db_type_t gfdb_db_type;
- gfdb_sync_type_t gfdb_sync_type;
- gfdb_conn_node_t *_db_conn;
- uint64_t ctr_lookupheal_link_timeout;
- uint64_t ctr_lookupheal_inode_timeout;
- gf_boolean_t compact_active;
- gf_boolean_t compact_mode_switched;
- pthread_mutex_t compact_lock;
+ gf_boolean_t enabled;
+ char *ctr_db_path;
+ gf_boolean_t ctr_hot_brick;
+ gf_boolean_t ctr_record_wind;
+ gf_boolean_t ctr_record_unwind;
+ gf_boolean_t ctr_record_counter;
+ gf_boolean_t ctr_record_metadata_heat;
+ gf_boolean_t ctr_link_consistency;
+ gfdb_db_type_t gfdb_db_type;
+ gfdb_sync_type_t gfdb_sync_type;
+ gfdb_conn_node_t *_db_conn;
+ uint64_t ctr_lookupheal_link_timeout;
+ uint64_t ctr_lookupheal_inode_timeout;
+ gf_boolean_t compact_active;
+ gf_boolean_t compact_mode_switched;
+ pthread_mutex_t compact_lock;
} gf_ctr_private_t;
-
/*
* gf_ctr_local_t is the ctr xlator local data structure that is stored in
* the call_frame of each FOP.
@@ -76,67 +72,63 @@ typedef struct gf_ctr_private {
* but currently we record only file inode information.
*
* is_internal_fop in gf_ctr_local will tell us if this is a internal fop and
- * take special/no action. We don't record change/access times or increement heat
- * counter for internal fops from rebalancer.
+ * take special/no action. We don't record change/access times or increement
+ * heat counter for internal fops from rebalancer.
* */
typedef struct gf_ctr_local {
- gfdb_db_record_t gfdb_db_record;
- ia_type_t ia_inode_type;
- gf_boolean_t is_internal_fop;
- gf_special_pid_t client_pid;
+ gfdb_db_record_t gfdb_db_record;
+ ia_type_t ia_inode_type;
+ gf_boolean_t is_internal_fop;
+ gf_special_pid_t client_pid;
} gf_ctr_local_t;
/*
* Easy access of gfdb_db_record of ctr_local
* */
-#define CTR_DB_REC(ctr_local)\
- (ctr_local->gfdb_db_record)
+#define CTR_DB_REC(ctr_local) (ctr_local->gfdb_db_record)
/*Clear db record*/
-#define CLEAR_CTR_DB_RECORD(ctr_local)\
-do {\
- ctr_local->gfdb_db_record.gfdb_fop_path = GFDB_FOP_INVALID;\
- memset(&(ctr_local->gfdb_db_record.gfdb_wind_change_time),\
- 0, sizeof(gfdb_time_t));\
- memset(&(ctr_local->gfdb_db_record.gfdb_unwind_change_time),\
- 0, sizeof(gfdb_time_t));\
- gf_uuid_clear (ctr_local->gfdb_db_record.gfid);\
- gf_uuid_clear (ctr_local->gfdb_db_record.pargfid);\
- memset(ctr_local->gfdb_db_record.file_name, 0, GF_NAME_MAX + 1);\
- memset(ctr_local->gfdb_db_record.old_file_name, 0, GF_NAME_MAX + 1);\
- ctr_local->gfdb_db_record.gfdb_fop_type = GFDB_FOP_INVALID_OP;\
- ctr_local->ia_inode_type = IA_INVAL;\
-} while (0)
-
+#define CLEAR_CTR_DB_RECORD(ctr_local) \
+ do { \
+ ctr_local->gfdb_db_record.gfdb_fop_path = GFDB_FOP_INVALID; \
+ memset(&(ctr_local->gfdb_db_record.gfdb_wind_change_time), 0, \
+ sizeof(gfdb_time_t)); \
+ memset(&(ctr_local->gfdb_db_record.gfdb_unwind_change_time), 0, \
+ sizeof(gfdb_time_t)); \
+ gf_uuid_clear(ctr_local->gfdb_db_record.gfid); \
+ gf_uuid_clear(ctr_local->gfdb_db_record.pargfid); \
+ memset(ctr_local->gfdb_db_record.file_name, 0, GF_NAME_MAX + 1); \
+ memset(ctr_local->gfdb_db_record.old_file_name, 0, GF_NAME_MAX + 1); \
+ ctr_local->gfdb_db_record.gfdb_fop_type = GFDB_FOP_INVALID_OP; \
+ ctr_local->ia_inode_type = IA_INVAL; \
+ } while (0)
static gf_ctr_local_t *
-init_ctr_local_t (xlator_t *this) {
+init_ctr_local_t(xlator_t *this)
+{
+ gf_ctr_local_t *ctr_local = NULL;
- gf_ctr_local_t *ctr_local = NULL;
+ GF_ASSERT(this);
- GF_ASSERT(this);
+ ctr_local = mem_get0(this->local_pool);
+ if (!ctr_local) {
+ gf_msg(GFDB_DATA_STORE, GF_LOG_ERROR, 0,
+ CTR_MSG_CREATE_CTR_LOCAL_ERROR_WIND,
+ "Error while creating ctr local");
+ goto out;
+ }
- ctr_local = mem_get0 (this->local_pool);
- if (!ctr_local) {
- gf_msg (GFDB_DATA_STORE, GF_LOG_ERROR, 0,
- CTR_MSG_CREATE_CTR_LOCAL_ERROR_WIND,
- "Error while creating ctr local");
- goto out;
- }
-
- CLEAR_CTR_DB_RECORD (ctr_local);
+ CLEAR_CTR_DB_RECORD(ctr_local);
out:
- return ctr_local;
+ return ctr_local;
}
static void
-free_ctr_local (gf_ctr_local_t *ctr_local)
+free_ctr_local(gf_ctr_local_t *ctr_local)
{
- if (ctr_local)
- mem_put (ctr_local);
+ if (ctr_local)
+ mem_put(ctr_local);
}
-
-
/******************************************************************************
*
*
@@ -159,94 +151,85 @@ free_ctr_local (gf_ctr_local_t *ctr_local)
*
* */
- /*Context Carrier Structure for hard links*/
+/*Context Carrier Structure for hard links*/
typedef struct gf_ctr_link_context {
- uuid_t *pargfid;
- const char *basename;
+ uuid_t *pargfid;
+ const char *basename;
} gf_ctr_link_context_t;
- /*Context Carrier Structure for inodes*/
+/*Context Carrier Structure for inodes*/
typedef struct gf_ctr_inode_context {
- ia_type_t ia_type;
- uuid_t *gfid;
- uuid_t *old_gfid;
- gf_ctr_link_context_t *new_link_cx;
- gf_ctr_link_context_t *old_link_cx;
- gfdb_fop_type_t fop_type;
- gfdb_fop_path_t fop_path;
- gf_boolean_t is_internal_fop;
- /* Indicating metadata fops */
- gf_boolean_t is_metadata_fop;
+ ia_type_t ia_type;
+ uuid_t *gfid;
+ uuid_t *old_gfid;
+ gf_ctr_link_context_t *new_link_cx;
+ gf_ctr_link_context_t *old_link_cx;
+ gfdb_fop_type_t fop_type;
+ gfdb_fop_path_t fop_path;
+ gf_boolean_t is_internal_fop;
+ /* Indicating metadata fops */
+ gf_boolean_t is_metadata_fop;
} gf_ctr_inode_context_t;
-
/*******************Util Macros for Context Carrier Structures*****************/
/*Checks if ctr_link_cx is sane!*/
-#define IS_CTR_LINK_CX_SANE(ctr_link_cx)\
-do {\
- if (ctr_link_cx) {\
- if (ctr_link_cx->pargfid)\
- GF_ASSERT (*(ctr_link_cx->pargfid));\
- GF_ASSERT (ctr_link_cx->basename);\
- };\
-} while (0)
+#define IS_CTR_LINK_CX_SANE(ctr_link_cx) \
+ do { \
+ if (ctr_link_cx) { \
+ if (ctr_link_cx->pargfid) \
+ GF_ASSERT(*(ctr_link_cx->pargfid)); \
+ GF_ASSERT(ctr_link_cx->basename); \
+ }; \
+ } while (0)
/*Clear and fill the ctr_link_context with values*/
-#define FILL_CTR_LINK_CX(ctr_link_cx, _pargfid, _basename, label)\
-do {\
- GF_VALIDATE_OR_GOTO ("ctr", ctr_link_cx, label);\
- GF_VALIDATE_OR_GOTO ("ctr", _pargfid, label);\
- GF_VALIDATE_OR_GOTO ("ctr", _basename, label);\
- memset (ctr_link_cx, 0, sizeof (*ctr_link_cx));\
- ctr_link_cx->pargfid = &_pargfid;\
- ctr_link_cx->basename = _basename;\
-} while (0)
-
-#define NEW_LINK_CX(ctr_inode_cx)\
- ctr_inode_cx->new_link_cx\
-
-#define OLD_LINK_CX(ctr_inode_cx)\
- ctr_inode_cx->old_link_cx\
+#define FILL_CTR_LINK_CX(ctr_link_cx, _pargfid, _basename, label) \
+ do { \
+ GF_VALIDATE_OR_GOTO("ctr", ctr_link_cx, label); \
+ GF_VALIDATE_OR_GOTO("ctr", _pargfid, label); \
+ GF_VALIDATE_OR_GOTO("ctr", _basename, label); \
+ memset(ctr_link_cx, 0, sizeof(*ctr_link_cx)); \
+ ctr_link_cx->pargfid = &_pargfid; \
+ ctr_link_cx->basename = _basename; \
+ } while (0)
+
+#define NEW_LINK_CX(ctr_inode_cx) ctr_inode_cx->new_link_cx
+
+#define OLD_LINK_CX(ctr_inode_cx) ctr_inode_cx->old_link_cx
/*Checks if ctr_inode_cx is sane!*/
-#define IS_CTR_INODE_CX_SANE(ctr_inode_cx)\
-do {\
- GF_ASSERT (ctr_inode_cx);\
- GF_ASSERT (ctr_inode_cx->gfid);\
- GF_ASSERT (*(ctr_inode_cx->gfid));\
- GF_ASSERT (ctr_inode_cx->fop_type != GFDB_FOP_INVALID_OP);\
- GF_ASSERT (ctr_inode_cx->fop_path != GFDB_FOP_INVALID);\
- IS_CTR_LINK_CX_SANE (NEW_LINK_CX(ctr_inode_cx));\
- IS_CTR_LINK_CX_SANE (OLD_LINK_CX(ctr_inode_cx));\
-} while (0)
+#define IS_CTR_INODE_CX_SANE(ctr_inode_cx) \
+ do { \
+ GF_ASSERT(ctr_inode_cx); \
+ GF_ASSERT(ctr_inode_cx->gfid); \
+ GF_ASSERT(*(ctr_inode_cx->gfid)); \
+ GF_ASSERT(ctr_inode_cx->fop_type != GFDB_FOP_INVALID_OP); \
+ GF_ASSERT(ctr_inode_cx->fop_path != GFDB_FOP_INVALID); \
+ IS_CTR_LINK_CX_SANE(NEW_LINK_CX(ctr_inode_cx)); \
+ IS_CTR_LINK_CX_SANE(OLD_LINK_CX(ctr_inode_cx)); \
+ } while (0)
/*Clear and fill the ctr_inode_context with values*/
-#define FILL_CTR_INODE_CONTEXT(ctr_inode_cx,\
- _ia_type,\
- _gfid,\
- _new_link_cx,\
- _old_link_cx,\
- _fop_type,\
- _fop_path)\
-do {\
- GF_ASSERT (ctr_inode_cx);\
- GF_ASSERT (_gfid);\
- GF_ASSERT (_fop_type != GFDB_FOP_INVALID_OP);\
- GF_ASSERT (_fop_path != GFDB_FOP_INVALID);\
- memset(ctr_inode_cx, 0, sizeof(*ctr_inode_cx));\
- ctr_inode_cx->ia_type = _ia_type;\
- ctr_inode_cx->gfid = &_gfid;\
- IS_CTR_LINK_CX_SANE(NEW_LINK_CX(ctr_inode_cx));\
- if (_new_link_cx)\
- NEW_LINK_CX(ctr_inode_cx) = _new_link_cx;\
- IS_CTR_LINK_CX_SANE(OLD_LINK_CX(ctr_inode_cx));\
- if (_old_link_cx)\
- OLD_LINK_CX(ctr_inode_cx) = _old_link_cx;\
- ctr_inode_cx->fop_type = _fop_type;\
- ctr_inode_cx->fop_path = _fop_path;\
-} while (0)
-
+#define FILL_CTR_INODE_CONTEXT(ctr_inode_cx, _ia_type, _gfid, _new_link_cx, \
+ _old_link_cx, _fop_type, _fop_path) \
+ do { \
+ GF_ASSERT(ctr_inode_cx); \
+ GF_ASSERT(_gfid); \
+ GF_ASSERT(_fop_type != GFDB_FOP_INVALID_OP); \
+ GF_ASSERT(_fop_path != GFDB_FOP_INVALID); \
+ memset(ctr_inode_cx, 0, sizeof(*ctr_inode_cx)); \
+ ctr_inode_cx->ia_type = _ia_type; \
+ ctr_inode_cx->gfid = &_gfid; \
+ IS_CTR_LINK_CX_SANE(NEW_LINK_CX(ctr_inode_cx)); \
+ if (_new_link_cx) \
+ NEW_LINK_CX(ctr_inode_cx) = _new_link_cx; \
+ IS_CTR_LINK_CX_SANE(OLD_LINK_CX(ctr_inode_cx)); \
+ if (_old_link_cx) \
+ OLD_LINK_CX(ctr_inode_cx) = _old_link_cx; \
+ ctr_inode_cx->fop_type = _fop_type; \
+ ctr_inode_cx->fop_path = _fop_path; \
+ } while (0)
/******************************************************************************
*
@@ -256,11 +239,12 @@ do {\
* ****************************************************************************/
/* Free ctr frame local */
static inline void
-ctr_free_frame_local (call_frame_t *frame) {
- if (frame) {
- free_ctr_local ((gf_ctr_local_t *) frame->local);
- frame->local = NULL;
- }
+ctr_free_frame_local(call_frame_t *frame)
+{
+ if (frame) {
+ free_ctr_local((gf_ctr_local_t *)frame->local);
+ frame->local = NULL;
+ }
}
/* Setting GF_REQUEST_LINK_COUNT_XDATA in dict
@@ -271,170 +255,161 @@ ctr_free_frame_local (call_frame_t *frame) {
* return -1 for failure.
* */
static inline int
-set_posix_link_request (xlator_t *this,
- dict_t **xdata)
+set_posix_link_request(xlator_t *this, dict_t **xdata)
{
- int ret = -1;
- gf_boolean_t is_created = _gf_false;
-
- GF_VALIDATE_OR_GOTO ("ctr", this, out);
- GF_VALIDATE_OR_GOTO (this->name, xdata, out);
-
- /*create xdata if NULL*/
- if (!*xdata) {
- *xdata = dict_new();
- is_created = _gf_true;
- ret = 1;
- } else {
- ret = 0;
- }
-
- if (!*xdata) {
- gf_msg (this->name, GF_LOG_ERROR, 0, CTR_MSG_XDATA_NULL,
- "xdata is NULL :Cannot send "
- "GF_REQUEST_LINK_COUNT_XDATA to posix");
- ret = -1;
- goto out;
- }
-
- ret = dict_set_int32 (*xdata, GF_REQUEST_LINK_COUNT_XDATA, 1);
- if (ret) {
- gf_msg (this->name, GF_LOG_ERROR, 0,
- CTR_MSG_SET_CTR_RESPONSE_LINK_COUNT_XDATA_FAILED,
- "Failed setting GF_REQUEST_LINK_COUNT_XDATA");
- ret = -1;
- goto out;
- }
+ int ret = -1;
+ gf_boolean_t is_created = _gf_false;
+
+ GF_VALIDATE_OR_GOTO("ctr", this, out);
+ GF_VALIDATE_OR_GOTO(this->name, xdata, out);
+
+ /*create xdata if NULL*/
+ if (!*xdata) {
+ *xdata = dict_new();
+ is_created = _gf_true;
+ ret = 1;
+ } else {
ret = 0;
+ }
+
+ if (!*xdata) {
+ gf_msg(this->name, GF_LOG_ERROR, 0, CTR_MSG_XDATA_NULL,
+ "xdata is NULL :Cannot send "
+ "GF_REQUEST_LINK_COUNT_XDATA to posix");
+ ret = -1;
+ goto out;
+ }
+
+ ret = dict_set_int32(*xdata, GF_REQUEST_LINK_COUNT_XDATA, 1);
+ if (ret) {
+ gf_msg(this->name, GF_LOG_ERROR, 0,
+ CTR_MSG_SET_CTR_RESPONSE_LINK_COUNT_XDATA_FAILED,
+ "Failed setting GF_REQUEST_LINK_COUNT_XDATA");
+ ret = -1;
+ goto out;
+ }
+ ret = 0;
out:
- if (ret == -1) {
- if (*xdata && is_created) {
- dict_unref (*xdata);
- }
+ if (ret == -1) {
+ if (*xdata && is_created) {
+ dict_unref(*xdata);
}
- return ret;
+ }
+ return ret;
}
-
/*
* If a bitrot fop
* */
-#define BITROT_FOP(frame)\
- (frame->root->pid == GF_CLIENT_PID_BITD ||\
- frame->root->pid == GF_CLIENT_PID_SCRUB)
-
+#define BITROT_FOP(frame) \
+ (frame->root->pid == GF_CLIENT_PID_BITD || \
+ frame->root->pid == GF_CLIENT_PID_SCRUB)
/*
* If a rebalancer fop
* */
-#define REBALANCE_FOP(frame)\
- (frame->root->pid == GF_CLIENT_PID_DEFRAG)
+#define REBALANCE_FOP(frame) (frame->root->pid == GF_CLIENT_PID_DEFRAG)
/*
* If its a tiering rebalancer fop
* */
-#define TIER_REBALANCE_FOP(frame)\
- (frame->root->pid == GF_CLIENT_PID_TIER_DEFRAG)
+#define TIER_REBALANCE_FOP(frame) \
+ (frame->root->pid == GF_CLIENT_PID_TIER_DEFRAG)
/*
* If its a AFR SELF HEAL
* */
- #define AFR_SELF_HEAL_FOP(frame)\
- (frame->root->pid == GF_CLIENT_PID_SELF_HEALD)
+#define AFR_SELF_HEAL_FOP(frame) (frame->root->pid == GF_CLIENT_PID_SELF_HEALD)
/*
* if a rebalancer fop goto
* */
-#define CTR_IF_REBALANCE_FOP_THEN_GOTO(frame, label)\
-do {\
- if (REBALANCE_FOP (frame))\
- goto label;\
-} while (0)
+#define CTR_IF_REBALANCE_FOP_THEN_GOTO(frame, label) \
+ do { \
+ if (REBALANCE_FOP(frame)) \
+ goto label; \
+ } while (0)
/*
* Internal fop
*
* */
static inline gf_boolean_t
-is_internal_fop (call_frame_t *frame,
- dict_t *xdata)
+is_internal_fop(call_frame_t *frame, dict_t *xdata)
{
- gf_boolean_t ret = _gf_false;
-
- GF_ASSERT(frame);
- GF_ASSERT(frame->root);
-
- if (AFR_SELF_HEAL_FOP (frame)) {
- ret = _gf_true;
- }
- if (BITROT_FOP (frame)) {
- ret = _gf_true;
- }
- if (REBALANCE_FOP (frame) || TIER_REBALANCE_FOP (frame)) {
- ret = _gf_true;
- if (xdata && dict_get (xdata, CTR_ATTACH_TIER_LOOKUP)) {
- ret = _gf_false;
- }
- }
- if (xdata && dict_get (xdata, GLUSTERFS_INTERNAL_FOP_KEY)) {
- ret = _gf_true;
+ gf_boolean_t ret = _gf_false;
+
+ GF_ASSERT(frame);
+ GF_ASSERT(frame->root);
+
+ if (AFR_SELF_HEAL_FOP(frame)) {
+ ret = _gf_true;
+ }
+ if (BITROT_FOP(frame)) {
+ ret = _gf_true;
+ }
+ if (REBALANCE_FOP(frame) || TIER_REBALANCE_FOP(frame)) {
+ ret = _gf_true;
+ if (xdata && dict_get(xdata, CTR_ATTACH_TIER_LOOKUP)) {
+ ret = _gf_false;
}
+ }
+ if (xdata && dict_get(xdata, GLUSTERFS_INTERNAL_FOP_KEY)) {
+ ret = _gf_true;
+ }
- return ret;
+ return ret;
}
-#define CTR_IF_INTERNAL_FOP_THEN_GOTO(frame, dict, label)\
-do {\
- if (is_internal_fop (frame, dict)) \
- goto label; \
-} while (0)
+#define CTR_IF_INTERNAL_FOP_THEN_GOTO(frame, dict, label) \
+ do { \
+ if (is_internal_fop(frame, dict)) \
+ goto label; \
+ } while (0)
/* if fop has failed exit */
-#define CTR_IF_FOP_FAILED_THEN_GOTO(this, op_ret, op_errno, label)\
-do {\
- if (op_ret == -1) {\
- gf_msg_trace (this->name, 0, "Failed fop with %s",\
- strerror (op_errno));\
- goto label;\
- };\
-} while (0)
+#define CTR_IF_FOP_FAILED_THEN_GOTO(this, op_ret, op_errno, label) \
+ do { \
+ if (op_ret == -1) { \
+ gf_msg_trace(this->name, 0, "Failed fop with %s", \
+ strerror(op_errno)); \
+ goto label; \
+ }; \
+ } while (0)
/*
* IS CTR Xlator is disabled then goto to label
* */
- #define CTR_IS_DISABLED_THEN_GOTO(this, label)\
- do {\
- gf_ctr_private_t *_priv = NULL;\
- GF_ASSERT (this);\
- GF_ASSERT (this->private);\
- _priv = this->private;\
- if (!_priv->_db_conn)\
- goto label;\
- } while (0)
+#define CTR_IS_DISABLED_THEN_GOTO(this, label) \
+ do { \
+ gf_ctr_private_t *_priv = NULL; \
+ GF_ASSERT(this); \
+ GF_ASSERT(this->private); \
+ _priv = this->private; \
+ if (!_priv->_db_conn) \
+ goto label; \
+ } while (0)
/*
* IS CTR record metadata heat is disabled then goto to label
* */
- #define CTR_RECORD_METADATA_HEAT_IS_DISABLED_THEN_GOTO(this, label)\
- do {\
- gf_ctr_private_t *_priv = NULL;\
- GF_ASSERT (this);\
- GF_ASSERT (this->private);\
- _priv = this->private;\
- if (!_priv->ctr_record_metadata_heat)\
- goto label;\
- } while (0)
+#define CTR_RECORD_METADATA_HEAT_IS_DISABLED_THEN_GOTO(this, label) \
+ do { \
+ gf_ctr_private_t *_priv = NULL; \
+ GF_ASSERT(this); \
+ GF_ASSERT(this->private); \
+ _priv = this->private; \
+ if (!_priv->ctr_record_metadata_heat) \
+ goto label; \
+ } while (0)
int
-fill_db_record_for_unwind (xlator_t *this,
- gf_ctr_local_t *ctr_local,
- gfdb_fop_type_t fop_type,
- gfdb_fop_path_t fop_path);
+fill_db_record_for_unwind(xlator_t *this, gf_ctr_local_t *ctr_local,
+ gfdb_fop_type_t fop_type, gfdb_fop_path_t fop_path);
int
-fill_db_record_for_wind (xlator_t *this,
- gf_ctr_local_t *ctr_local,
- gf_ctr_inode_context_t *ctr_inode_cx);
+fill_db_record_for_wind(xlator_t *this, gf_ctr_local_t *ctr_local,
+ gf_ctr_inode_context_t *ctr_inode_cx);
/*******************************************************************************
* CTR INSERT WIND
@@ -445,116 +420,108 @@ fill_db_record_for_wind (xlator_t *this,
* ****************************************************************************/
static inline int
-ctr_insert_wind (call_frame_t *frame,
- xlator_t *this,
- gf_ctr_inode_context_t *ctr_inode_cx)
+ctr_insert_wind(call_frame_t *frame, xlator_t *this,
+ gf_ctr_inode_context_t *ctr_inode_cx)
{
- int ret = -1;
- gf_ctr_private_t *_priv = NULL;
- gf_ctr_local_t *ctr_local = NULL;
-
- GF_ASSERT(frame);
- GF_ASSERT(frame->root);
- GF_ASSERT(this);
- IS_CTR_INODE_CX_SANE(ctr_inode_cx);
-
- _priv = this->private;
- GF_ASSERT (_priv);
-
- GF_ASSERT(_priv->_db_conn);
-
- /*If record_wind option of CTR is on record wind for
- * regular files only*/
- if (_priv->ctr_record_wind && ctr_inode_cx->ia_type != IA_IFDIR) {
- frame->local = init_ctr_local_t (this);
- if (!frame->local) {
- gf_msg (this->name, GF_LOG_ERROR, 0,
- CTR_MSG_CREATE_CTR_LOCAL_ERROR_WIND,
- "WIND: Error while creating ctr local");
- goto out;
- };
- ctr_local = frame->local;
- ctr_local->client_pid = frame->root->pid;
- ctr_local->is_internal_fop = ctr_inode_cx->is_internal_fop;
-
- /* Decide whether to record counters or not */
- CTR_DB_REC(ctr_local).do_record_counters = _gf_false;
- /* If record counter is enabled */
- if (_priv->ctr_record_counter) {
- /* If not a internal fop */
- if (!(ctr_local->is_internal_fop)) {
- /* If its a metadata fop AND
- * record metadata heat
- * OR
- * its NOT a metadata fop */
- if ((ctr_inode_cx->is_metadata_fop
- && _priv->ctr_record_metadata_heat)
- ||
- (!ctr_inode_cx->is_metadata_fop)) {
- CTR_DB_REC(ctr_local).do_record_counters
- = _gf_true;
- }
- }
- }
-
- /* Decide whether to record times or not
- * For non internal FOPS record times as usual*/
- CTR_DB_REC(ctr_local).do_record_times = _gf_false;
- if (!ctr_local->is_internal_fop) {
- /* If its a metadata fop AND
- * record metadata heat
- * OR
- * its NOT a metadata fop */
- if ((ctr_inode_cx->is_metadata_fop &&
- _priv->ctr_record_metadata_heat)
- ||
- (!ctr_inode_cx->is_metadata_fop)) {
- CTR_DB_REC(ctr_local).do_record_times =
- (_priv->ctr_record_wind
- || _priv->ctr_record_unwind);
- }
- }
- /* when its a internal FOPS*/
- else {
- /* Record times only for create
- * i.e when the inode is created */
- CTR_DB_REC(ctr_local).do_record_times =
- (isdentrycreatefop(ctr_inode_cx->fop_type)) ?
- _gf_true : _gf_false;
- }
-
- /*Fill the db record for insertion*/
- ret = fill_db_record_for_wind (this, ctr_local, ctr_inode_cx);
- if (ret) {
- gf_msg (this->name, GF_LOG_ERROR, 0,
- CTR_MSG_FILL_CTR_LOCAL_ERROR_WIND,
- "WIND: Error filling ctr local");
- goto out;
+ int ret = -1;
+ gf_ctr_private_t *_priv = NULL;
+ gf_ctr_local_t *ctr_local = NULL;
+
+ GF_ASSERT(frame);
+ GF_ASSERT(frame->root);
+ GF_ASSERT(this);
+ IS_CTR_INODE_CX_SANE(ctr_inode_cx);
+
+ _priv = this->private;
+ GF_ASSERT(_priv);
+
+ GF_ASSERT(_priv->_db_conn);
+
+ /*If record_wind option of CTR is on record wind for
+ * regular files only*/
+ if (_priv->ctr_record_wind && ctr_inode_cx->ia_type != IA_IFDIR) {
+ frame->local = init_ctr_local_t(this);
+ if (!frame->local) {
+ gf_msg(this->name, GF_LOG_ERROR, 0,
+ CTR_MSG_CREATE_CTR_LOCAL_ERROR_WIND,
+ "WIND: Error while creating ctr local");
+ goto out;
+ };
+ ctr_local = frame->local;
+ ctr_local->client_pid = frame->root->pid;
+ ctr_local->is_internal_fop = ctr_inode_cx->is_internal_fop;
+
+ /* Decide whether to record counters or not */
+ CTR_DB_REC(ctr_local).do_record_counters = _gf_false;
+ /* If record counter is enabled */
+ if (_priv->ctr_record_counter) {
+ /* If not a internal fop */
+ if (!(ctr_local->is_internal_fop)) {
+ /* If its a metadata fop AND
+ * record metadata heat
+ * OR
+ * its NOT a metadata fop */
+ if ((ctr_inode_cx->is_metadata_fop &&
+ _priv->ctr_record_metadata_heat) ||
+ (!ctr_inode_cx->is_metadata_fop)) {
+ CTR_DB_REC(ctr_local).do_record_counters = _gf_true;
}
+ }
+ }
- /*Insert the db record*/
- ret = insert_record (_priv->_db_conn,
- &ctr_local->gfdb_db_record);
- if (ret) {
- gf_msg (this->name, GF_LOG_ERROR, 0,
- CTR_MSG_INSERT_RECORD_WIND_FAILED,
- "WIND: Inserting of record failed!");
- goto out;
- }
+ /* Decide whether to record times or not
+ * For non internal FOPS record times as usual*/
+ CTR_DB_REC(ctr_local).do_record_times = _gf_false;
+ if (!ctr_local->is_internal_fop) {
+ /* If its a metadata fop AND
+ * record metadata heat
+ * OR
+ * its NOT a metadata fop */
+ if ((ctr_inode_cx->is_metadata_fop &&
+ _priv->ctr_record_metadata_heat) ||
+ (!ctr_inode_cx->is_metadata_fop)) {
+ CTR_DB_REC(ctr_local).do_record_times =
+ (_priv->ctr_record_wind || _priv->ctr_record_unwind);
+ }
+ }
+ /* when its a internal FOPS*/
+ else {
+ /* Record times only for create
+ * i.e when the inode is created */
+ CTR_DB_REC(ctr_local).do_record_times = (isdentrycreatefop(
+ ctr_inode_cx->fop_type))
+ ? _gf_true
+ : _gf_false;
}
- ret = 0;
-out:
+ /*Fill the db record for insertion*/
+ ret = fill_db_record_for_wind(this, ctr_local, ctr_inode_cx);
if (ret) {
- free_ctr_local (ctr_local);
- frame->local = NULL;
+ gf_msg(this->name, GF_LOG_ERROR, 0,
+ CTR_MSG_FILL_CTR_LOCAL_ERROR_WIND,
+ "WIND: Error filling ctr local");
+ goto out;
}
- return ret;
-}
-
+ /*Insert the db record*/
+ ret = insert_record(_priv->_db_conn, &ctr_local->gfdb_db_record);
+ if (ret) {
+ gf_msg(this->name, GF_LOG_ERROR, 0,
+ CTR_MSG_INSERT_RECORD_WIND_FAILED,
+ "WIND: Inserting of record failed!");
+ goto out;
+ }
+ }
+ ret = 0;
+out:
+ if (ret) {
+ free_ctr_local(ctr_local);
+ frame->local = NULL;
+ }
+ return ret;
+}
/*******************************************************************************
* CTR INSERT UNWIND
@@ -564,168 +531,148 @@ out:
* call at the end.
* ****************************************************************************/
static inline int
-ctr_insert_unwind (call_frame_t *frame,
- xlator_t *this,
- gfdb_fop_type_t fop_type,
- gfdb_fop_path_t fop_path)
+ctr_insert_unwind(call_frame_t *frame, xlator_t *this, gfdb_fop_type_t fop_type,
+ gfdb_fop_path_t fop_path)
{
- int ret = -1;
- gf_ctr_private_t *_priv = NULL;
- gf_ctr_local_t *ctr_local = NULL;
-
- GF_ASSERT(frame);
- GF_ASSERT(this);
+ int ret = -1;
+ gf_ctr_private_t *_priv = NULL;
+ gf_ctr_local_t *ctr_local = NULL;
- _priv = this->private;
- GF_ASSERT (_priv);
+ GF_ASSERT(frame);
+ GF_ASSERT(this);
- GF_ASSERT(_priv->_db_conn);
+ _priv = this->private;
+ GF_ASSERT(_priv);
- ctr_local = frame->local;
+ GF_ASSERT(_priv->_db_conn);
- if (ctr_local
- && (_priv->ctr_record_unwind || isdentryfop(fop_type))
- && (ctr_local->ia_inode_type != IA_IFDIR)) {
+ ctr_local = frame->local;
- CTR_DB_REC(ctr_local).do_record_uwind_time =
- _priv->ctr_record_unwind;
+ if (ctr_local && (_priv->ctr_record_unwind || isdentryfop(fop_type)) &&
+ (ctr_local->ia_inode_type != IA_IFDIR)) {
+ CTR_DB_REC(ctr_local).do_record_uwind_time = _priv->ctr_record_unwind;
- ret = fill_db_record_for_unwind(this, ctr_local, fop_type,
- fop_path);
- if (ret == -1) {
- gf_msg(this->name, GF_LOG_ERROR, 0,
- CTR_MSG_FILL_CTR_LOCAL_ERROR_UNWIND,
- "UNWIND: Error filling ctr local");
- goto out;
- }
+ ret = fill_db_record_for_unwind(this, ctr_local, fop_type, fop_path);
+ if (ret == -1) {
+ gf_msg(this->name, GF_LOG_ERROR, 0,
+ CTR_MSG_FILL_CTR_LOCAL_ERROR_UNWIND,
+ "UNWIND: Error filling ctr local");
+ goto out;
+ }
- ret = insert_record(_priv->_db_conn,
- &ctr_local->gfdb_db_record);
- if (ret == -1) {
- gf_msg(this->name, GF_LOG_ERROR, 0,
- CTR_MSG_FILL_CTR_LOCAL_ERROR_UNWIND,
- "UNWIND: Error filling ctr local");
- goto out;
- }
+ ret = insert_record(_priv->_db_conn, &ctr_local->gfdb_db_record);
+ if (ret == -1) {
+ gf_msg(this->name, GF_LOG_ERROR, 0,
+ CTR_MSG_FILL_CTR_LOCAL_ERROR_UNWIND,
+ "UNWIND: Error filling ctr local");
+ goto out;
}
- ret = 0;
+ }
+ ret = 0;
out:
- return ret;
+ return ret;
}
/******************************************************************************
* Delete file/flink record/s from db
* ****************************************************************************/
static inline int
-ctr_delete_hard_link_from_db (xlator_t *this,
- uuid_t gfid,
- uuid_t pargfid,
- char *basename,
- gfdb_fop_type_t fop_type,
- gfdb_fop_path_t fop_path)
+ctr_delete_hard_link_from_db(xlator_t *this, uuid_t gfid, uuid_t pargfid,
+ char *basename, gfdb_fop_type_t fop_type,
+ gfdb_fop_path_t fop_path)
{
- int ret = -1;
- gfdb_db_record_t gfdb_db_record;
- gf_ctr_private_t *_priv = NULL;
-
- _priv = this->private;
- GF_VALIDATE_OR_GOTO (this->name, _priv, out);
- GF_VALIDATE_OR_GOTO (this->name, (!gf_uuid_is_null (gfid)), out);
- GF_VALIDATE_OR_GOTO (this->name, (!gf_uuid_is_null (pargfid)), out);
- GF_VALIDATE_OR_GOTO (this->name, (fop_type == GFDB_FOP_DENTRY_WRITE),
- out);
- GF_VALIDATE_OR_GOTO (this->name,
- (fop_path == GFDB_FOP_UNDEL || GFDB_FOP_UNDEL_ALL),
- out);
-
- /* Set gfdb_db_record to 0 */
- memset (&gfdb_db_record, 0, sizeof(gfdb_db_record));
-
- /* Copy basename */
- if (snprintf (gfdb_db_record.file_name, GF_NAME_MAX, "%s",
- basename) >= GF_NAME_MAX)
- goto out;
-
- /* Copy gfid into db record */
- gf_uuid_copy (gfdb_db_record.gfid, gfid);
-
- /* Copy pargid into db record */
- gf_uuid_copy (gfdb_db_record.pargfid, pargfid);
-
- gfdb_db_record.gfdb_fop_path = fop_path;
- gfdb_db_record.gfdb_fop_type = fop_type;
-
- /*send delete request to db*/
- ret = insert_record (_priv->_db_conn, &gfdb_db_record);
- if (ret) {
- gf_msg (this->name, GF_LOG_ERROR, 0,
- CTR_MSG_INSERT_RECORD_WIND_FAILED,
- "Failed to delete record. %s", basename);
- goto out;
- }
-
- ret = 0;
+ int ret = -1;
+ gfdb_db_record_t gfdb_db_record;
+ gf_ctr_private_t *_priv = NULL;
+
+ _priv = this->private;
+ GF_VALIDATE_OR_GOTO(this->name, _priv, out);
+ GF_VALIDATE_OR_GOTO(this->name, (!gf_uuid_is_null(gfid)), out);
+ GF_VALIDATE_OR_GOTO(this->name, (!gf_uuid_is_null(pargfid)), out);
+ GF_VALIDATE_OR_GOTO(this->name, (fop_type == GFDB_FOP_DENTRY_WRITE), out);
+ GF_VALIDATE_OR_GOTO(
+ this->name, (fop_path == GFDB_FOP_UNDEL || GFDB_FOP_UNDEL_ALL), out);
+
+ /* Set gfdb_db_record to 0 */
+ memset(&gfdb_db_record, 0, sizeof(gfdb_db_record));
+
+ /* Copy basename */
+ if (snprintf(gfdb_db_record.file_name, GF_NAME_MAX, "%s", basename) >=
+ GF_NAME_MAX)
+ goto out;
+
+ /* Copy gfid into db record */
+ gf_uuid_copy(gfdb_db_record.gfid, gfid);
+
+ /* Copy pargid into db record */
+ gf_uuid_copy(gfdb_db_record.pargfid, pargfid);
+
+ gfdb_db_record.gfdb_fop_path = fop_path;
+ gfdb_db_record.gfdb_fop_type = fop_type;
+
+ /*send delete request to db*/
+ ret = insert_record(_priv->_db_conn, &gfdb_db_record);
+ if (ret) {
+ gf_msg(this->name, GF_LOG_ERROR, 0, CTR_MSG_INSERT_RECORD_WIND_FAILED,
+ "Failed to delete record. %s", basename);
+ goto out;
+ }
+
+ ret = 0;
out:
- return ret;
+ return ret;
}
/******************************* Hard link function ***************************/
static inline gf_boolean_t
-__is_inode_expired (ctr_xlator_ctx_t *ctr_xlator_ctx,
- gf_ctr_private_t *_priv,
- gfdb_time_t *current_time)
+__is_inode_expired(ctr_xlator_ctx_t *ctr_xlator_ctx, gf_ctr_private_t *_priv,
+ gfdb_time_t *current_time)
{
- gf_boolean_t ret = _gf_false;
- uint64_t time_diff = 0;
+ gf_boolean_t ret = _gf_false;
+ uint64_t time_diff = 0;
- GF_ASSERT (ctr_xlator_ctx);
- GF_ASSERT (_priv);
- GF_ASSERT (current_time);
+ GF_ASSERT(ctr_xlator_ctx);
+ GF_ASSERT(_priv);
+ GF_ASSERT(current_time);
- time_diff = current_time->tv_sec -
- ctr_xlator_ctx->inode_heal_period;
+ time_diff = current_time->tv_sec - ctr_xlator_ctx->inode_heal_period;
- ret = (time_diff >= _priv->ctr_lookupheal_inode_timeout) ?
- _gf_true : _gf_false;
- return ret;
+ ret = (time_diff >= _priv->ctr_lookupheal_inode_timeout) ? _gf_true
+ : _gf_false;
+ return ret;
}
static inline gf_boolean_t
-__is_hardlink_expired (ctr_hard_link_t *ctr_hard_link,
- gf_ctr_private_t *_priv,
- gfdb_time_t *current_time)
+__is_hardlink_expired(ctr_hard_link_t *ctr_hard_link, gf_ctr_private_t *_priv,
+ gfdb_time_t *current_time)
{
- gf_boolean_t ret = _gf_false;
- uint64_t time_diff = 0;
+ gf_boolean_t ret = _gf_false;
+ uint64_t time_diff = 0;
- GF_ASSERT (ctr_hard_link);
- GF_ASSERT (_priv);
- GF_ASSERT (current_time);
+ GF_ASSERT(ctr_hard_link);
+ GF_ASSERT(_priv);
+ GF_ASSERT(current_time);
- time_diff = current_time->tv_sec -
- ctr_hard_link->hardlink_heal_period;
+ time_diff = current_time->tv_sec - ctr_hard_link->hardlink_heal_period;
- ret = ret || (time_diff >= _priv->ctr_lookupheal_link_timeout) ?
- _gf_true : _gf_false;
+ ret = ret || (time_diff >= _priv->ctr_lookupheal_link_timeout) ? _gf_true
+ : _gf_false;
- return ret;
+ return ret;
}
-
/* Return values of heal*/
typedef enum ctr_heal_ret_val {
- CTR_CTX_ERROR = -1,
- /* No healing required */
- CTR_TRY_NO_HEAL = 0,
- /* Try healing hard link */
- CTR_TRY_HARDLINK_HEAL = 1,
- /* Try healing inode */
- CTR_TRY_INODE_HEAL = 2,
+ CTR_CTX_ERROR = -1,
+ /* No healing required */
+ CTR_TRY_NO_HEAL = 0,
+ /* Try healing hard link */
+ CTR_TRY_HARDLINK_HEAL = 1,
+ /* Try healing inode */
+ CTR_TRY_INODE_HEAL = 2,
} ctr_heal_ret_val_t;
-
-
/**
* @brief Function to add hard link to the inode context variable.
* The inode context maintainences a in-memory list. This is used
@@ -737,180 +684,161 @@ typedef enum ctr_heal_ret_val {
*/
static inline ctr_heal_ret_val_t
-add_hard_link_ctx (call_frame_t *frame,
- xlator_t *this,
- inode_t *inode)
+add_hard_link_ctx(call_frame_t *frame, xlator_t *this, inode_t *inode)
{
- ctr_heal_ret_val_t ret_val = CTR_TRY_NO_HEAL;
- int ret = -1;
- gf_ctr_local_t *ctr_local = NULL;
- ctr_xlator_ctx_t *ctr_xlator_ctx = NULL;
- ctr_hard_link_t *ctr_hard_link = NULL;
- gf_ctr_private_t *_priv = NULL;
- gfdb_time_t current_time = {0};
-
-
- GF_ASSERT (frame);
- GF_ASSERT (this);
- GF_ASSERT (inode);
- GF_ASSERT (this->private);
-
- _priv = this->private;
-
- ctr_local = frame->local;
- if (!ctr_local) {
- goto out;
- }
-
- ctr_xlator_ctx = init_ctr_xlator_ctx (this, inode);
- if (!ctr_xlator_ctx) {
- gf_msg (this->name, GF_LOG_ERROR, 0,
- CTR_MSG_ACCESS_CTR_INODE_CONTEXT_FAILED,
- "Failed accessing ctr inode context");
- goto out;
+ ctr_heal_ret_val_t ret_val = CTR_TRY_NO_HEAL;
+ int ret = -1;
+ gf_ctr_local_t *ctr_local = NULL;
+ ctr_xlator_ctx_t *ctr_xlator_ctx = NULL;
+ ctr_hard_link_t *ctr_hard_link = NULL;
+ gf_ctr_private_t *_priv = NULL;
+ gfdb_time_t current_time = {0};
+
+ GF_ASSERT(frame);
+ GF_ASSERT(this);
+ GF_ASSERT(inode);
+ GF_ASSERT(this->private);
+
+ _priv = this->private;
+
+ ctr_local = frame->local;
+ if (!ctr_local) {
+ goto out;
+ }
+
+ ctr_xlator_ctx = init_ctr_xlator_ctx(this, inode);
+ if (!ctr_xlator_ctx) {
+ gf_msg(this->name, GF_LOG_ERROR, 0,
+ CTR_MSG_ACCESS_CTR_INODE_CONTEXT_FAILED,
+ "Failed accessing ctr inode context");
+ goto out;
+ }
+
+ LOCK(&ctr_xlator_ctx->lock);
+
+ /* Check if the hard link already exists
+ * in the ctr inode context*/
+ ctr_hard_link = ctr_search_hard_link_ctx(this, ctr_xlator_ctx,
+ CTR_DB_REC(ctr_local).pargfid,
+ CTR_DB_REC(ctr_local).file_name);
+ /* if there then ignore */
+ if (ctr_hard_link) {
+ ret = gettimeofday(&current_time, NULL);
+ if (ret == -1) {
+ gf_log(this->name, GF_LOG_ERROR, "Failed to get current time");
+ ret_val = CTR_CTX_ERROR;
+ goto unlock;
}
- LOCK (&ctr_xlator_ctx->lock);
-
- /* Check if the hard link already exists
- * in the ctr inode context*/
- ctr_hard_link = ctr_search_hard_link_ctx (this,
- ctr_xlator_ctx,
- CTR_DB_REC(ctr_local).pargfid,
- CTR_DB_REC(ctr_local).file_name);
- /* if there then ignore */
- if (ctr_hard_link) {
-
- ret = gettimeofday (&current_time, NULL);
- if (ret == -1) {
- gf_log (this->name, GF_LOG_ERROR,
- "Failed to get current time");
- ret_val = CTR_CTX_ERROR;
- goto unlock;
- }
-
- if (__is_hardlink_expired (ctr_hard_link,
- _priv, &current_time)) {
- ctr_hard_link->hardlink_heal_period =
- current_time.tv_sec;
- ret_val = ret_val | CTR_TRY_HARDLINK_HEAL;
- }
-
- if (__is_inode_expired (ctr_xlator_ctx,
- _priv, &current_time)) {
- ctr_xlator_ctx->inode_heal_period =
- current_time.tv_sec;
- ret_val = ret_val | CTR_TRY_INODE_HEAL;
- }
-
- goto unlock;
+ if (__is_hardlink_expired(ctr_hard_link, _priv, &current_time)) {
+ ctr_hard_link->hardlink_heal_period = current_time.tv_sec;
+ ret_val = ret_val | CTR_TRY_HARDLINK_HEAL;
}
- /* Add the hard link to the list*/
- ret = ctr_add_hard_link (this, ctr_xlator_ctx,
- CTR_DB_REC(ctr_local).pargfid,
- CTR_DB_REC(ctr_local).file_name);
- if (ret) {
- gf_msg (this->name, GF_LOG_ERROR, 0,
- CTR_MSG_ADD_HARDLINK_TO_CTR_INODE_CONTEXT_FAILED,
- "Failed to add hardlink to the ctr inode context");
- ret_val = CTR_CTX_ERROR;
- goto unlock;
+ if (__is_inode_expired(ctr_xlator_ctx, _priv, &current_time)) {
+ ctr_xlator_ctx->inode_heal_period = current_time.tv_sec;
+ ret_val = ret_val | CTR_TRY_INODE_HEAL;
}
- ret_val = CTR_TRY_NO_HEAL;
+ goto unlock;
+ }
+
+ /* Add the hard link to the list*/
+ ret = ctr_add_hard_link(this, ctr_xlator_ctx, CTR_DB_REC(ctr_local).pargfid,
+ CTR_DB_REC(ctr_local).file_name);
+ if (ret) {
+ gf_msg(this->name, GF_LOG_ERROR, 0,
+ CTR_MSG_ADD_HARDLINK_TO_CTR_INODE_CONTEXT_FAILED,
+ "Failed to add hardlink to the ctr inode context");
+ ret_val = CTR_CTX_ERROR;
+ goto unlock;
+ }
+
+ ret_val = CTR_TRY_NO_HEAL;
unlock:
- UNLOCK (&ctr_xlator_ctx->lock);
+ UNLOCK(&ctr_xlator_ctx->lock);
out:
- return ret_val;
+ return ret_val;
}
static inline int
-delete_hard_link_ctx (call_frame_t *frame,
- xlator_t *this,
- inode_t *inode)
+delete_hard_link_ctx(call_frame_t *frame, xlator_t *this, inode_t *inode)
{
- int ret = -1;
- ctr_xlator_ctx_t *ctr_xlator_ctx = NULL;
- gf_ctr_local_t *ctr_local = NULL;
-
- GF_ASSERT (frame);
- GF_ASSERT (this);
- GF_ASSERT (inode);
-
- ctr_local = frame->local;
- if (!ctr_local) {
- goto out;
- }
-
- ctr_xlator_ctx = get_ctr_xlator_ctx (this, inode);
- if (!ctr_xlator_ctx) {
- /* Since there is no ctr inode context so nothing more to do */
- ret = 0;
- goto out;
- }
+ int ret = -1;
+ ctr_xlator_ctx_t *ctr_xlator_ctx = NULL;
+ gf_ctr_local_t *ctr_local = NULL;
+
+ GF_ASSERT(frame);
+ GF_ASSERT(this);
+ GF_ASSERT(inode);
+
+ ctr_local = frame->local;
+ if (!ctr_local) {
+ goto out;
+ }
+
+ ctr_xlator_ctx = get_ctr_xlator_ctx(this, inode);
+ if (!ctr_xlator_ctx) {
+ /* Since there is no ctr inode context so nothing more to do */
+ ret = 0;
+ goto out;
+ }
- ret = ctr_delete_hard_link (this, ctr_xlator_ctx,
- CTR_DB_REC(ctr_local).pargfid,
- CTR_DB_REC(ctr_local).file_name);
- if (ret) {
- gf_msg (this->name, GF_LOG_ERROR, 0,
- CTR_MSG_DELETE_HARDLINK_FAILED,
- "Failed to delete hard link");
- goto out;
- }
+ ret = ctr_delete_hard_link(this, ctr_xlator_ctx,
+ CTR_DB_REC(ctr_local).pargfid,
+ CTR_DB_REC(ctr_local).file_name);
+ if (ret) {
+ gf_msg(this->name, GF_LOG_ERROR, 0, CTR_MSG_DELETE_HARDLINK_FAILED,
+ "Failed to delete hard link");
+ goto out;
+ }
- ret = 0;
+ ret = 0;
out:
- return ret;
+ return ret;
}
static inline int
-update_hard_link_ctx (call_frame_t *frame,
- xlator_t *this,
- inode_t *inode)
+update_hard_link_ctx(call_frame_t *frame, xlator_t *this, inode_t *inode)
{
- int ret = -1;
- ctr_xlator_ctx_t *ctr_xlator_ctx = NULL;
- gf_ctr_local_t *ctr_local = NULL;
-
- GF_ASSERT (frame);
- GF_ASSERT (this);
- GF_ASSERT (inode);
-
- ctr_local = frame->local;
- if (!ctr_local) {
- goto out;
- }
-
- ctr_xlator_ctx = init_ctr_xlator_ctx (this, inode);
- if (!ctr_xlator_ctx) {
- gf_msg (this->name, GF_LOG_ERROR, 0,
- CTR_MSG_ACCESS_CTR_INODE_CONTEXT_FAILED,
- "Failed accessing ctr inode context");
- goto out;
- }
-
- ret = ctr_update_hard_link (this, ctr_xlator_ctx,
- CTR_DB_REC(ctr_local).pargfid,
- CTR_DB_REC(ctr_local).file_name,
- CTR_DB_REC(ctr_local).old_pargfid,
- CTR_DB_REC(ctr_local).old_file_name);
- if (ret) {
- gf_msg (this->name, GF_LOG_ERROR, 0,
- CTR_MSG_DELETE_HARDLINK_FAILED,
- "Failed to delete hard link");
- goto out;
- }
-
- ret = 0;
+ int ret = -1;
+ ctr_xlator_ctx_t *ctr_xlator_ctx = NULL;
+ gf_ctr_local_t *ctr_local = NULL;
+
+ GF_ASSERT(frame);
+ GF_ASSERT(this);
+ GF_ASSERT(inode);
+
+ ctr_local = frame->local;
+ if (!ctr_local) {
+ goto out;
+ }
+
+ ctr_xlator_ctx = init_ctr_xlator_ctx(this, inode);
+ if (!ctr_xlator_ctx) {
+ gf_msg(this->name, GF_LOG_ERROR, 0,
+ CTR_MSG_ACCESS_CTR_INODE_CONTEXT_FAILED,
+ "Failed accessing ctr inode context");
+ goto out;
+ }
+
+ ret = ctr_update_hard_link(
+ this, ctr_xlator_ctx, CTR_DB_REC(ctr_local).pargfid,
+ CTR_DB_REC(ctr_local).file_name, CTR_DB_REC(ctr_local).old_pargfid,
+ CTR_DB_REC(ctr_local).old_file_name);
+ if (ret) {
+ gf_msg(this->name, GF_LOG_ERROR, 0, CTR_MSG_DELETE_HARDLINK_FAILED,
+ "Failed to delete hard link");
+ goto out;
+ }
+
+ ret = 0;
out:
- return ret;
+ return ret;
}
-
/******************************************************************************
*
* CTR xlator init related functions
@@ -918,12 +846,9 @@ out:
*
* ****************************************************************************/
int
-extract_db_params (xlator_t *this,
- dict_t *params_dict,
- gfdb_db_type_t db_type);
+extract_db_params(xlator_t *this, dict_t *params_dict, gfdb_db_type_t db_type);
int
-extract_ctr_options (xlator_t *this,
- gf_ctr_private_t *_priv);
+extract_ctr_options(xlator_t *this, gf_ctr_private_t *_priv);
#endif
diff --git a/xlators/features/changetimerecorder/src/ctr-messages.h b/xlators/features/changetimerecorder/src/ctr-messages.h
index bc9a9e0f3ab..105d2265430 100644
--- a/xlators/features/changetimerecorder/src/ctr-messages.h
+++ b/xlators/features/changetimerecorder/src/ctr-messages.h
@@ -23,64 +23,39 @@
* glfs-message-id.h.
*/
-GLFS_MSGID(CTR,
- CTR_MSG_CREATE_CTR_LOCAL_ERROR_WIND,
- CTR_MSG_FILL_CTR_LOCAL_ERROR_UNWIND,
- CTR_MSG_FILL_CTR_LOCAL_ERROR_WIND,
- CTR_MSG_INSERT_LINK_WIND_FAILED,
- CTR_MSG_INSERT_WRITEV_WIND_FAILED,
- CTR_MSG_INSERT_WRITEV_UNWIND_FAILED,
- CTR_MSG_INSERT_SETATTR_WIND_FAILED,
- CTR_MSG_INSERT_SETATTR_UNWIND_FAILED,
- CTR_MSG_INSERT_FREMOVEXATTR_UNWIND_FAILED,
- CTR_MSG_INSERT_FREMOVEXATTR_WIND_FAILED,
- CTR_MSG_INSERT_REMOVEXATTR_WIND_FAILED,
- CTR_MSG_INSERT_REMOVEXATTR_UNWIND_FAILED,
- CTR_MSG_INSERT_TRUNCATE_WIND_FAILED,
- CTR_MSG_INSERT_TRUNCATE_UNWIND_FAILED,
- CTR_MSG_INSERT_FTRUNCATE_UNWIND_FAILED,
- CTR_MSG_INSERT_FTRUNCATE_WIND_FAILED,
- CTR_MSG_INSERT_RENAME_WIND_FAILED,
- CTR_MSG_INSERT_RENAME_UNWIND_FAILED,
- CTR_MSG_ACCESS_CTR_INODE_CONTEXT_FAILED,
- CTR_MSG_ADD_HARDLINK_FAILED,
- CTR_MSG_DELETE_HARDLINK_FAILED,
- CTR_MSG_UPDATE_HARDLINK_FAILED,
- CTR_MSG_GET_CTR_RESPONSE_LINK_COUNT_XDATA_FAILED,
- CTR_MSG_SET_CTR_RESPONSE_LINK_COUNT_XDATA_FAILED,
- CTR_MSG_INSERT_UNLINK_UNWIND_FAILED,
- CTR_MSG_INSERT_UNLINK_WIND_FAILED,
- CTR_MSG_XDATA_NULL,
- CTR_MSG_INSERT_FSYNC_WIND_FAILED,
- CTR_MSG_INSERT_FSYNC_UNWIND_FAILED,
- CTR_MSG_INSERT_MKNOD_UNWIND_FAILED,
- CTR_MSG_INSERT_MKNOD_WIND_FAILED,
- CTR_MSG_INSERT_CREATE_WIND_FAILED,
- CTR_MSG_INSERT_CREATE_UNWIND_FAILED,
- CTR_MSG_INSERT_RECORD_WIND_FAILED,
- CTR_MSG_INSERT_READV_WIND_FAILED,
- CTR_MSG_GET_GFID_FROM_DICT_FAILED,
- CTR_MSG_SET,
- CTR_MSG_FATAL_ERROR,
- CTR_MSG_DANGLING_VOLUME,
- CTR_MSG_CALLOC_FAILED,
- CTR_MSG_EXTRACT_CTR_XLATOR_OPTIONS_FAILED,
- CTR_MSG_INIT_DB_PARAMS_FAILED,
- CTR_MSG_CREATE_LOCAL_MEMORY_POOL_FAILED,
- CTR_MSG_MEM_ACC_INIT_FAILED,
- CTR_MSG_CLOSE_DB_CONN_FAILED,
- CTR_MSG_FILL_UNWIND_TIME_REC_ERROR,
- CTR_MSG_WRONG_FOP_PATH,
- CTR_MSG_CONSTRUCT_DB_PATH_FAILED,
- CTR_MSG_SET_VALUE_TO_SQL_PARAM_FAILED,
- CTR_MSG_XLATOR_DISABLED,
- CTR_MSG_HARDLINK_MISSING_IN_LIST,
- CTR_MSG_ADD_HARDLINK_TO_LIST_FAILED,
- CTR_MSG_INIT_LOCK_FAILED,
- CTR_MSG_COPY_FAILED,
- CTR_MSG_EXTRACT_DB_PARAM_OPTIONS_FAILED,
- CTR_MSG_ADD_HARDLINK_TO_CTR_INODE_CONTEXT_FAILED,
- CTR_MSG_NULL_LOCAL
-);
+GLFS_MSGID(
+ CTR, CTR_MSG_CREATE_CTR_LOCAL_ERROR_WIND,
+ CTR_MSG_FILL_CTR_LOCAL_ERROR_UNWIND, CTR_MSG_FILL_CTR_LOCAL_ERROR_WIND,
+ CTR_MSG_INSERT_LINK_WIND_FAILED, CTR_MSG_INSERT_WRITEV_WIND_FAILED,
+ CTR_MSG_INSERT_WRITEV_UNWIND_FAILED, CTR_MSG_INSERT_SETATTR_WIND_FAILED,
+ CTR_MSG_INSERT_SETATTR_UNWIND_FAILED,
+ CTR_MSG_INSERT_FREMOVEXATTR_UNWIND_FAILED,
+ CTR_MSG_INSERT_FREMOVEXATTR_WIND_FAILED,
+ CTR_MSG_INSERT_REMOVEXATTR_WIND_FAILED,
+ CTR_MSG_INSERT_REMOVEXATTR_UNWIND_FAILED,
+ CTR_MSG_INSERT_TRUNCATE_WIND_FAILED, CTR_MSG_INSERT_TRUNCATE_UNWIND_FAILED,
+ CTR_MSG_INSERT_FTRUNCATE_UNWIND_FAILED,
+ CTR_MSG_INSERT_FTRUNCATE_WIND_FAILED, CTR_MSG_INSERT_RENAME_WIND_FAILED,
+ CTR_MSG_INSERT_RENAME_UNWIND_FAILED,
+ CTR_MSG_ACCESS_CTR_INODE_CONTEXT_FAILED, CTR_MSG_ADD_HARDLINK_FAILED,
+ CTR_MSG_DELETE_HARDLINK_FAILED, CTR_MSG_UPDATE_HARDLINK_FAILED,
+ CTR_MSG_GET_CTR_RESPONSE_LINK_COUNT_XDATA_FAILED,
+ CTR_MSG_SET_CTR_RESPONSE_LINK_COUNT_XDATA_FAILED,
+ CTR_MSG_INSERT_UNLINK_UNWIND_FAILED, CTR_MSG_INSERT_UNLINK_WIND_FAILED,
+ CTR_MSG_XDATA_NULL, CTR_MSG_INSERT_FSYNC_WIND_FAILED,
+ CTR_MSG_INSERT_FSYNC_UNWIND_FAILED, CTR_MSG_INSERT_MKNOD_UNWIND_FAILED,
+ CTR_MSG_INSERT_MKNOD_WIND_FAILED, CTR_MSG_INSERT_CREATE_WIND_FAILED,
+ CTR_MSG_INSERT_CREATE_UNWIND_FAILED, CTR_MSG_INSERT_RECORD_WIND_FAILED,
+ CTR_MSG_INSERT_READV_WIND_FAILED, CTR_MSG_GET_GFID_FROM_DICT_FAILED,
+ CTR_MSG_SET, CTR_MSG_FATAL_ERROR, CTR_MSG_DANGLING_VOLUME,
+ CTR_MSG_CALLOC_FAILED, CTR_MSG_EXTRACT_CTR_XLATOR_OPTIONS_FAILED,
+ CTR_MSG_INIT_DB_PARAMS_FAILED, CTR_MSG_CREATE_LOCAL_MEMORY_POOL_FAILED,
+ CTR_MSG_MEM_ACC_INIT_FAILED, CTR_MSG_CLOSE_DB_CONN_FAILED,
+ CTR_MSG_FILL_UNWIND_TIME_REC_ERROR, CTR_MSG_WRONG_FOP_PATH,
+ CTR_MSG_CONSTRUCT_DB_PATH_FAILED, CTR_MSG_SET_VALUE_TO_SQL_PARAM_FAILED,
+ CTR_MSG_XLATOR_DISABLED, CTR_MSG_HARDLINK_MISSING_IN_LIST,
+ CTR_MSG_ADD_HARDLINK_TO_LIST_FAILED, CTR_MSG_INIT_LOCK_FAILED,
+ CTR_MSG_COPY_FAILED, CTR_MSG_EXTRACT_DB_PARAM_OPTIONS_FAILED,
+ CTR_MSG_ADD_HARDLINK_TO_CTR_INODE_CONTEXT_FAILED, CTR_MSG_NULL_LOCAL);
#endif /* !_CTR_MESSAGES_H_ */
diff --git a/xlators/features/changetimerecorder/src/ctr-xlator-ctx.h b/xlators/features/changetimerecorder/src/ctr-xlator-ctx.h
index 7f1c6cb1712..584d3b79ba4 100644
--- a/xlators/features/changetimerecorder/src/ctr-xlator-ctx.h
+++ b/xlators/features/changetimerecorder/src/ctr-xlator-ctx.h
@@ -23,68 +23,46 @@
#include <sys/time.h>
typedef struct ctr_hard_link {
- uuid_t pgfid;
- char *base_name;
- /* Hardlink expiry : Defines the expiry period after which a
- * database heal is attempted. */
- uint64_t hardlink_heal_period;
- struct list_head list;
+ uuid_t pgfid;
+ char *base_name;
+ /* Hardlink expiry : Defines the expiry period after which a
+ * database heal is attempted. */
+ uint64_t hardlink_heal_period;
+ struct list_head list;
} ctr_hard_link_t;
typedef struct ctr_xlator_ctx {
- /* This represents the looked up hardlinks
- * NOTE: This doesn't represent all physical hardlinks of the inode*/
- struct list_head hardlink_list;
- uint64_t inode_heal_period;
- gf_lock_t lock;
+ /* This represents the looked up hardlinks
+ * NOTE: This doesn't represent all physical hardlinks of the inode*/
+ struct list_head hardlink_list;
+ uint64_t inode_heal_period;
+ gf_lock_t lock;
} ctr_xlator_ctx_t;
-
ctr_hard_link_t *
-ctr_search_hard_link_ctx (xlator_t *this,
- ctr_xlator_ctx_t *ctr_xlator_ctx,
- uuid_t pgfid,
- const char *base_name);
-
+ctr_search_hard_link_ctx(xlator_t *this, ctr_xlator_ctx_t *ctr_xlator_ctx,
+ uuid_t pgfid, const char *base_name);
int
-ctr_add_hard_link (xlator_t *this,
- ctr_xlator_ctx_t *ctr_xlator_ctx,
- uuid_t pgfid,
- const char *base_name);
-
-
+ctr_add_hard_link(xlator_t *this, ctr_xlator_ctx_t *ctr_xlator_ctx,
+ uuid_t pgfid, const char *base_name);
int
-ctr_delete_hard_link (xlator_t *this,
- ctr_xlator_ctx_t *ctr_xlator_ctx,
- uuid_t pgfid,
- const char *base_name);
-
+ctr_delete_hard_link(xlator_t *this, ctr_xlator_ctx_t *ctr_xlator_ctx,
+ uuid_t pgfid, const char *base_name);
int
-ctr_update_hard_link (xlator_t *this,
- ctr_xlator_ctx_t *ctr_xlator_ctx,
- uuid_t pgfid,
- const char *base_name,
- uuid_t old_pgfid,
- const char *old_base_name);
-
+ctr_update_hard_link(xlator_t *this, ctr_xlator_ctx_t *ctr_xlator_ctx,
+ uuid_t pgfid, const char *base_name, uuid_t old_pgfid,
+ const char *old_base_name);
ctr_xlator_ctx_t *
-get_ctr_xlator_ctx (xlator_t *this,
- inode_t *inode);
-
-
-
+get_ctr_xlator_ctx(xlator_t *this, inode_t *inode);
ctr_xlator_ctx_t *
-init_ctr_xlator_ctx (xlator_t *this,
- inode_t *inode);
-
+init_ctr_xlator_ctx(xlator_t *this, inode_t *inode);
void
-fini_ctr_xlator_ctx (xlator_t *this,
- inode_t *inode);
+fini_ctr_xlator_ctx(xlator_t *this, inode_t *inode);
#endif
diff --git a/xlators/features/changetimerecorder/src/ctr_mem_types.h b/xlators/features/changetimerecorder/src/ctr_mem_types.h
index f408c028e24..7b8f531ddec 100644
--- a/xlators/features/changetimerecorder/src/ctr_mem_types.h
+++ b/xlators/features/changetimerecorder/src/ctr_mem_types.h
@@ -8,17 +8,15 @@
cases as published by the Free Software Foundation.
*/
-
#ifndef __CTR_MEM_TYPES_H__
#define __CTR_MEM_TYPES_H__
#include "gfdb_mem-types.h"
enum gf_ctr_mem_types_ {
- gf_ctr_mt_private_t = gfdb_mt_end + 1,
- gf_ctr_mt_xlator_ctx,
- gf_ctr_mt_hard_link_t,
- gf_ctr_mt_end
+ gf_ctr_mt_private_t = gfdb_mt_end + 1,
+ gf_ctr_mt_xlator_ctx,
+ gf_ctr_mt_hard_link_t,
+ gf_ctr_mt_end
};
#endif
-
diff --git a/xlators/features/cloudsync/src/cloudsync-common.h b/xlators/features/cloudsync/src/cloudsync-common.h
index 3298ab0a6f2..0be6a446456 100644
--- a/xlators/features/cloudsync/src/cloudsync-common.h
+++ b/xlators/features/cloudsync/src/cloudsync-common.h
@@ -18,80 +18,82 @@
#include "cloudsync-messages.h"
typedef struct cs_local {
- loc_t loc;
- fd_t *fd;
- call_stub_t *stub;
- call_frame_t *main_frame;
- int op_errno;
- int op_ret;
- fd_t *dlfd;
- off_t dloffset;
- struct iatt stbuf;
- dict_t *xattr_rsp;
- dict_t *xattr_req;
- glusterfs_fop_t fop;
- gf_boolean_t locked;
- int call_cnt;
- inode_t *inode;
- char *remotepath;
+ loc_t loc;
+ fd_t *fd;
+ call_stub_t *stub;
+ call_frame_t *main_frame;
+ int op_errno;
+ int op_ret;
+ fd_t *dlfd;
+ off_t dloffset;
+ struct iatt stbuf;
+ dict_t *xattr_rsp;
+ dict_t *xattr_req;
+ glusterfs_fop_t fop;
+ gf_boolean_t locked;
+ int call_cnt;
+ inode_t *inode;
+ char *remotepath;
} cs_local_t;
-typedef int (*fop_download_t) (call_frame_t *frame, void *config);
+typedef int (*fop_download_t)(call_frame_t *frame, void *config);
-typedef void *(*store_init) (xlator_t *this);
+typedef void *(*store_init)(xlator_t *this);
-typedef int (*store_reconfigure) (xlator_t *this, dict_t *options);
+typedef int (*store_reconfigure)(xlator_t *this, dict_t *options);
-typedef void (*store_fini) (void *config);
+typedef void (*store_fini)(void *config);
struct cs_remote_stores {
- char *name; /* store name */
- void *config; /* store related information */
- fop_download_t dlfop; /* store specific download function */
- store_init init; /* store init to initialize store config */
- store_reconfigure reconfigure; /* reconfigure store config */
- store_fini fini;
- void *handle; /* shared library handle*/
+ char *name; /* store name */
+ void *config; /* store related information */
+ fop_download_t dlfop; /* store specific download function */
+ store_init init; /* store init to initialize store config */
+ store_reconfigure reconfigure; /* reconfigure store config */
+ store_fini fini;
+ void *handle; /* shared library handle*/
};
typedef struct cs_private {
- xlator_t *this;
- struct cs_remote_stores *stores;
- gf_boolean_t abortdl;
- pthread_spinlock_t lock;
+ xlator_t *this;
+ struct cs_remote_stores *stores;
+ gf_boolean_t abortdl;
+ pthread_spinlock_t lock;
} cs_private_t;
void
-cs_local_wipe (xlator_t *this, cs_local_t *local);
+cs_local_wipe(xlator_t *this, cs_local_t *local);
-#define CS_STACK_UNWIND(fop, frame, params ...) do { \
- cs_local_t *__local = NULL; \
- xlator_t *__xl = NULL; \
- if (frame) { \
- __xl = frame->this; \
- __local = frame->local; \
- frame->local = NULL; \
- } \
- STACK_UNWIND_STRICT (fop, frame, params); \
- cs_local_wipe (__xl, __local); \
-} while (0)
+#define CS_STACK_UNWIND(fop, frame, params...) \
+ do { \
+ cs_local_t *__local = NULL; \
+ xlator_t *__xl = NULL; \
+ if (frame) { \
+ __xl = frame->this; \
+ __local = frame->local; \
+ frame->local = NULL; \
+ } \
+ STACK_UNWIND_STRICT(fop, frame, params); \
+ cs_local_wipe(__xl, __local); \
+ } while (0)
-#define CS_STACK_DESTROY(frame) do { \
- cs_local_t *__local = NULL; \
- xlator_t *__xl = NULL; \
- __xl = frame->this; \
- __local = frame->local; \
- frame->local = NULL; \
- STACK_DESTROY (frame->root); \
- cs_local_wipe (__xl, __local); \
-} while (0)
+#define CS_STACK_DESTROY(frame) \
+ do { \
+ cs_local_t *__local = NULL; \
+ xlator_t *__xl = NULL; \
+ __xl = frame->this; \
+ __local = frame->local; \
+ frame->local = NULL; \
+ STACK_DESTROY(frame->root); \
+ cs_local_wipe(__xl, __local); \
+ } while (0)
typedef struct store_methods {
- int (*fop_download) (call_frame_t *frame, void *config);
- /* return type should be the store config */
- void *(*fop_init) (xlator_t *this);
- int (*fop_reconfigure) (xlator_t *this, dict_t *options);
- void (*fop_fini) (void *config);
+ int (*fop_download)(call_frame_t *frame, void *config);
+ /* return type should be the store config */
+ void *(*fop_init)(xlator_t *this);
+ int (*fop_reconfigure)(xlator_t *this, dict_t *options);
+ void (*fop_fini)(void *config);
} store_methods_t;
#endif /* _CLOUDSYNC_COMMON_H */
diff --git a/xlators/features/cloudsync/src/cloudsync-mem-types.h b/xlators/features/cloudsync/src/cloudsync-mem-types.h
index 6ebcb16552b..46d4f3aa2a1 100644
--- a/xlators/features/cloudsync/src/cloudsync-mem-types.h
+++ b/xlators/features/cloudsync/src/cloudsync-mem-types.h
@@ -8,16 +8,14 @@
* cases as published by the Free Software Foundation.
*/
-
#ifndef __CLOUDSYNC_MEM_TYPES_H__
#define __CLOUDSYNC_MEM_TYPES_H__
#include "mem-types.h"
enum cs_mem_types_ {
- gf_cs_mt_cs_private_t = gf_common_mt_end + 1,
- gf_cs_mt_cs_remote_stores_t,
- gf_cs_mt_cs_inode_ctx_t,
- gf_cs_mt_end
+ gf_cs_mt_cs_private_t = gf_common_mt_end + 1,
+ gf_cs_mt_cs_remote_stores_t,
+ gf_cs_mt_cs_inode_ctx_t,
+ gf_cs_mt_end
};
#endif /* __CLOUDSYNC_MEM_TYPES_H__ */
-
diff --git a/xlators/features/cloudsync/src/cloudsync-messages.h b/xlators/features/cloudsync/src/cloudsync-messages.h
index ad4b7d2e0b8..fb08f72de7f 100644
--- a/xlators/features/cloudsync/src/cloudsync-messages.h
+++ b/xlators/features/cloudsync/src/cloudsync-messages.h
@@ -8,12 +8,9 @@
* cases as published by the Free Software Foundation.
*/
-
#ifndef __CLOUDSYNC_MESSAGES_H__
#define __CLOUDSYNC_MESSAGES_H__
/*TODO: define relevant message ids */
-
#endif /* __CLOUDSYNC_MESSAGES_H__ */
-
diff --git a/xlators/features/cloudsync/src/cloudsync-plugins/src/cloudsyncs3/src/libcloudsyncs3-mem-types.h b/xlators/features/cloudsync/src/cloudsync-plugins/src/cloudsyncs3/src/libcloudsyncs3-mem-types.h
index dd9314ec8d8..0aaab1fe955 100644
--- a/xlators/features/cloudsync/src/cloudsync-plugins/src/cloudsyncs3/src/libcloudsyncs3-mem-types.h
+++ b/xlators/features/cloudsync/src/cloudsync-plugins/src/cloudsyncs3/src/libcloudsyncs3-mem-types.h
@@ -8,14 +8,12 @@
* cases as published by the Free Software Foundation.
*/
-
#ifndef __LIBAWS_MEM_TYPES_H__
#define __LIBAWS_MEM_TYPES_H__
#include "mem-types.h"
enum libaws_mem_types_ {
- gf_libaws_mt_aws_private_t = gf_common_mt_end + 1,
- gf_libaws_mt_end
+ gf_libaws_mt_aws_private_t = gf_common_mt_end + 1,
+ gf_libaws_mt_end
};
#endif /* __CLOUDSYNC_MEM_TYPES_H__ */
-
diff --git a/xlators/features/cloudsync/src/cloudsync-plugins/src/cloudsyncs3/src/libcloudsyncs3.h b/xlators/features/cloudsync/src/cloudsync-plugins/src/cloudsyncs3/src/libcloudsyncs3.h
index c233e1c96f7..b1a95f8cbf9 100644
--- a/xlators/features/cloudsync/src/cloudsync-plugins/src/cloudsyncs3/src/libcloudsyncs3.h
+++ b/xlators/features/cloudsync/src/cloudsync-plugins/src/cloudsyncs3/src/libcloudsyncs3.h
@@ -18,34 +18,33 @@
#include "cloudsync-common.h"
#include "libcloudsyncs3-mem-types.h"
-
-char*
+char *
aws_b64_encode(const unsigned char *input, int length);
size_t
aws_write_callback(void *dlbuf, size_t size, size_t nitems, void *mainframe);
int
-aws_download_s3 (call_frame_t *frame, void *config);
+aws_download_s3(call_frame_t *frame, void *config);
int
-aws_dlwritev_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int op_ret, int op_errno, struct iatt *prebuf,
- struct iatt *postbuf, dict_t *xdata);
+aws_dlwritev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret,
+ int op_errno, struct iatt *prebuf, struct iatt *postbuf,
+ dict_t *xdata);
void *
-aws_init (xlator_t *this);
+aws_init(xlator_t *this);
int
-aws_reconfigure (xlator_t *this, dict_t *options);
+aws_reconfigure(xlator_t *this, dict_t *options);
char *
-aws_form_request (char *resource, char **date, char *reqtype, char *bucketid,
- char *filepath);
+aws_form_request(char *resource, char **date, char *reqtype, char *bucketid,
+ char *filepath);
char *
aws_sign_request(char *const str, char *awssekey);
void
-aws_fini (void *config);
+aws_fini(void *config);
#endif
diff --git a/xlators/features/cloudsync/src/cloudsync.h b/xlators/features/cloudsync/src/cloudsync.h
index 18840a6523d..7c70c744d2b 100644
--- a/xlators/features/cloudsync/src/cloudsync.h
+++ b/xlators/features/cloudsync/src/cloudsync.h
@@ -8,7 +8,6 @@
* cases as published by the Free Software Foundation.
*/
-
#ifndef __CLOUDSYNC_H__
#define __CLOUDSYNC_H__
@@ -20,87 +19,85 @@
#include "cloudsync-common.h"
#include "cloudsync-autogen-fops.h"
-
#define CS_LOCK_DOMAIN "cs.protect.file.stat"
typedef struct cs_dlstore {
- off_t off;
- struct iovec *vector;
- int32_t count;
- struct iobref *iobref;
- uint32_t flags;
+ off_t off;
+ struct iovec *vector;
+ int32_t count;
+ struct iobref *iobref;
+ uint32_t flags;
} cs_dlstore;
typedef struct cs_inode_ctx {
- gf_cs_obj_state state;
+ gf_cs_obj_state state;
} cs_inode_ctx_t;
struct cs_plugin {
- char *name; /* store name */
- char *library; /* library to load for the given store */
- char *description; /* description about the store */
+ char *name; /* store name */
+ char *library; /* library to load for the given store */
+ char *description; /* description about the store */
};
cs_local_t *
-cs_local_init (xlator_t *this, call_frame_t *frame, loc_t *loc, fd_t *fd,
- glusterfs_fop_t fop);
+cs_local_init(xlator_t *this, call_frame_t *frame, loc_t *loc, fd_t *fd,
+ glusterfs_fop_t fop);
int
-locate_and_execute (call_frame_t *frame);
-
+locate_and_execute(call_frame_t *frame);
int32_t
-cs_resume_setxattr (call_frame_t *frame, xlator_t *this, loc_t *loc,
- dict_t *dict, int32_t flags, dict_t *xdata);
+cs_resume_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ dict_t *dict, int32_t flags, dict_t *xdata);
int32_t
-cs_inodelk_unlock_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret,
- int32_t op_errno, dict_t *xdata);
+cs_inodelk_unlock_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *xdata);
size_t
-cs_write_callback (void *lcurlbuf, size_t size, size_t nitems, void *frame);
+cs_write_callback(void *lcurlbuf, size_t size, size_t nitems, void *frame);
void
-cs_common_cbk (call_frame_t *frame);
+cs_common_cbk(call_frame_t *frame);
gf_boolean_t
-cs_is_file_remote (struct iatt *stbuf, dict_t *xattr);
+cs_is_file_remote(struct iatt *stbuf, dict_t *xattr);
int32_t
-cs_setxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, dict_t *xdata);
+cs_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *xdata);
int
-cs_build_loc (loc_t *loc, call_frame_t *frame);
+cs_build_loc(loc_t *loc, call_frame_t *frame);
int
-cs_blocking_inodelk_cbk (call_frame_t *lock_frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, dict_t *xdata);
+cs_blocking_inodelk_cbk(call_frame_t *lock_frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *xdata);
-int cs_read_authinfo(xlator_t *this);
+int
+cs_read_authinfo(xlator_t *this);
int
-__cs_inode_ctx_update (xlator_t *this, inode_t *inode, uint64_t val);
+__cs_inode_ctx_update(xlator_t *this, inode_t *inode, uint64_t val);
int
-cs_inode_ctx_reset (xlator_t *this, inode_t *inode);
+cs_inode_ctx_reset(xlator_t *this, inode_t *inode);
void
-__cs_inode_ctx_get (xlator_t *this, inode_t *inode, cs_inode_ctx_t **ctx);
+__cs_inode_ctx_get(xlator_t *this, inode_t *inode, cs_inode_ctx_t **ctx);
gf_cs_obj_state
-__cs_get_file_state (xlator_t *this, inode_t *inode, cs_inode_ctx_t *ctx);
+__cs_get_file_state(xlator_t *this, inode_t *inode, cs_inode_ctx_t *ctx);
int
-cs_inodelk_unlock (call_frame_t *main_frame);
+cs_inodelk_unlock(call_frame_t *main_frame);
int
-cs_resume_postprocess (xlator_t *this, call_frame_t *frame, inode_t *inode);
+cs_resume_postprocess(xlator_t *this, call_frame_t *frame, inode_t *inode);
int32_t
-cs_truncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct iatt *prebuf,
- struct iatt *postbuf, dict_t *xdata);
+cs_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, struct iatt *prebuf,
+ struct iatt *postbuf, dict_t *xdata);
int32_t
-cs_resume_truncate (call_frame_t *frame, xlator_t *this, loc_t *loc,
- off_t offset, dict_t *xattr_req);
+cs_resume_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ off_t offset, dict_t *xattr_req);
#endif /* __CLOUDSYNC_H__ */
-
diff --git a/xlators/features/compress/src/cdc-mem-types.h b/xlators/features/compress/src/cdc-mem-types.h
index ead2c70ba6e..56a5a05ee8c 100644
--- a/xlators/features/compress/src/cdc-mem-types.h
+++ b/xlators/features/compress/src/cdc-mem-types.h
@@ -14,10 +14,10 @@
#include "mem-types.h"
enum gf_cdc_mem_types {
- gf_cdc_mt_priv_t = gf_common_mt_end + 1,
- gf_cdc_mt_vec_t = gf_common_mt_end + 2,
- gf_cdc_mt_gzip_trailer_t = gf_common_mt_end + 3,
- gf_cdc_mt_end = gf_common_mt_end + 4,
+ gf_cdc_mt_priv_t = gf_common_mt_end + 1,
+ gf_cdc_mt_vec_t = gf_common_mt_end + 2,
+ gf_cdc_mt_gzip_trailer_t = gf_common_mt_end + 3,
+ gf_cdc_mt_end = gf_common_mt_end + 4,
};
#endif
diff --git a/xlators/features/compress/src/cdc.h b/xlators/features/compress/src/cdc.h
index 71f4d2317bb..764f2028c75 100644
--- a/xlators/features/compress/src/cdc.h
+++ b/xlators/features/compress/src/cdc.h
@@ -22,34 +22,34 @@
#endif
typedef struct cdc_priv {
- int window_size;
- int mem_level;
- int cdc_level;
- int min_file_size;
- int op_mode;
- gf_boolean_t debug;
- gf_lock_t lock;
+ int window_size;
+ int mem_level;
+ int cdc_level;
+ int min_file_size;
+ int op_mode;
+ gf_boolean_t debug;
+ gf_lock_t lock;
} cdc_priv_t;
typedef struct cdc_info {
- /* input bits */
- int count;
- int32_t ibytes;
- struct iovec *vector;
- struct iatt *buf;
-
- /* output bits */
- int ncount;
- int nbytes;
- int buffer_size;
- struct iovec vec[MAX_IOVEC];
- struct iobref *iobref;
-
- /* zlib bits */
+ /* input bits */
+ int count;
+ int32_t ibytes;
+ struct iovec *vector;
+ struct iatt *buf;
+
+ /* output bits */
+ int ncount;
+ int nbytes;
+ int buffer_size;
+ struct iovec vec[MAX_IOVEC];
+ struct iobref *iobref;
+
+ /* zlib bits */
#ifdef HAVE_LIB_Z
- z_stream stream;
+ z_stream stream;
#endif
- unsigned long crc;
+ unsigned long crc;
} cdc_info_t;
#define NVEC(ci) (ci->ncount - 1)
@@ -57,8 +57,8 @@ typedef struct cdc_info {
#define THIS_VEC(ci, i) ci->vector[i]
/* Gzip defaults */
-#define GF_CDC_DEF_WINDOWSIZE -15 /* default value */
-#define GF_CDC_MAX_WINDOWSIZE -8 /* max value */
+#define GF_CDC_DEF_WINDOWSIZE -15 /* default value */
+#define GF_CDC_MAX_WINDOWSIZE -8 /* max value */
#ifdef HAVE_LIB_Z
#define GF_CDC_DEF_COMPRESSION Z_DEFAULT_COMPRESSION
@@ -66,15 +66,15 @@ typedef struct cdc_info {
#define GF_CDC_DEF_COMPRESSION -1
#endif
-#define GF_CDC_DEF_MEMLEVEL 8
-#define GF_CDC_DEF_BUFFERSIZE 262144 // 256K - default compression buffer size
+#define GF_CDC_DEF_MEMLEVEL 8
+#define GF_CDC_DEF_BUFFERSIZE 262144 // 256K - default compression buffer size
/* Operation mode
* If xlator is loaded on client, readv decompresses and writev compresses
* If xlator is loaded on server, readv compresses and writev decompresses
*/
-#define GF_CDC_MODE_CLIENT 0
-#define GF_CDC_MODE_SERVER 1
+#define GF_CDC_MODE_CLIENT 0
+#define GF_CDC_MODE_SERVER 1
/* min size of data to do cmpression
* 0 == compress even 1byte
@@ -87,21 +87,13 @@ typedef struct cdc_info {
#define GF_CDC_DEFLATE_CANARY_VAL "deflate"
#define GF_CDC_DEBUG_DUMP_FILE "/tmp/cdcdump.gz"
-#define GF_CDC_MODE_IS_CLIENT(m) \
- (strcmp (m, "client") == 0)
+#define GF_CDC_MODE_IS_CLIENT(m) (strcmp(m, "client") == 0)
-#define GF_CDC_MODE_IS_SERVER(m) \
- (strcmp (m, "server") == 0)
+#define GF_CDC_MODE_IS_SERVER(m) (strcmp(m, "server") == 0)
int32_t
-cdc_compress (xlator_t *this,
- cdc_priv_t *priv,
- cdc_info_t *ci,
- dict_t **xdata);
+cdc_compress(xlator_t *this, cdc_priv_t *priv, cdc_info_t *ci, dict_t **xdata);
int32_t
-cdc_decompress (xlator_t *this,
- cdc_priv_t *priv,
- cdc_info_t *ci,
- dict_t *xdata);
+cdc_decompress(xlator_t *this, cdc_priv_t *priv, cdc_info_t *ci, dict_t *xdata);
#endif
diff --git a/xlators/features/gfid-access/src/gfid-access-mem-types.h b/xlators/features/gfid-access/src/gfid-access-mem-types.h
index 168d67b431f..ee7fd794da8 100644
--- a/xlators/features/gfid-access/src/gfid-access-mem-types.h
+++ b/xlators/features/gfid-access/src/gfid-access-mem-types.h
@@ -14,10 +14,9 @@
#include "mem-types.h"
enum gf_changelog_mem_types {
- gf_gfid_access_mt_priv_t = gf_common_mt_end + 1,
- gf_gfid_access_mt_gfid_t,
- gf_gfid_access_mt_end
+ gf_gfid_access_mt_priv_t = gf_common_mt_end + 1,
+ gf_gfid_access_mt_gfid_t,
+ gf_gfid_access_mt_end
};
#endif
-
diff --git a/xlators/features/gfid-access/src/gfid-access.h b/xlators/features/gfid-access/src/gfid-access.h
index 2b5e4fd4184..68ebe539564 100644
--- a/xlators/features/gfid-access/src/gfid-access.h
+++ b/xlators/features/gfid-access/src/gfid-access.h
@@ -20,87 +20,87 @@
#define UUID_CANONICAL_FORM_LEN 36
#define GF_FUSE_AUX_GFID_NEWFILE "glusterfs.gfid.newfile"
-#define GF_FUSE_AUX_GFID_HEAL "glusterfs.gfid.heal"
+#define GF_FUSE_AUX_GFID_HEAL "glusterfs.gfid.heal"
#define GF_GFID_KEY "GLUSTERFS_GFID"
#define GF_GFID_DIR ".gfid"
#define GF_AUX_GFID 0xd
-#define GFID_ACCESS_ENTRY_OP_CHECK(loc,err,lbl) do { \
- /* need to check if the lookup is on virtual dir */ \
- if ((loc->name && !strcmp (GF_GFID_DIR, loc->name)) && \
- ((loc->parent && \
- __is_root_gfid (loc->parent->gfid)) || \
- __is_root_gfid (loc->pargfid))) { \
- err = ENOTSUP; \
- goto lbl; \
- } \
- \
- /* now, check if the lookup() is on an existing */ \
- /* entry, but on gfid-path */ \
- if ((loc->parent && \
- __is_gfid_access_dir (loc->parent->gfid)) || \
- __is_gfid_access_dir (loc->pargfid)) { \
- err = EPERM; \
- goto lbl; \
- } \
- } while (0)
+#define GFID_ACCESS_ENTRY_OP_CHECK(loc, err, lbl) \
+ do { \
+ /* need to check if the lookup is on virtual dir */ \
+ if ((loc->name && !strcmp(GF_GFID_DIR, loc->name)) && \
+ ((loc->parent && __is_root_gfid(loc->parent->gfid)) || \
+ __is_root_gfid(loc->pargfid))) { \
+ err = ENOTSUP; \
+ goto lbl; \
+ } \
+ \
+ /* now, check if the lookup() is on an existing */ \
+ /* entry, but on gfid-path */ \
+ if ((loc->parent && __is_gfid_access_dir(loc->parent->gfid)) || \
+ __is_gfid_access_dir(loc->pargfid)) { \
+ err = EPERM; \
+ goto lbl; \
+ } \
+ } while (0)
-#define GFID_ACCESS_INODE_OP_CHECK(loc,err,lbl) do { \
- /*Check if it is on .gfid*/ \
- if (__is_gfid_access_dir(loc->gfid)) { \
- err = ENOTSUP; \
- goto lbl; \
- } \
- } while (0)
+#define GFID_ACCESS_INODE_OP_CHECK(loc, err, lbl) \
+ do { \
+ /*Check if it is on .gfid*/ \
+ if (__is_gfid_access_dir(loc->gfid)) { \
+ err = ENOTSUP; \
+ goto lbl; \
+ } \
+ } while (0)
typedef struct {
- unsigned int uid;
- unsigned int gid;
- char gfid[UUID_CANONICAL_FORM_LEN + 1];
- unsigned int st_mode;
- char *bname;
+ unsigned int uid;
+ unsigned int gid;
+ char gfid[UUID_CANONICAL_FORM_LEN + 1];
+ unsigned int st_mode;
+ char *bname;
- union {
- struct _symlink_in {
- char *linkpath;
- } __attribute__ ((__packed__)) symlink;
+ union {
+ struct _symlink_in {
+ char *linkpath;
+ } __attribute__((__packed__)) symlink;
- struct _mknod_in {
- unsigned int mode;
- unsigned int rdev;
- unsigned int umask;
- } __attribute__ ((__packed__)) mknod;
+ struct _mknod_in {
+ unsigned int mode;
+ unsigned int rdev;
+ unsigned int umask;
+ } __attribute__((__packed__)) mknod;
- struct _mkdir_in {
- unsigned int mode;
- unsigned int umask;
- } __attribute__ ((__packed__)) mkdir;
- } __attribute__ ((__packed__)) args;
+ struct _mkdir_in {
+ unsigned int mode;
+ unsigned int umask;
+ } __attribute__((__packed__)) mkdir;
+ } __attribute__((__packed__)) args;
} __attribute__((__packed__)) ga_newfile_args_t;
typedef struct {
- char gfid[UUID_CANONICAL_FORM_LEN + 1];
- char *bname; /* a null terminated basename */
+ char gfid[UUID_CANONICAL_FORM_LEN + 1];
+ char *bname; /* a null terminated basename */
} __attribute__((__packed__)) ga_heal_args_t;
struct ga_private {
- /* root inode's stbuf */
- struct iatt root_stbuf;
- struct iatt gfiddir_stbuf;
- struct mem_pool *newfile_args_pool;
- struct mem_pool *heal_args_pool;
+ /* root inode's stbuf */
+ struct iatt root_stbuf;
+ struct iatt gfiddir_stbuf;
+ struct mem_pool *newfile_args_pool;
+ struct mem_pool *heal_args_pool;
};
typedef struct ga_private ga_private_t;
struct __ga_local {
- call_frame_t *orig_frame;
- unsigned int uid;
- unsigned int gid;
- loc_t loc;
- mode_t mode;
- dev_t rdev;
- mode_t umask;
- dict_t *xdata;
+ call_frame_t *orig_frame;
+ unsigned int uid;
+ unsigned int gid;
+ loc_t loc;
+ mode_t mode;
+ dev_t rdev;
+ mode_t umask;
+ dict_t *xdata;
};
typedef struct __ga_local ga_local_t;
diff --git a/xlators/features/glupy/src/glupy.h b/xlators/features/glupy/src/glupy.h
index 1488c55c331..851b02154d2 100644
--- a/xlators/features/glupy/src/glupy.h
+++ b/xlators/features/glupy/src/glupy.h
@@ -14,43 +14,43 @@
#include "mem-types.h"
enum {
- GLUPY_LOOKUP = 0,
- GLUPY_CREATE,
- GLUPY_OPEN,
- GLUPY_READV,
- GLUPY_WRITEV,
- GLUPY_OPENDIR,
- GLUPY_READDIR,
- GLUPY_READDIRP,
- GLUPY_STAT,
- GLUPY_FSTAT,
- GLUPY_STATFS,
- GLUPY_SETXATTR,
- GLUPY_GETXATTR,
- GLUPY_FSETXATTR,
- GLUPY_FGETXATTR,
- GLUPY_REMOVEXATTR,
- GLUPY_FREMOVEXATTR,
- GLUPY_LINK,
- GLUPY_UNLINK,
- GLUPY_READLINK,
- GLUPY_SYMLINK,
- GLUPY_MKNOD,
- GLUPY_MKDIR,
- GLUPY_RMDIR,
- GLUPY_N_FUNCS
+ GLUPY_LOOKUP = 0,
+ GLUPY_CREATE,
+ GLUPY_OPEN,
+ GLUPY_READV,
+ GLUPY_WRITEV,
+ GLUPY_OPENDIR,
+ GLUPY_READDIR,
+ GLUPY_READDIRP,
+ GLUPY_STAT,
+ GLUPY_FSTAT,
+ GLUPY_STATFS,
+ GLUPY_SETXATTR,
+ GLUPY_GETXATTR,
+ GLUPY_FSETXATTR,
+ GLUPY_FGETXATTR,
+ GLUPY_REMOVEXATTR,
+ GLUPY_FREMOVEXATTR,
+ GLUPY_LINK,
+ GLUPY_UNLINK,
+ GLUPY_READLINK,
+ GLUPY_SYMLINK,
+ GLUPY_MKNOD,
+ GLUPY_MKDIR,
+ GLUPY_RMDIR,
+ GLUPY_N_FUNCS
};
typedef struct {
- PyObject *py_module;
- PyObject *py_xlator;
- long fops[GLUPY_N_FUNCS];
- long cbks[GLUPY_N_FUNCS];
+ PyObject *py_module;
+ PyObject *py_xlator;
+ long fops[GLUPY_N_FUNCS];
+ long cbks[GLUPY_N_FUNCS];
} glupy_private_t;
enum gf_glupy_mem_types_ {
- gf_glupy_mt_priv = gf_common_mt_end + 1,
- gf_glupy_mt_end
+ gf_glupy_mt_priv = gf_common_mt_end + 1,
+ gf_glupy_mt_end
};
#endif /* __GLUPY_H__ */
diff --git a/xlators/features/index/src/index-mem-types.h b/xlators/features/index/src/index-mem-types.h
index ca291cfba7e..f5d456e84be 100644
--- a/xlators/features/index/src/index-mem-types.h
+++ b/xlators/features/index/src/index-mem-types.h
@@ -14,10 +14,10 @@
#include "mem-types.h"
enum gf_index_mem_types_ {
- gf_index_mt_priv_t = gf_common_mt_end + 1,
- gf_index_inode_ctx_t = gf_common_mt_end + 2,
- gf_index_fd_ctx_t = gf_common_mt_end + 3,
- gf_index_mt_local_t = gf_common_mt_end + 4,
- gf_index_mt_end
+ gf_index_mt_priv_t = gf_common_mt_end + 1,
+ gf_index_inode_ctx_t = gf_common_mt_end + 2,
+ gf_index_fd_ctx_t = gf_common_mt_end + 3,
+ gf_index_mt_local_t = gf_common_mt_end + 4,
+ gf_index_mt_end
};
#endif
diff --git a/xlators/features/index/src/index-messages.h b/xlators/features/index/src/index-messages.h
index 7ab2bb0ad4b..3495fb080f0 100644
--- a/xlators/features/index/src/index-messages.h
+++ b/xlators/features/index/src/index-messages.h
@@ -23,17 +23,11 @@
* glfs-message-id.h.
*/
-GLFS_MSGID(INDEX,
- INDEX_MSG_INDEX_DIR_CREATE_FAILED,
- INDEX_MSG_INDEX_READDIR_FAILED,
- INDEX_MSG_INDEX_ADD_FAILED,
- INDEX_MSG_INDEX_DEL_FAILED,
- INDEX_MSG_DICT_SET_FAILED,
- INDEX_MSG_INODE_CTX_GET_SET_FAILED,
- INDEX_MSG_INVALID_ARGS,
- INDEX_MSG_FD_OP_FAILED,
- INDEX_MSG_WORKER_THREAD_CREATE_FAILED,
- INDEX_MSG_INVALID_GRAPH
-);
+GLFS_MSGID(INDEX, INDEX_MSG_INDEX_DIR_CREATE_FAILED,
+ INDEX_MSG_INDEX_READDIR_FAILED, INDEX_MSG_INDEX_ADD_FAILED,
+ INDEX_MSG_INDEX_DEL_FAILED, INDEX_MSG_DICT_SET_FAILED,
+ INDEX_MSG_INODE_CTX_GET_SET_FAILED, INDEX_MSG_INVALID_ARGS,
+ INDEX_MSG_FD_OP_FAILED, INDEX_MSG_WORKER_THREAD_CREATE_FAILED,
+ INDEX_MSG_INVALID_GRAPH);
#endif /* !_INDEX_MESSAGES_H_ */
diff --git a/xlators/features/index/src/index.h b/xlators/features/index/src/index.h
index ae9091d69c9..f1e0293b794 100644
--- a/xlators/features/index/src/index.h
+++ b/xlators/features/index/src/index.h
@@ -18,71 +18,67 @@
#include "common-utils.h"
#include "index-mem-types.h"
-#define INDEX_THREAD_STACK_SIZE ((size_t)(1024*1024))
+#define INDEX_THREAD_STACK_SIZE ((size_t)(1024 * 1024))
-typedef enum {
- UNKNOWN,
- IN,
- NOTIN
-} index_state_t;
+typedef enum { UNKNOWN, IN, NOTIN } index_state_t;
typedef enum {
- XATTROP_TYPE_UNSET = -1,
- XATTROP,
- DIRTY,
- ENTRY_CHANGES,
- XATTROP_TYPE_END
+ XATTROP_TYPE_UNSET = -1,
+ XATTROP,
+ DIRTY,
+ ENTRY_CHANGES,
+ XATTROP_TYPE_END
} index_xattrop_type_t;
typedef struct index_inode_ctx {
- gf_boolean_t processing;
- struct list_head callstubs;
- int state[XATTROP_TYPE_END];
- uuid_t virtual_pargfid; /* virtual gfid of dir under
- .glusterfs/indices/entry-changes. */
+ gf_boolean_t processing;
+ struct list_head callstubs;
+ int state[XATTROP_TYPE_END];
+ uuid_t virtual_pargfid; /* virtual gfid of dir under
+ .glusterfs/indices/entry-changes. */
} index_inode_ctx_t;
typedef struct index_fd_ctx {
- DIR *dir;
- off_t dir_eof;
+ DIR *dir;
+ off_t dir_eof;
} index_fd_ctx_t;
typedef struct index_priv {
- char *index_basepath;
- char *dirty_basepath;
- uuid_t index;
- gf_lock_t lock;
- uuid_t internal_vgfid[XATTROP_TYPE_END];
- struct list_head callstubs;
- pthread_mutex_t mutex;
- pthread_cond_t cond;
- dict_t *dirty_watchlist;
- dict_t *pending_watchlist;
- dict_t *complete_watchlist;
- int64_t pending_count;
- pthread_t thread;
- gf_boolean_t down;
+ char *index_basepath;
+ char *dirty_basepath;
+ uuid_t index;
+ gf_lock_t lock;
+ uuid_t internal_vgfid[XATTROP_TYPE_END];
+ struct list_head callstubs;
+ pthread_mutex_t mutex;
+ pthread_cond_t cond;
+ dict_t *dirty_watchlist;
+ dict_t *pending_watchlist;
+ dict_t *complete_watchlist;
+ int64_t pending_count;
+ pthread_t thread;
+ gf_boolean_t down;
} index_priv_t;
typedef struct index_local {
- inode_t *inode;
- dict_t *xdata;
+ inode_t *inode;
+ dict_t *xdata;
} index_local_t;
-#define INDEX_STACK_UNWIND(fop, frame, params ...) \
-do { \
- index_local_t *__local = NULL; \
- if (frame) { \
- __local = frame->local; \
- frame->local = NULL; \
- } \
- STACK_UNWIND_STRICT (fop, frame, params); \
- if (__local) { \
- inode_unref (__local->inode); \
- if (__local->xdata) \
- dict_unref (__local->xdata); \
- mem_put (__local); \
- } \
-} while (0)
+#define INDEX_STACK_UNWIND(fop, frame, params...) \
+ do { \
+ index_local_t *__local = NULL; \
+ if (frame) { \
+ __local = frame->local; \
+ frame->local = NULL; \
+ } \
+ STACK_UNWIND_STRICT(fop, frame, params); \
+ if (__local) { \
+ inode_unref(__local->inode); \
+ if (__local->xdata) \
+ dict_unref(__local->xdata); \
+ mem_put(__local); \
+ } \
+ } while (0)
#endif
diff --git a/xlators/features/leases/src/leases-mem-types.h b/xlators/features/leases/src/leases-mem-types.h
index d1a59c1db2e..59d3cbaf0b3 100644
--- a/xlators/features/leases/src/leases-mem-types.h
+++ b/xlators/features/leases/src/leases-mem-types.h
@@ -14,15 +14,15 @@
#include "mem-types.h"
enum gf_leases_mem_types_ {
- gf_leases_mt_conf_t = gf_common_mt_end + 1,
- gf_leases_mt_private_t,
- gf_leases_mt_lease_client_t,
- gf_leases_mt_lease_inode_t,
- gf_leases_mt_fd_ctx_t,
- gf_leases_mt_lease_inode_ctx_t,
- gf_leases_mt_lease_id_entry_t,
- gf_leases_mt_fop_stub_t,
- gf_leases_mt_timer_data_t,
- gf_leases_mt_end
+ gf_leases_mt_conf_t = gf_common_mt_end + 1,
+ gf_leases_mt_private_t,
+ gf_leases_mt_lease_client_t,
+ gf_leases_mt_lease_inode_t,
+ gf_leases_mt_fd_ctx_t,
+ gf_leases_mt_lease_inode_ctx_t,
+ gf_leases_mt_lease_id_entry_t,
+ gf_leases_mt_fop_stub_t,
+ gf_leases_mt_timer_data_t,
+ gf_leases_mt_end
};
#endif
diff --git a/xlators/features/leases/src/leases-messages.h b/xlators/features/leases/src/leases-messages.h
index f4dc169b8d6..81a517f63cd 100644
--- a/xlators/features/leases/src/leases-messages.h
+++ b/xlators/features/leases/src/leases-messages.h
@@ -23,18 +23,11 @@
* glfs-message-id.h.
*/
-GLFS_MSGID(LEASES,
- LEASE_MSG_NO_MEM,
- LEASE_MSG_RECALL_FAIL,
- LEASE_MSG_INVAL_LEASE_ID,
- LEASE_MSG_INVAL_UNLK_LEASE,
- LEASE_MSG_INVAL_INODE_CTX,
- LEASE_MSG_NOT_ENABLED,
- LEASE_MSG_NO_TIMER_WHEEL,
- LEASE_MSG_CLNT_NOTFOUND,
- LEASE_MSG_INODE_NOTFOUND,
- LEASE_MSG_INVAL_FD_CTX,
- LEASE_MSG_INVAL_LEASE_TYPE
-);
+GLFS_MSGID(LEASES, LEASE_MSG_NO_MEM, LEASE_MSG_RECALL_FAIL,
+ LEASE_MSG_INVAL_LEASE_ID, LEASE_MSG_INVAL_UNLK_LEASE,
+ LEASE_MSG_INVAL_INODE_CTX, LEASE_MSG_NOT_ENABLED,
+ LEASE_MSG_NO_TIMER_WHEEL, LEASE_MSG_CLNT_NOTFOUND,
+ LEASE_MSG_INODE_NOTFOUND, LEASE_MSG_INVAL_FD_CTX,
+ LEASE_MSG_INVAL_LEASE_TYPE);
#endif /* !_LEASES_MESSAGES_H_ */
diff --git a/xlators/features/leases/src/leases.h b/xlators/features/leases/src/leases.h
index 80dbcbb06b9..d5fc451289d 100644
--- a/xlators/features/leases/src/leases.h
+++ b/xlators/features/leases/src/leases.h
@@ -39,24 +39,27 @@
#define BLOCK_FOP 0x0001
#define WIND_FOP 0x0002
-#define EXIT_IF_LEASES_OFF(this, label) do { \
+#define EXIT_IF_LEASES_OFF(this, label) \
+ do { \
if (!is_leases_enabled(this)) \
- goto label; \
-} while (0)
+ goto label; \
+ } while (0)
-#define GET_LEASE_ID(xdata, lease_id, client_uid) do { \
- int ret_val = -1; \
- ret_val = dict_get_bin (xdata, "lease-id", (void **)&lease_id); \
+#define GET_LEASE_ID(xdata, lease_id, client_uid) \
+ do { \
+ int ret_val = -1; \
+ ret_val = dict_get_bin(xdata, "lease-id", (void **)&lease_id); \
if (ret_val) { \
- ret_val = 0; \
- gf_msg_debug ("leases", 0, "Lease id is not set for client:%s", client_uid); \
+ ret_val = 0; \
+ gf_msg_debug("leases", 0, "Lease id is not set for client:%s", \
+ client_uid); \
} \
-} while (0)
+ } while (0)
#define GET_FLAGS(fop, fd_flags) \
-do { \
+ do { \
if ((fd_flags & (O_WRONLY | O_RDWR)) && fop == GF_FOP_OPEN) \
- fop_flags = DATA_MODIFY_FOP; \
+ fop_flags = DATA_MODIFY_FOP; \
\
if (fop == GF_FOP_UNLINK || fop == GF_FOP_RENAME || \
fop == GF_FOP_TRUNCATE || fop == GF_FOP_FTRUNCATE || \
@@ -65,185 +68,181 @@ do { \
fop == GF_FOP_DISCARD || fop == GF_FOP_ZEROFILL || \
fop == GF_FOP_SETATTR || fop == GF_FOP_FSETATTR || \
fop == GF_FOP_LINK) \
- fop_flags = DATA_MODIFY_FOP; \
+ fop_flags = DATA_MODIFY_FOP; \
\
if (!(fd_flags & (O_NONBLOCK | O_NDELAY))) \
- fop_flags |= BLOCKING_FOP; \
+ fop_flags |= BLOCKING_FOP; \
\
-} while (0) \
-
+ } while (0)
#define GET_FLAGS_LK(cmd, l_type, fd_flags) \
-do { \
+ do { \
/* TODO: handle F_RESLK_LCK and other glusterfs_lk_recovery_cmds_t */ \
- if ((cmd == F_SETLKW || cmd == F_SETLKW64 || \
- cmd == F_SETLK || cmd == F_SETLK64) && \
+ if ((cmd == F_SETLKW || cmd == F_SETLKW64 || cmd == F_SETLK || \
+ cmd == F_SETLK64) && \
l_type == F_WRLCK) \
- fop_flags = DATA_MODIFY_FOP; \
+ fop_flags = DATA_MODIFY_FOP; \
\
if (fd_flags & (O_NONBLOCK | O_NDELAY) && \
(cmd == F_SETLKW || cmd == F_SETLKW64)) \
- fop_flags |= BLOCKING_FOP; \
+ fop_flags |= BLOCKING_FOP; \
\
-} while (0) \
+ } while (0)
-#define LEASE_BLOCK_FOP(inode, fop_name, frame, this, params ...) \
-do { \
- call_stub_t *__stub = NULL; \
- fop_stub_t *blk_fop = NULL; \
- lease_inode_ctx_t *lease_ctx = NULL; \
+#define LEASE_BLOCK_FOP(inode, fop_name, frame, this, params...) \
+ do { \
+ call_stub_t *__stub = NULL; \
+ fop_stub_t *blk_fop = NULL; \
+ lease_inode_ctx_t *lease_ctx = NULL; \
\
- __stub = fop_##fop_name##_stub (frame, default_##fop_name##_resume, \
- params); \
+ __stub = fop_##fop_name##_stub(frame, default_##fop_name##_resume, \
+ params); \
if (!__stub) { \
- gf_msg (this->name, GF_LOG_WARNING, ENOMEM, \
- LEASE_MSG_NO_MEM, \
- "Unable to create stub"); \
- ret = -ENOMEM; \
- goto __out; \
+ gf_msg(this->name, GF_LOG_WARNING, ENOMEM, LEASE_MSG_NO_MEM, \
+ "Unable to create stub"); \
+ ret = -ENOMEM; \
+ goto __out; \
} \
\
- blk_fop = GF_CALLOC (1, sizeof (*blk_fop), \
- gf_leases_mt_fop_stub_t); \
+ blk_fop = GF_CALLOC(1, sizeof(*blk_fop), gf_leases_mt_fop_stub_t); \
if (!blk_fop) { \
- gf_msg (this->name, GF_LOG_WARNING, ENOMEM, \
- LEASE_MSG_NO_MEM, \
- "Unable to create lease fop stub"); \
- ret = -ENOMEM; \
- goto __out; \
+ gf_msg(this->name, GF_LOG_WARNING, ENOMEM, LEASE_MSG_NO_MEM, \
+ "Unable to create lease fop stub"); \
+ ret = -ENOMEM; \
+ goto __out; \
} \
\
- lease_ctx = lease_ctx_get (inode, this); \
+ lease_ctx = lease_ctx_get(inode, this); \
if (!lease_ctx) { \
- gf_msg (this->name, GF_LOG_WARNING, ENOMEM, \
- LEASE_MSG_NO_MEM, \
- "Unable to create/get inode ctx"); \
- ret = -ENOMEM; \
- goto __out; \
+ gf_msg(this->name, GF_LOG_WARNING, ENOMEM, LEASE_MSG_NO_MEM, \
+ "Unable to create/get inode ctx"); \
+ ret = -ENOMEM; \
+ goto __out; \
} \
\
blk_fop->stub = __stub; \
- pthread_mutex_lock (&lease_ctx->lock); \
+ pthread_mutex_lock(&lease_ctx->lock); \
{ \
- /*TODO: If the lease is unlocked btw check lease conflict and \
- * by now, then this fop shouldn't be add to the blocked fop \
- * list, can use generation number for the same?*/ \
- list_add_tail (&blk_fop->list, &lease_ctx->blocked_list); \
+ /*TODO: If the lease is unlocked btw check lease conflict and \
+ * by now, then this fop shouldn't be add to the blocked fop \
+ * list, can use generation number for the same?*/ \
+ list_add_tail(&blk_fop->list, &lease_ctx->blocked_list); \
} \
- pthread_mutex_unlock (&lease_ctx->lock); \
+ pthread_mutex_unlock(&lease_ctx->lock); \
\
-__out: \
+ __out: \
if (ret < 0) { \
- gf_msg (this->name, GF_LOG_WARNING, ENOMEM, LEASE_MSG_NO_MEM, \
- "Unable to create stub for blocking the fop:%s (%s)", \
- gf_fop_list[frame->root->op], strerror(ENOMEM)); \
- if (__stub != NULL) { \
- call_stub_destroy (__stub); \
- } \
- GF_FREE (blk_fop); \
- goto err; \
+ gf_msg(this->name, GF_LOG_WARNING, ENOMEM, LEASE_MSG_NO_MEM, \
+ "Unable to create stub for blocking the fop:%s (%s)", \
+ gf_fop_list[frame->root->op], strerror(ENOMEM)); \
+ if (__stub != NULL) { \
+ call_stub_destroy(__stub); \
+ } \
+ GF_FREE(blk_fop); \
+ goto err; \
} \
-} while (0) \
+ } while (0)
struct _leases_private {
- gf_boolean_t leases_enabled;
- int32_t recall_lease_timeout;
- struct list_head client_list;
- struct list_head recall_list;
- struct tvec_base *timer_wheel; /* timer wheel where the recall request
- is qued and waits for unlock/expiry */
- gf_boolean_t fini;
- pthread_t recall_thr;
- gf_boolean_t inited_recall_thr;
- pthread_mutex_t mutex;
- pthread_cond_t cond;
+ gf_boolean_t leases_enabled;
+ int32_t recall_lease_timeout;
+ struct list_head client_list;
+ struct list_head recall_list;
+ struct tvec_base *timer_wheel; /* timer wheel where the recall request
+ is qued and waits for unlock/expiry */
+ gf_boolean_t fini;
+ pthread_t recall_thr;
+ gf_boolean_t inited_recall_thr;
+ pthread_mutex_t mutex;
+ pthread_cond_t cond;
};
typedef struct _leases_private leases_private_t;
struct _lease_client {
- char *client_uid;
- struct list_head client_list;
- struct list_head inode_list;
+ char *client_uid;
+ struct list_head client_list;
+ struct list_head inode_list;
};
typedef struct _lease_client lease_client_t;
struct _lease_inode {
- inode_t *inode;
- struct list_head list; /* This can be part of both inode_list and recall_list */
+ inode_t *inode;
+ struct list_head
+ list; /* This can be part of both inode_list and recall_list */
};
typedef struct _lease_inode lease_inode_t;
struct _lease_fd_ctx {
- char *client_uid;
- char lease_id[LEASE_ID_SIZE];
+ char *client_uid;
+ char lease_id[LEASE_ID_SIZE];
};
typedef struct _lease_fd_ctx lease_fd_ctx_t;
struct _lease_inode_ctx {
- struct list_head lease_id_list; /* clients that have taken leases */
- int lease_type_cnt[GF_LEASE_MAX_TYPE+1];
- int lease_type; /* Types of leases acquired */
- uint64_t lease_cnt; /* Total number of leases on this inode */
- uint64_t openfd_cnt; /* number of fds open */
- gf_boolean_t recall_in_progress; /* if lease recall is sent on this inode */
- struct list_head blocked_list; /* List of fops blocked until the
- lease recall is complete */
- inode_t *inode; /* this represents the inode on which the
- lock was taken, required mainly during
- disconnect cleanup */
- struct gf_tw_timer_list *timer;
- pthread_mutex_t lock;
+ struct list_head lease_id_list; /* clients that have taken leases */
+ int lease_type_cnt[GF_LEASE_MAX_TYPE + 1];
+ int lease_type; /* Types of leases acquired */
+ uint64_t lease_cnt; /* Total number of leases on this inode */
+ uint64_t openfd_cnt; /* number of fds open */
+ gf_boolean_t recall_in_progress; /* if lease recall is sent on this inode */
+ struct list_head blocked_list; /* List of fops blocked until the
+ lease recall is complete */
+ inode_t *inode; /* this represents the inode on which the
+ lock was taken, required mainly during
+ disconnect cleanup */
+ struct gf_tw_timer_list *timer;
+ pthread_mutex_t lock;
};
typedef struct _lease_inode_ctx lease_inode_ctx_t;
struct _lease_id_entry {
- struct list_head lease_id_list;
- char lease_id[LEASE_ID_SIZE];
- char *client_uid; /* uid of the client that has
- taken the lease */
- int lease_type_cnt[GF_LEASE_MAX_TYPE+1]; /* count of each lease type */
- int lease_type; /* Union of all the leases taken
- under the given lease id */
- uint64_t lease_cnt; /* Number of leases taken under the
- given lease id */
- time_t recall_time; /* time @ which recall was sent */
+ struct list_head lease_id_list;
+ char lease_id[LEASE_ID_SIZE];
+ char *client_uid; /* uid of the client that has
+ taken the lease */
+ int lease_type_cnt[GF_LEASE_MAX_TYPE + 1]; /* count of each lease type */
+ int lease_type; /* Union of all the leases taken
+ under the given lease id */
+ uint64_t lease_cnt; /* Number of leases taken under the
+ given lease id */
+ time_t recall_time; /* time @ which recall was sent */
};
typedef struct _lease_id_entry lease_id_entry_t;
/* Required? as stub itself will have list */
struct __fop_stub {
- struct list_head list;
- call_stub_t *stub;
+ struct list_head list;
+ call_stub_t *stub;
};
typedef struct __fop_stub fop_stub_t;
struct __lease_timer_data {
- inode_t *inode;
- xlator_t *this;
+ inode_t *inode;
+ xlator_t *this;
};
typedef struct __lease_timer_data lease_timer_data_t;
gf_boolean_t
-is_leases_enabled (xlator_t *this);
+is_leases_enabled(xlator_t *this);
int32_t
-get_recall_lease_timeout (xlator_t *this);
+get_recall_lease_timeout(xlator_t *this);
lease_inode_ctx_t *
-lease_ctx_get (inode_t *inode, xlator_t *this);
+lease_ctx_get(inode_t *inode, xlator_t *this);
int
-process_lease_req (call_frame_t *frame, xlator_t *this,
- inode_t *inode, struct gf_lease *lease);
+process_lease_req(call_frame_t *frame, xlator_t *this, inode_t *inode,
+ struct gf_lease *lease);
int
-check_lease_conflict (call_frame_t *frame, inode_t *inode,
- const char *lease_id, uint32_t fop_flags);
+check_lease_conflict(call_frame_t *frame, inode_t *inode, const char *lease_id,
+ uint32_t fop_flags);
int
-cleanup_client_leases (xlator_t *this, const char *client_uid);
+cleanup_client_leases(xlator_t *this, const char *client_uid);
void *
-expired_recall_cleanup (void *data);
+expired_recall_cleanup(void *data);
#endif /* _LEASES_H */
diff --git a/xlators/features/locks/src/clear.h b/xlators/features/locks/src/clear.h
index 78fc5ae3398..08662746f98 100644
--- a/xlators/features/locks/src/clear.h
+++ b/xlators/features/locks/src/clear.h
@@ -16,56 +16,56 @@
#include "locks.h"
typedef enum {
- CLRLK_INODE,
- CLRLK_ENTRY,
- CLRLK_POSIX,
- CLRLK_TYPE_MAX
+ CLRLK_INODE,
+ CLRLK_ENTRY,
+ CLRLK_POSIX,
+ CLRLK_TYPE_MAX
} clrlk_type;
typedef enum {
- CLRLK_BLOCKED = 1,
- CLRLK_GRANTED,
- CLRLK_ALL,
- CLRLK_KIND_MAX
+ CLRLK_BLOCKED = 1,
+ CLRLK_GRANTED,
+ CLRLK_ALL,
+ CLRLK_KIND_MAX
} clrlk_kind;
typedef enum {
- KW_TYPE,
- KW_KIND,
- /*add new keywords here*/
- KW_MAX
+ KW_TYPE,
+ KW_KIND,
+ /*add new keywords here*/
+ KW_MAX
} clrlk_opts;
struct _clrlk_args;
typedef struct _clrlk_args clrlk_args;
struct _clrlk_args {
- int type;
- int kind;
- char *opts;
+ int type;
+ int kind;
+ char *opts;
};
int
-clrlk_get__kind (char *kind);
+clrlk_get__kind(char *kind);
int
-clrlk_get_type (char *type);
+clrlk_get_type(char *type);
int
-clrlk_get_lock_range (char *range_str, struct gf_flock *ulock,
- gf_boolean_t *chk_range);
+clrlk_get_lock_range(char *range_str, struct gf_flock *ulock,
+ gf_boolean_t *chk_range);
int
-clrlk_parse_args (const char* cmd, clrlk_args *args);
+clrlk_parse_args(const char *cmd, clrlk_args *args);
int
-clrlk_clear_posixlk (xlator_t *this, pl_inode_t *pl_inode, clrlk_args *args,
- int *blkd, int *granted, int *op_errno);
+clrlk_clear_posixlk(xlator_t *this, pl_inode_t *pl_inode, clrlk_args *args,
+ int *blkd, int *granted, int *op_errno);
int
-clrlk_clear_inodelk (xlator_t *this, pl_inode_t *pl_inode, pl_dom_list_t *dom,
- clrlk_args *args, int *blkd, int *granted, int *op_errno);
+clrlk_clear_inodelk(xlator_t *this, pl_inode_t *pl_inode, pl_dom_list_t *dom,
+ clrlk_args *args, int *blkd, int *granted, int *op_errno);
int
-clrlk_clear_entrylk (xlator_t *this, pl_inode_t *pl_inode, pl_dom_list_t *dom,
- clrlk_args *args, int *blkd, int *granted, int *op_errno);
+clrlk_clear_entrylk(xlator_t *this, pl_inode_t *pl_inode, pl_dom_list_t *dom,
+ clrlk_args *args, int *blkd, int *granted, int *op_errno);
int
-clrlk_clear_lks_in_all_domains (xlator_t *this, pl_inode_t *pl_inode,
- clrlk_args *args, int *blkd, int *granted,
- int *op_errno);
+clrlk_clear_lks_in_all_domains(xlator_t *this, pl_inode_t *pl_inode,
+ clrlk_args *args, int *blkd, int *granted,
+ int *op_errno);
#endif /* __CLEAR_H__ */
diff --git a/xlators/features/locks/src/common.h b/xlators/features/locks/src/common.h
index 50c156feb38..c3d0e361933 100644
--- a/xlators/features/locks/src/common.h
+++ b/xlators/features/locks/src/common.h
@@ -12,163 +12,173 @@
#include "lkowner.h"
/*dump locks format strings */
-#define RANGE_FMT "type=%s, whence=%hd, start=%llu, len=%llu"
-#define ENTRY_FMT "type=%s on basename=%s"
-#define DUMP_GEN_FMT "pid = %llu, owner=%s, client=%p"
-#define GRNTD_AT "granted at %s"
-#define BLKD_AT "blocked at %s"
-#define CONN_ID "connection-id=%s"
-#define DUMP_BLKD_FMT DUMP_GEN_FMT", "CONN_ID", "BLKD_AT
-#define DUMP_GRNTD_FMT DUMP_GEN_FMT", "CONN_ID", "GRNTD_AT
-#define DUMP_BLKD_GRNTD_FMT DUMP_GEN_FMT", "CONN_ID", "BLKD_AT", "GRNTD_AT
-
-#define ENTRY_BLKD_FMT ENTRY_FMT", "DUMP_BLKD_FMT
-#define ENTRY_GRNTD_FMT ENTRY_FMT", "DUMP_GRNTD_FMT
-#define ENTRY_BLKD_GRNTD_FMT ENTRY_FMT", "DUMP_BLKD_GRNTD_FMT
-
-#define RANGE_BLKD_FMT RANGE_FMT", "DUMP_BLKD_FMT
-#define RANGE_GRNTD_FMT RANGE_FMT", "DUMP_GRNTD_FMT
-#define RANGE_BLKD_GRNTD_FMT RANGE_FMT", "DUMP_BLKD_GRNTD_FMT
+#define RANGE_FMT "type=%s, whence=%hd, start=%llu, len=%llu"
+#define ENTRY_FMT "type=%s on basename=%s"
+#define DUMP_GEN_FMT "pid = %llu, owner=%s, client=%p"
+#define GRNTD_AT "granted at %s"
+#define BLKD_AT "blocked at %s"
+#define CONN_ID "connection-id=%s"
+#define DUMP_BLKD_FMT DUMP_GEN_FMT ", " CONN_ID ", " BLKD_AT
+#define DUMP_GRNTD_FMT DUMP_GEN_FMT ", " CONN_ID ", " GRNTD_AT
+#define DUMP_BLKD_GRNTD_FMT DUMP_GEN_FMT ", " CONN_ID ", " BLKD_AT ", " GRNTD_AT
+
+#define ENTRY_BLKD_FMT ENTRY_FMT ", " DUMP_BLKD_FMT
+#define ENTRY_GRNTD_FMT ENTRY_FMT ", " DUMP_GRNTD_FMT
+#define ENTRY_BLKD_GRNTD_FMT ENTRY_FMT ", " DUMP_BLKD_GRNTD_FMT
+
+#define RANGE_BLKD_FMT RANGE_FMT ", " DUMP_BLKD_FMT
+#define RANGE_GRNTD_FMT RANGE_FMT ", " DUMP_GRNTD_FMT
+#define RANGE_BLKD_GRNTD_FMT RANGE_FMT ", " DUMP_BLKD_GRNTD_FMT
#define SET_FLOCK_PID(flock, lock) ((flock)->l_pid = lock->client_pid)
-
posix_lock_t *
-new_posix_lock (struct gf_flock *flock, client_t *client, pid_t client_pid,
- gf_lkowner_t *owner, fd_t *fd, uint32_t lk_flags,
- int can_block);
+new_posix_lock(struct gf_flock *flock, client_t *client, pid_t client_pid,
+ gf_lkowner_t *owner, fd_t *fd, uint32_t lk_flags, int can_block);
pl_inode_t *
-pl_inode_get (xlator_t *this, inode_t *inode);
+pl_inode_get(xlator_t *this, inode_t *inode);
posix_lock_t *
-pl_getlk (pl_inode_t *inode, posix_lock_t *lock);
+pl_getlk(pl_inode_t *inode, posix_lock_t *lock);
int
-pl_setlk (xlator_t *this, pl_inode_t *inode, posix_lock_t *lock,
- int can_block);
+pl_setlk(xlator_t *this, pl_inode_t *inode, posix_lock_t *lock, int can_block);
void
-grant_blocked_locks (xlator_t *this, pl_inode_t *inode);
+grant_blocked_locks(xlator_t *this, pl_inode_t *inode);
void
-posix_lock_to_flock (posix_lock_t *lock, struct gf_flock *flock);
+posix_lock_to_flock(posix_lock_t *lock, struct gf_flock *flock);
int
-locks_overlap (posix_lock_t *l1, posix_lock_t *l2);
+locks_overlap(posix_lock_t *l1, posix_lock_t *l2);
int
-same_owner (posix_lock_t *l1, posix_lock_t *l2);
+same_owner(posix_lock_t *l1, posix_lock_t *l2);
-void __delete_lock (posix_lock_t *);
+void
+__delete_lock(posix_lock_t *);
-void __destroy_lock (posix_lock_t *);
+void
+__destroy_lock(posix_lock_t *);
pl_dom_list_t *
-get_domain (pl_inode_t *pl_inode, const char *volume);
+get_domain(pl_inode_t *pl_inode, const char *volume);
void
-grant_blocked_inode_locks (xlator_t *this, pl_inode_t *pl_inode,
- pl_dom_list_t *dom, struct timespec *now,
- struct list_head *contend);
+grant_blocked_inode_locks(xlator_t *this, pl_inode_t *pl_inode,
+ pl_dom_list_t *dom, struct timespec *now,
+ struct list_head *contend);
void
-inodelk_contention_notify (xlator_t *this, struct list_head *contend);
+inodelk_contention_notify(xlator_t *this, struct list_head *contend);
void
-__delete_inode_lock (pl_inode_lock_t *lock);
+__delete_inode_lock(pl_inode_lock_t *lock);
void
-__pl_inodelk_unref (pl_inode_lock_t *lock);
+__pl_inodelk_unref(pl_inode_lock_t *lock);
void
-grant_blocked_entry_locks (xlator_t *this, pl_inode_t *pl_inode,
- pl_dom_list_t *dom, struct timespec *now,
- struct list_head *contend);
+grant_blocked_entry_locks(xlator_t *this, pl_inode_t *pl_inode,
+ pl_dom_list_t *dom, struct timespec *now,
+ struct list_head *contend);
void
-entrylk_contention_notify (xlator_t *this, struct list_head *contend);
+entrylk_contention_notify(xlator_t *this, struct list_head *contend);
-void pl_update_refkeeper (xlator_t *this, inode_t *inode);
+void
+pl_update_refkeeper(xlator_t *this, inode_t *inode);
int32_t
-__get_inodelk_count (xlator_t *this, pl_inode_t *pl_inode, char *domname);
+__get_inodelk_count(xlator_t *this, pl_inode_t *pl_inode, char *domname);
int32_t
-get_inodelk_count (xlator_t *this, inode_t *inode, char *domname);
+get_inodelk_count(xlator_t *this, inode_t *inode, char *domname);
int32_t
-__get_entrylk_count (xlator_t *this, pl_inode_t *pl_inode);
+__get_entrylk_count(xlator_t *this, pl_inode_t *pl_inode);
int32_t
-get_entrylk_count (xlator_t *this, inode_t *inode);
+get_entrylk_count(xlator_t *this, inode_t *inode);
-void pl_trace_in (xlator_t *this, call_frame_t *frame, fd_t *fd, loc_t *loc,
- int cmd, struct gf_flock *flock, const char *domain);
+void
+pl_trace_in(xlator_t *this, call_frame_t *frame, fd_t *fd, loc_t *loc, int cmd,
+ struct gf_flock *flock, const char *domain);
-void pl_trace_out (xlator_t *this, call_frame_t *frame, fd_t *fd, loc_t *loc,
- int cmd, struct gf_flock *flock, int op_ret, int op_errno, const char *domain);
+void
+pl_trace_out(xlator_t *this, call_frame_t *frame, fd_t *fd, loc_t *loc, int cmd,
+ struct gf_flock *flock, int op_ret, int op_errno,
+ const char *domain);
-void pl_trace_block (xlator_t *this, call_frame_t *frame, fd_t *fd, loc_t *loc,
- int cmd, struct gf_flock *flock, const char *domain);
+void
+pl_trace_block(xlator_t *this, call_frame_t *frame, fd_t *fd, loc_t *loc,
+ int cmd, struct gf_flock *flock, const char *domain);
-void pl_trace_flush (xlator_t *this, call_frame_t *frame, fd_t *fd);
+void
+pl_trace_flush(xlator_t *this, call_frame_t *frame, fd_t *fd);
-void entrylk_trace_in (xlator_t *this, call_frame_t *frame, const char *volume,
- fd_t *fd, loc_t *loc, const char *basename,
- entrylk_cmd cmd, entrylk_type type);
+void
+entrylk_trace_in(xlator_t *this, call_frame_t *frame, const char *volume,
+ fd_t *fd, loc_t *loc, const char *basename, entrylk_cmd cmd,
+ entrylk_type type);
-void entrylk_trace_out (xlator_t *this, call_frame_t *frame, const char *volume,
- fd_t *fd, loc_t *loc, const char *basename,
- entrylk_cmd cmd, entrylk_type type,
- int op_ret, int op_errno);
+void
+entrylk_trace_out(xlator_t *this, call_frame_t *frame, const char *volume,
+ fd_t *fd, loc_t *loc, const char *basename, entrylk_cmd cmd,
+ entrylk_type type, int op_ret, int op_errno);
-void entrylk_trace_block (xlator_t *this, call_frame_t *frame, const char *volume,
- fd_t *fd, loc_t *loc, const char *basename,
- entrylk_cmd cmd, entrylk_type type);
+void
+entrylk_trace_block(xlator_t *this, call_frame_t *frame, const char *volume,
+ fd_t *fd, loc_t *loc, const char *basename, entrylk_cmd cmd,
+ entrylk_type type);
void
-pl_print_verdict (char *str, int size, int op_ret, int op_errno);
+pl_print_verdict(char *str, int size, int op_ret, int op_errno);
void
-pl_print_lockee (char *str, int size, fd_t *fd, loc_t *loc);
+pl_print_lockee(char *str, int size, fd_t *fd, loc_t *loc);
void
-pl_print_locker (char *str, int size, xlator_t *this, call_frame_t *frame);
+pl_print_locker(char *str, int size, xlator_t *this, call_frame_t *frame);
void
-pl_print_inodelk (char *str, int size, int cmd, struct gf_flock *flock, const char *domain);
+pl_print_inodelk(char *str, int size, int cmd, struct gf_flock *flock,
+ const char *domain);
void
-pl_trace_release (xlator_t *this, fd_t *fd);
+pl_trace_release(xlator_t *this, fd_t *fd);
unsigned long
-fd_to_fdnum (fd_t *fd);
+fd_to_fdnum(fd_t *fd);
fd_t *
-fd_from_fdnum (posix_lock_t *lock);
+fd_from_fdnum(posix_lock_t *lock);
int
-pl_reserve_setlk (xlator_t *this, pl_inode_t *pl_inode, posix_lock_t *lock,
- int can_block);
+pl_reserve_setlk(xlator_t *this, pl_inode_t *pl_inode, posix_lock_t *lock,
+ int can_block);
int
-reservelks_equal (posix_lock_t *l1, posix_lock_t *l2);
+reservelks_equal(posix_lock_t *l1, posix_lock_t *l2);
int
-pl_verify_reservelk (xlator_t *this, pl_inode_t *pl_inode,
- posix_lock_t *lock, int can_block);
+pl_verify_reservelk(xlator_t *this, pl_inode_t *pl_inode, posix_lock_t *lock,
+ int can_block);
int
-pl_reserve_unlock (xlator_t *this, pl_inode_t *pl_inode, posix_lock_t *reqlock);
+pl_reserve_unlock(xlator_t *this, pl_inode_t *pl_inode, posix_lock_t *reqlock);
int32_t
-check_entrylk_on_basename (xlator_t *this, inode_t *parent, char *basename);
+check_entrylk_on_basename(xlator_t *this, inode_t *parent, char *basename);
-void __pl_inodelk_unref (pl_inode_lock_t *lock);
-void __pl_entrylk_unref (pl_entry_lock_t *lock);
+void
+__pl_inodelk_unref(pl_inode_lock_t *lock);
+void
+__pl_entrylk_unref(pl_entry_lock_t *lock);
int
-pl_metalock_is_active (pl_inode_t *pl_inode);
+pl_metalock_is_active(pl_inode_t *pl_inode);
int
-__pl_queue_lock (pl_inode_t *pl_inode, posix_lock_t *reqlock, int can_block);
+__pl_queue_lock(pl_inode_t *pl_inode, posix_lock_t *reqlock, int can_block);
gf_boolean_t
pl_does_monkey_want_stuck_lock();
diff --git a/xlators/features/locks/src/locks-mem-types.h b/xlators/features/locks/src/locks-mem-types.h
index a48b35c2044..240c1957a42 100644
--- a/xlators/features/locks/src/locks-mem-types.h
+++ b/xlators/features/locks/src/locks-mem-types.h
@@ -14,17 +14,16 @@
#include "mem-types.h"
enum gf_locks_mem_types_ {
- gf_locks_mt_pl_dom_list_t = gf_common_mt_end + 1,
- gf_locks_mt_pl_inode_t,
- gf_locks_mt_posix_lock_t,
- gf_locks_mt_pl_entry_lock_t,
- gf_locks_mt_pl_inode_lock_t,
- gf_locks_mt_truncate_ops,
- gf_locks_mt_pl_rw_req_t,
- gf_locks_mt_posix_locks_private_t,
- gf_locks_mt_pl_fdctx_t,
- gf_locks_mt_pl_meta_lock_t,
- gf_locks_mt_end
+ gf_locks_mt_pl_dom_list_t = gf_common_mt_end + 1,
+ gf_locks_mt_pl_inode_t,
+ gf_locks_mt_posix_lock_t,
+ gf_locks_mt_pl_entry_lock_t,
+ gf_locks_mt_pl_inode_lock_t,
+ gf_locks_mt_truncate_ops,
+ gf_locks_mt_pl_rw_req_t,
+ gf_locks_mt_posix_locks_private_t,
+ gf_locks_mt_pl_fdctx_t,
+ gf_locks_mt_pl_meta_lock_t,
+ gf_locks_mt_end
};
#endif
-
diff --git a/xlators/features/locks/src/locks.h b/xlators/features/locks/src/locks.h
index e9b75fb3f13..cf2849fc251 100644
--- a/xlators/features/locks/src/locks.h
+++ b/xlators/features/locks/src/locks.h
@@ -19,234 +19,233 @@
#include "lkowner.h"
typedef enum {
- MLK_NONE,
- MLK_FILE_BASED,
- MLK_FORCED,
- MLK_OPTIMAL
+ MLK_NONE,
+ MLK_FILE_BASED,
+ MLK_FORCED,
+ MLK_OPTIMAL
} mlk_mode_t; /* defines different mandatory locking modes*/
struct __pl_fd;
struct __posix_lock {
- struct list_head list;
+ struct list_head list;
- short fl_type;
- off_t fl_start;
- off_t fl_end;
- uint32_t lk_flags;
+ short fl_type;
+ off_t fl_start;
+ off_t fl_end;
+ uint32_t lk_flags;
- short blocked; /* waiting to acquire */
- struct gf_flock user_flock; /* the flock supplied by the user */
- xlator_t *this; /* required for blocked locks */
- unsigned long fd_num;
+ short blocked; /* waiting to acquire */
+ struct gf_flock user_flock; /* the flock supplied by the user */
+ xlator_t *this; /* required for blocked locks */
+ unsigned long fd_num;
- fd_t *fd;
- call_frame_t *frame;
+ fd_t *fd;
+ call_frame_t *frame;
- struct timeval blkd_time; /*time at which lock was queued into blkd list*/
- struct timeval granted_time; /*time at which lock was queued into active list*/
+ struct timeval blkd_time; /*time at which lock was queued into blkd list*/
+ struct timeval
+ granted_time; /*time at which lock was queued into active list*/
- /* These two together serve to uniquely identify each process
- across nodes */
+ /* These two together serve to uniquely identify each process
+ across nodes */
- void *client; /* to identify client node */
+ void *client; /* to identify client node */
- /* This field uniquely identifies the client the lock belongs to. As
- * lock migration is handled by rebalance, the client_t object will be
- * overwritten by rebalance and can't be deemed as the owner of the
- * lock on destination. Hence, the below field is migrated from
- * source to destination by lock_migration_info_t and updated on the
- * destination. So that on client-server disconnection, server can
- * cleanup the locks proper;y. */
+ /* This field uniquely identifies the client the lock belongs to. As
+ * lock migration is handled by rebalance, the client_t object will be
+ * overwritten by rebalance and can't be deemed as the owner of the
+ * lock on destination. Hence, the below field is migrated from
+ * source to destination by lock_migration_info_t and updated on the
+ * destination. So that on client-server disconnection, server can
+ * cleanup the locks proper;y. */
- char *client_uid;
- gf_lkowner_t owner;
- pid_t client_pid; /* pid of client process */
+ char *client_uid;
+ gf_lkowner_t owner;
+ pid_t client_pid; /* pid of client process */
- int blocking;
+ int blocking;
};
typedef struct __posix_lock posix_lock_t;
struct __pl_inode_lock {
- struct list_head list;
- struct list_head blocked_locks; /* list_head pointing to blocked_inodelks */
- struct list_head contend; /* list of contending locks */
- int ref;
+ struct list_head list;
+ struct list_head blocked_locks; /* list_head pointing to blocked_inodelks */
+ struct list_head contend; /* list of contending locks */
+ int ref;
- short fl_type;
- off_t fl_start;
- off_t fl_end;
+ short fl_type;
+ off_t fl_start;
+ off_t fl_end;
- const char *volume;
+ const char *volume;
- struct gf_flock user_flock; /* the flock supplied by the user */
- xlator_t *this; /* required for blocked locks */
- struct __pl_inode *pl_inode;
+ struct gf_flock user_flock; /* the flock supplied by the user */
+ xlator_t *this; /* required for blocked locks */
+ struct __pl_inode *pl_inode;
- call_frame_t *frame;
+ call_frame_t *frame;
- struct timeval blkd_time; /*time at which lock was queued into blkd list*/
- struct timeval granted_time; /*time at which lock was queued into active list*/
- /*last time at which lock contention was detected and notified*/
- struct timespec contention_time;
+ struct timeval blkd_time; /*time at which lock was queued into blkd list*/
+ struct timeval
+ granted_time; /*time at which lock was queued into active list*/
+ /*last time at which lock contention was detected and notified*/
+ struct timespec contention_time;
- /* These two together serve to uniquely identify each process
- across nodes */
+ /* These two together serve to uniquely identify each process
+ across nodes */
- void *client; /* to identify client node */
- gf_lkowner_t owner;
- pid_t client_pid; /* pid of client process */
+ void *client; /* to identify client node */
+ gf_lkowner_t owner;
+ pid_t client_pid; /* pid of client process */
- char *connection_id; /* stores the client connection id */
+ char *connection_id; /* stores the client connection id */
- struct list_head client_list; /* list of all locks from a client */
+ struct list_head client_list; /* list of all locks from a client */
};
typedef struct __pl_inode_lock pl_inode_lock_t;
struct _pl_rw_req {
- struct list_head list;
- call_stub_t *stub;
- posix_lock_t region;
+ struct list_head list;
+ call_stub_t *stub;
+ posix_lock_t region;
};
typedef struct _pl_rw_req pl_rw_req_t;
struct _pl_dom_list {
- struct list_head inode_list; /* list_head back to pl_inode_t */
- const char *domain;
- struct list_head entrylk_list; /* List of entry locks */
- struct list_head blocked_entrylks; /* List of all blocked entrylks */
- struct list_head inodelk_list; /* List of inode locks */
- struct list_head blocked_inodelks; /* List of all blocked inodelks */
+ struct list_head inode_list; /* list_head back to pl_inode_t */
+ const char *domain;
+ struct list_head entrylk_list; /* List of entry locks */
+ struct list_head blocked_entrylks; /* List of all blocked entrylks */
+ struct list_head inodelk_list; /* List of inode locks */
+ struct list_head blocked_inodelks; /* List of all blocked inodelks */
};
typedef struct _pl_dom_list pl_dom_list_t;
struct __entry_lock {
- struct list_head domain_list; /* list_head back to pl_dom_list_t */
- struct list_head blocked_locks; /* list_head back to blocked_entrylks */
- struct list_head contend; /* list of contending locks */
- int ref;
+ struct list_head domain_list; /* list_head back to pl_dom_list_t */
+ struct list_head blocked_locks; /* list_head back to blocked_entrylks */
+ struct list_head contend; /* list of contending locks */
+ int ref;
- call_frame_t *frame;
- xlator_t *this;
- struct __pl_inode *pinode;
+ call_frame_t *frame;
+ xlator_t *this;
+ struct __pl_inode *pinode;
- const char *volume;
+ const char *volume;
- const char *basename;
- entrylk_type type;
+ const char *basename;
+ entrylk_type type;
- struct timeval blkd_time; /*time at which lock was queued into blkd list*/
- struct timeval granted_time; /*time at which lock was queued into active list*/
- /*last time at which lock contention was detected and notified*/
- struct timespec contention_time;
+ struct timeval blkd_time; /*time at which lock was queued into blkd list*/
+ struct timeval
+ granted_time; /*time at which lock was queued into active list*/
+ /*last time at which lock contention was detected and notified*/
+ struct timespec contention_time;
- void *client;
- gf_lkowner_t owner;
- pid_t client_pid; /* pid of client process */
+ void *client;
+ gf_lkowner_t owner;
+ pid_t client_pid; /* pid of client process */
- char *connection_id; /* stores the client connection id */
+ char *connection_id; /* stores the client connection id */
- struct list_head client_list; /* list of all locks from a client */
+ struct list_head client_list; /* list of all locks from a client */
};
typedef struct __entry_lock pl_entry_lock_t;
-
/* The "simulated" inode. This contains a list of all the locks associated
with this file */
struct __pl_inode {
- pthread_mutex_t mutex;
-
- struct list_head dom_list; /* list of domains */
- struct list_head ext_list; /* list of fcntl locks */
- struct list_head rw_list; /* list of waiting r/w requests */
- struct list_head reservelk_list; /* list of reservelks */
- struct list_head blocked_reservelks; /* list of blocked reservelks */
- struct list_head blocked_calls; /* List of blocked lock calls while a reserve is held*/
- struct list_head metalk_list; /* Meta lock list */
- /* This is to store the incoming lock
- requests while meta lock is enabled */
- struct list_head queued_locks;
- int mandatory; /* if mandatory locking is enabled */
-
- inode_t *refkeeper; /* hold refs on an inode while locks are
- held to prevent pruning */
- uuid_t gfid; /* placeholder for gfid of the inode */
- inode_t *inode; /* pointer to be used for ref and unref
- of inode_t as long as there are
- locks on it */
- gf_boolean_t migrated;
+ pthread_mutex_t mutex;
+
+ struct list_head dom_list; /* list of domains */
+ struct list_head ext_list; /* list of fcntl locks */
+ struct list_head rw_list; /* list of waiting r/w requests */
+ struct list_head reservelk_list; /* list of reservelks */
+ struct list_head blocked_reservelks; /* list of blocked reservelks */
+ struct list_head
+ blocked_calls; /* List of blocked lock calls while a reserve is held*/
+ struct list_head metalk_list; /* Meta lock list */
+ /* This is to store the incoming lock
+ requests while meta lock is enabled */
+ struct list_head queued_locks;
+ int mandatory; /* if mandatory locking is enabled */
+
+ inode_t *refkeeper; /* hold refs on an inode while locks are
+ held to prevent pruning */
+ uuid_t gfid; /* placeholder for gfid of the inode */
+ inode_t *inode; /* pointer to be used for ref and unref
+ of inode_t as long as there are
+ locks on it */
+ gf_boolean_t migrated;
};
typedef struct __pl_inode pl_inode_t;
struct __pl_metalk {
- pthread_mutex_t mutex;
- /* For pl_inode meta lock list */
- struct list_head list;
- /* For pl_ctx_t list */
- struct list_head client_list;
- char *client_uid;
-
- pl_inode_t *pl_inode;
- int ref;
+ pthread_mutex_t mutex;
+ /* For pl_inode meta lock list */
+ struct list_head list;
+ /* For pl_ctx_t list */
+ struct list_head client_list;
+ char *client_uid;
+
+ pl_inode_t *pl_inode;
+ int ref;
};
typedef struct __pl_metalk pl_meta_lock_t;
typedef struct {
- mlk_mode_t mandatory_mode; /* holds current mandatory locking mode */
- gf_boolean_t trace; /* trace lock requests in and out */
- char *brickname;
- gf_boolean_t monkey_unlocking;
- uint32_t revocation_secs;
- gf_boolean_t revocation_clear_all;
- uint32_t revocation_max_blocked;
- gf_boolean_t notify_contention;
- uint32_t notify_contention_delay;
+ mlk_mode_t mandatory_mode; /* holds current mandatory locking mode */
+ gf_boolean_t trace; /* trace lock requests in and out */
+ char *brickname;
+ gf_boolean_t monkey_unlocking;
+ uint32_t revocation_secs;
+ gf_boolean_t revocation_clear_all;
+ uint32_t revocation_max_blocked;
+ gf_boolean_t notify_contention;
+ uint32_t notify_contention_delay;
} posix_locks_private_t;
-
typedef struct {
- gf_boolean_t entrylk_count_req;
- gf_boolean_t inodelk_count_req;
- gf_boolean_t posixlk_count_req;
- gf_boolean_t parent_entrylk_req;
- data_t *inodelk_dom_count_req;
-
- dict_t *xdata;
- loc_t loc[2];
- fd_t *fd;
- off_t offset;
- glusterfs_fop_t op;
+ gf_boolean_t entrylk_count_req;
+ gf_boolean_t inodelk_count_req;
+ gf_boolean_t posixlk_count_req;
+ gf_boolean_t parent_entrylk_req;
+ data_t *inodelk_dom_count_req;
+
+ dict_t *xdata;
+ loc_t loc[2];
+ fd_t *fd;
+ off_t offset;
+ glusterfs_fop_t op;
} pl_local_t;
-
typedef struct {
- struct list_head locks_list;
+ struct list_head locks_list;
} pl_fdctx_t;
-
struct _locker {
- struct list_head lockers;
- char *volume;
- inode_t *inode;
- gf_lkowner_t owner;
+ struct list_head lockers;
+ char *volume;
+ inode_t *inode;
+ gf_lkowner_t owner;
};
typedef struct _locks_ctx {
- pthread_mutex_t lock;
- struct list_head inodelk_lockers;
- struct list_head entrylk_lockers;
- struct list_head metalk_list;
+ pthread_mutex_t lock;
+ struct list_head inodelk_lockers;
+ struct list_head entrylk_lockers;
+ struct list_head metalk_list;
} pl_ctx_t;
-
pl_ctx_t *
-pl_ctx_get (client_t *client, xlator_t *xlator);
+pl_ctx_get(client_t *client, xlator_t *xlator);
int
-pl_inodelk_client_cleanup (xlator_t *this, pl_ctx_t *ctx);
+pl_inodelk_client_cleanup(xlator_t *this, pl_ctx_t *ctx);
int
-pl_entrylk_client_cleanup (xlator_t *this, pl_ctx_t *ctx);
+pl_entrylk_client_cleanup(xlator_t *this, pl_ctx_t *ctx);
#endif /* __POSIX_LOCKS_H__ */
diff --git a/xlators/features/locks/src/pl-messages.h b/xlators/features/locks/src/pl-messages.h
index e5a276f35b5..a99e1bbce43 100644
--- a/xlators/features/locks/src/pl-messages.h
+++ b/xlators/features/locks/src/pl-messages.h
@@ -23,10 +23,7 @@
* glfs-message-id.h.
*/
-GLFS_MSGID(PL,
- PL_MSG_LOCK_NUMBER,
- PL_MSG_INODELK_CONTENTION_FAILED,
- PL_MSG_ENTRYLK_CONTENTION_FAILED
-);
+GLFS_MSGID(PL, PL_MSG_LOCK_NUMBER, PL_MSG_INODELK_CONTENTION_FAILED,
+ PL_MSG_ENTRYLK_CONTENTION_FAILED);
#endif /* !_PL_MESSAGES_H_ */
diff --git a/xlators/features/marker/src/marker-common.h b/xlators/features/marker/src/marker-common.h
index fbe9a2ce4b0..449d55b5ef0 100644
--- a/xlators/features/marker/src/marker-common.h
+++ b/xlators/features/marker/src/marker-common.h
@@ -14,8 +14,8 @@
#include "marker.h"
int32_t
-marker_force_inode_ctx_get (inode_t *, xlator_t *, marker_inode_ctx_t **);
+marker_force_inode_ctx_get(inode_t *, xlator_t *, marker_inode_ctx_t **);
int
-marker_filter_quota_xattr (dict_t *, char *, data_t *, void *);
+marker_filter_quota_xattr(dict_t *, char *, data_t *, void *);
#endif
diff --git a/xlators/features/marker/src/marker-mem-types.h b/xlators/features/marker/src/marker-mem-types.h
index dc5ad16ed76..7d590d7ec84 100644
--- a/xlators/features/marker/src/marker-mem-types.h
+++ b/xlators/features/marker/src/marker-mem-types.h
@@ -13,15 +13,15 @@
#include "mem-types.h"
enum gf_marker_mem_types_ {
- gf_marker_mt_marker_conf_t = gf_common_mt_end + 1,
- gf_marker_mt_loc_t,
- gf_marker_mt_volume_mark,
- gf_marker_mt_int64_t,
- gf_marker_mt_quota_inode_ctx_t,
- gf_marker_mt_marker_inode_ctx_t,
- gf_marker_mt_inode_contribution_t,
- gf_marker_mt_quota_meta_t,
- gf_marker_mt_quota_synctask_t,
- gf_marker_mt_end
+ gf_marker_mt_marker_conf_t = gf_common_mt_end + 1,
+ gf_marker_mt_loc_t,
+ gf_marker_mt_volume_mark,
+ gf_marker_mt_int64_t,
+ gf_marker_mt_quota_inode_ctx_t,
+ gf_marker_mt_marker_inode_ctx_t,
+ gf_marker_mt_inode_contribution_t,
+ gf_marker_mt_quota_meta_t,
+ gf_marker_mt_quota_synctask_t,
+ gf_marker_mt_end
};
#endif
diff --git a/xlators/features/marker/src/marker-quota-helper.h b/xlators/features/marker/src/marker-quota-helper.h
index 444ba7ca71e..99723def1b9 100644
--- a/xlators/features/marker/src/marker-quota-helper.h
+++ b/xlators/features/marker/src/marker-quota-helper.h
@@ -13,66 +13,66 @@
#include "marker.h"
-#define QUOTA_FREE_CONTRIBUTION_NODE(ctx, _contribution) \
- do { \
- LOCK (&ctx->lock); \
- { \
- list_del_init (&_contribution->contri_list); \
- GF_REF_PUT (_contribution); \
- } \
- UNLOCK (&ctx->lock); \
- } while (0)
-
-#define QUOTA_SAFE_INCREMENT(lock, var) \
- do { \
- LOCK (lock); \
- var ++; \
- UNLOCK (lock); \
- } while (0)
-
-#define QUOTA_SAFE_DECREMENT(lock, var, value) \
- do { \
- LOCK (lock); \
- { \
- value = --var; \
- } \
- UNLOCK (lock); \
- } while (0)
+#define QUOTA_FREE_CONTRIBUTION_NODE(ctx, _contribution) \
+ do { \
+ LOCK(&ctx->lock); \
+ { \
+ list_del_init(&_contribution->contri_list); \
+ GF_REF_PUT(_contribution); \
+ } \
+ UNLOCK(&ctx->lock); \
+ } while (0)
+
+#define QUOTA_SAFE_INCREMENT(lock, var) \
+ do { \
+ LOCK(lock); \
+ var++; \
+ UNLOCK(lock); \
+ } while (0)
+
+#define QUOTA_SAFE_DECREMENT(lock, var, value) \
+ do { \
+ LOCK(lock); \
+ { \
+ value = --var; \
+ } \
+ UNLOCK(lock); \
+ } while (0)
inode_contribution_t *
-mq_add_new_contribution_node (xlator_t *, quota_inode_ctx_t *, loc_t *);
+mq_add_new_contribution_node(xlator_t *, quota_inode_ctx_t *, loc_t *);
int32_t
-mq_dict_set_contribution (xlator_t *, dict_t *, loc_t *, uuid_t, char *);
+mq_dict_set_contribution(xlator_t *, dict_t *, loc_t *, uuid_t, char *);
quota_inode_ctx_t *
-mq_inode_ctx_new (inode_t *, xlator_t *);
+mq_inode_ctx_new(inode_t *, xlator_t *);
int32_t
-mq_inode_ctx_get (inode_t *, xlator_t *, quota_inode_ctx_t **);
+mq_inode_ctx_get(inode_t *, xlator_t *, quota_inode_ctx_t **);
int32_t
-mq_delete_contribution_node (dict_t *, char *, inode_contribution_t *);
+mq_delete_contribution_node(dict_t *, char *, inode_contribution_t *);
int32_t
-mq_inode_loc_fill (const char *, inode_t *, loc_t *);
+mq_inode_loc_fill(const char *, inode_t *, loc_t *);
quota_local_t *
-mq_local_new ();
+mq_local_new();
quota_local_t *
-mq_local_ref (quota_local_t *);
+mq_local_ref(quota_local_t *);
int32_t
-mq_local_unref (xlator_t *, quota_local_t *);
+mq_local_unref(xlator_t *, quota_local_t *);
-inode_contribution_t*
-mq_contri_init (inode_t *inode);
+inode_contribution_t *
+mq_contri_init(inode_t *inode);
inode_contribution_t *
-mq_get_contribution_node (inode_t *, quota_inode_ctx_t *);
+mq_get_contribution_node(inode_t *, quota_inode_ctx_t *);
inode_contribution_t *
-mq_get_contribution_from_loc (xlator_t *this, loc_t *loc);
+mq_get_contribution_from_loc(xlator_t *this, loc_t *loc);
#endif
diff --git a/xlators/features/marker/src/marker-quota.h b/xlators/features/marker/src/marker-quota.h
index 51e062537b8..7f63e268203 100644
--- a/xlators/features/marker/src/marker-quota.h
+++ b/xlators/features/marker/src/marker-quota.h
@@ -19,138 +19,131 @@
#define QUOTA_XATTR_PREFIX "trusted.glusterfs"
#define QUOTA_DIRTY_KEY "trusted.glusterfs.quota.dirty"
-#define CONTRIBUTION "contri"
+#define CONTRIBUTION "contri"
#define QUOTA_KEY_MAX 512
#define READDIR_BUF 4096
-
-#define QUOTA_STACK_DESTROY(_frame, _this) \
- do { \
- quota_local_t *_local = NULL; \
- _local = _frame->local; \
- _frame->local = NULL; \
- STACK_DESTROY (_frame->root); \
- mq_local_unref (_this, _local); \
- } while (0)
-
-
-#define QUOTA_ALLOC(var, type, ret) \
- do { \
- ret = 0; \
- var = GF_CALLOC (sizeof (type), 1, \
- gf_marker_mt_##type); \
- if (!var) { \
- ret = -1; \
- } \
- } while (0);
-
-#define QUOTA_ALLOC_OR_GOTO(var, type, ret, label) \
- do { \
- var = GF_CALLOC (sizeof (type), 1, \
- gf_marker_mt_##type); \
- if (!var) { \
- gf_log ("", GF_LOG_ERROR, \
- "out of memory"); \
- ret = -1; \
- goto label; \
- } \
- ret = 0; \
- } while (0);
-
-#define GET_QUOTA_KEY(_this, var, key, _ret) \
- do { \
- marker_conf_t *_priv = _this->private; \
- if (_priv->version > 0) \
- _ret = snprintf (var, QUOTA_KEY_MAX, "%s.%d", \
- key, _priv->version); \
- else \
- _ret = snprintf (var, QUOTA_KEY_MAX, "%s", key); \
- } while (0)
-
-#define GET_CONTRI_KEY(_this, var, _gfid, _ret) \
- do { \
- char _tmp_var[QUOTA_KEY_MAX] = {0, }; \
- if (_gfid != NULL) { \
- char _gfid_unparsed[40]; \
- gf_uuid_unparse (_gfid, _gfid_unparsed); \
- _ret = snprintf (_tmp_var, QUOTA_KEY_MAX, \
- QUOTA_XATTR_PREFIX \
- ".%s.%s." CONTRIBUTION, \
- "quota", _gfid_unparsed); \
- } else { \
- _ret = snprintf (_tmp_var, QUOTA_KEY_MAX, \
- QUOTA_XATTR_PREFIX \
- ".%s.." CONTRIBUTION, \
- "quota"); \
- } \
- GET_QUOTA_KEY (_this, var, _tmp_var, _ret); \
- } while (0)
-
-#define GET_SIZE_KEY(_this, var, _ret) \
- { \
- GET_QUOTA_KEY (_this, var, QUOTA_SIZE_KEY, _ret); \
- }
-
-#define QUOTA_SAFE_INCREMENT(lock, var) \
- do { \
- LOCK (lock); \
- var ++; \
- UNLOCK (lock); \
- } while (0)
+#define QUOTA_STACK_DESTROY(_frame, _this) \
+ do { \
+ quota_local_t *_local = NULL; \
+ _local = _frame->local; \
+ _frame->local = NULL; \
+ STACK_DESTROY(_frame->root); \
+ mq_local_unref(_this, _local); \
+ } while (0)
+
+#define QUOTA_ALLOC(var, type, ret) \
+ do { \
+ ret = 0; \
+ var = GF_CALLOC(sizeof(type), 1, gf_marker_mt_##type); \
+ if (!var) { \
+ ret = -1; \
+ } \
+ } while (0);
+
+#define QUOTA_ALLOC_OR_GOTO(var, type, ret, label) \
+ do { \
+ var = GF_CALLOC(sizeof(type), 1, gf_marker_mt_##type); \
+ if (!var) { \
+ gf_log("", GF_LOG_ERROR, "out of memory"); \
+ ret = -1; \
+ goto label; \
+ } \
+ ret = 0; \
+ } while (0);
+
+#define GET_QUOTA_KEY(_this, var, key, _ret) \
+ do { \
+ marker_conf_t *_priv = _this->private; \
+ if (_priv->version > 0) \
+ _ret = snprintf(var, QUOTA_KEY_MAX, "%s.%d", key, _priv->version); \
+ else \
+ _ret = snprintf(var, QUOTA_KEY_MAX, "%s", key); \
+ } while (0)
+
+#define GET_CONTRI_KEY(_this, var, _gfid, _ret) \
+ do { \
+ char _tmp_var[QUOTA_KEY_MAX] = { \
+ 0, \
+ }; \
+ if (_gfid != NULL) { \
+ char _gfid_unparsed[40]; \
+ gf_uuid_unparse(_gfid, _gfid_unparsed); \
+ _ret = snprintf(_tmp_var, QUOTA_KEY_MAX, \
+ QUOTA_XATTR_PREFIX ".%s.%s." CONTRIBUTION, \
+ "quota", _gfid_unparsed); \
+ } else { \
+ _ret = snprintf(_tmp_var, QUOTA_KEY_MAX, \
+ QUOTA_XATTR_PREFIX ".%s.." CONTRIBUTION, "quota"); \
+ } \
+ GET_QUOTA_KEY(_this, var, _tmp_var, _ret); \
+ } while (0)
+
+#define GET_SIZE_KEY(_this, var, _ret) \
+ { \
+ GET_QUOTA_KEY(_this, var, QUOTA_SIZE_KEY, _ret); \
+ }
+
+#define QUOTA_SAFE_INCREMENT(lock, var) \
+ do { \
+ LOCK(lock); \
+ var++; \
+ UNLOCK(lock); \
+ } while (0)
struct quota_inode_ctx {
- int64_t size;
- int64_t file_count;
- int64_t dir_count;
- int8_t dirty;
- gf_boolean_t create_status;
- gf_boolean_t updation_status;
- gf_boolean_t dirty_status;
- gf_lock_t lock;
- struct list_head contribution_head;
+ int64_t size;
+ int64_t file_count;
+ int64_t dir_count;
+ int8_t dirty;
+ gf_boolean_t create_status;
+ gf_boolean_t updation_status;
+ gf_boolean_t dirty_status;
+ gf_lock_t lock;
+ struct list_head contribution_head;
};
typedef struct quota_inode_ctx quota_inode_ctx_t;
struct quota_synctask {
- xlator_t *this;
- loc_t loc;
- quota_meta_t contri;
- gf_boolean_t is_static;
- uint32_t ia_nlink;
- call_stub_t *stub;
+ xlator_t *this;
+ loc_t loc;
+ quota_meta_t contri;
+ gf_boolean_t is_static;
+ uint32_t ia_nlink;
+ call_stub_t *stub;
};
typedef struct quota_synctask quota_synctask_t;
struct inode_contribution {
- struct list_head contri_list;
- int64_t contribution;
- int64_t file_count;
- int64_t dir_count;
- uuid_t gfid;
- gf_lock_t lock;
- GF_REF_DECL;
+ struct list_head contri_list;
+ int64_t contribution;
+ int64_t file_count;
+ int64_t dir_count;
+ uuid_t gfid;
+ gf_lock_t lock;
+ GF_REF_DECL;
};
typedef struct inode_contribution inode_contribution_t;
int32_t
-mq_req_xattr (xlator_t *, loc_t *, dict_t *, char *, char *);
+mq_req_xattr(xlator_t *, loc_t *, dict_t *, char *, char *);
int32_t
-mq_xattr_state (xlator_t *, loc_t *, dict_t *, struct iatt);
+mq_xattr_state(xlator_t *, loc_t *, dict_t *, struct iatt);
int
-mq_initiate_quota_txn (xlator_t *, loc_t *, struct iatt *);
+mq_initiate_quota_txn(xlator_t *, loc_t *, struct iatt *);
int
-mq_initiate_quota_blocking_txn (xlator_t *, loc_t *, struct iatt *);
+mq_initiate_quota_blocking_txn(xlator_t *, loc_t *, struct iatt *);
int
-mq_create_xattrs_txn (xlator_t *this, loc_t *loc, struct iatt *buf);
+mq_create_xattrs_txn(xlator_t *this, loc_t *loc, struct iatt *buf);
int32_t
-mq_reduce_parent_size_txn (xlator_t *, loc_t *, quota_meta_t *,
- uint32_t nlink, call_stub_t *stub);
+mq_reduce_parent_size_txn(xlator_t *, loc_t *, quota_meta_t *, uint32_t nlink,
+ call_stub_t *stub);
int32_t
-mq_forget (xlator_t *, quota_inode_ctx_t *);
+mq_forget(xlator_t *, quota_inode_ctx_t *);
#endif
diff --git a/xlators/features/marker/src/marker.h b/xlators/features/marker/src/marker.h
index 4726880b82f..3b6f4ec8b72 100644
--- a/xlators/features/marker/src/marker.h
+++ b/xlators/features/marker/src/marker.h
@@ -17,132 +17,131 @@
#include "call-stub.h"
#define MARKER_XATTR_PREFIX "trusted.glusterfs"
-#define XTIME "xtime"
-#define VOLUME_MARK "volume-mark"
-#define VOLUME_UUID "volume-uuid"
-#define TIMESTAMP_FILE "timestamp-file"
+#define XTIME "xtime"
+#define VOLUME_MARK "volume-mark"
+#define VOLUME_UUID "volume-uuid"
+#define TIMESTAMP_FILE "timestamp-file"
enum {
- GF_QUOTA = 1,
- GF_XTIME = 2,
- GF_XTIME_GSYNC_FORCE = 4,
- GF_INODE_QUOTA = 8,
+ GF_QUOTA = 1,
+ GF_XTIME = 2,
+ GF_XTIME_GSYNC_FORCE = 4,
+ GF_INODE_QUOTA = 8,
};
/*initialize the local variable*/
-#define MARKER_INIT_LOCAL(_frame,_local) do { \
- _frame->local = _local; \
- _local->pid = _frame->root->pid; \
- memset (&_local->loc, 0, sizeof (loc_t)); \
- _local->ref = 1; \
- _local->uid = -1; \
- _local->gid = -1; \
- LOCK_INIT (&_local->lock); \
- _local->oplocal = NULL; \
- } while (0)
+#define MARKER_INIT_LOCAL(_frame, _local) \
+ do { \
+ _frame->local = _local; \
+ _local->pid = _frame->root->pid; \
+ memset(&_local->loc, 0, sizeof(loc_t)); \
+ _local->ref = 1; \
+ _local->uid = -1; \
+ _local->gid = -1; \
+ LOCK_INIT(&_local->lock); \
+ _local->oplocal = NULL; \
+ } while (0)
/* try alloc and if it fails, goto label */
-#define ALLOCATE_OR_GOTO(var, type, label) do { \
- var = GF_CALLOC (sizeof (type), 1, \
- gf_marker_mt_##type); \
- if (!var) { \
- gf_log (this->name, GF_LOG_ERROR, \
- "out of memory :("); \
- goto label; \
- } \
- } while (0)
-
-#define _MARKER_SET_UID_GID(dest, src) \
- do { \
- if (src->uid != -1 && \
- src->gid != -1) { \
- dest->uid = src->uid; \
- dest->gid = src->gid; \
- } \
- } while (0)
-
-#define MARKER_SET_UID_GID(frame, dest, src) \
- do { \
- _MARKER_SET_UID_GID (dest, src); \
- frame->root->uid = 0; \
- frame->root->gid = 0; \
- frame->cookie = (void *) _GF_UID_GID_CHANGED; \
- } while (0)
-
-#define MARKER_RESET_UID_GID(frame, dest, src) \
- do { \
- _MARKER_SET_UID_GID (dest, src); \
- frame->cookie = NULL; \
- } while (0)
-
-#define MARKER_STACK_UNWIND(fop, frame, params...) \
- do { \
- quota_local_t *_local = NULL; \
- if (frame) { \
- _local = frame->local; \
- frame->local = NULL; \
- } \
- STACK_UNWIND_STRICT (fop, frame, params); \
- if (_local) \
- marker_local_unref (_local); \
- } while (0)
-
-struct marker_local{
- uint32_t timebuf[2];
- pid_t pid;
- loc_t loc;
- loc_t parent_loc;
- uid_t uid;
- gid_t gid;
- int32_t ref;
- uint32_t ia_nlink;
- struct iatt buf;
- gf_lock_t lock;
- mode_t mode;
- int32_t err;
- call_stub_t *stub;
- call_frame_t *lk_frame;
- quota_meta_t contribution;
- struct marker_local *oplocal;
-
- /* marker quota specific */
- int64_t delta;
- int64_t d_off;
- int64_t sum;
- int64_t size;
- int32_t hl_count;
- int32_t dentry_child_count;
-
- fd_t *fd;
- call_frame_t *frame;
-
- quota_inode_ctx_t *ctx;
- inode_contribution_t *contri;
-
- int xflag;
- dict_t *xdata;
- gf_boolean_t skip_txn;
+#define ALLOCATE_OR_GOTO(var, type, label) \
+ do { \
+ var = GF_CALLOC(sizeof(type), 1, gf_marker_mt_##type); \
+ if (!var) { \
+ gf_log(this->name, GF_LOG_ERROR, "out of memory :("); \
+ goto label; \
+ } \
+ } while (0)
+
+#define _MARKER_SET_UID_GID(dest, src) \
+ do { \
+ if (src->uid != -1 && src->gid != -1) { \
+ dest->uid = src->uid; \
+ dest->gid = src->gid; \
+ } \
+ } while (0)
+
+#define MARKER_SET_UID_GID(frame, dest, src) \
+ do { \
+ _MARKER_SET_UID_GID(dest, src); \
+ frame->root->uid = 0; \
+ frame->root->gid = 0; \
+ frame->cookie = (void *)_GF_UID_GID_CHANGED; \
+ } while (0)
+
+#define MARKER_RESET_UID_GID(frame, dest, src) \
+ do { \
+ _MARKER_SET_UID_GID(dest, src); \
+ frame->cookie = NULL; \
+ } while (0)
+
+#define MARKER_STACK_UNWIND(fop, frame, params...) \
+ do { \
+ quota_local_t *_local = NULL; \
+ if (frame) { \
+ _local = frame->local; \
+ frame->local = NULL; \
+ } \
+ STACK_UNWIND_STRICT(fop, frame, params); \
+ if (_local) \
+ marker_local_unref(_local); \
+ } while (0)
+
+struct marker_local {
+ uint32_t timebuf[2];
+ pid_t pid;
+ loc_t loc;
+ loc_t parent_loc;
+ uid_t uid;
+ gid_t gid;
+ int32_t ref;
+ uint32_t ia_nlink;
+ struct iatt buf;
+ gf_lock_t lock;
+ mode_t mode;
+ int32_t err;
+ call_stub_t *stub;
+ call_frame_t *lk_frame;
+ quota_meta_t contribution;
+ struct marker_local *oplocal;
+
+ /* marker quota specific */
+ int64_t delta;
+ int64_t d_off;
+ int64_t sum;
+ int64_t size;
+ int32_t hl_count;
+ int32_t dentry_child_count;
+
+ fd_t *fd;
+ call_frame_t *frame;
+
+ quota_inode_ctx_t *ctx;
+ inode_contribution_t *contri;
+
+ int xflag;
+ dict_t *xdata;
+ gf_boolean_t skip_txn;
};
typedef struct marker_local marker_local_t;
#define quota_local_t marker_local_t
struct marker_inode_ctx {
- struct quota_inode_ctx *quota_ctx;
+ struct quota_inode_ctx *quota_ctx;
};
typedef struct marker_inode_ctx marker_inode_ctx_t;
-struct marker_conf{
- char feature_enabled;
- char *size_key;
- char *dirty_key;
- char *volume_uuid;
- uuid_t volume_uuid_bin;
- char *timestamp_file;
- char *marker_xattr;
- uint64_t quota_lk_owner;
- gf_lock_t lock;
- int32_t version;
+struct marker_conf {
+ char feature_enabled;
+ char *size_key;
+ char *dirty_key;
+ char *volume_uuid;
+ uuid_t volume_uuid_bin;
+ char *timestamp_file;
+ char *marker_xattr;
+ uint64_t quota_lk_owner;
+ gf_lock_t lock;
+ int32_t version;
};
typedef struct marker_conf marker_conf_t;
diff --git a/xlators/features/namespace/src/namespace.h b/xlators/features/namespace/src/namespace.h
index 1dbec50e024..4c04cb3f471 100644
--- a/xlators/features/namespace/src/namespace.h
+++ b/xlators/features/namespace/src/namespace.h
@@ -12,12 +12,12 @@
#define GF_NAMESPACE "namespace"
typedef struct {
- gf_boolean_t tag_namespaces;
+ gf_boolean_t tag_namespaces;
} ns_private_t;
typedef struct {
- loc_t loc; /* We store a "fake" loc_t for the getxattr wind. */
- call_stub_t *stub; /* A stub back to the function we're resuming. */
+ loc_t loc; /* We store a "fake" loc_t for the getxattr wind. */
+ call_stub_t *stub; /* A stub back to the function we're resuming. */
} ns_local_t;
#endif /* __NAMESPACE_H__ */
diff --git a/xlators/features/quiesce/src/quiesce-mem-types.h b/xlators/features/quiesce/src/quiesce-mem-types.h
index 31346c1a794..914bfb22ed0 100644
--- a/xlators/features/quiesce/src/quiesce-mem-types.h
+++ b/xlators/features/quiesce/src/quiesce-mem-types.h
@@ -14,8 +14,8 @@
#include "mem-types.h"
enum gf_quiesce_mem_types_ {
- gf_quiesce_mt_priv_t = gf_common_mt_end + 1,
- gf_quiesce_mt_failover_hosts,
- gf_quiesce_mt_end
+ gf_quiesce_mt_priv_t = gf_common_mt_end + 1,
+ gf_quiesce_mt_failover_hosts,
+ gf_quiesce_mt_end
};
#endif
diff --git a/xlators/features/quiesce/src/quiesce-messages.h b/xlators/features/quiesce/src/quiesce-messages.h
index 8af3b10b06e..864a18147dc 100644
--- a/xlators/features/quiesce/src/quiesce-messages.h
+++ b/xlators/features/quiesce/src/quiesce-messages.h
@@ -23,9 +23,6 @@
* glfs-message-id.h.
*/
-GLFS_MSGID(QUIESCE,
- QUIESCE_MSG_INVAL_HOST,
- QUIESCE_MSG_FAILOVER_FAILED
-);
+GLFS_MSGID(QUIESCE, QUIESCE_MSG_INVAL_HOST, QUIESCE_MSG_FAILOVER_FAILED);
#endif /* __NL_CACHE_MESSAGES_H__ */
diff --git a/xlators/features/quiesce/src/quiesce.h b/xlators/features/quiesce/src/quiesce.h
index c084801c6c6..ed8f8fa2934 100644
--- a/xlators/features/quiesce/src/quiesce.h
+++ b/xlators/features/quiesce/src/quiesce.h
@@ -19,47 +19,47 @@
#define GF_FOPS_EXPECTED_IN_PARALLEL 512
typedef struct {
- struct list_head list;
- char *addr;
- gf_boolean_t tried; /* indicates attempted connecting */
+ struct list_head list;
+ char *addr;
+ gf_boolean_t tried; /* indicates attempted connecting */
} quiesce_failover_hosts_t;
typedef struct {
- gf_timer_t *timer;
- gf_boolean_t pass_through;
- gf_lock_t lock;
- struct list_head req;
- int queue_size;
- pthread_t thr;
- struct mem_pool *local_pool;
- uint32_t timeout;
- char *failover_hosts;
- struct list_head failover_list;
+ gf_timer_t *timer;
+ gf_boolean_t pass_through;
+ gf_lock_t lock;
+ struct list_head req;
+ int queue_size;
+ pthread_t thr;
+ struct mem_pool *local_pool;
+ uint32_t timeout;
+ char *failover_hosts;
+ struct list_head failover_list;
} quiesce_priv_t;
typedef struct {
- fd_t *fd;
- char *name;
- char *volname;
- loc_t loc;
- off_t size;
- off_t offset;
- mode_t mode;
- int32_t flag;
- struct iatt stbuf;
- struct iovec *vector;
- struct iobref *iobref;
- dict_t *dict;
- struct gf_flock flock;
- entrylk_cmd cmd;
- entrylk_type type;
- gf_xattrop_flags_t xattrop_flags;
- int32_t wbflags;
- uint32_t io_flag;
- /* for fallocate */
- size_t len;
- /* for lseek */
- gf_seek_what_t what;
+ fd_t *fd;
+ char *name;
+ char *volname;
+ loc_t loc;
+ off_t size;
+ off_t offset;
+ mode_t mode;
+ int32_t flag;
+ struct iatt stbuf;
+ struct iovec *vector;
+ struct iobref *iobref;
+ dict_t *dict;
+ struct gf_flock flock;
+ entrylk_cmd cmd;
+ entrylk_type type;
+ gf_xattrop_flags_t xattrop_flags;
+ int32_t wbflags;
+ uint32_t io_flag;
+ /* for fallocate */
+ size_t len;
+ /* for lseek */
+ gf_seek_what_t what;
} quiesce_local_t;
#endif
diff --git a/xlators/features/quota/src/quota-mem-types.h b/xlators/features/quota/src/quota-mem-types.h
index 97d9165681f..e04d2e846cd 100644
--- a/xlators/features/quota/src/quota-mem-types.h
+++ b/xlators/features/quota/src/quota-mem-types.h
@@ -13,18 +13,17 @@
#include "mem-types.h"
enum gf_quota_mem_types_ {
- gf_quota_mt_quota_priv_t = gf_common_mt_end + 1,
- gf_quota_mt_quota_inode_ctx_t,
- gf_quota_mt_loc_t,
- gf_quota_mt_char,
- gf_quota_mt_int64_t,
- gf_quota_mt_int32_t,
- gf_quota_mt_limits_t,
- gf_quota_mt_quota_dentry_t,
- gf_quota_mt_quota_limits_level_t,
- gf_quota_mt_qd_vols_conf_t,
- gf_quota_mt_aggregator_state_t,
- gf_quota_mt_end
+ gf_quota_mt_quota_priv_t = gf_common_mt_end + 1,
+ gf_quota_mt_quota_inode_ctx_t,
+ gf_quota_mt_loc_t,
+ gf_quota_mt_char,
+ gf_quota_mt_int64_t,
+ gf_quota_mt_int32_t,
+ gf_quota_mt_limits_t,
+ gf_quota_mt_quota_dentry_t,
+ gf_quota_mt_quota_limits_level_t,
+ gf_quota_mt_qd_vols_conf_t,
+ gf_quota_mt_aggregator_state_t,
+ gf_quota_mt_end
};
#endif
-
diff --git a/xlators/features/quota/src/quota-messages.h b/xlators/features/quota/src/quota-messages.h
index 85f5abf7b29..5129d2ee9ad 100644
--- a/xlators/features/quota/src/quota-messages.h
+++ b/xlators/features/quota/src/quota-messages.h
@@ -23,33 +23,17 @@
* glfs-message-id.h.
*/
-GLFS_MSGID(QUOTA,
- Q_MSG_ENFORCEMENT_FAILED,
- Q_MSG_ENOMEM,
- Q_MSG_PARENT_NULL,
- Q_MSG_CROSSED_SOFT_LIMIT,
- Q_MSG_QUOTA_ENFORCER_RPC_INIT_FAILED,
- Q_MSG_REMOTE_OPERATION_FAILED,
- Q_MSG_FAILED_TO_SEND_FOP,
- Q_MSG_INVALID_VOLFILE,
- Q_MSG_INODE_PARENT_NOT_FOUND,
- Q_MSG_XDR_DECODE_ERROR,
- Q_MSG_DICT_UNSERIALIZE_FAIL,
- Q_MSG_DICT_SERIALIZE_FAIL,
- Q_MSG_RPCSVC_INIT_FAILED,
- Q_MSG_RPCSVC_LISTENER_CREATION_FAILED,
- Q_MSG_RPCSVC_REGISTER_FAILED,
- Q_MSG_XDR_DECODING_FAILED,
- Q_MSG_RPCCLNT_REGISTER_NOTIFY_FAILED,
- Q_MSG_ANCESTRY_BUILD_FAILED,
- Q_MSG_SIZE_KEY_MISSING,
- Q_MSG_INODE_CTX_GET_FAILED,
- Q_MSG_INODE_CTX_SET_FAILED,
- Q_MSG_LOOKUP_FAILED,
- Q_MSG_RPC_SUBMIT_FAILED,
- Q_MSG_ENFORCEMENT_SKIPPED,
- Q_MSG_INTERNAL_FOP_KEY_MISSING
-);
+GLFS_MSGID(QUOTA, Q_MSG_ENFORCEMENT_FAILED, Q_MSG_ENOMEM, Q_MSG_PARENT_NULL,
+ Q_MSG_CROSSED_SOFT_LIMIT, Q_MSG_QUOTA_ENFORCER_RPC_INIT_FAILED,
+ Q_MSG_REMOTE_OPERATION_FAILED, Q_MSG_FAILED_TO_SEND_FOP,
+ Q_MSG_INVALID_VOLFILE, Q_MSG_INODE_PARENT_NOT_FOUND,
+ Q_MSG_XDR_DECODE_ERROR, Q_MSG_DICT_UNSERIALIZE_FAIL,
+ Q_MSG_DICT_SERIALIZE_FAIL, Q_MSG_RPCSVC_INIT_FAILED,
+ Q_MSG_RPCSVC_LISTENER_CREATION_FAILED, Q_MSG_RPCSVC_REGISTER_FAILED,
+ Q_MSG_XDR_DECODING_FAILED, Q_MSG_RPCCLNT_REGISTER_NOTIFY_FAILED,
+ Q_MSG_ANCESTRY_BUILD_FAILED, Q_MSG_SIZE_KEY_MISSING,
+ Q_MSG_INODE_CTX_GET_FAILED, Q_MSG_INODE_CTX_SET_FAILED,
+ Q_MSG_LOOKUP_FAILED, Q_MSG_RPC_SUBMIT_FAILED,
+ Q_MSG_ENFORCEMENT_SKIPPED, Q_MSG_INTERNAL_FOP_KEY_MISSING);
#endif /* !_QUOTA_MESSAGES_H_ */
-
diff --git a/xlators/features/quota/src/quota.h b/xlators/features/quota/src/quota.h
index 9fe0e3e0a51..7ced27a6188 100644
--- a/xlators/features/quota/src/quota.h
+++ b/xlators/features/quota/src/quota.h
@@ -31,246 +31,235 @@
#include "quota-common-utils.h"
#include "quota-messages.h"
-#define DIRTY "dirty"
-#define SIZE "size"
-#define CONTRIBUTION "contri"
-#define VAL_LENGTH 8
-#define READDIR_BUF 4096
+#define DIRTY "dirty"
+#define SIZE "size"
+#define CONTRIBUTION "contri"
+#define VAL_LENGTH 8
+#define READDIR_BUF 4096
#ifndef UUID_CANONICAL_FORM_LEN
#define UUID_CANONICAL_FORM_LEN 36
#endif
-#define WIND_IF_QUOTAOFF(is_quota_on, label) \
- if (!is_quota_on) \
- goto label;
-
-#define QUOTA_WIND_FOR_INTERNAL_FOP(xdata, label) \
- do { \
- if (xdata && dict_get (xdata, GLUSTERFS_INTERNAL_FOP_KEY)) \
- goto label; \
- } while (0)
-
-#define DID_REACH_LIMIT(lim, prev_size, cur_size) \
- ((cur_size) >= (lim) && (prev_size) < (lim))
-
-#define QUOTA_SAFE_INCREMENT(lock, var) \
- do { \
- LOCK (lock); \
- var ++; \
- UNLOCK (lock); \
- } while (0)
-
-#define QUOTA_SAFE_DECREMENT(lock, var) \
- do { \
- LOCK (lock); \
- var --; \
- UNLOCK (lock); \
- } while (0)
-
-#define QUOTA_ALLOC_OR_GOTO(var, type, label) \
- do { \
- var = GF_CALLOC (sizeof (type), 1, \
- gf_quota_mt_##type); \
- if (!var) { \
- gf_msg ("", GF_LOG_ERROR, \
- ENOMEM, Q_MSG_ENOMEM, \
- "out of memory"); \
- ret = -1; \
- goto label; \
- } \
- } while (0);
-
-#define QUOTA_STACK_WIND_TAIL(frame, params...) \
- do { \
- quota_local_t *_local = NULL; \
- \
- if (frame) { \
- _local = frame->local; \
- frame->local = NULL; \
- } \
- \
- STACK_WIND_TAIL (frame, params); \
- \
- if (_local) \
- quota_local_cleanup (_local); \
- } while (0)
-
-#define QUOTA_STACK_UNWIND(fop, frame, params...) \
- do { \
- quota_local_t *_local = NULL; \
- if (frame) { \
- _local = frame->local; \
- frame->local = NULL; \
- } \
- STACK_UNWIND_STRICT (fop, frame, params); \
- quota_local_cleanup (_local); \
- } while (0)
-
-#define QUOTA_FREE_CONTRIBUTION_NODE(_contribution) \
- do { \
- list_del (&_contribution->contri_list); \
- GF_FREE (_contribution); \
- } while (0)
-
-#define GET_CONTRI_KEY(var, _vol_name, _gfid, _ret) \
- do { \
- char _gfid_unparsed[40]; \
- if (_gfid != NULL) { \
- gf_uuid_unparse (_gfid, _gfid_unparsed);\
- _ret = gf_asprintf (var, QUOTA_XATTR_PREFIX \
- "%s.%s." CONTRIBUTION, \
- _vol_name, _gfid_unparsed); \
- } else { \
- _ret = gf_asprintf (var, QUOTA_XATTR_PREFIX \
- "%s.." CONTRIBUTION, \
- _vol_name); \
- } \
- } while (0)
-
-
-#define GET_CONTRI_KEY_OR_GOTO(var, _vol_name, _gfid, label) \
- do { \
- GET_CONTRI_KEY(var, _vol_name, _gfid, ret); \
- if (ret == -1) \
- goto label; \
- } while (0)
-
-#define GET_DIRTY_KEY_OR_GOTO(var, _vol_name, label) \
- do { \
- ret = gf_asprintf (var, QUOTA_XATTR_PREFIX \
- "%s." DIRTY, _vol_name); \
- if (ret == -1) \
- goto label; \
- } while (0)
-
-#define QUOTA_REG_OR_LNK_FILE(ia_type) \
- (IA_ISREG (ia_type) || IA_ISLNK (ia_type))
-
-
+#define WIND_IF_QUOTAOFF(is_quota_on, label) \
+ if (!is_quota_on) \
+ goto label;
+
+#define QUOTA_WIND_FOR_INTERNAL_FOP(xdata, label) \
+ do { \
+ if (xdata && dict_get(xdata, GLUSTERFS_INTERNAL_FOP_KEY)) \
+ goto label; \
+ } while (0)
+
+#define DID_REACH_LIMIT(lim, prev_size, cur_size) \
+ ((cur_size) >= (lim) && (prev_size) < (lim))
+
+#define QUOTA_SAFE_INCREMENT(lock, var) \
+ do { \
+ LOCK(lock); \
+ var++; \
+ UNLOCK(lock); \
+ } while (0)
+
+#define QUOTA_SAFE_DECREMENT(lock, var) \
+ do { \
+ LOCK(lock); \
+ var--; \
+ UNLOCK(lock); \
+ } while (0)
+
+#define QUOTA_ALLOC_OR_GOTO(var, type, label) \
+ do { \
+ var = GF_CALLOC(sizeof(type), 1, gf_quota_mt_##type); \
+ if (!var) { \
+ gf_msg("", GF_LOG_ERROR, ENOMEM, Q_MSG_ENOMEM, "out of memory"); \
+ ret = -1; \
+ goto label; \
+ } \
+ } while (0);
+
+#define QUOTA_STACK_WIND_TAIL(frame, params...) \
+ do { \
+ quota_local_t *_local = NULL; \
+ \
+ if (frame) { \
+ _local = frame->local; \
+ frame->local = NULL; \
+ } \
+ \
+ STACK_WIND_TAIL(frame, params); \
+ \
+ if (_local) \
+ quota_local_cleanup(_local); \
+ } while (0)
+
+#define QUOTA_STACK_UNWIND(fop, frame, params...) \
+ do { \
+ quota_local_t *_local = NULL; \
+ if (frame) { \
+ _local = frame->local; \
+ frame->local = NULL; \
+ } \
+ STACK_UNWIND_STRICT(fop, frame, params); \
+ quota_local_cleanup(_local); \
+ } while (0)
+
+#define QUOTA_FREE_CONTRIBUTION_NODE(_contribution) \
+ do { \
+ list_del(&_contribution->contri_list); \
+ GF_FREE(_contribution); \
+ } while (0)
+
+#define GET_CONTRI_KEY(var, _vol_name, _gfid, _ret) \
+ do { \
+ char _gfid_unparsed[40]; \
+ if (_gfid != NULL) { \
+ gf_uuid_unparse(_gfid, _gfid_unparsed); \
+ _ret = gf_asprintf(var, QUOTA_XATTR_PREFIX "%s.%s." CONTRIBUTION, \
+ _vol_name, _gfid_unparsed); \
+ } else { \
+ _ret = gf_asprintf(var, QUOTA_XATTR_PREFIX "%s.." CONTRIBUTION, \
+ _vol_name); \
+ } \
+ } while (0)
+
+#define GET_CONTRI_KEY_OR_GOTO(var, _vol_name, _gfid, label) \
+ do { \
+ GET_CONTRI_KEY(var, _vol_name, _gfid, ret); \
+ if (ret == -1) \
+ goto label; \
+ } while (0)
+
+#define GET_DIRTY_KEY_OR_GOTO(var, _vol_name, label) \
+ do { \
+ ret = gf_asprintf(var, QUOTA_XATTR_PREFIX "%s." DIRTY, _vol_name); \
+ if (ret == -1) \
+ goto label; \
+ } while (0)
+
+#define QUOTA_REG_OR_LNK_FILE(ia_type) (IA_ISREG(ia_type) || IA_ISLNK(ia_type))
struct quota_dentry {
- char *name;
- uuid_t par;
- struct list_head next;
+ char *name;
+ uuid_t par;
+ struct list_head next;
};
typedef struct quota_dentry quota_dentry_t;
struct quota_inode_ctx {
- int64_t size;
- int64_t hard_lim;
- int64_t soft_lim;
- int64_t file_count;
- int64_t dir_count;
- int64_t object_hard_lim;
- int64_t object_soft_lim;
- struct iatt buf;
- struct list_head parents;
- struct timeval tv;
- struct timeval prev_log;
- gf_boolean_t ancestry_built;
- gf_lock_t lock;
+ int64_t size;
+ int64_t hard_lim;
+ int64_t soft_lim;
+ int64_t file_count;
+ int64_t dir_count;
+ int64_t object_hard_lim;
+ int64_t object_soft_lim;
+ struct iatt buf;
+ struct list_head parents;
+ struct timeval tv;
+ struct timeval prev_log;
+ gf_boolean_t ancestry_built;
+ gf_lock_t lock;
};
typedef struct quota_inode_ctx quota_inode_ctx_t;
-typedef void
-(*quota_ancestry_built_t) (struct list_head *parents, inode_t *inode,
- int32_t op_ret, int32_t op_errno, void *data);
+typedef void (*quota_ancestry_built_t)(struct list_head *parents,
+ inode_t *inode, int32_t op_ret,
+ int32_t op_errno, void *data);
-typedef void
-(*quota_fop_continue_t) (call_frame_t *frame);
+typedef void (*quota_fop_continue_t)(call_frame_t *frame);
struct quota_local {
- gf_lock_t lock;
- uint32_t link_count;
- loc_t loc;
- loc_t oldloc;
- loc_t newloc;
- loc_t validate_loc;
- int64_t delta;
- int8_t object_delta;
- int32_t op_ret;
- int32_t op_errno;
- int64_t size;
- char just_validated;
- fop_lookup_cbk_t validate_cbk;
- quota_fop_continue_t fop_continue_cbk;
- inode_t *inode;
- uuid_t common_ancestor; /* Used by quota_rename */
- call_stub_t *stub;
- struct iobref *iobref;
- quota_limits_t limit;
- quota_limits_t object_limit;
- int64_t space_available;
- quota_ancestry_built_t ancestry_cbk;
- void *ancestry_data;
- dict_t *xdata;
- dict_t *validate_xdata;
- int32_t quotad_conn_retry;
- xlator_t *this;
- call_frame_t *par_frame;
+ gf_lock_t lock;
+ uint32_t link_count;
+ loc_t loc;
+ loc_t oldloc;
+ loc_t newloc;
+ loc_t validate_loc;
+ int64_t delta;
+ int8_t object_delta;
+ int32_t op_ret;
+ int32_t op_errno;
+ int64_t size;
+ char just_validated;
+ fop_lookup_cbk_t validate_cbk;
+ quota_fop_continue_t fop_continue_cbk;
+ inode_t *inode;
+ uuid_t common_ancestor; /* Used by quota_rename */
+ call_stub_t *stub;
+ struct iobref *iobref;
+ quota_limits_t limit;
+ quota_limits_t object_limit;
+ int64_t space_available;
+ quota_ancestry_built_t ancestry_cbk;
+ void *ancestry_data;
+ dict_t *xdata;
+ dict_t *validate_xdata;
+ int32_t quotad_conn_retry;
+ xlator_t *this;
+ call_frame_t *par_frame;
};
-typedef struct quota_local quota_local_t;
+typedef struct quota_local quota_local_t;
struct quota_priv {
- uint32_t soft_timeout;
- uint32_t hard_timeout;
- uint32_t log_timeout;
- double default_soft_lim;
- gf_boolean_t is_quota_on;
- gf_boolean_t consider_statfs;
- gf_lock_t lock;
- rpc_clnt_prog_t *quota_enforcer;
- struct rpcsvc_program *quotad_aggregator;
- struct rpc_clnt *rpc_clnt;
- rpcsvc_t *rpcsvc;
- inode_table_t *itable;
- char *volume_uuid;
- uint64_t validation_count;
- int32_t quotad_conn_status;
+ uint32_t soft_timeout;
+ uint32_t hard_timeout;
+ uint32_t log_timeout;
+ double default_soft_lim;
+ gf_boolean_t is_quota_on;
+ gf_boolean_t consider_statfs;
+ gf_lock_t lock;
+ rpc_clnt_prog_t *quota_enforcer;
+ struct rpcsvc_program *quotad_aggregator;
+ struct rpc_clnt *rpc_clnt;
+ rpcsvc_t *rpcsvc;
+ inode_table_t *itable;
+ char *volume_uuid;
+ uint64_t validation_count;
+ int32_t quotad_conn_status;
};
-typedef struct quota_priv quota_priv_t;
+typedef struct quota_priv quota_priv_t;
int
-quota_enforcer_lookup (call_frame_t *frame, xlator_t *this, dict_t *xdata,
- fop_lookup_cbk_t cbk);
+quota_enforcer_lookup(call_frame_t *frame, xlator_t *this, dict_t *xdata,
+ fop_lookup_cbk_t cbk);
void
-_quota_enforcer_lookup (void *data);
+_quota_enforcer_lookup(void *data);
struct rpc_clnt *
-quota_enforcer_init (xlator_t *this, dict_t *options);
+quota_enforcer_init(xlator_t *this, dict_t *options);
void
-quota_log_usage (xlator_t *this, quota_inode_ctx_t *ctx, inode_t *inode,
- int64_t delta);
+quota_log_usage(xlator_t *this, quota_inode_ctx_t *ctx, inode_t *inode,
+ int64_t delta);
int
-quota_build_ancestry (inode_t *inode, quota_ancestry_built_t ancestry_cbk,
- void *data);
+quota_build_ancestry(inode_t *inode, quota_ancestry_built_t ancestry_cbk,
+ void *data);
void
-quota_get_limit_dir (call_frame_t *frame, inode_t *cur_inode, xlator_t *this);
+quota_get_limit_dir(call_frame_t *frame, inode_t *cur_inode, xlator_t *this);
int32_t
-quota_check_limit (call_frame_t *frame, inode_t *inode, xlator_t *this);
+quota_check_limit(call_frame_t *frame, inode_t *inode, xlator_t *this);
inode_t *
-do_quota_check_limit (call_frame_t *frame, inode_t *inode, xlator_t *this,
- quota_dentry_t *dentry, gf_boolean_t force);
+do_quota_check_limit(call_frame_t *frame, inode_t *inode, xlator_t *this,
+ quota_dentry_t *dentry, gf_boolean_t force);
int
-quota_fill_inodectx (xlator_t *this, inode_t *inode, dict_t *dict,
- loc_t *loc, struct iatt *buf, int32_t *op_errno);
+quota_fill_inodectx(xlator_t *this, inode_t *inode, dict_t *dict, loc_t *loc,
+ struct iatt *buf, int32_t *op_errno);
int32_t
-quota_check_size_limit (call_frame_t *frame, quota_inode_ctx_t *ctx,
- quota_priv_t *priv, inode_t *_inode, xlator_t *this,
- int32_t *op_errno, int just_validated, int64_t delta,
- quota_local_t *local, gf_boolean_t *skip_check);
+quota_check_size_limit(call_frame_t *frame, quota_inode_ctx_t *ctx,
+ quota_priv_t *priv, inode_t *_inode, xlator_t *this,
+ int32_t *op_errno, int just_validated, int64_t delta,
+ quota_local_t *local, gf_boolean_t *skip_check);
int32_t
-quota_check_object_limit (call_frame_t *frame, quota_inode_ctx_t *ctx,
- quota_priv_t *priv, inode_t *_inode, xlator_t *this,
- int32_t *op_errno, int just_validated,
- quota_local_t *local, gf_boolean_t *skip_check);
+quota_check_object_limit(call_frame_t *frame, quota_inode_ctx_t *ctx,
+ quota_priv_t *priv, inode_t *_inode, xlator_t *this,
+ int32_t *op_errno, int just_validated,
+ quota_local_t *local, gf_boolean_t *skip_check);
#endif
diff --git a/xlators/features/quota/src/quotad-aggregator.h b/xlators/features/quota/src/quotad-aggregator.h
index 5ddea5b3c46..02a0094102f 100644
--- a/xlators/features/quota/src/quotad-aggregator.h
+++ b/xlators/features/quota/src/quotad-aggregator.h
@@ -17,21 +17,20 @@
#include "inode.h"
typedef struct {
- void *pool;
- xlator_t *this;
- xlator_t *active_subvol;
- inode_table_t *itable;
- loc_t loc;
- dict_t *xdata;
+ void *pool;
+ xlator_t *this;
+ xlator_t *active_subvol;
+ inode_table_t *itable;
+ loc_t loc;
+ dict_t *xdata;
} quotad_aggregator_state_t;
-typedef int (*quotad_aggregator_lookup_cbk_t) (xlator_t *this,
- call_frame_t *frame,
- void *rsp);
+typedef int (*quotad_aggregator_lookup_cbk_t)(xlator_t *this,
+ call_frame_t *frame, void *rsp);
int
-qd_nameless_lookup (xlator_t *this, call_frame_t *frame, gfs3_lookup_req *req,
- dict_t *xdata, quotad_aggregator_lookup_cbk_t lookup_cbk);
+qd_nameless_lookup(xlator_t *this, call_frame_t *frame, gfs3_lookup_req *req,
+ dict_t *xdata, quotad_aggregator_lookup_cbk_t lookup_cbk);
int
-quotad_aggregator_init (xlator_t *this);
+quotad_aggregator_init(xlator_t *this);
#endif
diff --git a/xlators/features/quota/src/quotad-helpers.h b/xlators/features/quota/src/quotad-helpers.h
index a10fb7fa82a..bcb39fe845e 100644
--- a/xlators/features/quota/src/quotad-helpers.h
+++ b/xlators/features/quota/src/quotad-helpers.h
@@ -16,9 +16,9 @@
#include "quotad-aggregator.h"
void
-quotad_aggregator_free_state (quotad_aggregator_state_t *state);
+quotad_aggregator_free_state(quotad_aggregator_state_t *state);
call_frame_t *
-quotad_aggregator_get_frame_from_req (rpcsvc_request_t *req);
+quotad_aggregator_get_frame_from_req(rpcsvc_request_t *req);
#endif
diff --git a/xlators/features/read-only/src/read-only-common.h b/xlators/features/read-only/src/read-only-common.h
index ec629bd5660..32719da28f1 100644
--- a/xlators/features/read-only/src/read-only-common.h
+++ b/xlators/features/read-only/src/read-only-common.h
@@ -11,107 +11,111 @@
#include "defaults.h"
gf_boolean_t
-is_readonly_or_worm_enabled (call_frame_t *frame, xlator_t *this);
+is_readonly_or_worm_enabled(call_frame_t *frame, xlator_t *this);
int32_t
-ro_xattrop (call_frame_t *frame, xlator_t *this, loc_t *loc,
- gf_xattrop_flags_t flags, dict_t *dict, dict_t *xdata);
+ro_xattrop(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ gf_xattrop_flags_t flags, dict_t *dict, dict_t *xdata);
int32_t
-ro_fxattrop (call_frame_t *frame, xlator_t *this,
- fd_t *fd, gf_xattrop_flags_t flags, dict_t *dict, dict_t *xdata);
+ro_fxattrop(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ gf_xattrop_flags_t flags, dict_t *dict, dict_t *xdata);
int32_t
-ro_entrylk (call_frame_t *frame, xlator_t *this, const char *volume,
- loc_t *loc, const char *basename, entrylk_cmd cmd,
- entrylk_type type, dict_t *xdata);
+ro_entrylk(call_frame_t *frame, xlator_t *this, const char *volume, loc_t *loc,
+ const char *basename, entrylk_cmd cmd, entrylk_type type,
+ dict_t *xdata);
int32_t
-ro_fentrylk (call_frame_t *frame, xlator_t *this, const char *volume,
- fd_t *fd, const char *basename, entrylk_cmd cmd, entrylk_type
- type, dict_t *xdata);
+ro_fentrylk(call_frame_t *frame, xlator_t *this, const char *volume, fd_t *fd,
+ const char *basename, entrylk_cmd cmd, entrylk_type type,
+ dict_t *xdata);
int32_t
-ro_inodelk (call_frame_t *frame, xlator_t *this, const char *volume,
- loc_t *loc, int32_t cmd, struct gf_flock *lock, dict_t *xdata);
+ro_inodelk(call_frame_t *frame, xlator_t *this, const char *volume, loc_t *loc,
+ int32_t cmd, struct gf_flock *lock, dict_t *xdata);
int32_t
-ro_finodelk (call_frame_t *frame, xlator_t *this, const char *volume,
- fd_t *fd, int32_t cmd, struct gf_flock *lock, dict_t *xdata);
+ro_finodelk(call_frame_t *frame, xlator_t *this, const char *volume, fd_t *fd,
+ int32_t cmd, struct gf_flock *lock, dict_t *xdata);
int32_t
-ro_lk (call_frame_t *frame, xlator_t *this, fd_t *fd, int cmd,
- struct gf_flock *flock, dict_t *xdata);
+ro_lk(call_frame_t *frame, xlator_t *this, fd_t *fd, int cmd,
+ struct gf_flock *flock, dict_t *xdata);
int32_t
-ro_setattr (call_frame_t *frame, xlator_t *this, loc_t *loc,
- struct iatt *stbuf, int32_t valid, dict_t *xdata);
+ro_setattr(call_frame_t *frame, xlator_t *this, loc_t *loc, struct iatt *stbuf,
+ int32_t valid, dict_t *xdata);
int32_t
-ro_fsetattr (call_frame_t *frame, xlator_t *this, fd_t *fd,
- struct iatt *stbuf, int32_t valid, dict_t *xdata);
-
+ro_fsetattr(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iatt *stbuf,
+ int32_t valid, dict_t *xdata);
int32_t
-ro_truncate (call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset, dict_t *xdata);
+ro_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset,
+ dict_t *xdata);
int32_t
-ro_ftruncate (call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, dict_t *xdata);
+ro_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
+ dict_t *xdata);
int
-ro_mknod (call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode,
- dev_t rdev, mode_t umask, dict_t *xdata);
+ro_mknod(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode,
+ dev_t rdev, mode_t umask, dict_t *xdata);
int
-ro_mkdir (call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode,
- mode_t umask, dict_t *xdata);
+ro_mkdir(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode,
+ mode_t umask, dict_t *xdata);
int32_t
-ro_unlink (call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag,
- dict_t *xdata);
-
-int
-ro_rmdir (call_frame_t *frame, xlator_t *this, loc_t *loc, int flags,
+ro_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag,
dict_t *xdata);
+int
+ro_rmdir(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags,
+ dict_t *xdata);
int
-ro_symlink (call_frame_t *frame, xlator_t *this, const char *linkpath,
- loc_t *loc, mode_t umask, dict_t *xdata);
+ro_symlink(call_frame_t *frame, xlator_t *this, const char *linkpath,
+ loc_t *loc, mode_t umask, dict_t *xdata);
int32_t
-ro_rename (call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, dict_t *xdata);
+ro_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc,
+ dict_t *xdata);
int32_t
-ro_link (call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, dict_t *xdata);
+ro_link(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc,
+ dict_t *xdata);
int32_t
-ro_create (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags,
- mode_t mode, mode_t umask, fd_t *fd, dict_t *xdata);
+ro_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags,
+ mode_t mode, mode_t umask, fd_t *fd, dict_t *xdata);
int32_t
-ro_open (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags,
- fd_t *fd, dict_t *xdata);
+ro_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags,
+ fd_t *fd, dict_t *xdata);
int32_t
-ro_fsetxattr (call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict,
- int32_t flags, dict_t *xdata);
+ro_fsetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict,
+ int32_t flags, dict_t *xdata);
int32_t
-ro_fsyncdir (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t flags, dict_t *xdata);
+ro_fsyncdir(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t flags,
+ dict_t *xdata);
int32_t
-ro_writev (call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector,
- int32_t count, off_t off, uint32_t flags, struct iobref *iobref, dict_t *xdata);
+ro_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector,
+ int32_t count, off_t off, uint32_t flags, struct iobref *iobref,
+ dict_t *xdata);
int32_t
-ro_setxattr (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict,
- int32_t flags, dict_t *xdata);
+ro_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict,
+ int32_t flags, dict_t *xdata);
int32_t
-ro_removexattr (call_frame_t *frame, xlator_t *this, loc_t *loc,
- const char *name, dict_t *xdata);
+ro_removexattr(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ const char *name, dict_t *xdata);
int32_t
-ro_fallocate (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t mode,
- off_t offset, size_t len, dict_t *xdata);
+ro_fallocate(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t mode,
+ off_t offset, size_t len, dict_t *xdata);
diff --git a/xlators/features/read-only/src/read-only-mem-types.h b/xlators/features/read-only/src/read-only-mem-types.h
index 940700a017d..4baaeb41216 100644
--- a/xlators/features/read-only/src/read-only-mem-types.h
+++ b/xlators/features/read-only/src/read-only-mem-types.h
@@ -14,7 +14,7 @@
#include "mem-types.h"
enum gf_read_only_mem_types_ {
- gf_read_only_mt_priv_t = gf_common_mt_end + 1,
- gf_read_only_mt_end
+ gf_read_only_mt_priv_t = gf_common_mt_end + 1,
+ gf_read_only_mt_end
};
#endif
diff --git a/xlators/features/read-only/src/read-only.h b/xlators/features/read-only/src/read-only.h
index aae625f5eaf..d74053a2a8f 100644
--- a/xlators/features/read-only/src/read-only.h
+++ b/xlators/features/read-only/src/read-only.h
@@ -14,25 +14,23 @@
#include "read-only-mem-types.h"
#include "xlator.h"
-
typedef struct {
- uint8_t worm : 1;
- uint8_t retain : 1;
- uint8_t legal_hold :1;
- uint8_t ret_mode : 1;
- uint64_t ret_period;
- uint64_t auto_commit_period;
+ uint8_t worm : 1;
+ uint8_t retain : 1;
+ uint8_t legal_hold : 1;
+ uint8_t ret_mode : 1;
+ uint64_t ret_period;
+ uint64_t auto_commit_period;
} worm_reten_state_t;
-
typedef struct {
- gf_boolean_t readonly_or_worm_enabled;
- gf_boolean_t worm_file;
- gf_boolean_t worm_files_deletable;
- uint64_t reten_period;
- uint64_t com_period;
- char *reten_mode;
- time_t start_time;
+ gf_boolean_t readonly_or_worm_enabled;
+ gf_boolean_t worm_file;
+ gf_boolean_t worm_files_deletable;
+ uint64_t reten_period;
+ uint64_t com_period;
+ char *reten_mode;
+ time_t start_time;
} read_only_priv_t;
#endif
diff --git a/xlators/features/read-only/src/worm-helper.h b/xlators/features/read-only/src/worm-helper.h
index 745df8294c3..b42f8d2b40c 100644
--- a/xlators/features/read-only/src/worm-helper.h
+++ b/xlators/features/read-only/src/worm-helper.h
@@ -8,30 +8,37 @@
cases as published by the Free Software Foundation.
*/
-gf_boolean_t gf_worm_write_disabled (struct iatt *stbuf);
+gf_boolean_t
+gf_worm_write_disabled(struct iatt *stbuf);
-int32_t worm_init_state (xlator_t *this, gf_boolean_t fop_with_fd,
- void *file_ptr);
+int32_t
+worm_init_state(xlator_t *this, gf_boolean_t fop_with_fd, void *file_ptr);
-int32_t worm_set_state (xlator_t *this, gf_boolean_t fop_with_fd,
- void *file_ptr, worm_reten_state_t *retention_state,
- struct iatt *stbuf);
+int32_t
+worm_set_state(xlator_t *this, gf_boolean_t fop_with_fd, void *file_ptr,
+ worm_reten_state_t *retention_state, struct iatt *stbuf);
-int32_t worm_get_state (xlator_t *this, gf_boolean_t fop_with_fd,
- void *file_ptr, worm_reten_state_t *reten_state);
+int32_t
+worm_get_state(xlator_t *this, gf_boolean_t fop_with_fd, void *file_ptr,
+ worm_reten_state_t *reten_state);
-void gf_worm_state_lookup (xlator_t *this, gf_boolean_t fop_with_fd,
- void *file_ptr, worm_reten_state_t *reten_state,
- struct iatt *stbuf);
+void
+gf_worm_state_lookup(xlator_t *this, gf_boolean_t fop_with_fd, void *file_ptr,
+ worm_reten_state_t *reten_state, struct iatt *stbuf);
-void gf_worm_serialize_state (worm_reten_state_t *reten_state, char *val);
+void
+gf_worm_serialize_state(worm_reten_state_t *reten_state, char *val);
-void gf_worm_deserialize_state (char *val, worm_reten_state_t *reten_state);
+void
+gf_worm_deserialize_state(char *val, worm_reten_state_t *reten_state);
-int32_t gf_worm_set_xattr (xlator_t *this, worm_reten_state_t *reten_state,
- gf_boolean_t fop_with_fd, void *file_ptr);
+int32_t
+gf_worm_set_xattr(xlator_t *this, worm_reten_state_t *reten_state,
+ gf_boolean_t fop_with_fd, void *file_ptr);
-int gf_worm_state_transition (xlator_t *this, gf_boolean_t fop_with_fd,
- void *file_ptr, glusterfs_fop_t op);
+int
+gf_worm_state_transition(xlator_t *this, gf_boolean_t fop_with_fd,
+ void *file_ptr, glusterfs_fop_t op);
-int32_t is_wormfile (xlator_t *this, gf_boolean_t fop_with_fd, void *file_ptr);
+int32_t
+is_wormfile(xlator_t *this, gf_boolean_t fop_with_fd, void *file_ptr);
diff --git a/xlators/features/sdfs/src/sdfs-messages.h b/xlators/features/sdfs/src/sdfs-messages.h
index 6c7a9d90667..cf866c8512a 100644
--- a/xlators/features/sdfs/src/sdfs-messages.h
+++ b/xlators/features/sdfs/src/sdfs-messages.h
@@ -39,16 +39,14 @@
* holes.
*/
-#define GLFS_SDFS_BASE GLFS_MSGID_COMP_SDFS
-#define GLFS_SDFS_NUM_MESSAGES 2
-#define GLFS_MSGID_END (GLFS_SDFS_BASE + \
- GLFS_SDFS_NUM_MESSAGES + 1)
+#define GLFS_SDFS_BASE GLFS_MSGID_COMP_SDFS
+#define GLFS_SDFS_NUM_MESSAGES 2
+#define GLFS_MSGID_END (GLFS_SDFS_BASE + GLFS_SDFS_NUM_MESSAGES + 1)
/* Messaged with message IDs */
-#define glfs_msg_start_x GLFS_DFS_BASE, "Invalid: Start of messages"
+#define glfs_msg_start_x GLFS_DFS_BASE, "Invalid: Start of messages"
/*------------*/
-
-#define SDFS_MSG_ENTRYLK_ERROR (GLFS_SDFS_BASE + 1)
+#define SDFS_MSG_ENTRYLK_ERROR (GLFS_SDFS_BASE + 1)
/*!
* @messageid
* @diagnosis
@@ -56,7 +54,7 @@
*
*/
-#define SDFS_MSG_MKDIR_ERROR (GLFS_SDFS_BASE + 2)
+#define SDFS_MSG_MKDIR_ERROR (GLFS_SDFS_BASE + 2)
/*!
* @messageid
* @diagnosis
diff --git a/xlators/features/sdfs/src/sdfs.h b/xlators/features/sdfs/src/sdfs.h
index d28257eda5e..986d7c2731c 100644
--- a/xlators/features/sdfs/src/sdfs.h
+++ b/xlators/features/sdfs/src/sdfs.h
@@ -13,37 +13,37 @@
#include "sdfs-messages.h"
#include "atomic.h"
-#define SDFS_LOCK_COUNT_MAX 2
+#define SDFS_LOCK_COUNT_MAX 2
-typedef struct{
- loc_t parent_loc;
- char *basename;
- int locked[SDFS_LOCK_COUNT_MAX];
+typedef struct {
+ loc_t parent_loc;
+ char *basename;
+ int locked[SDFS_LOCK_COUNT_MAX];
} sdfs_entry_lock_t;
typedef struct {
- sdfs_entry_lock_t entrylk[SDFS_LOCK_COUNT_MAX];
- int lock_count;
+ sdfs_entry_lock_t entrylk[SDFS_LOCK_COUNT_MAX];
+ int lock_count;
} sdfs_lock_t;
struct sdfs_local {
- call_frame_t *main_frame;
- loc_t loc;
- loc_t parent_loc;
- call_stub_t *stub;
- sdfs_lock_t *lock;
- int op_ret;
- int op_errno;
- gf_atomic_t call_cnt;
+ call_frame_t *main_frame;
+ loc_t loc;
+ loc_t parent_loc;
+ call_stub_t *stub;
+ sdfs_lock_t *lock;
+ int op_ret;
+ int op_errno;
+ gf_atomic_t call_cnt;
};
typedef struct sdfs_local sdfs_local_t;
-#define SDFS_STACK_DESTROY(frame) do { \
- sdfs_local_t *__local = NULL; \
- __local = frame->local; \
- frame->local = NULL; \
- gf_client_unref (frame->root->client); \
- STACK_DESTROY (frame->root); \
- sdfs_local_cleanup (__local); \
- } while (0)
-
+#define SDFS_STACK_DESTROY(frame) \
+ do { \
+ sdfs_local_t *__local = NULL; \
+ __local = frame->local; \
+ frame->local = NULL; \
+ gf_client_unref(frame->root->client); \
+ STACK_DESTROY(frame->root); \
+ sdfs_local_cleanup(__local); \
+ } while (0)
diff --git a/xlators/features/selinux/src/selinux-mem-types.h b/xlators/features/selinux/src/selinux-mem-types.h
index f9f356dd39a..a8c544fba52 100644
--- a/xlators/features/selinux/src/selinux-mem-types.h
+++ b/xlators/features/selinux/src/selinux-mem-types.h
@@ -13,8 +13,7 @@
#include "mem-types.h"
enum gf_selinux_mem_types_ {
- gf_selinux_mt_selinux_priv_t = gf_common_mt_end + 1,
- gf_selinux_mt_end
+ gf_selinux_mt_selinux_priv_t = gf_common_mt_end + 1,
+ gf_selinux_mt_end
};
#endif
-
diff --git a/xlators/features/selinux/src/selinux-messages.h b/xlators/features/selinux/src/selinux-messages.h
index 3a1663433ab..1f5739d8dc7 100644
--- a/xlators/features/selinux/src/selinux-messages.h
+++ b/xlators/features/selinux/src/selinux-messages.h
@@ -23,13 +23,8 @@
* glfs-message-id.h.
*/
-GLFS_MSGID(SL,
- SL_MSG_INVALID_VOLFILE,
- SL_MSG_ENOMEM,
- SL_MSG_MEM_ACCT_INIT_FAILED,
- SL_MSG_SELINUX_GLUSTER_XATTR_MISSING,
- SL_MSG_SELINUX_XATTR_MISSING
-);
+GLFS_MSGID(SL, SL_MSG_INVALID_VOLFILE, SL_MSG_ENOMEM,
+ SL_MSG_MEM_ACCT_INIT_FAILED, SL_MSG_SELINUX_GLUSTER_XATTR_MISSING,
+ SL_MSG_SELINUX_XATTR_MISSING);
#endif /*_SELINUX_MESSAGES_H */
-
diff --git a/xlators/features/selinux/src/selinux.h b/xlators/features/selinux/src/selinux.h
index 2ff57b5080a..787bff348f0 100644
--- a/xlators/features/selinux/src/selinux.h
+++ b/xlators/features/selinux/src/selinux.h
@@ -16,7 +16,7 @@
#define SELINUX_GLUSTER_XATTR "trusted.glusterfs.selinux"
struct selinux_priv {
- gf_boolean_t selinux_enabled;
+ gf_boolean_t selinux_enabled;
};
typedef struct selinux_priv selinux_priv_t;
diff --git a/xlators/features/shard/src/shard-mem-types.h b/xlators/features/shard/src/shard-mem-types.h
index fea66aa7dcb..39a57ba6fd0 100644
--- a/xlators/features/shard/src/shard-mem-types.h
+++ b/xlators/features/shard/src/shard-mem-types.h
@@ -13,12 +13,12 @@
#include "mem-types.h"
enum gf_shard_mem_types_ {
- gf_shard_mt_priv_t = gf_common_mt_end + 1,
- gf_shard_mt_inode_list,
- gf_shard_mt_inode_ctx_t,
- gf_shard_mt_iovec,
- gf_shard_mt_int64_t,
- gf_shard_mt_uint64_t,
- gf_shard_mt_end
+ gf_shard_mt_priv_t = gf_common_mt_end + 1,
+ gf_shard_mt_inode_list,
+ gf_shard_mt_inode_ctx_t,
+ gf_shard_mt_iovec,
+ gf_shard_mt_int64_t,
+ gf_shard_mt_uint64_t,
+ gf_shard_mt_end
};
#endif
diff --git a/xlators/features/shard/src/shard-messages.h b/xlators/features/shard/src/shard-messages.h
index 1f0378b20df..89a96709219 100644
--- a/xlators/features/shard/src/shard-messages.h
+++ b/xlators/features/shard/src/shard-messages.h
@@ -23,29 +23,17 @@
* glfs-message-id.h.
*/
-GLFS_MSGID(SHARD,
- SHARD_MSG_BASE_FILE_LOOKUP_FAILED,
- SHARD_MSG_DICT_OP_FAILED,
- SHARD_MSG_DOT_SHARD_NODIR,
- SHARD_MSG_FD_CTX_SET_FAILED,
- SHARD_MSG_INODE_CTX_GET_FAILED,
- SHARD_MSG_INODE_CTX_SET_FAILED,
- SHARD_MSG_INODE_PATH_FAILED,
- SHARD_MSG_INTERNAL_XATTR_MISSING,
- SHARD_MSG_INVALID_VOLFILE,
- SHARD_MSG_LOOKUP_SHARD_FAILED,
- SHARD_MSG_MEM_ACCT_INIT_FAILED,
- SHARD_MSG_NULL_THIS,
- SHARD_MSG_SIZE_SET_FAILED,
- SHARD_MSG_STAT_FAILED,
- SHARD_MSG_TRUNCATE_LAST_SHARD_FAILED,
- SHARD_MSG_UPDATE_FILE_SIZE_FAILED,
- SHARD_MSG_FOP_NOT_SUPPORTED,
- SHARD_MSG_INVALID_FOP,
- SHARD_MSG_MEMALLOC_FAILED,
- SHARD_MSG_FOP_FAILED,
- SHARD_MSG_SHARDS_DELETION_FAILED,
- SHARD_MSG_SHARD_DELETION_COMPLETED
-);
+GLFS_MSGID(SHARD, SHARD_MSG_BASE_FILE_LOOKUP_FAILED, SHARD_MSG_DICT_OP_FAILED,
+ SHARD_MSG_DOT_SHARD_NODIR, SHARD_MSG_FD_CTX_SET_FAILED,
+ SHARD_MSG_INODE_CTX_GET_FAILED, SHARD_MSG_INODE_CTX_SET_FAILED,
+ SHARD_MSG_INODE_PATH_FAILED, SHARD_MSG_INTERNAL_XATTR_MISSING,
+ SHARD_MSG_INVALID_VOLFILE, SHARD_MSG_LOOKUP_SHARD_FAILED,
+ SHARD_MSG_MEM_ACCT_INIT_FAILED, SHARD_MSG_NULL_THIS,
+ SHARD_MSG_SIZE_SET_FAILED, SHARD_MSG_STAT_FAILED,
+ SHARD_MSG_TRUNCATE_LAST_SHARD_FAILED,
+ SHARD_MSG_UPDATE_FILE_SIZE_FAILED, SHARD_MSG_FOP_NOT_SUPPORTED,
+ SHARD_MSG_INVALID_FOP, SHARD_MSG_MEMALLOC_FAILED,
+ SHARD_MSG_FOP_FAILED, SHARD_MSG_SHARDS_DELETION_FAILED,
+ SHARD_MSG_SHARD_DELETION_COMPLETED);
#endif /* !_SHARD_MESSAGES_H_ */
diff --git a/xlators/features/shard/src/shard.h b/xlators/features/shard/src/shard.h
index 7a263f4c37b..f877591faee 100644
--- a/xlators/features/shard/src/shard.h
+++ b/xlators/features/shard/src/shard.h
@@ -8,7 +8,6 @@
cases as published by the Free Software Foundation.
*/
-
#ifndef __SHARD_H__
#define __SHARD_H__
@@ -19,324 +18,329 @@
#define GF_SHARD_DIR ".shard"
#define GF_SHARD_REMOVE_ME_DIR ".remove_me"
-#define SHARD_MIN_BLOCK_SIZE (4 * GF_UNIT_MB)
-#define SHARD_MAX_BLOCK_SIZE (4 * GF_UNIT_TB)
+#define SHARD_MIN_BLOCK_SIZE (4 * GF_UNIT_MB)
+#define SHARD_MAX_BLOCK_SIZE (4 * GF_UNIT_TB)
#define SHARD_XATTR_PREFIX "trusted.glusterfs.shard."
#define GF_XATTR_SHARD_BLOCK_SIZE "trusted.glusterfs.shard.block-size"
/**
* Bit masks for the valid flag, which is used while updating ctx
-**/
-#define SHARD_MASK_BLOCK_SIZE (1 << 0)
-#define SHARD_MASK_PROT (1 << 1)
-#define SHARD_MASK_NLINK (1 << 2)
-#define SHARD_MASK_UID (1 << 3)
-#define SHARD_MASK_GID (1 << 4)
-#define SHARD_MASK_SIZE (1 << 6)
-#define SHARD_MASK_BLOCKS (1 << 7)
-#define SHARD_MASK_TIMES (1 << 8)
-#define SHARD_MASK_OTHERS (1 << 9)
-#define SHARD_MASK_REFRESH_RESET (1 << 10)
-
-#define SHARD_INODE_WRITE_MASK (SHARD_MASK_SIZE | SHARD_MASK_BLOCKS \
- | SHARD_MASK_TIMES)
-
-#define SHARD_LOOKUP_MASK (SHARD_MASK_PROT | SHARD_MASK_NLINK | SHARD_MASK_UID \
- | SHARD_MASK_GID | SHARD_MASK_TIMES \
- | SHARD_MASK_OTHERS)
-
-#define SHARD_ALL_MASK (SHARD_MASK_BLOCK_SIZE | SHARD_MASK_PROT \
- | SHARD_MASK_NLINK | SHARD_MASK_UID | SHARD_MASK_GID \
- | SHARD_MASK_SIZE | SHARD_MASK_BLOCKS \
- | SHARD_MASK_TIMES | SHARD_MASK_OTHERS)
-
+ **/
+#define SHARD_MASK_BLOCK_SIZE (1 << 0)
+#define SHARD_MASK_PROT (1 << 1)
+#define SHARD_MASK_NLINK (1 << 2)
+#define SHARD_MASK_UID (1 << 3)
+#define SHARD_MASK_GID (1 << 4)
+#define SHARD_MASK_SIZE (1 << 6)
+#define SHARD_MASK_BLOCKS (1 << 7)
+#define SHARD_MASK_TIMES (1 << 8)
+#define SHARD_MASK_OTHERS (1 << 9)
+#define SHARD_MASK_REFRESH_RESET (1 << 10)
+
+#define SHARD_INODE_WRITE_MASK \
+ (SHARD_MASK_SIZE | SHARD_MASK_BLOCKS | SHARD_MASK_TIMES)
+
+#define SHARD_LOOKUP_MASK \
+ (SHARD_MASK_PROT | SHARD_MASK_NLINK | SHARD_MASK_UID | SHARD_MASK_GID | \
+ SHARD_MASK_TIMES | SHARD_MASK_OTHERS)
+
+#define SHARD_ALL_MASK \
+ (SHARD_MASK_BLOCK_SIZE | SHARD_MASK_PROT | SHARD_MASK_NLINK | \
+ SHARD_MASK_UID | SHARD_MASK_GID | SHARD_MASK_SIZE | SHARD_MASK_BLOCKS | \
+ SHARD_MASK_TIMES | SHARD_MASK_OTHERS)
#define get_lowest_block(off, shard_size) ((off) / (shard_size))
-#define get_highest_block(off, len, shard_size) \
- (((((off)+(len)) == 0)?0:((off)+(len)-1)) / (shard_size))
+#define get_highest_block(off, len, shard_size) \
+ (((((off) + (len)) == 0) ? 0 : ((off) + (len)-1)) / (shard_size))
int
-shard_unlock_inodelk (call_frame_t *frame, xlator_t *this);
+shard_unlock_inodelk(call_frame_t *frame, xlator_t *this);
int
-shard_unlock_entrylk (call_frame_t *frame, xlator_t *this);
-
-#define SHARD_ENTRY_FOP_CHECK(loc, op_errno, label) do { \
- if ((loc->name && !strcmp (GF_SHARD_DIR, loc->name)) && \
- (((loc->parent) && \
- __is_root_gfid (loc->parent->gfid)) || \
- __is_root_gfid (loc->pargfid))) { \
- op_errno = EPERM; \
- goto label; \
- } \
- \
- if ((loc->parent && \
- __is_shard_dir (loc->parent->gfid)) || \
- __is_shard_dir (loc->pargfid)) { \
- op_errno = EPERM; \
- goto label; \
- } \
-} while (0)
-
-#define SHARD_INODE_OP_CHECK(gfid, err, label) do { \
- if (__is_shard_dir(gfid)) { \
- err = EPERM; \
- goto label; \
- } \
-} while (0)
-
-#define SHARD_STACK_UNWIND(fop, frame, params ...) do { \
- shard_local_t *__local = NULL; \
- if (frame) { \
- __local = frame->local; \
- if (__local && __local->int_inodelk.acquired_lock) \
- shard_unlock_inodelk (frame, frame->this); \
- if (__local && __local->int_entrylk.acquired_lock) \
- shard_unlock_entrylk (frame, frame->this); \
- frame->local = NULL; \
- } \
- STACK_UNWIND_STRICT (fop, frame, params); \
- if (__local) { \
- shard_local_wipe (__local); \
- mem_put (__local); \
- } \
-} while (0)
-
-#define SHARD_STACK_DESTROY(frame) \
- do { \
- shard_local_t *__local = NULL; \
- __local = frame->local; \
- frame->local = NULL; \
- STACK_DESTROY (frame->root); \
- if (__local) { \
- shard_local_wipe (__local); \
- mem_put (__local); \
- } \
- } while (0);
-
-
-#define SHARD_INODE_CREATE_INIT(this, block_size, xattr_req, loc, size, \
- block_count, label) do { \
- int __ret = -1; \
- int64_t *__size_attr = NULL; \
- uint64_t *__bs = 0; \
- \
- __bs = GF_MALLOC (sizeof (uint64_t), gf_shard_mt_uint64_t); \
- if (!__bs) \
- goto label; \
- *__bs = hton64 (block_size); \
- __ret = dict_set_bin (xattr_req, GF_XATTR_SHARD_BLOCK_SIZE, __bs, \
- sizeof (*__bs)); \
- if (__ret) { \
- gf_msg (this->name, GF_LOG_WARNING, 0, \
- SHARD_MSG_DICT_OP_FAILED, "Failed to set key: %s " \
- "on path %s", GF_XATTR_SHARD_BLOCK_SIZE, (loc)->path);\
- GF_FREE (__bs); \
- goto label; \
- } \
- \
- __ret = shard_set_size_attrs (size, block_count, &__size_attr); \
- if (__ret) \
- goto label; \
- \
- __ret = dict_set_bin (xattr_req, GF_XATTR_SHARD_FILE_SIZE, \
- __size_attr, 8 * 4); \
- if (__ret) { \
- gf_msg (this->name, GF_LOG_WARNING, 0, \
- SHARD_MSG_DICT_OP_FAILED, "Failed to set key: %s " \
- "on path %s", GF_XATTR_SHARD_FILE_SIZE, (loc)->path); \
- GF_FREE (__size_attr); \
- goto label; \
- } \
-} while (0)
-
-
-#define SHARD_MD_READ_FOP_INIT_REQ_DICT(this, dict, gfid, local, label) do { \
- int __ret = -1; \
- \
- __ret = dict_set_uint64 (dict, GF_XATTR_SHARD_FILE_SIZE, 8 * 4); \
- if (__ret) { \
- local->op_ret = -1; \
- local->op_errno = ENOMEM; \
- gf_msg (this->name, GF_LOG_WARNING, 0, \
- SHARD_MSG_DICT_OP_FAILED, "Failed to set dict value:"\
- " key:%s for %s.", GF_XATTR_SHARD_FILE_SIZE, \
- uuid_utoa (gfid)); \
- goto label; \
- } \
-} while (0)
-
-#define SHARD_SET_ROOT_FS_ID(frame, local) do { \
- if (!local->is_set_fsid) { \
- local->uid = frame->root->uid; \
- local->gid = frame->root->gid; \
- frame->root->uid = 0; \
- frame->root->gid = 0; \
- local->is_set_fsid = _gf_true; \
- } \
-} while (0)
-
-#define SHARD_UNSET_ROOT_FS_ID(frame, local) do { \
- if (local->is_set_fsid) { \
- frame->root->uid = local->uid; \
- frame->root->gid = local->gid; \
- local->is_set_fsid = _gf_false; \
- } \
-} while (0)
-
-#define SHARD_TIME_UPDATE(ctx_sec, ctx_nsec, new_sec, new_nsec) do { \
- if (ctx_sec == new_sec) \
- ctx_nsec = new_nsec = max (new_nsec, ctx_nsec); \
- else if (ctx_sec > new_sec) { \
- new_sec = ctx_sec; \
- new_nsec = ctx_nsec; \
- } else { \
- ctx_sec = new_sec; \
- ctx_nsec = new_nsec; \
- } \
- } while (0)
+shard_unlock_entrylk(call_frame_t *frame, xlator_t *this);
+
+#define SHARD_ENTRY_FOP_CHECK(loc, op_errno, label) \
+ do { \
+ if ((loc->name && !strcmp(GF_SHARD_DIR, loc->name)) && \
+ (((loc->parent) && __is_root_gfid(loc->parent->gfid)) || \
+ __is_root_gfid(loc->pargfid))) { \
+ op_errno = EPERM; \
+ goto label; \
+ } \
+ \
+ if ((loc->parent && __is_shard_dir(loc->parent->gfid)) || \
+ __is_shard_dir(loc->pargfid)) { \
+ op_errno = EPERM; \
+ goto label; \
+ } \
+ } while (0)
+
+#define SHARD_INODE_OP_CHECK(gfid, err, label) \
+ do { \
+ if (__is_shard_dir(gfid)) { \
+ err = EPERM; \
+ goto label; \
+ } \
+ } while (0)
+
+#define SHARD_STACK_UNWIND(fop, frame, params...) \
+ do { \
+ shard_local_t *__local = NULL; \
+ if (frame) { \
+ __local = frame->local; \
+ if (__local && __local->int_inodelk.acquired_lock) \
+ shard_unlock_inodelk(frame, frame->this); \
+ if (__local && __local->int_entrylk.acquired_lock) \
+ shard_unlock_entrylk(frame, frame->this); \
+ frame->local = NULL; \
+ } \
+ STACK_UNWIND_STRICT(fop, frame, params); \
+ if (__local) { \
+ shard_local_wipe(__local); \
+ mem_put(__local); \
+ } \
+ } while (0)
+
+#define SHARD_STACK_DESTROY(frame) \
+ do { \
+ shard_local_t *__local = NULL; \
+ __local = frame->local; \
+ frame->local = NULL; \
+ STACK_DESTROY(frame->root); \
+ if (__local) { \
+ shard_local_wipe(__local); \
+ mem_put(__local); \
+ } \
+ } while (0);
+
+#define SHARD_INODE_CREATE_INIT(this, block_size, xattr_req, loc, size, \
+ block_count, label) \
+ do { \
+ int __ret = -1; \
+ int64_t *__size_attr = NULL; \
+ uint64_t *__bs = 0; \
+ \
+ __bs = GF_MALLOC(sizeof(uint64_t), gf_shard_mt_uint64_t); \
+ if (!__bs) \
+ goto label; \
+ *__bs = hton64(block_size); \
+ __ret = dict_set_bin(xattr_req, GF_XATTR_SHARD_BLOCK_SIZE, __bs, \
+ sizeof(*__bs)); \
+ if (__ret) { \
+ gf_msg(this->name, GF_LOG_WARNING, 0, SHARD_MSG_DICT_OP_FAILED, \
+ "Failed to set key: %s " \
+ "on path %s", \
+ GF_XATTR_SHARD_BLOCK_SIZE, (loc)->path); \
+ GF_FREE(__bs); \
+ goto label; \
+ } \
+ \
+ __ret = shard_set_size_attrs(size, block_count, &__size_attr); \
+ if (__ret) \
+ goto label; \
+ \
+ __ret = dict_set_bin(xattr_req, GF_XATTR_SHARD_FILE_SIZE, __size_attr, \
+ 8 * 4); \
+ if (__ret) { \
+ gf_msg(this->name, GF_LOG_WARNING, 0, SHARD_MSG_DICT_OP_FAILED, \
+ "Failed to set key: %s " \
+ "on path %s", \
+ GF_XATTR_SHARD_FILE_SIZE, (loc)->path); \
+ GF_FREE(__size_attr); \
+ goto label; \
+ } \
+ } while (0)
+
+#define SHARD_MD_READ_FOP_INIT_REQ_DICT(this, dict, gfid, local, label) \
+ do { \
+ int __ret = -1; \
+ \
+ __ret = dict_set_uint64(dict, GF_XATTR_SHARD_FILE_SIZE, 8 * 4); \
+ if (__ret) { \
+ local->op_ret = -1; \
+ local->op_errno = ENOMEM; \
+ gf_msg(this->name, GF_LOG_WARNING, 0, SHARD_MSG_DICT_OP_FAILED, \
+ "Failed to set dict value:" \
+ " key:%s for %s.", \
+ GF_XATTR_SHARD_FILE_SIZE, uuid_utoa(gfid)); \
+ goto label; \
+ } \
+ } while (0)
+
+#define SHARD_SET_ROOT_FS_ID(frame, local) \
+ do { \
+ if (!local->is_set_fsid) { \
+ local->uid = frame->root->uid; \
+ local->gid = frame->root->gid; \
+ frame->root->uid = 0; \
+ frame->root->gid = 0; \
+ local->is_set_fsid = _gf_true; \
+ } \
+ } while (0)
+
+#define SHARD_UNSET_ROOT_FS_ID(frame, local) \
+ do { \
+ if (local->is_set_fsid) { \
+ frame->root->uid = local->uid; \
+ frame->root->gid = local->gid; \
+ local->is_set_fsid = _gf_false; \
+ } \
+ } while (0)
+
+#define SHARD_TIME_UPDATE(ctx_sec, ctx_nsec, new_sec, new_nsec) \
+ do { \
+ if (ctx_sec == new_sec) \
+ ctx_nsec = new_nsec = max(new_nsec, ctx_nsec); \
+ else if (ctx_sec > new_sec) { \
+ new_sec = ctx_sec; \
+ new_nsec = ctx_nsec; \
+ } else { \
+ ctx_sec = new_sec; \
+ ctx_nsec = new_nsec; \
+ } \
+ } while (0)
typedef enum {
- SHARD_FIRST_LOOKUP_PENDING = 0,
- SHARD_FIRST_LOOKUP_IN_PROGRESS,
- SHARD_FIRST_LOOKUP_DONE,
+ SHARD_FIRST_LOOKUP_PENDING = 0,
+ SHARD_FIRST_LOOKUP_IN_PROGRESS,
+ SHARD_FIRST_LOOKUP_DONE,
} shard_first_lookup_state_t;
/* rm = "remove me" */
typedef struct shard_priv {
- uint64_t block_size;
- uuid_t dot_shard_gfid;
- uuid_t dot_shard_rm_gfid;
- inode_t *dot_shard_inode;
- inode_t *dot_shard_rm_inode;
- gf_lock_t lock;
- int inode_count;
- struct list_head ilist_head;
- uint32_t deletion_rate;
- shard_first_lookup_state_t first_lookup;
- uint64_t lru_limit;
+ uint64_t block_size;
+ uuid_t dot_shard_gfid;
+ uuid_t dot_shard_rm_gfid;
+ inode_t *dot_shard_inode;
+ inode_t *dot_shard_rm_inode;
+ gf_lock_t lock;
+ int inode_count;
+ struct list_head ilist_head;
+ uint32_t deletion_rate;
+ shard_first_lookup_state_t first_lookup;
+ uint64_t lru_limit;
} shard_priv_t;
typedef struct {
- loc_t loc;
- char *domain;
- struct gf_flock flock;
- gf_boolean_t acquired_lock;
+ loc_t loc;
+ char *domain;
+ struct gf_flock flock;
+ gf_boolean_t acquired_lock;
} shard_inodelk_t;
typedef struct {
- loc_t loc;
- char *domain;
- char *basename;
- entrylk_cmd cmd;
- entrylk_type type;
- gf_boolean_t acquired_lock;
+ loc_t loc;
+ char *domain;
+ char *basename;
+ entrylk_cmd cmd;
+ entrylk_type type;
+ gf_boolean_t acquired_lock;
} shard_entrylk_t;
-typedef int32_t (*shard_post_fop_handler_t) (call_frame_t *frame,
- xlator_t *this);
-typedef int32_t (*shard_post_resolve_fop_handler_t) (call_frame_t *frame,
- xlator_t *this);
-typedef int32_t (*shard_post_lookup_shards_fop_handler_t) (call_frame_t *frame,
- xlator_t *this);
+typedef int32_t (*shard_post_fop_handler_t)(call_frame_t *frame,
+ xlator_t *this);
+typedef int32_t (*shard_post_resolve_fop_handler_t)(call_frame_t *frame,
+ xlator_t *this);
+typedef int32_t (*shard_post_lookup_shards_fop_handler_t)(call_frame_t *frame,
+ xlator_t *this);
-typedef int32_t (*shard_post_mknod_fop_handler_t) (call_frame_t *frame,
- xlator_t *this);
+typedef int32_t (*shard_post_mknod_fop_handler_t)(call_frame_t *frame,
+ xlator_t *this);
-typedef int32_t (*shard_post_update_size_fop_handler_t) (call_frame_t *frame,
- xlator_t *this);
+typedef int32_t (*shard_post_update_size_fop_handler_t)(call_frame_t *frame,
+ xlator_t *this);
typedef struct shard_local {
- int op_ret;
- int op_errno;
- int first_block;
- int last_block;
- int num_blocks;
- int call_count;
- int eexist_count;
- int create_count;
- int xflag;
- int count;
- uint32_t flags;
- uint32_t uid;
- uint32_t gid;
- uint64_t block_size;
- uint64_t dst_block_size;
- int32_t datasync;
- off_t offset;
- size_t total_size;
- size_t written_size;
- size_t hole_size;
- size_t req_size;
- size_t readdir_size;
- int64_t delta_size;
- int delta_blocks;
- loc_t loc;
- loc_t dot_shard_loc;
- loc_t dot_shard_rm_loc;
- loc_t loc2;
- loc_t tmp_loc;
- fd_t *fd;
- dict_t *xattr_req;
- dict_t *xattr_rsp;
- inode_t **inode_list;
- glusterfs_fop_t fop;
- struct iatt prebuf;
- struct iatt postbuf;
- struct iatt preoldparent;
- struct iatt postoldparent;
- struct iatt prenewparent;
- struct iatt postnewparent;
- struct iovec *vector;
- struct iobref *iobref;
- struct iobuf *iobuf;
- gf_dirent_t entries_head;
- gf_boolean_t is_set_fsid;
- gf_boolean_t list_inited;
- shard_post_fop_handler_t handler;
- shard_post_lookup_shards_fop_handler_t pls_fop_handler;
- shard_post_resolve_fop_handler_t post_res_handler;
- shard_post_mknod_fop_handler_t post_mknod_handler;
- shard_post_update_size_fop_handler_t post_update_size_handler;
- shard_inodelk_t int_inodelk;
- shard_entrylk_t int_entrylk;
- inode_t *resolver_base_inode;
- gf_boolean_t first_lookup_done;
- syncbarrier_t barrier;
- gf_boolean_t lookup_shards_barriered;
- gf_boolean_t unlink_shards_barriered;
- gf_boolean_t resolve_not;
- loc_t newloc;
- call_frame_t *main_frame;
- call_frame_t *inodelk_frame;
- call_frame_t *entrylk_frame;
- uint32_t deletion_rate;
- gf_boolean_t cleanup_required;
- uuid_t base_gfid;
+ int op_ret;
+ int op_errno;
+ int first_block;
+ int last_block;
+ int num_blocks;
+ int call_count;
+ int eexist_count;
+ int create_count;
+ int xflag;
+ int count;
+ uint32_t flags;
+ uint32_t uid;
+ uint32_t gid;
+ uint64_t block_size;
+ uint64_t dst_block_size;
+ int32_t datasync;
+ off_t offset;
+ size_t total_size;
+ size_t written_size;
+ size_t hole_size;
+ size_t req_size;
+ size_t readdir_size;
+ int64_t delta_size;
+ int delta_blocks;
+ loc_t loc;
+ loc_t dot_shard_loc;
+ loc_t dot_shard_rm_loc;
+ loc_t loc2;
+ loc_t tmp_loc;
+ fd_t *fd;
+ dict_t *xattr_req;
+ dict_t *xattr_rsp;
+ inode_t **inode_list;
+ glusterfs_fop_t fop;
+ struct iatt prebuf;
+ struct iatt postbuf;
+ struct iatt preoldparent;
+ struct iatt postoldparent;
+ struct iatt prenewparent;
+ struct iatt postnewparent;
+ struct iovec *vector;
+ struct iobref *iobref;
+ struct iobuf *iobuf;
+ gf_dirent_t entries_head;
+ gf_boolean_t is_set_fsid;
+ gf_boolean_t list_inited;
+ shard_post_fop_handler_t handler;
+ shard_post_lookup_shards_fop_handler_t pls_fop_handler;
+ shard_post_resolve_fop_handler_t post_res_handler;
+ shard_post_mknod_fop_handler_t post_mknod_handler;
+ shard_post_update_size_fop_handler_t post_update_size_handler;
+ shard_inodelk_t int_inodelk;
+ shard_entrylk_t int_entrylk;
+ inode_t *resolver_base_inode;
+ gf_boolean_t first_lookup_done;
+ syncbarrier_t barrier;
+ gf_boolean_t lookup_shards_barriered;
+ gf_boolean_t unlink_shards_barriered;
+ gf_boolean_t resolve_not;
+ loc_t newloc;
+ call_frame_t *main_frame;
+ call_frame_t *inodelk_frame;
+ call_frame_t *entrylk_frame;
+ uint32_t deletion_rate;
+ gf_boolean_t cleanup_required;
+ uuid_t base_gfid;
} shard_local_t;
typedef struct shard_inode_ctx {
- uint64_t block_size; /* The block size with which this inode is
- sharded */
- struct iatt stat;
- gf_boolean_t refresh;
- /* The following members of inode ctx will be applicable only to the
- * individual shards' ctx and never the base file ctx.
- */
- struct list_head ilist;
- uuid_t base_gfid;
- int block_num;
- gf_boolean_t refreshed;
- struct list_head to_fsync_list;
- int fsync_needed;
- inode_t *inode;
- int fsync_count;
- inode_t *base_inode;
+ uint64_t block_size; /* The block size with which this inode is
+ sharded */
+ struct iatt stat;
+ gf_boolean_t refresh;
+ /* The following members of inode ctx will be applicable only to the
+ * individual shards' ctx and never the base file ctx.
+ */
+ struct list_head ilist;
+ uuid_t base_gfid;
+ int block_num;
+ gf_boolean_t refreshed;
+ struct list_head to_fsync_list;
+ int fsync_needed;
+ inode_t *inode;
+ int fsync_count;
+ inode_t *base_inode;
} shard_inode_ctx_t;
typedef enum {
- SHARD_INTERNAL_DIR_DOT_SHARD = 1,
- SHARD_INTERNAL_DIR_DOT_SHARD_REMOVE_ME,
+ SHARD_INTERNAL_DIR_DOT_SHARD = 1,
+ SHARD_INTERNAL_DIR_DOT_SHARD_REMOVE_ME,
} shard_internal_dir_type_t;
#endif /* __SHARD_H__ */
diff --git a/xlators/features/snapview-client/src/snapview-client-mem-types.h b/xlators/features/snapview-client/src/snapview-client-mem-types.h
index 1a0158d950e..aac0d571c41 100644
--- a/xlators/features/snapview-client/src/snapview-client-mem-types.h
+++ b/xlators/features/snapview-client/src/snapview-client-mem-types.h
@@ -14,11 +14,11 @@
#include "mem-types.h"
enum svc_mem_types {
- gf_svc_mt_svc_private_t = gf_common_mt_end + 1,
- gf_svc_mt_svc_local_t,
- gf_svc_mt_svc_inode_t,
- gf_svc_mt_svc_fd_t,
- gf_svc_mt_end
+ gf_svc_mt_svc_private_t = gf_common_mt_end + 1,
+ gf_svc_mt_svc_local_t,
+ gf_svc_mt_svc_inode_t,
+ gf_svc_mt_svc_fd_t,
+ gf_svc_mt_end
};
#endif
diff --git a/xlators/features/snapview-client/src/snapview-client.h b/xlators/features/snapview-client/src/snapview-client.h
index 169974af532..ccce7bebca6 100644
--- a/xlators/features/snapview-client/src/snapview-client.h
+++ b/xlators/features/snapview-client/src/snapview-client.h
@@ -1,11 +1,11 @@
- /*
- Copyright (c) 2014 Red Hat, Inc. <http://www.redhat.com>
- This file is part of GlusterFS.
+/*
+ Copyright (c) 2014 Red Hat, Inc. <http://www.redhat.com>
+ This file is part of GlusterFS.
- This file is licensed to you under your choice of the GNU Lesser
- General Public License, version 3 or any later version (LGPLv3 or
- later), or the GNU General Public License, version 2 (GPLv2), in all
- cases as published by the Free Software Foundation.
+ This file is licensed to you under your choice of the GNU Lesser
+ General Public License, version 3 or any later version (LGPLv3 or
+ later), or the GNU General Public License, version 2 (GPLv2), in all
+ cases as published by the Free Software Foundation.
*/
#ifndef __SNAP_VIEW_CLIENT_H__
#define __SNAP_VIEW_CLIENT_H__
@@ -18,85 +18,82 @@
#include "snapview-client-mem-types.h"
struct __svc_local {
- loc_t loc;
- xlator_t *subvolume;
- fd_t *fd;
- void *cookie;
- dict_t *xdata;
- uint16_t revalidate;
+ loc_t loc;
+ xlator_t *subvolume;
+ fd_t *fd;
+ void *cookie;
+ dict_t *xdata;
+ uint16_t revalidate;
};
typedef struct __svc_local svc_local_t;
-#define SVC_STACK_UNWIND(fop, frame, params ...) do { \
- svc_local_t *__local = NULL; \
- if (frame) { \
- __local = frame->local; \
- frame->local = NULL; \
- } \
- STACK_UNWIND_STRICT (fop, frame, params); \
- svc_local_free (__local); \
- } while (0)
+#define SVC_STACK_UNWIND(fop, frame, params...) \
+ do { \
+ svc_local_t *__local = NULL; \
+ if (frame) { \
+ __local = frame->local; \
+ frame->local = NULL; \
+ } \
+ STACK_UNWIND_STRICT(fop, frame, params); \
+ svc_local_free(__local); \
+ } while (0)
-#define SVC_ENTRY_POINT_SET(this, xdata, op_ret, op_errno, new_xdata, \
- priv, ret, label) \
- do { \
- if (!xdata) { \
- xdata = new_xdata = dict_new (); \
- if (!new_xdata) { \
- gf_log (this->name, GF_LOG_ERROR, \
- "failed to allocate new dict"); \
- op_ret = -1; \
- op_errno = ENOMEM; \
- goto label; \
- } \
- } \
- ret = dict_set_str (xdata, "entry-point", "true"); \
- if (ret) { \
- gf_log (this->name, GF_LOG_ERROR, \
- "failed to set dict"); \
- op_ret = -1; \
- op_errno = ENOMEM; \
- goto label; \
- } \
- } while (0);
+#define SVC_ENTRY_POINT_SET(this, xdata, op_ret, op_errno, new_xdata, priv, \
+ ret, label) \
+ do { \
+ if (!xdata) { \
+ xdata = new_xdata = dict_new(); \
+ if (!new_xdata) { \
+ gf_log(this->name, GF_LOG_ERROR, \
+ "failed to allocate new dict"); \
+ op_ret = -1; \
+ op_errno = ENOMEM; \
+ goto label; \
+ } \
+ } \
+ ret = dict_set_str(xdata, "entry-point", "true"); \
+ if (ret) { \
+ gf_log(this->name, GF_LOG_ERROR, "failed to set dict"); \
+ op_ret = -1; \
+ op_errno = ENOMEM; \
+ goto label; \
+ } \
+ } while (0);
-#define SVC_GET_SUBVOL_FROM_CTX(this, op_ret, op_errno, inode_type, ret, \
- inode, subvolume, label) \
- do { \
- ret = svc_inode_ctx_get (this, inode, &inode_type); \
- if (ret < 0) { \
- gf_log (this->name, GF_LOG_ERROR, \
- "inode context not found for gfid %s", \
- uuid_utoa (inode->gfid)); \
- op_ret = -1; \
- op_errno = EINVAL; \
- goto label; \
- } \
- \
- subvolume = svc_get_subvolume (this, inode_type); \
- } while (0);
+#define SVC_GET_SUBVOL_FROM_CTX(this, op_ret, op_errno, inode_type, ret, \
+ inode, subvolume, label) \
+ do { \
+ ret = svc_inode_ctx_get(this, inode, &inode_type); \
+ if (ret < 0) { \
+ gf_log(this->name, GF_LOG_ERROR, \
+ "inode context not found for gfid %s", \
+ uuid_utoa(inode->gfid)); \
+ op_ret = -1; \
+ op_errno = EINVAL; \
+ goto label; \
+ } \
+ \
+ subvolume = svc_get_subvolume(this, inode_type); \
+ } while (0);
struct svc_private {
- char *path;
- char *special_dir; /* needed for samba */
- gf_boolean_t show_entry_point;
+ char *path;
+ char *special_dir; /* needed for samba */
+ gf_boolean_t show_entry_point;
};
typedef struct svc_private svc_private_t;
struct svc_fd {
- off_t last_offset;
- gf_boolean_t entry_point_handled;
- gf_boolean_t special_dir;
+ off_t last_offset;
+ gf_boolean_t entry_point_handled;
+ gf_boolean_t special_dir;
};
typedef struct svc_fd svc_fd_t;
-typedef enum {
- NORMAL_INODE = 1,
- VIRTUAL_INODE
-} inode_type_t;
+typedef enum { NORMAL_INODE = 1, VIRTUAL_INODE } inode_type_t;
int
-gf_svc_special_dir_revalidate_lookup (call_frame_t *frame, xlator_t *this,
- dict_t *xdata);
+gf_svc_special_dir_revalidate_lookup(call_frame_t *frame, xlator_t *this,
+ dict_t *xdata);
#endif /* __SNAP_VIEW_CLIENT_H__ */
diff --git a/xlators/features/snapview-server/src/snapview-server-mem-types.h b/xlators/features/snapview-server/src/snapview-server-mem-types.h
index a8035165000..504c7969bdc 100644
--- a/xlators/features/snapview-server/src/snapview-server-mem-types.h
+++ b/xlators/features/snapview-server/src/snapview-server-mem-types.h
@@ -14,13 +14,12 @@
#include "mem-types.h"
enum snapview_mem_types {
- gf_svs_mt_priv_t = gf_common_mt_end + 1,
- gf_svs_mt_svs_inode_t,
- gf_svs_mt_dirents_t,
- gf_svs_mt_svs_fd_t,
- gf_svs_mt_snaplist_t,
- gf_svs_mt_end
+ gf_svs_mt_priv_t = gf_common_mt_end + 1,
+ gf_svs_mt_svs_inode_t,
+ gf_svs_mt_dirents_t,
+ gf_svs_mt_svs_fd_t,
+ gf_svs_mt_snaplist_t,
+ gf_svs_mt_end
};
#endif
-
diff --git a/xlators/features/snapview-server/src/snapview-server.h b/xlators/features/snapview-server/src/snapview-server.h
index d024a77011b..e07d3bcad0c 100644
--- a/xlators/features/snapview-server/src/snapview-server.h
+++ b/xlators/features/snapview-server/src/snapview-server.h
@@ -34,219 +34,216 @@
#include "protocol-common.h"
#include "xdr-generic.h"
-
#define DEFAULT_SVD_LOG_FILE_DIRECTORY DATADIR "/log/glusterfs"
-#define SNAP_VIEW_MAX_GLFS_T 256
-#define SNAP_VIEW_MAX_GLFS_FDS 1024
-#define SNAP_VIEW_MAX_GLFS_OBJ_HANDLES 1024
-
-#define SVS_STACK_DESTROY(_frame) \
- do { \
- ((call_frame_t *)_frame)->local = NULL; \
- STACK_DESTROY (((call_frame_t *)_frame)->root); \
- } while (0)
-
-#define SVS_CHECK_VALID_SNAPSHOT_HANDLE(fs, this) \
- do { \
- svs_private_t *_private = NULL; \
- _private = this->private; \
- int i = 0; \
- gf_boolean_t found = _gf_false; \
- glfs_t *tmp_fs = NULL; \
- LOCK (&_private->snaplist_lock); \
- { \
- for (i = 0; i < _private->num_snaps; i++) { \
- tmp_fs = _private->dirents[i].fs; \
- gf_log (this->name, GF_LOG_DEBUG, \
- "dirent->fs: %p", tmp_fs); \
- if (tmp_fs && fs && (tmp_fs == fs)) { \
- found = _gf_true; \
- break; \
- } \
- } \
- } \
- UNLOCK (&_private->snaplist_lock); \
- \
- if (!found) { \
- gf_log (this->name, GF_LOG_WARNING, "failed to" \
- " find the fs instance %p", fs); \
- fs = NULL; \
- } \
- } while (0)
-
-#define SVS_GET_INODE_CTX_INFO(inode_ctx, fs, object, this, loc, ret, \
- op_errno, label) \
- do { \
- fs = inode_ctx->fs; \
- object = inode_ctx->object; \
- SVS_CHECK_VALID_SNAPSHOT_HANDLE (fs, this); \
- if (!fs) \
- object = NULL; \
- \
- if (!fs || !object) { \
- int32_t tmp = -1; \
- char tmp_uuid[64]; \
- \
- tmp = svs_get_handle (this, loc, inode_ctx, \
- &op_errno); \
- if (tmp) { \
- gf_log (this->name, GF_LOG_ERROR, \
- "failed to get the handle for %s " \
- "(gfid: %s)", loc->path, \
- uuid_utoa_r (loc->inode->gfid, \
- tmp_uuid)); \
- ret = -1; \
- goto label; \
- } \
- \
- fs = inode_ctx->fs; \
- object = inode_ctx->object; \
- } \
- } while(0);
-
-#define SVS_STRDUP(dst, src) \
- do { \
- if (dst && strcmp (src, dst)) { \
- GF_FREE (dst); \
- dst = NULL; \
- } \
- \
- if (!dst) \
- dst = gf_strdup (src); \
- } while (0)
+#define SNAP_VIEW_MAX_GLFS_T 256
+#define SNAP_VIEW_MAX_GLFS_FDS 1024
+#define SNAP_VIEW_MAX_GLFS_OBJ_HANDLES 1024
+
+#define SVS_STACK_DESTROY(_frame) \
+ do { \
+ ((call_frame_t *)_frame)->local = NULL; \
+ STACK_DESTROY(((call_frame_t *)_frame)->root); \
+ } while (0)
+
+#define SVS_CHECK_VALID_SNAPSHOT_HANDLE(fs, this) \
+ do { \
+ svs_private_t *_private = NULL; \
+ _private = this->private; \
+ int i = 0; \
+ gf_boolean_t found = _gf_false; \
+ glfs_t *tmp_fs = NULL; \
+ LOCK(&_private->snaplist_lock); \
+ { \
+ for (i = 0; i < _private->num_snaps; i++) { \
+ tmp_fs = _private->dirents[i].fs; \
+ gf_log(this->name, GF_LOG_DEBUG, "dirent->fs: %p", tmp_fs); \
+ if (tmp_fs && fs && (tmp_fs == fs)) { \
+ found = _gf_true; \
+ break; \
+ } \
+ } \
+ } \
+ UNLOCK(&_private->snaplist_lock); \
+ \
+ if (!found) { \
+ gf_log(this->name, GF_LOG_WARNING, \
+ "failed to" \
+ " find the fs instance %p", \
+ fs); \
+ fs = NULL; \
+ } \
+ } while (0)
+
+#define SVS_GET_INODE_CTX_INFO(inode_ctx, fs, object, this, loc, ret, \
+ op_errno, label) \
+ do { \
+ fs = inode_ctx->fs; \
+ object = inode_ctx->object; \
+ SVS_CHECK_VALID_SNAPSHOT_HANDLE(fs, this); \
+ if (!fs) \
+ object = NULL; \
+ \
+ if (!fs || !object) { \
+ int32_t tmp = -1; \
+ char tmp_uuid[64]; \
+ \
+ tmp = svs_get_handle(this, loc, inode_ctx, &op_errno); \
+ if (tmp) { \
+ gf_log(this->name, GF_LOG_ERROR, \
+ "failed to get the handle for %s " \
+ "(gfid: %s)", \
+ loc->path, uuid_utoa_r(loc->inode->gfid, tmp_uuid)); \
+ ret = -1; \
+ goto label; \
+ } \
+ \
+ fs = inode_ctx->fs; \
+ object = inode_ctx->object; \
+ } \
+ } while (0);
+
+#define SVS_STRDUP(dst, src) \
+ do { \
+ if (dst && strcmp(src, dst)) { \
+ GF_FREE(dst); \
+ dst = NULL; \
+ } \
+ \
+ if (!dst) \
+ dst = gf_strdup(src); \
+ } while (0)
int
-svs_mgmt_submit_request (void *req, call_frame_t *frame,
- glusterfs_ctx_t *ctx,
- rpc_clnt_prog_t *prog, int procnum,
- fop_cbk_fn_t cbkfn, xdrproc_t xdrproc);
+svs_mgmt_submit_request(void *req, call_frame_t *frame, glusterfs_ctx_t *ctx,
+ rpc_clnt_prog_t *prog, int procnum, fop_cbk_fn_t cbkfn,
+ xdrproc_t xdrproc);
int
-svs_get_snapshot_list (xlator_t *this);
+svs_get_snapshot_list(xlator_t *this);
int
-mgmt_get_snapinfo_cbk (struct rpc_req *req, struct iovec *iov,
- int count, void *myframe);
+mgmt_get_snapinfo_cbk(struct rpc_req *req, struct iovec *iov, int count,
+ void *myframe);
typedef enum {
- SNAP_VIEW_ENTRY_POINT_INODE = 0,
- SNAP_VIEW_SNAPSHOT_INODE,
- SNAP_VIEW_VIRTUAL_INODE
+ SNAP_VIEW_ENTRY_POINT_INODE = 0,
+ SNAP_VIEW_SNAPSHOT_INODE,
+ SNAP_VIEW_VIRTUAL_INODE
} inode_type_t;
struct svs_inode {
- glfs_t *fs;
- glfs_object_t *object;
- inode_type_t type;
-
- /* used only for entry point directory where gfid of the directory
- from where the entry point was entered is saved.
- */
- uuid_t pargfid;
-
- /* This is used to generate gfid for all sub files/dirs under this
- * snapshot
- */
- char *snapname;
- struct iatt buf;
+ glfs_t *fs;
+ glfs_object_t *object;
+ inode_type_t type;
+
+ /* used only for entry point directory where gfid of the directory
+ from where the entry point was entered is saved.
+ */
+ uuid_t pargfid;
+
+ /* This is used to generate gfid for all sub files/dirs under this
+ * snapshot
+ */
+ char *snapname;
+ struct iatt buf;
};
typedef struct svs_inode svs_inode_t;
struct svs_fd {
- glfs_fd_t *fd;
+ glfs_fd_t *fd;
};
typedef struct svs_fd svs_fd_t;
struct snap_dirent {
- char name[NAME_MAX];
- char uuid[UUID_CANONICAL_FORM_LEN + 1];
- char snap_volname[NAME_MAX];
- glfs_t *fs;
+ char name[NAME_MAX];
+ char uuid[UUID_CANONICAL_FORM_LEN + 1];
+ char snap_volname[NAME_MAX];
+ glfs_t *fs;
};
typedef struct snap_dirent snap_dirent_t;
struct svs_private {
- snap_dirent_t *dirents;
- int num_snaps;
- char *volname;
- struct list_head snaplist;
- gf_lock_t snaplist_lock;
- struct rpc_clnt *rpc;
+ snap_dirent_t *dirents;
+ int num_snaps;
+ char *volname;
+ struct list_head snaplist;
+ gf_lock_t snaplist_lock;
+ struct rpc_clnt *rpc;
};
typedef struct svs_private svs_private_t;
int
-__svs_inode_ctx_set (xlator_t *this, inode_t *inode, svs_inode_t *svs_inode);
+__svs_inode_ctx_set(xlator_t *this, inode_t *inode, svs_inode_t *svs_inode);
svs_inode_t *
-__svs_inode_ctx_get (xlator_t *this, inode_t *inode);
+__svs_inode_ctx_get(xlator_t *this, inode_t *inode);
svs_inode_t *
-svs_inode_ctx_get (xlator_t *this, inode_t *inode);
+svs_inode_ctx_get(xlator_t *this, inode_t *inode);
int32_t
-svs_inode_ctx_set (xlator_t *this, inode_t *inode, svs_inode_t *svs_inode);
+svs_inode_ctx_set(xlator_t *this, inode_t *inode, svs_inode_t *svs_inode);
svs_inode_t *
-svs_inode_ctx_get_or_new (xlator_t *this, inode_t *inode);
+svs_inode_ctx_get_or_new(xlator_t *this, inode_t *inode);
int
-__svs_fd_ctx_set (xlator_t *this, fd_t *fd, svs_fd_t *svs_fd);
+__svs_fd_ctx_set(xlator_t *this, fd_t *fd, svs_fd_t *svs_fd);
svs_fd_t *
-__svs_fd_ctx_get (xlator_t *this, fd_t *fd);
+__svs_fd_ctx_get(xlator_t *this, fd_t *fd);
svs_fd_t *
-svs_fd_ctx_get (xlator_t *this, fd_t *fd);
+svs_fd_ctx_get(xlator_t *this, fd_t *fd);
int32_t
-svs_fd_ctx_set (xlator_t *this, fd_t *fd, svs_fd_t *svs_fd);
+svs_fd_ctx_set(xlator_t *this, fd_t *fd, svs_fd_t *svs_fd);
svs_fd_t *
-__svs_fd_ctx_get_or_new (xlator_t *this, fd_t *fd);
+__svs_fd_ctx_get_or_new(xlator_t *this, fd_t *fd);
svs_fd_t *
-svs_fd_ctx_get_or_new (xlator_t *this, fd_t *fd);
+svs_fd_ctx_get_or_new(xlator_t *this, fd_t *fd);
int
-svs_uuid_generate (xlator_t *this, uuid_t gfid, char *snapname,
- uuid_t origin_gfid);
+svs_uuid_generate(xlator_t *this, uuid_t gfid, char *snapname,
+ uuid_t origin_gfid);
void
-svs_fill_ino_from_gfid (struct iatt *buf);
+svs_fill_ino_from_gfid(struct iatt *buf);
void
-svs_iatt_fill (uuid_t gfid, struct iatt *buf);
+svs_iatt_fill(uuid_t gfid, struct iatt *buf);
snap_dirent_t *
-svs_get_latest_snap_entry (xlator_t *this);
+svs_get_latest_snap_entry(xlator_t *this);
glfs_t *
-svs_get_latest_snapshot (xlator_t *this);
+svs_get_latest_snapshot(xlator_t *this);
glfs_t *
-svs_initialise_snapshot_volume (xlator_t *this, const char *name,
- int32_t *op_errno);
+svs_initialise_snapshot_volume(xlator_t *this, const char *name,
+ int32_t *op_errno);
glfs_t *
-__svs_initialise_snapshot_volume (xlator_t *this, const char *name,
- int32_t *op_errno);
+__svs_initialise_snapshot_volume(xlator_t *this, const char *name,
+ int32_t *op_errno);
snap_dirent_t *
-__svs_get_snap_dirent (xlator_t *this, const char *name);
+__svs_get_snap_dirent(xlator_t *this, const char *name);
int
-svs_mgmt_init (xlator_t *this);
+svs_mgmt_init(xlator_t *this);
int32_t
-svs_get_handle (xlator_t *this, loc_t *loc, svs_inode_t *inode_ctx,
- int32_t *op_errno);
+svs_get_handle(xlator_t *this, loc_t *loc, svs_inode_t *inode_ctx,
+ int32_t *op_errno);
glfs_t *
-svs_inode_glfs_mapping (xlator_t *this, inode_t *inode);
+svs_inode_glfs_mapping(xlator_t *this, inode_t *inode);
glfs_t *
-svs_inode_ctx_glfs_mapping (xlator_t *this, svs_inode_t *inode_ctx);
+svs_inode_ctx_glfs_mapping(xlator_t *this, svs_inode_t *inode_ctx);
#endif /* __SNAP_VIEW_H__ */
diff --git a/xlators/features/thin-arbiter/src/thin-arbiter-mem-types.h b/xlators/features/thin-arbiter/src/thin-arbiter-mem-types.h
index d7288192d32..79b5ce0eee3 100644
--- a/xlators/features/thin-arbiter/src/thin-arbiter-mem-types.h
+++ b/xlators/features/thin-arbiter/src/thin-arbiter-mem-types.h
@@ -12,8 +12,8 @@
#include "mem-types.h"
typedef enum gf_ta_mem_types_ {
- gf_ta_mt_local_t = gf_common_mt_end + 1,
- gf_ta_mt_char,
- gf_ta_mt_end
+ gf_ta_mt_local_t = gf_common_mt_end + 1,
+ gf_ta_mt_char,
+ gf_ta_mt_end
} gf_ta_mem_types_t;
#endif
diff --git a/xlators/features/thin-arbiter/src/thin-arbiter-messages.h b/xlators/features/thin-arbiter/src/thin-arbiter-messages.h
index 524e4d3aef8..f49b3eedadf 100644
--- a/xlators/features/thin-arbiter/src/thin-arbiter-messages.h
+++ b/xlators/features/thin-arbiter/src/thin-arbiter-messages.h
@@ -23,8 +23,6 @@
* glfs-message-id.h.
*/
-GLFS_MSGID(TA,
- TA_MSG_INVALID_FOP
-);
+GLFS_MSGID(TA, TA_MSG_INVALID_FOP);
#endif /* !_TA_MESSAGES_H_ */
diff --git a/xlators/features/thin-arbiter/src/thin-arbiter.h b/xlators/features/thin-arbiter/src/thin-arbiter.h
index 996f4441fdd..af3d4b1af92 100644
--- a/xlators/features/thin-arbiter/src/thin-arbiter.h
+++ b/xlators/features/thin-arbiter/src/thin-arbiter.h
@@ -21,43 +21,39 @@
#define THIN_ARBITER_SOURCE_XATTR "trusted.ta.source"
#define THIN_ARBITER_SOURCE_SIZE 2
-#define TA_FAILED_FOP(fop, frame, op_errno) \
- do { \
- default_##fop##_failure_cbk(frame, op_errno); \
+#define TA_FAILED_FOP(fop, frame, op_errno) \
+ do { \
+ default_##fop##_failure_cbk(frame, op_errno); \
} while (0)
-#define TA_STACK_UNWIND(fop, frame, op_ret, op_errno, params ...)\
- do { \
- ta_fop_t *__local = NULL; \
- int32_t __op_ret = 0; \
- int32_t __op_errno = 0; \
- \
- __local = frame->local; \
- __op_ret = op_ret; \
- __op_errno = op_errno; \
- if (__local) { \
- ta_release_fop (__local); \
- frame->local = NULL; \
- } \
- STACK_UNWIND_STRICT (fop, frame, __op_ret, \
- __op_errno, params); \
- \
+#define TA_STACK_UNWIND(fop, frame, op_ret, op_errno, params...) \
+ do { \
+ ta_fop_t *__local = NULL; \
+ int32_t __op_ret = 0; \
+ int32_t __op_errno = 0; \
+ \
+ __local = frame->local; \
+ __op_ret = op_ret; \
+ __op_errno = op_errno; \
+ if (__local) { \
+ ta_release_fop(__local); \
+ frame->local = NULL; \
+ } \
+ STACK_UNWIND_STRICT(fop, frame, __op_ret, __op_errno, params); \
+ \
} while (0)
struct _ta_fop;
typedef struct _ta_fop ta_fop_t;
struct _ta_fop {
- gf_xattrop_flags_t xattrop_flags;
- loc_t loc;
- fd_t *fd;
- dict_t *dict;
- dict_t *brick_xattr;
- int32_t on_disk[2];
- int32_t idx;
+ gf_xattrop_flags_t xattrop_flags;
+ loc_t loc;
+ fd_t *fd;
+ dict_t *dict;
+ dict_t *brick_xattr;
+ int32_t on_disk[2];
+ int32_t idx;
};
-
-
-
#endif /* _THIN_ARBITER_H */
diff --git a/xlators/features/trash/src/trash-mem-types.h b/xlators/features/trash/src/trash-mem-types.h
index b7cad3ce3a9..133f2edf99b 100644
--- a/xlators/features/trash/src/trash-mem-types.h
+++ b/xlators/features/trash/src/trash-mem-types.h
@@ -13,11 +13,10 @@
#include "mem-types.h"
enum gf_trash_mem_types_ {
- gf_trash_mt_trash_private_t = gf_common_mt_end + 1,
- gf_trash_mt_char,
- gf_trash_mt_uuid,
- gf_trash_mt_trash_elim_path,
- gf_trash_mt_end
+ gf_trash_mt_trash_private_t = gf_common_mt_end + 1,
+ gf_trash_mt_char,
+ gf_trash_mt_uuid,
+ gf_trash_mt_trash_elim_path,
+ gf_trash_mt_end
};
#endif
-
diff --git a/xlators/features/trash/src/trash.h b/xlators/features/trash/src/trash.h
index 7dd83afc09a..675f9f97350 100644
--- a/xlators/features/trash/src/trash.h
+++ b/xlators/features/trash/src/trash.h
@@ -21,7 +21,7 @@
#include <libgen.h>
#ifndef GF_BLOCK_READV_SIZE
-#define GF_BLOCK_READV_SIZE (128 * GF_UNIT_KB)
+#define GF_BLOCK_READV_SIZE (128 * GF_UNIT_KB)
#endif
#ifndef GF_DEFAULT_MAX_FILE_SIZE
@@ -29,66 +29,69 @@
#endif
struct trash_struct {
- fd_t *fd; /* for the fd of existing file */
- fd_t *newfd; /* for the newly created file */
- loc_t loc; /* to store the location of the existing file */
- loc_t newloc; /* to store the location for the new file */
- size_t fsize; /* for keeping the size of existing file */
- off_t cur_offset; /* current offset for read and write ops */
- off_t fop_offset; /* original offset received with the fop */
- pid_t pid;
- char origpath[PATH_MAX];
- char newpath[PATH_MAX];
- int32_t loop_count;
- gf_boolean_t is_set_pid;
- struct iatt preparent;
- struct iatt postparent;
- gf_boolean_t ctr_link_count_req;
+ fd_t *fd; /* for the fd of existing file */
+ fd_t *newfd; /* for the newly created file */
+ loc_t loc; /* to store the location of the existing file */
+ loc_t newloc; /* to store the location for the new file */
+ size_t fsize; /* for keeping the size of existing file */
+ off_t cur_offset; /* current offset for read and write ops */
+ off_t fop_offset; /* original offset received with the fop */
+ pid_t pid;
+ char origpath[PATH_MAX];
+ char newpath[PATH_MAX];
+ int32_t loop_count;
+ gf_boolean_t is_set_pid;
+ struct iatt preparent;
+ struct iatt postparent;
+ gf_boolean_t ctr_link_count_req;
};
typedef struct trash_struct trash_local_t;
struct _trash_elim_path {
- struct _trash_elim_path *next;
- char *path;
+ struct _trash_elim_path *next;
+ char *path;
};
typedef struct _trash_elim_path trash_elim_path;
struct trash_priv {
- char *oldtrash_dir;
- char *newtrash_dir;
- char *brick_path;
- trash_elim_path *eliminate;
- size_t max_trash_file_size;
- gf_boolean_t state;
- gf_boolean_t internal;
- inode_t *trash_inode;
- inode_table_t *trash_itable;
+ char *oldtrash_dir;
+ char *newtrash_dir;
+ char *brick_path;
+ trash_elim_path *eliminate;
+ size_t max_trash_file_size;
+ gf_boolean_t state;
+ gf_boolean_t internal;
+ inode_t *trash_inode;
+ inode_table_t *trash_itable;
};
typedef struct trash_priv trash_private_t;
-#define TRASH_SET_PID(frame, local) do { \
- GF_ASSERT (!local->is_set_pid); \
- if (!local->is_set_pid) { \
- local->pid = frame->root->pid; \
- frame->root->pid = GF_SERVER_PID_TRASH; \
- local->is_set_pid = _gf_true; \
- } \
-} while (0)
+#define TRASH_SET_PID(frame, local) \
+ do { \
+ GF_ASSERT(!local->is_set_pid); \
+ if (!local->is_set_pid) { \
+ local->pid = frame->root->pid; \
+ frame->root->pid = GF_SERVER_PID_TRASH; \
+ local->is_set_pid = _gf_true; \
+ } \
+ } while (0)
-#define TRASH_UNSET_PID(frame, local) do { \
- GF_ASSERT (local->is_set_pid); \
- if (local->is_set_pid) { \
- frame->root->pid = local->pid; \
- local->is_set_pid = _gf_false; \
- } \
-} while (0)
+#define TRASH_UNSET_PID(frame, local) \
+ do { \
+ GF_ASSERT(local->is_set_pid); \
+ if (local->is_set_pid) { \
+ frame->root->pid = local->pid; \
+ local->is_set_pid = _gf_false; \
+ } \
+ } while (0)
-#define TRASH_STACK_UNWIND(op, frame, params ...) do { \
- trash_local_t *__local = NULL; \
- __local = frame->local; \
- frame->local = NULL; \
- STACK_UNWIND_STRICT (op, frame, params); \
- trash_local_wipe (__local); \
- } while (0)
+#define TRASH_STACK_UNWIND(op, frame, params...) \
+ do { \
+ trash_local_t *__local = NULL; \
+ __local = frame->local; \
+ frame->local = NULL; \
+ STACK_UNWIND_STRICT(op, frame, params); \
+ trash_local_wipe(__local); \
+ } while (0)
#endif /* __TRASH_H__ */
diff --git a/xlators/features/upcall/src/upcall-cache-invalidation.h b/xlators/features/upcall/src/upcall-cache-invalidation.h
index 62b458fa295..e509a89acd5 100644
--- a/xlators/features/upcall/src/upcall-cache-invalidation.h
+++ b/xlators/features/upcall/src/upcall-cache-invalidation.h
@@ -16,7 +16,9 @@
#define CACHE_INVALIDATION_TIMEOUT "60"
/* xlator options */
-gf_boolean_t is_cache_invalidation_enabled(xlator_t *this);
-int32_t get_cache_invalidation_timeout(xlator_t *this);
+gf_boolean_t
+is_cache_invalidation_enabled(xlator_t *this);
+int32_t
+get_cache_invalidation_timeout(xlator_t *this);
#endif /* __UPCALL_CACHE_INVALIDATION_H__ */
diff --git a/xlators/features/upcall/src/upcall-mem-types.h b/xlators/features/upcall/src/upcall-mem-types.h
index 55793ec65ca..079677ff79c 100644
--- a/xlators/features/upcall/src/upcall-mem-types.h
+++ b/xlators/features/upcall/src/upcall-mem-types.h
@@ -14,11 +14,10 @@
#include "mem-types.h"
enum gf_upcall_mem_types_ {
- gf_upcall_mt_conf_t = gf_common_mt_end + 1,
- gf_upcall_mt_private_t,
- gf_upcall_mt_upcall_inode_ctx_t,
- gf_upcall_mt_upcall_client_entry_t,
- gf_upcall_mt_end
+ gf_upcall_mt_conf_t = gf_common_mt_end + 1,
+ gf_upcall_mt_private_t,
+ gf_upcall_mt_upcall_inode_ctx_t,
+ gf_upcall_mt_upcall_client_entry_t,
+ gf_upcall_mt_end
};
#endif
-
diff --git a/xlators/features/upcall/src/upcall-messages.h b/xlators/features/upcall/src/upcall-messages.h
index b60a3ed7371..db5cac1e07d 100644
--- a/xlators/features/upcall/src/upcall-messages.h
+++ b/xlators/features/upcall/src/upcall-messages.h
@@ -23,10 +23,7 @@
* glfs-message-id.h.
*/
-GLFS_MSGID(UPCALL,
- UPCALL_MSG_NO_MEMORY,
- UPCALL_MSG_INTERNAL_ERROR,
- UPCALL_MSG_NOTIFY_FAILED
-);
+GLFS_MSGID(UPCALL, UPCALL_MSG_NO_MEMORY, UPCALL_MSG_INTERNAL_ERROR,
+ UPCALL_MSG_NOTIFY_FAILED);
#endif /* !_UPCALL_MESSAGES_H_ */
diff --git a/xlators/features/upcall/src/upcall.h b/xlators/features/upcall/src/upcall.h
index 3e0d96cd001..3797e62aac3 100644
--- a/xlators/features/upcall/src/upcall.h
+++ b/xlators/features/upcall/src/upcall.h
@@ -17,123 +17,143 @@
#include "upcall-cache-invalidation.h"
#include "upcall-utils.h"
-#define EXIT_IF_UPCALL_OFF(this, label) do { \
- if (!is_upcall_enabled(this)) \
- goto label; \
-} while (0)
-
-#define UPCALL_STACK_UNWIND(fop, frame, params ...) do { \
- upcall_local_t *__local = NULL; \
- xlator_t *__xl = NULL; \
- if (frame) { \
- __xl = frame->this; \
- __local = frame->local; \
- frame->local = NULL; \
- } \
- STACK_UNWIND_STRICT (fop, frame, params); \
- upcall_local_wipe (__xl, __local); \
-} while (0)
-
-#define UPCALL_STACK_DESTROY(frame) do { \
- upcall_local_t *__local = NULL; \
- xlator_t *__xl = NULL; \
- __xl = frame->this; \
- __local = frame->local; \
- frame->local = NULL; \
- STACK_DESTROY (frame->root); \
- upcall_local_wipe (__xl, __local); \
-} while (0)
+#define EXIT_IF_UPCALL_OFF(this, label) \
+ do { \
+ if (!is_upcall_enabled(this)) \
+ goto label; \
+ } while (0)
+
+#define UPCALL_STACK_UNWIND(fop, frame, params...) \
+ do { \
+ upcall_local_t *__local = NULL; \
+ xlator_t *__xl = NULL; \
+ if (frame) { \
+ __xl = frame->this; \
+ __local = frame->local; \
+ frame->local = NULL; \
+ } \
+ STACK_UNWIND_STRICT(fop, frame, params); \
+ upcall_local_wipe(__xl, __local); \
+ } while (0)
+
+#define UPCALL_STACK_DESTROY(frame) \
+ do { \
+ upcall_local_t *__local = NULL; \
+ xlator_t *__xl = NULL; \
+ __xl = frame->this; \
+ __local = frame->local; \
+ frame->local = NULL; \
+ STACK_DESTROY(frame->root); \
+ upcall_local_wipe(__xl, __local); \
+ } while (0)
struct _upcall_private {
- gf_boolean_t cache_invalidation_enabled;
- int32_t cache_invalidation_timeout;
- struct list_head inode_ctx_list;
- gf_lock_t inode_ctx_lk;
- gf_boolean_t reaper_init_done;
- pthread_t reaper_thr;
- int32_t fini;
- dict_t *xattrs; /* list of xattrs registered by clients
- for receiving invalidation */
+ gf_boolean_t cache_invalidation_enabled;
+ int32_t cache_invalidation_timeout;
+ struct list_head inode_ctx_list;
+ gf_lock_t inode_ctx_lk;
+ gf_boolean_t reaper_init_done;
+ pthread_t reaper_thr;
+ int32_t fini;
+ dict_t *xattrs; /* list of xattrs registered by clients
+ for receiving invalidation */
};
typedef struct _upcall_private upcall_private_t;
struct _upcall_client {
- struct list_head client_list;
- /* strdup to store client_uid, strdup. Free it explicitly */
- char *client_uid;
- time_t access_time; /* time last accessed */
- /* the amount of time which client can cache this entry */
- uint32_t expire_time_attr;
+ struct list_head client_list;
+ /* strdup to store client_uid, strdup. Free it explicitly */
+ char *client_uid;
+ time_t access_time; /* time last accessed */
+ /* the amount of time which client can cache this entry */
+ uint32_t expire_time_attr;
};
typedef struct _upcall_client upcall_client_t;
/* Upcall entries are maintained in inode_ctx */
struct _upcall_inode_ctx {
- struct list_head inode_ctx_list;
- struct list_head client_list;
- pthread_mutex_t client_list_lock; /* mutex for clients list
- of this upcall entry */
- int destroy;
- uuid_t gfid; /* gfid of the entry */
+ struct list_head inode_ctx_list;
+ struct list_head client_list;
+ pthread_mutex_t client_list_lock; /* mutex for clients list
+ of this upcall entry */
+ int destroy;
+ uuid_t gfid; /* gfid of the entry */
};
typedef struct _upcall_inode_ctx upcall_inode_ctx_t;
struct upcall_local {
- /* XXX: need to check if we can store
- * pointers in 'local' which may get freed
- * in future by other thread
- */
- inode_t *inode;
- loc_t rename_oldloc;
- loc_t loc; /* required for stat in *xattr_cbk */
- fd_t *fd; /* required for fstat in *xattr_cbk */
- dict_t *xattr;
+ /* XXX: need to check if we can store
+ * pointers in 'local' which may get freed
+ * in future by other thread
+ */
+ inode_t *inode;
+ loc_t rename_oldloc;
+ loc_t loc; /* required for stat in *xattr_cbk */
+ fd_t *fd; /* required for fstat in *xattr_cbk */
+ dict_t *xattr;
};
typedef struct upcall_local upcall_local_t;
-void upcall_local_wipe (xlator_t *this, upcall_local_t *local);
-upcall_local_t *upcall_local_init (call_frame_t *frame, xlator_t *this,
- loc_t *loc, fd_t *fd, inode_t *inode,
- dict_t *xattr);
-
-upcall_client_t *add_upcall_client (call_frame_t *frame, client_t *client,
- upcall_inode_ctx_t *up_inode_ctx);
-upcall_client_t *__add_upcall_client (call_frame_t *frame, client_t *client,
- upcall_inode_ctx_t *up_inode_ctx);
-upcall_client_t *__get_upcall_client (call_frame_t *frame, client_t *client,
- upcall_inode_ctx_t *up_inode_ctx);
-int __upcall_cleanup_client_entry (upcall_client_t *up_client);
-int upcall_cleanup_expired_clients (xlator_t *this,
- upcall_inode_ctx_t *up_inode_ctx);
-
-int __upcall_inode_ctx_set (inode_t *inode, xlator_t *this);
-upcall_inode_ctx_t *__upcall_inode_ctx_get (inode_t *inode, xlator_t *this);
-upcall_inode_ctx_t *upcall_inode_ctx_get (inode_t *inode, xlator_t *this);
-int upcall_cleanup_inode_ctx (xlator_t *this, inode_t *inode);
-void upcall_cache_forget (xlator_t *this, inode_t *inode,
- upcall_inode_ctx_t *up_inode_ctx);
-
-void *upcall_reaper_thread (void *data);
-int upcall_reaper_thread_init (xlator_t *this);
+void
+upcall_local_wipe(xlator_t *this, upcall_local_t *local);
+upcall_local_t *
+upcall_local_init(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd,
+ inode_t *inode, dict_t *xattr);
+
+upcall_client_t *
+add_upcall_client(call_frame_t *frame, client_t *client,
+ upcall_inode_ctx_t *up_inode_ctx);
+upcall_client_t *
+__add_upcall_client(call_frame_t *frame, client_t *client,
+ upcall_inode_ctx_t *up_inode_ctx);
+upcall_client_t *
+__get_upcall_client(call_frame_t *frame, client_t *client,
+ upcall_inode_ctx_t *up_inode_ctx);
+int
+__upcall_cleanup_client_entry(upcall_client_t *up_client);
+int
+upcall_cleanup_expired_clients(xlator_t *this,
+ upcall_inode_ctx_t *up_inode_ctx);
+
+int
+__upcall_inode_ctx_set(inode_t *inode, xlator_t *this);
+upcall_inode_ctx_t *
+__upcall_inode_ctx_get(inode_t *inode, xlator_t *this);
+upcall_inode_ctx_t *
+upcall_inode_ctx_get(inode_t *inode, xlator_t *this);
+int
+upcall_cleanup_inode_ctx(xlator_t *this, inode_t *inode);
+void
+upcall_cache_forget(xlator_t *this, inode_t *inode,
+ upcall_inode_ctx_t *up_inode_ctx);
+
+void *
+upcall_reaper_thread(void *data);
+int
+upcall_reaper_thread_init(xlator_t *this);
/* Xlator options */
-gf_boolean_t is_upcall_enabled (xlator_t *this);
+gf_boolean_t
+is_upcall_enabled(xlator_t *this);
/* Cache invalidation specific */
-void upcall_cache_invalidate (call_frame_t *frame, xlator_t *this,
- client_t *client, inode_t *inode,
- uint32_t flags, struct iatt *stbuf,
- struct iatt *p_stbuf,
- struct iatt *oldp_stbuf, dict_t *xattr);
-void upcall_client_cache_invalidate (xlator_t *xl, uuid_t gfid,
- upcall_client_t *up_client_entry,
- uint32_t flags, struct iatt *stbuf,
- struct iatt *p_stbuf,
- struct iatt *oldp_stbuf, dict_t *xattr);
-
-int up_filter_xattr (dict_t *xattr, dict_t *regd_xattrs);
-
-int up_compare_afr_xattr (dict_t *d, char *k, data_t *v, void *tmp);
-
-gf_boolean_t up_invalidate_needed (dict_t *xattrs);
+void
+upcall_cache_invalidate(call_frame_t *frame, xlator_t *this, client_t *client,
+ inode_t *inode, uint32_t flags, struct iatt *stbuf,
+ struct iatt *p_stbuf, struct iatt *oldp_stbuf,
+ dict_t *xattr);
+void
+upcall_client_cache_invalidate(xlator_t *xl, uuid_t gfid,
+ upcall_client_t *up_client_entry, uint32_t flags,
+ struct iatt *stbuf, struct iatt *p_stbuf,
+ struct iatt *oldp_stbuf, dict_t *xattr);
+
+int
+up_filter_xattr(dict_t *xattr, dict_t *regd_xattrs);
+
+int
+up_compare_afr_xattr(dict_t *d, char *k, data_t *v, void *tmp);
+
+gf_boolean_t
+up_invalidate_needed(dict_t *xattrs);
#endif /* __UPCALL_H__ */
diff --git a/xlators/features/utime/src/utime-helpers.h b/xlators/features/utime/src/utime-helpers.h
index f526aecb063..4efe75619eb 100644
--- a/xlators/features/utime/src/utime-helpers.h
+++ b/xlators/features/utime/src/utime-helpers.h
@@ -17,7 +17,7 @@
#include <time.h>
void
-gl_timespec_get (struct timespec *ts);
+gl_timespec_get(struct timespec *ts);
void
utime_update_attribute_flags(call_frame_t *frame, glusterfs_fop_t fop);
diff --git a/xlators/lib/src/libxlator.h b/xlators/lib/src/libxlator.h
index 0825ddb0f70..80224f9df38 100644
--- a/xlators/lib/src/libxlator.h
+++ b/xlators/lib/src/libxlator.h
@@ -10,7 +10,6 @@
#ifndef _LIBXLATOR_H
#define _LIBXLATOR_H
-
#include "xlator.h"
#include "logging.h"
#include "defaults.h"
@@ -18,29 +17,26 @@
#include "compat.h"
#include "compat-errno.h"
-
#define MARKER_XATTR_PREFIX "trusted.glusterfs"
-#define XTIME "xtime"
-#define VOLUME_MARK "volume-mark"
+#define XTIME "xtime"
+#define VOLUME_MARK "volume-mark"
#define GF_XATTR_MARKER_KEY MARKER_XATTR_PREFIX "." VOLUME_MARK
#define UUID_SIZE 36
-#define MARKER_UUID_TYPE 1
-#define MARKER_XTIME_TYPE 2
-
-typedef int32_t (*xlator_specf_unwind_t) (call_frame_t *frame,
- int op_ret, int op_errno,
- dict_t *dict, dict_t *xdata);
+#define MARKER_UUID_TYPE 1
+#define MARKER_XTIME_TYPE 2
+typedef int32_t (*xlator_specf_unwind_t)(call_frame_t *frame, int op_ret,
+ int op_errno, dict_t *dict,
+ dict_t *xdata);
struct volume_mark {
- uint8_t major;
- uint8_t minor;
- uint8_t uuid[16];
- uint8_t retval;
- uint32_t sec;
- uint32_t usec;
-}__attribute__ ((__packed__));
-
+ uint8_t major;
+ uint8_t minor;
+ uint8_t uuid[16];
+ uint8_t retval;
+ uint32_t sec;
+ uint32_t usec;
+} __attribute__((__packed__));
/*
* The enumerated type here
@@ -92,58 +88,58 @@ struct volume_mark {
*/
typedef enum {
- MCNT_FOUND,
- MCNT_NOTFOUND,
- MCNT_ENODATA,
- MCNT_ENOTCONN,
- MCNT_ENOENT,
- MCNT_EOTHER,
- MCNT_MAX
+ MCNT_FOUND,
+ MCNT_NOTFOUND,
+ MCNT_ENODATA,
+ MCNT_ENOTCONN,
+ MCNT_ENOENT,
+ MCNT_EOTHER,
+ MCNT_MAX
} marker_result_idx_t;
extern int marker_xtime_default_gauge[];
extern int marker_uuid_default_gauge[];
struct marker_str {
- struct volume_mark *volmark;
- data_t *data;
-
- uint32_t host_timebuf[2];
- uint32_t net_timebuf[2];
- int32_t call_count;
- int gauge[MCNT_MAX];
- int count[MCNT_MAX];
-
- xlator_specf_unwind_t xl_specf_unwind;
- void *xl_local;
- char *vol_uuid;
- uint8_t retval;
+ struct volume_mark *volmark;
+ data_t *data;
+
+ uint32_t host_timebuf[2];
+ uint32_t net_timebuf[2];
+ int32_t call_count;
+ int gauge[MCNT_MAX];
+ int count[MCNT_MAX];
+
+ xlator_specf_unwind_t xl_specf_unwind;
+ void *xl_local;
+ char *vol_uuid;
+ uint8_t retval;
};
typedef struct marker_str xl_marker_local_t;
int32_t
-cluster_markerxtime_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int op_ret, int op_errno, dict_t *dict, dict_t *xdata);
+cluster_markerxtime_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int op_ret, int op_errno, dict_t *dict, dict_t *xdata);
int32_t
-cluster_markeruuid_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int op_ret, int op_errno, dict_t *dict, dict_t *xdata);
+cluster_markeruuid_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int op_ret, int op_errno, dict_t *dict, dict_t *xdata);
int
-cluster_handle_marker_getxattr (call_frame_t *frame, loc_t *loc,
- const char *name, char *vol_uuid,
- xlator_specf_unwind_t unwind,
- int (*populate_args) (call_frame_t *frame,
- int type, int *gauge,
- xlator_t **subvols));
+cluster_handle_marker_getxattr(call_frame_t *frame, loc_t *loc,
+ const char *name, char *vol_uuid,
+ xlator_specf_unwind_t unwind,
+ int (*populate_args)(call_frame_t *frame,
+ int type, int *gauge,
+ xlator_t **subvols));
int
-match_uuid_local (const char *name, char *uuid);
+match_uuid_local(const char *name, char *uuid);
int
-gf_get_min_stime (xlator_t *this, dict_t *dst, char *key, data_t *value);
+gf_get_min_stime(xlator_t *this, dict_t *dst, char *key, data_t *value);
int
-gf_get_max_stime (xlator_t *this, dict_t *dst, char *key, data_t *value);
+gf_get_max_stime(xlator_t *this, dict_t *dst, char *key, data_t *value);
#endif /* !_LIBXLATOR_H */
diff --git a/xlators/meta/src/meta-hooks.h b/xlators/meta/src/meta-hooks.h
index bcf3643d223..2ee006f7876 100644
--- a/xlators/meta/src/meta-hooks.h
+++ b/xlators/meta/src/meta-hooks.h
@@ -12,7 +12,9 @@
#define __META_HOOKS_H
#include "xlator.h"
-#define DECLARE_HOOK(name) int meta_##name##_hook (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata)
+#define DECLARE_HOOK(name) \
+ int meta_##name##_hook(call_frame_t *frame, xlator_t *this, loc_t *loc, \
+ dict_t *xdata)
DECLARE_HOOK(root_dir);
DECLARE_HOOK(graphs_dir);
diff --git a/xlators/meta/src/meta-mem-types.h b/xlators/meta/src/meta-mem-types.h
index e8a31856e71..0fdfea4fac6 100644
--- a/xlators/meta/src/meta-mem-types.h
+++ b/xlators/meta/src/meta-mem-types.h
@@ -14,13 +14,12 @@
#include "mem-types.h"
enum gf_meta_mem_types_ {
- gf_meta_mt_priv_t = gf_common_mt_end + 1,
- gf_meta_mt_fd_t,
- gf_meta_mt_fd_data_t,
- gf_meta_mt_strfd_t,
- gf_meta_mt_dirents_t,
- gf_meta_mt_local_t,
- gf_meta_mt_end
+ gf_meta_mt_priv_t = gf_common_mt_end + 1,
+ gf_meta_mt_fd_t,
+ gf_meta_mt_fd_data_t,
+ gf_meta_mt_strfd_t,
+ gf_meta_mt_dirents_t,
+ gf_meta_mt_local_t,
+ gf_meta_mt_end
};
#endif
-
diff --git a/xlators/meta/src/meta.h b/xlators/meta/src/meta.h
index d9c56c656ad..10609a9ec05 100644
--- a/xlators/meta/src/meta.h
+++ b/xlators/meta/src/meta.h
@@ -16,106 +16,125 @@
#define META_ROOT_GFID "ba926388-bb9c-4eec-ad60-79dba4cc083a"
-#define IS_META_ROOT_GFID(g) (strcmp (uuid_utoa(g), META_ROOT_GFID) == 0)
+#define IS_META_ROOT_GFID(g) (strcmp(uuid_utoa(g), META_ROOT_GFID) == 0)
-typedef int (*meta_hook_t) (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata);
+typedef int (*meta_hook_t)(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ dict_t *xdata);
typedef struct {
- dict_t *xdata;
+ dict_t *xdata;
} meta_local_t;
typedef struct {
- char *meta_dir_name;
+ char *meta_dir_name;
} meta_priv_t;
struct meta_dirent {
- const char *name;
- ia_type_t type;
- meta_hook_t hook;
+ const char *name;
+ ia_type_t type;
+ meta_hook_t hook;
};
-#define DOT_DOTDOT { .name = ".", .type = IA_IFDIR }, { .name = "..", .type = IA_IFDIR }
+#define DOT_DOTDOT \
+ {.name = ".", .type = IA_IFDIR}, { .name = "..", .type = IA_IFDIR }
struct meta_ops {
- struct meta_dirent *fixed_dirents;
- int (*dir_fill) (xlator_t *this, inode_t *dir, struct meta_dirent **entries);
- int (*file_fill) (xlator_t *this, inode_t *file, strfd_t *strfd);
- int (*iatt_fill) (xlator_t *this, inode_t *inode, struct iatt *iatt);
- int (*link_fill) (xlator_t *this, inode_t *inode, strfd_t *strfd);
- int (*file_write) (xlator_t *this, fd_t *fd, struct iovec *iov, int count);
- struct xlator_fops fops;
- struct xlator_cbks cbks;
+ struct meta_dirent *fixed_dirents;
+ int (*dir_fill)(xlator_t *this, inode_t *dir, struct meta_dirent **entries);
+ int (*file_fill)(xlator_t *this, inode_t *file, strfd_t *strfd);
+ int (*iatt_fill)(xlator_t *this, inode_t *inode, struct iatt *iatt);
+ int (*link_fill)(xlator_t *this, inode_t *inode, strfd_t *strfd);
+ int (*file_write)(xlator_t *this, fd_t *fd, struct iovec *iov, int count);
+ struct xlator_fops fops;
+ struct xlator_cbks cbks;
};
typedef struct {
- char *data;
- struct meta_dirent *dirents;
- size_t size;
+ char *data;
+ struct meta_dirent *dirents;
+ size_t size;
} meta_fd_t;
+#define COUNT(arr) (sizeof(arr) / sizeof(arr[0]))
-#define COUNT(arr) (sizeof(arr)/sizeof(arr[0]))
-
-#define META_HOOK(loc) (__is_root_gfid (loc->pargfid) && !strcmp (loc->name, META_PRIV(THIS)->meta_dir_name))
+#define META_HOOK(loc) \
+ (__is_root_gfid(loc->pargfid) && \
+ !strcmp(loc->name, META_PRIV(THIS)->meta_dir_name))
#define META_PRIV(t) ((meta_priv_t *)(t->private))
-#define META_STACK_UNWIND(fop, frame, params ...) \
- do { \
- meta_local_t *__local = NULL; \
- xlator_t *__this = NULL; \
- if (frame) { \
- __local = frame->local; \
- __this = frame->this; \
- frame->local = NULL; \
- } \
- STACK_UNWIND_STRICT (fop, frame, params); \
- if (__local) { \
- meta_local_cleanup (__local, __this); \
- } \
- } while (0)
-
-
-#define META_FOP(i, fop, fr, t, params ...) { \
- struct xlator_fops *_fops = NULL; \
- \
- _fops = meta_fops_get (i, t); \
- \
- _fops->fop (fr, t, params); \
- } while (0)
-
-
-void meta_iatt_fill (struct iatt *iatt, inode_t *inode, ia_type_t type);
-
-int meta_inode_discover (call_frame_t *frame, xlator_t *this, loc_t *loc,
- dict_t *xdata);
-
-int meta_ops_set (inode_t *inode, xlator_t *this, struct meta_ops *ops);
-
-struct xlator_fops *meta_fops_get (inode_t *inode, xlator_t *this);
-struct xlator_cbks *meta_cbks_get (inode_t *inode, xlator_t *this);
-struct meta_ops *meta_ops_get (inode_t *inode, xlator_t *this);
-
-int meta_ctx_set (inode_t *inode, xlator_t *this, void *ctx);
-
-void *meta_ctx_get (inode_t *inode, xlator_t *this);
-
-
-void meta_local_cleanup (meta_local_t *local, xlator_t *this);
-
-struct xlator_fops *meta_defaults_init (struct xlator_fops *fops);
-
-meta_fd_t *meta_fd_get (fd_t *fd, xlator_t *this);
-
-int meta_fd_release (fd_t *fd, xlator_t *this);
-
-dict_t *meta_direct_io_mode (dict_t *xdata, call_frame_t *frame);
-
-meta_local_t *meta_local (call_frame_t *frame);
-
-int meta_file_fill (xlator_t *this, fd_t *fd);
-
-int meta_dir_fill (xlator_t *this, fd_t *fd);
-
-int fixed_dirents_len (struct meta_dirent *dirents);
+#define META_STACK_UNWIND(fop, frame, params...) \
+ do { \
+ meta_local_t *__local = NULL; \
+ xlator_t *__this = NULL; \
+ if (frame) { \
+ __local = frame->local; \
+ __this = frame->this; \
+ frame->local = NULL; \
+ } \
+ STACK_UNWIND_STRICT(fop, frame, params); \
+ if (__local) { \
+ meta_local_cleanup(__local, __this); \
+ } \
+ } while (0)
+
+#define META_FOP(i, fop, fr, t, params...) \
+ { \
+ struct xlator_fops *_fops = NULL; \
+ \
+ _fops = meta_fops_get(i, t); \
+ \
+ _fops->fop(fr, t, params); \
+ } \
+ while (0)
+
+void
+meta_iatt_fill(struct iatt *iatt, inode_t *inode, ia_type_t type);
+
+int
+meta_inode_discover(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ dict_t *xdata);
+
+int
+meta_ops_set(inode_t *inode, xlator_t *this, struct meta_ops *ops);
+
+struct xlator_fops *
+meta_fops_get(inode_t *inode, xlator_t *this);
+struct xlator_cbks *
+meta_cbks_get(inode_t *inode, xlator_t *this);
+struct meta_ops *
+meta_ops_get(inode_t *inode, xlator_t *this);
+
+int
+meta_ctx_set(inode_t *inode, xlator_t *this, void *ctx);
+
+void *
+meta_ctx_get(inode_t *inode, xlator_t *this);
+
+void
+meta_local_cleanup(meta_local_t *local, xlator_t *this);
+
+struct xlator_fops *
+meta_defaults_init(struct xlator_fops *fops);
+
+meta_fd_t *
+meta_fd_get(fd_t *fd, xlator_t *this);
+
+int
+meta_fd_release(fd_t *fd, xlator_t *this);
+
+dict_t *
+meta_direct_io_mode(dict_t *xdata, call_frame_t *frame);
+
+meta_local_t *
+meta_local(call_frame_t *frame);
+
+int
+meta_file_fill(xlator_t *this, fd_t *fd);
+
+int
+meta_dir_fill(xlator_t *this, fd_t *fd);
+
+int
+fixed_dirents_len(struct meta_dirent *dirents);
#endif /* __META_H__ */
diff --git a/xlators/mgmt/glusterd/src/glusterd-bitd-svc.h b/xlators/mgmt/glusterd/src/glusterd-bitd-svc.h
index 7f276fb0b5c..1bff084a9a8 100644
--- a/xlators/mgmt/glusterd/src/glusterd-bitd-svc.h
+++ b/xlators/mgmt/glusterd/src/glusterd-bitd-svc.h
@@ -16,25 +16,25 @@
#define bitd_svc_name "bitd"
void
-glusterd_bitdsvc_build (glusterd_svc_t *svc);
+glusterd_bitdsvc_build(glusterd_svc_t *svc);
int
-glusterd_bitdsvc_init (glusterd_svc_t *svc);
+glusterd_bitdsvc_init(glusterd_svc_t *svc);
int
-glusterd_bitdsvc_manager (glusterd_svc_t *svc, void *data, int flags);
+glusterd_bitdsvc_manager(glusterd_svc_t *svc, void *data, int flags);
int
-glusterd_bitdsvc_start (glusterd_svc_t *svc, int flags);
+glusterd_bitdsvc_start(glusterd_svc_t *svc, int flags);
int
-glusterd_bitdsvc_stop (glusterd_svc_t *svc, int sig);
+glusterd_bitdsvc_stop(glusterd_svc_t *svc, int sig);
int
-glusterd_bitdsvc_reconfigure ();
+glusterd_bitdsvc_reconfigure();
void
-glusterd_bitdsvc_build_volfile_path (char *server, char *workdir,
- char *volfile, size_t len);
+glusterd_bitdsvc_build_volfile_path(char *server, char *workdir, char *volfile,
+ size_t len);
#endif
diff --git a/xlators/mgmt/glusterd/src/glusterd-conn-helper.h b/xlators/mgmt/glusterd/src/glusterd-conn-helper.h
index 80468d6de75..6f500309175 100644
--- a/xlators/mgmt/glusterd/src/glusterd-conn-helper.h
+++ b/xlators/mgmt/glusterd/src/glusterd-conn-helper.h
@@ -16,6 +16,6 @@
#include "glusterd-conn-mgmt.h"
glusterd_svc_t *
-glusterd_conn_get_svc_object (glusterd_conn_t *conn);
+glusterd_conn_get_svc_object(glusterd_conn_t *conn);
#endif
diff --git a/xlators/mgmt/glusterd/src/glusterd-conn-mgmt.h b/xlators/mgmt/glusterd/src/glusterd-conn-mgmt.h
index 5820419dbf5..602c0ba7b84 100644
--- a/xlators/mgmt/glusterd/src/glusterd-conn-mgmt.h
+++ b/xlators/mgmt/glusterd/src/glusterd-conn-mgmt.h
@@ -15,37 +15,37 @@
typedef struct glusterd_conn_ glusterd_conn_t;
-typedef int (*glusterd_conn_notify_t)
- (glusterd_conn_t *conn, rpc_clnt_event_t event);
+typedef int (*glusterd_conn_notify_t)(glusterd_conn_t *conn,
+ rpc_clnt_event_t event);
struct glusterd_conn_ {
- struct rpc_clnt *rpc;
- char sockpath[PATH_MAX];
- int frame_timeout;
- /* Existing daemons tend to specialize their respective
- * notify implementations, so ... */
- glusterd_conn_notify_t notify;
+ struct rpc_clnt *rpc;
+ char sockpath[PATH_MAX];
+ int frame_timeout;
+ /* Existing daemons tend to specialize their respective
+ * notify implementations, so ... */
+ glusterd_conn_notify_t notify;
};
int
-glusterd_conn_init (glusterd_conn_t *conn, char *sockpath,
- int frame_timeout, glusterd_conn_notify_t notify);
+glusterd_conn_init(glusterd_conn_t *conn, char *sockpath, int frame_timeout,
+ glusterd_conn_notify_t notify);
int
-glusterd_conn_term (glusterd_conn_t *conn);
+glusterd_conn_term(glusterd_conn_t *conn);
int
-glusterd_conn_connect (glusterd_conn_t *conn);
+glusterd_conn_connect(glusterd_conn_t *conn);
int
-glusterd_conn_disconnect (glusterd_conn_t *conn);
+glusterd_conn_disconnect(glusterd_conn_t *conn);
int
-glusterd_conn_common_notify (struct rpc_clnt *rpc, void *mydata,
- rpc_clnt_event_t event, void *data);
+glusterd_conn_common_notify(struct rpc_clnt *rpc, void *mydata,
+ rpc_clnt_event_t event, void *data);
int32_t
-glusterd_conn_build_socket_filepath (char *rundir, uuid_t uuid,
- char *socketpath, int len);
+glusterd_conn_build_socket_filepath(char *rundir, uuid_t uuid, char *socketpath,
+ int len);
#endif
diff --git a/xlators/mgmt/glusterd/src/glusterd-errno.h b/xlators/mgmt/glusterd/src/glusterd-errno.h
index bfb56b56240..7e1575b57af 100644
--- a/xlators/mgmt/glusterd/src/glusterd-errno.h
+++ b/xlators/mgmt/glusterd/src/glusterd-errno.h
@@ -11,23 +11,23 @@
#define _GLUSTERD_ERRNO_H
enum glusterd_op_errno {
- EG_INTRNL = 30800, /* Internal Error */
- EG_OPNOTSUP = 30801, /* Gluster Op Not Supported */
- EG_ANOTRANS = 30802, /* Another Transaction in Progress */
- EG_BRCKDWN = 30803, /* One or more brick is down */
- EG_NODEDWN = 30804, /* One or more node is down */
- EG_HRDLMT = 30805, /* Hard Limit is reached */
- EG_NOVOL = 30806, /* Volume does not exist */
- EG_NOSNAP = 30807, /* Snap does not exist */
- EG_RBALRUN = 30808, /* Rebalance is running */
- EG_VOLRUN = 30809, /* Volume is running */
- EG_VOLSTP = 30810, /* Volume is not running */
- EG_VOLEXST = 30811, /* Volume exists */
- EG_SNAPEXST = 30812, /* Snapshot exists */
- EG_ISSNAP = 30813, /* Volume is a snap volume */
- EG_GEOREPRUN = 30814, /* Geo-Replication is running */
- EG_NOTTHINP = 30815, /* Bricks are not thinly provisioned */
- EG_NOGANESHA = 30816, /* obsolete ganesha is not enabled */
+ EG_INTRNL = 30800, /* Internal Error */
+ EG_OPNOTSUP = 30801, /* Gluster Op Not Supported */
+ EG_ANOTRANS = 30802, /* Another Transaction in Progress */
+ EG_BRCKDWN = 30803, /* One or more brick is down */
+ EG_NODEDWN = 30804, /* One or more node is down */
+ EG_HRDLMT = 30805, /* Hard Limit is reached */
+ EG_NOVOL = 30806, /* Volume does not exist */
+ EG_NOSNAP = 30807, /* Snap does not exist */
+ EG_RBALRUN = 30808, /* Rebalance is running */
+ EG_VOLRUN = 30809, /* Volume is running */
+ EG_VOLSTP = 30810, /* Volume is not running */
+ EG_VOLEXST = 30811, /* Volume exists */
+ EG_SNAPEXST = 30812, /* Snapshot exists */
+ EG_ISSNAP = 30813, /* Volume is a snap volume */
+ EG_GEOREPRUN = 30814, /* Geo-Replication is running */
+ EG_NOTTHINP = 30815, /* Bricks are not thinly provisioned */
+ EG_NOGANESHA = 30816, /* obsolete ganesha is not enabled */
};
#endif
diff --git a/xlators/mgmt/glusterd/src/glusterd-geo-rep.h b/xlators/mgmt/glusterd/src/glusterd-geo-rep.h
index 8d08bcda50e..5f5fe344406 100644
--- a/xlators/mgmt/glusterd/src/glusterd-geo-rep.h
+++ b/xlators/mgmt/glusterd/src/glusterd-geo-rep.h
@@ -11,7 +11,7 @@
#define _GLUSTERD_GEO_REP_H_
#ifndef GSYNC_CONF_TEMPLATE
-#define GSYNC_CONF_TEMPLATE GEOREP"/gsyncd_template.conf"
+#define GSYNC_CONF_TEMPLATE GEOREP "/gsyncd_template.conf"
#endif
/* <slave host>::<slave volume> */
@@ -20,34 +20,33 @@
/* slave info format:
* <master host uuid>:ssh://{<slave_user>@}<slave host>::<slave volume> \
* :<slave volume uuid> */
-#define VOLINFO_SLAVE_URL_MAX (LOGIN_NAME_MAX + (2*GF_UUID_BUF_SIZE) \
- + SLAVE_URL_INFO_MAX + 10)
+#define VOLINFO_SLAVE_URL_MAX \
+ (LOGIN_NAME_MAX + (2 * GF_UUID_BUF_SIZE) + SLAVE_URL_INFO_MAX + 10)
typedef struct glusterd_gsync_status_temp {
- dict_t *rsp_dict;
- glusterd_volinfo_t *volinfo;
- char *node;
+ dict_t *rsp_dict;
+ glusterd_volinfo_t *volinfo;
+ char *node;
} glusterd_gsync_status_temp_t;
typedef struct gsync_status_param {
- int is_active;
- glusterd_volinfo_t *volinfo;
+ int is_active;
+ glusterd_volinfo_t *volinfo;
} gsync_status_param_t;
int
-gsync_status (char *master, char *slave, char *conf_path,
- int *status, gf_boolean_t *is_template_in_use);
+gsync_status(char *master, char *slave, char *conf_path, int *status,
+ gf_boolean_t *is_template_in_use);
void
-glusterd_check_geo_rep_configured (glusterd_volinfo_t *volinfo,
- gf_boolean_t *flag);
+glusterd_check_geo_rep_configured(glusterd_volinfo_t *volinfo,
+ gf_boolean_t *flag);
int
-_get_slave_status (dict_t *dict, char *key, data_t *value, void *data);
+_get_slave_status(dict_t *dict, char *key, data_t *value, void *data);
int
-glusterd_check_geo_rep_running (gsync_status_param_t *param, char **op_errstr);
+glusterd_check_geo_rep_running(gsync_status_param_t *param, char **op_errstr);
int
-glusterd_get_gsync_status_mst (glusterd_volinfo_t *volinfo, dict_t *rsp_dict,
- char *node);
+glusterd_get_gsync_status_mst(glusterd_volinfo_t *volinfo, dict_t *rsp_dict,
+ char *node);
#endif
-
diff --git a/xlators/mgmt/glusterd/src/glusterd-gfproxyd-svc-helper.h b/xlators/mgmt/glusterd/src/glusterd-gfproxyd-svc-helper.h
index 34a0e62a85a..3aca218a65d 100644
--- a/xlators/mgmt/glusterd/src/glusterd-gfproxyd-svc-helper.h
+++ b/xlators/mgmt/glusterd/src/glusterd-gfproxyd-svc-helper.h
@@ -14,38 +14,38 @@
#include "glusterd.h"
void
-glusterd_svc_build_gfproxyd_rundir (glusterd_volinfo_t *volinfo,
- char *path, int path_len);
+glusterd_svc_build_gfproxyd_rundir(glusterd_volinfo_t *volinfo, char *path,
+ int path_len);
void
-glusterd_svc_build_gfproxyd_socket_filepath (glusterd_volinfo_t *volinfo,
- char *path, int path_len);
+glusterd_svc_build_gfproxyd_socket_filepath(glusterd_volinfo_t *volinfo,
+ char *path, int path_len);
void
-glusterd_svc_build_gfproxyd_pidfile (glusterd_volinfo_t *volinfo,
- char *path, int path_len);
+glusterd_svc_build_gfproxyd_pidfile(glusterd_volinfo_t *volinfo, char *path,
+ int path_len);
void
-glusterd_svc_build_gfproxyd_volfile_path (glusterd_volinfo_t *volinfo,
- char *path, int path_len);
+glusterd_svc_build_gfproxyd_volfile_path(glusterd_volinfo_t *volinfo,
+ char *path, int path_len);
void
-glusterd_svc_build_gfproxyd_logdir (char *logdir, char *volname, size_t len);
+glusterd_svc_build_gfproxyd_logdir(char *logdir, char *volname, size_t len);
void
-glusterd_svc_build_gfproxyd_logfile (char *logfile, char *logdir, size_t len);
+glusterd_svc_build_gfproxyd_logfile(char *logfile, char *logdir, size_t len);
int
-glusterd_svc_check_gfproxyd_volfile_identical (char *svc_name,
+glusterd_svc_check_gfproxyd_volfile_identical(char *svc_name,
+ glusterd_volinfo_t *volinfo,
+ gf_boolean_t *identical);
+int
+glusterd_svc_check_gfproxyd_topology_identical(char *svc_name,
glusterd_volinfo_t *volinfo,
gf_boolean_t *identical);
int
-glusterd_svc_check_gfproxyd_topology_identical (char *svc_name,
- glusterd_volinfo_t *volinfo,
- gf_boolean_t *identical);
-int
-glusterd_is_gfproxyd_enabled (glusterd_volinfo_t *volinfo);
+glusterd_is_gfproxyd_enabled(glusterd_volinfo_t *volinfo);
glusterd_volinfo_t *
-glusterd_gfproxyd_volinfo_from_svc (glusterd_svc_t *svc);
+glusterd_gfproxyd_volinfo_from_svc(glusterd_svc_t *svc);
#endif
diff --git a/xlators/mgmt/glusterd/src/glusterd-gfproxyd-svc.h b/xlators/mgmt/glusterd/src/glusterd-gfproxyd-svc.h
index a4af632a5b0..db1c8b1e7b0 100644
--- a/xlators/mgmt/glusterd/src/glusterd-gfproxyd-svc.h
+++ b/xlators/mgmt/glusterd/src/glusterd-gfproxyd-svc.h
@@ -16,32 +16,32 @@
#define gfproxyd_svc_name "gfproxyd"
struct glusterd_gfproxydsvc_ {
- glusterd_svc_t svc;
- int port;
- gf_store_handle_t *handle;
+ glusterd_svc_t svc;
+ int port;
+ gf_store_handle_t *handle;
};
typedef struct glusterd_gfproxydsvc_ glusterd_gfproxydsvc_t;
void
-glusterd_gfproxydsvc_build (glusterd_svc_t *svc);
+glusterd_gfproxydsvc_build(glusterd_svc_t *svc);
int
-glusterd_gfproxydsvc_manager (glusterd_svc_t *svc, void *data, int flags);
+glusterd_gfproxydsvc_manager(glusterd_svc_t *svc, void *data, int flags);
int
-glusterd_gfproxydsvc_start (glusterd_svc_t *svc, int flags);
+glusterd_gfproxydsvc_start(glusterd_svc_t *svc, int flags);
int
-glusterd_gfproxydsvc_stop (glusterd_svc_t *svc, int sig);
+glusterd_gfproxydsvc_stop(glusterd_svc_t *svc, int sig);
int
-glusterd_gfproxydsvc_reconfigure ();
+glusterd_gfproxydsvc_reconfigure();
void
-glusterd_gfproxydsvc_build_volfile_path (char *server, char *workdir,
- char *volfile, size_t len);
+glusterd_gfproxydsvc_build_volfile_path(char *server, char *workdir,
+ char *volfile, size_t len);
int
-glusterd_gfproxydsvc_restart ();
+glusterd_gfproxydsvc_restart();
#endif
diff --git a/xlators/mgmt/glusterd/src/glusterd-hooks.h b/xlators/mgmt/glusterd/src/glusterd-hooks.h
index 752e459f89c..3813c18e989 100644
--- a/xlators/mgmt/glusterd/src/glusterd-hooks.h
+++ b/xlators/mgmt/glusterd/src/glusterd-hooks.h
@@ -12,79 +12,77 @@
#include <fnmatch.h>
-#define GLUSTERD_GET_HOOKS_DIR(path, version, priv) \
- do { \
- int32_t len; \
- len = snprintf (path, PATH_MAX, "%s/hooks/%d", priv->workdir,\
- version); \
- if (len < 0) { \
- path[0] = 0; \
- } \
- } while (0)
+#define GLUSTERD_GET_HOOKS_DIR(path, version, priv) \
+ do { \
+ int32_t len; \
+ len = snprintf(path, PATH_MAX, "%s/hooks/%d", priv->workdir, version); \
+ if (len < 0) { \
+ path[0] = 0; \
+ } \
+ } while (0)
-#define GLUSTERD_HOOK_VER 1
+#define GLUSTERD_HOOK_VER 1
-#define GD_HOOKS_SPECIFIC_KEY "user.*"
+#define GD_HOOKS_SPECIFIC_KEY "user.*"
typedef enum glusterd_commit_hook_type {
- GD_COMMIT_HOOK_NONE = 0,
- GD_COMMIT_HOOK_PRE,
- GD_COMMIT_HOOK_POST,
- GD_COMMIT_HOOK_MAX
+ GD_COMMIT_HOOK_NONE = 0,
+ GD_COMMIT_HOOK_PRE,
+ GD_COMMIT_HOOK_POST,
+ GD_COMMIT_HOOK_MAX
} glusterd_commit_hook_type_t;
typedef struct hooks_private {
- struct cds_list_head list;
- int waitcount; //debug purposes
- pthread_mutex_t mutex;
- pthread_cond_t cond;
- pthread_t worker;
+ struct cds_list_head list;
+ int waitcount; // debug purposes
+ pthread_mutex_t mutex;
+ pthread_cond_t cond;
+ pthread_t worker;
} glusterd_hooks_private_t;
typedef struct hooks_stub {
- struct cds_list_head all_hooks;
- char *scriptdir;
- glusterd_op_t op;
- dict_t *op_ctx;
+ struct cds_list_head all_hooks;
+ char *scriptdir;
+ glusterd_op_t op;
+ dict_t *op_ctx;
} glusterd_hooks_stub_t;
-
static inline gf_boolean_t
-is_key_glusterd_hooks_friendly (char *key)
+is_key_glusterd_hooks_friendly(char *key)
{
- gf_boolean_t is_friendly = _gf_false;
+ gf_boolean_t is_friendly = _gf_false;
- /* This is very specific to hooks friendly behavior */
- if (fnmatch (GD_HOOKS_SPECIFIC_KEY, key, FNM_NOESCAPE) == 0) {
- gf_msg_debug (THIS->name, 0, "user namespace key %s", key);
- is_friendly = _gf_true;
- }
+ /* This is very specific to hooks friendly behavior */
+ if (fnmatch(GD_HOOKS_SPECIFIC_KEY, key, FNM_NOESCAPE) == 0) {
+ gf_msg_debug(THIS->name, 0, "user namespace key %s", key);
+ is_friendly = _gf_true;
+ }
- return is_friendly;
+ return is_friendly;
}
int
-glusterd_hooks_create_hooks_directory (char *basedir);
+glusterd_hooks_create_hooks_directory(char *basedir);
char *
-glusterd_hooks_get_hooks_cmd_subdir (glusterd_op_t op);
+glusterd_hooks_get_hooks_cmd_subdir(glusterd_op_t op);
int
-glusterd_hooks_run_hooks (char *hooks_path, glusterd_op_t op, dict_t *op_ctx,
- glusterd_commit_hook_type_t type);
+glusterd_hooks_run_hooks(char *hooks_path, glusterd_op_t op, dict_t *op_ctx,
+ glusterd_commit_hook_type_t type);
int
-glusterd_hooks_spawn_worker (xlator_t *this);
+glusterd_hooks_spawn_worker(xlator_t *this);
int
-glusterd_hooks_stub_init (glusterd_hooks_stub_t **stub, char *scriptdir,
- glusterd_op_t op, dict_t *op_ctx);
+glusterd_hooks_stub_init(glusterd_hooks_stub_t **stub, char *scriptdir,
+ glusterd_op_t op, dict_t *op_ctx);
void
-glusterd_hooks_stub_cleanup (glusterd_hooks_stub_t *stub);
+glusterd_hooks_stub_cleanup(glusterd_hooks_stub_t *stub);
int
-glusterd_hooks_post_stub_enqueue (char *scriptdir, glusterd_op_t op,
- dict_t *op_ctx);
+glusterd_hooks_post_stub_enqueue(char *scriptdir, glusterd_op_t op,
+ dict_t *op_ctx);
int
-glusterd_hooks_priv_init (glusterd_hooks_private_t **new);
+glusterd_hooks_priv_init(glusterd_hooks_private_t **new);
#endif
diff --git a/xlators/mgmt/glusterd/src/glusterd-locks.h b/xlators/mgmt/glusterd/src/glusterd-locks.h
index 226d5c6bd7f..8878a30d0bf 100644
--- a/xlators/mgmt/glusterd/src/glusterd-locks.h
+++ b/xlators/mgmt/glusterd/src/glusterd-locks.h
@@ -11,49 +11,49 @@
#define _GLUSTERD_LOCKS_H_
typedef struct glusterd_mgmt_v3_lock_object_ {
- uuid_t lock_owner;
+ uuid_t lock_owner;
} glusterd_mgmt_v3_lock_obj;
typedef struct glusterd_mgmt_v3_lock_timer_ {
- gf_timer_t *timer;
- xlator_t *xl;
+ gf_timer_t *timer;
+ xlator_t *xl;
} glusterd_mgmt_v3_lock_timer;
typedef struct glusterd_mgmt_v3_lock_valid_entities {
- char *type; /* Entity type like vol, snap */
- gf_boolean_t default_value; /* The default value that *
- * determines if the locks *
- * should be held for that *
- * entity */
+ char *type; /* Entity type like vol, snap */
+ gf_boolean_t default_value; /* The default value that *
+ * determines if the locks *
+ * should be held for that *
+ * entity */
} glusterd_valid_entities;
int32_t
-glusterd_mgmt_v3_lock_init ();
+glusterd_mgmt_v3_lock_init();
void
-glusterd_mgmt_v3_lock_fini ();
+glusterd_mgmt_v3_lock_fini();
int32_t
-glusterd_mgmt_v3_lock_timer_init ();
+glusterd_mgmt_v3_lock_timer_init();
void
-glusterd_mgmt_v3_lock_timer_fini ();
+glusterd_mgmt_v3_lock_timer_fini();
int32_t
-glusterd_get_mgmt_v3_lock_owner (char *volname, uuid_t *uuid);
+glusterd_get_mgmt_v3_lock_owner(char *volname, uuid_t *uuid);
int32_t
-glusterd_mgmt_v3_lock (const char *key, uuid_t uuid, uint32_t *op_errno,
- char *type);
+glusterd_mgmt_v3_lock(const char *key, uuid_t uuid, uint32_t *op_errno,
+ char *type);
int32_t
-glusterd_mgmt_v3_unlock (const char *key, uuid_t uuid, char *type);
+glusterd_mgmt_v3_unlock(const char *key, uuid_t uuid, char *type);
int32_t
-glusterd_multiple_mgmt_v3_lock (dict_t *dict, uuid_t uuid, uint32_t *op_errno);
+glusterd_multiple_mgmt_v3_lock(dict_t *dict, uuid_t uuid, uint32_t *op_errno);
int32_t
-glusterd_multiple_mgmt_v3_unlock (dict_t *dict, uuid_t uuid);
+glusterd_multiple_mgmt_v3_unlock(dict_t *dict, uuid_t uuid);
void
gd_mgmt_v3_unlock_timer_cbk(void *data);
diff --git a/xlators/mgmt/glusterd/src/glusterd-mem-types.h b/xlators/mgmt/glusterd/src/glusterd-mem-types.h
index 33aac2f3dc8..210d0f8658c 100644
--- a/xlators/mgmt/glusterd/src/glusterd-mem-types.h
+++ b/xlators/mgmt/glusterd/src/glusterd-mem-types.h
@@ -14,65 +14,64 @@
#include "mem-types.h"
typedef enum gf_gld_mem_types_ {
- gf_gld_mt_dir_entry_t = gf_common_mt_end + 1,
- gf_gld_mt_volfile_ctx = gf_common_mt_end + 2,
- gf_gld_mt_glusterd_state_t = gf_common_mt_end + 3,
- gf_gld_mt_glusterd_conf_t = gf_common_mt_end + 4,
- gf_gld_mt_locker = gf_common_mt_end + 5,
- gf_gld_mt_string = gf_common_mt_end + 6,
- gf_gld_mt_lock_table = gf_common_mt_end + 7,
- gf_gld_mt_char = gf_common_mt_end + 8,
- gf_gld_mt_glusterd_connection_t = gf_common_mt_end + 9,
- gf_gld_mt_resolve_comp = gf_common_mt_end + 10,
- gf_gld_mt_peerinfo_t = gf_common_mt_end + 11,
- gf_gld_mt_friend_sm_event_t = gf_common_mt_end + 12,
- gf_gld_mt_friend_req_ctx_t = gf_common_mt_end + 13,
- gf_gld_mt_friend_update_ctx_t = gf_common_mt_end + 14,
- gf_gld_mt_op_sm_event_t = gf_common_mt_end + 15,
- gf_gld_mt_op_lock_ctx_t = gf_common_mt_end + 16,
- gf_gld_mt_op_stage_ctx_t = gf_common_mt_end + 17,
- gf_gld_mt_op_commit_ctx_t = gf_common_mt_end + 18,
- gf_gld_mt_mop_stage_req_t = gf_common_mt_end + 19,
- gf_gld_mt_probe_ctx_t = gf_common_mt_end + 20,
- gf_gld_mt_create_volume_ctx_t = gf_common_mt_end + 21,
- gf_gld_mt_start_volume_ctx_t = gf_common_mt_end + 22,
- gf_gld_mt_stop_volume_ctx_t = gf_common_mt_end + 23,
- gf_gld_mt_delete_volume_ctx_t = gf_common_mt_end + 24,
- gf_gld_mt_glusterd_volinfo_t = gf_common_mt_end + 25,
- gf_gld_mt_glusterd_brickinfo_t = gf_common_mt_end + 26,
- gf_gld_mt_peer_hostname_t = gf_common_mt_end + 27,
- gf_gld_mt_ifreq = gf_common_mt_end + 28,
- gf_gld_mt_store_handle_t = gf_common_mt_end + 29,
- gf_gld_mt_store_iter_t = gf_common_mt_end + 30,
- gf_gld_mt_defrag_info = gf_common_mt_end + 31,
- gf_gld_mt_log_filename_ctx_t = gf_common_mt_end + 32,
- gf_gld_mt_log_locate_ctx_t = gf_common_mt_end + 33,
- gf_gld_mt_log_rotate_ctx_t = gf_common_mt_end + 34,
- gf_gld_mt_peerctx_t = gf_common_mt_end + 35,
- gf_gld_mt_sm_tr_log_t = gf_common_mt_end + 36,
- gf_gld_mt_pending_node_t = gf_common_mt_end + 37,
- gf_gld_mt_brick_rsp_ctx_t = gf_common_mt_end + 38,
- gf_gld_mt_mop_brick_req_t = gf_common_mt_end + 39,
- gf_gld_mt_op_allack_ctx_t = gf_common_mt_end + 40,
- gf_gld_mt_linearr = gf_common_mt_end + 41,
- gf_gld_mt_linebuf = gf_common_mt_end + 42,
- gf_gld_mt_mount_pattern = gf_common_mt_end + 43,
- gf_gld_mt_mount_comp_container = gf_common_mt_end + 44,
- gf_gld_mt_mount_component = gf_common_mt_end + 45,
- gf_gld_mt_mount_spec = gf_common_mt_end + 46,
- gf_gld_mt_georep_meet_spec = gf_common_mt_end + 47,
- gf_gld_mt_nodesrv_t = gf_common_mt_end + 48,
- gf_gld_mt_charptr = gf_common_mt_end + 49,
- gf_gld_mt_hooks_stub_t = gf_common_mt_end + 50,
- gf_gld_mt_hooks_priv_t = gf_common_mt_end + 51,
- gf_gld_mt_mop_commit_req_t = gf_common_mt_end + 52,
- gf_gld_mt_int = gf_common_mt_end + 53,
- gf_gld_mt_snap_t = gf_common_mt_end + 54,
- gf_gld_mt_missed_snapinfo_t = gf_common_mt_end + 55,
- gf_gld_mt_snap_create_args_t = gf_common_mt_end + 56,
- gf_gld_mt_local_peers_t = gf_common_mt_end + 57,
- gf_gld_mt_glusterd_brick_proc_t = gf_common_mt_end + 58,
- gf_gld_mt_end = gf_common_mt_end + 59,
+ gf_gld_mt_dir_entry_t = gf_common_mt_end + 1,
+ gf_gld_mt_volfile_ctx = gf_common_mt_end + 2,
+ gf_gld_mt_glusterd_state_t = gf_common_mt_end + 3,
+ gf_gld_mt_glusterd_conf_t = gf_common_mt_end + 4,
+ gf_gld_mt_locker = gf_common_mt_end + 5,
+ gf_gld_mt_string = gf_common_mt_end + 6,
+ gf_gld_mt_lock_table = gf_common_mt_end + 7,
+ gf_gld_mt_char = gf_common_mt_end + 8,
+ gf_gld_mt_glusterd_connection_t = gf_common_mt_end + 9,
+ gf_gld_mt_resolve_comp = gf_common_mt_end + 10,
+ gf_gld_mt_peerinfo_t = gf_common_mt_end + 11,
+ gf_gld_mt_friend_sm_event_t = gf_common_mt_end + 12,
+ gf_gld_mt_friend_req_ctx_t = gf_common_mt_end + 13,
+ gf_gld_mt_friend_update_ctx_t = gf_common_mt_end + 14,
+ gf_gld_mt_op_sm_event_t = gf_common_mt_end + 15,
+ gf_gld_mt_op_lock_ctx_t = gf_common_mt_end + 16,
+ gf_gld_mt_op_stage_ctx_t = gf_common_mt_end + 17,
+ gf_gld_mt_op_commit_ctx_t = gf_common_mt_end + 18,
+ gf_gld_mt_mop_stage_req_t = gf_common_mt_end + 19,
+ gf_gld_mt_probe_ctx_t = gf_common_mt_end + 20,
+ gf_gld_mt_create_volume_ctx_t = gf_common_mt_end + 21,
+ gf_gld_mt_start_volume_ctx_t = gf_common_mt_end + 22,
+ gf_gld_mt_stop_volume_ctx_t = gf_common_mt_end + 23,
+ gf_gld_mt_delete_volume_ctx_t = gf_common_mt_end + 24,
+ gf_gld_mt_glusterd_volinfo_t = gf_common_mt_end + 25,
+ gf_gld_mt_glusterd_brickinfo_t = gf_common_mt_end + 26,
+ gf_gld_mt_peer_hostname_t = gf_common_mt_end + 27,
+ gf_gld_mt_ifreq = gf_common_mt_end + 28,
+ gf_gld_mt_store_handle_t = gf_common_mt_end + 29,
+ gf_gld_mt_store_iter_t = gf_common_mt_end + 30,
+ gf_gld_mt_defrag_info = gf_common_mt_end + 31,
+ gf_gld_mt_log_filename_ctx_t = gf_common_mt_end + 32,
+ gf_gld_mt_log_locate_ctx_t = gf_common_mt_end + 33,
+ gf_gld_mt_log_rotate_ctx_t = gf_common_mt_end + 34,
+ gf_gld_mt_peerctx_t = gf_common_mt_end + 35,
+ gf_gld_mt_sm_tr_log_t = gf_common_mt_end + 36,
+ gf_gld_mt_pending_node_t = gf_common_mt_end + 37,
+ gf_gld_mt_brick_rsp_ctx_t = gf_common_mt_end + 38,
+ gf_gld_mt_mop_brick_req_t = gf_common_mt_end + 39,
+ gf_gld_mt_op_allack_ctx_t = gf_common_mt_end + 40,
+ gf_gld_mt_linearr = gf_common_mt_end + 41,
+ gf_gld_mt_linebuf = gf_common_mt_end + 42,
+ gf_gld_mt_mount_pattern = gf_common_mt_end + 43,
+ gf_gld_mt_mount_comp_container = gf_common_mt_end + 44,
+ gf_gld_mt_mount_component = gf_common_mt_end + 45,
+ gf_gld_mt_mount_spec = gf_common_mt_end + 46,
+ gf_gld_mt_georep_meet_spec = gf_common_mt_end + 47,
+ gf_gld_mt_nodesrv_t = gf_common_mt_end + 48,
+ gf_gld_mt_charptr = gf_common_mt_end + 49,
+ gf_gld_mt_hooks_stub_t = gf_common_mt_end + 50,
+ gf_gld_mt_hooks_priv_t = gf_common_mt_end + 51,
+ gf_gld_mt_mop_commit_req_t = gf_common_mt_end + 52,
+ gf_gld_mt_int = gf_common_mt_end + 53,
+ gf_gld_mt_snap_t = gf_common_mt_end + 54,
+ gf_gld_mt_missed_snapinfo_t = gf_common_mt_end + 55,
+ gf_gld_mt_snap_create_args_t = gf_common_mt_end + 56,
+ gf_gld_mt_local_peers_t = gf_common_mt_end + 57,
+ gf_gld_mt_glusterd_brick_proc_t = gf_common_mt_end + 58,
+ gf_gld_mt_end = gf_common_mt_end + 59,
} gf_gld_mem_types_t;
#endif
-
diff --git a/xlators/mgmt/glusterd/src/glusterd-messages.h b/xlators/mgmt/glusterd/src/glusterd-messages.h
index 29b97570630..41fedf9e288 100644
--- a/xlators/mgmt/glusterd/src/glusterd-messages.h
+++ b/xlators/mgmt/glusterd/src/glusterd-messages.h
@@ -23,621 +23,281 @@
* glfs-message-id.h.
*/
-GLFS_MSGID(GLUSTERD,
- GD_MSG_SERVER_QUORUM_NOT_MET,
- GD_MSG_SERVER_QUORUM_LOST_STOPPING_BRICKS,
- GD_MSG_SERVER_QUORUM_MET_STARTING_BRICKS,
- GD_MSG_PEER_DISCONNECTED,
- GD_MSG_BRICK_DISCONNECTED,
- GD_MSG_NODE_DISCONNECTED,
- GD_MSG_REBALANCE_DISCONNECTED,
- GD_MSG_VOL_CLEANUP_FAIL,
- GD_MSG_VOL_VERS_MISMATCH,
- GD_MSG_CKSUM_VERS_MISMATCH,
- GD_MSG_QUOTA_CONFIG_VERS_MISMATCH,
- GD_MSG_QUOTA_CONFIG_CKSUM_MISMATCH,
- GD_MSG_BRICK_STOP_FAIL,
- GD_MSG_SVC_KILL_FAIL,
- GD_MSG_PID_KILL_FAIL,
- GD_MSG_REBAL_NO_SOCK_FILE,
- GD_MSG_UNIX_OP_BUILD_FAIL,
- GD_MSG_RPC_CREATE_FAIL,
- GD_MSG_FAIL_DEFAULT_OPT_SET,
- GD_MSG_CLUSTER_UNLOCK_FAILED,
- GD_MSG_NO_MEMORY,
- GD_MSG_UNSUPPORTED_VERSION,
- GD_MSG_COMMAND_NOT_FOUND,
- GD_MSG_SNAPSHOT_OP_FAILED,
- GD_MSG_INVALID_ENTRY,
- GD_MSG_VOL_NOT_FOUND,
- GD_MSG_REG_COMPILE_FAILED,
- GD_MSG_FILE_OP_FAILED,
- GD_MSG_SNAP_CREATION_FAIL,
- GD_MSG_VOL_OP_FAILED,
- GD_MSG_CREATE_DIR_FAILED,
- GD_MSG_DIR_OP_FAILED,
- GD_MSG_VOL_STOP_FAILED,
- GD_MSG_NO_CLI_RESP,
- GD_MSG_LOCK_INIT_FAILED,
- GD_MSG_SNAP_LIST_GET_FAIL,
- GD_MSG_UNOUNT_FAILED,
- GD_MSG_LOCK_DESTROY_FAILED,
- GD_MSG_SNAP_CLEANUP_FAIL,
- GD_MSG_SNAP_ACTIVATE_FAIL,
- GD_MSG_SNAP_DEACTIVATE_FAIL,
- GD_MSG_SNAP_RESTORE_FAIL,
- GD_MSG_SNAP_REMOVE_FAIL,
- GD_MSG_SNAP_CONFIG_FAIL,
- GD_MSG_SNAP_STATUS_FAIL,
- GD_MSG_SNAP_INIT_FAIL,
- GD_MSG_VOLINFO_SET_FAIL,
- GD_MSG_VOLINFO_GET_FAIL,
- GD_MSG_BRICK_CREATION_FAIL,
- GD_MSG_BRICK_GET_INFO_FAIL,
- GD_MSG_BRICK_NEW_INFO_FAIL,
- GD_MSG_LVS_FAIL,
- GD_MSG_SETXATTR_FAIL,
- GD_MSG_UMOUNTING_SNAP_BRICK,
- GD_MSG_OP_UNSUPPORTED,
- GD_MSG_SNAP_NOT_FOUND,
- GD_MSG_FS_LABEL_UPDATE_FAIL,
- GD_MSG_LVM_MOUNT_FAILED,
- GD_MSG_DICT_SET_FAILED,
- GD_MSG_CANONICALIZE_FAIL,
- GD_MSG_DICT_GET_FAILED,
- GD_MSG_SNAP_INFO_FAIL,
- GD_MSG_SNAP_VOL_CONFIG_FAIL,
- GD_MSG_SNAP_OBJECT_STORE_FAIL,
- GD_MSG_DICT_UNSERIALIZE_FAIL,
- GD_MSG_SNAP_RESTORE_REVERT_FAIL,
- GD_MSG_SNAP_LIST_SET_FAIL,
- GD_MSG_VOLFILE_CREATE_FAIL,
- GD_MSG_VOLINFO_REMOVE_FAIL,
- GD_MSG_VOL_DELETE_FAIL,
- GD_MSG_SNAPSHOT_PENDING,
- GD_MSG_BRICK_PATH_UNMOUNTED,
- GD_MSG_BRICK_ADD_FAIL,
- GD_MSG_BRICK_SET_INFO_FAIL,
- GD_MSG_LVCREATE_FAIL,
- GD_MSG_VG_GET_FAIL,
- GD_MSG_TPOOL_GET_FAIL,
- GD_MSG_LVM_REMOVE_FAILED,
- GD_MSG_MISSEDSNAP_INFO_SET_FAIL,
- GD_MSG_BRK_MOUNTOPTS_FAIL,
- GD_MSG_MISSED_SNAP_LIST_STORE_FAIL,
- GD_MSG_INVALID_MISSED_SNAP_ENTRY,
- GD_MSG_MISSED_SNAP_GET_FAIL,
- GD_MSG_MISSED_SNAP_CREATE_FAIL,
- GD_MSG_DUP_ENTRY,
- GD_MSG_MISSED_SNAP_STATUS_DONE,
- GD_MSG_NO_EXEC_PERMS,
- GD_MSG_GLOBAL_OP_VERSION_SET_FAIL,
- GD_MSG_HARD_LIMIT_SET_FAIL,
- GD_MSG_OP_SUCCESS,
- GD_MSG_STORE_FAIL,
- GD_MSG_GLOBAL_OP_VERSION_GET_FAIL,
- GD_MSG_GEOREP_GET_FAILED,
- GD_MSG_GLUSTERD_UMOUNT_FAIL,
- GD_MSG_QUORUM_CHECK_FAIL,
- GD_MSG_QUORUM_COUNT_IGNORED,
- GD_MSG_SNAP_MOUNT_FAIL,
- GD_MSG_RSP_DICT_USE_FAIL,
- GD_MSG_SNAP_IMPORT_FAIL,
- GD_MSG_SNAP_CONFLICT,
- GD_MSG_MISSED_SNAP_DELETE,
- GD_MSG_QUOTA_CONFIG_IMPORT_FAIL,
- GD_MSG_SNAPDIR_CREATE_FAIL,
- GD_MSG_MISSED_SNAP_PRESENT,
- GD_MSG_UUID_NULL,
- GD_MSG_TSTAMP_SET_FAIL,
- GD_MSG_RESP_AGGR_FAIL,
- GD_MSG_DICT_EMPTY,
- GD_MSG_DICT_CREATE_FAIL,
- GD_MSG_SNAPD_STOP_FAIL,
- GD_MSG_SOFT_LIMIT_REACHED,
- GD_MSG_SNAPD_START_FAIL,
- GD_MSG_SNAPD_CREATE_FAIL,
- GD_MSG_SNAPD_INIT_FAIL,
- GD_MSG_MGMTV3_OP_FAIL,
- GD_MSG_MGMTV3_PAYLOAD_BUILD_FAIL,
- GD_MSG_MGMTV3_UNLOCK_FAIL,
- GD_MSG_MGMTV3_LOCK_GET_FAIL,
- GD_MSG_MGMTV3_LOCKDOWN_FAIL,
- GD_MSG_POST_VALIDATION_FAIL,
- GD_MSG_PRE_VALIDATION_FAIL,
- GD_MSG_COMMIT_OP_FAIL,
- GD_MSG_PEER_LIST_CREATE_FAIL,
- GD_MSG_BRICK_OP_FAIL,
- GD_MSG_OPINFO_SET_FAIL,
- GD_MSG_OP_EVENT_UNLOCK_FAIL,
- GD_MSG_MGMTV3_OP_RESP_FAIL,
- GD_MSG_PEER_NOT_FOUND,
- GD_MSG_REQ_DECODE_FAIL,
- GD_MSG_DICT_SERL_LENGTH_GET_FAIL,
- GD_MSG_ALREADY_STOPPED,
- GD_MSG_PRE_VALD_RESP_FAIL,
- GD_MSG_SVC_GET_FAIL,
- GD_MSG_VOLFILE_NOT_FOUND,
- GD_MSG_OP_EVENT_LOCK_FAIL,
- GD_MSG_NON_STRIPE_VOL,
- GD_MSG_SNAPD_OBJ_GET_FAIL,
- GD_MSG_QUOTA_DISABLED,
- GD_MSG_CACHE_MINMAX_SIZE_INVALID,
- GD_MSG_QUOTA_GET_STAT_FAIL,
- GD_MSG_SUBVOLUMES_EXCEED,
- GD_MSG_BRICK_ADD,
- GD_MSG_BRICK_REMOVE,
- GD_MSG_CREATE_KEY_FAIL,
- GD_MSG_MULTIPLE_LOCK_ACQUIRE_FAIL,
- GD_MSG_MULTIPLE_LOCK_RELEASE_FAIL,
- GD_MSG_RESP_FROM_UNKNOWN_PEER,
- GD_MSG_BRICK_MOUNDIRS_AGGR_FAIL,
- GD_MSG_GFID_VALIDATE_SET_FAIL,
- GD_MSG_PEER_LOCK_FAIL,
- GD_MSG_PEER_UNLOCK_FAIL,
- GD_MSG_MGMT_OP_FAIL,
- GD_MSG_TRANS_OPINFO_CLEAR_FAIL,
- GD_MSG_GLUSTERD_LOCK_FAIL,
- GD_MSG_TRANS_OPINFO_SET_FAIL,
- GD_MSG_TRANS_IDGEN_FAIL,
- GD_MSG_RPC_FAILURE,
- GD_MSG_OP_VERS_ADJUST_FAIL,
- GD_MSG_SNAP_DEVICE_NAME_GET_FAIL,
- GD_MSG_SNAP_STATUS_NOT_PENDING,
- GD_MSG_MGMT_PGM_SET_FAIL,
- GD_MSG_EVENT_INJECT_FAIL,
- GD_MSG_VERS_INFO,
- GD_MSG_VOL_INFO_REQ_RECVD,
- GD_MSG_VERS_GET_FAIL,
- GD_MSG_EVENT_NEW_GET_FAIL,
- GD_MSG_RPC_LAYER_ERROR,
- GD_MSG_NO_HANDSHAKE_ACK,
- GD_MSG_OP_VERSION_MISMATCH,
- GD_MSG_HANDSHAKE_REQ_REJECTED,
- GD_MSG_UNKNOWN_MODE,
- GD_MSG_DEFRAG_STATUS_UPDATED,
- GD_MSG_NO_FLAG_SET,
- GD_MSG_VERSION_UNSUPPORTED,
- GD_MSG_UUID_SET_FAIL,
- GD_MSG_MOUNT_REQ_FAIL,
- GD_MSG_GLUSTERD_GLOBAL_INFO_STORE_FAIL,
- GD_MSG_OP_VERS_STORE_FAIL,
- GD_MSG_SNAP_AUTOMIC_UPDATE_FAIL,
- GD_MSG_SNAPINFO_WRITE_FAIL,
- GD_MSG_SNAPINFO_CREATE_FAIL,
- GD_MSG_SNAPD_INFO_STORE_FAIL,
- GD_MSG_BRK_MNTPATH_MOUNT_FAIL,
- GD_MSG_BRK_MNTPATH_GET_FAIL,
- GD_MSG_SNAP_BRK_MNT_RECREATE_FAIL,
- GD_MSG_SNAP_RESOLVE_BRICK_FAIL,
- GD_MSG_RESOLVE_BRICK_FAIL,
- GD_MSG_BRK_MNT_RECREATE_FAIL,
- GD_MSG_TMP_FILE_UNLINK_FAIL,
- GD_MSG_VOL_VALS_WRITE_FAIL,
- GD_MSG_STORE_HANDLE_GET_FAIL,
- GD_MSG_STORE_HANDLE_WRITE_FAIL,
- GD_MSG_MISSED_SNAP_LIST_STORE_HANDLE_GET_FAIL,
- GD_MSG_MISSED_SNAP_LIST_EMPTY,
- GD_MSG_SNAP_VOL_RETRIEVE_FAIL,
- GD_MSG_SNAPSHOT_UPDATE_FAIL,
- GD_MSG_SNAPD_PORT_STORE_FAIL,
- GD_MSG_CKSUM_STORE_FAIL,
- GD_MSG_STORE_HANDLE_CREATE_FAIL,
- GD_MSG_HANDLE_NULL,
- GD_MSG_VOL_RESTORE_FAIL,
- GD_MSG_NAME_TOO_LONG,
- GD_MSG_UUID_PARSE_FAIL,
- GD_MSG_UNKNOWN_KEY,
- GD_MSG_STORE_ITER_DESTROY_FAIL,
- GD_MSG_STORE_ITER_GET_FAIL,
- GD_MSG_VOLINFO_UPDATE_FAIL,
- GD_MSG_PARSE_BRICKINFO_FAIL,
- GD_MSG_VERS_STORE_FAIL,
- GD_MSG_HEADER_ADD_FAIL,
- GD_MSG_QUOTA_CONF_WRITE_FAIL,
- GD_MSG_QUOTA_CONF_CORRUPT,
- GD_MSG_FORK_FAIL,
- GD_MSG_CKSUM_COMPUTE_FAIL,
- GD_MSG_VERS_CKSUM_STORE_FAIL,
- GD_MSG_GETXATTR_FAIL,
- GD_MSG_CONVERSION_FAILED,
- GD_MSG_VOL_NOT_DISTRIBUTE,
- GD_MSG_VOL_STOPPED,
- GD_MSG_OPCTX_GET_FAIL,
- GD_MSG_TASKID_GEN_FAIL,
- GD_MSG_REBALANCE_ID_MISSING,
- GD_MSG_NO_REBALANCE_PFX_IN_VOLNAME,
- GD_MSG_DEFRAG_STATUS_UPDATE_FAIL,
- GD_MSG_UUID_GEN_STORE_FAIL,
- GD_MSG_UUID_STORE_FAIL,
- GD_MSG_NO_INIT,
- GD_MSG_MODULE_NOT_INSTALLED,
- GD_MSG_MODULE_NOT_WORKING,
- GD_MSG_WRITE_ACCESS_GRANT_FAIL,
- GD_MSG_DIRPATH_TOO_LONG,
- GD_MSG_LOGGROUP_INVALID,
- GD_MSG_DIR_PERM_LIBERAL,
- GD_MSG_DIR_PERM_STRICT,
- GD_MSG_MOUNT_SPEC_INSTALL_FAIL,
- GD_MSG_GLUSTERD_SOCK_LISTENER_START_FAIL,
- GD_MSG_DIR_NOT_FOUND,
- GD_MSG_FAILED_INIT_SHDSVC,
- GD_MSG_FAILED_INIT_NFSSVC,
- GD_MSG_FAILED_INIT_QUOTASVC,
- GD_MSG_RPC_INIT_FAIL,
- GD_MSG_RPCSVC_REG_NOTIFY_RETURNED,
- GD_MSG_RPC_TRANSPORT_COUNT_GET_FAIL,
- GD_MSG_RPC_LISTENER_CREATE_FAIL,
- GD_MSG_OP_VERS_RESTORE_FAIL,
- GD_MSG_SELF_HEALD_DISABLED,
- GD_MSG_PRIV_NULL,
- GD_MSG_GSYNC_VALIDATION_FAIL,
- GD_MSG_SLAVE_CONFPATH_DETAILS_FETCH_FAIL,
- GD_MSG_OP_NOT_PERMITTED_AC_REQD,
- GD_MSG_OP_NOT_PERMITTED,
- GD_MSG_REBALANCE_START_FAIL,
- GD_MSG_NFS_RECONF_FAIL,
- GD_MSG_REMOVE_BRICK_ID_SET_FAIL,
- GD_MSG_BRICK_MOUNTDIR_GET_FAIL,
- GD_MSG_BRICK_NOT_FOUND,
- GD_MSG_BRKPATH_TOO_LONG,
- GD_MSG_CLRLOCKS_CLNT_UMOUNT_FAIL,
- GD_MSG_CLRLOCKS_CLNT_MOUNT_FAIL,
- GD_MSG_CLRLOCKS_MOUNTDIR_CREATE_FAIL,
- GD_MSG_BRK_PORT_NUM_GET_FAIL,
- GD_MSG_BRK_STATEDUMP_FAIL,
- GD_MSG_VOL_GRAPH_CHANGE_NOTIFY_FAIL,
- GD_MSG_INVALID_VG,
- GD_MSG_GLUSTERD_OP_FAILED,
- GD_MSG_HOSTNAME_ADD_TO_PEERLIST_FAIL,
- GD_MSG_STALE_PEERINFO_REMOVE_FAIL,
- GD_MSG_TRANS_ID_GET_FAIL,
- GD_MSG_RES_DECODE_FAIL,
- GD_MSG_VOL_ALREADY_EXIST,
- GD_MSG_BAD_BRKORDER,
- GD_MSG_BAD_BRKORDER_CHECK_FAIL,
- GD_MSG_BRICK_SELECT_FAIL,
- GD_MSG_NO_LOCK_RESP_FROM_PEER,
- GD_MSG_MGMTV3_LOCK_FROM_UUID_REJCT,
- GD_MSG_STAGE_FROM_UUID_REJCT,
- GD_MSG_UNLOCK_FROM_UUID_REJCT,
- GD_MSG_MGMTV3_UNLOCK_FROM_UUID_REJCT,
- GD_MSG_COMMIT_FROM_UUID_REJCT,
- GD_MSG_VOL_NOT_STARTED,
- GD_MSG_VOL_NOT_REPLICA,
- GD_MSG_VOL_NOT_DISPERSE,
- GD_MSG_OLD_REMOVE_BRICK_EXISTS,
- GD_MSG_USE_THE_FORCE,
- GD_MSG_OIP,
- GD_MSG_OIP_RETRY_LATER,
- GD_MSG_GSYNC_RESTART_FAIL,
- GD_MSG_LOCK_FROM_UUID_REJCT,
- GD_MSG_BRICK_OP_PAYLOAD_BUILD_FAIL,
- GD_MSG_HOSTNAME_RESOLVE_FAIL,
- GD_MSG_COUNT_VALIDATE_FAILED,
- GD_MSG_SPAWNING_CHILD_FAILED,
- GD_MSG_READ_CHILD_DATA_FAILED,
- GD_MSG_DEFAULT_TEMP_CONFIG,
- GD_MSG_PIDFILE_CREATE_FAILED,
- GD_MSG_GSYNCD_SPAWN_FAILED,
- GD_MSG_SUBOP_NOT_FOUND,
- GD_MSG_RESERVED_OPTION,
- GD_MSG_GLUSTERD_PRIV_NOT_FOUND,
- GD_MSG_SLAVEINFO_FETCH_ERROR,
- GD_MSG_VALIDATE_FAILED,
- GD_MSG_INVOKE_ERROR,
- GD_MSG_SESSION_CREATE_ERROR,
- GD_MSG_STOP_FORCE,
- GD_MSG_GET_CONFIG_INFO_FAILED,
- GD_MSG_STAT_FILE_READ_FAILED,
- GD_MSG_CONF_PATH_ASSIGN_FAILED,
- GD_MSG_SESSION_INACTIVE,
- GD_MSG_PIDFILE_NOT_FOUND,
- GD_MSG_PEER_CMD_ERROR,
- GD_MSG_SRC_FILE_ERROR,
- GD_MSG_GET_STATEFILE_NAME_FAILED,
- GD_MSG_STATUS_NULL,
- GD_MSG_STATUSFILE_CREATE_FAILED,
- GD_MSG_SLAVE_URL_INVALID,
- GD_MSG_INVALID_SLAVE,
- GD_MSG_READ_ERROR,
- GD_MSG_ARG_FETCH_ERROR,
- GD_MSG_REG_FILE_MISSING,
- GD_MSG_STATEFILE_NAME_NOT_FOUND,
- GD_MSG_GEO_REP_START_FAILED,
- GD_MSG_GSYNCD_ERROR,
- GD_MSG_UPDATE_STATEFILE_FAILED,
- GD_MSG_STATUS_UPDATE_FAILED,
- GD_MSG_GSYNCD_OP_SET_FAILED,
- GD_MSG_BUFFER_EMPTY,
- GD_MSG_CONFIG_INFO,
- GD_MSG_FETCH_CONFIG_VAL_FAILED,
- GD_MSG_GSYNCD_PARSE_ERROR,
- GD_MSG_SESSION_ALREADY_EXIST,
- GD_MSG_FORCE_CREATE_SESSION,
- GD_MSG_GET_KEY_FAILED,
- GD_MSG_SESSION_DEL_FAILED,
- GD_MSG_CMD_EXEC_FAIL,
- GD_MSG_STRDUP_FAILED,
- GD_MSG_UNABLE_TO_END,
- GD_MSG_PAUSE_FAILED,
- GD_MSG_NORMALIZE_URL_FAIL,
- GD_MSG_MODULE_ERROR,
- GD_MSG_SLAVEINFO_STORE_ERROR,
- GD_MSG_MARKER_START_FAIL,
- GD_MSG_RESUME_FAILED,
- GD_MSG_GLUSTERFS_START_FAIL,
- GD_MSG_GLUSTERFS_STOP_FAIL,
- GD_MSG_RBOP_STATE_STORE_FAIL,
- GD_MSG_PUMP_XLATOR_DISABLED,
- GD_MSG_ABORT_OP_FAIL,
- GD_MSG_PAUSE_OP_FAIL,
- GD_MSG_GLUSTER_SERVICE_START_FAIL,
- GD_MSG_HANDSHAKE_FAILED,
- GD_MSG_CLI_REQ_EMPTY,
- GD_MSG_PEER_ADD_FAIL,
- GD_MSG_SYNC_FROM_LOCALHOST_UNALLOWED,
- GD_MSG_UUIDS_SAME_RETRY,
- GD_MSG_TSP_ALREADY_FORMED,
- GD_MSG_VOLS_ALREADY_PRESENT,
- GD_MSG_REQ_CTX_CREATE_FAIL,
- GD_MSG_PEER_INFO_UPDATE_FAIL,
- GD_MSG_PEERINFO_CREATE_FAIL,
- GD_MSG_REQ_FROM_UNKNOWN_PEER,
- GD_MSG_STATUS_REPLY_STRING_CREATE_FAIL,
- GD_MSG_TOKENIZE_FAIL,
- GD_MSG_LAZY_UMOUNT_FAIL,
- GD_MSG_NFS_SERVER_START_FAIL,
- GD_MSG_GLUSTER_SERVICES_STOP_FAIL,
- GD_MSG_BRK_CLEANUP_FAIL,
- GD_MSG_RB_ALREADY_STARTED,
- GD_MSG_RB_BRICKINFO_GET_FAIL,
- GD_MSG_BAD_FORMAT,
- GD_MSG_RB_CMD_FAIL,
- GD_MSG_RB_NOT_STARTED_OR_PAUSED,
- GD_MSG_RB_NOT_STARTED,
- GD_MSG_RB_PAUSED_ALREADY,
- GD_MSG_NO_FREE_PORTS,
- GD_MSG_EVENT_STATE_TRANSITION_FAIL,
- GD_MSG_HANDLER_RETURNED,
- GD_MSG_SNAP_COMPARE_CONFLICT,
- GD_MSG_PEER_DETACH_CLEANUP_FAIL,
- GD_MSG_STALE_VOL_REMOVE_FAIL,
- GD_MSG_AC_ERROR,
- GD_MSG_LOCK_FAIL,
- GD_MSG_MGMTV3_LOCK_REQ_SEND_FAIL,
- GD_MSG_GLUSTERD_UNLOCK_FAIL,
- GD_MSG_RBOP_START_FAIL,
- GD_MSG_UNKNOWN_RESPONSE,
- GD_MSG_COMMIT_REQ_SEND_FAIL,
- GD_MSG_OPCTX_UPDATE_FAIL,
- GD_MSG_OPCTX_NULL,
- GD_MSG_DICT_COPY_FAIL,
- GD_MSG_SHD_STATUS_SET_FAIL,
- GD_MSG_REPLICA_INDEX_GET_FAIL,
- GD_MSG_NFS_SERVER_NOT_RUNNING,
- GD_MSG_STAGE_REQ_SEND_FAIL,
- GD_MSG_LOCK_REQ_SEND_FAIL,
- GD_MSG_VOLNAMES_GET_FAIL,
- GD_MSG_NO_TASK_ID,
- GD_MSG_ADD_REMOVE_BRICK_FAIL,
- GD_MSG_SVC_RESTART_FAIL,
- GD_MSG_VOL_SET_FAIL,
- GD_MSG_QUOTAD_NOT_RUNNING,
- GD_MSG_XLATOR_COUNT_GET_FAIL,
- GD_MSG_TRANS_OPINFO_GET_FAIL,
- GD_MSG_TRANS_ID_INVALID,
- GD_MSG_NO_OPTIONS_GIVEN,
- GD_MSG_SNAPD_NOT_RUNNING,
- GD_MSG_ADD_ADDRESS_TO_PEER_FAIL,
- GD_MSG_PEER_ADDRESS_GET_FAIL,
- GD_MSG_GETADDRINFO_FAIL,
- GD_MSG_PEERINFO_DELETE_FAIL,
- GD_MSG_KEY_NULL,
- GD_MSG_SPAWN_SVCS_FAIL,
- GD_MSG_DICT_ITER_FAIL,
- GD_MSG_TASK_STATUS_UPDATE_FAIL,
- GD_MSG_VOL_ID_MISMATCH,
- GD_MSG_STR_TO_BOOL_FAIL,
- GD_MSG_RB_MNT_BRICKS_MISMATCH,
- GD_MSG_RB_SRC_BRICKS_MISMATCH,
- GD_MSG_MNTENTRY_GET_FAIL,
- GD_MSG_INODE_SIZE_GET_FAIL,
- GD_MSG_NO_STATEFILE_ENTRY,
- GD_MSG_PMAP_UNSET_FAIL,
- GD_MSG_GLOBAL_OPT_IMPORT_FAIL,
- GD_MSD_BRICK_DISCONNECT_FAIL,
- GD_MSG_SNAP_DETAILS_IMPORT_FAIL,
- GD_MSG_BRICKINFO_CREATE_FAIL,
- GD_MSG_QUOTA_CKSUM_VER_STORE_FAIL,
- GD_MSG_CKSUM_GET_FAIL,
- GD_MSG_BRICKPATH_ROOT_GET_FAIL,
- GD_MSG_HOSTNAME_TO_UUID_FAIL,
- GD_MSG_REPLY_SUBMIT_FAIL,
- GD_MSG_SERIALIZE_MSG_FAIL,
- GD_MSG_ENCODE_FAIL,
- GD_MSG_RB_DST_BRICKS_MISMATCH,
- GD_MSG_XLATOR_VOLOPT_DYNLOAD_ERROR,
- GD_MSG_VOLNAME_NOTFOUND_IN_DICT,
- GD_MSG_FLAGS_NOTFOUND_IN_DICT,
- GD_MSG_HOSTNAME_NOTFOUND_IN_DICT,
- GD_MSG_PORT_NOTFOUND_IN_DICT,
- GD_MSG_CMDSTR_NOTFOUND_IN_DICT,
- GD_MSG_SNAP_OBJ_NEW_FAIL,
- GD_MSG_SNAP_BACKEND_MAKE_FAIL,
- GD_MSG_SNAP_CLONE_FAILED,
- GD_MSG_SNAP_CLONE_PREVAL_FAILED,
- GD_MSG_SNAP_CLONE_POSTVAL_FAILED,
- GD_MSG_VOLINFO_STORE_FAIL,
- GD_MSG_NEW_FRIEND_SM_EVENT_GET_FAIL,
- GD_MSG_VOL_TYPE_CHANGING_INFO,
- GD_MSG_BRKPATH_MNTPNT_MISMATCH,
- GD_MSG_TASKS_COUNT_MISMATCH,
- GD_MSG_WRONG_OPTS_SETTING,
- GD_MSG_PATH_ALREADY_PART_OF_VOL,
- GD_MSG_BRICK_VALIDATE_FAIL,
- GD_MSG_READIN_FILE_FAILED,
- GD_MSG_IMPORT_PRDICT_DICT,
- GD_MSG_VOL_OPTS_IMPORT_FAIL,
- GD_MSG_BRICK_IMPORT_FAIL,
- GD_MSG_VOLINFO_IMPORT_FAIL,
- GD_MSG_BRICK_ID_GEN_FAILED,
- GD_MSG_GET_STATUS_DATA_FAIL,
- GD_MSG_BITROT_NOT_RUNNING,
- GD_MSG_SCRUBBER_NOT_RUNNING,
- GD_MSG_SRC_BRICK_PORT_UNAVAIL,
- GD_MSG_BITD_INIT_FAIL,
- GD_MSG_SCRUB_INIT_FAIL,
- GD_MSG_VAR_RUN_DIR_INIT_FAIL,
- GD_MSG_VAR_RUN_DIR_FIND_FAIL,
- GD_MSG_SCRUBSVC_RECONF_FAIL,
- GD_MSG_BITDSVC_RECONF_FAIL,
- GD_MSG_NFS_GNS_START_FAIL,
- GD_MSG_NFS_GNS_SETUP_FAIL,
- GD_MSG_UNRECOGNIZED_SVC_MNGR,
- GD_MSG_NFS_GNS_OP_HANDLE_FAIL,
- GD_MSG_EXPORT_FILE_CREATE_FAIL,
- GD_MSG_NFS_GNS_HOST_FOUND,
- GD_MSG_REBALANCE_CMD_IN_TIER_VOL,
- GD_MSG_INCOMPATIBLE_VALUE,
- GD_MSG_GENERATED_UUID,
- GD_MSG_FILE_DESC_LIMIT_SET,
- GD_MSG_CURR_WORK_DIR_INFO,
- GD_MSG_STRIPE_COUNT_CHANGE_INFO,
- GD_MSG_REPLICA_COUNT_CHANGE_INFO,
- GD_MSG_ADD_BRICK_REQ_RECVD,
- GD_MSG_VOL_ALREADY_TIER,
- GD_MSG_REM_BRICK_REQ_RECVD,
- GD_MSG_VOL_NOT_TIER,
- GD_MSG_LOG_ROTATE_REQ_RECVD,
- GD_MSG_CLI_REQ_RECVD,
- GD_MSG_GET_VOL_REQ_RCVD,
- GD_MSG_VOL_SYNC_REQ_RCVD,
- GD_MSG_PROBE_RCVD,
- GD_MSG_UNFRIEND_REQ_RCVD,
- GD_MSG_FRIEND_UPDATE_RCVD,
- GD_MSG_RESPONSE_INFO,
- GD_MSG_VOL_PROFILE_REQ_RCVD,
- GD_MSG_GETWD_REQ_RCVD,
- GD_MSG_MOUNT_REQ_RCVD,
- GD_MSG_UMOUNT_REQ_RCVD,
- GD_MSG_CONNECT_RETURNED,
- GD_MSG_STATUS_VOL_REQ_RCVD,
- GD_MSG_CLRCLK_VOL_REQ_RCVD,
- GD_MSG_BARRIER_VOL_REQ_RCVD,
- GD_MSG_UUID_RECEIVED,
- GD_MSG_REPLACE_BRK_COMMIT_FORCE_REQ_RCVD,
- GD_MSG_BRK_PORT_NO_ADD_INDO,
- GD_MSG_REPLACE_BRK_REQ_RCVD,
- GD_MSG_ADD_OP_ARGS_FAIL,
- GD_MSG_POST_HOOK_STUB_INIT_FAIL,
- GD_MSG_HOOK_STUB_NULL,
- GD_MSG_SPAWN_THREADS_FAIL,
- GD_MSG_STALE_VOL_DELETE_INFO,
- GD_MSG_PROBE_REQ_RESP_RCVD,
- GD_MSG_HOST_PRESENT_ALREADY,
- GD_MSG_OP_VERS_INFO,
- GD_MSG_OP_VERS_SET_INFO,
- GD_MSG_NEW_NODE_STATE_CREATION,
- GD_MSG_ALREADY_MOUNTED,
- GD_MSG_SHARED_STRG_VOL_OPT_VALIDATE_FAIL,
- GD_MSG_NFS_GNS_STOP_FAIL,
- GD_MSG_NFS_GNS_RESET_FAIL,
- GD_MSG_SHARED_STRG_SET_FAIL,
- GD_MSG_VOL_TRANSPORT_TYPE_CHANGE,
- GD_MSG_PEER_COUNT_GET_FAIL,
- GD_MSG_INSUFFICIENT_UP_NODES,
- GD_MSG_OP_STAGE_STATS_VOL_FAIL,
- GD_MSG_VOL_ID_SET_FAIL,
- GD_MSG_OP_STAGE_RESET_VOL_FAIL,
- GD_MSG_OP_STAGE_BITROT_FAIL,
- GD_MSG_OP_STAGE_QUOTA_FAIL,
- GD_MSG_OP_STAGE_DELETE_VOL_FAIL,
- GD_MSG_HANDLE_HEAL_CMD_FAIL,
- GD_MSG_CLRCLK_SND_CMD_FAIL,
- GD_MSG_DISPERSE_CLUSTER_FOUND,
- GD_MSG_HEAL_VOL_REQ_RCVD,
- GD_MSG_STATEDUMP_VOL_REQ_RCVD,
- GD_MSG_THINPOOLS_FOR_THINLVS,
- GD_MSG_OP_STAGE_CREATE_VOL_FAIL,
- GD_MSG_OP_STAGE_START_VOL_FAIL,
- GD_MSG_NFS_GNS_UNEXPRT_VOL_FAIL,
- GD_MSG_TASK_ID_INFO,
- GD_MSG_DEREGISTER_SUCCESS,
- GD_MSG_STATEDUMP_OPTS_RCVD,
- GD_MSG_STATEDUMP_INFO,
- GD_MSG_RECOVERING_CORRUPT_CONF,
- GD_MSG_RETRIEVED_UUID,
- GD_MSG_XLATOR_CREATE_FAIL,
- GD_MSG_GRAPH_ENTRY_ADD_FAIL,
- GD_MSG_ERROR_ENCOUNTERED,
- GD_MSG_FILTER_RUN_FAILED,
- GD_MSG_DEFAULT_OPT_INFO,
- GD_MSG_MARKER_STATUS_GET_FAIL,
- GD_MSG_MARKER_DISABLE_FAIL,
- GD_MSG_GRAPH_FEATURE_ADD_FAIL,
- GD_MSG_XLATOR_SET_OPT_FAIL,
- GD_MSG_BUILD_GRAPH_FAILED,
- GD_MSG_XML_TEXT_WRITE_FAIL,
- GD_MSG_XML_DOC_START_FAIL,
- GD_MSG_XML_ELE_CREATE_FAIL,
- GD_MSG_VOLUME_INCONSISTENCY,
- GD_MSG_XLATOR_LINK_FAIL,
- GD_MSG_REMOTE_HOST_GET_FAIL,
- GD_MSG_GRAPH_SET_OPT_FAIL,
- GD_MSG_ROOT_SQUASH_ENABLED,
- GD_MSG_ROOT_SQUASH_FAILED,
- GD_MSG_LOCK_OWNER_MISMATCH,
- GD_MSG_LOCK_NOT_HELD,
- GD_MSG_LOCK_ALREADY_HELD,
- GD_MSG_SVC_START_SUCCESS,
- GD_MSG_SVC_STOP_SUCCESS,
- GD_MSG_PARAM_NULL,
- GD_MSG_SVC_STOP_FAIL,
- GD_MSG_SHARED_STORAGE_DOES_NOT_EXIST,
- GD_MSG_SNAP_PAUSE_TIER_FAIL,
- GD_MSG_SNAP_RESUME_TIER_FAIL,
- GD_MSG_FILE_NOT_FOUND,
- GD_MSG_RETRY_WITH_NEW_PORT,
- GD_MSG_REMOTE_VOL_UUID_FAIL,
- GD_MSG_SLAVE_VOL_PARSE_FAIL,
- GD_MSG_DICT_GET_SUCCESS,
- GD_MSG_PMAP_REGISTRY_REMOVE_FAIL,
- GD_MSG_MNTBROKER_LABEL_NULL,
- GD_MSG_MNTBROKER_LABEL_MISS,
- GD_MSG_MNTBROKER_SPEC_MISMATCH,
- GD_MSG_SYSCALL_FAIL,
- GD_MSG_DAEMON_STATE_REQ_RCVD,
- GD_MSG_BRICK_CLEANUP_SUCCESS,
- GD_MSG_STATE_STR_GET_FAILED,
- GD_MSG_RESET_BRICK_COMMIT_FORCE_REQ_RCVD,
- GD_MSG_RESET_BRICK_CMD_FAIL,
- GD_MSG_TIERD_STOP_FAIL,
- GD_MSG_TIERD_CREATE_FAIL,
- GD_MSG_TIERD_START_FAIL,
- GD_MSG_TIERD_OBJ_GET_FAIL,
- GD_MSG_TIERD_NOT_RUNNING,
- GD_MSG_TIERD_INIT_FAIL,
- GD_MSG_BRICK_MX_SET_FAIL,
- GD_MSG_NO_SIG_TO_PID_ZERO,
- GD_MSG_TIER_WATERMARK_RESET_FAIL,
- GD_MSG_CLIENTS_GET_STATE_FAILED,
- GD_MSG_GNFS_XLATOR_NOT_INSTALLED,
- GD_MSG_PIDFILE_UNLINKING,
- GD_MSG_VOL_SET_VALIDATION_INFO,
- GD_MSG_NO_MUX_LIMIT,
- GD_MSG_BRICKPROC_REM_BRICK_FAILED,
- GD_MSG_BRICKPROC_ADD_BRICK_FAILED,
- GD_MSG_BRICKPROC_NEW_FAILED,
- GD_MSG_STATVFS_FAILED,
- GD_MSG_GARBAGE_ARGS,
- GD_MSG_LOCALTIME_LOGGING_VOL_OPT_VALIDATE_FAIL,
- GD_MSG_LOCALTIME_LOGGING_ENABLE,
- GD_MSG_LOCALTIME_LOGGING_DISABLE,
- GD_MSG_PORTS_EXHAUSTED,
- GD_MSG_CHANGELOG_GET_FAIL,
- GD_MSG_MANAGER_FUNCTION_FAILED,
- GD_MSG_DAEMON_LOG_LEVEL_VOL_OPT_VALIDATE_FAIL
-);
+GLFS_MSGID(
+ GLUSTERD, GD_MSG_SERVER_QUORUM_NOT_MET,
+ GD_MSG_SERVER_QUORUM_LOST_STOPPING_BRICKS,
+ GD_MSG_SERVER_QUORUM_MET_STARTING_BRICKS, GD_MSG_PEER_DISCONNECTED,
+ GD_MSG_BRICK_DISCONNECTED, GD_MSG_NODE_DISCONNECTED,
+ GD_MSG_REBALANCE_DISCONNECTED, GD_MSG_VOL_CLEANUP_FAIL,
+ GD_MSG_VOL_VERS_MISMATCH, GD_MSG_CKSUM_VERS_MISMATCH,
+ GD_MSG_QUOTA_CONFIG_VERS_MISMATCH, GD_MSG_QUOTA_CONFIG_CKSUM_MISMATCH,
+ GD_MSG_BRICK_STOP_FAIL, GD_MSG_SVC_KILL_FAIL, GD_MSG_PID_KILL_FAIL,
+ GD_MSG_REBAL_NO_SOCK_FILE, GD_MSG_UNIX_OP_BUILD_FAIL,
+ GD_MSG_RPC_CREATE_FAIL, GD_MSG_FAIL_DEFAULT_OPT_SET,
+ GD_MSG_CLUSTER_UNLOCK_FAILED, GD_MSG_NO_MEMORY, GD_MSG_UNSUPPORTED_VERSION,
+ GD_MSG_COMMAND_NOT_FOUND, GD_MSG_SNAPSHOT_OP_FAILED, GD_MSG_INVALID_ENTRY,
+ GD_MSG_VOL_NOT_FOUND, GD_MSG_REG_COMPILE_FAILED, GD_MSG_FILE_OP_FAILED,
+ GD_MSG_SNAP_CREATION_FAIL, GD_MSG_VOL_OP_FAILED, GD_MSG_CREATE_DIR_FAILED,
+ GD_MSG_DIR_OP_FAILED, GD_MSG_VOL_STOP_FAILED, GD_MSG_NO_CLI_RESP,
+ GD_MSG_LOCK_INIT_FAILED, GD_MSG_SNAP_LIST_GET_FAIL, GD_MSG_UNOUNT_FAILED,
+ GD_MSG_LOCK_DESTROY_FAILED, GD_MSG_SNAP_CLEANUP_FAIL,
+ GD_MSG_SNAP_ACTIVATE_FAIL, GD_MSG_SNAP_DEACTIVATE_FAIL,
+ GD_MSG_SNAP_RESTORE_FAIL, GD_MSG_SNAP_REMOVE_FAIL, GD_MSG_SNAP_CONFIG_FAIL,
+ GD_MSG_SNAP_STATUS_FAIL, GD_MSG_SNAP_INIT_FAIL, GD_MSG_VOLINFO_SET_FAIL,
+ GD_MSG_VOLINFO_GET_FAIL, GD_MSG_BRICK_CREATION_FAIL,
+ GD_MSG_BRICK_GET_INFO_FAIL, GD_MSG_BRICK_NEW_INFO_FAIL, GD_MSG_LVS_FAIL,
+ GD_MSG_SETXATTR_FAIL, GD_MSG_UMOUNTING_SNAP_BRICK, GD_MSG_OP_UNSUPPORTED,
+ GD_MSG_SNAP_NOT_FOUND, GD_MSG_FS_LABEL_UPDATE_FAIL, GD_MSG_LVM_MOUNT_FAILED,
+ GD_MSG_DICT_SET_FAILED, GD_MSG_CANONICALIZE_FAIL, GD_MSG_DICT_GET_FAILED,
+ GD_MSG_SNAP_INFO_FAIL, GD_MSG_SNAP_VOL_CONFIG_FAIL,
+ GD_MSG_SNAP_OBJECT_STORE_FAIL, GD_MSG_DICT_UNSERIALIZE_FAIL,
+ GD_MSG_SNAP_RESTORE_REVERT_FAIL, GD_MSG_SNAP_LIST_SET_FAIL,
+ GD_MSG_VOLFILE_CREATE_FAIL, GD_MSG_VOLINFO_REMOVE_FAIL,
+ GD_MSG_VOL_DELETE_FAIL, GD_MSG_SNAPSHOT_PENDING,
+ GD_MSG_BRICK_PATH_UNMOUNTED, GD_MSG_BRICK_ADD_FAIL,
+ GD_MSG_BRICK_SET_INFO_FAIL, GD_MSG_LVCREATE_FAIL, GD_MSG_VG_GET_FAIL,
+ GD_MSG_TPOOL_GET_FAIL, GD_MSG_LVM_REMOVE_FAILED,
+ GD_MSG_MISSEDSNAP_INFO_SET_FAIL, GD_MSG_BRK_MOUNTOPTS_FAIL,
+ GD_MSG_MISSED_SNAP_LIST_STORE_FAIL, GD_MSG_INVALID_MISSED_SNAP_ENTRY,
+ GD_MSG_MISSED_SNAP_GET_FAIL, GD_MSG_MISSED_SNAP_CREATE_FAIL,
+ GD_MSG_DUP_ENTRY, GD_MSG_MISSED_SNAP_STATUS_DONE, GD_MSG_NO_EXEC_PERMS,
+ GD_MSG_GLOBAL_OP_VERSION_SET_FAIL, GD_MSG_HARD_LIMIT_SET_FAIL,
+ GD_MSG_OP_SUCCESS, GD_MSG_STORE_FAIL, GD_MSG_GLOBAL_OP_VERSION_GET_FAIL,
+ GD_MSG_GEOREP_GET_FAILED, GD_MSG_GLUSTERD_UMOUNT_FAIL,
+ GD_MSG_QUORUM_CHECK_FAIL, GD_MSG_QUORUM_COUNT_IGNORED,
+ GD_MSG_SNAP_MOUNT_FAIL, GD_MSG_RSP_DICT_USE_FAIL, GD_MSG_SNAP_IMPORT_FAIL,
+ GD_MSG_SNAP_CONFLICT, GD_MSG_MISSED_SNAP_DELETE,
+ GD_MSG_QUOTA_CONFIG_IMPORT_FAIL, GD_MSG_SNAPDIR_CREATE_FAIL,
+ GD_MSG_MISSED_SNAP_PRESENT, GD_MSG_UUID_NULL, GD_MSG_TSTAMP_SET_FAIL,
+ GD_MSG_RESP_AGGR_FAIL, GD_MSG_DICT_EMPTY, GD_MSG_DICT_CREATE_FAIL,
+ GD_MSG_SNAPD_STOP_FAIL, GD_MSG_SOFT_LIMIT_REACHED, GD_MSG_SNAPD_START_FAIL,
+ GD_MSG_SNAPD_CREATE_FAIL, GD_MSG_SNAPD_INIT_FAIL, GD_MSG_MGMTV3_OP_FAIL,
+ GD_MSG_MGMTV3_PAYLOAD_BUILD_FAIL, GD_MSG_MGMTV3_UNLOCK_FAIL,
+ GD_MSG_MGMTV3_LOCK_GET_FAIL, GD_MSG_MGMTV3_LOCKDOWN_FAIL,
+ GD_MSG_POST_VALIDATION_FAIL, GD_MSG_PRE_VALIDATION_FAIL,
+ GD_MSG_COMMIT_OP_FAIL, GD_MSG_PEER_LIST_CREATE_FAIL, GD_MSG_BRICK_OP_FAIL,
+ GD_MSG_OPINFO_SET_FAIL, GD_MSG_OP_EVENT_UNLOCK_FAIL,
+ GD_MSG_MGMTV3_OP_RESP_FAIL, GD_MSG_PEER_NOT_FOUND, GD_MSG_REQ_DECODE_FAIL,
+ GD_MSG_DICT_SERL_LENGTH_GET_FAIL, GD_MSG_ALREADY_STOPPED,
+ GD_MSG_PRE_VALD_RESP_FAIL, GD_MSG_SVC_GET_FAIL, GD_MSG_VOLFILE_NOT_FOUND,
+ GD_MSG_OP_EVENT_LOCK_FAIL, GD_MSG_NON_STRIPE_VOL, GD_MSG_SNAPD_OBJ_GET_FAIL,
+ GD_MSG_QUOTA_DISABLED, GD_MSG_CACHE_MINMAX_SIZE_INVALID,
+ GD_MSG_QUOTA_GET_STAT_FAIL, GD_MSG_SUBVOLUMES_EXCEED, GD_MSG_BRICK_ADD,
+ GD_MSG_BRICK_REMOVE, GD_MSG_CREATE_KEY_FAIL,
+ GD_MSG_MULTIPLE_LOCK_ACQUIRE_FAIL, GD_MSG_MULTIPLE_LOCK_RELEASE_FAIL,
+ GD_MSG_RESP_FROM_UNKNOWN_PEER, GD_MSG_BRICK_MOUNDIRS_AGGR_FAIL,
+ GD_MSG_GFID_VALIDATE_SET_FAIL, GD_MSG_PEER_LOCK_FAIL,
+ GD_MSG_PEER_UNLOCK_FAIL, GD_MSG_MGMT_OP_FAIL,
+ GD_MSG_TRANS_OPINFO_CLEAR_FAIL, GD_MSG_GLUSTERD_LOCK_FAIL,
+ GD_MSG_TRANS_OPINFO_SET_FAIL, GD_MSG_TRANS_IDGEN_FAIL, GD_MSG_RPC_FAILURE,
+ GD_MSG_OP_VERS_ADJUST_FAIL, GD_MSG_SNAP_DEVICE_NAME_GET_FAIL,
+ GD_MSG_SNAP_STATUS_NOT_PENDING, GD_MSG_MGMT_PGM_SET_FAIL,
+ GD_MSG_EVENT_INJECT_FAIL, GD_MSG_VERS_INFO, GD_MSG_VOL_INFO_REQ_RECVD,
+ GD_MSG_VERS_GET_FAIL, GD_MSG_EVENT_NEW_GET_FAIL, GD_MSG_RPC_LAYER_ERROR,
+ GD_MSG_NO_HANDSHAKE_ACK, GD_MSG_OP_VERSION_MISMATCH,
+ GD_MSG_HANDSHAKE_REQ_REJECTED, GD_MSG_UNKNOWN_MODE,
+ GD_MSG_DEFRAG_STATUS_UPDATED, GD_MSG_NO_FLAG_SET,
+ GD_MSG_VERSION_UNSUPPORTED, GD_MSG_UUID_SET_FAIL, GD_MSG_MOUNT_REQ_FAIL,
+ GD_MSG_GLUSTERD_GLOBAL_INFO_STORE_FAIL, GD_MSG_OP_VERS_STORE_FAIL,
+ GD_MSG_SNAP_AUTOMIC_UPDATE_FAIL, GD_MSG_SNAPINFO_WRITE_FAIL,
+ GD_MSG_SNAPINFO_CREATE_FAIL, GD_MSG_SNAPD_INFO_STORE_FAIL,
+ GD_MSG_BRK_MNTPATH_MOUNT_FAIL, GD_MSG_BRK_MNTPATH_GET_FAIL,
+ GD_MSG_SNAP_BRK_MNT_RECREATE_FAIL, GD_MSG_SNAP_RESOLVE_BRICK_FAIL,
+ GD_MSG_RESOLVE_BRICK_FAIL, GD_MSG_BRK_MNT_RECREATE_FAIL,
+ GD_MSG_TMP_FILE_UNLINK_FAIL, GD_MSG_VOL_VALS_WRITE_FAIL,
+ GD_MSG_STORE_HANDLE_GET_FAIL, GD_MSG_STORE_HANDLE_WRITE_FAIL,
+ GD_MSG_MISSED_SNAP_LIST_STORE_HANDLE_GET_FAIL,
+ GD_MSG_MISSED_SNAP_LIST_EMPTY, GD_MSG_SNAP_VOL_RETRIEVE_FAIL,
+ GD_MSG_SNAPSHOT_UPDATE_FAIL, GD_MSG_SNAPD_PORT_STORE_FAIL,
+ GD_MSG_CKSUM_STORE_FAIL, GD_MSG_STORE_HANDLE_CREATE_FAIL,
+ GD_MSG_HANDLE_NULL, GD_MSG_VOL_RESTORE_FAIL, GD_MSG_NAME_TOO_LONG,
+ GD_MSG_UUID_PARSE_FAIL, GD_MSG_UNKNOWN_KEY, GD_MSG_STORE_ITER_DESTROY_FAIL,
+ GD_MSG_STORE_ITER_GET_FAIL, GD_MSG_VOLINFO_UPDATE_FAIL,
+ GD_MSG_PARSE_BRICKINFO_FAIL, GD_MSG_VERS_STORE_FAIL, GD_MSG_HEADER_ADD_FAIL,
+ GD_MSG_QUOTA_CONF_WRITE_FAIL, GD_MSG_QUOTA_CONF_CORRUPT, GD_MSG_FORK_FAIL,
+ GD_MSG_CKSUM_COMPUTE_FAIL, GD_MSG_VERS_CKSUM_STORE_FAIL,
+ GD_MSG_GETXATTR_FAIL, GD_MSG_CONVERSION_FAILED, GD_MSG_VOL_NOT_DISTRIBUTE,
+ GD_MSG_VOL_STOPPED, GD_MSG_OPCTX_GET_FAIL, GD_MSG_TASKID_GEN_FAIL,
+ GD_MSG_REBALANCE_ID_MISSING, GD_MSG_NO_REBALANCE_PFX_IN_VOLNAME,
+ GD_MSG_DEFRAG_STATUS_UPDATE_FAIL, GD_MSG_UUID_GEN_STORE_FAIL,
+ GD_MSG_UUID_STORE_FAIL, GD_MSG_NO_INIT, GD_MSG_MODULE_NOT_INSTALLED,
+ GD_MSG_MODULE_NOT_WORKING, GD_MSG_WRITE_ACCESS_GRANT_FAIL,
+ GD_MSG_DIRPATH_TOO_LONG, GD_MSG_LOGGROUP_INVALID, GD_MSG_DIR_PERM_LIBERAL,
+ GD_MSG_DIR_PERM_STRICT, GD_MSG_MOUNT_SPEC_INSTALL_FAIL,
+ GD_MSG_GLUSTERD_SOCK_LISTENER_START_FAIL, GD_MSG_DIR_NOT_FOUND,
+ GD_MSG_FAILED_INIT_SHDSVC, GD_MSG_FAILED_INIT_NFSSVC,
+ GD_MSG_FAILED_INIT_QUOTASVC, GD_MSG_RPC_INIT_FAIL,
+ GD_MSG_RPCSVC_REG_NOTIFY_RETURNED, GD_MSG_RPC_TRANSPORT_COUNT_GET_FAIL,
+ GD_MSG_RPC_LISTENER_CREATE_FAIL, GD_MSG_OP_VERS_RESTORE_FAIL,
+ GD_MSG_SELF_HEALD_DISABLED, GD_MSG_PRIV_NULL, GD_MSG_GSYNC_VALIDATION_FAIL,
+ GD_MSG_SLAVE_CONFPATH_DETAILS_FETCH_FAIL, GD_MSG_OP_NOT_PERMITTED_AC_REQD,
+ GD_MSG_OP_NOT_PERMITTED, GD_MSG_REBALANCE_START_FAIL,
+ GD_MSG_NFS_RECONF_FAIL, GD_MSG_REMOVE_BRICK_ID_SET_FAIL,
+ GD_MSG_BRICK_MOUNTDIR_GET_FAIL, GD_MSG_BRICK_NOT_FOUND,
+ GD_MSG_BRKPATH_TOO_LONG, GD_MSG_CLRLOCKS_CLNT_UMOUNT_FAIL,
+ GD_MSG_CLRLOCKS_CLNT_MOUNT_FAIL, GD_MSG_CLRLOCKS_MOUNTDIR_CREATE_FAIL,
+ GD_MSG_BRK_PORT_NUM_GET_FAIL, GD_MSG_BRK_STATEDUMP_FAIL,
+ GD_MSG_VOL_GRAPH_CHANGE_NOTIFY_FAIL, GD_MSG_INVALID_VG,
+ GD_MSG_GLUSTERD_OP_FAILED, GD_MSG_HOSTNAME_ADD_TO_PEERLIST_FAIL,
+ GD_MSG_STALE_PEERINFO_REMOVE_FAIL, GD_MSG_TRANS_ID_GET_FAIL,
+ GD_MSG_RES_DECODE_FAIL, GD_MSG_VOL_ALREADY_EXIST, GD_MSG_BAD_BRKORDER,
+ GD_MSG_BAD_BRKORDER_CHECK_FAIL, GD_MSG_BRICK_SELECT_FAIL,
+ GD_MSG_NO_LOCK_RESP_FROM_PEER, GD_MSG_MGMTV3_LOCK_FROM_UUID_REJCT,
+ GD_MSG_STAGE_FROM_UUID_REJCT, GD_MSG_UNLOCK_FROM_UUID_REJCT,
+ GD_MSG_MGMTV3_UNLOCK_FROM_UUID_REJCT, GD_MSG_COMMIT_FROM_UUID_REJCT,
+ GD_MSG_VOL_NOT_STARTED, GD_MSG_VOL_NOT_REPLICA, GD_MSG_VOL_NOT_DISPERSE,
+ GD_MSG_OLD_REMOVE_BRICK_EXISTS, GD_MSG_USE_THE_FORCE, GD_MSG_OIP,
+ GD_MSG_OIP_RETRY_LATER, GD_MSG_GSYNC_RESTART_FAIL,
+ GD_MSG_LOCK_FROM_UUID_REJCT, GD_MSG_BRICK_OP_PAYLOAD_BUILD_FAIL,
+ GD_MSG_HOSTNAME_RESOLVE_FAIL, GD_MSG_COUNT_VALIDATE_FAILED,
+ GD_MSG_SPAWNING_CHILD_FAILED, GD_MSG_READ_CHILD_DATA_FAILED,
+ GD_MSG_DEFAULT_TEMP_CONFIG, GD_MSG_PIDFILE_CREATE_FAILED,
+ GD_MSG_GSYNCD_SPAWN_FAILED, GD_MSG_SUBOP_NOT_FOUND, GD_MSG_RESERVED_OPTION,
+ GD_MSG_GLUSTERD_PRIV_NOT_FOUND, GD_MSG_SLAVEINFO_FETCH_ERROR,
+ GD_MSG_VALIDATE_FAILED, GD_MSG_INVOKE_ERROR, GD_MSG_SESSION_CREATE_ERROR,
+ GD_MSG_STOP_FORCE, GD_MSG_GET_CONFIG_INFO_FAILED,
+ GD_MSG_STAT_FILE_READ_FAILED, GD_MSG_CONF_PATH_ASSIGN_FAILED,
+ GD_MSG_SESSION_INACTIVE, GD_MSG_PIDFILE_NOT_FOUND, GD_MSG_PEER_CMD_ERROR,
+ GD_MSG_SRC_FILE_ERROR, GD_MSG_GET_STATEFILE_NAME_FAILED, GD_MSG_STATUS_NULL,
+ GD_MSG_STATUSFILE_CREATE_FAILED, GD_MSG_SLAVE_URL_INVALID,
+ GD_MSG_INVALID_SLAVE, GD_MSG_READ_ERROR, GD_MSG_ARG_FETCH_ERROR,
+ GD_MSG_REG_FILE_MISSING, GD_MSG_STATEFILE_NAME_NOT_FOUND,
+ GD_MSG_GEO_REP_START_FAILED, GD_MSG_GSYNCD_ERROR,
+ GD_MSG_UPDATE_STATEFILE_FAILED, GD_MSG_STATUS_UPDATE_FAILED,
+ GD_MSG_GSYNCD_OP_SET_FAILED, GD_MSG_BUFFER_EMPTY, GD_MSG_CONFIG_INFO,
+ GD_MSG_FETCH_CONFIG_VAL_FAILED, GD_MSG_GSYNCD_PARSE_ERROR,
+ GD_MSG_SESSION_ALREADY_EXIST, GD_MSG_FORCE_CREATE_SESSION,
+ GD_MSG_GET_KEY_FAILED, GD_MSG_SESSION_DEL_FAILED, GD_MSG_CMD_EXEC_FAIL,
+ GD_MSG_STRDUP_FAILED, GD_MSG_UNABLE_TO_END, GD_MSG_PAUSE_FAILED,
+ GD_MSG_NORMALIZE_URL_FAIL, GD_MSG_MODULE_ERROR,
+ GD_MSG_SLAVEINFO_STORE_ERROR, GD_MSG_MARKER_START_FAIL,
+ GD_MSG_RESUME_FAILED, GD_MSG_GLUSTERFS_START_FAIL,
+ GD_MSG_GLUSTERFS_STOP_FAIL, GD_MSG_RBOP_STATE_STORE_FAIL,
+ GD_MSG_PUMP_XLATOR_DISABLED, GD_MSG_ABORT_OP_FAIL, GD_MSG_PAUSE_OP_FAIL,
+ GD_MSG_GLUSTER_SERVICE_START_FAIL, GD_MSG_HANDSHAKE_FAILED,
+ GD_MSG_CLI_REQ_EMPTY, GD_MSG_PEER_ADD_FAIL,
+ GD_MSG_SYNC_FROM_LOCALHOST_UNALLOWED, GD_MSG_UUIDS_SAME_RETRY,
+ GD_MSG_TSP_ALREADY_FORMED, GD_MSG_VOLS_ALREADY_PRESENT,
+ GD_MSG_REQ_CTX_CREATE_FAIL, GD_MSG_PEER_INFO_UPDATE_FAIL,
+ GD_MSG_PEERINFO_CREATE_FAIL, GD_MSG_REQ_FROM_UNKNOWN_PEER,
+ GD_MSG_STATUS_REPLY_STRING_CREATE_FAIL, GD_MSG_TOKENIZE_FAIL,
+ GD_MSG_LAZY_UMOUNT_FAIL, GD_MSG_NFS_SERVER_START_FAIL,
+ GD_MSG_GLUSTER_SERVICES_STOP_FAIL, GD_MSG_BRK_CLEANUP_FAIL,
+ GD_MSG_RB_ALREADY_STARTED, GD_MSG_RB_BRICKINFO_GET_FAIL, GD_MSG_BAD_FORMAT,
+ GD_MSG_RB_CMD_FAIL, GD_MSG_RB_NOT_STARTED_OR_PAUSED, GD_MSG_RB_NOT_STARTED,
+ GD_MSG_RB_PAUSED_ALREADY, GD_MSG_NO_FREE_PORTS,
+ GD_MSG_EVENT_STATE_TRANSITION_FAIL, GD_MSG_HANDLER_RETURNED,
+ GD_MSG_SNAP_COMPARE_CONFLICT, GD_MSG_PEER_DETACH_CLEANUP_FAIL,
+ GD_MSG_STALE_VOL_REMOVE_FAIL, GD_MSG_AC_ERROR, GD_MSG_LOCK_FAIL,
+ GD_MSG_MGMTV3_LOCK_REQ_SEND_FAIL, GD_MSG_GLUSTERD_UNLOCK_FAIL,
+ GD_MSG_RBOP_START_FAIL, GD_MSG_UNKNOWN_RESPONSE,
+ GD_MSG_COMMIT_REQ_SEND_FAIL, GD_MSG_OPCTX_UPDATE_FAIL, GD_MSG_OPCTX_NULL,
+ GD_MSG_DICT_COPY_FAIL, GD_MSG_SHD_STATUS_SET_FAIL,
+ GD_MSG_REPLICA_INDEX_GET_FAIL, GD_MSG_NFS_SERVER_NOT_RUNNING,
+ GD_MSG_STAGE_REQ_SEND_FAIL, GD_MSG_LOCK_REQ_SEND_FAIL,
+ GD_MSG_VOLNAMES_GET_FAIL, GD_MSG_NO_TASK_ID, GD_MSG_ADD_REMOVE_BRICK_FAIL,
+ GD_MSG_SVC_RESTART_FAIL, GD_MSG_VOL_SET_FAIL, GD_MSG_QUOTAD_NOT_RUNNING,
+ GD_MSG_XLATOR_COUNT_GET_FAIL, GD_MSG_TRANS_OPINFO_GET_FAIL,
+ GD_MSG_TRANS_ID_INVALID, GD_MSG_NO_OPTIONS_GIVEN, GD_MSG_SNAPD_NOT_RUNNING,
+ GD_MSG_ADD_ADDRESS_TO_PEER_FAIL, GD_MSG_PEER_ADDRESS_GET_FAIL,
+ GD_MSG_GETADDRINFO_FAIL, GD_MSG_PEERINFO_DELETE_FAIL, GD_MSG_KEY_NULL,
+ GD_MSG_SPAWN_SVCS_FAIL, GD_MSG_DICT_ITER_FAIL,
+ GD_MSG_TASK_STATUS_UPDATE_FAIL, GD_MSG_VOL_ID_MISMATCH,
+ GD_MSG_STR_TO_BOOL_FAIL, GD_MSG_RB_MNT_BRICKS_MISMATCH,
+ GD_MSG_RB_SRC_BRICKS_MISMATCH, GD_MSG_MNTENTRY_GET_FAIL,
+ GD_MSG_INODE_SIZE_GET_FAIL, GD_MSG_NO_STATEFILE_ENTRY,
+ GD_MSG_PMAP_UNSET_FAIL, GD_MSG_GLOBAL_OPT_IMPORT_FAIL,
+ GD_MSD_BRICK_DISCONNECT_FAIL, GD_MSG_SNAP_DETAILS_IMPORT_FAIL,
+ GD_MSG_BRICKINFO_CREATE_FAIL, GD_MSG_QUOTA_CKSUM_VER_STORE_FAIL,
+ GD_MSG_CKSUM_GET_FAIL, GD_MSG_BRICKPATH_ROOT_GET_FAIL,
+ GD_MSG_HOSTNAME_TO_UUID_FAIL, GD_MSG_REPLY_SUBMIT_FAIL,
+ GD_MSG_SERIALIZE_MSG_FAIL, GD_MSG_ENCODE_FAIL,
+ GD_MSG_RB_DST_BRICKS_MISMATCH, GD_MSG_XLATOR_VOLOPT_DYNLOAD_ERROR,
+ GD_MSG_VOLNAME_NOTFOUND_IN_DICT, GD_MSG_FLAGS_NOTFOUND_IN_DICT,
+ GD_MSG_HOSTNAME_NOTFOUND_IN_DICT, GD_MSG_PORT_NOTFOUND_IN_DICT,
+ GD_MSG_CMDSTR_NOTFOUND_IN_DICT, GD_MSG_SNAP_OBJ_NEW_FAIL,
+ GD_MSG_SNAP_BACKEND_MAKE_FAIL, GD_MSG_SNAP_CLONE_FAILED,
+ GD_MSG_SNAP_CLONE_PREVAL_FAILED, GD_MSG_SNAP_CLONE_POSTVAL_FAILED,
+ GD_MSG_VOLINFO_STORE_FAIL, GD_MSG_NEW_FRIEND_SM_EVENT_GET_FAIL,
+ GD_MSG_VOL_TYPE_CHANGING_INFO, GD_MSG_BRKPATH_MNTPNT_MISMATCH,
+ GD_MSG_TASKS_COUNT_MISMATCH, GD_MSG_WRONG_OPTS_SETTING,
+ GD_MSG_PATH_ALREADY_PART_OF_VOL, GD_MSG_BRICK_VALIDATE_FAIL,
+ GD_MSG_READIN_FILE_FAILED, GD_MSG_IMPORT_PRDICT_DICT,
+ GD_MSG_VOL_OPTS_IMPORT_FAIL, GD_MSG_BRICK_IMPORT_FAIL,
+ GD_MSG_VOLINFO_IMPORT_FAIL, GD_MSG_BRICK_ID_GEN_FAILED,
+ GD_MSG_GET_STATUS_DATA_FAIL, GD_MSG_BITROT_NOT_RUNNING,
+ GD_MSG_SCRUBBER_NOT_RUNNING, GD_MSG_SRC_BRICK_PORT_UNAVAIL,
+ GD_MSG_BITD_INIT_FAIL, GD_MSG_SCRUB_INIT_FAIL, GD_MSG_VAR_RUN_DIR_INIT_FAIL,
+ GD_MSG_VAR_RUN_DIR_FIND_FAIL, GD_MSG_SCRUBSVC_RECONF_FAIL,
+ GD_MSG_BITDSVC_RECONF_FAIL, GD_MSG_NFS_GNS_START_FAIL,
+ GD_MSG_NFS_GNS_SETUP_FAIL, GD_MSG_UNRECOGNIZED_SVC_MNGR,
+ GD_MSG_NFS_GNS_OP_HANDLE_FAIL, GD_MSG_EXPORT_FILE_CREATE_FAIL,
+ GD_MSG_NFS_GNS_HOST_FOUND, GD_MSG_REBALANCE_CMD_IN_TIER_VOL,
+ GD_MSG_INCOMPATIBLE_VALUE, GD_MSG_GENERATED_UUID,
+ GD_MSG_FILE_DESC_LIMIT_SET, GD_MSG_CURR_WORK_DIR_INFO,
+ GD_MSG_STRIPE_COUNT_CHANGE_INFO, GD_MSG_REPLICA_COUNT_CHANGE_INFO,
+ GD_MSG_ADD_BRICK_REQ_RECVD, GD_MSG_VOL_ALREADY_TIER,
+ GD_MSG_REM_BRICK_REQ_RECVD, GD_MSG_VOL_NOT_TIER,
+ GD_MSG_LOG_ROTATE_REQ_RECVD, GD_MSG_CLI_REQ_RECVD, GD_MSG_GET_VOL_REQ_RCVD,
+ GD_MSG_VOL_SYNC_REQ_RCVD, GD_MSG_PROBE_RCVD, GD_MSG_UNFRIEND_REQ_RCVD,
+ GD_MSG_FRIEND_UPDATE_RCVD, GD_MSG_RESPONSE_INFO,
+ GD_MSG_VOL_PROFILE_REQ_RCVD, GD_MSG_GETWD_REQ_RCVD, GD_MSG_MOUNT_REQ_RCVD,
+ GD_MSG_UMOUNT_REQ_RCVD, GD_MSG_CONNECT_RETURNED, GD_MSG_STATUS_VOL_REQ_RCVD,
+ GD_MSG_CLRCLK_VOL_REQ_RCVD, GD_MSG_BARRIER_VOL_REQ_RCVD,
+ GD_MSG_UUID_RECEIVED, GD_MSG_REPLACE_BRK_COMMIT_FORCE_REQ_RCVD,
+ GD_MSG_BRK_PORT_NO_ADD_INDO, GD_MSG_REPLACE_BRK_REQ_RCVD,
+ GD_MSG_ADD_OP_ARGS_FAIL, GD_MSG_POST_HOOK_STUB_INIT_FAIL,
+ GD_MSG_HOOK_STUB_NULL, GD_MSG_SPAWN_THREADS_FAIL,
+ GD_MSG_STALE_VOL_DELETE_INFO, GD_MSG_PROBE_REQ_RESP_RCVD,
+ GD_MSG_HOST_PRESENT_ALREADY, GD_MSG_OP_VERS_INFO, GD_MSG_OP_VERS_SET_INFO,
+ GD_MSG_NEW_NODE_STATE_CREATION, GD_MSG_ALREADY_MOUNTED,
+ GD_MSG_SHARED_STRG_VOL_OPT_VALIDATE_FAIL, GD_MSG_NFS_GNS_STOP_FAIL,
+ GD_MSG_NFS_GNS_RESET_FAIL, GD_MSG_SHARED_STRG_SET_FAIL,
+ GD_MSG_VOL_TRANSPORT_TYPE_CHANGE, GD_MSG_PEER_COUNT_GET_FAIL,
+ GD_MSG_INSUFFICIENT_UP_NODES, GD_MSG_OP_STAGE_STATS_VOL_FAIL,
+ GD_MSG_VOL_ID_SET_FAIL, GD_MSG_OP_STAGE_RESET_VOL_FAIL,
+ GD_MSG_OP_STAGE_BITROT_FAIL, GD_MSG_OP_STAGE_QUOTA_FAIL,
+ GD_MSG_OP_STAGE_DELETE_VOL_FAIL, GD_MSG_HANDLE_HEAL_CMD_FAIL,
+ GD_MSG_CLRCLK_SND_CMD_FAIL, GD_MSG_DISPERSE_CLUSTER_FOUND,
+ GD_MSG_HEAL_VOL_REQ_RCVD, GD_MSG_STATEDUMP_VOL_REQ_RCVD,
+ GD_MSG_THINPOOLS_FOR_THINLVS, GD_MSG_OP_STAGE_CREATE_VOL_FAIL,
+ GD_MSG_OP_STAGE_START_VOL_FAIL, GD_MSG_NFS_GNS_UNEXPRT_VOL_FAIL,
+ GD_MSG_TASK_ID_INFO, GD_MSG_DEREGISTER_SUCCESS, GD_MSG_STATEDUMP_OPTS_RCVD,
+ GD_MSG_STATEDUMP_INFO, GD_MSG_RECOVERING_CORRUPT_CONF,
+ GD_MSG_RETRIEVED_UUID, GD_MSG_XLATOR_CREATE_FAIL,
+ GD_MSG_GRAPH_ENTRY_ADD_FAIL, GD_MSG_ERROR_ENCOUNTERED,
+ GD_MSG_FILTER_RUN_FAILED, GD_MSG_DEFAULT_OPT_INFO,
+ GD_MSG_MARKER_STATUS_GET_FAIL, GD_MSG_MARKER_DISABLE_FAIL,
+ GD_MSG_GRAPH_FEATURE_ADD_FAIL, GD_MSG_XLATOR_SET_OPT_FAIL,
+ GD_MSG_BUILD_GRAPH_FAILED, GD_MSG_XML_TEXT_WRITE_FAIL,
+ GD_MSG_XML_DOC_START_FAIL, GD_MSG_XML_ELE_CREATE_FAIL,
+ GD_MSG_VOLUME_INCONSISTENCY, GD_MSG_XLATOR_LINK_FAIL,
+ GD_MSG_REMOTE_HOST_GET_FAIL, GD_MSG_GRAPH_SET_OPT_FAIL,
+ GD_MSG_ROOT_SQUASH_ENABLED, GD_MSG_ROOT_SQUASH_FAILED,
+ GD_MSG_LOCK_OWNER_MISMATCH, GD_MSG_LOCK_NOT_HELD, GD_MSG_LOCK_ALREADY_HELD,
+ GD_MSG_SVC_START_SUCCESS, GD_MSG_SVC_STOP_SUCCESS, GD_MSG_PARAM_NULL,
+ GD_MSG_SVC_STOP_FAIL, GD_MSG_SHARED_STORAGE_DOES_NOT_EXIST,
+ GD_MSG_SNAP_PAUSE_TIER_FAIL, GD_MSG_SNAP_RESUME_TIER_FAIL,
+ GD_MSG_FILE_NOT_FOUND, GD_MSG_RETRY_WITH_NEW_PORT,
+ GD_MSG_REMOTE_VOL_UUID_FAIL, GD_MSG_SLAVE_VOL_PARSE_FAIL,
+ GD_MSG_DICT_GET_SUCCESS, GD_MSG_PMAP_REGISTRY_REMOVE_FAIL,
+ GD_MSG_MNTBROKER_LABEL_NULL, GD_MSG_MNTBROKER_LABEL_MISS,
+ GD_MSG_MNTBROKER_SPEC_MISMATCH, GD_MSG_SYSCALL_FAIL,
+ GD_MSG_DAEMON_STATE_REQ_RCVD, GD_MSG_BRICK_CLEANUP_SUCCESS,
+ GD_MSG_STATE_STR_GET_FAILED, GD_MSG_RESET_BRICK_COMMIT_FORCE_REQ_RCVD,
+ GD_MSG_RESET_BRICK_CMD_FAIL, GD_MSG_TIERD_STOP_FAIL,
+ GD_MSG_TIERD_CREATE_FAIL, GD_MSG_TIERD_START_FAIL,
+ GD_MSG_TIERD_OBJ_GET_FAIL, GD_MSG_TIERD_NOT_RUNNING, GD_MSG_TIERD_INIT_FAIL,
+ GD_MSG_BRICK_MX_SET_FAIL, GD_MSG_NO_SIG_TO_PID_ZERO,
+ GD_MSG_TIER_WATERMARK_RESET_FAIL, GD_MSG_CLIENTS_GET_STATE_FAILED,
+ GD_MSG_GNFS_XLATOR_NOT_INSTALLED, GD_MSG_PIDFILE_UNLINKING,
+ GD_MSG_VOL_SET_VALIDATION_INFO, GD_MSG_NO_MUX_LIMIT,
+ GD_MSG_BRICKPROC_REM_BRICK_FAILED, GD_MSG_BRICKPROC_ADD_BRICK_FAILED,
+ GD_MSG_BRICKPROC_NEW_FAILED, GD_MSG_STATVFS_FAILED, GD_MSG_GARBAGE_ARGS,
+ GD_MSG_LOCALTIME_LOGGING_VOL_OPT_VALIDATE_FAIL,
+ GD_MSG_LOCALTIME_LOGGING_ENABLE, GD_MSG_LOCALTIME_LOGGING_DISABLE,
+ GD_MSG_PORTS_EXHAUSTED, GD_MSG_CHANGELOG_GET_FAIL,
+ GD_MSG_MANAGER_FUNCTION_FAILED,
+ GD_MSG_DAEMON_LOG_LEVEL_VOL_OPT_VALIDATE_FAIL);
#endif /* !_GLUSTERD_MESSAGES_H_ */
diff --git a/xlators/mgmt/glusterd/src/glusterd-mgmt.h b/xlators/mgmt/glusterd/src/glusterd-mgmt.h
index 2215f178327..9b57f4cb833 100644
--- a/xlators/mgmt/glusterd/src/glusterd-mgmt.h
+++ b/xlators/mgmt/glusterd/src/glusterd-mgmt.h
@@ -10,74 +10,73 @@
#ifndef _GLUSTERD_MGMT_H_
#define _GLUSTERD_MGMT_H_
-void gd_mgmt_v3_collate_errors (struct syncargs *args, int op_ret, int op_errno,
- char *op_errstr, int op_code, uuid_t peerid,
- u_char *uuid);
+void
+gd_mgmt_v3_collate_errors(struct syncargs *args, int op_ret, int op_errno,
+ char *op_errstr, int op_code, uuid_t peerid,
+ u_char *uuid);
int32_t
-gd_mgmt_v3_pre_validate_fn (glusterd_op_t op, dict_t *dict,
- char **op_errstr, dict_t *rsp_dict,
- uint32_t *op_errno);
+gd_mgmt_v3_pre_validate_fn(glusterd_op_t op, dict_t *dict, char **op_errstr,
+ dict_t *rsp_dict, uint32_t *op_errno);
int32_t
-gd_mgmt_v3_brick_op_fn (glusterd_op_t op, dict_t *dict,
- char **op_errstr, dict_t *rsp_dict);
+gd_mgmt_v3_brick_op_fn(glusterd_op_t op, dict_t *dict, char **op_errstr,
+ dict_t *rsp_dict);
int32_t
-gd_mgmt_v3_commit_fn (glusterd_op_t op, dict_t *dict,
- char **op_errstr, uint32_t *op_errno,
- dict_t *rsp_dict);
+gd_mgmt_v3_commit_fn(glusterd_op_t op, dict_t *dict, char **op_errstr,
+ uint32_t *op_errno, dict_t *rsp_dict);
int32_t
-gd_mgmt_v3_post_validate_fn (glusterd_op_t op, int32_t op_ret, dict_t *dict,
+gd_mgmt_v3_post_validate_fn(glusterd_op_t op, int32_t op_ret, dict_t *dict,
char **op_errstr, dict_t *rsp_dict);
int32_t
-glusterd_mgmt_v3_initiate_all_phases (rpcsvc_request_t *req, glusterd_op_t op,
+glusterd_mgmt_v3_initiate_all_phases(rpcsvc_request_t *req, glusterd_op_t op,
dict_t *dict);
int32_t
-glusterd_mgmt_v3_initiate_snap_phases (rpcsvc_request_t *req, glusterd_op_t op,
+glusterd_mgmt_v3_initiate_snap_phases(rpcsvc_request_t *req, glusterd_op_t op,
dict_t *dict);
int
-glusterd_snap_pre_validate_use_rsp_dict (dict_t *dst, dict_t *src);
+glusterd_snap_pre_validate_use_rsp_dict(dict_t *dst, dict_t *src);
int32_t
-glusterd_set_barrier_value (dict_t *dict, char *option);
+glusterd_set_barrier_value(dict_t *dict, char *option);
int
-glusterd_mgmt_v3_initiate_lockdown (glusterd_op_t op, dict_t *dict,
- char **op_errstr, uint32_t *op_errno,
- gf_boolean_t *is_acquired,
- uint32_t txn_generation);
+glusterd_mgmt_v3_initiate_lockdown(glusterd_op_t op, dict_t *dict,
+ char **op_errstr, uint32_t *op_errno,
+ gf_boolean_t *is_acquired,
+ uint32_t txn_generation);
int
-glusterd_mgmt_v3_build_payload (dict_t **req, char **op_errstr, dict_t *dict,
- glusterd_op_t op);
+glusterd_mgmt_v3_build_payload(dict_t **req, char **op_errstr, dict_t *dict,
+ glusterd_op_t op);
int
-glusterd_mgmt_v3_pre_validate (glusterd_op_t op, dict_t *req_dict,
- char **op_errstr, uint32_t *op_errno,
- uint32_t txn_generation);
+glusterd_mgmt_v3_pre_validate(glusterd_op_t op, dict_t *req_dict,
+ char **op_errstr, uint32_t *op_errno,
+ uint32_t txn_generation);
int
-glusterd_mgmt_v3_commit (glusterd_op_t op, dict_t *op_ctx, dict_t *req_dict,
- char **op_errstr, uint32_t *op_errno,
- uint32_t txn_generation);
+glusterd_mgmt_v3_commit(glusterd_op_t op, dict_t *op_ctx, dict_t *req_dict,
+ char **op_errstr, uint32_t *op_errno,
+ uint32_t txn_generation);
int
-glusterd_mgmt_v3_release_peer_locks (glusterd_op_t op, dict_t *dict,
- int32_t op_ret, char **op_errstr,
- gf_boolean_t is_acquired,
- uint32_t txn_generation);
+glusterd_mgmt_v3_release_peer_locks(glusterd_op_t op, dict_t *dict,
+ int32_t op_ret, char **op_errstr,
+ gf_boolean_t is_acquired,
+ uint32_t txn_generation);
int32_t
-glusterd_multiple_mgmt_v3_unlock (dict_t *dict, uuid_t uuid);
+glusterd_multiple_mgmt_v3_unlock(dict_t *dict, uuid_t uuid);
int
-glusterd_reset_brick_prevalidate (dict_t *dict, char **op_errstr,
- dict_t *rsp_dict);
+glusterd_reset_brick_prevalidate(dict_t *dict, char **op_errstr,
+ dict_t *rsp_dict);
int
-glusterd_op_reset_brick (dict_t *dict, dict_t *rsp_dict);
+glusterd_op_reset_brick(dict_t *dict, dict_t *rsp_dict);
#endif /* _GLUSTERD_MGMT_H_ */
diff --git a/xlators/mgmt/glusterd/src/glusterd-mountbroker.h b/xlators/mgmt/glusterd/src/glusterd-mountbroker.h
index 83267c203ca..319e05188b4 100644
--- a/xlators/mgmt/glusterd/src/glusterd-mountbroker.h
+++ b/xlators/mgmt/glusterd/src/glusterd-mountbroker.h
@@ -9,34 +9,31 @@
*/
#define MB_HIVE "mb_hive"
-typedef enum {
- SET_SUB = 1,
- SET_SUPER,
- SET_EQUAL,
- SET_INTERSECT
-} gf_setrel_t;
+typedef enum { SET_SUB = 1, SET_SUPER, SET_EQUAL, SET_INTERSECT } gf_setrel_t;
struct gf_mount_pattern {
- char **components;
- gf_setrel_t condition;
- gf_boolean_t negative;
+ char **components;
+ gf_setrel_t condition;
+ gf_boolean_t negative;
};
typedef struct gf_mount_pattern gf_mount_pattern_t;
struct gf_mount_spec {
- struct cds_list_head speclist;
- char *label;
- gf_mount_pattern_t *patterns;
- size_t len;
+ struct cds_list_head speclist;
+ char *label;
+ gf_mount_pattern_t *patterns;
+ size_t len;
};
typedef struct gf_mount_spec gf_mount_spec_t;
+int
+parse_mount_pattern_desc(gf_mount_spec_t *mspec, char *pdesc);
-int parse_mount_pattern_desc (gf_mount_spec_t *mspec, char *pdesc);
+int
+make_georep_mountspec(gf_mount_spec_t *mspec, const char *volname, char *user);
+int
+make_ghadoop_mountspec(gf_mount_spec_t *mspec, const char *volname, char *user,
+ char *server);
-int make_georep_mountspec (gf_mount_spec_t *mspec, const char *volname,
- char *user);
-int make_ghadoop_mountspec (gf_mount_spec_t *mspec, const char *volname,
- char *user, char *server);
-
-int glusterd_do_mount (char *label, dict_t *argdict, char **path, int *op_errno);
+int
+glusterd_do_mount(char *label, dict_t *argdict, char **path, int *op_errno);
diff --git a/xlators/mgmt/glusterd/src/glusterd-nfs-svc.h b/xlators/mgmt/glusterd/src/glusterd-nfs-svc.h
index 6330b71ba7d..47e89830f55 100644
--- a/xlators/mgmt/glusterd/src/glusterd-nfs-svc.h
+++ b/xlators/mgmt/glusterd/src/glusterd-nfs-svc.h
@@ -14,12 +14,12 @@
#include "glusterd-svc-mgmt.h"
void
-glusterd_nfssvc_build (glusterd_svc_t *svc);
+glusterd_nfssvc_build(glusterd_svc_t *svc);
int
-glusterd_nfssvc_init (glusterd_svc_t *svc);
+glusterd_nfssvc_init(glusterd_svc_t *svc);
int
-glusterd_nfssvc_reconfigure ();
+glusterd_nfssvc_reconfigure();
#endif
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.h b/xlators/mgmt/glusterd/src/glusterd-op-sm.h
index 92a604b680c..4fcaff1c8ba 100644
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.h
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.h
@@ -10,7 +10,6 @@
#ifndef _GLUSTERD_OP_SM_H_
#define _GLUSTERD_OP_SM_H_
-
#include <pthread.h>
#include "compat-uuid.h"
@@ -23,292 +22,293 @@
#include "protocol-common.h"
#include "glusterd-hooks.h"
-#define GD_OP_PROTECTED (0x02)
-#define GD_OP_UNPROTECTED (0x04)
+#define GD_OP_PROTECTED (0x02)
+#define GD_OP_UNPROTECTED (0x04)
typedef enum glusterd_op_sm_state_ {
- GD_OP_STATE_DEFAULT = 0,
- GD_OP_STATE_LOCK_SENT,
- GD_OP_STATE_LOCKED,
- GD_OP_STATE_STAGE_OP_SENT,
- GD_OP_STATE_STAGED,
- GD_OP_STATE_COMMIT_OP_SENT,
- GD_OP_STATE_COMMITED,
- GD_OP_STATE_UNLOCK_SENT,
- GD_OP_STATE_STAGE_OP_FAILED,
- GD_OP_STATE_COMMIT_OP_FAILED,
- GD_OP_STATE_BRICK_OP_SENT,
- GD_OP_STATE_BRICK_OP_FAILED,
- GD_OP_STATE_BRICK_COMMITTED,
- GD_OP_STATE_BRICK_COMMIT_FAILED,
- GD_OP_STATE_ACK_DRAIN,
- GD_OP_STATE_MAX,
+ GD_OP_STATE_DEFAULT = 0,
+ GD_OP_STATE_LOCK_SENT,
+ GD_OP_STATE_LOCKED,
+ GD_OP_STATE_STAGE_OP_SENT,
+ GD_OP_STATE_STAGED,
+ GD_OP_STATE_COMMIT_OP_SENT,
+ GD_OP_STATE_COMMITED,
+ GD_OP_STATE_UNLOCK_SENT,
+ GD_OP_STATE_STAGE_OP_FAILED,
+ GD_OP_STATE_COMMIT_OP_FAILED,
+ GD_OP_STATE_BRICK_OP_SENT,
+ GD_OP_STATE_BRICK_OP_FAILED,
+ GD_OP_STATE_BRICK_COMMITTED,
+ GD_OP_STATE_BRICK_COMMIT_FAILED,
+ GD_OP_STATE_ACK_DRAIN,
+ GD_OP_STATE_MAX,
} glusterd_op_sm_state_t;
typedef enum glusterd_op_sm_event_type_ {
- GD_OP_EVENT_NONE = 0,
- GD_OP_EVENT_START_LOCK,
- GD_OP_EVENT_LOCK,
- GD_OP_EVENT_RCVD_ACC,
- GD_OP_EVENT_ALL_ACC,
- GD_OP_EVENT_STAGE_ACC,
- GD_OP_EVENT_COMMIT_ACC,
- GD_OP_EVENT_RCVD_RJT,
- GD_OP_EVENT_STAGE_OP,
- GD_OP_EVENT_COMMIT_OP,
- GD_OP_EVENT_UNLOCK,
- GD_OP_EVENT_START_UNLOCK,
- GD_OP_EVENT_ALL_ACK,
- GD_OP_EVENT_LOCAL_UNLOCK_NO_RESP,
- GD_OP_EVENT_MAX
+ GD_OP_EVENT_NONE = 0,
+ GD_OP_EVENT_START_LOCK,
+ GD_OP_EVENT_LOCK,
+ GD_OP_EVENT_RCVD_ACC,
+ GD_OP_EVENT_ALL_ACC,
+ GD_OP_EVENT_STAGE_ACC,
+ GD_OP_EVENT_COMMIT_ACC,
+ GD_OP_EVENT_RCVD_RJT,
+ GD_OP_EVENT_STAGE_OP,
+ GD_OP_EVENT_COMMIT_OP,
+ GD_OP_EVENT_UNLOCK,
+ GD_OP_EVENT_START_UNLOCK,
+ GD_OP_EVENT_ALL_ACK,
+ GD_OP_EVENT_LOCAL_UNLOCK_NO_RESP,
+ GD_OP_EVENT_MAX
} glusterd_op_sm_event_type_t;
-
struct glusterd_op_sm_event_ {
- struct cds_list_head list;
- void *ctx;
- glusterd_op_sm_event_type_t event;
- uuid_t txn_id;
+ struct cds_list_head list;
+ void *ctx;
+ glusterd_op_sm_event_type_t event;
+ uuid_t txn_id;
};
typedef struct glusterd_op_sm_event_ glusterd_op_sm_event_t;
-typedef int (*glusterd_op_sm_ac_fn) (glusterd_op_sm_event_t *, void *);
+typedef int (*glusterd_op_sm_ac_fn)(glusterd_op_sm_event_t *, void *);
typedef struct glusterd_op_sm_ {
- glusterd_op_sm_state_t next_state;
- glusterd_op_sm_ac_fn handler;
+ glusterd_op_sm_state_t next_state;
+ glusterd_op_sm_ac_fn handler;
} glusterd_op_sm_t;
typedef struct glusterd_op_sm_state_info_ {
- glusterd_op_sm_state_t state;
- struct timeval time;
+ glusterd_op_sm_state_t state;
+ struct timeval time;
} glusterd_op_sm_state_info_t;
struct glusterd_op_info_ {
- glusterd_op_sm_state_info_t state;
- int32_t pending_count;
- int32_t brick_pending_count;
- int32_t op_count;
- /* op is an enum, glusterd_op_t or glusterd_op_sm_state_info_t */
- int op;
- struct cds_list_head op_peers;
- void *op_ctx;
- rpcsvc_request_t *req;
- int32_t op_ret;
- int32_t op_errno;
- char *op_errstr;
- struct cds_list_head pending_bricks;
- uint32_t txn_generation;
- gf_boolean_t skip_locking;
+ glusterd_op_sm_state_info_t state;
+ int32_t pending_count;
+ int32_t brick_pending_count;
+ int32_t op_count;
+ /* op is an enum, glusterd_op_t or glusterd_op_sm_state_info_t */
+ int op;
+ struct cds_list_head op_peers;
+ void *op_ctx;
+ rpcsvc_request_t *req;
+ int32_t op_ret;
+ int32_t op_errno;
+ char *op_errstr;
+ struct cds_list_head pending_bricks;
+ uint32_t txn_generation;
+ gf_boolean_t skip_locking;
};
typedef struct glusterd_op_info_ glusterd_op_info_t;
struct glusterd_op_log_filename_ctx_ {
- char volume_name[GD_VOLUME_NAME_MAX];
- char brick[GD_VOLUME_NAME_MAX];
- char path[PATH_MAX];
+ char volume_name[GD_VOLUME_NAME_MAX];
+ char brick[GD_VOLUME_NAME_MAX];
+ char path[PATH_MAX];
};
typedef struct glusterd_op_log_filename_ctx_ glusterd_op_log_filename_ctx_t;
struct glusterd_op_lock_ctx_ {
- uuid_t uuid;
- dict_t *dict;
- rpcsvc_request_t *req;
+ uuid_t uuid;
+ dict_t *dict;
+ rpcsvc_request_t *req;
};
typedef struct glusterd_op_lock_ctx_ glusterd_op_lock_ctx_t;
struct glusterd_req_ctx_ {
- rpcsvc_request_t *req;
- u_char uuid[16];
- int op;
- dict_t *dict;
+ rpcsvc_request_t *req;
+ u_char uuid[16];
+ int op;
+ dict_t *dict;
};
typedef struct glusterd_req_ctx_ glusterd_req_ctx_t;
typedef struct glusterd_op_brick_rsp_ctx_ {
- int op_ret;
- char *op_errstr;
- dict_t *rsp_dict;
- glusterd_req_ctx_t *commit_ctx;
- glusterd_pending_node_t *pending_node;
+ int op_ret;
+ char *op_errstr;
+ dict_t *rsp_dict;
+ glusterd_req_ctx_t *commit_ctx;
+ glusterd_pending_node_t *pending_node;
} glusterd_op_brick_rsp_ctx_t;
typedef struct glusterd_pr_brick_rsp_conv_t {
- int count;
- dict_t *dict;
+ int count;
+ dict_t *dict;
} glusterd_pr_brick_rsp_conv_t;
typedef struct glusterd_heal_rsp_conv_ {
- dict_t *dict;
- glusterd_volinfo_t *volinfo;
- xlator_t *this;
+ dict_t *dict;
+ glusterd_volinfo_t *volinfo;
+ xlator_t *this;
} glusterd_heal_rsp_conv_t;
typedef struct glusterd_status_rsp_conv_ {
- int count;
- int brick_index_max;
- int other_count;
- dict_t *dict;
+ int count;
+ int brick_index_max;
+ int other_count;
+ dict_t *dict;
} glusterd_status_rsp_conv_t;
-
typedef struct glusterd_txn_opinfo_object_ {
- glusterd_op_info_t opinfo;
+ glusterd_op_info_t opinfo;
} glusterd_txn_opinfo_obj;
typedef enum cli_cmd_type_ {
- PER_HEAL_XL,
- ALL_HEAL_XL,
- } cli_cmd_type;
+ PER_HEAL_XL,
+ ALL_HEAL_XL,
+} cli_cmd_type;
typedef struct glusterd_all_volume_options {
- char *option;
- char *dflt_val;
+ char *option;
+ char *dflt_val;
} glusterd_all_vol_opts;
int
-glusterd_op_commit_hook (glusterd_op_t op, dict_t *op_ctx,
- glusterd_commit_hook_type_t type);
+glusterd_op_commit_hook(glusterd_op_t op, dict_t *op_ctx,
+ glusterd_commit_hook_type_t type);
int
-glusterd_op_sm_new_event (glusterd_op_sm_event_type_t event_type,
- glusterd_op_sm_event_t **new_event);
+glusterd_op_sm_new_event(glusterd_op_sm_event_type_t event_type,
+ glusterd_op_sm_event_t **new_event);
int
-glusterd_op_sm_inject_event (glusterd_op_sm_event_type_t event_type,
- uuid_t *txn_id, void *ctx);
+glusterd_op_sm_inject_event(glusterd_op_sm_event_type_t event_type,
+ uuid_t *txn_id, void *ctx);
int
-glusterd_op_sm_init ();
+glusterd_op_sm_init();
int
-glusterd_op_sm ();
+glusterd_op_sm();
int32_t
-glusterd_op_set_ctx (void *ctx);
+glusterd_op_set_ctx(void *ctx);
int32_t
-glusterd_op_set_op (glusterd_op_t op);
+glusterd_op_set_op(glusterd_op_t op);
int
-glusterd_op_build_payload (dict_t **req, char **op_errstr, dict_t *op_ctx);
+glusterd_op_build_payload(dict_t **req, char **op_errstr, dict_t *op_ctx);
int32_t
-glusterd_op_stage_validate (glusterd_op_t op, dict_t *req, char **op_errstr,
- dict_t *rsp_dict);
+glusterd_op_stage_validate(glusterd_op_t op, dict_t *req, char **op_errstr,
+ dict_t *rsp_dict);
int32_t
-glusterd_op_commit_perform (glusterd_op_t op, dict_t *req, char **op_errstr,
- dict_t* dict);
+glusterd_op_commit_perform(glusterd_op_t op, dict_t *req, char **op_errstr,
+ dict_t *dict);
int32_t
-glusterd_op_txn_begin (rpcsvc_request_t *req, glusterd_op_t op, void *ctx,
- char *err_str, size_t err_len);
+glusterd_op_txn_begin(rpcsvc_request_t *req, glusterd_op_t op, void *ctx,
+ char *err_str, size_t err_len);
int32_t
-glusterd_op_txn_complete ();
+glusterd_op_txn_complete();
void *
-glusterd_op_get_ctx ();
+glusterd_op_get_ctx();
int32_t
-glusterd_op_set_req (rpcsvc_request_t *req);
+glusterd_op_set_req(rpcsvc_request_t *req);
int32_t
-glusterd_op_send_cli_response (glusterd_op_t op, int32_t op_ret,
- int32_t op_errno, rpcsvc_request_t *req,
- void *ctx, char *op_errstr);
+glusterd_op_send_cli_response(glusterd_op_t op, int32_t op_ret,
+ int32_t op_errno, rpcsvc_request_t *req,
+ void *ctx, char *op_errstr);
int32_t
-glusterd_op_get_op ();
+glusterd_op_get_op();
int32_t
-glusterd_op_clear_op ();
+glusterd_op_clear_op();
int32_t
-glusterd_op_free_ctx (glusterd_op_t op, void *ctx);
+glusterd_op_free_ctx(glusterd_op_t op, void *ctx);
int
glusterd_check_option_exists(char *optstring, char **completion);
int
-set_xlator_option (dict_t *dict, char *key, char *value);
+set_xlator_option(dict_t *dict, char *key, char *value);
-char*
-glusterd_op_sm_state_name_get (int state);
+char *
+glusterd_op_sm_state_name_get(int state);
-char*
-glusterd_op_sm_event_name_get (int event);
+char *
+glusterd_op_sm_event_name_get(int event);
int32_t
-glusterd_op_bricks_select (glusterd_op_t op, dict_t *dict, char **op_errstr,
- struct cds_list_head *selected, dict_t *rsp_dict);
+glusterd_op_bricks_select(glusterd_op_t op, dict_t *dict, char **op_errstr,
+ struct cds_list_head *selected, dict_t *rsp_dict);
int
-glusterd_brick_op_build_payload (glusterd_op_t op, glusterd_brickinfo_t *brickinfo,
- gd1_mgmt_brick_op_req **req, dict_t *dict);
+glusterd_brick_op_build_payload(glusterd_op_t op,
+ glusterd_brickinfo_t *brickinfo,
+ gd1_mgmt_brick_op_req **req, dict_t *dict);
int
-glusterd_node_op_build_payload (glusterd_op_t op, gd1_mgmt_brick_op_req **req,
+glusterd_node_op_build_payload(glusterd_op_t op, gd1_mgmt_brick_op_req **req,
dict_t *dict);
int32_t
-glusterd_handle_brick_rsp (void *pending_entry, glusterd_op_t op,
- dict_t *rsp_dict, dict_t *ctx_dict, char **op_errstr,
- gd_node_type type);
+glusterd_handle_brick_rsp(void *pending_entry, glusterd_op_t op,
+ dict_t *rsp_dict, dict_t *ctx_dict, char **op_errstr,
+ gd_node_type type);
-dict_t*
-glusterd_op_init_commit_rsp_dict (glusterd_op_t op);
+dict_t *
+glusterd_op_init_commit_rsp_dict(glusterd_op_t op);
void
-glusterd_op_modify_op_ctx (glusterd_op_t op, void *op_ctx);
+glusterd_op_modify_op_ctx(glusterd_op_t op, void *op_ctx);
void
-glusterd_op_perform_detach_tier (glusterd_volinfo_t *volinfo);
+glusterd_op_perform_detach_tier(glusterd_volinfo_t *volinfo);
int
-glusterd_set_detach_bricks (dict_t *dict, glusterd_volinfo_t *volinfo);
+glusterd_set_detach_bricks(dict_t *dict, glusterd_volinfo_t *volinfo);
int32_t
-glusterd_volume_stats_read_perf (char *brick_path, int32_t blk_size,
- int32_t blk_count, double *throughput, double *time);
+glusterd_volume_stats_read_perf(char *brick_path, int32_t blk_size,
+ int32_t blk_count, double *throughput,
+ double *time);
int32_t
-glusterd_volume_stats_write_perf (char *brick_path, int32_t blk_size,
- int32_t blk_count, double *throughput, double *time);
+glusterd_volume_stats_write_perf(char *brick_path, int32_t blk_size,
+ int32_t blk_count, double *throughput,
+ double *time);
gf_boolean_t
-glusterd_is_volume_started (glusterd_volinfo_t *volinfo);
+glusterd_is_volume_started(glusterd_volinfo_t *volinfo);
int
-glusterd_start_bricks (glusterd_volinfo_t *volinfo);
+glusterd_start_bricks(glusterd_volinfo_t *volinfo);
gf_boolean_t
-glusterd_are_all_volumes_stopped ();
+glusterd_are_all_volumes_stopped();
int
-glusterd_stop_bricks (glusterd_volinfo_t *volinfo);
+glusterd_stop_bricks(glusterd_volinfo_t *volinfo);
int
-glusterd_defrag_volume_node_rsp (dict_t *req_dict, dict_t *rsp_dict,
- dict_t *op_ctx);
+glusterd_defrag_volume_node_rsp(dict_t *req_dict, dict_t *rsp_dict,
+ dict_t *op_ctx);
#ifdef HAVE_BD_XLATOR
int
-glusterd_is_valid_vg (glusterd_brickinfo_t *brick, int check_tag, char *msg);
+glusterd_is_valid_vg(glusterd_brickinfo_t *brick, int check_tag, char *msg);
#endif
int32_t
-glusterd_get_txn_opinfo (uuid_t *txn_id, glusterd_op_info_t *opinfo);
+glusterd_get_txn_opinfo(uuid_t *txn_id, glusterd_op_info_t *opinfo);
int32_t
-glusterd_set_txn_opinfo (uuid_t *txn_id, glusterd_op_info_t *opinfo);
+glusterd_set_txn_opinfo(uuid_t *txn_id, glusterd_op_info_t *opinfo);
int32_t
-glusterd_clear_txn_opinfo (uuid_t *txn_id);
+glusterd_clear_txn_opinfo(uuid_t *txn_id);
int32_t
-glusterd_generate_txn_id (dict_t *dict, uuid_t **txn_id);
+glusterd_generate_txn_id(dict_t *dict, uuid_t **txn_id);
void
-glusterd_set_opinfo (char *errstr, int32_t op_errno, int32_t op_ret);
+glusterd_set_opinfo(char *errstr, int32_t op_errno, int32_t op_ret);
int
-glusterd_dict_set_volid (dict_t *dict, char *volname, char **op_errstr);
+glusterd_dict_set_volid(dict_t *dict, char *volname, char **op_errstr);
int32_t
-glusterd_tier_op (xlator_t *this, void *data);
+glusterd_tier_op(xlator_t *this, void *data);
#endif
diff --git a/xlators/mgmt/glusterd/src/glusterd-peer-utils.h b/xlators/mgmt/glusterd/src/glusterd-peer-utils.h
index b03b136d3ca..47cbf6ee13d 100644
--- a/xlators/mgmt/glusterd/src/glusterd-peer-utils.h
+++ b/xlators/mgmt/glusterd/src/glusterd-peer-utils.h
@@ -8,86 +8,84 @@
cases as published by the Free Software Foundation.
*/
-
#ifndef _GLUSTERD_PEER_UTILS_H
#define _GLUSTERD_PEER_UTILS_H
#include "glusterd.h"
int32_t
-glusterd_peerinfo_cleanup (glusterd_peerinfo_t *peerinfo);
+glusterd_peerinfo_cleanup(glusterd_peerinfo_t *peerinfo);
glusterd_peerinfo_t *
-glusterd_peerinfo_find_by_hostname (const char *hoststr);
+glusterd_peerinfo_find_by_hostname(const char *hoststr);
int
-glusterd_hostname_to_uuid (char *hostname, uuid_t uuid);
+glusterd_hostname_to_uuid(char *hostname, uuid_t uuid);
glusterd_peerinfo_t *
-glusterd_peerinfo_find_by_uuid (uuid_t uuid);
+glusterd_peerinfo_find_by_uuid(uuid_t uuid);
glusterd_peerinfo_t *
-glusterd_peerinfo_find (uuid_t uuid, const char *hostname);
+glusterd_peerinfo_find(uuid_t uuid, const char *hostname);
glusterd_peerinfo_t *
-glusterd_peerinfo_new (glusterd_friend_sm_state_t state, uuid_t *uuid,
- const char *hostname, int port);
+glusterd_peerinfo_new(glusterd_friend_sm_state_t state, uuid_t *uuid,
+ const char *hostname, int port);
gf_boolean_t
-glusterd_chk_peers_connected_befriended (uuid_t skip_uuid);
+glusterd_chk_peers_connected_befriended(uuid_t skip_uuid);
char *
-glusterd_uuid_to_hostname (uuid_t uuid);
+glusterd_uuid_to_hostname(uuid_t uuid);
-char*
-gd_peer_uuid_str (glusterd_peerinfo_t *peerinfo);
+char *
+gd_peer_uuid_str(glusterd_peerinfo_t *peerinfo);
gf_boolean_t
-glusterd_are_all_peers_up ();
+glusterd_are_all_peers_up();
gf_boolean_t
-glusterd_are_vol_all_peers_up (glusterd_volinfo_t *volinfo,
- struct cds_list_head *peers,
- char **down_peerstr);
+glusterd_are_vol_all_peers_up(glusterd_volinfo_t *volinfo,
+ struct cds_list_head *peers, char **down_peerstr);
int32_t
-glusterd_peer_hostname_new (const char *hostname,
- glusterd_peer_hostname_t **name);
+glusterd_peer_hostname_new(const char *hostname,
+ glusterd_peer_hostname_t **name);
void
-glusterd_peer_hostname_free (glusterd_peer_hostname_t *name);
+glusterd_peer_hostname_free(glusterd_peer_hostname_t *name);
gf_boolean_t
-gd_peer_has_address (glusterd_peerinfo_t *peerinfo, const char *address);
+gd_peer_has_address(glusterd_peerinfo_t *peerinfo, const char *address);
int
-gd_add_address_to_peer (glusterd_peerinfo_t *peerinfo, const char *address);
+gd_add_address_to_peer(glusterd_peerinfo_t *peerinfo, const char *address);
int
-gd_add_friend_to_dict (glusterd_peerinfo_t *friend, dict_t *dict,
- const char *prefix);
+gd_add_friend_to_dict(glusterd_peerinfo_t *friend, dict_t *dict,
+ const char *prefix);
glusterd_peerinfo_t *
-gd_peerinfo_find_from_hostname (const char *hoststr);
+gd_peerinfo_find_from_hostname(const char *hoststr);
glusterd_peerinfo_t *
-gd_peerinfo_find_from_addrinfo (const struct addrinfo *addr);
+gd_peerinfo_find_from_addrinfo(const struct addrinfo *addr);
int
-gd_update_peerinfo_from_dict (glusterd_peerinfo_t *peerinfo, dict_t *dict,
- const char *prefix);
+gd_update_peerinfo_from_dict(glusterd_peerinfo_t *peerinfo, dict_t *dict,
+ const char *prefix);
glusterd_peerinfo_t *
-gd_peerinfo_from_dict (dict_t *dict, const char *prefix);
+gd_peerinfo_from_dict(dict_t *dict, const char *prefix);
int
-gd_add_peer_hostnames_to_dict (glusterd_peerinfo_t *peerinfo, dict_t *dict,
- const char *prefix);
+gd_add_peer_hostnames_to_dict(glusterd_peerinfo_t *peerinfo, dict_t *dict,
+ const char *prefix);
int
-gd_add_peer_detail_to_dict (glusterd_peerinfo_t *peerinfo, dict_t *friends,
- int count);
+gd_add_peer_detail_to_dict(glusterd_peerinfo_t *peerinfo, dict_t *friends,
+ int count);
glusterd_peerinfo_t *
-glusterd_peerinfo_find_by_generation (uint32_t generation);
+glusterd_peerinfo_find_by_generation(uint32_t generation);
int
-glusterd_get_peers_count ();
+glusterd_get_peers_count();
#endif /* _GLUSTERD_PEER_UTILS_H */
diff --git a/xlators/mgmt/glusterd/src/glusterd-pmap.h b/xlators/mgmt/glusterd/src/glusterd-pmap.h
index 04004c2b2af..8a3ebac48a0 100644
--- a/xlators/mgmt/glusterd/src/glusterd-pmap.h
+++ b/xlators/mgmt/glusterd/src/glusterd-pmap.h
@@ -20,31 +20,38 @@
#include "byte-order.h"
#include "rpcsvc.h"
-
struct pmap_port_status {
- gf_pmap_port_type_t type;
- char *brickname;
- void *xprt;
+ gf_pmap_port_type_t type;
+ char *brickname;
+ void *xprt;
};
struct pmap_registry {
- int base_port;
- int max_port;
- int last_alloc;
- struct pmap_port_status ports[GF_PORT_MAX + 1];
+ int base_port;
+ int max_port;
+ int last_alloc;
+ struct pmap_port_status ports[GF_PORT_MAX + 1];
};
-int pmap_assign_port (xlator_t *this, int port, const char *path);
-int pmap_mark_port_leased (xlator_t *this, int port);
-int pmap_registry_alloc (xlator_t *this);
-int pmap_registry_bind (xlator_t *this, int port, const char *brickname,
- gf_pmap_port_type_t type, void *xprt);
-int pmap_registry_extend (xlator_t *this, int port, const char *brickname);
-int pmap_registry_remove (xlator_t *this, int port, const char *brickname,
- gf_pmap_port_type_t type, void *xprt,
- gf_boolean_t brick_disconnect);
-int pmap_registry_search (xlator_t *this, const char *brickname,
- gf_pmap_port_type_t type, gf_boolean_t destroy);
-struct pmap_registry *pmap_registry_get (xlator_t *this);
+int
+pmap_assign_port(xlator_t *this, int port, const char *path);
+int
+pmap_mark_port_leased(xlator_t *this, int port);
+int
+pmap_registry_alloc(xlator_t *this);
+int
+pmap_registry_bind(xlator_t *this, int port, const char *brickname,
+ gf_pmap_port_type_t type, void *xprt);
+int
+pmap_registry_extend(xlator_t *this, int port, const char *brickname);
+int
+pmap_registry_remove(xlator_t *this, int port, const char *brickname,
+ gf_pmap_port_type_t type, void *xprt,
+ gf_boolean_t brick_disconnect);
+int
+pmap_registry_search(xlator_t *this, const char *brickname,
+ gf_pmap_port_type_t type, gf_boolean_t destroy);
+struct pmap_registry *
+pmap_registry_get(xlator_t *this);
#endif
diff --git a/xlators/mgmt/glusterd/src/glusterd-proc-mgmt.h b/xlators/mgmt/glusterd/src/glusterd-proc-mgmt.h
index f5235171816..36ad5ae6731 100644
--- a/xlators/mgmt/glusterd/src/glusterd-proc-mgmt.h
+++ b/xlators/mgmt/glusterd/src/glusterd-proc-mgmt.h
@@ -14,31 +14,31 @@
typedef struct glusterd_proc_ glusterd_proc_t;
enum proc_flags {
- PROC_NONE = 0,
- PROC_START,
- PROC_START_NO_WAIT,
- PROC_STOP,
- PROC_STOP_FORCE
+ PROC_NONE = 0,
+ PROC_START,
+ PROC_START_NO_WAIT,
+ PROC_STOP,
+ PROC_STOP_FORCE
};
struct glusterd_proc_ {
- char name[PATH_MAX];
- char pidfile[PATH_MAX];
- char logdir[PATH_MAX];
- char logfile[PATH_MAX];
- char volfile[PATH_MAX];
- char volfileserver[PATH_MAX];
- char volfileid[256];
+ char name[PATH_MAX];
+ char pidfile[PATH_MAX];
+ char logdir[PATH_MAX];
+ char logfile[PATH_MAX];
+ char volfile[PATH_MAX];
+ char volfileserver[PATH_MAX];
+ char volfileid[256];
};
int
-glusterd_proc_init (glusterd_proc_t *proc, char *name, char *pidfile,
- char *logdir, char *logfile, char *volfile, char *volfileid,
- char *volfileserver);
+glusterd_proc_init(glusterd_proc_t *proc, char *name, char *pidfile,
+ char *logdir, char *logfile, char *volfile, char *volfileid,
+ char *volfileserver);
int
-glusterd_proc_stop (glusterd_proc_t *proc, int sig, int flags);
+glusterd_proc_stop(glusterd_proc_t *proc, int sig, int flags);
int
-glusterd_proc_is_running (glusterd_proc_t *proc);
+glusterd_proc_is_running(glusterd_proc_t *proc);
#endif
diff --git a/xlators/mgmt/glusterd/src/glusterd-quota.h b/xlators/mgmt/glusterd/src/glusterd-quota.h
index 9efff41b436..ab2092a9c6a 100644
--- a/xlators/mgmt/glusterd/src/glusterd-quota.h
+++ b/xlators/mgmt/glusterd/src/glusterd-quota.h
@@ -11,7 +11,7 @@
#define _GLUSTERD_QUOTA_
int
-glusterd_store_quota_config (glusterd_volinfo_t *volinfo, char *path,
- char *gfid_str, int opcode, char **op_errstr);
+glusterd_store_quota_config(glusterd_volinfo_t *volinfo, char *path,
+ char *gfid_str, int opcode, char **op_errstr);
#endif
diff --git a/xlators/mgmt/glusterd/src/glusterd-quotad-svc.h b/xlators/mgmt/glusterd/src/glusterd-quotad-svc.h
index 91da50dc36d..e8d9bbee964 100644
--- a/xlators/mgmt/glusterd/src/glusterd-quotad-svc.h
+++ b/xlators/mgmt/glusterd/src/glusterd-quotad-svc.h
@@ -14,18 +14,18 @@
#include "glusterd-svc-mgmt.h"
void
-glusterd_quotadsvc_build (glusterd_svc_t *svc);
+glusterd_quotadsvc_build(glusterd_svc_t *svc);
int
-glusterd_quotadsvc_init (glusterd_svc_t *svc);
+glusterd_quotadsvc_init(glusterd_svc_t *svc);
int
-glusterd_quotadsvc_start (glusterd_svc_t *svc, int flags);
+glusterd_quotadsvc_start(glusterd_svc_t *svc, int flags);
int
-glusterd_quotadsvc_manager (glusterd_svc_t *svc, void *data, int flags);
+glusterd_quotadsvc_manager(glusterd_svc_t *svc, void *data, int flags);
int
-glusterd_quotadsvc_reconfigure ();
+glusterd_quotadsvc_reconfigure();
#endif
diff --git a/xlators/mgmt/glusterd/src/glusterd-rcu.h b/xlators/mgmt/glusterd/src/glusterd-rcu.h
index 15beac5a745..32ac3bbfd4e 100644
--- a/xlators/mgmt/glusterd/src/glusterd-rcu.h
+++ b/xlators/mgmt/glusterd/src/glusterd-rcu.h
@@ -29,8 +29,8 @@
* Use this in place of struct rcu_head when embedding into another struct
*/
typedef struct glusterd_rcu_head_ {
- struct rcu_head head;
- xlator_t *this;
+ struct rcu_head head;
+ xlator_t *this;
} gd_rcu_head;
#endif /* _GLUSTERD_RCU_H */
diff --git a/xlators/mgmt/glusterd/src/glusterd-scrub-svc.h b/xlators/mgmt/glusterd/src/glusterd-scrub-svc.h
index dbdcf43529c..514b1de96a0 100644
--- a/xlators/mgmt/glusterd/src/glusterd-scrub-svc.h
+++ b/xlators/mgmt/glusterd/src/glusterd-scrub-svc.h
@@ -15,31 +15,31 @@
typedef struct glusterd_scrubsvc_ glusterd_scrubsvc_t;
-struct glusterd_scrubsvc_{
- glusterd_svc_t svc;
- gf_store_handle_t *handle;
+struct glusterd_scrubsvc_ {
+ glusterd_svc_t svc;
+ gf_store_handle_t *handle;
};
void
-glusterd_scrubsvc_build (glusterd_svc_t *svc);
+glusterd_scrubsvc_build(glusterd_svc_t *svc);
int
-glusterd_scrubsvc_init (glusterd_svc_t *svc);
+glusterd_scrubsvc_init(glusterd_svc_t *svc);
int
-glusterd_scrubsvc_manager (glusterd_svc_t *svc, void *data, int flags);
+glusterd_scrubsvc_manager(glusterd_svc_t *svc, void *data, int flags);
int
-glusterd_scrubsvc_start (glusterd_svc_t *svc, int flags);
+glusterd_scrubsvc_start(glusterd_svc_t *svc, int flags);
int
-glusterd_scrubsvc_stop (glusterd_svc_t *svc, int sig);
+glusterd_scrubsvc_stop(glusterd_svc_t *svc, int sig);
int
-glusterd_scrubsvc_reconfigure ();
+glusterd_scrubsvc_reconfigure();
void
-glusterd_scrubsvc_build_volfile_path (char *server, char *workdir,
- char *volfile, size_t len);
+glusterd_scrubsvc_build_volfile_path(char *server, char *workdir, char *volfile,
+ size_t len);
#endif
diff --git a/xlators/mgmt/glusterd/src/glusterd-server-quorum.h b/xlators/mgmt/glusterd/src/glusterd-server-quorum.h
index ea6a8bd6158..e11bf1a9206 100644
--- a/xlators/mgmt/glusterd/src/glusterd-server-quorum.h
+++ b/xlators/mgmt/glusterd/src/glusterd-server-quorum.h
@@ -11,36 +11,36 @@
#define _GLUSTERD_SERVER_QUORUM_H
int
-glusterd_validate_quorum (xlator_t *this, glusterd_op_t op, dict_t *dict,
- char **op_errstr);
+glusterd_validate_quorum(xlator_t *this, glusterd_op_t op, dict_t *dict,
+ char **op_errstr);
gf_boolean_t
-glusterd_is_quorum_changed (dict_t *options, char *option, char *value);
+glusterd_is_quorum_changed(dict_t *options, char *option, char *value);
int
-glusterd_do_quorum_action ();
+glusterd_do_quorum_action();
int
-glusterd_get_quorum_cluster_counts (xlator_t *this, int *active_count,
- int *quorum_count);
+glusterd_get_quorum_cluster_counts(xlator_t *this, int *active_count,
+ int *quorum_count);
gf_boolean_t
-glusterd_is_quorum_option (char *option);
+glusterd_is_quorum_option(char *option);
gf_boolean_t
-glusterd_is_volume_in_server_quorum (glusterd_volinfo_t *volinfo);
+glusterd_is_volume_in_server_quorum(glusterd_volinfo_t *volinfo);
gf_boolean_t
-glusterd_is_any_volume_in_server_quorum (xlator_t *this);
+glusterd_is_any_volume_in_server_quorum(xlator_t *this);
gf_boolean_t
-does_gd_meet_server_quorum (xlator_t *this);
+does_gd_meet_server_quorum(xlator_t *this);
int
-check_quorum_for_brick_start (glusterd_volinfo_t *volinfo,
- gf_boolean_t node_quorum);
+check_quorum_for_brick_start(glusterd_volinfo_t *volinfo,
+ gf_boolean_t node_quorum);
gf_boolean_t
-does_quorum_meet (int active_count, int quorum_count);
+does_quorum_meet(int active_count, int quorum_count);
#endif /* _GLUSTERD_SERVER_QUORUM_H */
diff --git a/xlators/mgmt/glusterd/src/glusterd-shd-svc.h b/xlators/mgmt/glusterd/src/glusterd-shd-svc.h
index 38a3fd1afd1..775a9d44a2c 100644
--- a/xlators/mgmt/glusterd/src/glusterd-shd-svc.h
+++ b/xlators/mgmt/glusterd/src/glusterd-shd-svc.h
@@ -14,17 +14,17 @@
#include "glusterd-svc-mgmt.h"
void
-glusterd_shdsvc_build (glusterd_svc_t *svc);
+glusterd_shdsvc_build(glusterd_svc_t *svc);
int
-glusterd_shdsvc_init (glusterd_svc_t *svc);
+glusterd_shdsvc_init(glusterd_svc_t *svc);
int
-glusterd_shdsvc_manager (glusterd_svc_t *svc, void *data, int flags);
+glusterd_shdsvc_manager(glusterd_svc_t *svc, void *data, int flags);
int
-glusterd_shdsvc_start (glusterd_svc_t *svc, int flags);
+glusterd_shdsvc_start(glusterd_svc_t *svc, int flags);
int
-glusterd_shdsvc_reconfigure ();
+glusterd_shdsvc_reconfigure();
#endif
diff --git a/xlators/mgmt/glusterd/src/glusterd-sm.h b/xlators/mgmt/glusterd/src/glusterd-sm.h
index 640468830d5..051e83c675d 100644
--- a/xlators/mgmt/glusterd/src/glusterd-sm.h
+++ b/xlators/mgmt/glusterd/src/glusterd-sm.h
@@ -26,196 +26,194 @@
#include "glusterd-rcu.h"
typedef enum gd_quorum_contribution_ {
- QUORUM_NONE,
- QUORUM_WAITING,
- QUORUM_DOWN,
- QUORUM_UP
+ QUORUM_NONE,
+ QUORUM_WAITING,
+ QUORUM_DOWN,
+ QUORUM_UP
} gd_quorum_contrib_t;
typedef enum glusterd_friend_sm_state_ {
- GD_FRIEND_STATE_DEFAULT = 0,
- GD_FRIEND_STATE_REQ_SENT,
- GD_FRIEND_STATE_REQ_RCVD,
- GD_FRIEND_STATE_BEFRIENDED,
- GD_FRIEND_STATE_REQ_ACCEPTED,
- GD_FRIEND_STATE_REQ_SENT_RCVD,
- GD_FRIEND_STATE_REJECTED,
- GD_FRIEND_STATE_UNFRIEND_SENT,
- GD_FRIEND_STATE_PROBE_RCVD,
- GD_FRIEND_STATE_CONNECTED_RCVD,
- GD_FRIEND_STATE_CONNECTED_ACCEPTED,
- GD_FRIEND_STATE_MAX
+ GD_FRIEND_STATE_DEFAULT = 0,
+ GD_FRIEND_STATE_REQ_SENT,
+ GD_FRIEND_STATE_REQ_RCVD,
+ GD_FRIEND_STATE_BEFRIENDED,
+ GD_FRIEND_STATE_REQ_ACCEPTED,
+ GD_FRIEND_STATE_REQ_SENT_RCVD,
+ GD_FRIEND_STATE_REJECTED,
+ GD_FRIEND_STATE_UNFRIEND_SENT,
+ GD_FRIEND_STATE_PROBE_RCVD,
+ GD_FRIEND_STATE_CONNECTED_RCVD,
+ GD_FRIEND_STATE_CONNECTED_ACCEPTED,
+ GD_FRIEND_STATE_MAX
} glusterd_friend_sm_state_t;
typedef struct glusterd_peer_state_info_ {
- glusterd_friend_sm_state_t state;
- struct timeval transition_time;
-}glusterd_peer_state_info_t;
+ glusterd_friend_sm_state_t state;
+ struct timeval transition_time;
+} glusterd_peer_state_info_t;
typedef struct glusterd_peer_hostname_ {
- char *hostname;
- struct cds_list_head hostname_list;
+ char *hostname;
+ struct cds_list_head hostname_list;
} glusterd_peer_hostname_t;
typedef struct glusterd_sm_transition_ {
- int old_state;
- int event;
- int new_state;
- time_t time;
+ int old_state;
+ int event;
+ int new_state;
+ time_t time;
} glusterd_sm_transition_t;
typedef struct glusterd_sm_tr_log_ {
- glusterd_sm_transition_t *transitions;
- size_t current;
- size_t size;
- size_t count;
- char* (*state_name_get) (int);
- char* (*event_name_get) (int);
+ glusterd_sm_transition_t *transitions;
+ size_t current;
+ size_t size;
+ size_t count;
+ char *(*state_name_get)(int);
+ char *(*event_name_get)(int);
} glusterd_sm_tr_log_t;
struct glusterd_peerinfo_ {
- uuid_t uuid;
- char uuid_str[50]; /* Retrieve this using
- * gd_peer_uuid_str ()
- */
- glusterd_peer_state_info_t state;
- char *hostname;
- struct cds_list_head hostnames;
- int port;
- struct cds_list_head uuid_list;
- struct cds_list_head op_peers_list;
- struct rpc_clnt *rpc;
- rpc_clnt_prog_t *mgmt;
- rpc_clnt_prog_t *peer;
- rpc_clnt_prog_t *mgmt_v3;
- int connected;
- gf_store_handle_t *shandle;
- glusterd_sm_tr_log_t sm_log;
- gf_boolean_t quorum_action;
- gd_quorum_contrib_t quorum_contrib;
- gf_boolean_t locked;
- gf_boolean_t detaching;
- /* Members required for proper cleanup using RCU */
- gd_rcu_head rcu_head;
- pthread_mutex_t delete_lock;
- uint32_t generation;
+ uuid_t uuid;
+ char uuid_str[50]; /* Retrieve this using
+ * gd_peer_uuid_str ()
+ */
+ glusterd_peer_state_info_t state;
+ char *hostname;
+ struct cds_list_head hostnames;
+ int port;
+ struct cds_list_head uuid_list;
+ struct cds_list_head op_peers_list;
+ struct rpc_clnt *rpc;
+ rpc_clnt_prog_t *mgmt;
+ rpc_clnt_prog_t *peer;
+ rpc_clnt_prog_t *mgmt_v3;
+ int connected;
+ gf_store_handle_t *shandle;
+ glusterd_sm_tr_log_t sm_log;
+ gf_boolean_t quorum_action;
+ gd_quorum_contrib_t quorum_contrib;
+ gf_boolean_t locked;
+ gf_boolean_t detaching;
+ /* Members required for proper cleanup using RCU */
+ gd_rcu_head rcu_head;
+ pthread_mutex_t delete_lock;
+ uint32_t generation;
};
typedef struct glusterd_peerinfo_ glusterd_peerinfo_t;
typedef struct glusterd_local_peers_ {
- glusterd_peerinfo_t *peerinfo;
- struct cds_list_head op_peers_list;
+ glusterd_peerinfo_t *peerinfo;
+ struct cds_list_head op_peers_list;
} glusterd_local_peers_t;
typedef enum glusterd_ev_gen_mode_ {
- GD_MODE_OFF,
- GD_MODE_ON,
- GD_MODE_SWITCH_ON
+ GD_MODE_OFF,
+ GD_MODE_ON,
+ GD_MODE_SWITCH_ON
} glusterd_ev_gen_mode_t;
typedef struct glusterd_peer_ctx_args_ {
- rpcsvc_request_t *req;
- glusterd_ev_gen_mode_t mode;
- dict_t *dict;
+ rpcsvc_request_t *req;
+ glusterd_ev_gen_mode_t mode;
+ dict_t *dict;
} glusterd_peerctx_args_t;
typedef struct glusterd_peer_ctx_ {
- glusterd_peerctx_args_t args;
- uuid_t peerid;
- char *peername;
- uint32_t peerinfo_gen;
- char *errstr;
+ glusterd_peerctx_args_t args;
+ uuid_t peerid;
+ char *peername;
+ uint32_t peerinfo_gen;
+ char *errstr;
} glusterd_peerctx_t;
typedef enum glusterd_friend_sm_event_type_ {
- GD_FRIEND_EVENT_NONE = 0,
- GD_FRIEND_EVENT_PROBE,
- GD_FRIEND_EVENT_INIT_FRIEND_REQ,
- GD_FRIEND_EVENT_RCVD_ACC,
- GD_FRIEND_EVENT_LOCAL_ACC,
- GD_FRIEND_EVENT_RCVD_RJT,
- GD_FRIEND_EVENT_LOCAL_RJT,
- GD_FRIEND_EVENT_RCVD_FRIEND_REQ,
- GD_FRIEND_EVENT_INIT_REMOVE_FRIEND,
- GD_FRIEND_EVENT_RCVD_REMOVE_FRIEND,
- GD_FRIEND_EVENT_REMOVE_FRIEND,
- GD_FRIEND_EVENT_CONNECTED,
- GD_FRIEND_EVENT_NEW_NAME,
- GD_FRIEND_EVENT_MAX
+ GD_FRIEND_EVENT_NONE = 0,
+ GD_FRIEND_EVENT_PROBE,
+ GD_FRIEND_EVENT_INIT_FRIEND_REQ,
+ GD_FRIEND_EVENT_RCVD_ACC,
+ GD_FRIEND_EVENT_LOCAL_ACC,
+ GD_FRIEND_EVENT_RCVD_RJT,
+ GD_FRIEND_EVENT_LOCAL_RJT,
+ GD_FRIEND_EVENT_RCVD_FRIEND_REQ,
+ GD_FRIEND_EVENT_INIT_REMOVE_FRIEND,
+ GD_FRIEND_EVENT_RCVD_REMOVE_FRIEND,
+ GD_FRIEND_EVENT_REMOVE_FRIEND,
+ GD_FRIEND_EVENT_CONNECTED,
+ GD_FRIEND_EVENT_NEW_NAME,
+ GD_FRIEND_EVENT_MAX
} glusterd_friend_sm_event_type_t;
-
typedef enum glusterd_friend_update_op_ {
- GD_FRIEND_UPDATE_NONE = 0,
- GD_FRIEND_UPDATE_ADD,
- GD_FRIEND_UPDATE_DEL,
+ GD_FRIEND_UPDATE_NONE = 0,
+ GD_FRIEND_UPDATE_ADD,
+ GD_FRIEND_UPDATE_DEL,
} glusterd_friend_update_op_t;
-
struct glusterd_friend_sm_event_ {
- struct cds_list_head list;
- uuid_t peerid;
- char *peername;
- void *ctx;
- glusterd_friend_sm_event_type_t event;
+ struct cds_list_head list;
+ uuid_t peerid;
+ char *peername;
+ void *ctx;
+ glusterd_friend_sm_event_type_t event;
};
typedef struct glusterd_friend_sm_event_ glusterd_friend_sm_event_t;
-typedef int (*glusterd_friend_sm_ac_fn) (glusterd_friend_sm_event_t *, void *);
+typedef int (*glusterd_friend_sm_ac_fn)(glusterd_friend_sm_event_t *, void *);
typedef struct glusterd_sm_ {
- glusterd_friend_sm_state_t next_state;
- glusterd_friend_sm_ac_fn handler;
+ glusterd_friend_sm_state_t next_state;
+ glusterd_friend_sm_ac_fn handler;
} glusterd_sm_t;
typedef struct glusterd_friend_req_ctx_ {
- uuid_t uuid;
- char *hostname;
- rpcsvc_request_t *req;
- int port;
- dict_t *vols;
+ uuid_t uuid;
+ char *hostname;
+ rpcsvc_request_t *req;
+ int port;
+ dict_t *vols;
} glusterd_friend_req_ctx_t;
typedef struct glusterd_friend_update_ctx_ {
- uuid_t uuid;
- char *hostname;
- int op;
+ uuid_t uuid;
+ char *hostname;
+ int op;
} glusterd_friend_update_ctx_t;
typedef struct glusterd_probe_ctx_ {
- char *hostname;
- rpcsvc_request_t *req;
- int port;
- dict_t *dict;
+ char *hostname;
+ rpcsvc_request_t *req;
+ int port;
+ dict_t *dict;
} glusterd_probe_ctx_t;
int
-glusterd_friend_sm_new_event (glusterd_friend_sm_event_type_t event_type,
- glusterd_friend_sm_event_t **new_event);
+glusterd_friend_sm_new_event(glusterd_friend_sm_event_type_t event_type,
+ glusterd_friend_sm_event_t **new_event);
int
-glusterd_friend_sm_inject_event (glusterd_friend_sm_event_t *event);
+glusterd_friend_sm_inject_event(glusterd_friend_sm_event_t *event);
int
-glusterd_friend_sm_init ();
+glusterd_friend_sm_init();
int
-glusterd_friend_sm ();
+glusterd_friend_sm();
void
-glusterd_destroy_probe_ctx (glusterd_probe_ctx_t *ctx);
+glusterd_destroy_probe_ctx(glusterd_probe_ctx_t *ctx);
void
-glusterd_destroy_friend_req_ctx (glusterd_friend_req_ctx_t *ctx);
+glusterd_destroy_friend_req_ctx(glusterd_friend_req_ctx_t *ctx);
-char*
-glusterd_friend_sm_state_name_get (int state);
+char *
+glusterd_friend_sm_state_name_get(int state);
-char*
-glusterd_friend_sm_event_name_get (int event);
+char *
+glusterd_friend_sm_event_name_get(int event);
int
-glusterd_broadcast_friend_delete (char *hostname, uuid_t uuid);
+glusterd_broadcast_friend_delete(char *hostname, uuid_t uuid);
void
-glusterd_destroy_friend_update_ctx (glusterd_friend_update_ctx_t *ctx);
+glusterd_destroy_friend_update_ctx(glusterd_friend_update_ctx_t *ctx);
#endif
diff --git a/xlators/mgmt/glusterd/src/glusterd-snapd-svc-helper.h b/xlators/mgmt/glusterd/src/glusterd-snapd-svc-helper.h
index 4c452b91658..3e23c2ce942 100644
--- a/xlators/mgmt/glusterd/src/glusterd-snapd-svc-helper.h
+++ b/xlators/mgmt/glusterd/src/glusterd-snapd-svc-helper.h
@@ -14,19 +14,19 @@
#include "glusterd.h"
void
-glusterd_svc_build_snapd_rundir (glusterd_volinfo_t *volinfo,
- char *path, int path_len);
+glusterd_svc_build_snapd_rundir(glusterd_volinfo_t *volinfo, char *path,
+ int path_len);
void
-glusterd_svc_build_snapd_socket_filepath (glusterd_volinfo_t *volinfo,
- char *path, int path_len);
+glusterd_svc_build_snapd_socket_filepath(glusterd_volinfo_t *volinfo,
+ char *path, int path_len);
void
-glusterd_svc_build_snapd_pidfile (glusterd_volinfo_t *volinfo,
- char *path, int path_len);
+glusterd_svc_build_snapd_pidfile(glusterd_volinfo_t *volinfo, char *path,
+ int path_len);
void
-glusterd_svc_build_snapd_volfile (glusterd_volinfo_t *volinfo,
- char *path, int path_len);
+glusterd_svc_build_snapd_volfile(glusterd_volinfo_t *volinfo, char *path,
+ int path_len);
#endif
diff --git a/xlators/mgmt/glusterd/src/glusterd-snapd-svc.h b/xlators/mgmt/glusterd/src/glusterd-snapd-svc.h
index 40dae848f58..c95e4cc7661 100644
--- a/xlators/mgmt/glusterd/src/glusterd-snapd-svc.h
+++ b/xlators/mgmt/glusterd/src/glusterd-snapd-svc.h
@@ -15,28 +15,28 @@
typedef struct glusterd_snapdsvc_ glusterd_snapdsvc_t;
-struct glusterd_snapdsvc_{
- glusterd_svc_t svc;
- int port;
- gf_store_handle_t *handle;
+struct glusterd_snapdsvc_ {
+ glusterd_svc_t svc;
+ int port;
+ gf_store_handle_t *handle;
};
void
-glusterd_snapdsvc_build (glusterd_svc_t *svc);
+glusterd_snapdsvc_build(glusterd_svc_t *svc);
int
-glusterd_snapdsvc_init (void *data);
+glusterd_snapdsvc_init(void *data);
int
-glusterd_snapdsvc_manager (glusterd_svc_t *svc, void *data, int flags);
+glusterd_snapdsvc_manager(glusterd_svc_t *svc, void *data, int flags);
int
-glusterd_snapdsvc_start (glusterd_svc_t *svc, int flags);
+glusterd_snapdsvc_start(glusterd_svc_t *svc, int flags);
int
-glusterd_snapdsvc_restart ();
+glusterd_snapdsvc_restart();
int
-glusterd_snapdsvc_rpc_notify (glusterd_conn_t *conn, rpc_clnt_event_t event);
+glusterd_snapdsvc_rpc_notify(glusterd_conn_t *conn, rpc_clnt_event_t event);
#endif
diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.h b/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.h
index d619f1d3106..19fedecee8d 100644
--- a/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.h
+++ b/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.h
@@ -11,154 +11,149 @@
#define _GLUSTERD_SNAP_UTILS_H
int32_t
-glusterd_snap_volinfo_find (char *volname, glusterd_snap_t *snap,
- glusterd_volinfo_t **volinfo);
+glusterd_snap_volinfo_find(char *volname, glusterd_snap_t *snap,
+ glusterd_volinfo_t **volinfo);
int32_t
-glusterd_snap_volinfo_find_from_parent_volname (char *origin_volname,
- glusterd_snap_t *snap,
- glusterd_volinfo_t **volinfo);
+glusterd_snap_volinfo_find_from_parent_volname(char *origin_volname,
+ glusterd_snap_t *snap,
+ glusterd_volinfo_t **volinfo);
int
-glusterd_snap_volinfo_find_by_volume_id (uuid_t volume_id,
- glusterd_volinfo_t **volinfo);
+glusterd_snap_volinfo_find_by_volume_id(uuid_t volume_id,
+ glusterd_volinfo_t **volinfo);
int32_t
-glusterd_add_snapd_to_dict (glusterd_volinfo_t *volinfo,
- dict_t *dict, int32_t count);
+glusterd_add_snapd_to_dict(glusterd_volinfo_t *volinfo, dict_t *dict,
+ int32_t count);
int
-glusterd_compare_snap_time (struct cds_list_head *, struct cds_list_head *);
+glusterd_compare_snap_time(struct cds_list_head *, struct cds_list_head *);
int
-glusterd_compare_snap_vol_time (struct cds_list_head *, struct cds_list_head *);
+glusterd_compare_snap_vol_time(struct cds_list_head *, struct cds_list_head *);
int32_t
-glusterd_snap_volinfo_restore (dict_t *dict, dict_t *rsp_dict,
- glusterd_volinfo_t *new_volinfo,
- glusterd_volinfo_t *snap_volinfo,
- int32_t volcount);
+glusterd_snap_volinfo_restore(dict_t *dict, dict_t *rsp_dict,
+ glusterd_volinfo_t *new_volinfo,
+ glusterd_volinfo_t *snap_volinfo,
+ int32_t volcount);
int32_t
-glusterd_snapobject_delete (glusterd_snap_t *snap);
+glusterd_snapobject_delete(glusterd_snap_t *snap);
int32_t
-glusterd_cleanup_snaps_for_volume (glusterd_volinfo_t *volinfo);
+glusterd_cleanup_snaps_for_volume(glusterd_volinfo_t *volinfo);
int32_t
-glusterd_missed_snapinfo_new (glusterd_missed_snap_info **missed_snapinfo);
+glusterd_missed_snapinfo_new(glusterd_missed_snap_info **missed_snapinfo);
int32_t
-glusterd_missed_snap_op_new (glusterd_snap_op_t **snap_op);
+glusterd_missed_snap_op_new(glusterd_snap_op_t **snap_op);
int32_t
-glusterd_add_missed_snaps_to_dict (dict_t *rsp_dict,
- glusterd_volinfo_t *snap_vol,
- glusterd_brickinfo_t *brickinfo,
- int32_t brick_number, int32_t op);
+glusterd_add_missed_snaps_to_dict(dict_t *rsp_dict,
+ glusterd_volinfo_t *snap_vol,
+ glusterd_brickinfo_t *brickinfo,
+ int32_t brick_number, int32_t op);
int32_t
-glusterd_add_missed_snaps_to_export_dict (dict_t *peer_data);
+glusterd_add_missed_snaps_to_export_dict(dict_t *peer_data);
int32_t
-glusterd_import_friend_missed_snap_list (dict_t *peer_data);
+glusterd_import_friend_missed_snap_list(dict_t *peer_data);
int
-gd_restore_snap_volume (dict_t *dict, dict_t *rsp_dict,
- glusterd_volinfo_t *orig_vol,
- glusterd_volinfo_t *snap_vol,
- int32_t volcount);
+gd_restore_snap_volume(dict_t *dict, dict_t *rsp_dict,
+ glusterd_volinfo_t *orig_vol,
+ glusterd_volinfo_t *snap_vol, int32_t volcount);
int32_t
-glusterd_mount_lvm_snapshot (glusterd_brickinfo_t *brickinfo,
- char *brick_mount_path);
+glusterd_mount_lvm_snapshot(glusterd_brickinfo_t *brickinfo,
+ char *brick_mount_path);
int32_t
-glusterd_umount (const char *path);
+glusterd_umount(const char *path);
int32_t
-glusterd_snap_unmount (xlator_t *this, glusterd_volinfo_t *volinfo);
+glusterd_snap_unmount(xlator_t *this, glusterd_volinfo_t *volinfo);
int32_t
-glusterd_add_snapshots_to_export_dict (dict_t *peer_data);
+glusterd_add_snapshots_to_export_dict(dict_t *peer_data);
int32_t
-glusterd_compare_friend_snapshots (dict_t *peer_data, char *peername,
- uuid_t peerid);
+glusterd_compare_friend_snapshots(dict_t *peer_data, char *peername,
+ uuid_t peerid);
int32_t
-glusterd_store_create_snap_dir (glusterd_snap_t *snap);
+glusterd_store_create_snap_dir(glusterd_snap_t *snap);
int32_t
-glusterd_copy_file (const char *source, const char *destination);
+glusterd_copy_file(const char *source, const char *destination);
int32_t
-glusterd_copy_folder (const char *source, const char *destination);
+glusterd_copy_folder(const char *source, const char *destination);
int32_t
-glusterd_get_geo_rep_session (char *slave_key, char *origin_volname,
- dict_t *gsync_slaves_dict, char *session,
- char *slave);
+glusterd_get_geo_rep_session(char *slave_key, char *origin_volname,
+ dict_t *gsync_slaves_dict, char *session,
+ char *slave);
int32_t
-glusterd_restore_geo_rep_files (glusterd_volinfo_t *snap_vol);
+glusterd_restore_geo_rep_files(glusterd_volinfo_t *snap_vol);
int32_t
-glusterd_copy_quota_files (glusterd_volinfo_t *src_vol,
- glusterd_volinfo_t *dest_vol,
- gf_boolean_t *conf_present);
+glusterd_copy_quota_files(glusterd_volinfo_t *src_vol,
+ glusterd_volinfo_t *dest_vol,
+ gf_boolean_t *conf_present);
int
-glusterd_snap_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict);
+glusterd_snap_use_rsp_dict(dict_t *aggr, dict_t *rsp_dict);
int
-gd_add_vol_snap_details_to_dict (dict_t *dict, char *prefix,
- glusterd_volinfo_t *volinfo);
+gd_add_vol_snap_details_to_dict(dict_t *dict, char *prefix,
+ glusterd_volinfo_t *volinfo);
int
-gd_add_brick_snap_details_to_dict (dict_t *dict, char *prefix,
- glusterd_brickinfo_t *brickinfo);
+gd_add_brick_snap_details_to_dict(dict_t *dict, char *prefix,
+ glusterd_brickinfo_t *brickinfo);
int
-gd_import_new_brick_snap_details (dict_t *dict, char *prefix,
- glusterd_brickinfo_t *brickinfo);
+gd_import_new_brick_snap_details(dict_t *dict, char *prefix,
+ glusterd_brickinfo_t *brickinfo);
int
-gd_import_volume_snap_details (dict_t *dict, glusterd_volinfo_t *volinfo,
- char *prefix, char *volname);
+gd_import_volume_snap_details(dict_t *dict, glusterd_volinfo_t *volinfo,
+ char *prefix, char *volname);
int32_t
-glusterd_snap_quorum_check (dict_t *dict, gf_boolean_t snap_volume,
- char **op_errstr, uint32_t *op_errno);
+glusterd_snap_quorum_check(dict_t *dict, gf_boolean_t snap_volume,
+ char **op_errstr, uint32_t *op_errno);
int32_t
-glusterd_snap_brick_create (glusterd_volinfo_t *snap_volinfo,
- glusterd_brickinfo_t *brickinfo,
- int32_t brick_count, int32_t clone);
+glusterd_snap_brick_create(glusterd_volinfo_t *snap_volinfo,
+ glusterd_brickinfo_t *brickinfo, int32_t brick_count,
+ int32_t clone);
int
-glusterd_snapshot_restore_cleanup (dict_t *rsp_dict,
- char *volname,
- glusterd_snap_t *snap);
+glusterd_snapshot_restore_cleanup(dict_t *rsp_dict, char *volname,
+ glusterd_snap_t *snap);
void
-glusterd_get_snapd_dir (glusterd_volinfo_t *volinfo,
- char *path, int path_len);
+glusterd_get_snapd_dir(glusterd_volinfo_t *volinfo, char *path, int path_len);
int
-glusterd_is_snapd_enabled (glusterd_volinfo_t *volinfo);
+glusterd_is_snapd_enabled(glusterd_volinfo_t *volinfo);
int32_t
-glusterd_check_and_set_config_limit (glusterd_conf_t *priv);
+glusterd_check_and_set_config_limit(glusterd_conf_t *priv);
int32_t
-glusterd_is_snap_soft_limit_reached (glusterd_volinfo_t *volinfo,
- dict_t *dict);
+glusterd_is_snap_soft_limit_reached(glusterd_volinfo_t *volinfo, dict_t *dict);
void
-gd_get_snap_conf_values_if_present (dict_t *opts, uint64_t *sys_hard_limit,
- uint64_t *sys_soft_limit);
+gd_get_snap_conf_values_if_present(dict_t *opts, uint64_t *sys_hard_limit,
+ uint64_t *sys_soft_limit);
int
-glusterd_get_snap_status_str (glusterd_snap_t *snapinfo, char *snap_status_str);
+glusterd_get_snap_status_str(glusterd_snap_t *snapinfo, char *snap_status_str);
#endif
-
diff --git a/xlators/mgmt/glusterd/src/glusterd-statedump.h b/xlators/mgmt/glusterd/src/glusterd-statedump.h
index 3ac8659f293..7d7fc1a7fa3 100644
--- a/xlators/mgmt/glusterd/src/glusterd-statedump.h
+++ b/xlators/mgmt/glusterd/src/glusterd-statedump.h
@@ -14,5 +14,5 @@
#include "xlator.h"
int
-glusterd_dump_priv (xlator_t *this);
+glusterd_dump_priv(xlator_t *this);
#endif
diff --git a/xlators/mgmt/glusterd/src/glusterd-store.h b/xlators/mgmt/glusterd/src/glusterd-store.h
index d809f2c7963..5db77703482 100644
--- a/xlators/mgmt/glusterd/src/glusterd-store.h
+++ b/xlators/mgmt/glusterd/src/glusterd-store.h
@@ -22,187 +22,185 @@
#include "glusterd.h"
#include "rpcsvc.h"
-typedef enum glusterd_store_ver_ac_{
- GLUSTERD_VOLINFO_VER_AC_NONE = 0,
- GLUSTERD_VOLINFO_VER_AC_INCREMENT = 1,
- GLUSTERD_VOLINFO_VER_AC_DECREMENT = 2,
+typedef enum glusterd_store_ver_ac_ {
+ GLUSTERD_VOLINFO_VER_AC_NONE = 0,
+ GLUSTERD_VOLINFO_VER_AC_INCREMENT = 1,
+ GLUSTERD_VOLINFO_VER_AC_DECREMENT = 2,
} glusterd_volinfo_ver_ac_t;
-
-#define GLUSTERD_STORE_UUID_KEY "UUID"
-
-#define GLUSTERD_STORE_KEY_VOL_TYPE "type"
-#define GLUSTERD_STORE_KEY_VOL_COUNT "count"
-#define GLUSTERD_STORE_KEY_VOL_STATUS "status"
-#define GLUSTERD_STORE_KEY_VOL_PORT "port"
-#define GLUSTERD_STORE_KEY_VOL_SUB_COUNT "sub_count"
-#define GLUSTERD_STORE_KEY_VOL_STRIPE_CNT "stripe_count"
-#define GLUSTERD_STORE_KEY_VOL_REPLICA_CNT "replica_count"
-#define GLUSTERD_STORE_KEY_VOL_DISPERSE_CNT "disperse_count"
-#define GLUSTERD_STORE_KEY_VOL_REDUNDANCY_CNT "redundancy_count"
-#define GLUSTERD_STORE_KEY_VOL_ARBITER_CNT "arbiter_count"
-#define GLUSTERD_STORE_KEY_VOL_BRICK "brick"
-#define GLUSTERD_STORE_KEY_VOL_VERSION "version"
-#define GLUSTERD_STORE_KEY_VOL_TRANSPORT "transport-type"
-#define GLUSTERD_STORE_KEY_VOL_ID "volume-id"
-#define GLUSTERD_STORE_KEY_VOL_RESTORED_SNAP "restored_from_snap"
-#define GLUSTERD_STORE_KEY_RB_STATUS "rb_status"
-#define GLUSTERD_STORE_KEY_RB_SRC_BRICK "rb_src"
-#define GLUSTERD_STORE_KEY_RB_DST_BRICK "rb_dst"
-#define GLUSTERD_STORE_KEY_RB_DST_PORT "rb_port"
-#define GLUSTERD_STORE_KEY_VOL_DEFRAG "rebalance_status"
-#define GLUSTERD_STORE_KEY_VOL_DEFRAG_STATUS "status"
-#define GLUSTERD_STORE_KEY_DEFRAG_OP "rebalance_op"
-#define GLUSTERD_STORE_KEY_USERNAME "username"
-#define GLUSTERD_STORE_KEY_PASSWORD "password"
-#define GLUSTERD_STORE_KEY_PARENT_VOLNAME "parent_volname"
-#define GLUSTERD_STORE_KEY_VOL_OP_VERSION "op-version"
+#define GLUSTERD_STORE_UUID_KEY "UUID"
+
+#define GLUSTERD_STORE_KEY_VOL_TYPE "type"
+#define GLUSTERD_STORE_KEY_VOL_COUNT "count"
+#define GLUSTERD_STORE_KEY_VOL_STATUS "status"
+#define GLUSTERD_STORE_KEY_VOL_PORT "port"
+#define GLUSTERD_STORE_KEY_VOL_SUB_COUNT "sub_count"
+#define GLUSTERD_STORE_KEY_VOL_STRIPE_CNT "stripe_count"
+#define GLUSTERD_STORE_KEY_VOL_REPLICA_CNT "replica_count"
+#define GLUSTERD_STORE_KEY_VOL_DISPERSE_CNT "disperse_count"
+#define GLUSTERD_STORE_KEY_VOL_REDUNDANCY_CNT "redundancy_count"
+#define GLUSTERD_STORE_KEY_VOL_ARBITER_CNT "arbiter_count"
+#define GLUSTERD_STORE_KEY_VOL_BRICK "brick"
+#define GLUSTERD_STORE_KEY_VOL_VERSION "version"
+#define GLUSTERD_STORE_KEY_VOL_TRANSPORT "transport-type"
+#define GLUSTERD_STORE_KEY_VOL_ID "volume-id"
+#define GLUSTERD_STORE_KEY_VOL_RESTORED_SNAP "restored_from_snap"
+#define GLUSTERD_STORE_KEY_RB_STATUS "rb_status"
+#define GLUSTERD_STORE_KEY_RB_SRC_BRICK "rb_src"
+#define GLUSTERD_STORE_KEY_RB_DST_BRICK "rb_dst"
+#define GLUSTERD_STORE_KEY_RB_DST_PORT "rb_port"
+#define GLUSTERD_STORE_KEY_VOL_DEFRAG "rebalance_status"
+#define GLUSTERD_STORE_KEY_VOL_DEFRAG_STATUS "status"
+#define GLUSTERD_STORE_KEY_DEFRAG_OP "rebalance_op"
+#define GLUSTERD_STORE_KEY_USERNAME "username"
+#define GLUSTERD_STORE_KEY_PASSWORD "password"
+#define GLUSTERD_STORE_KEY_PARENT_VOLNAME "parent_volname"
+#define GLUSTERD_STORE_KEY_VOL_OP_VERSION "op-version"
#define GLUSTERD_STORE_KEY_VOL_CLIENT_OP_VERSION "client-op-version"
-#define GLUSTERD_STORE_KEY_VOL_QUOTA_VERSION "quota-version"
-
-#define GLUSTERD_STORE_KEY_VOL_TIER_STATUS "tier_status"
-#define GLUSTERD_STORE_KEY_TIER_DETACH_OP "tier_op"
-#define GLUSTERD_STORE_KEY_COLD_TYPE "cold_type"
-#define GLUSTERD_STORE_KEY_COLD_COUNT "cold_count"
-#define GLUSTERD_STORE_KEY_COLD_REPLICA_COUNT "cold_replica_count"
-#define GLUSTERD_STORE_KEY_COLD_DISPERSE_COUNT "cold_disperse_count"
-#define GLUSTERD_STORE_KEY_COLD_REDUNDANCY_COUNT "cold_redundancy_count"
-#define GLUSTERD_STORE_KEY_HOT_TYPE "hot_type"
-#define GLUSTERD_STORE_KEY_HOT_COUNT "hot_count"
-#define GLUSTERD_STORE_KEY_HOT_REPLICA_COUNT "hot_replica_count"
-
-#define GLUSTERD_STORE_KEY_SNAP_NAME "name"
-#define GLUSTERD_STORE_KEY_SNAP_ID "snap-id"
-#define GLUSTERD_STORE_KEY_SNAP_DESC "desc"
-#define GLUSTERD_STORE_KEY_SNAP_TIMESTAMP "time-stamp"
-#define GLUSTERD_STORE_KEY_SNAP_STATUS "status"
-#define GLUSTERD_STORE_KEY_SNAP_RESTORED "snap-restored"
-#define GLUSTERD_STORE_KEY_SNAP_MAX_HARD_LIMIT "snap-max-hard-limit"
-#define GLUSTERD_STORE_KEY_SNAP_AUTO_DELETE "auto-delete"
-#define GLUSTERD_STORE_KEY_SNAP_MAX_SOFT_LIMIT "snap-max-soft-limit"
-#define GLUSTERD_STORE_KEY_SNAPD_PORT "snapd-port"
-#define GLUSTERD_STORE_KEY_SNAP_ACTIVATE "snap-activate-on-create"
-
-#define GLUSTERD_STORE_KEY_BRICK_HOSTNAME "hostname"
-#define GLUSTERD_STORE_KEY_BRICK_PATH "path"
-#define GLUSTERD_STORE_KEY_BRICK_REAL_PATH "real_path"
-#define GLUSTERD_STORE_KEY_BRICK_PORT "listen-port"
-#define GLUSTERD_STORE_KEY_BRICK_RDMA_PORT "rdma.listen-port"
+#define GLUSTERD_STORE_KEY_VOL_QUOTA_VERSION "quota-version"
+
+#define GLUSTERD_STORE_KEY_VOL_TIER_STATUS "tier_status"
+#define GLUSTERD_STORE_KEY_TIER_DETACH_OP "tier_op"
+#define GLUSTERD_STORE_KEY_COLD_TYPE "cold_type"
+#define GLUSTERD_STORE_KEY_COLD_COUNT "cold_count"
+#define GLUSTERD_STORE_KEY_COLD_REPLICA_COUNT "cold_replica_count"
+#define GLUSTERD_STORE_KEY_COLD_DISPERSE_COUNT "cold_disperse_count"
+#define GLUSTERD_STORE_KEY_COLD_REDUNDANCY_COUNT "cold_redundancy_count"
+#define GLUSTERD_STORE_KEY_HOT_TYPE "hot_type"
+#define GLUSTERD_STORE_KEY_HOT_COUNT "hot_count"
+#define GLUSTERD_STORE_KEY_HOT_REPLICA_COUNT "hot_replica_count"
+
+#define GLUSTERD_STORE_KEY_SNAP_NAME "name"
+#define GLUSTERD_STORE_KEY_SNAP_ID "snap-id"
+#define GLUSTERD_STORE_KEY_SNAP_DESC "desc"
+#define GLUSTERD_STORE_KEY_SNAP_TIMESTAMP "time-stamp"
+#define GLUSTERD_STORE_KEY_SNAP_STATUS "status"
+#define GLUSTERD_STORE_KEY_SNAP_RESTORED "snap-restored"
+#define GLUSTERD_STORE_KEY_SNAP_MAX_HARD_LIMIT "snap-max-hard-limit"
+#define GLUSTERD_STORE_KEY_SNAP_AUTO_DELETE "auto-delete"
+#define GLUSTERD_STORE_KEY_SNAP_MAX_SOFT_LIMIT "snap-max-soft-limit"
+#define GLUSTERD_STORE_KEY_SNAPD_PORT "snapd-port"
+#define GLUSTERD_STORE_KEY_SNAP_ACTIVATE "snap-activate-on-create"
+
+#define GLUSTERD_STORE_KEY_BRICK_HOSTNAME "hostname"
+#define GLUSTERD_STORE_KEY_BRICK_PATH "path"
+#define GLUSTERD_STORE_KEY_BRICK_REAL_PATH "real_path"
+#define GLUSTERD_STORE_KEY_BRICK_PORT "listen-port"
+#define GLUSTERD_STORE_KEY_BRICK_RDMA_PORT "rdma.listen-port"
#define GLUSTERD_STORE_KEY_BRICK_DECOMMISSIONED "decommissioned"
-#define GLUSTERD_STORE_KEY_BRICK_VGNAME "vg"
-#define GLUSTERD_STORE_KEY_BRICK_DEVICE_PATH "device_path"
-#define GLUSTERD_STORE_KEY_BRICK_MOUNT_DIR "mount_dir"
-#define GLUSTERD_STORE_KEY_BRICK_SNAP_STATUS "snap-status"
-#define GLUSTERD_STORE_KEY_BRICK_FSTYPE "fs-type"
-#define GLUSTERD_STORE_KEY_BRICK_MNTOPTS "mnt-opts"
-#define GLUSTERD_STORE_KEY_BRICK_ID "brick-id"
-#define GLUSTERD_STORE_KEY_BRICK_FSID "brick-fsid"
-#define GLUSTERD_STORE_KEY_BRICK_UUID "uuid"
-
-#define GLUSTERD_STORE_KEY_PEER_UUID "uuid"
-#define GLUSTERD_STORE_KEY_PEER_HOSTNAME "hostname"
-#define GLUSTERD_STORE_KEY_PEER_STATE "state"
-
-#define GLUSTERD_STORE_KEY_VOL_CAPS "caps"
+#define GLUSTERD_STORE_KEY_BRICK_VGNAME "vg"
+#define GLUSTERD_STORE_KEY_BRICK_DEVICE_PATH "device_path"
+#define GLUSTERD_STORE_KEY_BRICK_MOUNT_DIR "mount_dir"
+#define GLUSTERD_STORE_KEY_BRICK_SNAP_STATUS "snap-status"
+#define GLUSTERD_STORE_KEY_BRICK_FSTYPE "fs-type"
+#define GLUSTERD_STORE_KEY_BRICK_MNTOPTS "mnt-opts"
+#define GLUSTERD_STORE_KEY_BRICK_ID "brick-id"
+#define GLUSTERD_STORE_KEY_BRICK_FSID "brick-fsid"
+#define GLUSTERD_STORE_KEY_BRICK_UUID "uuid"
+
+#define GLUSTERD_STORE_KEY_PEER_UUID "uuid"
+#define GLUSTERD_STORE_KEY_PEER_HOSTNAME "hostname"
+#define GLUSTERD_STORE_KEY_PEER_STATE "state"
+
+#define GLUSTERD_STORE_KEY_VOL_CAPS "caps"
#define GLUSTERD_STORE_KEY_VOL_DEFRAG_REB_FILES "rebalanced-files"
-#define GLUSTERD_STORE_KEY_VOL_DEFRAG_SIZE "size"
-#define GLUSTERD_STORE_KEY_VOL_DEFRAG_SCANNED "scanned"
-#define GLUSTERD_STORE_KEY_VOL_DEFRAG_FAILURES "failures"
-#define GLUSTERD_STORE_KEY_VOL_DEFRAG_SKIPPED "skipped"
-#define GLUSTERD_STORE_KEY_VOL_DEFRAG_RUN_TIME "run-time"
+#define GLUSTERD_STORE_KEY_VOL_DEFRAG_SIZE "size"
+#define GLUSTERD_STORE_KEY_VOL_DEFRAG_SCANNED "scanned"
+#define GLUSTERD_STORE_KEY_VOL_DEFRAG_FAILURES "failures"
+#define GLUSTERD_STORE_KEY_VOL_DEFRAG_SKIPPED "skipped"
+#define GLUSTERD_STORE_KEY_VOL_DEFRAG_RUN_TIME "run-time"
-#define GLUSTERD_STORE_KEY_VOL_MIGRATED_FILES "migrated-files"
-#define GLUSTERD_STORE_KEY_VOL_MIGRATED_SIZE "migration-size"
-#define GLUSTERD_STORE_KEY_VOL_MIGRATIONS_SCANNED "migration-scanned"
-#define GLUSTERD_STORE_KEY_VOL_MIGRATIONS_FAILURES "migration-failures"
-#define GLUSTERD_STORE_KEY_VOL_MIGRATIONS_SKIPPED "migration-skipped"
-#define GLUSTERD_STORE_KEY_VOL_MIGRATION_RUN_TIME "migration-run-time"
+#define GLUSTERD_STORE_KEY_VOL_MIGRATED_FILES "migrated-files"
+#define GLUSTERD_STORE_KEY_VOL_MIGRATED_SIZE "migration-size"
+#define GLUSTERD_STORE_KEY_VOL_MIGRATIONS_SCANNED "migration-scanned"
+#define GLUSTERD_STORE_KEY_VOL_MIGRATIONS_FAILURES "migration-failures"
+#define GLUSTERD_STORE_KEY_VOL_MIGRATIONS_SKIPPED "migration-skipped"
+#define GLUSTERD_STORE_KEY_VOL_MIGRATION_RUN_TIME "migration-run-time"
int32_t
-glusterd_store_volinfo (glusterd_volinfo_t *volinfo, glusterd_volinfo_ver_ac_t ac);
+glusterd_store_volinfo(glusterd_volinfo_t *volinfo,
+ glusterd_volinfo_ver_ac_t ac);
int32_t
-glusterd_store_delete_volume (glusterd_volinfo_t *volinfo);
+glusterd_store_delete_volume(glusterd_volinfo_t *volinfo);
int32_t
-glusterd_store_delete_snap (glusterd_snap_t *snap);
+glusterd_store_delete_snap(glusterd_snap_t *snap);
int32_t
-glusterd_retrieve_uuid ();
+glusterd_retrieve_uuid();
int32_t
-glusterd_store_peerinfo (glusterd_peerinfo_t *peerinfo);
+glusterd_store_peerinfo(glusterd_peerinfo_t *peerinfo);
int32_t
-glusterd_store_delete_peerinfo (glusterd_peerinfo_t *peerinfo);
+glusterd_store_delete_peerinfo(glusterd_peerinfo_t *peerinfo);
int32_t
-glusterd_store_delete_brick (glusterd_brickinfo_t *brickinfo,
- char *delete_path);
+glusterd_store_delete_brick(glusterd_brickinfo_t *brickinfo, char *delete_path);
int32_t
-glusterd_restore ();
+glusterd_restore();
void
-glusterd_perform_volinfo_version_action (glusterd_volinfo_t *volinfo,
- glusterd_volinfo_ver_ac_t ac);
+glusterd_perform_volinfo_version_action(glusterd_volinfo_t *volinfo,
+ glusterd_volinfo_ver_ac_t ac);
gf_boolean_t
-glusterd_store_is_valid_brickpath (char *volname, char *brick);
+glusterd_store_is_valid_brickpath(char *volname, char *brick);
int32_t
-glusterd_store_perform_node_state_store (glusterd_volinfo_t *volinfo);
+glusterd_store_perform_node_state_store(glusterd_volinfo_t *volinfo);
int
-glusterd_retrieve_op_version (xlator_t *this, int *op_version);
+glusterd_retrieve_op_version(xlator_t *this, int *op_version);
int
-glusterd_store_global_info (xlator_t *this);
+glusterd_store_global_info(xlator_t *this);
int32_t
-glusterd_store_retrieve_options (xlator_t *this);
+glusterd_store_retrieve_options(xlator_t *this);
int32_t
-glusterd_store_retrieve_bricks (glusterd_volinfo_t *volinfo);
+glusterd_store_retrieve_bricks(glusterd_volinfo_t *volinfo);
int32_t
-glusterd_store_options (xlator_t *this, dict_t *opts);
+glusterd_store_options(xlator_t *this, dict_t *opts);
void
-glusterd_replace_slash_with_hyphen (char *str);
+glusterd_replace_slash_with_hyphen(char *str);
int32_t
-glusterd_store_perform_volume_store (glusterd_volinfo_t *volinfo);
+glusterd_store_perform_volume_store(glusterd_volinfo_t *volinfo);
int32_t
-glusterd_store_create_quota_conf_sh_on_absence (glusterd_volinfo_t *volinfo);
+glusterd_store_create_quota_conf_sh_on_absence(glusterd_volinfo_t *volinfo);
int
-glusterd_store_retrieve_quota_version (glusterd_volinfo_t *volinfo);
+glusterd_store_retrieve_quota_version(glusterd_volinfo_t *volinfo);
int
-glusterd_store_save_quota_version_and_cksum (glusterd_volinfo_t *volinfo);
+glusterd_store_save_quota_version_and_cksum(glusterd_volinfo_t *volinfo);
int32_t
-glusterd_store_snap (glusterd_snap_t *snap);
+glusterd_store_snap(glusterd_snap_t *snap);
int32_t
-glusterd_store_update_missed_snaps ();
+glusterd_store_update_missed_snaps();
-glusterd_volinfo_t*
-glusterd_store_retrieve_volume (char *volname, glusterd_snap_t *snap);
+glusterd_volinfo_t *
+glusterd_store_retrieve_volume(char *volname, glusterd_snap_t *snap);
int
-glusterd_restore_op_version (xlator_t *this);
+glusterd_restore_op_version(xlator_t *this);
int32_t
-glusterd_quota_conf_write_header (int fd);
+glusterd_quota_conf_write_header(int fd);
int32_t
-glusterd_quota_conf_write_gfid (int fd, void *buf, char type);
+glusterd_quota_conf_write_gfid(int fd, void *buf, char type);
int32_t
-glusterd_recreate_vol_brick_mounts (xlator_t *this,
- glusterd_volinfo_t *volinfo);
+glusterd_recreate_vol_brick_mounts(xlator_t *this, glusterd_volinfo_t *volinfo);
#endif
diff --git a/xlators/mgmt/glusterd/src/glusterd-svc-helper.h b/xlators/mgmt/glusterd/src/glusterd-svc-helper.h
index bbba5ce9ee4..cc98e788bbe 100644
--- a/xlators/mgmt/glusterd/src/glusterd-svc-helper.h
+++ b/xlators/mgmt/glusterd/src/glusterd-svc-helper.h
@@ -16,30 +16,30 @@
#include "glusterd-volgen.h"
int
-glusterd_svcs_reconfigure ();
+glusterd_svcs_reconfigure();
int
-glusterd_svcs_stop ();
+glusterd_svcs_stop();
int
-glusterd_svcs_manager (glusterd_volinfo_t *volinfo);
+glusterd_svcs_manager(glusterd_volinfo_t *volinfo);
int
-glusterd_svc_check_volfile_identical (char *svc_name,
+glusterd_svc_check_volfile_identical(char *svc_name,
+ glusterd_graph_builder_t builder,
+ gf_boolean_t *identical);
+int
+glusterd_svc_check_topology_identical(char *svc_name,
glusterd_graph_builder_t builder,
gf_boolean_t *identical);
-int
-glusterd_svc_check_topology_identical (char *svc_name,
- glusterd_graph_builder_t builder,
- gf_boolean_t *identical);
int
-glusterd_svc_check_tier_volfile_identical (char *svc_name,
+glusterd_svc_check_tier_volfile_identical(char *svc_name,
+ glusterd_volinfo_t *volinfo,
+ gf_boolean_t *identical);
+int
+glusterd_svc_check_tier_topology_identical(char *svc_name,
glusterd_volinfo_t *volinfo,
gf_boolean_t *identical);
-int
-glusterd_svc_check_tier_topology_identical (char *svc_name,
- glusterd_volinfo_t *volinfo,
- gf_boolean_t *identical);
#endif
diff --git a/xlators/mgmt/glusterd/src/glusterd-svc-mgmt.h b/xlators/mgmt/glusterd/src/glusterd-svc-mgmt.h
index 8b70a62a4e3..3bf142b58d3 100644
--- a/xlators/mgmt/glusterd/src/glusterd-svc-mgmt.h
+++ b/xlators/mgmt/glusterd/src/glusterd-svc-mgmt.h
@@ -17,59 +17,56 @@
struct glusterd_svc_;
typedef struct glusterd_svc_ glusterd_svc_t;
-typedef void (*glusterd_svc_build_t) (glusterd_svc_t *svc);
+typedef void (*glusterd_svc_build_t)(glusterd_svc_t *svc);
-typedef int (*glusterd_svc_manager_t) (glusterd_svc_t *svc,
- void *data, int flags);
-typedef int (*glusterd_svc_start_t) (glusterd_svc_t *svc, int flags);
-typedef int (*glusterd_svc_stop_t) (glusterd_svc_t *svc, int sig);
-typedef int (*glusterd_svc_reconfigure_t) (void *data);
+typedef int (*glusterd_svc_manager_t)(glusterd_svc_t *svc, void *data,
+ int flags);
+typedef int (*glusterd_svc_start_t)(glusterd_svc_t *svc, int flags);
+typedef int (*glusterd_svc_stop_t)(glusterd_svc_t *svc, int sig);
+typedef int (*glusterd_svc_reconfigure_t)(void *data);
struct glusterd_svc_ {
- char name[PATH_MAX];
- glusterd_conn_t conn;
- glusterd_proc_t proc;
- glusterd_svc_manager_t manager;
- glusterd_svc_start_t start;
- glusterd_svc_stop_t stop;
- gf_boolean_t online;
- gf_boolean_t inited;
- glusterd_svc_reconfigure_t reconfigure;
+ char name[PATH_MAX];
+ glusterd_conn_t conn;
+ glusterd_proc_t proc;
+ glusterd_svc_manager_t manager;
+ glusterd_svc_start_t start;
+ glusterd_svc_stop_t stop;
+ gf_boolean_t online;
+ gf_boolean_t inited;
+ glusterd_svc_reconfigure_t reconfigure;
};
int
-glusterd_svc_create_rundir (char *rundir);
+glusterd_svc_create_rundir(char *rundir);
int
-glusterd_svc_init (glusterd_svc_t *svc, char *svc_name);
+glusterd_svc_init(glusterd_svc_t *svc, char *svc_name);
int
-glusterd_svc_start (glusterd_svc_t *svc, int flags, dict_t *cmdline);
+glusterd_svc_start(glusterd_svc_t *svc, int flags, dict_t *cmdline);
int
-glusterd_svc_stop (glusterd_svc_t *svc, int sig);
+glusterd_svc_stop(glusterd_svc_t *svc, int sig);
void
-glusterd_svc_build_pidfile_path (char *server, char *workdir,
- char *path, size_t len);
+glusterd_svc_build_pidfile_path(char *server, char *workdir, char *path,
+ size_t len);
void
-glusterd_svc_build_volfile_path (char *server, char *workdir,
- char *volfile, size_t len);
+glusterd_svc_build_volfile_path(char *server, char *workdir, char *volfile,
+ size_t len);
void
-glusterd_svc_build_svcdir (char *server, char *workdir,
- char *path, size_t len);
+glusterd_svc_build_svcdir(char *server, char *workdir, char *path, size_t len);
void
-glusterd_svc_build_rundir (char *server, char *workdir,
- char *path, size_t len);
+glusterd_svc_build_rundir(char *server, char *workdir, char *path, size_t len);
int
-glusterd_svc_reconfigure (int (*create_volfile) ());
+glusterd_svc_reconfigure(int (*create_volfile)());
int
-glusterd_svc_common_rpc_notify (glusterd_conn_t *conn,
- rpc_clnt_event_t event);
+glusterd_svc_common_rpc_notify(glusterd_conn_t *conn, rpc_clnt_event_t event);
#endif
diff --git a/xlators/mgmt/glusterd/src/glusterd-syncop.h b/xlators/mgmt/glusterd/src/glusterd-syncop.h
index e5f3aa6304c..37195ef0112 100644
--- a/xlators/mgmt/glusterd/src/glusterd-syncop.h
+++ b/xlators/mgmt/glusterd/src/glusterd-syncop.h
@@ -17,71 +17,77 @@
#define GD_SYNC_OPCODE_KEY "sync-mgmt-operation"
/* gd_syncop_* */
-#define GD_SYNCOP(rpc, stb, cookie, cbk, req, prog, procnum, xdrproc) do { \
- int ret = 0; \
- struct synctask *task = NULL; \
- glusterd_conf_t *conf= THIS->private; \
+#define GD_SYNCOP(rpc, stb, cookie, cbk, req, prog, procnum, xdrproc) \
+ do { \
+ int ret = 0; \
+ struct synctask *task = NULL; \
+ glusterd_conf_t *conf = THIS->private; \
\
- task = synctask_get (); \
- stb->task = task; \
+ task = synctask_get(); \
+ stb->task = task; \
\
- /*This is to ensure that the brick_op_cbk is able to \
- * take the big lock*/ \
- synclock_unlock (&conf->big_lock); \
- ret = gd_syncop_submit_request (rpc, req, stb, cookie, \
- prog, procnum, cbk, \
- (xdrproc_t)xdrproc); \
- if (!ret) \
- synctask_yield (stb->task); \
- else \
- gf_asprintf (&stb->errstr, "%s failed. Check log file" \
- " for more details", (prog)->progname); \
- synclock_lock (&conf->big_lock); \
- } while (0)
+ /*This is to ensure that the brick_op_cbk is able to \
+ * take the big lock*/ \
+ synclock_unlock(&conf->big_lock); \
+ ret = gd_syncop_submit_request(rpc, req, stb, cookie, prog, procnum, \
+ cbk, (xdrproc_t)xdrproc); \
+ if (!ret) \
+ synctask_yield(stb->task); \
+ else \
+ gf_asprintf(&stb->errstr, \
+ "%s failed. Check log file" \
+ " for more details", \
+ (prog)->progname); \
+ synclock_lock(&conf->big_lock); \
+ } while (0)
-#define GD_ALLOC_COPY_UUID(dst_ptr, uuid, ret) do { \
- dst_ptr = GF_MALLOC (sizeof (*dst_ptr), gf_common_mt_uuid_t); \
+#define GD_ALLOC_COPY_UUID(dst_ptr, uuid, ret) \
+ do { \
+ dst_ptr = GF_MALLOC(sizeof(*dst_ptr), gf_common_mt_uuid_t); \
if (dst_ptr) { \
- gf_uuid_copy (*dst_ptr, uuid); \
- ret = 0; \
+ gf_uuid_copy(*dst_ptr, uuid); \
+ ret = 0; \
} else { \
- ret = -1; \
+ ret = -1; \
} \
-} while (0)
+ } while (0)
int32_t
-gd_syncop_brick_op_cbk (struct rpc_req *req, struct iovec *iov,
- int count, void *myframe);
+gd_syncop_brick_op_cbk(struct rpc_req *req, struct iovec *iov, int count,
+ void *myframe);
-int gd_syncop_submit_request (struct rpc_clnt *rpc, void *req, void *local,
- void *cookie, rpc_clnt_prog_t *prog, int procnum,
- fop_cbk_fn_t cbkfn, xdrproc_t xdrproc);
-int gd_syncop_mgmt_lock (glusterd_peerinfo_t *peerinfo, struct syncargs *arg,
- uuid_t my_uuid, uuid_t recv_uuid);
+int
+gd_syncop_submit_request(struct rpc_clnt *rpc, void *req, void *local,
+ void *cookie, rpc_clnt_prog_t *prog, int procnum,
+ fop_cbk_fn_t cbkfn, xdrproc_t xdrproc);
+int
+gd_syncop_mgmt_lock(glusterd_peerinfo_t *peerinfo, struct syncargs *arg,
+ uuid_t my_uuid, uuid_t recv_uuid);
-int gd_syncop_mgmt_unlock (glusterd_peerinfo_t *peerinfo, struct syncargs *arg,
- uuid_t my_uuid, uuid_t recv_uuid);
+int
+gd_syncop_mgmt_unlock(glusterd_peerinfo_t *peerinfo, struct syncargs *arg,
+ uuid_t my_uuid, uuid_t recv_uuid);
-int gd_syncop_mgmt_stage_op (glusterd_peerinfo_t *peerinfo,
- struct syncargs *arg, uuid_t my_uuid,
- uuid_t recv_uuid, int op, dict_t *dict_out,
- dict_t *op_ctx);
+int
+gd_syncop_mgmt_stage_op(glusterd_peerinfo_t *peerinfo, struct syncargs *arg,
+ uuid_t my_uuid, uuid_t recv_uuid, int op,
+ dict_t *dict_out, dict_t *op_ctx);
-int gd_syncop_mgmt_commit_op (glusterd_peerinfo_t *peerinfo,
- struct syncargs *arg, uuid_t my_uuid,
- uuid_t recv_uuid, int op, dict_t *dict_out,
- dict_t *op_ctx);
+int
+gd_syncop_mgmt_commit_op(glusterd_peerinfo_t *peerinfo, struct syncargs *arg,
+ uuid_t my_uuid, uuid_t recv_uuid, int op,
+ dict_t *dict_out, dict_t *op_ctx);
void
-gd_synctask_barrier_wait (struct syncargs *args, int count);
+gd_synctask_barrier_wait(struct syncargs *args, int count);
int
-gd_brick_op_phase (glusterd_op_t op, dict_t *op_ctx, dict_t *req_dict,
- char **op_errstr);
+gd_brick_op_phase(glusterd_op_t op, dict_t *op_ctx, dict_t *req_dict,
+ char **op_errstr);
int
-glusterd_syncop_aggr_rsp_dict (glusterd_op_t op, dict_t *aggr, dict_t *rsp);
+glusterd_syncop_aggr_rsp_dict(glusterd_op_t op, dict_t *aggr, dict_t *rsp);
void
-gd_syncargs_init (struct syncargs *args, dict_t *op_ctx);
+gd_syncargs_init(struct syncargs *args, dict_t *op_ctx);
#endif /* __RPC_SYNCOP_H */
diff --git a/xlators/mgmt/glusterd/src/glusterd-tierd-svc-helper.h b/xlators/mgmt/glusterd/src/glusterd-tierd-svc-helper.h
index 1f0e33b989c..56b794df506 100644
--- a/xlators/mgmt/glusterd/src/glusterd-tierd-svc-helper.h
+++ b/xlators/mgmt/glusterd/src/glusterd-tierd-svc-helper.h
@@ -14,24 +14,24 @@
#include "glusterd.h"
void
-glusterd_svc_build_tierd_rundir (glusterd_volinfo_t *volinfo,
- char *path, int path_len);
+glusterd_svc_build_tierd_rundir(glusterd_volinfo_t *volinfo, char *path,
+ int path_len);
void
-glusterd_svc_build_tierd_socket_filepath (glusterd_volinfo_t *volinfo,
- char *path, int path_len);
+glusterd_svc_build_tierd_socket_filepath(glusterd_volinfo_t *volinfo,
+ char *path, int path_len);
void
-glusterd_svc_build_tierd_pidfile (glusterd_volinfo_t *volinfo,
- char *path, int path_len);
+glusterd_svc_build_tierd_pidfile(glusterd_volinfo_t *volinfo, char *path,
+ int path_len);
void
-glusterd_svc_build_tierd_volfile_path (glusterd_volinfo_t *volinfo,
- char *path, int path_len);
+glusterd_svc_build_tierd_volfile_path(glusterd_volinfo_t *volinfo, char *path,
+ int path_len);
void
-glusterd_svc_build_tierd_logdir (char *logdir, char *volname, size_t len);
+glusterd_svc_build_tierd_logdir(char *logdir, char *volname, size_t len);
void
-glusterd_svc_build_tierd_logfile (char *logfile, char *logdir, size_t len);
+glusterd_svc_build_tierd_logfile(char *logfile, char *logdir, size_t len);
#endif
diff --git a/xlators/mgmt/glusterd/src/glusterd-tierd-svc.h b/xlators/mgmt/glusterd/src/glusterd-tierd-svc.h
index 2ff840d0f25..78d3d11b6a3 100644
--- a/xlators/mgmt/glusterd/src/glusterd-tierd-svc.h
+++ b/xlators/mgmt/glusterd/src/glusterd-tierd-svc.h
@@ -13,30 +13,29 @@
#include "glusterd-svc-mgmt.h"
-
typedef struct glusterd_tierdsvc_ glusterd_tierdsvc_t;
struct glusterd_tierdsvc_ {
- glusterd_svc_t svc;
- gf_store_handle_t *handle;
+ glusterd_svc_t svc;
+ gf_store_handle_t *handle;
};
void
-glusterd_tierdsvc_build (glusterd_svc_t *svc);
+glusterd_tierdsvc_build(glusterd_svc_t *svc);
int
-glusterd_tierdsvc_init (void *data);
+glusterd_tierdsvc_init(void *data);
int
-glusterd_tierdsvc_manager (glusterd_svc_t *svc, void *data, int flags);
+glusterd_tierdsvc_manager(glusterd_svc_t *svc, void *data, int flags);
int
-glusterd_tierdsvc_start (glusterd_svc_t *svc, int flags);
+glusterd_tierdsvc_start(glusterd_svc_t *svc, int flags);
int
-glusterd_tierdsvc_reconfigure (void *data);
+glusterd_tierdsvc_reconfigure(void *data);
int
-glusterd_tierdsvc_restart ();
+glusterd_tierdsvc_restart();
#endif
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.h b/xlators/mgmt/glusterd/src/glusterd-utils.h
index 6f77ca6fbd6..4bdc048dd35 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.h
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.h
@@ -26,869 +26,851 @@
#include "glusterd-peer-utils.h"
#define GLUSTERD_SOCK_DIR "/var/run/gluster"
-#define GLUSTERD_ASSIGN_BRICKID_TO_BRICKINFO(brickinfo, volinfo, brickid) do {\
- sprintf (brickinfo->brick_id, "%s-client-%d",\
- volinfo->volname, brickid);\
-} while (0)
+#define GLUSTERD_ASSIGN_BRICKID_TO_BRICKINFO(brickinfo, volinfo, brickid) \
+ do { \
+ sprintf(brickinfo->brick_id, "%s-client-%d", volinfo->volname, \
+ brickid); \
+ } while (0)
#define ALL_VOLUME_OPTION_CHECK(volname, get_opt, key, ret, op_errstr, label) \
- do { \
- gf_boolean_t _all = !strcmp ("all", volname); \
- gf_boolean_t _is_valid_opt = _gf_false; \
- int32_t i = 0; \
+ do { \
+ gf_boolean_t _all = !strcmp("all", volname); \
+ gf_boolean_t _is_valid_opt = _gf_false; \
+ int32_t i = 0; \
\
- if (!get_opt && (!strcmp (key, "all") || \
- !strcmp (key, GLUSTERD_MAX_OP_VERSION_KEY))) {\
- ret = -1; \
- *op_errstr = gf_strdup ("Not a valid option to set"); \
- goto out; \
- } \
+ if (!get_opt && (!strcmp(key, "all") || \
+ !strcmp(key, GLUSTERD_MAX_OP_VERSION_KEY))) { \
+ ret = -1; \
+ *op_errstr = gf_strdup("Not a valid option to set"); \
+ goto out; \
+ } \
\
- for (i = 0; valid_all_vol_opts[i].option; i++) { \
- if (!strcmp (key, "all") || \
- !strcmp (key, valid_all_vol_opts[i].option)) { \
- _is_valid_opt = _gf_true; \
- break; \
- } \
- } \
+ for (i = 0; valid_all_vol_opts[i].option; i++) { \
+ if (!strcmp(key, "all") || \
+ !strcmp(key, valid_all_vol_opts[i].option)) { \
+ _is_valid_opt = _gf_true; \
+ break; \
+ } \
+ } \
\
- if (_all && !_is_valid_opt) { \
- ret = -1; \
- *op_errstr = gf_strdup ("Not a valid option for all " \
- "volumes"); \
- goto label; \
- } else if (!_all && _is_valid_opt) { \
- ret = -1; \
- *op_errstr = gf_strdup ("Not a valid option for " \
- "single volume"); \
- goto label; \
- } \
- } while (0) \
-
+ if (_all && !_is_valid_opt) { \
+ ret = -1; \
+ *op_errstr = gf_strdup( \
+ "Not a valid option for all " \
+ "volumes"); \
+ goto label; \
+ } else if (!_all && _is_valid_opt) { \
+ ret = -1; \
+ *op_errstr = gf_strdup( \
+ "Not a valid option for " \
+ "single volume"); \
+ goto label; \
+ } \
+ } while (0)
struct glusterd_lock_ {
- uuid_t owner;
- time_t timestamp;
+ uuid_t owner;
+ time_t timestamp;
};
typedef struct glusterd_dict_ctx_ {
- dict_t *dict;
- int opt_count;
- char *key_name;
- char *val_name;
- char *prefix;
+ dict_t *dict;
+ int opt_count;
+ char *key_name;
+ char *val_name;
+ char *prefix;
} glusterd_dict_ctx_t;
-gf_boolean_t is_brick_mx_enabled (void);
+gf_boolean_t
+is_brick_mx_enabled(void);
int
-glusterd_compare_lines (const void *a, const void *b);
+glusterd_compare_lines(const void *a, const void *b);
-typedef int (*glusterd_condition_func) (glusterd_volinfo_t *volinfo,
- glusterd_brickinfo_t *brickinfo,
- void *ctx);
+typedef int (*glusterd_condition_func)(glusterd_volinfo_t *volinfo,
+ glusterd_brickinfo_t *brickinfo,
+ void *ctx);
typedef struct glusterd_lock_ glusterd_lock_t;
int32_t
-glusterd_get_lock_owner (uuid_t *cur_owner);
+glusterd_get_lock_owner(uuid_t *cur_owner);
int32_t
-glusterd_lock (uuid_t new_owner);
+glusterd_lock(uuid_t new_owner);
int32_t
-glusterd_unlock (uuid_t owner);
+glusterd_unlock(uuid_t owner);
int32_t
-glusterd_get_uuid (uuid_t *uuid);
+glusterd_get_uuid(uuid_t *uuid);
-char*
-gd_get_shd_key (int type);
+char *
+gd_get_shd_key(int type);
int
-glusterd_submit_reply (rpcsvc_request_t *req, void *arg,
- struct iovec *payload, int payloadcount,
- struct iobref *iobref, xdrproc_t xdrproc);
+glusterd_submit_reply(rpcsvc_request_t *req, void *arg, struct iovec *payload,
+ int payloadcount, struct iobref *iobref,
+ xdrproc_t xdrproc);
int
-glusterd_to_cli (rpcsvc_request_t *req, gf_cli_rsp *arg, struct iovec *payload,
- int payloadcount, struct iobref *iobref, xdrproc_t xdrproc,
- dict_t *dict);
+glusterd_to_cli(rpcsvc_request_t *req, gf_cli_rsp *arg, struct iovec *payload,
+ int payloadcount, struct iobref *iobref, xdrproc_t xdrproc,
+ dict_t *dict);
int
-glusterd_submit_request (struct rpc_clnt *rpc, void *req,
- call_frame_t *frame, rpc_clnt_prog_t *prog,
- int procnum, struct iobref *iobref,
- xlator_t *this, fop_cbk_fn_t cbkfn, xdrproc_t xdrproc);
+glusterd_submit_request(struct rpc_clnt *rpc, void *req, call_frame_t *frame,
+ rpc_clnt_prog_t *prog, int procnum,
+ struct iobref *iobref, xlator_t *this,
+ fop_cbk_fn_t cbkfn, xdrproc_t xdrproc);
int32_t
-glusterd_volinfo_new (glusterd_volinfo_t **volinfo);
+glusterd_volinfo_new(glusterd_volinfo_t **volinfo);
int32_t
-glusterd_volinfo_dup (glusterd_volinfo_t *volinfo,
- glusterd_volinfo_t **dup_volinfo,
- gf_boolean_t set_userauth);
+glusterd_volinfo_dup(glusterd_volinfo_t *volinfo,
+ glusterd_volinfo_t **dup_volinfo,
+ gf_boolean_t set_userauth);
char *
-glusterd_auth_get_username (glusterd_volinfo_t *volinfo);
+glusterd_auth_get_username(glusterd_volinfo_t *volinfo);
char *
-glusterd_auth_get_password (glusterd_volinfo_t *volinfo);
+glusterd_auth_get_password(glusterd_volinfo_t *volinfo);
int32_t
-glusterd_auth_set_username (glusterd_volinfo_t *volinfo, char *username);
+glusterd_auth_set_username(glusterd_volinfo_t *volinfo, char *username);
int32_t
-glusterd_auth_set_password (glusterd_volinfo_t *volinfo, char *password);
+glusterd_auth_set_password(glusterd_volinfo_t *volinfo, char *password);
void
-glusterd_auth_cleanup (glusterd_volinfo_t *volinfo);
+glusterd_auth_cleanup(glusterd_volinfo_t *volinfo);
gf_boolean_t
-glusterd_check_volume_exists (char *volname);
+glusterd_check_volume_exists(char *volname);
int32_t
-glusterd_brickprocess_new (glusterd_brick_proc_t **brickprocess);
+glusterd_brickprocess_new(glusterd_brick_proc_t **brickprocess);
int32_t
-glusterd_brickinfo_new (glusterd_brickinfo_t **brickinfo);
+glusterd_brickinfo_new(glusterd_brickinfo_t **brickinfo);
int32_t
-glusterd_brickinfo_new_from_brick (char *brick,
- glusterd_brickinfo_t **brickinfo,
- gf_boolean_t construct_real_path,
- char **op_errstr);
+glusterd_brickinfo_new_from_brick(char *brick, glusterd_brickinfo_t **brickinfo,
+ gf_boolean_t construct_real_path,
+ char **op_errstr);
int32_t
-glusterd_volinfo_find (const char *volname, glusterd_volinfo_t **volinfo);
+glusterd_volinfo_find(const char *volname, glusterd_volinfo_t **volinfo);
int
-glusterd_volinfo_find_by_volume_id (uuid_t volume_id, glusterd_volinfo_t **volinfo);
+glusterd_volinfo_find_by_volume_id(uuid_t volume_id,
+ glusterd_volinfo_t **volinfo);
int32_t
glusterd_service_stop(const char *service, char *pidfile, int sig,
gf_boolean_t force_kill);
int32_t
-glusterd_service_stop_nolock (const char *service, char *pidfile, int sig,
- gf_boolean_t force_kill);
+glusterd_service_stop_nolock(const char *service, char *pidfile, int sig,
+ gf_boolean_t force_kill);
int
-glusterd_get_next_available_brickid (glusterd_volinfo_t *volinfo);
+glusterd_get_next_available_brickid(glusterd_volinfo_t *volinfo);
int32_t
-glusterd_resolve_brick (glusterd_brickinfo_t *brickinfo);
+glusterd_resolve_brick(glusterd_brickinfo_t *brickinfo);
int
-glusterd_brick_process_add_brick (glusterd_brickinfo_t *brickinfo);
+glusterd_brick_process_add_brick(glusterd_brickinfo_t *brickinfo);
int
-glusterd_brick_process_remove_brick (glusterd_brickinfo_t *brickinfo,
- int *last_brick);
+glusterd_brick_process_remove_brick(glusterd_brickinfo_t *brickinfo,
+ int *last_brick);
int
-glusterd_brick_proc_for_port (int port, glusterd_brick_proc_t **brickprocess);
+glusterd_brick_proc_for_port(int port, glusterd_brick_proc_t **brickprocess);
int32_t
-glusterd_volume_start_glusterfs (glusterd_volinfo_t *volinfo,
- glusterd_brickinfo_t *brickinfo,
- gf_boolean_t wait);
+glusterd_volume_start_glusterfs(glusterd_volinfo_t *volinfo,
+ glusterd_brickinfo_t *brickinfo,
+ gf_boolean_t wait);
int32_t
-glusterd_volume_stop_glusterfs (glusterd_volinfo_t *volinfo,
- glusterd_brickinfo_t *brickinfo,
- gf_boolean_t del_brick);
+glusterd_volume_stop_glusterfs(glusterd_volinfo_t *volinfo,
+ glusterd_brickinfo_t *brickinfo,
+ gf_boolean_t del_brick);
int
-send_attach_req (xlator_t *this, struct rpc_clnt *rpc, char *path,
- glusterd_brickinfo_t *brick,
- glusterd_brickinfo_t *other_brick, int op);
+send_attach_req(xlator_t *this, struct rpc_clnt *rpc, char *path,
+ glusterd_brickinfo_t *brick, glusterd_brickinfo_t *other_brick,
+ int op);
glusterd_volinfo_t *
-glusterd_volinfo_ref (glusterd_volinfo_t *volinfo);
+glusterd_volinfo_ref(glusterd_volinfo_t *volinfo);
glusterd_volinfo_t *
-glusterd_volinfo_unref (glusterd_volinfo_t *volinfo);
+glusterd_volinfo_unref(glusterd_volinfo_t *volinfo);
int32_t
-glusterd_volinfo_delete (glusterd_volinfo_t *volinfo);
+glusterd_volinfo_delete(glusterd_volinfo_t *volinfo);
int32_t
-glusterd_brickinfo_delete (glusterd_brickinfo_t *brickinfo);
+glusterd_brickinfo_delete(glusterd_brickinfo_t *brickinfo);
gf_boolean_t
-glusterd_is_cli_op_req (int32_t op);
+glusterd_is_cli_op_req(int32_t op);
int32_t
-glusterd_volume_brickinfo_get_by_brick (char *brick,
- glusterd_volinfo_t *volinfo,
- glusterd_brickinfo_t **brickinfo,
- gf_boolean_t construct_real_path);
+glusterd_volume_brickinfo_get_by_brick(char *brick, glusterd_volinfo_t *volinfo,
+ glusterd_brickinfo_t **brickinfo,
+ gf_boolean_t construct_real_path);
int32_t
-glusterd_add_volumes_to_export_dict (dict_t **peer_data);
+glusterd_add_volumes_to_export_dict(dict_t **peer_data);
int32_t
-glusterd_compare_friend_data (dict_t *peer_data, int32_t *status,
- char *hostname);
+glusterd_compare_friend_data(dict_t *peer_data, int32_t *status,
+ char *hostname);
int
-glusterd_compute_cksum (glusterd_volinfo_t *volinfo,
- gf_boolean_t is_quota_conf);
+glusterd_compute_cksum(glusterd_volinfo_t *volinfo, gf_boolean_t is_quota_conf);
void
-glusterd_set_socket_filepath (char *sock_filepath, char *sockpath, size_t len);
+glusterd_set_socket_filepath(char *sock_filepath, char *sockpath, size_t len);
-struct rpc_clnt*
-glusterd_pending_node_get_rpc (glusterd_pending_node_t *pending_node);
+struct rpc_clnt *
+glusterd_pending_node_get_rpc(glusterd_pending_node_t *pending_node);
void
-glusterd_pending_node_put_rpc (glusterd_pending_node_t *pending_node);
+glusterd_pending_node_put_rpc(glusterd_pending_node_t *pending_node);
int
-glusterd_remote_hostname_get (rpcsvc_request_t *req,
- char *remote_host, int len);
+glusterd_remote_hostname_get(rpcsvc_request_t *req, char *remote_host, int len);
int32_t
-glusterd_import_friend_volumes_synctask (void *opaque);
+glusterd_import_friend_volumes_synctask(void *opaque);
int32_t
-glusterd_import_friend_volumes (dict_t *peer_data);
+glusterd_import_friend_volumes(dict_t *peer_data);
void
-glusterd_set_volume_status (glusterd_volinfo_t *volinfo,
- glusterd_volume_status status);
+glusterd_set_volume_status(glusterd_volinfo_t *volinfo,
+ glusterd_volume_status status);
int32_t
-glusterd_volume_count_get (void);
+glusterd_volume_count_get(void);
int32_t
-glusterd_add_volume_to_dict (glusterd_volinfo_t *volinfo,
- dict_t *dict, int32_t count,
- char *prefix);
+glusterd_add_volume_to_dict(glusterd_volinfo_t *volinfo, dict_t *dict,
+ int32_t count, char *prefix);
int
-glusterd_get_brickinfo (xlator_t *this, const char *brickname,
- int port, glusterd_brickinfo_t **brickinfo);
+glusterd_get_brickinfo(xlator_t *this, const char *brickname, int port,
+ glusterd_brickinfo_t **brickinfo);
void
-glusterd_set_brick_status (glusterd_brickinfo_t *brickinfo,
- gf_brick_status_t status);
+glusterd_set_brick_status(glusterd_brickinfo_t *brickinfo,
+ gf_brick_status_t status);
gf_boolean_t
-glusterd_is_brick_started (glusterd_brickinfo_t *brickinfo);
+glusterd_is_brick_started(glusterd_brickinfo_t *brickinfo);
int
-glusterd_friend_brick_belongs (glusterd_volinfo_t *volinfo,
- glusterd_brickinfo_t *brickinfo, void *uuid);
+glusterd_friend_brick_belongs(glusterd_volinfo_t *volinfo,
+ glusterd_brickinfo_t *brickinfo, void *uuid);
int
-glusterd_all_volume_cond_check (glusterd_condition_func func, int status,
- void *ctx);
+glusterd_all_volume_cond_check(glusterd_condition_func func, int status,
+ void *ctx);
int
-glusterd_brick_start (glusterd_volinfo_t *volinfo,
- glusterd_brickinfo_t *brickinfo,
- gf_boolean_t wait,
- gf_boolean_t only_connect);
+glusterd_brick_start(glusterd_volinfo_t *volinfo,
+ glusterd_brickinfo_t *brickinfo, gf_boolean_t wait,
+ gf_boolean_t only_connect);
int
-glusterd_brick_stop (glusterd_volinfo_t *volinfo,
- glusterd_brickinfo_t *brickinfo,
- gf_boolean_t del_brick);
+glusterd_brick_stop(glusterd_volinfo_t *volinfo,
+ glusterd_brickinfo_t *brickinfo, gf_boolean_t del_brick);
gf_boolean_t
-glusterd_is_tier_daemon_running (glusterd_volinfo_t *volinfo);
+glusterd_is_tier_daemon_running(glusterd_volinfo_t *volinfo);
int32_t
-glusterd_add_tierd_to_dict (glusterd_volinfo_t *volinfo,
- dict_t *dict, int32_t count);
+glusterd_add_tierd_to_dict(glusterd_volinfo_t *volinfo, dict_t *dict,
+ int32_t count);
int
-glusterd_op_tier_status (dict_t *dict, char **op_errstr, dict_t *rsp_dict,
- glusterd_op_t op);
+glusterd_op_tier_status(dict_t *dict, char **op_errstr, dict_t *rsp_dict,
+ glusterd_op_t op);
int
-glusterd_is_defrag_on (glusterd_volinfo_t *volinfo);
+glusterd_is_defrag_on(glusterd_volinfo_t *volinfo);
int32_t
-glusterd_volinfo_bricks_delete (glusterd_volinfo_t *volinfo);
+glusterd_volinfo_bricks_delete(glusterd_volinfo_t *volinfo);
int
-glusterd_new_brick_validate (char *brick, glusterd_brickinfo_t *brickinfo,
- char *op_errstr, size_t len, char *op);
+glusterd_new_brick_validate(char *brick, glusterd_brickinfo_t *brickinfo,
+ char *op_errstr, size_t len, char *op);
int32_t
-glusterd_volume_brickinfos_delete (glusterd_volinfo_t *volinfo);
+glusterd_volume_brickinfos_delete(glusterd_volinfo_t *volinfo);
int32_t
-glusterd_volume_brickinfo_get (uuid_t uuid, char *hostname, char *path,
- glusterd_volinfo_t *volinfo,
- glusterd_brickinfo_t **brickinfo);
+glusterd_volume_brickinfo_get(uuid_t uuid, char *hostname, char *path,
+ glusterd_volinfo_t *volinfo,
+ glusterd_brickinfo_t **brickinfo);
int
-glusterd_brickinfo_get (uuid_t uuid, char *hostname, char *path,
+glusterd_brickinfo_get(uuid_t uuid, char *hostname, char *path,
glusterd_brickinfo_t **brickinfo);
-
int
-glusterd_rb_check_bricks (glusterd_volinfo_t *volinfo,
- glusterd_brickinfo_t *src_brick,
- glusterd_brickinfo_t *dst_brick);
+glusterd_rb_check_bricks(glusterd_volinfo_t *volinfo,
+ glusterd_brickinfo_t *src_brick,
+ glusterd_brickinfo_t *dst_brick);
int
-glusterd_check_and_set_brick_xattr (char *host, char *path, uuid_t uuid,
- char **op_errstr, gf_boolean_t is_force);
+glusterd_check_and_set_brick_xattr(char *host, char *path, uuid_t uuid,
+ char **op_errstr, gf_boolean_t is_force);
int
-glusterd_validate_and_create_brickpath (glusterd_brickinfo_t *brickinfo,
- uuid_t volume_id, char **op_errstr,
- gf_boolean_t is_force,
- gf_boolean_t ignore_partition);
+glusterd_validate_and_create_brickpath(glusterd_brickinfo_t *brickinfo,
+ uuid_t volume_id, char **op_errstr,
+ gf_boolean_t is_force,
+ gf_boolean_t ignore_partition);
int
-glusterd_sm_tr_log_transition_add (glusterd_sm_tr_log_t *log,
- int old_state, int new_state,
- int event);
+glusterd_sm_tr_log_transition_add(glusterd_sm_tr_log_t *log, int old_state,
+ int new_state, int event);
int
-glusterd_sm_tr_log_init (glusterd_sm_tr_log_t *log,
- char * (*state_name_get) (int),
- char * (*event_name_get) (int),
- size_t size);
+glusterd_sm_tr_log_init(glusterd_sm_tr_log_t *log, char *(*state_name_get)(int),
+ char *(*event_name_get)(int), size_t size);
void
-glusterd_sm_tr_log_delete (glusterd_sm_tr_log_t *log);
+glusterd_sm_tr_log_delete(glusterd_sm_tr_log_t *log);
int
-glusterd_sm_tr_log_add_to_dict (dict_t *dict,
- glusterd_sm_tr_log_t *circular_log);
+glusterd_sm_tr_log_add_to_dict(dict_t *dict,
+ glusterd_sm_tr_log_t *circular_log);
int
-glusterd_remove_pending_entry (struct cds_list_head *list, void *elem);
+glusterd_remove_pending_entry(struct cds_list_head *list, void *elem);
int
-glusterd_clear_pending_nodes (struct cds_list_head *list);
+glusterd_clear_pending_nodes(struct cds_list_head *list);
int32_t
-glusterd_brick_connect (glusterd_volinfo_t *volinfo,
- glusterd_brickinfo_t *brickinfo, char *socketpath);
+glusterd_brick_connect(glusterd_volinfo_t *volinfo,
+ glusterd_brickinfo_t *brickinfo, char *socketpath);
int32_t
-glusterd_brick_disconnect (glusterd_brickinfo_t *brickinfo);
+glusterd_brick_disconnect(glusterd_brickinfo_t *brickinfo);
int32_t
-glusterd_delete_volume (glusterd_volinfo_t *volinfo);
+glusterd_delete_volume(glusterd_volinfo_t *volinfo);
int32_t
-glusterd_delete_brick (glusterd_volinfo_t* volinfo,
- glusterd_brickinfo_t *brickinfo);
+glusterd_delete_brick(glusterd_volinfo_t *volinfo,
+ glusterd_brickinfo_t *brickinfo);
int32_t
-glusterd_delete_all_bricks (glusterd_volinfo_t* volinfo);
+glusterd_delete_all_bricks(glusterd_volinfo_t *volinfo);
int
-glusterd_spawn_daemons (void *opaque);
+glusterd_spawn_daemons(void *opaque);
int
-glusterd_restart_gsyncds (glusterd_conf_t *conf);
+glusterd_restart_gsyncds(glusterd_conf_t *conf);
int
-glusterd_start_gsync (glusterd_volinfo_t *master_vol, char *slave,
- char *path_list, char *conf_path,
- char *glusterd_uuid_str,
- char **op_errstr, gf_boolean_t is_pause);
+glusterd_start_gsync(glusterd_volinfo_t *master_vol, char *slave,
+ char *path_list, char *conf_path, char *glusterd_uuid_str,
+ char **op_errstr, gf_boolean_t is_pause);
int
-glusterd_get_local_brickpaths (glusterd_volinfo_t *volinfo,
- char **pathlist);
+glusterd_get_local_brickpaths(glusterd_volinfo_t *volinfo, char **pathlist);
int32_t
-glusterd_recreate_bricks (glusterd_conf_t *conf);
+glusterd_recreate_bricks(glusterd_conf_t *conf);
int32_t
-glusterd_handle_upgrade_downgrade (dict_t *options, glusterd_conf_t *conf,
- gf_boolean_t upgrade,
- gf_boolean_t downgrade);
+glusterd_handle_upgrade_downgrade(dict_t *options, glusterd_conf_t *conf,
+ gf_boolean_t upgrade, gf_boolean_t downgrade);
int
-glusterd_add_brick_detail_to_dict (glusterd_volinfo_t *volinfo,
- glusterd_brickinfo_t *brickinfo,
- dict_t *dict, int32_t count);
+glusterd_add_brick_detail_to_dict(glusterd_volinfo_t *volinfo,
+ glusterd_brickinfo_t *brickinfo, dict_t *dict,
+ int32_t count);
int32_t
-glusterd_add_brick_to_dict (glusterd_volinfo_t *volinfo,
- glusterd_brickinfo_t *brickinfo,
- dict_t *dict, int32_t count);
+glusterd_add_brick_to_dict(glusterd_volinfo_t *volinfo,
+ glusterd_brickinfo_t *brickinfo, dict_t *dict,
+ int32_t count);
int32_t
-glusterd_get_all_volnames (dict_t *dict);
+glusterd_get_all_volnames(dict_t *dict);
gf_boolean_t
-glusterd_is_fuse_available ();
+glusterd_is_fuse_available();
int
-glusterd_brick_statedump (glusterd_volinfo_t *volinfo,
- glusterd_brickinfo_t *brickinfo,
- char *options, int option_cnt, char **op_errstr);
+glusterd_brick_statedump(glusterd_volinfo_t *volinfo,
+ glusterd_brickinfo_t *brickinfo, char *options,
+ int option_cnt, char **op_errstr);
int
-glusterd_brick_terminate (glusterd_volinfo_t *volinfo,
- glusterd_brickinfo_t *brickinfo,
- char *options, int option_cnt, char **op_errstr);
+glusterd_brick_terminate(glusterd_volinfo_t *volinfo,
+ glusterd_brickinfo_t *brickinfo, char *options,
+ int option_cnt, char **op_errstr);
int
-glusterd_nfs_statedump (char *options, int option_cnt, char **op_errstr);
+glusterd_nfs_statedump(char *options, int option_cnt, char **op_errstr);
int
-glusterd_client_statedump (char *volname, char *options, int option_cnt,
- char **op_errstr);
+glusterd_client_statedump(char *volname, char *options, int option_cnt,
+ char **op_errstr);
int
-glusterd_quotad_statedump (char *options, int option_cnt, char **op_errstr);
+glusterd_quotad_statedump(char *options, int option_cnt, char **op_errstr);
gf_boolean_t
-glusterd_is_volume_replicate (glusterd_volinfo_t *volinfo);
+glusterd_is_volume_replicate(glusterd_volinfo_t *volinfo);
gf_boolean_t
-glusterd_is_brick_decommissioned (glusterd_volinfo_t *volinfo, char *hostname,
- char *path);
+glusterd_is_brick_decommissioned(glusterd_volinfo_t *volinfo, char *hostname,
+ char *path);
int
-glusterd_friend_contains_vol_bricks (glusterd_volinfo_t *volinfo,
- uuid_t friend_uuid);
+glusterd_friend_contains_vol_bricks(glusterd_volinfo_t *volinfo,
+ uuid_t friend_uuid);
int
-glusterd_friend_contains_snap_bricks (glusterd_snap_t *snapinfo,
+glusterd_friend_contains_snap_bricks(glusterd_snap_t *snapinfo,
uuid_t friend_uuid);
int
-glusterd_friend_remove_cleanup_vols (uuid_t uuid);
+glusterd_friend_remove_cleanup_vols(uuid_t uuid);
int
-glusterd_get_client_filepath (char *filepath,
- glusterd_volinfo_t *volinfo,
- gf_transport_type type);
+glusterd_get_client_filepath(char *filepath, glusterd_volinfo_t *volinfo,
+ gf_transport_type type);
int
-glusterd_get_trusted_client_filepath (char *filepath,
- glusterd_volinfo_t *volinfo,
- gf_transport_type type);
+glusterd_get_trusted_client_filepath(char *filepath,
+ glusterd_volinfo_t *volinfo,
+ gf_transport_type type);
int
-glusterd_restart_rebalance (glusterd_conf_t *conf);
+glusterd_restart_rebalance(glusterd_conf_t *conf);
int32_t
-glusterd_create_sub_tier_volinfo (glusterd_volinfo_t *volinfo,
- glusterd_volinfo_t **dup_volinfo,
- gf_boolean_t is_hot_tier,
- const char *new_name);
+glusterd_create_sub_tier_volinfo(glusterd_volinfo_t *volinfo,
+ glusterd_volinfo_t **dup_volinfo,
+ gf_boolean_t is_hot_tier,
+ const char *new_name);
int
-glusterd_restart_rebalance_for_volume (glusterd_volinfo_t *volinfo);
+glusterd_restart_rebalance_for_volume(glusterd_volinfo_t *volinfo);
void
-glusterd_defrag_info_set (glusterd_volinfo_t *volinfo, dict_t *dict, int cmd,
- int status, int op);
+glusterd_defrag_info_set(glusterd_volinfo_t *volinfo, dict_t *dict, int cmd,
+ int status, int op);
int32_t
-glusterd_add_bricks_hname_path_to_dict (dict_t *dict,
- glusterd_volinfo_t *volinfo);
+glusterd_add_bricks_hname_path_to_dict(dict_t *dict,
+ glusterd_volinfo_t *volinfo);
int
-glusterd_add_node_to_dict (char *server, dict_t *dict, int count,
- dict_t *vol_opts);
+glusterd_add_node_to_dict(char *server, dict_t *dict, int count,
+ dict_t *vol_opts);
int
-glusterd_calc_dist_leaf_count (int rcount, int scount);
+glusterd_calc_dist_leaf_count(int rcount, int scount);
int
-glusterd_get_dist_leaf_count (glusterd_volinfo_t *volinfo);
+glusterd_get_dist_leaf_count(glusterd_volinfo_t *volinfo);
-glusterd_brickinfo_t*
-glusterd_get_brickinfo_by_position (glusterd_volinfo_t *volinfo, uint32_t pos);
+glusterd_brickinfo_t *
+glusterd_get_brickinfo_by_position(glusterd_volinfo_t *volinfo, uint32_t pos);
gf_boolean_t
-glusterd_is_local_brick (xlator_t *this, glusterd_volinfo_t *volinfo,
- glusterd_brickinfo_t *brickinfo);
+glusterd_is_local_brick(xlator_t *this, glusterd_volinfo_t *volinfo,
+ glusterd_brickinfo_t *brickinfo);
int
-glusterd_validate_volume_id (dict_t *op_dict, glusterd_volinfo_t *volinfo);
+glusterd_validate_volume_id(dict_t *op_dict, glusterd_volinfo_t *volinfo);
int
-glusterd_defrag_volume_status_update (glusterd_volinfo_t *volinfo,
- dict_t *rsp_dict, int32_t cmd);
+glusterd_defrag_volume_status_update(glusterd_volinfo_t *volinfo,
+ dict_t *rsp_dict, int32_t cmd);
int
-glusterd_check_files_identical (char *filename1, char *filename2,
- gf_boolean_t *identical);
+glusterd_check_files_identical(char *filename1, char *filename2,
+ gf_boolean_t *identical);
int
-glusterd_check_topology_identical (const char *filename1,
- const char *filename2,
- gf_boolean_t *identical);
+glusterd_check_topology_identical(const char *filename1, const char *filename2,
+ gf_boolean_t *identical);
void
-glusterd_volinfo_reset_defrag_stats (glusterd_volinfo_t *volinfo);
+glusterd_volinfo_reset_defrag_stats(glusterd_volinfo_t *volinfo);
int
-glusterd_volset_help (dict_t *dict, char **op_errstr);
+glusterd_volset_help(dict_t *dict, char **op_errstr);
int32_t
-glusterd_sync_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict);
+glusterd_sync_use_rsp_dict(dict_t *aggr, dict_t *rsp_dict);
int32_t
-glusterd_gsync_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict, char *op_errstr);
+glusterd_gsync_use_rsp_dict(dict_t *aggr, dict_t *rsp_dict, char *op_errstr);
int32_t
-glusterd_rb_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict);
+glusterd_rb_use_rsp_dict(dict_t *aggr, dict_t *rsp_dict);
int
-glusterd_profile_volume_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict);
+glusterd_profile_volume_use_rsp_dict(dict_t *aggr, dict_t *rsp_dict);
int
-glusterd_volume_status_copy_to_op_ctx_dict (dict_t *aggr, dict_t *rsp_dict);
+glusterd_volume_status_copy_to_op_ctx_dict(dict_t *aggr, dict_t *rsp_dict);
int
-glusterd_volume_rebalance_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict);
+glusterd_volume_rebalance_use_rsp_dict(dict_t *aggr, dict_t *rsp_dict);
int
-glusterd_volume_tier_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict);
+glusterd_volume_tier_use_rsp_dict(dict_t *aggr, dict_t *rsp_dict);
int
-glusterd_volume_heal_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict);
+glusterd_volume_heal_use_rsp_dict(dict_t *aggr, dict_t *rsp_dict);
int
-glusterd_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict);
+glusterd_use_rsp_dict(dict_t *aggr, dict_t *rsp_dict);
int
-glusterd_sys_exec_output_rsp_dict (dict_t *aggr, dict_t *rsp_dict);
+glusterd_sys_exec_output_rsp_dict(dict_t *aggr, dict_t *rsp_dict);
int32_t
-glusterd_handle_node_rsp (dict_t *req_ctx, void *pending_entry,
- glusterd_op_t op, dict_t *rsp_dict, dict_t *op_ctx,
- char **op_errstr, gd_node_type type);
+glusterd_handle_node_rsp(dict_t *req_ctx, void *pending_entry, glusterd_op_t op,
+ dict_t *rsp_dict, dict_t *op_ctx, char **op_errstr,
+ gd_node_type type);
int
-glusterd_max_opversion_use_rsp_dict (dict_t *dst, dict_t *src);
+glusterd_max_opversion_use_rsp_dict(dict_t *dst, dict_t *src);
int
-glusterd_volume_bitrot_scrub_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict);
+glusterd_volume_bitrot_scrub_use_rsp_dict(dict_t *aggr, dict_t *rsp_dict);
int
-glusterd_volume_heal_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict);
+glusterd_volume_heal_use_rsp_dict(dict_t *aggr, dict_t *rsp_dict);
int32_t
-glusterd_check_if_quota_trans_enabled (glusterd_volinfo_t *volinfo);
+glusterd_check_if_quota_trans_enabled(glusterd_volinfo_t *volinfo);
int
-glusterd_volume_quota_copy_to_op_ctx_dict (dict_t *aggr, dict_t *rsp);
+glusterd_volume_quota_copy_to_op_ctx_dict(dict_t *aggr, dict_t *rsp);
int
-_profile_volume_add_brick_rsp (dict_t *this, char *key, data_t *value,
- void *data);
+_profile_volume_add_brick_rsp(dict_t *this, char *key, data_t *value,
+ void *data);
int
-glusterd_profile_volume_brick_rsp (void *pending_entry,
- dict_t *rsp_dict, dict_t *op_ctx,
- char **op_errstr, gd_node_type type);
+glusterd_profile_volume_brick_rsp(void *pending_entry, dict_t *rsp_dict,
+ dict_t *op_ctx, char **op_errstr,
+ gd_node_type type);
int32_t
-glusterd_set_originator_uuid (dict_t *dict);
+glusterd_set_originator_uuid(dict_t *dict);
/* Should be used only when an operation is in progress, as that is the only
* time a lock_owner is set
*/
gf_boolean_t
-is_origin_glusterd (dict_t *dict);
+is_origin_glusterd(dict_t *dict);
int
-glusterd_get_next_global_opt_version_str (dict_t *opts, char **version_str);
+glusterd_get_next_global_opt_version_str(dict_t *opts, char **version_str);
int
-glusterd_generate_and_set_task_id (dict_t *dict, char *key, const int keylen);
+glusterd_generate_and_set_task_id(dict_t *dict, char *key, const int keylen);
int
-glusterd_validate_and_set_gfid (dict_t *op_ctx, dict_t *req_dict,
- char **op_errstr);
+glusterd_validate_and_set_gfid(dict_t *op_ctx, dict_t *req_dict,
+ char **op_errstr);
int
-glusterd_copy_uuid_to_dict (uuid_t uuid, dict_t *dict, char *key,
- const int keylen);
+glusterd_copy_uuid_to_dict(uuid_t uuid, dict_t *dict, char *key,
+ const int keylen);
gf_boolean_t
-glusterd_is_same_address (char *name1, char *name2);
+glusterd_is_same_address(char *name1, char *name2);
void
-gd_update_volume_op_versions (glusterd_volinfo_t *volinfo);
+gd_update_volume_op_versions(glusterd_volinfo_t *volinfo);
int
-op_version_check (xlator_t *this, int min_op_version, char *msg, int msglen);
+op_version_check(xlator_t *this, int min_op_version, char *msg, int msglen);
gf_boolean_t
-gd_is_remove_brick_committed (glusterd_volinfo_t *volinfo);
+gd_is_remove_brick_committed(glusterd_volinfo_t *volinfo);
int
-glusterd_remove_brick_validate_bricks (gf1_op_commands cmd, int32_t brick_count,
- dict_t *dict,
- glusterd_volinfo_t *volinfo,
- char **errstr, gf_cli_defrag_type);
+glusterd_remove_brick_validate_bricks(gf1_op_commands cmd, int32_t brick_count,
+ dict_t *dict, glusterd_volinfo_t *volinfo,
+ char **errstr, gf_cli_defrag_type);
int
-glusterd_get_slave_details_confpath (glusterd_volinfo_t *volinfo,
- dict_t *dict, char **slave_url,
- char **slave_host, char **slave_vol,
- char **conf_path, char **op_errstr);
+glusterd_get_slave_details_confpath(glusterd_volinfo_t *volinfo, dict_t *dict,
+ char **slave_url, char **slave_host,
+ char **slave_vol, char **conf_path,
+ char **op_errstr);
int
-glusterd_get_slave_info (char *slave,
- char **slave_url, char **hostname,
- char **slave_vol, char **op_errstr);
+glusterd_get_slave_info(char *slave, char **slave_url, char **hostname,
+ char **slave_vol, char **op_errstr);
int
-glusterd_get_statefile_name (glusterd_volinfo_t *volinfo, char *slave,
- char *conf_path, char **statefile,
- gf_boolean_t *is_template_in_use);
+glusterd_get_statefile_name(glusterd_volinfo_t *volinfo, char *slave,
+ char *conf_path, char **statefile,
+ gf_boolean_t *is_template_in_use);
int
-glusterd_gsync_read_frm_status (char *path, char *buf, size_t blen);
+glusterd_gsync_read_frm_status(char *path, char *buf, size_t blen);
int
-glusterd_create_status_file (char *master, char *slave, char *slave_url,
- char *slave_vol, char *status);
+glusterd_create_status_file(char *master, char *slave, char *slave_url,
+ char *slave_vol, char *status);
int
-glusterd_check_restart_gsync_session (glusterd_volinfo_t *volinfo, char *slave,
- dict_t *resp_dict, char *path_list,
- char *conf_path, gf_boolean_t is_force);
+glusterd_check_restart_gsync_session(glusterd_volinfo_t *volinfo, char *slave,
+ dict_t *resp_dict, char *path_list,
+ char *conf_path, gf_boolean_t is_force);
int
-glusterd_check_gsync_running_local (char *master, char *slave,
- char *conf_path,
- gf_boolean_t *is_run);
+glusterd_check_gsync_running_local(char *master, char *slave, char *conf_path,
+ gf_boolean_t *is_run);
gf_boolean_t
-glusterd_is_status_tasks_op (glusterd_op_t op, dict_t *dict);
+glusterd_is_status_tasks_op(glusterd_op_t op, dict_t *dict);
gf_boolean_t
-gd_should_i_start_rebalance (glusterd_volinfo_t *volinfo);
+gd_should_i_start_rebalance(glusterd_volinfo_t *volinfo);
int
-glusterd_is_tierd_enabled (glusterd_volinfo_t *volinfo);
+glusterd_is_tierd_enabled(glusterd_volinfo_t *volinfo);
int
-glusterd_is_tierd_supposed_to_be_enabled (glusterd_volinfo_t *volinfo);
+glusterd_is_tierd_supposed_to_be_enabled(glusterd_volinfo_t *volinfo);
int
-glusterd_is_volume_quota_enabled (glusterd_volinfo_t *volinfo);
+glusterd_is_volume_quota_enabled(glusterd_volinfo_t *volinfo);
int
-glusterd_is_volume_inode_quota_enabled (glusterd_volinfo_t *volinfo);
+glusterd_is_volume_inode_quota_enabled(glusterd_volinfo_t *volinfo);
int
-glusterd_is_bitrot_enabled (glusterd_volinfo_t *volinfo);
+glusterd_is_bitrot_enabled(glusterd_volinfo_t *volinfo);
gf_boolean_t
-glusterd_all_volumes_with_quota_stopped ();
+glusterd_all_volumes_with_quota_stopped();
void
-glusterd_clean_up_quota_store (glusterd_volinfo_t *volinfo);
+glusterd_clean_up_quota_store(glusterd_volinfo_t *volinfo);
int
-glusterd_remove_auxiliary_mount (char *volname);
+glusterd_remove_auxiliary_mount(char *volname);
gf_boolean_t
-glusterd_status_has_tasks (int cmd);
+glusterd_status_has_tasks(int cmd);
int
-gd_stop_rebalance_process (glusterd_volinfo_t *volinfo);
+gd_stop_rebalance_process(glusterd_volinfo_t *volinfo);
rpc_clnt_t *
-glusterd_rpc_clnt_unref (glusterd_conf_t *conf, rpc_clnt_t *rpc);
+glusterd_rpc_clnt_unref(glusterd_conf_t *conf, rpc_clnt_t *rpc);
int32_t
glusterd_compare_volume_name(struct cds_list_head *, struct cds_list_head *);
-char*
-glusterd_get_brick_mount_device (char *brick_path);
+char *
+glusterd_get_brick_mount_device(char *brick_path);
struct mntent *
-glusterd_get_mnt_entry_info (char *mnt_pt, char *buff, int buflen,
- struct mntent *entry_ptr);
+glusterd_get_mnt_entry_info(char *mnt_pt, char *buff, int buflen,
+ struct mntent *entry_ptr);
int
-glusterd_get_brick_root (char *path, char **mount_point);
+glusterd_get_brick_root(char *path, char **mount_point);
int32_t
-glusterd_lvm_snapshot_remove (dict_t *rsp_dict, glusterd_volinfo_t *snap_vol);
+glusterd_lvm_snapshot_remove(dict_t *rsp_dict, glusterd_volinfo_t *snap_vol);
gf_boolean_t
-gd_vol_is_geo_rep_active (glusterd_volinfo_t *volinfo);
+gd_vol_is_geo_rep_active(glusterd_volinfo_t *volinfo);
int32_t
-glusterd_get_brick_mount_dir (char *brickpath, char *hostname, char *mount_dir);
+glusterd_get_brick_mount_dir(char *brickpath, char *hostname, char *mount_dir);
int32_t
-glusterd_aggr_brick_mount_dirs (dict_t *aggr, dict_t *rsp_dict);
+glusterd_aggr_brick_mount_dirs(dict_t *aggr, dict_t *rsp_dict);
int32_t
-glusterd_take_lvm_snapshot (glusterd_brickinfo_t *brickinfo,
- char *origin_brick_path);
+glusterd_take_lvm_snapshot(glusterd_brickinfo_t *brickinfo,
+ char *origin_brick_path);
void
-glusterd_launch_synctask (synctask_fn_t fn, void *opaque);
+glusterd_launch_synctask(synctask_fn_t fn, void *opaque);
int
-glusterd_enable_default_options (glusterd_volinfo_t *volinfo, char *option);
+glusterd_enable_default_options(glusterd_volinfo_t *volinfo, char *option);
int
-glusterd_unlink_file (char *sock_file_path);
+glusterd_unlink_file(char *sock_file_path);
int32_t
-glusterd_find_brick_mount_path (char *brick_path, char **brick_mount_path);
+glusterd_find_brick_mount_path(char *brick_path, char **brick_mount_path);
/*
* Function to retrieve list of snap volnames and their uuids
*/
-int glusterd_snapshot_get_volnames_uuids (dict_t *dict,
- char *volname, gf_getsnap_name_uuid_rsp *snap_info_rsp);
+int
+glusterd_snapshot_get_volnames_uuids(dict_t *dict, char *volname,
+ gf_getsnap_name_uuid_rsp *snap_info_rsp);
int
-glusterd_update_mntopts (char *brick_path, glusterd_brickinfo_t *brickinfo);
+glusterd_update_mntopts(char *brick_path, glusterd_brickinfo_t *brickinfo);
int
-glusterd_update_fs_label (glusterd_brickinfo_t *brickinfo);
+glusterd_update_fs_label(glusterd_brickinfo_t *brickinfo);
int
-glusterd_get_volopt_content (dict_t *dict, gf_boolean_t xml_out);
+glusterd_get_volopt_content(dict_t *dict, gf_boolean_t xml_out);
int
-glusterd_get_global_max_op_version (rpcsvc_request_t *req, dict_t *ctx,
- int count);
+glusterd_get_global_max_op_version(rpcsvc_request_t *req, dict_t *ctx,
+ int count);
int
-glusterd_get_global_options_for_all_vols (rpcsvc_request_t *req, dict_t *dict,
- char **op_errstr);
+glusterd_get_global_options_for_all_vols(rpcsvc_request_t *req, dict_t *dict,
+ char **op_errstr);
int
-glusterd_get_default_val_for_volopt (dict_t *dict, gf_boolean_t all_opts,
- char *key, char *orig_key,
- glusterd_volinfo_t *volinfo,
- char **err_str);
+glusterd_get_default_val_for_volopt(dict_t *dict, gf_boolean_t all_opts,
+ char *key, char *orig_key,
+ glusterd_volinfo_t *volinfo,
+ char **err_str);
int
-glusterd_check_client_op_version_support (char *volname, uint32_t op_version,
- char **op_errstr);
+glusterd_check_client_op_version_support(char *volname, uint32_t op_version,
+ char **op_errstr);
gf_boolean_t
-glusterd_have_peers ();
+glusterd_have_peers();
gf_boolean_t
-glusterd_have_volumes ();
+glusterd_have_volumes();
void
-glusterd_get_rebalance_volfile (glusterd_volinfo_t *volinfo,
- char *path, int path_len);
+glusterd_get_rebalance_volfile(glusterd_volinfo_t *volinfo, char *path,
+ int path_len);
void
-glusterd_get_gfproxy_client_volfile (glusterd_volinfo_t *volinfo,
- char *path, int path_len);
+glusterd_get_gfproxy_client_volfile(glusterd_volinfo_t *volinfo, char *path,
+ int path_len);
int32_t
-glusterd_brickinfo_dup (glusterd_brickinfo_t *brickinfo,
- glusterd_brickinfo_t *dup_brickinfo);
+glusterd_brickinfo_dup(glusterd_brickinfo_t *brickinfo,
+ glusterd_brickinfo_t *dup_brickinfo);
int
-glusterd_vol_add_quota_conf_to_dict (glusterd_volinfo_t *volinfo, dict_t *load,
- int vol_idx, char *prefix);
+glusterd_vol_add_quota_conf_to_dict(glusterd_volinfo_t *volinfo, dict_t *load,
+ int vol_idx, char *prefix);
int32_t
-glusterd_import_volinfo (dict_t *peer_data, int count,
- glusterd_volinfo_t **volinfo,
- char *prefix);
+glusterd_import_volinfo(dict_t *peer_data, int count,
+ glusterd_volinfo_t **volinfo, char *prefix);
int
-glusterd_import_quota_conf (dict_t *peer_data, int vol_idx,
- glusterd_volinfo_t *new_volinfo,
- char *prefix);
+glusterd_import_quota_conf(dict_t *peer_data, int vol_idx,
+ glusterd_volinfo_t *new_volinfo, char *prefix);
gf_boolean_t
-glusterd_is_shd_compatible_volume (glusterd_volinfo_t *volinfo);
+glusterd_is_shd_compatible_volume(glusterd_volinfo_t *volinfo);
gf_boolean_t
-glusterd_is_shd_compatible_type (int type);
+glusterd_is_shd_compatible_type(int type);
gf_boolean_t
-glusterd_are_all_volumes_stopped ();
+glusterd_are_all_volumes_stopped();
gf_boolean_t
-glusterd_all_shd_compatible_volumes_stopped ();
+glusterd_all_shd_compatible_volumes_stopped();
void
-glusterd_nfs_pmap_deregister ();
+glusterd_nfs_pmap_deregister();
gf_boolean_t
-glusterd_is_volume_started (glusterd_volinfo_t *volinfo);
+glusterd_is_volume_started(glusterd_volinfo_t *volinfo);
int
-glusterd_volume_get_type_str (glusterd_volinfo_t *volinfo, char **vol_type_str);
+glusterd_volume_get_type_str(glusterd_volinfo_t *volinfo, char **vol_type_str);
int
-glusterd_volume_get_status_str (glusterd_volinfo_t *volinfo, char *status_str);
+glusterd_volume_get_status_str(glusterd_volinfo_t *volinfo, char *status_str);
int
-glusterd_volume_get_transport_type_str (glusterd_volinfo_t *volinfo,
- char *transport_type_str);
+glusterd_volume_get_transport_type_str(glusterd_volinfo_t *volinfo,
+ char *transport_type_str);
int
-glusterd_volume_get_quorum_status_str (glusterd_volinfo_t *volinfo,
- char *quorum_status_str);
+glusterd_volume_get_quorum_status_str(glusterd_volinfo_t *volinfo,
+ char *quorum_status_str);
int
-glusterd_volume_get_rebalance_status_str (glusterd_volinfo_t *volinfo,
- char *rebal_status_str);
+glusterd_volume_get_rebalance_status_str(glusterd_volinfo_t *volinfo,
+ char *rebal_status_str);
int
-glusterd_volume_get_hot_tier_type_str (glusterd_volinfo_t *volinfo,
- char **hot_tier_type_str);
+glusterd_volume_get_hot_tier_type_str(glusterd_volinfo_t *volinfo,
+ char **hot_tier_type_str);
int
-glusterd_volume_get_cold_tier_type_str (glusterd_volinfo_t *volinfo,
- char **cold_tier_type_str);
+glusterd_volume_get_cold_tier_type_str(glusterd_volinfo_t *volinfo,
+ char **cold_tier_type_str);
void
-glusterd_list_add_order (struct cds_list_head *new, struct cds_list_head *head,
+glusterd_list_add_order(struct cds_list_head *new, struct cds_list_head *head,
int (*compare)(struct cds_list_head *,
struct cds_list_head *));
int
-glusterd_disallow_op_for_tier (glusterd_volinfo_t *volinfo, glusterd_op_t op,
- int cmd);
+glusterd_disallow_op_for_tier(glusterd_volinfo_t *volinfo, glusterd_op_t op,
+ int cmd);
-struct rpc_clnt*
-glusterd_defrag_rpc_get (glusterd_defrag_info_t *defrag);
+struct rpc_clnt *
+glusterd_defrag_rpc_get(glusterd_defrag_info_t *defrag);
-struct rpc_clnt*
-glusterd_defrag_rpc_put (glusterd_defrag_info_t *defrag);
+struct rpc_clnt *
+glusterd_defrag_rpc_put(glusterd_defrag_info_t *defrag);
int32_t
-glusterd_count_connected_peers (int32_t *count);
+glusterd_count_connected_peers(int32_t *count);
int
-glusterd_volume_brick_for_each (glusterd_volinfo_t *volinfo, void *data,
- int (*fn) (glusterd_volinfo_t *, glusterd_brickinfo_t *,
- dict_t *mod_dict, void *));
+glusterd_volume_brick_for_each(glusterd_volinfo_t *volinfo, void *data,
+ int (*fn)(glusterd_volinfo_t *,
+ glusterd_brickinfo_t *,
+ dict_t *mod_dict, void *));
int
-glusterd_get_dummy_client_filepath (char *filepath,
- glusterd_volinfo_t *volinfo,
- gf_transport_type type);
+glusterd_get_dummy_client_filepath(char *filepath, glusterd_volinfo_t *volinfo,
+ gf_transport_type type);
int
-glusterd_handle_replicate_brick_ops (glusterd_volinfo_t *volinfo,
- glusterd_brickinfo_t *brickinfo,
- glusterd_op_t op);
+glusterd_handle_replicate_brick_ops(glusterd_volinfo_t *volinfo,
+ glusterd_brickinfo_t *brickinfo,
+ glusterd_op_t op);
void
-assign_brick_groups (glusterd_volinfo_t *volinfo);
+assign_brick_groups(glusterd_volinfo_t *volinfo);
-glusterd_brickinfo_t*
-get_last_brick_of_brick_group (glusterd_volinfo_t *volinfo,
- glusterd_brickinfo_t *brickinfo);
+glusterd_brickinfo_t *
+get_last_brick_of_brick_group(glusterd_volinfo_t *volinfo,
+ glusterd_brickinfo_t *brickinfo);
int
-glusterd_get_rb_dst_brickinfo (glusterd_volinfo_t *volinfo,
- glusterd_brickinfo_t **brickinfo);
+glusterd_get_rb_dst_brickinfo(glusterd_volinfo_t *volinfo,
+ glusterd_brickinfo_t **brickinfo);
int
-rb_update_dstbrick_port (glusterd_brickinfo_t *dst_brickinfo, dict_t *rsp_dict,
- dict_t *req_dict);
+rb_update_dstbrick_port(glusterd_brickinfo_t *dst_brickinfo, dict_t *rsp_dict,
+ dict_t *req_dict);
int
-glusterd_op_perform_replace_brick (glusterd_volinfo_t *volinfo,
- char *old_brick, char *new_brick,
- dict_t *dict);
+glusterd_op_perform_replace_brick(glusterd_volinfo_t *volinfo, char *old_brick,
+ char *new_brick, dict_t *dict);
int32_t
-glusterd_brick_unlink_socket_file (glusterd_volinfo_t *volinfo,
- glusterd_brickinfo_t *brickinfo);
+glusterd_brick_unlink_socket_file(glusterd_volinfo_t *volinfo,
+ glusterd_brickinfo_t *brickinfo);
char *
-gd_rb_op_to_str (char *op);
+gd_rb_op_to_str(char *op);
glusterd_op_t
-gd_cli_to_gd_op (char *cli_op);
+gd_cli_to_gd_op(char *cli_op);
int
-glusterd_get_dst_brick_info (char **dst_brick, char *volname, char **op_errstr,
- glusterd_brickinfo_t **dst_brickinfo, char **host,
- dict_t *dict, char **dup_dstbrick);
+glusterd_get_dst_brick_info(char **dst_brick, char *volname, char **op_errstr,
+ glusterd_brickinfo_t **dst_brickinfo, char **host,
+ dict_t *dict, char **dup_dstbrick);
int
-glusterd_brick_op_prerequisites (dict_t *dict,
- char **op,
- glusterd_op_t *gd_op, char **volname,
- glusterd_volinfo_t **volinfo,
- char **src_brick, glusterd_brickinfo_t
- **src_brickinfo, char *pidfile,
- char **op_errstr, dict_t *rsp_dict);
+glusterd_brick_op_prerequisites(dict_t *dict, char **op, glusterd_op_t *gd_op,
+ char **volname, glusterd_volinfo_t **volinfo,
+ char **src_brick,
+ glusterd_brickinfo_t **src_brickinfo,
+ char *pidfile, char **op_errstr,
+ dict_t *rsp_dict);
int
-glusterd_get_volinfo_from_brick (char *brick, glusterd_volinfo_t **volinfo);
+glusterd_get_volinfo_from_brick(char *brick, glusterd_volinfo_t **volinfo);
gf_boolean_t
-glusterd_is_profile_on (glusterd_volinfo_t *volinfo);
+glusterd_is_profile_on(glusterd_volinfo_t *volinfo);
#endif
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.h b/xlators/mgmt/glusterd/src/glusterd-volgen.h
index 38a62393fd6..f9fc068931b 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.h
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.h
@@ -20,24 +20,24 @@
/* volopt map key name definitions */
-#define VKEY_DIAG_CNT_FOP_HITS "diagnostics.count-fop-hits"
+#define VKEY_DIAG_CNT_FOP_HITS "diagnostics.count-fop-hits"
#define VKEY_DIAG_LAT_MEASUREMENT "diagnostics.latency-measurement"
#define VKEY_FEATURES_LIMIT_USAGE "features.limit-usage"
-#define VKEY_FEATURES_SOFT_LIMIT "features.soft-limit"
-#define VKEY_MARKER_XTIME GEOREP".indexing"
-#define VKEY_MARKER_XTIME_FORCE GEOREP".ignore-pid-check"
-#define VKEY_CHANGELOG "changelog.changelog"
-#define VKEY_FEATURES_QUOTA "features.quota"
+#define VKEY_FEATURES_SOFT_LIMIT "features.soft-limit"
+#define VKEY_MARKER_XTIME GEOREP ".indexing"
+#define VKEY_MARKER_XTIME_FORCE GEOREP ".ignore-pid-check"
+#define VKEY_CHANGELOG "changelog.changelog"
+#define VKEY_FEATURES_QUOTA "features.quota"
#define VKEY_FEATURES_INODE_QUOTA "features.inode-quota"
-#define VKEY_FEATURES_TRASH "features.trash"
-#define VKEY_FEATURES_BITROT "features.bitrot"
-#define VKEY_FEATURES_SCRUB "features.scrub"
-#define VKEY_FEATURES_SELINUX "features.selinux"
-#define VKEY_PARALLEL_READDIR "performance.parallel-readdir"
-#define VKEY_READDIR_AHEAD "performance.readdir-ahead"
-#define VKEY_RDA_CACHE_LIMIT "performance.rda-cache-limit"
-#define VKEY_RDA_REQUEST_SIZE "performance.rda-request-size"
-#define VKEY_CONFIG_GFPROXY "config.gfproxyd"
+#define VKEY_FEATURES_TRASH "features.trash"
+#define VKEY_FEATURES_BITROT "features.bitrot"
+#define VKEY_FEATURES_SCRUB "features.scrub"
+#define VKEY_FEATURES_SELINUX "features.selinux"
+#define VKEY_PARALLEL_READDIR "performance.parallel-readdir"
+#define VKEY_READDIR_AHEAD "performance.readdir-ahead"
+#define VKEY_RDA_CACHE_LIMIT "performance.rda-cache-limit"
+#define VKEY_RDA_REQUEST_SIZE "performance.rda-request-size"
+#define VKEY_CONFIG_GFPROXY "config.gfproxyd"
#define AUTH_ALLOW_MAP_KEY "auth.allow"
#define AUTH_REJECT_MAP_KEY "auth.reject"
@@ -46,83 +46,82 @@
#define AUTH_REJECT_OPT_KEY "auth.addr.*.reject"
#define NFS_DISABLE_OPT_KEY "nfs.*.disable"
-#define SSL_OWN_CERT_OPT "ssl.own-cert"
+#define SSL_OWN_CERT_OPT "ssl.own-cert"
#define SSL_PRIVATE_KEY_OPT "ssl.private-key"
-#define SSL_CA_LIST_OPT "ssl.ca-list"
-#define SSL_CRL_PATH_OPT "ssl.crl-path"
-#define SSL_CERT_DEPTH_OPT "ssl.certificate-depth"
+#define SSL_CA_LIST_OPT "ssl.ca-list"
+#define SSL_CRL_PATH_OPT "ssl.crl-path"
+#define SSL_CERT_DEPTH_OPT "ssl.certificate-depth"
#define SSL_CIPHER_LIST_OPT "ssl.cipher-list"
-#define SSL_DH_PARAM_OPT "ssl.dh-param"
-#define SSL_EC_CURVE_OPT "ssl.ec-curve"
-
+#define SSL_DH_PARAM_OPT "ssl.dh-param"
+#define SSL_EC_CURVE_OPT "ssl.ec-curve"
typedef enum {
- GF_CLIENT_TRUSTED,
- GF_CLIENT_OTHER,
- GF_CLIENT_TRUSTED_PROXY,
+ GF_CLIENT_TRUSTED,
+ GF_CLIENT_OTHER,
+ GF_CLIENT_TRUSTED_PROXY,
} glusterd_client_type_t;
/* It indicates the type of volfile that the graph is built for */
typedef enum {
- GF_REBALANCED = 1,
- GF_QUOTAD,
- GF_SNAPD,
+ GF_REBALANCED = 1,
+ GF_QUOTAD,
+ GF_SNAPD,
} glusterd_graph_type_t;
struct volgen_graph {
- char **errstr;
- glusterfs_graph_t graph;
- glusterd_graph_type_t type;
+ char **errstr;
+ glusterfs_graph_t graph;
+ glusterd_graph_type_t type;
};
typedef struct volgen_graph volgen_graph_t;
-typedef int (*glusterd_graph_builder_t) (volgen_graph_t *graph,
- dict_t *mod_dict);
-
-#define COMPLETE_OPTION(key, completion, ret) \
- do { \
- if (!strchr (key, '.')) { \
- ret = option_complete (key, &completion); \
- if (ret) { \
- gf_msg ("", GF_LOG_ERROR, ENOMEM, \
- GD_MSG_NO_MEMORY, "Out of memory"); \
- return _gf_false; \
- } \
- \
- if (!completion) { \
- gf_msg ("", GF_LOG_ERROR, 0, \
- GD_MSG_INVALID_ENTRY, \
- "option %s does not" \
- "exist", key); \
- return _gf_false; \
- } \
- } \
- \
- if (completion) \
- GF_FREE (completion); \
- } while (0);
+typedef int (*glusterd_graph_builder_t)(volgen_graph_t *graph,
+ dict_t *mod_dict);
+
+#define COMPLETE_OPTION(key, completion, ret) \
+ do { \
+ if (!strchr(key, '.')) { \
+ ret = option_complete(key, &completion); \
+ if (ret) { \
+ gf_msg("", GF_LOG_ERROR, ENOMEM, GD_MSG_NO_MEMORY, \
+ "Out of memory"); \
+ return _gf_false; \
+ } \
+ \
+ if (!completion) { \
+ gf_msg("", GF_LOG_ERROR, 0, GD_MSG_INVALID_ENTRY, \
+ "option %s does not" \
+ "exist", \
+ key); \
+ return _gf_false; \
+ } \
+ } \
+ \
+ if (completion) \
+ GF_FREE(completion); \
+ } while (0);
typedef enum gd_volopt_flags_ {
- VOLOPT_FLAG_NONE,
- VOLOPT_FLAG_FORCE = 0x01, /* option needs force to be reset */
- VOLOPT_FLAG_XLATOR_OPT = 0x02, /* option enables/disables xlators */
- VOLOPT_FLAG_CLIENT_OPT = 0x04, /* option affects clients */
- VOLOPT_FLAG_NEVER_RESET = 0x08, /* option which should not be reset */
+ VOLOPT_FLAG_NONE,
+ VOLOPT_FLAG_FORCE = 0x01, /* option needs force to be reset */
+ VOLOPT_FLAG_XLATOR_OPT = 0x02, /* option enables/disables xlators */
+ VOLOPT_FLAG_CLIENT_OPT = 0x04, /* option affects clients */
+ VOLOPT_FLAG_NEVER_RESET = 0x08, /* option which should not be reset */
} gd_volopt_flags_t;
typedef enum {
- GF_XLATOR_POSIX = 0,
- GF_XLATOR_ACL,
- GF_XLATOR_LOCKS,
- GF_XLATOR_LEASES,
- GF_XLATOR_UPCALL,
- GF_XLATOR_IOT,
- GF_XLATOR_INDEX,
- GF_XLATOR_MARKER,
- GF_XLATOR_IO_STATS,
- GF_XLATOR_BD,
- GF_XLATOR_SERVER,
- GF_XLATOR_NONE,
+ GF_XLATOR_POSIX = 0,
+ GF_XLATOR_ACL,
+ GF_XLATOR_LOCKS,
+ GF_XLATOR_LEASES,
+ GF_XLATOR_UPCALL,
+ GF_XLATOR_IOT,
+ GF_XLATOR_INDEX,
+ GF_XLATOR_MARKER,
+ GF_XLATOR_IO_STATS,
+ GF_XLATOR_BD,
+ GF_XLATOR_SERVER,
+ GF_XLATOR_NONE,
} glusterd_server_xlator_t;
/* As of now debug xlators can be loaded only below fuse in the client
@@ -131,189 +130,187 @@ typedef enum {
* available.
*/
typedef enum {
- GF_CLNT_XLATOR_FUSE = 0,
- GF_CLNT_XLATOR_NONE,
+ GF_CLNT_XLATOR_FUSE = 0,
+ GF_CLNT_XLATOR_NONE,
} glusterd_client_xlator_t;
-typedef enum { DOC, NO_DOC, GLOBAL_DOC, GLOBAL_NO_DOC } option_type_t;
+typedef enum { DOC, NO_DOC, GLOBAL_DOC, GLOBAL_NO_DOC } option_type_t;
-typedef int (*vme_option_validation) (glusterd_volinfo_t *volinfo, dict_t *dict,
- char *key, char *value, char **op_errstr);
+typedef int (*vme_option_validation)(glusterd_volinfo_t *volinfo, dict_t *dict,
+ char *key, char *value, char **op_errstr);
struct volopt_map_entry {
- char *key;
- char *voltype;
- char *option;
- char *value;
- option_type_t type;
- uint32_t flags;
- uint32_t op_version;
- char *description;
- vme_option_validation validate_fn;
- /* If client_option is true, the option affects clients.
- * this is used to calculate client-op-version of volumes
- */
- //gf_boolean_t client_option;
+ char *key;
+ char *voltype;
+ char *option;
+ char *value;
+ option_type_t type;
+ uint32_t flags;
+ uint32_t op_version;
+ char *description;
+ vme_option_validation validate_fn;
+ /* If client_option is true, the option affects clients.
+ * this is used to calculate client-op-version of volumes
+ */
+ // gf_boolean_t client_option;
};
-typedef
-int (*brick_xlator_builder) (volgen_graph_t *graph,
- glusterd_volinfo_t *volinfo, dict_t *set_dict,
- glusterd_brickinfo_t *brickinfo);
+typedef int (*brick_xlator_builder)(volgen_graph_t *graph,
+ glusterd_volinfo_t *volinfo,
+ dict_t *set_dict,
+ glusterd_brickinfo_t *brickinfo);
struct volgen_brick_xlator {
- /* function that builds a xlator */
- brick_xlator_builder builder;
- /* debug key for a xlator that
- * gets used for adding debug translators like trace, error-gen,
- * delay-gen before this xlator */
- char *dbg_key;
+ /* function that builds a xlator */
+ brick_xlator_builder builder;
+ /* debug key for a xlator that
+ * gets used for adding debug translators like trace, error-gen,
+ * delay-gen before this xlator */
+ char *dbg_key;
};
typedef struct volgen_brick_xlator volgen_brick_xlator_t;
int
-glusterd_snapdsvc_create_volfile (glusterd_volinfo_t *volinfo);
+glusterd_snapdsvc_create_volfile(glusterd_volinfo_t *volinfo);
int
-glusterd_snapdsvc_generate_volfile (volgen_graph_t *graph,
- glusterd_volinfo_t *volinfo);
+glusterd_snapdsvc_generate_volfile(volgen_graph_t *graph,
+ glusterd_volinfo_t *volinfo);
int
-glusterd_create_global_volfile (glusterd_graph_builder_t builder,
- char *filepath, dict_t *mod_dict);
+glusterd_create_global_volfile(glusterd_graph_builder_t builder, char *filepath,
+ dict_t *mod_dict);
int
-glusterd_create_rb_volfiles (glusterd_volinfo_t *volinfo,
- glusterd_brickinfo_t *brickinfo);
+glusterd_create_rb_volfiles(glusterd_volinfo_t *volinfo,
+ glusterd_brickinfo_t *brickinfo);
int
-glusterd_create_volfiles (glusterd_volinfo_t *volinfo);
+glusterd_create_volfiles(glusterd_volinfo_t *volinfo);
int
-glusterd_create_volfiles_and_notify_services (glusterd_volinfo_t *volinfo);
+glusterd_create_volfiles_and_notify_services(glusterd_volinfo_t *volinfo);
int
-glusterd_generate_client_per_brick_volfile (glusterd_volinfo_t *volinfo);
+glusterd_generate_client_per_brick_volfile(glusterd_volinfo_t *volinfo);
void
-glusterd_get_nfs_filepath (char *filename);
+glusterd_get_nfs_filepath(char *filename);
void
-glusterd_get_shd_filepath (char *filename);
+glusterd_get_shd_filepath(char *filename);
int
-build_shd_graph (volgen_graph_t *graph, dict_t *mod_dict);
+build_shd_graph(volgen_graph_t *graph, dict_t *mod_dict);
int
-build_nfs_graph (volgen_graph_t *graph, dict_t *mod_dict);
+build_nfs_graph(volgen_graph_t *graph, dict_t *mod_dict);
int
-build_quotad_graph (volgen_graph_t *graph, dict_t *mod_dict);
+build_quotad_graph(volgen_graph_t *graph, dict_t *mod_dict);
int
-build_rebalance_volfile (glusterd_volinfo_t *volinfo, char *filepath,
- dict_t *mod_dict);
+build_rebalance_volfile(glusterd_volinfo_t *volinfo, char *filepath,
+ dict_t *mod_dict);
int
-build_bitd_graph (volgen_graph_t *graph, dict_t *mod_dict);
+build_bitd_graph(volgen_graph_t *graph, dict_t *mod_dict);
int
-build_scrub_graph (volgen_graph_t *graph, dict_t *mod_dict);
+build_scrub_graph(volgen_graph_t *graph, dict_t *mod_dict);
int
-glusterd_delete_volfile (glusterd_volinfo_t *volinfo,
- glusterd_brickinfo_t *brickinfo);
+glusterd_delete_volfile(glusterd_volinfo_t *volinfo,
+ glusterd_brickinfo_t *brickinfo);
int
-glusterd_delete_snap_volfile (glusterd_volinfo_t *volinfo,
- glusterd_volinfo_t *snap_volinfo,
- glusterd_brickinfo_t *brickinfo);
+glusterd_delete_snap_volfile(glusterd_volinfo_t *volinfo,
+ glusterd_volinfo_t *snap_volinfo,
+ glusterd_brickinfo_t *brickinfo);
int
-glusterd_volinfo_get (glusterd_volinfo_t *volinfo, char *key, char **value);
+glusterd_volinfo_get(glusterd_volinfo_t *volinfo, char *key, char **value);
int
-glusterd_volinfo_get_boolean (glusterd_volinfo_t *volinfo, char *key);
+glusterd_volinfo_get_boolean(glusterd_volinfo_t *volinfo, char *key);
int
-glusterd_validate_globalopts (glusterd_volinfo_t *volinfo, dict_t *val_dict,
- char **op_errstr);
+glusterd_validate_globalopts(glusterd_volinfo_t *volinfo, dict_t *val_dict,
+ char **op_errstr);
int
-glusterd_validate_localopts (dict_t *val_dict, char **op_errstr);
+glusterd_validate_localopts(dict_t *val_dict, char **op_errstr);
gf_boolean_t
-glusterd_check_globaloption (char *key);
+glusterd_check_globaloption(char *key);
gf_boolean_t
-glusterd_check_voloption_flags (char *key, int32_t flags);
+glusterd_check_voloption_flags(char *key, int32_t flags);
gf_boolean_t
-glusterd_is_valid_volfpath (char *volname, char *brick);
+glusterd_is_valid_volfpath(char *volname, char *brick);
int
-generate_brick_volfiles (glusterd_volinfo_t *volinfo);
+generate_brick_volfiles(glusterd_volinfo_t *volinfo);
int
-generate_snap_brick_volfiles (glusterd_volinfo_t *volinfo,
- glusterd_volinfo_t *snap_volinfo);
+generate_snap_brick_volfiles(glusterd_volinfo_t *volinfo,
+ glusterd_volinfo_t *snap_volinfo);
int
-generate_client_volfiles (glusterd_volinfo_t *volinfo,
- glusterd_client_type_t client_type);
+generate_client_volfiles(glusterd_volinfo_t *volinfo,
+ glusterd_client_type_t client_type);
int
-generate_snap_client_volfiles (glusterd_volinfo_t *actual_volinfo,
- glusterd_volinfo_t *snap_volinfo,
- glusterd_client_type_t client_type,
- gf_boolean_t vol_restore);
+generate_snap_client_volfiles(glusterd_volinfo_t *actual_volinfo,
+ glusterd_volinfo_t *snap_volinfo,
+ glusterd_client_type_t client_type,
+ gf_boolean_t vol_restore);
int
-_get_xlator_opt_key_from_vme ( struct volopt_map_entry *vme, char **key);
+_get_xlator_opt_key_from_vme(struct volopt_map_entry *vme, char **key);
void
-_free_xlator_opt_key (char *key);
-
+_free_xlator_opt_key(char *key);
#if (HAVE_LIB_XML)
int
-init_sethelp_xml_doc (xmlTextWriterPtr *writer, xmlBufferPtr *buf);
+init_sethelp_xml_doc(xmlTextWriterPtr *writer, xmlBufferPtr *buf);
int
-xml_add_volset_element (xmlTextWriterPtr writer, const char *name,
- const char *def_val, const char *dscrpt);
+xml_add_volset_element(xmlTextWriterPtr writer, const char *name,
+ const char *def_val, const char *dscrpt);
int
-end_sethelp_xml_doc (xmlTextWriterPtr writer);
+end_sethelp_xml_doc(xmlTextWriterPtr writer);
#endif /* HAVE_LIB_XML */
-char*
-glusterd_get_trans_type_rb (gf_transport_type ttype);
+char *
+glusterd_get_trans_type_rb(gf_transport_type ttype);
uint32_t
-glusterd_get_op_version_for_key (char *key);
+glusterd_get_op_version_for_key(char *key);
gf_boolean_t
-gd_is_client_option (char *key);
+gd_is_client_option(char *key);
gf_boolean_t
-gd_is_xlator_option (char *key);
+gd_is_xlator_option(char *key);
gf_boolean_t
-gd_is_boolean_option (char *key);
-
+gd_is_boolean_option(char *key);
-char*
-volgen_get_shd_key (int type);
+char *
+volgen_get_shd_key(int type);
int
-glusterd_volopt_validate (glusterd_volinfo_t *volinfo, dict_t *dict, char *key,
- char *value, char **op_errstr);
+glusterd_volopt_validate(glusterd_volinfo_t *volinfo, dict_t *dict, char *key,
+ char *value, char **op_errstr);
gf_boolean_t
-gd_is_self_heal_enabled (glusterd_volinfo_t *volinfo, dict_t *dict);
+gd_is_self_heal_enabled(glusterd_volinfo_t *volinfo, dict_t *dict);
int
-generate_dummy_client_volfiles (glusterd_volinfo_t *volinfo);
+generate_dummy_client_volfiles(glusterd_volinfo_t *volinfo);
int
-glusterd_generate_gfproxyd_volfile (glusterd_volinfo_t *volinfo);
+glusterd_generate_gfproxyd_volfile(glusterd_volinfo_t *volinfo);
int
-glusterd_build_gfproxyd_volfile (glusterd_volinfo_t *volinfo, char *filename);
+glusterd_build_gfproxyd_volfile(glusterd_volinfo_t *volinfo, char *filename);
#endif
diff --git a/xlators/mgmt/glusterd/src/glusterd.h b/xlators/mgmt/glusterd/src/glusterd.h
index 71ac45cd241..19cdee392f6 100644
--- a/xlators/mgmt/glusterd/src/glusterd.h
+++ b/xlators/mgmt/glusterd/src/glusterd.h
@@ -39,45 +39,50 @@
#include "events.h"
#include "glusterd-gfproxyd-svc.h"
-#define GLUSTERD_TR_LOG_SIZE 50
-#define GLUSTERD_QUORUM_TYPE_KEY "cluster.server-quorum-type"
-#define GLUSTERD_QUORUM_RATIO_KEY "cluster.server-quorum-ratio"
-#define GLUSTERD_GLOBAL_OPT_VERSION "global-option-version"
-#define GLUSTERD_GLOBAL_OP_VERSION_KEY "cluster.op-version"
-#define GLUSTERD_MAX_OP_VERSION_KEY "cluster.max-op-version"
-#define GLUSTERD_COMMON_PEM_PUB_FILE "/geo-replication/common_secret.pem.pub"
-#define GEO_CONF_MAX_OPT_VALS 6
-#define GLUSTERD_CREATE_HOOK_SCRIPT "/hooks/1/gsync-create/post/" \
- "S56glusterd-geo-rep-create-post.sh"
-#define GLUSTERD_SHRD_STRG_HOOK_SCRIPT "/hooks/1/set/post/" \
- "S32gluster_enable_shared_storage.sh"
-#define GLUSTER_SHARED_STORAGE "gluster_shared_storage"
-#define GLUSTERD_SHARED_STORAGE_KEY "cluster.enable-shared-storage"
-#define GLUSTERD_BRICK_MULTIPLEX_KEY "cluster.brick-multiplex"
-#define GLUSTERD_BRICKMUX_LIMIT_KEY "cluster.max-bricks-per-process"
-#define GLUSTERD_LOCALTIME_LOGGING_KEY "cluster.localtime-logging"
-#define GLUSTERD_DAEMON_LOG_LEVEL_KEY "cluster.daemon-log-level"
+#define GLUSTERD_TR_LOG_SIZE 50
+#define GLUSTERD_QUORUM_TYPE_KEY "cluster.server-quorum-type"
+#define GLUSTERD_QUORUM_RATIO_KEY "cluster.server-quorum-ratio"
+#define GLUSTERD_GLOBAL_OPT_VERSION "global-option-version"
+#define GLUSTERD_GLOBAL_OP_VERSION_KEY "cluster.op-version"
+#define GLUSTERD_MAX_OP_VERSION_KEY "cluster.max-op-version"
+#define GLUSTERD_COMMON_PEM_PUB_FILE "/geo-replication/common_secret.pem.pub"
+#define GEO_CONF_MAX_OPT_VALS 6
+#define GLUSTERD_CREATE_HOOK_SCRIPT \
+ "/hooks/1/gsync-create/post/" \
+ "S56glusterd-geo-rep-create-post.sh"
+#define GLUSTERD_SHRD_STRG_HOOK_SCRIPT \
+ "/hooks/1/set/post/" \
+ "S32gluster_enable_shared_storage.sh"
+#define GLUSTER_SHARED_STORAGE "gluster_shared_storage"
+#define GLUSTERD_SHARED_STORAGE_KEY "cluster.enable-shared-storage"
+#define GLUSTERD_BRICK_MULTIPLEX_KEY "cluster.brick-multiplex"
+#define GLUSTERD_BRICKMUX_LIMIT_KEY "cluster.max-bricks-per-process"
+#define GLUSTERD_LOCALTIME_LOGGING_KEY "cluster.localtime-logging"
+#define GLUSTERD_DAEMON_LOG_LEVEL_KEY "cluster.daemon-log-level"
#define GLUSTERD_SNAPS_MAX_HARD_LIMIT 256
#define GLUSTERD_SNAPS_DEF_SOFT_LIMIT_PERCENT 90
#define GLUSTERD_SNAPS_MAX_SOFT_LIMIT_PERCENT 100
#define GLUSTERD_SERVER_QUORUM "server"
-#define STATUS_STRLEN 128
+#define STATUS_STRLEN 128
#define FMTSTR_CHECK_VOL_EXISTS "Volume %s does not exist"
#define FMTSTR_RESOLVE_BRICK "Could not find peer on which brick %s:%s resides"
-#define LOGSTR_FOUND_BRICK "Found brick %s:%s in volume %s"
+#define LOGSTR_FOUND_BRICK "Found brick %s:%s in volume %s"
#define LOGSTR_BUILD_PAYLOAD "Failed to build payload for operation 'Volume %s'"
#define LOGSTR_STAGE_FAIL "Staging of operation 'Volume %s' failed on %s %s %s"
#define LOGSTR_COMMIT_FAIL "Commit of operation 'Volume %s' failed on %s %s %s"
-#define OPERRSTR_BUILD_PAYLOAD "Failed to build payload. Please check the log "\
- "file for more details."
-#define OPERRSTR_STAGE_FAIL "Staging failed on %s. Please check the log file " \
- "for more details."
-#define OPERRSTR_COMMIT_FAIL "Commit failed on %s. Please check the log file "\
- "for more details."
+#define OPERRSTR_BUILD_PAYLOAD \
+ "Failed to build payload. Please check the log " \
+ "file for more details."
+#define OPERRSTR_STAGE_FAIL \
+ "Staging failed on %s. Please check the log file " \
+ "for more details."
+#define OPERRSTR_COMMIT_FAIL \
+ "Commit failed on %s. Please check the log file " \
+ "for more details."
struct glusterd_volinfo_;
typedef struct glusterd_volinfo_ glusterd_volinfo_t;
@@ -88,57 +93,57 @@ typedef struct glusterd_snap_ glusterd_snap_t;
* at the end of latest enum (just before the GD_OP_MAX enum)
*/
typedef enum glusterd_op_ {
- GD_OP_NONE = 0,
- GD_OP_CREATE_VOLUME,
- GD_OP_START_BRICK,
- GD_OP_STOP_BRICK,
- GD_OP_DELETE_VOLUME,
- GD_OP_START_VOLUME,
- GD_OP_STOP_VOLUME,
- GD_OP_DEFRAG_VOLUME,
- GD_OP_ADD_BRICK,
- GD_OP_REMOVE_BRICK,
- GD_OP_REPLACE_BRICK,
- GD_OP_SET_VOLUME,
- GD_OP_RESET_VOLUME,
- GD_OP_SYNC_VOLUME,
- GD_OP_LOG_ROTATE,
- GD_OP_GSYNC_SET,
- GD_OP_PROFILE_VOLUME,
- GD_OP_QUOTA,
- GD_OP_STATUS_VOLUME,
- GD_OP_REBALANCE,
- GD_OP_HEAL_VOLUME,
- GD_OP_STATEDUMP_VOLUME,
- GD_OP_LIST_VOLUME,
- GD_OP_CLEARLOCKS_VOLUME,
- GD_OP_DEFRAG_BRICK_VOLUME,
- GD_OP_COPY_FILE,
- GD_OP_SYS_EXEC,
- GD_OP_GSYNC_CREATE,
- GD_OP_SNAP,
- GD_OP_BARRIER,
- GD_OP_GANESHA, /* obsolete */
- GD_OP_BITROT,
- GD_OP_DETACH_TIER,
- GD_OP_TIER_MIGRATE,
- GD_OP_SCRUB_STATUS,
- GD_OP_SCRUB_ONDEMAND,
- GD_OP_RESET_BRICK,
- GD_OP_MAX_OPVERSION,
- GD_OP_TIER_START_STOP,
- GD_OP_TIER_STATUS,
- GD_OP_DETACH_TIER_STATUS,
- GD_OP_DETACH_NOT_STARTED,
- GD_OP_REMOVE_TIER_BRICK,
- GD_OP_ADD_TIER_BRICK,
- GD_OP_MAX,
+ GD_OP_NONE = 0,
+ GD_OP_CREATE_VOLUME,
+ GD_OP_START_BRICK,
+ GD_OP_STOP_BRICK,
+ GD_OP_DELETE_VOLUME,
+ GD_OP_START_VOLUME,
+ GD_OP_STOP_VOLUME,
+ GD_OP_DEFRAG_VOLUME,
+ GD_OP_ADD_BRICK,
+ GD_OP_REMOVE_BRICK,
+ GD_OP_REPLACE_BRICK,
+ GD_OP_SET_VOLUME,
+ GD_OP_RESET_VOLUME,
+ GD_OP_SYNC_VOLUME,
+ GD_OP_LOG_ROTATE,
+ GD_OP_GSYNC_SET,
+ GD_OP_PROFILE_VOLUME,
+ GD_OP_QUOTA,
+ GD_OP_STATUS_VOLUME,
+ GD_OP_REBALANCE,
+ GD_OP_HEAL_VOLUME,
+ GD_OP_STATEDUMP_VOLUME,
+ GD_OP_LIST_VOLUME,
+ GD_OP_CLEARLOCKS_VOLUME,
+ GD_OP_DEFRAG_BRICK_VOLUME,
+ GD_OP_COPY_FILE,
+ GD_OP_SYS_EXEC,
+ GD_OP_GSYNC_CREATE,
+ GD_OP_SNAP,
+ GD_OP_BARRIER,
+ GD_OP_GANESHA, /* obsolete */
+ GD_OP_BITROT,
+ GD_OP_DETACH_TIER,
+ GD_OP_TIER_MIGRATE,
+ GD_OP_SCRUB_STATUS,
+ GD_OP_SCRUB_ONDEMAND,
+ GD_OP_RESET_BRICK,
+ GD_OP_MAX_OPVERSION,
+ GD_OP_TIER_START_STOP,
+ GD_OP_TIER_STATUS,
+ GD_OP_DETACH_TIER_STATUS,
+ GD_OP_DETACH_NOT_STARTED,
+ GD_OP_REMOVE_TIER_BRICK,
+ GD_OP_ADD_TIER_BRICK,
+ GD_OP_MAX,
} glusterd_op_t;
-extern const char * gd_op_list[];
+extern const char *gd_op_list[];
struct glusterd_volgen {
- dict_t *dict;
+ dict_t *dict;
};
/* Keeping all the paths required in glusterd would
@@ -152,446 +157,443 @@ struct glusterd_volgen {
#define VALID_GLUSTERD_PATHMAX (PATH_MAX - (256 + 64))
typedef struct {
- struct _volfile_ctx *volfile;
- pthread_mutex_t mutex;
- struct cds_list_head peers;
- gf_boolean_t verify_volfile_checksum;
- gf_boolean_t trace;
- uuid_t uuid;
- char workdir[VALID_GLUSTERD_PATHMAX];
- char rundir[VALID_GLUSTERD_PATHMAX];
- rpcsvc_t *rpc;
- glusterd_svc_t shd_svc;
- glusterd_svc_t nfs_svc;
- glusterd_svc_t bitd_svc;
- glusterd_svc_t scrub_svc;
- glusterd_svc_t quotad_svc;
- struct pmap_registry *pmap;
- struct cds_list_head volumes;
- struct cds_list_head snapshots; /*List of snap volumes */
- struct cds_list_head brick_procs; /* List of brick processes */
- pthread_mutex_t xprt_lock;
- struct list_head xprt_list;
- pthread_mutex_t import_volumes;
- gf_store_handle_t *handle;
- gf_timer_t *timer;
- glusterd_sm_tr_log_t op_sm_log;
- struct rpc_clnt_program *gfs_mgmt;
- dict_t *mgmt_v3_lock; /* Dict for saving
- * mgmt_v3 locks */
- dict_t *glusterd_txn_opinfo; /* Dict for saving
- * transaction opinfos */
- uuid_t global_txn_id; /* To be used in
- * heterogeneous
- * cluster with no
- * transaction ids */
-
- dict_t *mgmt_v3_lock_timer;
- struct cds_list_head mount_specs;
- pthread_t brick_thread;
- void *hooks_priv;
-
- /* need for proper handshake_t */
- int op_version; /* Starts with 1 for 3.3.0 */
- xlator_t *xl; /* Should be set to 'THIS' before creating thread */
- gf_boolean_t pending_quorum_action;
- dict_t *opts;
- synclock_t big_lock;
- gf_boolean_t restart_done;
- rpcsvc_t *uds_rpc; /* RPCSVC for the unix domain socket */
- uint32_t base_port;
- uint32_t max_port;
- char *snap_bricks_directory;
- gf_store_handle_t *missed_snaps_list_shandle;
- struct cds_list_head missed_snaps_list;
- int ping_timeout;
- uint32_t generation;
- int32_t workers;
- uint32_t blockers;
- uint32_t mgmt_v3_lock_timeout;
- gf_boolean_t restart_bricks;
+ struct _volfile_ctx *volfile;
+ pthread_mutex_t mutex;
+ struct cds_list_head peers;
+ gf_boolean_t verify_volfile_checksum;
+ gf_boolean_t trace;
+ uuid_t uuid;
+ char workdir[VALID_GLUSTERD_PATHMAX];
+ char rundir[VALID_GLUSTERD_PATHMAX];
+ rpcsvc_t *rpc;
+ glusterd_svc_t shd_svc;
+ glusterd_svc_t nfs_svc;
+ glusterd_svc_t bitd_svc;
+ glusterd_svc_t scrub_svc;
+ glusterd_svc_t quotad_svc;
+ struct pmap_registry *pmap;
+ struct cds_list_head volumes;
+ struct cds_list_head snapshots; /*List of snap volumes */
+ struct cds_list_head brick_procs; /* List of brick processes */
+ pthread_mutex_t xprt_lock;
+ struct list_head xprt_list;
+ pthread_mutex_t import_volumes;
+ gf_store_handle_t *handle;
+ gf_timer_t *timer;
+ glusterd_sm_tr_log_t op_sm_log;
+ struct rpc_clnt_program *gfs_mgmt;
+ dict_t *mgmt_v3_lock; /* Dict for saving
+ * mgmt_v3 locks */
+ dict_t *glusterd_txn_opinfo; /* Dict for saving
+ * transaction opinfos */
+ uuid_t global_txn_id; /* To be used in
+ * heterogeneous
+ * cluster with no
+ * transaction ids */
+
+ dict_t *mgmt_v3_lock_timer;
+ struct cds_list_head mount_specs;
+ pthread_t brick_thread;
+ void *hooks_priv;
+
+ /* need for proper handshake_t */
+ int op_version; /* Starts with 1 for 3.3.0 */
+ xlator_t *xl; /* Should be set to 'THIS' before creating thread */
+ gf_boolean_t pending_quorum_action;
+ dict_t *opts;
+ synclock_t big_lock;
+ gf_boolean_t restart_done;
+ rpcsvc_t *uds_rpc; /* RPCSVC for the unix domain socket */
+ uint32_t base_port;
+ uint32_t max_port;
+ char *snap_bricks_directory;
+ gf_store_handle_t *missed_snaps_list_shandle;
+ struct cds_list_head missed_snaps_list;
+ int ping_timeout;
+ uint32_t generation;
+ int32_t workers;
+ uint32_t blockers;
+ uint32_t mgmt_v3_lock_timeout;
+ gf_boolean_t restart_bricks;
} glusterd_conf_t;
-
typedef enum gf_brick_status {
- GF_BRICK_STOPPED,
- GF_BRICK_STARTED,
- GF_BRICK_STOPPING,
- GF_BRICK_STARTING
+ GF_BRICK_STOPPED,
+ GF_BRICK_STARTED,
+ GF_BRICK_STOPPING,
+ GF_BRICK_STARTING
} gf_brick_status_t;
struct glusterd_brickinfo {
- char hostname[NAME_MAX];
- char path[VALID_GLUSTERD_PATHMAX];
- char real_path[VALID_GLUSTERD_PATHMAX];
- char device_path[VALID_GLUSTERD_PATHMAX];
- char mount_dir[VALID_GLUSTERD_PATHMAX];
- char brick_id[1024];/*Client xlator name, AFR changelog name*/
- char fstype [NAME_MAX]; /* Brick file-system type */
- char mnt_opts [1024]; /* Brick mount options */
- struct cds_list_head brick_list;
- uuid_t uuid;
- int port;
- int rdma_port;
- char *logfile;
- gf_store_handle_t *shandle;
- gf_brick_status_t status;
- struct rpc_clnt *rpc;
- int decommissioned;
- char vg[PATH_MAX]; /* FIXME: Use max size for length of vg */
- int caps; /* Capability */
- int32_t snap_status;
- /*
- * The group is used to identify which bricks are part of the same
- * replica set during brick-volfile generation, so that JBR volfiles
- * can "cross-connect" the bricks to one another. It is also used by
- * AFR to load the arbiter xlator in the appropriate brick in case of
- * a replica 3 volume with arbiter enabled.
- */
- uint16_t group;
- uuid_t jbr_uuid;
-
- /* Below are used for handling the case of multiple bricks sharing
- the backend filesystem */
- uint64_t statfs_fsid;
- uint32_t fs_share_count;
- gf_boolean_t port_registered;
- gf_boolean_t start_triggered;
- pthread_mutex_t restart_mutex;
+ char hostname[NAME_MAX];
+ char path[VALID_GLUSTERD_PATHMAX];
+ char real_path[VALID_GLUSTERD_PATHMAX];
+ char device_path[VALID_GLUSTERD_PATHMAX];
+ char mount_dir[VALID_GLUSTERD_PATHMAX];
+ char brick_id[1024]; /*Client xlator name, AFR changelog name*/
+ char fstype[NAME_MAX]; /* Brick file-system type */
+ char mnt_opts[1024]; /* Brick mount options */
+ struct cds_list_head brick_list;
+ uuid_t uuid;
+ int port;
+ int rdma_port;
+ char *logfile;
+ gf_store_handle_t *shandle;
+ gf_brick_status_t status;
+ struct rpc_clnt *rpc;
+ int decommissioned;
+ char vg[PATH_MAX]; /* FIXME: Use max size for length of vg */
+ int caps; /* Capability */
+ int32_t snap_status;
+ /*
+ * The group is used to identify which bricks are part of the same
+ * replica set during brick-volfile generation, so that JBR volfiles
+ * can "cross-connect" the bricks to one another. It is also used by
+ * AFR to load the arbiter xlator in the appropriate brick in case of
+ * a replica 3 volume with arbiter enabled.
+ */
+ uint16_t group;
+ uuid_t jbr_uuid;
+
+ /* Below are used for handling the case of multiple bricks sharing
+ the backend filesystem */
+ uint64_t statfs_fsid;
+ uint32_t fs_share_count;
+ gf_boolean_t port_registered;
+ gf_boolean_t start_triggered;
+ pthread_mutex_t restart_mutex;
};
typedef struct glusterd_brickinfo glusterd_brickinfo_t;
struct glusterd_brick_proc {
- int port;
- uint32_t brick_count;
- struct cds_list_head brick_proc_list;
- struct cds_list_head bricks;
+ int port;
+ uint32_t brick_count;
+ struct cds_list_head brick_proc_list;
+ struct cds_list_head bricks;
};
typedef struct glusterd_brick_proc glusterd_brick_proc_t;
struct glusterd_gfproxyd_info {
- short port;
- char *logfile;
+ short port;
+ char *logfile;
};
struct gf_defrag_brickinfo_ {
- char *name;
- int files;
- int size;
+ char *name;
+ int files;
+ int size;
};
-typedef int (*defrag_cbk_fn_t) (glusterd_volinfo_t *volinfo,
- gf_defrag_status_t status);
+typedef int (*defrag_cbk_fn_t)(glusterd_volinfo_t *volinfo,
+ gf_defrag_status_t status);
struct glusterd_defrag_info_ {
- uint64_t total_files;
- uint64_t total_data;
- uint64_t num_files_lookedup;
- uint64_t total_failures;
- gf_lock_t lock;
- int cmd;
- pthread_t th;
- gf_defrag_status_t defrag_status;
- struct rpc_clnt *rpc;
- uint32_t connected;
- char mount[1024];
- struct gf_defrag_brickinfo_ *bricks; /* volinfo->brick_count */
-
- defrag_cbk_fn_t cbk_fn;
+ uint64_t total_files;
+ uint64_t total_data;
+ uint64_t num_files_lookedup;
+ uint64_t total_failures;
+ gf_lock_t lock;
+ int cmd;
+ pthread_t th;
+ gf_defrag_status_t defrag_status;
+ struct rpc_clnt *rpc;
+ uint32_t connected;
+ char mount[1024];
+ struct gf_defrag_brickinfo_ *bricks; /* volinfo->brick_count */
+
+ defrag_cbk_fn_t cbk_fn;
};
-
typedef struct glusterd_defrag_info_ glusterd_defrag_info_t;
typedef enum gf_transport_type_ {
- GF_TRANSPORT_TCP, //DEFAULT
- GF_TRANSPORT_RDMA,
- GF_TRANSPORT_BOTH_TCP_RDMA,
+ GF_TRANSPORT_TCP, // DEFAULT
+ GF_TRANSPORT_RDMA,
+ GF_TRANSPORT_BOTH_TCP_RDMA,
} gf_transport_type;
-
typedef enum gf_rb_status_ {
- GF_RB_STATUS_NONE,
- GF_RB_STATUS_STARTED,
- GF_RB_STATUS_PAUSED,
+ GF_RB_STATUS_NONE,
+ GF_RB_STATUS_STARTED,
+ GF_RB_STATUS_PAUSED,
} gf_rb_status_t;
struct _auth {
- char *username;
- char *password;
+ char *username;
+ char *password;
};
typedef struct _auth auth_t;
/* Capabilities of xlator */
-#define CAPS_BD 0x00000001
-#define CAPS_THIN 0x00000002
-#define CAPS_OFFLOAD_COPY 0x00000004
+#define CAPS_BD 0x00000001
+#define CAPS_THIN 0x00000002
+#define CAPS_OFFLOAD_COPY 0x00000004
#define CAPS_OFFLOAD_SNAPSHOT 0x00000008
-#define CAPS_OFFLOAD_ZERO 0x00000020
+#define CAPS_OFFLOAD_ZERO 0x00000020
struct glusterd_bitrot_scrub_ {
- char *scrub_state;
- char *scrub_impact;
- char *scrub_freq;
- uint64_t scrubbed_files;
- uint64_t unsigned_files;
- uint64_t last_scrub_time;
- uint64_t scrub_duration;
- uint64_t error_count;
+ char *scrub_state;
+ char *scrub_impact;
+ char *scrub_freq;
+ uint64_t scrubbed_files;
+ uint64_t unsigned_files;
+ uint64_t last_scrub_time;
+ uint64_t scrub_duration;
+ uint64_t error_count;
};
typedef struct glusterd_bitrot_scrub_ glusterd_bitrot_scrub_t;
struct glusterd_rebalance_ {
- gf_defrag_status_t defrag_status;
- uint64_t rebalance_files;
- uint64_t rebalance_data;
- uint64_t lookedup_files;
- uint64_t skipped_files;
- glusterd_defrag_info_t *defrag;
- gf_cli_defrag_type defrag_cmd;
- uint64_t rebalance_failures;
- uuid_t rebalance_id;
- double rebalance_time;
- uint64_t time_left;
- glusterd_op_t op;
- dict_t *dict; /* Dict to store misc information
- * like list of bricks being removed */
- uint32_t commit_hash;
+ gf_defrag_status_t defrag_status;
+ uint64_t rebalance_files;
+ uint64_t rebalance_data;
+ uint64_t lookedup_files;
+ uint64_t skipped_files;
+ glusterd_defrag_info_t *defrag;
+ gf_cli_defrag_type defrag_cmd;
+ uint64_t rebalance_failures;
+ uuid_t rebalance_id;
+ double rebalance_time;
+ uint64_t time_left;
+ glusterd_op_t op;
+ dict_t *dict; /* Dict to store misc information
+ * like list of bricks being removed */
+ uint32_t commit_hash;
};
typedef struct glusterd_rebalance_ glusterd_rebalance_t;
struct glusterd_replace_brick_ {
- glusterd_brickinfo_t *src_brick;
- glusterd_brickinfo_t *dst_brick;
+ glusterd_brickinfo_t *src_brick;
+ glusterd_brickinfo_t *dst_brick;
};
typedef struct glusterd_replace_brick_ glusterd_replace_brick_t;
typedef enum gd_quorum_status_ {
- NOT_APPLICABLE_QUORUM, //Does not follow quorum
- MEETS_QUORUM, //Follows quorum and meets.
- DOESNT_MEET_QUORUM, //Follows quorum and does not meet.
+ NOT_APPLICABLE_QUORUM, // Does not follow quorum
+ MEETS_QUORUM, // Follows quorum and meets.
+ DOESNT_MEET_QUORUM, // Follows quorum and does not meet.
} gd_quorum_status_t;
typedef struct tier_info_ {
- int cold_type;
- int cold_brick_count;
- int cold_replica_count;
- int cold_disperse_count;
- int cold_dist_leaf_count;
- int cold_redundancy_count;
- int hot_type;
- int hot_brick_count;
- int hot_replica_count;
- int promoted;
- int demoted;
- uint16_t cur_tier_hot;
+ int cold_type;
+ int cold_brick_count;
+ int cold_replica_count;
+ int cold_disperse_count;
+ int cold_dist_leaf_count;
+ int cold_redundancy_count;
+ int hot_type;
+ int hot_brick_count;
+ int hot_replica_count;
+ int promoted;
+ int demoted;
+ uint16_t cur_tier_hot;
} gd_tier_info_t;
struct glusterd_volinfo_ {
- gf_lock_t lock;
- gf_boolean_t is_snap_volume;
- glusterd_snap_t *snapshot;
- uuid_t restored_from_snap;
- gd_tier_info_t tier_info;
- gf_boolean_t is_tier_enabled;
- char parent_volname[GD_VOLUME_NAME_MAX];
- /* In case of a snap volume
- i.e (is_snap_volume == TRUE) this
- field will contain the name of
- the volume which is snapped. In
- case of a non-snap volume, this
- field will be initialized as N/A */
- char volname[NAME_MAX + 1];
- /* NAME_MAX + 1 will be equal to
- * GD_VOLUME_NAME_MAX + 5.(also to
- * GD_VOLUME_NAME_MAX_TIER). An extra 5
- * bytes are added to GD_VOLUME_NAME_MAX
- * because, as part of the tiering
- * volfile generation code, we are
- * temporarily appending either "-hot"
- * or "-cold" */
- int type;
- int brick_count;
- uint64_t snap_count;
- uint64_t snap_max_hard_limit;
- struct cds_list_head vol_list;
- /* In case of a snap volume
- i.e (is_snap_volume == TRUE) this
- is linked to glusterd_snap_t->volumes.
- In case of a non-snap volume, this is
- linked to glusterd_conf_t->volumes */
- struct cds_list_head snapvol_list;
- /* This is a current pointer for
- glusterd_volinfo_t->snap_volumes */
- struct cds_list_head bricks;
- struct cds_list_head snap_volumes;
- /* TODO : Need to remove this, as this
- * is already part of snapshot object.
- */
- glusterd_volume_status status;
- int sub_count; /* backward compatibility */
- int stripe_count;
- int replica_count;
- int arbiter_count;
- int disperse_count;
- int redundancy_count;
- int subvol_count; /* Number of subvolumes in a
- distribute volume */
- int dist_leaf_count; /* Number of bricks in one
- distribute subvolume */
- int port;
- gf_store_handle_t *shandle;
- gf_store_handle_t *node_state_shandle;
- gf_store_handle_t *quota_conf_shandle;
-
- /* Defrag/rebalance related */
- glusterd_rebalance_t rebal;
-
- /* Replace brick status */
- glusterd_replace_brick_t rep_brick;
-
- /* Bitrot scrub status*/
- glusterd_bitrot_scrub_t bitrot_scrub;
-
- glusterd_rebalance_t tier;
-
- int version;
- uint32_t quota_conf_version;
- uint32_t cksum;
- uint32_t quota_conf_cksum;
- gf_transport_type transport_type;
-
- dict_t *dict;
-
- uuid_t volume_id;
- auth_t auth;
- char *logdir;
-
- dict_t *gsync_slaves;
- dict_t *gsync_active_slaves;
-
- int decommission_in_progress;
- xlator_t *xl;
-
- gf_boolean_t memory_accounting;
- int caps; /* Capability */
-
- int op_version;
- int client_op_version;
- pthread_mutex_t reflock;
- int refcnt;
- gd_quorum_status_t quorum_status;
-
- glusterd_snapdsvc_t snapd;
- glusterd_tierdsvc_t tierd;
- glusterd_gfproxydsvc_t gfproxyd;
- int32_t quota_xattr_version;
- gf_boolean_t stage_deleted; /* volume has passed staging
- * for delete operation
- */
+ gf_lock_t lock;
+ gf_boolean_t is_snap_volume;
+ glusterd_snap_t *snapshot;
+ uuid_t restored_from_snap;
+ gd_tier_info_t tier_info;
+ gf_boolean_t is_tier_enabled;
+ char parent_volname[GD_VOLUME_NAME_MAX];
+ /* In case of a snap volume
+ i.e (is_snap_volume == TRUE) this
+ field will contain the name of
+ the volume which is snapped. In
+ case of a non-snap volume, this
+ field will be initialized as N/A */
+ char volname[NAME_MAX + 1];
+ /* NAME_MAX + 1 will be equal to
+ * GD_VOLUME_NAME_MAX + 5.(also to
+ * GD_VOLUME_NAME_MAX_TIER). An extra 5
+ * bytes are added to GD_VOLUME_NAME_MAX
+ * because, as part of the tiering
+ * volfile generation code, we are
+ * temporarily appending either "-hot"
+ * or "-cold" */
+ int type;
+ int brick_count;
+ uint64_t snap_count;
+ uint64_t snap_max_hard_limit;
+ struct cds_list_head vol_list;
+ /* In case of a snap volume
+ i.e (is_snap_volume == TRUE) this
+ is linked to glusterd_snap_t->volumes.
+ In case of a non-snap volume, this is
+ linked to glusterd_conf_t->volumes */
+ struct cds_list_head snapvol_list;
+ /* This is a current pointer for
+ glusterd_volinfo_t->snap_volumes */
+ struct cds_list_head bricks;
+ struct cds_list_head snap_volumes;
+ /* TODO : Need to remove this, as this
+ * is already part of snapshot object.
+ */
+ glusterd_volume_status status;
+ int sub_count; /* backward compatibility */
+ int stripe_count;
+ int replica_count;
+ int arbiter_count;
+ int disperse_count;
+ int redundancy_count;
+ int subvol_count; /* Number of subvolumes in a
+ distribute volume */
+ int dist_leaf_count; /* Number of bricks in one
+ distribute subvolume */
+ int port;
+ gf_store_handle_t *shandle;
+ gf_store_handle_t *node_state_shandle;
+ gf_store_handle_t *quota_conf_shandle;
+
+ /* Defrag/rebalance related */
+ glusterd_rebalance_t rebal;
+
+ /* Replace brick status */
+ glusterd_replace_brick_t rep_brick;
+
+ /* Bitrot scrub status*/
+ glusterd_bitrot_scrub_t bitrot_scrub;
+
+ glusterd_rebalance_t tier;
+
+ int version;
+ uint32_t quota_conf_version;
+ uint32_t cksum;
+ uint32_t quota_conf_cksum;
+ gf_transport_type transport_type;
+
+ dict_t *dict;
+
+ uuid_t volume_id;
+ auth_t auth;
+ char *logdir;
+
+ dict_t *gsync_slaves;
+ dict_t *gsync_active_slaves;
+
+ int decommission_in_progress;
+ xlator_t *xl;
+
+ gf_boolean_t memory_accounting;
+ int caps; /* Capability */
+
+ int op_version;
+ int client_op_version;
+ pthread_mutex_t reflock;
+ int refcnt;
+ gd_quorum_status_t quorum_status;
+
+ glusterd_snapdsvc_t snapd;
+ glusterd_tierdsvc_t tierd;
+ glusterd_gfproxydsvc_t gfproxyd;
+ int32_t quota_xattr_version;
+ gf_boolean_t stage_deleted; /* volume has passed staging
+ * for delete operation
+ */
};
typedef enum gd_snap_status_ {
- GD_SNAP_STATUS_NONE,
- GD_SNAP_STATUS_INIT,
- GD_SNAP_STATUS_IN_USE,
- GD_SNAP_STATUS_DECOMMISSION,
- GD_SNAP_STATUS_UNDER_RESTORE,
- GD_SNAP_STATUS_RESTORED,
+ GD_SNAP_STATUS_NONE,
+ GD_SNAP_STATUS_INIT,
+ GD_SNAP_STATUS_IN_USE,
+ GD_SNAP_STATUS_DECOMMISSION,
+ GD_SNAP_STATUS_UNDER_RESTORE,
+ GD_SNAP_STATUS_RESTORED,
} gd_snap_status_t;
struct glusterd_snap_ {
- gf_lock_t lock;
- struct cds_list_head volumes;
- struct cds_list_head snap_list;
- char snapname[GLUSTERD_MAX_SNAP_NAME];
- uuid_t snap_id;
- char *description;
- time_t time_stamp;
- gf_boolean_t snap_restored;
- gd_snap_status_t snap_status;
- gf_store_handle_t *shandle;
+ gf_lock_t lock;
+ struct cds_list_head volumes;
+ struct cds_list_head snap_list;
+ char snapname[GLUSTERD_MAX_SNAP_NAME];
+ uuid_t snap_id;
+ char *description;
+ time_t time_stamp;
+ gf_boolean_t snap_restored;
+ gd_snap_status_t snap_status;
+ gf_store_handle_t *shandle;
};
typedef struct glusterd_snap_op_ {
- char *snap_vol_id;
- int32_t brick_num;
- char *brick_path;
- int32_t op;
- int32_t status;
- struct cds_list_head snap_ops_list;
+ char *snap_vol_id;
+ int32_t brick_num;
+ char *brick_path;
+ int32_t op;
+ int32_t status;
+ struct cds_list_head snap_ops_list;
} glusterd_snap_op_t;
typedef struct glusterd_missed_snap_ {
- char *node_uuid;
- char *snap_uuid;
- struct cds_list_head missed_snaps;
- struct cds_list_head snap_ops;
+ char *node_uuid;
+ char *snap_uuid;
+ struct cds_list_head missed_snaps;
+ struct cds_list_head snap_ops;
} glusterd_missed_snap_info;
typedef enum gd_node_type_ {
- GD_NODE_NONE,
- GD_NODE_BRICK,
- GD_NODE_SHD,
- GD_NODE_REBALANCE,
- GD_NODE_NFS,
- GD_NODE_QUOTAD,
- GD_NODE_SNAPD,
- GD_NODE_BITD,
- GD_NODE_SCRUB,
- GD_NODE_TIERD
+ GD_NODE_NONE,
+ GD_NODE_BRICK,
+ GD_NODE_SHD,
+ GD_NODE_REBALANCE,
+ GD_NODE_NFS,
+ GD_NODE_QUOTAD,
+ GD_NODE_SNAPD,
+ GD_NODE_BITD,
+ GD_NODE_SCRUB,
+ GD_NODE_TIERD
} gd_node_type;
typedef enum missed_snap_stat {
- GD_MISSED_SNAP_NONE,
- GD_MISSED_SNAP_PENDING,
- GD_MISSED_SNAP_DONE,
+ GD_MISSED_SNAP_NONE,
+ GD_MISSED_SNAP_PENDING,
+ GD_MISSED_SNAP_DONE,
} missed_snap_stat;
typedef struct glusterd_pending_node_ {
- struct cds_list_head list;
- void *node;
- gd_node_type type;
- int32_t index;
+ struct cds_list_head list;
+ void *node;
+ gd_node_type type;
+ int32_t index;
} glusterd_pending_node_t;
struct gsync_config_opt_vals_ {
- char *op_name;
- int no_of_pos_vals;
- gf_boolean_t case_sensitive;
- char *values[GEO_CONF_MAX_OPT_VALS];
+ char *op_name;
+ int no_of_pos_vals;
+ gf_boolean_t case_sensitive;
+ char *values[GEO_CONF_MAX_OPT_VALS];
};
enum glusterd_op_ret {
- GLUSTERD_CONNECTION_AWAITED = 100,
+ GLUSTERD_CONNECTION_AWAITED = 100,
};
enum glusterd_vol_comp_status_ {
- GLUSTERD_VOL_COMP_NONE = 0,
- GLUSTERD_VOL_COMP_SCS = 1,
- GLUSTERD_VOL_COMP_UPDATE_REQ,
- GLUSTERD_VOL_COMP_RJT,
+ GLUSTERD_VOL_COMP_NONE = 0,
+ GLUSTERD_VOL_COMP_SCS = 1,
+ GLUSTERD_VOL_COMP_UPDATE_REQ,
+ GLUSTERD_VOL_COMP_RJT,
};
typedef struct addrinfo_list {
- struct cds_list_head list;
- struct addrinfo *info;
+ struct cds_list_head list;
+ struct addrinfo *info;
} addrinfo_list_t;
typedef enum {
- GF_AI_COMPARE_NO_MATCH = 0,
- GF_AI_COMPARE_MATCH = 1,
- GF_AI_COMPARE_ERROR = 2
+ GF_AI_COMPARE_NO_MATCH = 0,
+ GF_AI_COMPARE_MATCH = 1,
+ GF_AI_COMPARE_ERROR = 2
} gf_ai_compare_t;
-#define GLUSTERD_DEFAULT_PORT GF_DEFAULT_BASE_PORT
-#define GLUSTERD_INFO_FILE "glusterd.info"
+#define GLUSTERD_DEFAULT_PORT GF_DEFAULT_BASE_PORT
+#define GLUSTERD_INFO_FILE "glusterd.info"
#define GLUSTERD_VOLUME_QUOTA_CONFIG "quota.conf"
#define GLUSTERD_VOLUME_DIR_PREFIX "vols"
#define GLUSTERD_PEER_DIR_PREFIX "peers"
@@ -607,813 +609,883 @@ typedef enum {
#define GLUSTERD_MISSED_SNAPS_LIST_FILE "missed_snaps_list"
#define GLUSTERD_VOL_SNAP_DIR_PREFIX "snaps"
-#define GLUSTERD_DEFAULT_SNAPS_BRICK_DIR "/gluster/snaps"
-#define GLUSTERD_BITD_RUN_DIR "/bitd"
-#define GLUSTERD_SCRUB_RUN_DIR "/scrub"
-#define GLUSTERD_GLUSTERSHD_RUN_DIR "/glustershd"
-#define GLUSTERD_NFS_RUN_DIR "/nfs"
-#define GLUSTERD_QUOTAD_RUN_DIR "/quotad"
-#define GLUSTER_SHARED_STORAGE_BRICK_DIR GLUSTERD_DEFAULT_WORKDIR"/ss_brick"
-#define GLUSTERD_VAR_RUN_DIR "/var/run"
-#define GLUSTERD_RUN_DIR "/run"
+#define GLUSTERD_DEFAULT_SNAPS_BRICK_DIR "/gluster/snaps"
+#define GLUSTERD_BITD_RUN_DIR "/bitd"
+#define GLUSTERD_SCRUB_RUN_DIR "/scrub"
+#define GLUSTERD_GLUSTERSHD_RUN_DIR "/glustershd"
+#define GLUSTERD_NFS_RUN_DIR "/nfs"
+#define GLUSTERD_QUOTAD_RUN_DIR "/quotad"
+#define GLUSTER_SHARED_STORAGE_BRICK_DIR GLUSTERD_DEFAULT_WORKDIR "/ss_brick"
+#define GLUSTERD_VAR_RUN_DIR "/var/run"
+#define GLUSTERD_RUN_DIR "/run"
/* definitions related to replace brick */
-#define RB_CLIENT_MOUNTPOINT "rb_mount"
-#define RB_CLIENTVOL_FILENAME "rb_client.vol"
-#define RB_DSTBRICK_PIDFILE "rb_dst_brick.pid"
+#define RB_CLIENT_MOUNTPOINT "rb_mount"
+#define RB_CLIENTVOL_FILENAME "rb_client.vol"
+#define RB_DSTBRICK_PIDFILE "rb_dst_brick.pid"
#define RB_DSTBRICKVOL_FILENAME "rb_dst_brick.vol"
-#define RB_PUMP_DEF_ARG "default"
+#define RB_PUMP_DEF_ARG "default"
#define GLUSTERD_UUID_LEN 50
-typedef ssize_t (*gd_serialize_t) (struct iovec outmsg, void *args);
-
-#define GLUSTERD_GET_VOLUME_DIR(path, volinfo, priv) \
- do { \
- int32_t _vol_dir_len; \
- if (volinfo->is_snap_volume) { \
- _vol_dir_len = snprintf (path, PATH_MAX, "%s/snaps/%s/%s", \
- priv->workdir, \
- volinfo->snapshot->snapname, \
- volinfo->volname); \
- } else { \
- _vol_dir_len = snprintf (path, PATH_MAX, "%s/vols/%s",\
- priv->workdir, volinfo->volname); \
- } \
- if ((_vol_dir_len < 0) || (_vol_dir_len >= PATH_MAX)) { \
- path[0] = 0; \
- } \
- } while (0)
-
-#define GLUSTERD_GET_TIER_DIR(path, volinfo, priv) do { \
- int32_t _tier_dir_len; \
- _tier_dir_len = snprintf (path, PATH_MAX, "%s/tier/%s", \
- priv->workdir, volinfo->volname); \
- if ((_tier_dir_len < 0) || (_tier_dir_len >= PATH_MAX)) { \
- path[0] = 0; \
- } \
- } while (0)
-
-#define GLUSTERD_GET_TIER_PID_FILE(path, volinfo, priv) do { \
- char tier_path[PATH_MAX]; \
- int32_t _tier_pid_len; \
- GLUSTERD_GET_TIER_DIR(tier_path, volinfo, priv); \
- _tier_pid_len = snprintf (path, PATH_MAX, "%s/run/%s-tierd.pid", \
- tier_path, volinfo->volname); \
- if ((_tier_pid_len < 0) || (_tier_pid_len >= PATH_MAX)) { \
- path[0] = 0; \
- } \
- } while (0)
-
-#define GLUSTERD_GET_VOLUME_PID_DIR(path, volinfo, priv) \
-do { \
- int32_t _vol_pid_len; \
- if (volinfo->is_snap_volume) { \
- _vol_pid_len = snprintf (path, PATH_MAX, "%s/snaps/%s/%s", \
- priv->rundir, \
- volinfo->snapshot->snapname, \
- volinfo->volname); \
- } else { \
- _vol_pid_len = snprintf (path, PATH_MAX, "%s/vols/%s", \
- priv->rundir, \
- volinfo->volname); \
- } \
- if ((_vol_pid_len < 0) || (_vol_pid_len >= PATH_MAX)) { \
- path[0] = 0; \
- } \
-} while (0)
-
-#define GLUSTERD_GET_SNAP_DIR(path, snap, priv) \
- do { \
- int32_t _snap_dir_len; \
- _snap_dir_len = snprintf (path, PATH_MAX, "%s/snaps/%s", priv->workdir, \
- snap->snapname); \
- if ((_snap_dir_len < 0) || (_snap_dir_len >= PATH_MAX)) { \
- path[0] = 0; \
- } \
- } while (0)
-
-#define GLUSTERD_GET_SNAP_GEO_REP_DIR(path, snap, priv) \
- do { \
- int32_t _snap_geo_len; \
- _snap_geo_len = snprintf (path, PATH_MAX, "%s/snaps/%s/%s", \
- priv->workdir, snap->snapname, GEOREP); \
- if ((_snap_geo_len < 0) || (_snap_geo_len >= PATH_MAX)) { \
- path[0] = 0; \
- } \
- } while (0)
-
-#define GLUSTERD_GET_BRICK_DIR(path, volinfo, priv) \
- do { \
- int32_t _brick_len; \
- if (volinfo->is_snap_volume) { \
- _brick_len = snprintf (path, PATH_MAX, "%s/snaps/%s/%s/%s", \
- priv->workdir, \
- volinfo->snapshot->snapname, \
- volinfo->volname, \
- GLUSTERD_BRICK_INFO_DIR); \
- } else { \
- _brick_len = snprintf (path, PATH_MAX, "%s/%s/%s/%s", \
- priv->workdir, \
- GLUSTERD_VOLUME_DIR_PREFIX, \
- volinfo->volname, \
- GLUSTERD_BRICK_INFO_DIR); \
- } \
- if ((_brick_len < 0) || (_brick_len >= PATH_MAX)) { \
- path[0] = 0; \
- } \
- } while (0)
-
-#define GLUSTERD_GET_NFS_DIR(path, priv) \
- do { \
- int32_t _nfs_dir_len; \
- _nfs_dir_len = snprintf (path, PATH_MAX, "%s/nfs", priv->workdir); \
- if ((_nfs_dir_len < 0) || (_nfs_dir_len >= PATH_MAX)) { \
- path[0] = 0; \
- } \
- } while (0)
-
-#define GLUSTERD_GET_QUOTAD_DIR(path, priv) \
- do { \
- int32_t _quotad_dir_len; \
- _quotad_dir_len = snprintf (path, PATH_MAX, "%s/quotad", priv->workdir); \
- if ((_quotad_dir_len < 0) || (_quotad_dir_len >= PATH_MAX)) { \
- path[0] = 0; \
- } \
- } while (0)
-
-#define GLUSTERD_GET_QUOTA_LIMIT_MOUNT_PATH(abspath, volname, path) do { \
- snprintf (abspath, sizeof (abspath)-1, \
- DEFAULT_VAR_RUN_DIRECTORY"/%s_quota_limit%s", volname, path);\
- } while (0)
-
-#define GLUSTERD_GET_QUOTA_LIST_MOUNT_PATH(abspath, volname, path) do { \
- snprintf (abspath, sizeof (abspath)-1, \
- DEFAULT_VAR_RUN_DIRECTORY"/%s_quota_list%s", volname, path);\
- } while (0)
-
-#define GLUSTERD_GET_TMP_PATH(abspath, path) do { \
- snprintf (abspath, sizeof (abspath)-1, \
- DEFAULT_VAR_RUN_DIRECTORY"/tmp%s", path); \
- } while (0)
-
-#define GLUSTERD_REMOVE_SLASH_FROM_PATH(path,string) do { \
- int i = 0; \
- for (i = 1; i < strlen (path); i++) { \
- string[i-1] = path[i]; \
- if (string[i-1] == '/' && (i != strlen(path) - 1)) \
- string[i-1] = '-'; \
- } \
- } while (0)
-
-#define GLUSTERD_GET_BRICK_PIDFILE(pidfile,volinfo,brickinfo, priv) do { \
- char exp_path[PATH_MAX] = {0,}; \
- char volpath[PATH_MAX] = {0,}; \
- int32_t _brick_pid_len = 0; \
- GLUSTERD_GET_VOLUME_PID_DIR (volpath, volinfo, priv); \
- GLUSTERD_REMOVE_SLASH_FROM_PATH (brickinfo->path, exp_path); \
- _brick_pid_len = snprintf (pidfile, PATH_MAX, "%s/%s-%s.pid", \
- volpath, brickinfo->hostname, exp_path); \
- if ((_brick_pid_len < 0) || (_brick_pid_len >= PATH_MAX)) { \
- pidfile[0] = 0; \
- } \
- } while (0)
-
-#define GLUSTERD_GET_NFS_PIDFILE(pidfile, nfspath, priv) do { \
- int32_t _nfs_pid_len; \
- _nfs_pid_len = snprintf (pidfile, PATH_MAX, "%s/nfs/nfs.pid", \
- priv->rundir); \
- if ((_nfs_pid_len < 0) || (_nfs_pid_len >= PATH_MAX)) { \
- pidfile[0] = 0; \
- } \
- } while (0)
-
-#define GLUSTERD_GET_QUOTAD_PIDFILE(pidfile, quotadpath, priv) do { \
- int32_t _quotad_pid_len; \
- _quotad_pid_len = snprintf (pidfile, PATH_MAX, "%s/quotad/quotad.pid", \
- priv->rundir); \
- if ((_quotad_pid_len < 0) || (_quotad_pid_len >= PATH_MAX)) { \
- pidfile[0] = 0; \
- } \
- } while (0)
-
-#define GLUSTERD_GET_QUOTA_CRAWL_PIDDIR(piddir, volinfo, type) do { \
- char _volpath[PATH_MAX] = {0,}; \
- int32_t _crawl_pid_len; \
- GLUSTERD_GET_VOLUME_DIR (_volpath, volinfo, priv); \
- if (type == GF_QUOTA_OPTION_TYPE_ENABLE || \
- type == GF_QUOTA_OPTION_TYPE_ENABLE_OBJECTS) \
- _crawl_pid_len = snprintf (piddir, PATH_MAX, \
- "%s/run/quota/enable", _volpath); \
- else \
- _crawl_pid_len = snprintf (piddir, PATH_MAX, \
- "%s/run/quota/disable", _volpath); \
- if ((_crawl_pid_len < 0) || (_crawl_pid_len >= PATH_MAX)) { \
- piddir[0] = 0; \
- } \
- } while (0)
-
-#define GLUSTERD_STACK_DESTROY(frame) do {\
- frame->local = NULL; \
- STACK_DESTROY (frame->root); \
- } while (0)
-
-#define GLUSTERD_GET_DEFRAG_PROCESS(path, volinfo) do { \
- if (volinfo->rebal.defrag_cmd == GF_DEFRAG_CMD_START_TIER) \
- snprintf (path, NAME_MAX, "tier"); \
- else \
- snprintf (path, NAME_MAX, "rebalance"); \
- } while (0)
-
-#define GLUSTERD_GET_DEFRAG_DIR(path, volinfo, priv) do { \
- char vol_path[PATH_MAX]; \
- char operation[NAME_MAX]; \
- int32_t _defrag_dir_len; \
- GLUSTERD_GET_VOLUME_DIR(vol_path, volinfo, priv); \
- GLUSTERD_GET_DEFRAG_PROCESS(operation, volinfo); \
- _defrag_dir_len = snprintf (path, PATH_MAX, "%s/%s", vol_path,\
- operation); \
- if ((_defrag_dir_len < 0) || (_defrag_dir_len >= PATH_MAX)) { \
- path[0] = 0; \
- } \
- } while (0)
-
-#define GLUSTERD_GET_DEFRAG_SOCK_FILE_OLD(path, volinfo, priv) do { \
- char defrag_path[PATH_MAX]; \
- int32_t _sockfile_old_len; \
- GLUSTERD_GET_DEFRAG_DIR(defrag_path, volinfo, priv); \
- _sockfile_old_len = snprintf (path, PATH_MAX, "%s/%s.sock", \
- defrag_path, uuid_utoa(MY_UUID)); \
- if ((_sockfile_old_len < 0) || (_sockfile_old_len >= PATH_MAX)) { \
- path[0] = 0; \
- } \
- } while (0)
-
-#define GLUSTERD_GET_DEFRAG_SOCK_FILE(path, volinfo) do { \
- char operation[NAME_MAX]; \
- int32_t _defrag_sockfile_len; \
- GLUSTERD_GET_DEFRAG_PROCESS(operation, volinfo); \
- _defrag_sockfile_len = snprintf (path, UNIX_PATH_MAX, \
- DEFAULT_VAR_RUN_DIRECTORY \
- "/gluster-%s-%s.sock", operation, \
- uuid_utoa(volinfo->volume_id)); \
- if ((_defrag_sockfile_len < 0) || (_defrag_sockfile_len >= PATH_MAX)) { \
- path[0] = 0; \
- } \
- } while (0)
-
-#define GLUSTERD_GET_DEFRAG_PID_FILE(path, volinfo, priv) do { \
- char defrag_path[PATH_MAX]; \
- int32_t _defrag_pidfile_len; \
- GLUSTERD_GET_DEFRAG_DIR(defrag_path, volinfo, priv); \
- _defrag_pidfile_len = snprintf (path, PATH_MAX, "%s/%s.pid", \
- defrag_path, uuid_utoa(MY_UUID)); \
- if ((_defrag_pidfile_len < 0) || (_defrag_pidfile_len >= PATH_MAX)) { \
- path[0] = 0; \
- } \
- } while (0)
-
-#define GLUSTERFS_GET_QUOTA_LIMIT_MOUNT_PIDFILE(pidfile, volname) { \
- snprintf (pidfile, PATH_MAX-1, \
- DEFAULT_VAR_RUN_DIRECTORY"/%s_quota_limit.pid", \
- volname); \
- }
-
-#define GLUSTERFS_GET_QUOTA_LIST_MOUNT_PIDFILE(pidfile, volname) { \
- snprintf (pidfile, PATH_MAX-1, \
- DEFAULT_VAR_RUN_DIRECTORY"/%s_quota_list.pid", \
- volname); \
- }
-
-
-#define GLUSTERD_GET_UUID_NOHYPHEN(ret_string, uuid) do { \
- char *snap_volname_ptr = ret_string; \
- char tmp_uuid[64]; \
- char *snap_volid_ptr = uuid_utoa_r(uuid, tmp_uuid); \
- while (*snap_volid_ptr) { \
- if (*snap_volid_ptr == '-') { \
- snap_volid_ptr++; \
- } else { \
- (*snap_volname_ptr++) = \
- (*snap_volid_ptr++); \
- } \
- } \
- *snap_volname_ptr = '\0'; \
- } while (0)
-
-#define GLUSTERD_DUMP_PEERS(head, member, xpeers) do { \
- glusterd_peerinfo_t *_peerinfo = NULL; \
- int index = 1; \
- char *key = NULL; \
- \
- key = xpeers ? "glusterd.xaction_peer" : "glusterd.peer"; \
- \
- rcu_read_lock (); \
- cds_list_for_each_entry_rcu (_peerinfo, head, member) { \
- glusterd_dump_peer (_peerinfo, key, index, xpeers); \
- if (!xpeers) \
- glusterd_dump_peer_rpcstat (_peerinfo, key, \
- index); \
- index++; \
- } \
- rcu_read_unlock (); \
- \
- } while (0)
-
-int glusterd_uuid_init();
-
-int glusterd_uuid_generate_save ();
+typedef ssize_t (*gd_serialize_t)(struct iovec outmsg, void *args);
+
+#define GLUSTERD_GET_VOLUME_DIR(path, volinfo, priv) \
+ do { \
+ int32_t _vol_dir_len; \
+ if (volinfo->is_snap_volume) { \
+ _vol_dir_len = snprintf( \
+ path, PATH_MAX, "%s/snaps/%s/%s", priv->workdir, \
+ volinfo->snapshot->snapname, volinfo->volname); \
+ } else { \
+ _vol_dir_len = snprintf(path, PATH_MAX, "%s/vols/%s", \
+ priv->workdir, volinfo->volname); \
+ } \
+ if ((_vol_dir_len < 0) || (_vol_dir_len >= PATH_MAX)) { \
+ path[0] = 0; \
+ } \
+ } while (0)
+
+#define GLUSTERD_GET_TIER_DIR(path, volinfo, priv) \
+ do { \
+ int32_t _tier_dir_len; \
+ _tier_dir_len = snprintf(path, PATH_MAX, "%s/tier/%s", priv->workdir, \
+ volinfo->volname); \
+ if ((_tier_dir_len < 0) || (_tier_dir_len >= PATH_MAX)) { \
+ path[0] = 0; \
+ } \
+ } while (0)
+
+#define GLUSTERD_GET_TIER_PID_FILE(path, volinfo, priv) \
+ do { \
+ char tier_path[PATH_MAX]; \
+ int32_t _tier_pid_len; \
+ GLUSTERD_GET_TIER_DIR(tier_path, volinfo, priv); \
+ _tier_pid_len = snprintf(path, PATH_MAX, "%s/run/%s-tierd.pid", \
+ tier_path, volinfo->volname); \
+ if ((_tier_pid_len < 0) || (_tier_pid_len >= PATH_MAX)) { \
+ path[0] = 0; \
+ } \
+ } while (0)
+
+#define GLUSTERD_GET_VOLUME_PID_DIR(path, volinfo, priv) \
+ do { \
+ int32_t _vol_pid_len; \
+ if (volinfo->is_snap_volume) { \
+ _vol_pid_len = snprintf(path, PATH_MAX, "%s/snaps/%s/%s", \
+ priv->rundir, volinfo->snapshot->snapname, \
+ volinfo->volname); \
+ } else { \
+ _vol_pid_len = snprintf(path, PATH_MAX, "%s/vols/%s", \
+ priv->rundir, volinfo->volname); \
+ } \
+ if ((_vol_pid_len < 0) || (_vol_pid_len >= PATH_MAX)) { \
+ path[0] = 0; \
+ } \
+ } while (0)
+
+#define GLUSTERD_GET_SNAP_DIR(path, snap, priv) \
+ do { \
+ int32_t _snap_dir_len; \
+ _snap_dir_len = snprintf(path, PATH_MAX, "%s/snaps/%s", priv->workdir, \
+ snap->snapname); \
+ if ((_snap_dir_len < 0) || (_snap_dir_len >= PATH_MAX)) { \
+ path[0] = 0; \
+ } \
+ } while (0)
+
+#define GLUSTERD_GET_SNAP_GEO_REP_DIR(path, snap, priv) \
+ do { \
+ int32_t _snap_geo_len; \
+ _snap_geo_len = snprintf(path, PATH_MAX, "%s/snaps/%s/%s", \
+ priv->workdir, snap->snapname, GEOREP); \
+ if ((_snap_geo_len < 0) || (_snap_geo_len >= PATH_MAX)) { \
+ path[0] = 0; \
+ } \
+ } while (0)
+
+#define GLUSTERD_GET_BRICK_DIR(path, volinfo, priv) \
+ do { \
+ int32_t _brick_len; \
+ if (volinfo->is_snap_volume) { \
+ _brick_len = snprintf(path, PATH_MAX, "%s/snaps/%s/%s/%s", \
+ priv->workdir, volinfo->snapshot->snapname, \
+ volinfo->volname, GLUSTERD_BRICK_INFO_DIR); \
+ } else { \
+ _brick_len = snprintf(path, PATH_MAX, "%s/%s/%s/%s", \
+ priv->workdir, GLUSTERD_VOLUME_DIR_PREFIX, \
+ volinfo->volname, GLUSTERD_BRICK_INFO_DIR); \
+ } \
+ if ((_brick_len < 0) || (_brick_len >= PATH_MAX)) { \
+ path[0] = 0; \
+ } \
+ } while (0)
+
+#define GLUSTERD_GET_NFS_DIR(path, priv) \
+ do { \
+ int32_t _nfs_dir_len; \
+ _nfs_dir_len = snprintf(path, PATH_MAX, "%s/nfs", priv->workdir); \
+ if ((_nfs_dir_len < 0) || (_nfs_dir_len >= PATH_MAX)) { \
+ path[0] = 0; \
+ } \
+ } while (0)
+
+#define GLUSTERD_GET_QUOTAD_DIR(path, priv) \
+ do { \
+ int32_t _quotad_dir_len; \
+ _quotad_dir_len = snprintf(path, PATH_MAX, "%s/quotad", \
+ priv->workdir); \
+ if ((_quotad_dir_len < 0) || (_quotad_dir_len >= PATH_MAX)) { \
+ path[0] = 0; \
+ } \
+ } while (0)
+
+#define GLUSTERD_GET_QUOTA_LIMIT_MOUNT_PATH(abspath, volname, path) \
+ do { \
+ snprintf(abspath, sizeof(abspath) - 1, \
+ DEFAULT_VAR_RUN_DIRECTORY "/%s_quota_limit%s", volname, \
+ path); \
+ } while (0)
+
+#define GLUSTERD_GET_QUOTA_LIST_MOUNT_PATH(abspath, volname, path) \
+ do { \
+ snprintf(abspath, sizeof(abspath) - 1, \
+ DEFAULT_VAR_RUN_DIRECTORY "/%s_quota_list%s", volname, path); \
+ } while (0)
+
+#define GLUSTERD_GET_TMP_PATH(abspath, path) \
+ do { \
+ snprintf(abspath, sizeof(abspath) - 1, \
+ DEFAULT_VAR_RUN_DIRECTORY "/tmp%s", path); \
+ } while (0)
+
+#define GLUSTERD_REMOVE_SLASH_FROM_PATH(path, string) \
+ do { \
+ int i = 0; \
+ for (i = 1; i < strlen(path); i++) { \
+ string[i - 1] = path[i]; \
+ if (string[i - 1] == '/' && (i != strlen(path) - 1)) \
+ string[i - 1] = '-'; \
+ } \
+ } while (0)
+
+#define GLUSTERD_GET_BRICK_PIDFILE(pidfile, volinfo, brickinfo, priv) \
+ do { \
+ char exp_path[PATH_MAX] = { \
+ 0, \
+ }; \
+ char volpath[PATH_MAX] = { \
+ 0, \
+ }; \
+ int32_t _brick_pid_len = 0; \
+ GLUSTERD_GET_VOLUME_PID_DIR(volpath, volinfo, priv); \
+ GLUSTERD_REMOVE_SLASH_FROM_PATH(brickinfo->path, exp_path); \
+ _brick_pid_len = snprintf(pidfile, PATH_MAX, "%s/%s-%s.pid", volpath, \
+ brickinfo->hostname, exp_path); \
+ if ((_brick_pid_len < 0) || (_brick_pid_len >= PATH_MAX)) { \
+ pidfile[0] = 0; \
+ } \
+ } while (0)
+
+#define GLUSTERD_GET_NFS_PIDFILE(pidfile, nfspath, priv) \
+ do { \
+ int32_t _nfs_pid_len; \
+ _nfs_pid_len = snprintf(pidfile, PATH_MAX, "%s/nfs/nfs.pid", \
+ priv->rundir); \
+ if ((_nfs_pid_len < 0) || (_nfs_pid_len >= PATH_MAX)) { \
+ pidfile[0] = 0; \
+ } \
+ } while (0)
+
+#define GLUSTERD_GET_QUOTAD_PIDFILE(pidfile, quotadpath, priv) \
+ do { \
+ int32_t _quotad_pid_len; \
+ _quotad_pid_len = snprintf(pidfile, PATH_MAX, "%s/quotad/quotad.pid", \
+ priv->rundir); \
+ if ((_quotad_pid_len < 0) || (_quotad_pid_len >= PATH_MAX)) { \
+ pidfile[0] = 0; \
+ } \
+ } while (0)
+
+#define GLUSTERD_GET_QUOTA_CRAWL_PIDDIR(piddir, volinfo, type) \
+ do { \
+ char _volpath[PATH_MAX] = { \
+ 0, \
+ }; \
+ int32_t _crawl_pid_len; \
+ GLUSTERD_GET_VOLUME_DIR(_volpath, volinfo, priv); \
+ if (type == GF_QUOTA_OPTION_TYPE_ENABLE || \
+ type == GF_QUOTA_OPTION_TYPE_ENABLE_OBJECTS) \
+ _crawl_pid_len = snprintf(piddir, PATH_MAX, "%s/run/quota/enable", \
+ _volpath); \
+ else \
+ _crawl_pid_len = snprintf(piddir, PATH_MAX, \
+ "%s/run/quota/disable", _volpath); \
+ if ((_crawl_pid_len < 0) || (_crawl_pid_len >= PATH_MAX)) { \
+ piddir[0] = 0; \
+ } \
+ } while (0)
+
+#define GLUSTERD_STACK_DESTROY(frame) \
+ do { \
+ frame->local = NULL; \
+ STACK_DESTROY(frame->root); \
+ } while (0)
+
+#define GLUSTERD_GET_DEFRAG_PROCESS(path, volinfo) \
+ do { \
+ if (volinfo->rebal.defrag_cmd == GF_DEFRAG_CMD_START_TIER) \
+ snprintf(path, NAME_MAX, "tier"); \
+ else \
+ snprintf(path, NAME_MAX, "rebalance"); \
+ } while (0)
+
+#define GLUSTERD_GET_DEFRAG_DIR(path, volinfo, priv) \
+ do { \
+ char vol_path[PATH_MAX]; \
+ char operation[NAME_MAX]; \
+ int32_t _defrag_dir_len; \
+ GLUSTERD_GET_VOLUME_DIR(vol_path, volinfo, priv); \
+ GLUSTERD_GET_DEFRAG_PROCESS(operation, volinfo); \
+ _defrag_dir_len = snprintf(path, PATH_MAX, "%s/%s", vol_path, \
+ operation); \
+ if ((_defrag_dir_len < 0) || (_defrag_dir_len >= PATH_MAX)) { \
+ path[0] = 0; \
+ } \
+ } while (0)
+
+#define GLUSTERD_GET_DEFRAG_SOCK_FILE_OLD(path, volinfo, priv) \
+ do { \
+ char defrag_path[PATH_MAX]; \
+ int32_t _sockfile_old_len; \
+ GLUSTERD_GET_DEFRAG_DIR(defrag_path, volinfo, priv); \
+ _sockfile_old_len = snprintf(path, PATH_MAX, "%s/%s.sock", \
+ defrag_path, uuid_utoa(MY_UUID)); \
+ if ((_sockfile_old_len < 0) || (_sockfile_old_len >= PATH_MAX)) { \
+ path[0] = 0; \
+ } \
+ } while (0)
+
+#define GLUSTERD_GET_DEFRAG_SOCK_FILE(path, volinfo) \
+ do { \
+ char operation[NAME_MAX]; \
+ int32_t _defrag_sockfile_len; \
+ GLUSTERD_GET_DEFRAG_PROCESS(operation, volinfo); \
+ _defrag_sockfile_len = snprintf( \
+ path, UNIX_PATH_MAX, \
+ DEFAULT_VAR_RUN_DIRECTORY "/gluster-%s-%s.sock", operation, \
+ uuid_utoa(volinfo->volume_id)); \
+ if ((_defrag_sockfile_len < 0) || \
+ (_defrag_sockfile_len >= PATH_MAX)) { \
+ path[0] = 0; \
+ } \
+ } while (0)
+
+#define GLUSTERD_GET_DEFRAG_PID_FILE(path, volinfo, priv) \
+ do { \
+ char defrag_path[PATH_MAX]; \
+ int32_t _defrag_pidfile_len; \
+ GLUSTERD_GET_DEFRAG_DIR(defrag_path, volinfo, priv); \
+ _defrag_pidfile_len = snprintf(path, PATH_MAX, "%s/%s.pid", \
+ defrag_path, uuid_utoa(MY_UUID)); \
+ if ((_defrag_pidfile_len < 0) || (_defrag_pidfile_len >= PATH_MAX)) { \
+ path[0] = 0; \
+ } \
+ } while (0)
+
+#define GLUSTERFS_GET_QUOTA_LIMIT_MOUNT_PIDFILE(pidfile, volname) \
+ { \
+ snprintf(pidfile, PATH_MAX - 1, \
+ DEFAULT_VAR_RUN_DIRECTORY "/%s_quota_limit.pid", volname); \
+ }
+
+#define GLUSTERFS_GET_QUOTA_LIST_MOUNT_PIDFILE(pidfile, volname) \
+ { \
+ snprintf(pidfile, PATH_MAX - 1, \
+ DEFAULT_VAR_RUN_DIRECTORY "/%s_quota_list.pid", volname); \
+ }
+
+#define GLUSTERD_GET_UUID_NOHYPHEN(ret_string, uuid) \
+ do { \
+ char *snap_volname_ptr = ret_string; \
+ char tmp_uuid[64]; \
+ char *snap_volid_ptr = uuid_utoa_r(uuid, tmp_uuid); \
+ while (*snap_volid_ptr) { \
+ if (*snap_volid_ptr == '-') { \
+ snap_volid_ptr++; \
+ } else { \
+ (*snap_volname_ptr++) = (*snap_volid_ptr++); \
+ } \
+ } \
+ *snap_volname_ptr = '\0'; \
+ } while (0)
+
+#define GLUSTERD_DUMP_PEERS(head, member, xpeers) \
+ do { \
+ glusterd_peerinfo_t *_peerinfo = NULL; \
+ int index = 1; \
+ char *key = NULL; \
+ \
+ key = xpeers ? "glusterd.xaction_peer" : "glusterd.peer"; \
+ \
+ rcu_read_lock(); \
+ cds_list_for_each_entry_rcu(_peerinfo, head, member) \
+ { \
+ glusterd_dump_peer(_peerinfo, key, index, xpeers); \
+ if (!xpeers) \
+ glusterd_dump_peer_rpcstat(_peerinfo, key, index); \
+ index++; \
+ } \
+ rcu_read_unlock(); \
+ \
+ } while (0)
+
+int
+glusterd_uuid_init();
+
+int
+glusterd_uuid_generate_save();
#define MY_UUID (__glusterd_uuid())
static inline unsigned char *
__glusterd_uuid()
{
- glusterd_conf_t *priv = THIS->private;
+ glusterd_conf_t *priv = THIS->private;
- if (gf_uuid_is_null (priv->uuid))
- glusterd_uuid_init();
- return &priv->uuid[0];
+ if (gf_uuid_is_null(priv->uuid))
+ glusterd_uuid_init();
+ return &priv->uuid[0];
}
-int glusterd_big_locked_notify (struct rpc_clnt *rpc, void *mydata,
- rpc_clnt_event_t event,
- void *data, rpc_clnt_notify_t notify_fn);
+int
+glusterd_big_locked_notify(struct rpc_clnt *rpc, void *mydata,
+ rpc_clnt_event_t event, void *data,
+ rpc_clnt_notify_t notify_fn);
int
-glusterd_big_locked_cbk (struct rpc_req *req, struct iovec *iov,
- int count, void *myframe, fop_cbk_fn_t fn);
+glusterd_big_locked_cbk(struct rpc_req *req, struct iovec *iov, int count,
+ void *myframe, fop_cbk_fn_t fn);
-int glusterd_big_locked_handler (rpcsvc_request_t *req, rpcsvc_actor actor_fn);
+int
+glusterd_big_locked_handler(rpcsvc_request_t *req, rpcsvc_actor actor_fn);
int32_t
-glusterd_brick_from_brickinfo (glusterd_brickinfo_t *brickinfo,
- char **new_brick);
+glusterd_brick_from_brickinfo(glusterd_brickinfo_t *brickinfo,
+ char **new_brick);
int
-glusterd_probe_begin (rpcsvc_request_t *req, const char *hoststr, int port,
- dict_t *dict, int *op_errno);
+glusterd_probe_begin(rpcsvc_request_t *req, const char *hoststr, int port,
+ dict_t *dict, int *op_errno);
int
-glusterd_xfer_friend_add_resp (rpcsvc_request_t *req, char *myhostname,
- char *remote_hostname, int port, int32_t op_ret,
- int32_t op_errno);
+glusterd_xfer_friend_add_resp(rpcsvc_request_t *req, char *myhostname,
+ char *remote_hostname, int port, int32_t op_ret,
+ int32_t op_errno);
int
-glusterd_friend_add (const char *hoststr, int port,
- glusterd_friend_sm_state_t state,
- uuid_t *uuid, glusterd_peerinfo_t **friend,
- gf_boolean_t restore, glusterd_peerctx_args_t *args);
+glusterd_friend_add(const char *hoststr, int port,
+ glusterd_friend_sm_state_t state, uuid_t *uuid,
+ glusterd_peerinfo_t **friend, gf_boolean_t restore,
+ glusterd_peerctx_args_t *args);
int
-glusterd_friend_add_from_peerinfo (glusterd_peerinfo_t *friend,
- gf_boolean_t restore,
- glusterd_peerctx_args_t *args);
+glusterd_friend_add_from_peerinfo(glusterd_peerinfo_t *friend,
+ gf_boolean_t restore,
+ glusterd_peerctx_args_t *args);
int
-glusterd_friend_rpc_create (xlator_t *this, glusterd_peerinfo_t *peerinfo,
- glusterd_peerctx_args_t *args);
+glusterd_friend_rpc_create(xlator_t *this, glusterd_peerinfo_t *peerinfo,
+ glusterd_peerctx_args_t *args);
int
-glusterd_friend_remove (uuid_t uuid, char *hostname);
+glusterd_friend_remove(uuid_t uuid, char *hostname);
int
-glusterd_op_lock_send_resp (rpcsvc_request_t *req, int32_t status);
+glusterd_op_lock_send_resp(rpcsvc_request_t *req, int32_t status);
int
-glusterd_op_unlock_send_resp (rpcsvc_request_t *req, int32_t status);
+glusterd_op_unlock_send_resp(rpcsvc_request_t *req, int32_t status);
int
-glusterd_op_mgmt_v3_lock_send_resp (rpcsvc_request_t *req,
- uuid_t *txn_id, int32_t status);
+glusterd_op_mgmt_v3_lock_send_resp(rpcsvc_request_t *req, uuid_t *txn_id,
+ int32_t status);
int
-glusterd_op_mgmt_v3_unlock_send_resp (rpcsvc_request_t *req,
- uuid_t *txn_id, int32_t status);
+glusterd_op_mgmt_v3_unlock_send_resp(rpcsvc_request_t *req, uuid_t *txn_id,
+ int32_t status);
int
-glusterd_op_stage_send_resp (rpcsvc_request_t *req,
- int32_t op, int32_t status,
- char *op_errstr, dict_t *rsp_dict);
+glusterd_op_stage_send_resp(rpcsvc_request_t *req, int32_t op, int32_t status,
+ char *op_errstr, dict_t *rsp_dict);
int
-glusterd_op_commmit_send_resp (rpcsvc_request_t *req,
- int32_t op, int32_t status);
+glusterd_op_commmit_send_resp(rpcsvc_request_t *req, int32_t op,
+ int32_t status);
int32_t
-glusterd_create_volume (rpcsvc_request_t *req, dict_t *dict);
+glusterd_create_volume(rpcsvc_request_t *req, dict_t *dict);
int
-glusterd_handle_incoming_friend_req (rpcsvc_request_t *req);
+glusterd_handle_incoming_friend_req(rpcsvc_request_t *req);
int
-glusterd_handle_probe_query (rpcsvc_request_t *req);
+glusterd_handle_probe_query(rpcsvc_request_t *req);
int
-glusterd_handle_cluster_lock (rpcsvc_request_t *req);
+glusterd_handle_cluster_lock(rpcsvc_request_t *req);
int
-glusterd_handle_cluster_unlock (rpcsvc_request_t *req);
+glusterd_handle_cluster_unlock(rpcsvc_request_t *req);
int
-glusterd_handle_stage_op (rpcsvc_request_t *req);
+glusterd_handle_stage_op(rpcsvc_request_t *req);
int
-glusterd_handle_commit_op (rpcsvc_request_t *req);
+glusterd_handle_commit_op(rpcsvc_request_t *req);
int
-glusterd_handle_cli_probe (rpcsvc_request_t *req);
+glusterd_handle_cli_probe(rpcsvc_request_t *req);
int
-glusterd_handle_create_volume (rpcsvc_request_t *req);
+glusterd_handle_create_volume(rpcsvc_request_t *req);
int
-glusterd_handle_defrag_volume (rpcsvc_request_t *req);
+glusterd_handle_defrag_volume(rpcsvc_request_t *req);
int
-glusterd_handle_defrag_volume_v2 (rpcsvc_request_t *req);
+glusterd_handle_defrag_volume_v2(rpcsvc_request_t *req);
int
-glusterd_xfer_cli_probe_resp (rpcsvc_request_t *req, int32_t op_ret,
- int32_t op_errno, char *op_errstr, char *hostname,
- int port, dict_t *dict);
+glusterd_xfer_cli_probe_resp(rpcsvc_request_t *req, int32_t op_ret,
+ int32_t op_errno, char *op_errstr, char *hostname,
+ int port, dict_t *dict);
int
-glusterd_op_commit_send_resp (rpcsvc_request_t *req,
- int32_t op, int32_t status, char *op_errstr,
- dict_t *rsp_dict);
+glusterd_op_commit_send_resp(rpcsvc_request_t *req, int32_t op, int32_t status,
+ char *op_errstr, dict_t *rsp_dict);
int
-glusterd_xfer_friend_remove_resp (rpcsvc_request_t *req, char *hostname, int port);
+glusterd_xfer_friend_remove_resp(rpcsvc_request_t *req, char *hostname,
+ int port);
int
-glusterd_deprobe_begin (rpcsvc_request_t *req, const char *hoststr, int port,
- uuid_t uuid, dict_t *dict, int *op_errno);
+glusterd_deprobe_begin(rpcsvc_request_t *req, const char *hoststr, int port,
+ uuid_t uuid, dict_t *dict, int *op_errno);
int
-glusterd_handle_cli_deprobe (rpcsvc_request_t *req);
+glusterd_handle_cli_deprobe(rpcsvc_request_t *req);
int
-glusterd_handle_incoming_unfriend_req (rpcsvc_request_t *req);
+glusterd_handle_incoming_unfriend_req(rpcsvc_request_t *req);
int32_t
-glusterd_list_friends (rpcsvc_request_t *req, dict_t *dict, int32_t flags);
+glusterd_list_friends(rpcsvc_request_t *req, dict_t *dict, int32_t flags);
int
-glusterd_handle_cli_list_friends (rpcsvc_request_t *req);
+glusterd_handle_cli_list_friends(rpcsvc_request_t *req);
int
-glusterd_handle_cli_start_volume (rpcsvc_request_t *req);
+glusterd_handle_cli_start_volume(rpcsvc_request_t *req);
int
-glusterd_handle_friend_update (rpcsvc_request_t *req);
+glusterd_handle_friend_update(rpcsvc_request_t *req);
int
-glusterd_handle_cli_stop_volume (rpcsvc_request_t *req);
+glusterd_handle_cli_stop_volume(rpcsvc_request_t *req);
int
-glusterd_handle_cli_delete_volume (rpcsvc_request_t *req);
+glusterd_handle_cli_delete_volume(rpcsvc_request_t *req);
int
-glusterd_handle_cli_get_volume (rpcsvc_request_t *req);
+glusterd_handle_cli_get_volume(rpcsvc_request_t *req);
int32_t
-glusterd_get_volumes (rpcsvc_request_t *req, dict_t *dict, int32_t flags);
+glusterd_get_volumes(rpcsvc_request_t *req, dict_t *dict, int32_t flags);
int
-glusterd_handle_add_brick (rpcsvc_request_t *req);
+glusterd_handle_add_brick(rpcsvc_request_t *req);
int
-glusterd_handle_tier (rpcsvc_request_t *req);
+glusterd_handle_tier(rpcsvc_request_t *req);
int
-glusterd_handle_attach_tier (rpcsvc_request_t *req);
+glusterd_handle_attach_tier(rpcsvc_request_t *req);
int
-glusterd_handle_detach_tier (rpcsvc_request_t *req);
+glusterd_handle_detach_tier(rpcsvc_request_t *req);
int
-glusterd_handle_add_tier_brick (rpcsvc_request_t *req);
+glusterd_handle_add_tier_brick(rpcsvc_request_t *req);
int
-glusterd_handle_replace_brick (rpcsvc_request_t *req);
+glusterd_handle_replace_brick(rpcsvc_request_t *req);
int
-glusterd_handle_remove_brick (rpcsvc_request_t *req);
+glusterd_handle_remove_brick(rpcsvc_request_t *req);
int
-glusterd_handle_log_rotate (rpcsvc_request_t *req);
+glusterd_handle_log_rotate(rpcsvc_request_t *req);
int
-glusterd_handle_sync_volume (rpcsvc_request_t *req);
+glusterd_handle_sync_volume(rpcsvc_request_t *req);
int
-glusterd_defrag_start_validate (glusterd_volinfo_t *volinfo, char *op_errstr,
- size_t len, glusterd_op_t op);
+glusterd_defrag_start_validate(glusterd_volinfo_t *volinfo, char *op_errstr,
+ size_t len, glusterd_op_t op);
int
-glusterd_rebalance_cmd_validate (int cmd, char *volname,
- glusterd_volinfo_t **volinfo,
- char *op_errstr, size_t len);
+glusterd_rebalance_cmd_validate(int cmd, char *volname,
+ glusterd_volinfo_t **volinfo, char *op_errstr,
+ size_t len);
int32_t
-glusterd_log_filename (rpcsvc_request_t *req, dict_t *dict);
+glusterd_log_filename(rpcsvc_request_t *req, dict_t *dict);
int32_t
-glusterd_log_rotate (rpcsvc_request_t *req, dict_t *dict);
+glusterd_log_rotate(rpcsvc_request_t *req, dict_t *dict);
int32_t
-glusterd_remove_brick (rpcsvc_request_t *req, dict_t *dict);
+glusterd_remove_brick(rpcsvc_request_t *req, dict_t *dict);
int32_t
-glusterd_set_volume (rpcsvc_request_t *req, dict_t *dict);
+glusterd_set_volume(rpcsvc_request_t *req, dict_t *dict);
int32_t
-glusterd_reset_volume (rpcsvc_request_t *req, dict_t *dict);
+glusterd_reset_volume(rpcsvc_request_t *req, dict_t *dict);
int32_t
-glusterd_gsync_set (rpcsvc_request_t *req, dict_t *dict);
+glusterd_gsync_set(rpcsvc_request_t *req, dict_t *dict);
int32_t
-glusterd_quota (rpcsvc_request_t *req, dict_t *dict);
+glusterd_quota(rpcsvc_request_t *req, dict_t *dict);
int
-glusterd_handle_set_volume (rpcsvc_request_t *req);
+glusterd_handle_set_volume(rpcsvc_request_t *req);
int
-glusterd_handle_reset_volume (rpcsvc_request_t *req);
+glusterd_handle_reset_volume(rpcsvc_request_t *req);
int
-glusterd_handle_copy_file (rpcsvc_request_t *req);
+glusterd_handle_copy_file(rpcsvc_request_t *req);
int
-glusterd_handle_sys_exec (rpcsvc_request_t *req);
+glusterd_handle_sys_exec(rpcsvc_request_t *req);
int
-glusterd_handle_gsync_set (rpcsvc_request_t *req);
+glusterd_handle_gsync_set(rpcsvc_request_t *req);
int
-glusterd_handle_quota (rpcsvc_request_t *req);
+glusterd_handle_quota(rpcsvc_request_t *req);
int
-glusterd_handle_bitrot (rpcsvc_request_t *req);
+glusterd_handle_bitrot(rpcsvc_request_t *req);
int
-glusterd_handle_fsm_log (rpcsvc_request_t *req);
+glusterd_handle_fsm_log(rpcsvc_request_t *req);
int
-glusterd_handle_reset_brick (rpcsvc_request_t *req);
+glusterd_handle_reset_brick(rpcsvc_request_t *req);
int
-glusterd_xfer_cli_deprobe_resp (rpcsvc_request_t *req, int32_t op_ret,
- int32_t op_errno, char *op_errstr,
- char *hostname, dict_t *dict);
+glusterd_xfer_cli_deprobe_resp(rpcsvc_request_t *req, int32_t op_ret,
+ int32_t op_errno, char *op_errstr,
+ char *hostname, dict_t *dict);
int
-glusterd_client_statedump_submit_req (char *volname, char *target_ip,
- char *pid);
+glusterd_client_statedump_submit_req(char *volname, char *target_ip, char *pid);
int
-glusterd_fetchspec_notify (xlator_t *this);
+glusterd_fetchspec_notify(xlator_t *this);
int
-glusterd_fetchsnap_notify (xlator_t *this);
+glusterd_fetchsnap_notify(xlator_t *this);
int
-glusterd_add_tier_volume_detail_to_dict (glusterd_volinfo_t *volinfo,
- dict_t *volumes, int count);
+glusterd_add_tier_volume_detail_to_dict(glusterd_volinfo_t *volinfo,
+ dict_t *volumes, int count);
int
-glusterd_add_volume_detail_to_dict (glusterd_volinfo_t *volinfo,
- dict_t *volumes, int count);
+glusterd_add_volume_detail_to_dict(glusterd_volinfo_t *volinfo, dict_t *volumes,
+ int count);
int
-glusterd_restart_bricks ();
+glusterd_restart_bricks();
int32_t
-glusterd_volume_txn (rpcsvc_request_t *req, char *volname, int flags,
- glusterd_op_t op);
+glusterd_volume_txn(rpcsvc_request_t *req, char *volname, int flags,
+ glusterd_op_t op);
int
-glusterd_peer_dump_version (xlator_t *this, struct rpc_clnt *rpc,
- glusterd_peerctx_t *peerctx);
+glusterd_peer_dump_version(xlator_t *this, struct rpc_clnt *rpc,
+ glusterd_peerctx_t *peerctx);
int
-glusterd_validate_reconfopts (glusterd_volinfo_t *volinfo, dict_t *val_dict, char **op_errstr);
+glusterd_validate_reconfopts(glusterd_volinfo_t *volinfo, dict_t *val_dict,
+ char **op_errstr);
int
-glusterd_handle_cli_profile_volume (rpcsvc_request_t *req);
+glusterd_handle_cli_profile_volume(rpcsvc_request_t *req);
int
-glusterd_handle_getwd (rpcsvc_request_t *req);
+glusterd_handle_getwd(rpcsvc_request_t *req);
int32_t
-glusterd_set_volume (rpcsvc_request_t *req, dict_t *dict);
+glusterd_set_volume(rpcsvc_request_t *req, dict_t *dict);
int
-glusterd_peer_rpc_notify (struct rpc_clnt *rpc, void *mydata,
- rpc_clnt_event_t event,
- void *data);
+glusterd_peer_rpc_notify(struct rpc_clnt *rpc, void *mydata,
+ rpc_clnt_event_t event, void *data);
int
-glusterd_brick_rpc_notify (struct rpc_clnt *rpc, void *mydata,
+glusterd_brick_rpc_notify(struct rpc_clnt *rpc, void *mydata,
rpc_clnt_event_t event, void *data);
int
-glusterd_rpc_create (struct rpc_clnt **rpc, dict_t *options,
- rpc_clnt_notify_t notify_fn, void *notify_data,
- gf_boolean_t force);
-
+glusterd_rpc_create(struct rpc_clnt **rpc, dict_t *options,
+ rpc_clnt_notify_t notify_fn, void *notify_data,
+ gf_boolean_t force);
/* handler functions */
-int32_t glusterd_op_begin (rpcsvc_request_t *req, glusterd_op_t op, void *ctx,
- char *err_str, size_t size);
+int32_t
+glusterd_op_begin(rpcsvc_request_t *req, glusterd_op_t op, void *ctx,
+ char *err_str, size_t size);
/* removed other definitions as they have been defined elsewhere in this file*/
-int glusterd_handle_cli_statedump_volume (rpcsvc_request_t *req);
-int glusterd_handle_cli_clearlocks_volume (rpcsvc_request_t *req);
+int
+glusterd_handle_cli_statedump_volume(rpcsvc_request_t *req);
+int
+glusterd_handle_cli_clearlocks_volume(rpcsvc_request_t *req);
-int glusterd_handle_defrag_start (glusterd_volinfo_t *volinfo, char *op_errstr,
- size_t len, int cmd, defrag_cbk_fn_t cbk,
- glusterd_op_t op);
int
-glusterd_rebalance_rpc_create (glusterd_volinfo_t *volinfo);
+glusterd_handle_defrag_start(glusterd_volinfo_t *volinfo, char *op_errstr,
+ size_t len, int cmd, defrag_cbk_fn_t cbk,
+ glusterd_op_t op);
+int
+glusterd_rebalance_rpc_create(glusterd_volinfo_t *volinfo);
-int glusterd_rebalance_defrag_init (glusterd_volinfo_t *volinfo,
- defrag_cbk_fn_t cbk);
+int
+glusterd_rebalance_defrag_init(glusterd_volinfo_t *volinfo,
+ defrag_cbk_fn_t cbk);
-int glusterd_handle_cli_heal_volume (rpcsvc_request_t *req);
+int
+glusterd_handle_cli_heal_volume(rpcsvc_request_t *req);
-int glusterd_handle_cli_list_volume (rpcsvc_request_t *req);
+int
+glusterd_handle_cli_list_volume(rpcsvc_request_t *req);
int
-glusterd_handle_snapshot (rpcsvc_request_t *req);
+glusterd_handle_snapshot(rpcsvc_request_t *req);
/* op-sm functions */
-int glusterd_op_stage_heal_volume (dict_t *dict, char **op_errstr);
-int glusterd_op_heal_volume (dict_t *dict, char **op_errstr);
-int glusterd_op_stage_gsync_set (dict_t *dict, char **op_errstr);
-int glusterd_op_gsync_set (dict_t *dict, char **op_errstr, dict_t *rsp_dict);
-int glusterd_op_stage_copy_file (dict_t *dict, char **op_errstr);
-int glusterd_op_copy_file (dict_t *dict, char **op_errstr);
-int glusterd_op_stage_sys_exec (dict_t *dict, char **op_errstr);
-int glusterd_op_sys_exec (dict_t *dict, char **op_errstr, dict_t *rsp_dict);
-int glusterd_op_stage_gsync_create (dict_t *dict, char **op_errstr);
-int glusterd_op_gsync_create (dict_t *dict, char **op_errstr, dict_t *rsp_dict);
-int glusterd_op_quota (dict_t *dict, char **op_errstr, dict_t *rsp_dict);
-
-int glusterd_op_bitrot (dict_t *dict, char **op_errstr, dict_t *rsp_dict);
-
-int glusterd_op_stage_quota (dict_t *dict, char **op_errstr, dict_t *rsp_dict);
-
-int glusterd_op_stage_bitrot (dict_t *dict, char **op_errstr, dict_t *rsp_dict);
-
-int glusterd_op_stage_replace_brick (dict_t *dict, char **op_errstr,
- dict_t *rsp_dict);
-int glusterd_op_replace_brick (dict_t *dict, dict_t *rsp_dict);
-int glusterd_op_log_rotate (dict_t *dict);
-int glusterd_op_stage_log_rotate (dict_t *dict, char **op_errstr);
-int glusterd_op_stage_create_volume (dict_t *dict, char **op_errstr,
- dict_t *rsp_dict);
-int glusterd_op_stage_start_volume (dict_t *dict, char **op_errstr,
- dict_t *rsp_dict);
-int glusterd_op_stage_stop_volume (dict_t *dict, char **op_errstr);
-int glusterd_op_stage_delete_volume (dict_t *dict, char **op_errstr);
-int glusterd_op_create_volume (dict_t *dict, char **op_errstr);
-int glusterd_op_start_volume (dict_t *dict, char **op_errstr);
-int glusterd_op_stop_volume (dict_t *dict);
-int glusterd_op_delete_volume (dict_t *dict);
-int manage_export_config (char *volname, char *value, char **op_errstr);
-
-int glusterd_op_add_brick (dict_t *dict, char **op_errstr);
-int glusterd_op_add_tier_brick (dict_t *dict, char **op_errstr);
-int glusterd_op_remove_brick (dict_t *dict, char **op_errstr);
-int glusterd_op_stage_add_brick (dict_t *dict, char **op_errstr,
- dict_t *rsp_dict);
-int glusterd_op_stage_remove_brick (dict_t *dict, char **op_errstr);
-
-int glusterd_op_stage_rebalance (dict_t *dict, char **op_errstr);
-int glusterd_op_rebalance (dict_t *dict, char **op_errstr, dict_t *rsp_dict);
-
-int glusterd_op_stage_statedump_volume (dict_t *dict, char **op_errstr);
-int glusterd_op_statedump_volume (dict_t *dict, char **op_errstr);
-
-int glusterd_op_stage_clearlocks_volume (dict_t *dict, char **op_errstr);
-int glusterd_op_clearlocks_volume (dict_t *dict, char **op_errstr,
- dict_t *rsp_dict);
-
-
-int glusterd_op_stage_barrier (dict_t *dict, char **op_errstr);
-int glusterd_op_barrier (dict_t *dict, char **op_errstr);
+int
+glusterd_op_stage_heal_volume(dict_t *dict, char **op_errstr);
+int
+glusterd_op_heal_volume(dict_t *dict, char **op_errstr);
+int
+glusterd_op_stage_gsync_set(dict_t *dict, char **op_errstr);
+int
+glusterd_op_gsync_set(dict_t *dict, char **op_errstr, dict_t *rsp_dict);
+int
+glusterd_op_stage_copy_file(dict_t *dict, char **op_errstr);
+int
+glusterd_op_copy_file(dict_t *dict, char **op_errstr);
+int
+glusterd_op_stage_sys_exec(dict_t *dict, char **op_errstr);
+int
+glusterd_op_sys_exec(dict_t *dict, char **op_errstr, dict_t *rsp_dict);
+int
+glusterd_op_stage_gsync_create(dict_t *dict, char **op_errstr);
+int
+glusterd_op_gsync_create(dict_t *dict, char **op_errstr, dict_t *rsp_dict);
+int
+glusterd_op_quota(dict_t *dict, char **op_errstr, dict_t *rsp_dict);
+
+int
+glusterd_op_bitrot(dict_t *dict, char **op_errstr, dict_t *rsp_dict);
+
+int
+glusterd_op_stage_quota(dict_t *dict, char **op_errstr, dict_t *rsp_dict);
+
+int
+glusterd_op_stage_bitrot(dict_t *dict, char **op_errstr, dict_t *rsp_dict);
+
+int
+glusterd_op_stage_replace_brick(dict_t *dict, char **op_errstr,
+ dict_t *rsp_dict);
+int
+glusterd_op_replace_brick(dict_t *dict, dict_t *rsp_dict);
+int
+glusterd_op_log_rotate(dict_t *dict);
+int
+glusterd_op_stage_log_rotate(dict_t *dict, char **op_errstr);
+int
+glusterd_op_stage_create_volume(dict_t *dict, char **op_errstr,
+ dict_t *rsp_dict);
+int
+glusterd_op_stage_start_volume(dict_t *dict, char **op_errstr,
+ dict_t *rsp_dict);
+int
+glusterd_op_stage_stop_volume(dict_t *dict, char **op_errstr);
+int
+glusterd_op_stage_delete_volume(dict_t *dict, char **op_errstr);
+int
+glusterd_op_create_volume(dict_t *dict, char **op_errstr);
+int
+glusterd_op_start_volume(dict_t *dict, char **op_errstr);
+int
+glusterd_op_stop_volume(dict_t *dict);
+int
+glusterd_op_delete_volume(dict_t *dict);
+int
+manage_export_config(char *volname, char *value, char **op_errstr);
+
+int
+glusterd_op_add_brick(dict_t *dict, char **op_errstr);
+int
+glusterd_op_add_tier_brick(dict_t *dict, char **op_errstr);
+int
+glusterd_op_remove_brick(dict_t *dict, char **op_errstr);
+int
+glusterd_op_stage_add_brick(dict_t *dict, char **op_errstr, dict_t *rsp_dict);
+int
+glusterd_op_stage_remove_brick(dict_t *dict, char **op_errstr);
+
+int
+glusterd_op_stage_rebalance(dict_t *dict, char **op_errstr);
+int
+glusterd_op_rebalance(dict_t *dict, char **op_errstr, dict_t *rsp_dict);
+
+int
+glusterd_op_stage_statedump_volume(dict_t *dict, char **op_errstr);
+int
+glusterd_op_statedump_volume(dict_t *dict, char **op_errstr);
+
+int
+glusterd_op_stage_clearlocks_volume(dict_t *dict, char **op_errstr);
+int
+glusterd_op_clearlocks_volume(dict_t *dict, char **op_errstr, dict_t *rsp_dict);
+
+int
+glusterd_op_stage_barrier(dict_t *dict, char **op_errstr);
+int
+glusterd_op_barrier(dict_t *dict, char **op_errstr);
/* misc */
-int glusterd_op_perform_remove_brick (glusterd_volinfo_t *volinfo, char *brick,
- int force, int *need_migrate);
-int glusterd_op_stop_volume_args_get (dict_t *dict, char** volname, int *flags);
-int glusterd_op_statedump_volume_args_get (dict_t *dict, char **volname,
- char **options, int *option_cnt);
+int
+glusterd_op_perform_remove_brick(glusterd_volinfo_t *volinfo, char *brick,
+ int force, int *need_migrate);
+int
+glusterd_op_stop_volume_args_get(dict_t *dict, char **volname, int *flags);
+int
+glusterd_op_statedump_volume_args_get(dict_t *dict, char **volname,
+ char **options, int *option_cnt);
-int glusterd_op_gsync_args_get (dict_t *dict, char **op_errstr,
- char **master, char **slave, char **host_uuid);
+int
+glusterd_op_gsync_args_get(dict_t *dict, char **op_errstr, char **master,
+ char **slave, char **host_uuid);
-int glusterd_op_get_max_opversion (char **op_errstr, dict_t *rsp_dict);
+int
+glusterd_op_get_max_opversion(char **op_errstr, dict_t *rsp_dict);
-int glusterd_start_volume (glusterd_volinfo_t *volinfo, int flags,
- gf_boolean_t wait);
+int
+glusterd_start_volume(glusterd_volinfo_t *volinfo, int flags,
+ gf_boolean_t wait);
-int glusterd_stop_volume (glusterd_volinfo_t *volinfo);
+int
+glusterd_stop_volume(glusterd_volinfo_t *volinfo);
/* Synctask part */
-int32_t glusterd_op_begin_synctask (rpcsvc_request_t *req, glusterd_op_t op,
- void *dict);
int32_t
-glusterd_defrag_event_notify_handle (dict_t *dict);
+glusterd_op_begin_synctask(rpcsvc_request_t *req, glusterd_op_t op, void *dict);
+int32_t
+glusterd_defrag_event_notify_handle(dict_t *dict);
int32_t
-glusterd_txn_opinfo_dict_init ();
+glusterd_txn_opinfo_dict_init();
void
-glusterd_txn_opinfo_dict_fini ();
+glusterd_txn_opinfo_dict_fini();
void
-glusterd_txn_opinfo_init ();
+glusterd_txn_opinfo_init();
/* snapshot */
-glusterd_snap_t*
+glusterd_snap_t *
glusterd_new_snap_object();
int32_t
-glusterd_list_add_snapvol (glusterd_volinfo_t *origin_vol,
- glusterd_volinfo_t *snap_vol);
+glusterd_list_add_snapvol(glusterd_volinfo_t *origin_vol,
+ glusterd_volinfo_t *snap_vol);
-glusterd_snap_t*
-glusterd_remove_snap_by_id (uuid_t snap_id);
+glusterd_snap_t *
+glusterd_remove_snap_by_id(uuid_t snap_id);
-glusterd_snap_t*
-glusterd_remove_snap_by_name (char *snap_name);
+glusterd_snap_t *
+glusterd_remove_snap_by_name(char *snap_name);
-glusterd_snap_t*
-glusterd_find_snap_by_name (char *snap_name);
+glusterd_snap_t *
+glusterd_find_snap_by_name(char *snap_name);
-glusterd_snap_t*
-glusterd_find_snap_by_id (uuid_t snap_id);
+glusterd_snap_t *
+glusterd_find_snap_by_id(uuid_t snap_id);
int
-glusterd_snapshot_prevalidate (dict_t *dict, char **op_errstr,
- dict_t *rsp_dict, uint32_t *op_errno);
+glusterd_snapshot_prevalidate(dict_t *dict, char **op_errstr, dict_t *rsp_dict,
+ uint32_t *op_errno);
int
-glusterd_snapshot_brickop (dict_t *dict, char **op_errstr, dict_t *rsp_dict);
+glusterd_snapshot_brickop(dict_t *dict, char **op_errstr, dict_t *rsp_dict);
int
-glusterd_snapshot (dict_t *dict, char **op_errstr,
- uint32_t *op_errno, dict_t *rsp_dict);
+glusterd_snapshot(dict_t *dict, char **op_errstr, uint32_t *op_errno,
+ dict_t *rsp_dict);
int
-glusterd_snapshot_postvalidate (dict_t *dict, int32_t op_ret, char **op_errstr,
- dict_t *rsp_dict);
+glusterd_snapshot_postvalidate(dict_t *dict, int32_t op_ret, char **op_errstr,
+ dict_t *rsp_dict);
char *
-glusterd_build_snap_device_path (char *device, char *snapname,
- int32_t brick_count);
+glusterd_build_snap_device_path(char *device, char *snapname,
+ int32_t brick_count);
int32_t
-glusterd_snap_remove (dict_t *rsp_dict, glusterd_snap_t *snap,
- gf_boolean_t remove_lvm, gf_boolean_t force,
- gf_boolean_t is_clone);
+glusterd_snap_remove(dict_t *rsp_dict, glusterd_snap_t *snap,
+ gf_boolean_t remove_lvm, gf_boolean_t force,
+ gf_boolean_t is_clone);
int32_t
-glusterd_snapshot_cleanup (dict_t *dict, char **op_errstr, dict_t *rsp_dict);
+glusterd_snapshot_cleanup(dict_t *dict, char **op_errstr, dict_t *rsp_dict);
int32_t
-glusterd_add_missed_snaps_to_list (dict_t *dict, int32_t missed_snap_count);
+glusterd_add_missed_snaps_to_list(dict_t *dict, int32_t missed_snap_count);
int32_t
-glusterd_add_new_entry_to_list (char *missed_info, char *snap_vol_id,
- int32_t brick_num, char *brick_path,
- int32_t snap_op, int32_t snap_status);
+glusterd_add_new_entry_to_list(char *missed_info, char *snap_vol_id,
+ int32_t brick_num, char *brick_path,
+ int32_t snap_op, int32_t snap_status);
int
-glusterd_snapshot_revert_restore_from_snap (glusterd_snap_t *snap);
-
+glusterd_snapshot_revert_restore_from_snap(glusterd_snap_t *snap);
int
-glusterd_add_brick_status_to_dict (dict_t *dict, glusterd_volinfo_t *volinfo,
- glusterd_brickinfo_t *brickinfo,
- char *key_prefix);
+glusterd_add_brick_status_to_dict(dict_t *dict, glusterd_volinfo_t *volinfo,
+ glusterd_brickinfo_t *brickinfo,
+ char *key_prefix);
int32_t
-glusterd_handle_snap_limit (dict_t *dict, dict_t *rsp_dict);
+glusterd_handle_snap_limit(dict_t *dict, dict_t *rsp_dict);
gf_boolean_t
-glusterd_should_i_stop_bitd ();
+glusterd_should_i_stop_bitd();
int
-glusterd_remove_brick_migrate_cbk (glusterd_volinfo_t *volinfo,
- gf_defrag_status_t status);
+glusterd_remove_brick_migrate_cbk(glusterd_volinfo_t *volinfo,
+ gf_defrag_status_t status);
/* tier */
int
-__glusterd_handle_reset_brick (rpcsvc_request_t *req);
-int glusterd_op_stage_tier (dict_t *dict, char **op_errstr, dict_t *rsp_dict);
-int glusterd_op_tier_start_stop (dict_t *dict, char **op_errstr,
- dict_t *rsp_dict);
-int glusterd_op_remove_tier_brick (dict_t *dict, char **op_errstr,
- dict_t *rsp_dict);
+__glusterd_handle_reset_brick(rpcsvc_request_t *req);
+int
+glusterd_op_stage_tier(dict_t *dict, char **op_errstr, dict_t *rsp_dict);
+int
+glusterd_op_tier_start_stop(dict_t *dict, char **op_errstr, dict_t *rsp_dict);
+int
+glusterd_op_remove_tier_brick(dict_t *dict, char **op_errstr, dict_t *rsp_dict);
int
-glusterd_tier_prevalidate (dict_t *dict, char **op_errstr,
- dict_t *rsp_dict, uint32_t *op_errno);
+glusterd_tier_prevalidate(dict_t *dict, char **op_errstr, dict_t *rsp_dict,
+ uint32_t *op_errno);
int
-glusterd_options_init (xlator_t *this);
+glusterd_options_init(xlator_t *this);
#endif
diff --git a/xlators/mount/fuse/src/fuse-bridge.h b/xlators/mount/fuse/src/fuse-bridge.h
index b26b5e21109..318f33b5d61 100644
--- a/xlators/mount/fuse/src/fuse-bridge.h
+++ b/xlators/mount/fuse/src/fuse-bridge.h
@@ -46,130 +46,129 @@
#ifdef GF_DARWIN_HOST_OS
#define FUSE_OP_HIGH (FUSE_DESTROY + 1)
#endif
-#define GLUSTERFS_XATTR_LEN_MAX 65536
+#define GLUSTERFS_XATTR_LEN_MAX 65536
#define MAX_FUSE_PROC_DELAY 1
typedef struct fuse_in_header fuse_in_header_t;
-typedef void (fuse_handler_t) (xlator_t *this, fuse_in_header_t *finh,
- void *msg, struct iobuf *iobuf);
+typedef void(fuse_handler_t)(xlator_t *this, fuse_in_header_t *finh, void *msg,
+ struct iobuf *iobuf);
struct fuse_private {
- int fd;
- uint32_t proto_minor;
- char *volfile;
- size_t volfile_size;
- char *mount_point;
- struct iobuf *iobuf;
-
- pthread_t *fuse_thread;
- uint32_t reader_thread_count;
- char fuse_thread_started;
-
- uint32_t direct_io_mode;
- size_t *msg0_len_p;
-
- double entry_timeout;
- double negative_timeout;
- double attribute_timeout;
-
- pthread_cond_t sync_cond;
- pthread_mutex_t sync_mutex;
- char event_recvd;
-
- char init_recvd;
-
- gf_boolean_t strict_volfile_check;
-
- fuse_handler_t **fuse_ops;
- fuse_handler_t **fuse_ops0;
- pthread_mutex_t fuse_dump_mutex;
- int fuse_dump_fd;
-
- glusterfs_graph_t *next_graph;
- xlator_t *active_subvol;
-
- pid_t client_pid;
- gf_boolean_t client_pid_set;
- unsigned uid_map_root;
- gf_boolean_t acl;
- gf_boolean_t selinux;
- gf_boolean_t read_only;
- int32_t fopen_keep_cache;
- int32_t gid_cache_timeout;
- gf_boolean_t enable_ino32;
- /* This is the mount option for disabling the root-squash for the
- mount irrespective of whether the root-squash option for the
- volume is set or not. But this option is honoured only for
- thr trusted clients. For non trusted clients this value does
- not have any affect and the volume option for root-squash is
- honoured.
- */
- gf_boolean_t no_root_squash;
- fdtable_t *fdtable;
- gid_cache_t gid_cache;
- char *fuse_mountopts;
-
- /* For fuse-reverse-validation */
- struct list_head invalidate_list;
- pthread_cond_t invalidate_cond;
- pthread_mutex_t invalidate_mutex;
- gf_boolean_t reverse_fuse_thread_started;
-
- /* For communicating with separate mount thread. */
- int status_pipe[2];
-
- /* for fuse queue length and congestion threshold */
- int background_qlen;
- int congestion_threshold;
-
- /* for using fuse-kernel readdirp*/
- gf_boolean_t use_readdirp;
-
- /* fini started, helps prevent multiple epoll worker threads
- * firing up the fini routine */
- gf_boolean_t fini_invoked;
-
- /* resolve gid with getgrouplist() instead of /proc/%d/status */
- gf_boolean_t resolve_gids;
-
- /* Enable or disable capability support */
- gf_boolean_t capability;
-
- /* Enable or disable event history */
- gf_boolean_t event_history;
-
- /* whether to run the unmount daemon */
- gf_boolean_t auto_unmount;
-
- /* Load the thin volfile, and connect to gfproxyd*/
- gf_boolean_t thin_client;
- gf_boolean_t mount_finished;
- gf_boolean_t handle_graph_switch;
- pthread_cond_t migrate_cond;
-
- /* Writeback cache support */
- gf_boolean_t kernel_writeback_cache;
- int attr_times_granularity;
+ int fd;
+ uint32_t proto_minor;
+ char *volfile;
+ size_t volfile_size;
+ char *mount_point;
+ struct iobuf *iobuf;
+
+ pthread_t *fuse_thread;
+ uint32_t reader_thread_count;
+ char fuse_thread_started;
+
+ uint32_t direct_io_mode;
+ size_t *msg0_len_p;
+
+ double entry_timeout;
+ double negative_timeout;
+ double attribute_timeout;
+
+ pthread_cond_t sync_cond;
+ pthread_mutex_t sync_mutex;
+ char event_recvd;
+
+ char init_recvd;
+
+ gf_boolean_t strict_volfile_check;
+
+ fuse_handler_t **fuse_ops;
+ fuse_handler_t **fuse_ops0;
+ pthread_mutex_t fuse_dump_mutex;
+ int fuse_dump_fd;
+
+ glusterfs_graph_t *next_graph;
+ xlator_t *active_subvol;
+
+ pid_t client_pid;
+ gf_boolean_t client_pid_set;
+ unsigned uid_map_root;
+ gf_boolean_t acl;
+ gf_boolean_t selinux;
+ gf_boolean_t read_only;
+ int32_t fopen_keep_cache;
+ int32_t gid_cache_timeout;
+ gf_boolean_t enable_ino32;
+ /* This is the mount option for disabling the root-squash for the
+ mount irrespective of whether the root-squash option for the
+ volume is set or not. But this option is honoured only for
+ thr trusted clients. For non trusted clients this value does
+ not have any affect and the volume option for root-squash is
+ honoured.
+ */
+ gf_boolean_t no_root_squash;
+ fdtable_t *fdtable;
+ gid_cache_t gid_cache;
+ char *fuse_mountopts;
+
+ /* For fuse-reverse-validation */
+ struct list_head invalidate_list;
+ pthread_cond_t invalidate_cond;
+ pthread_mutex_t invalidate_mutex;
+ gf_boolean_t reverse_fuse_thread_started;
+
+ /* For communicating with separate mount thread. */
+ int status_pipe[2];
+
+ /* for fuse queue length and congestion threshold */
+ int background_qlen;
+ int congestion_threshold;
+
+ /* for using fuse-kernel readdirp*/
+ gf_boolean_t use_readdirp;
+
+ /* fini started, helps prevent multiple epoll worker threads
+ * firing up the fini routine */
+ gf_boolean_t fini_invoked;
+
+ /* resolve gid with getgrouplist() instead of /proc/%d/status */
+ gf_boolean_t resolve_gids;
+
+ /* Enable or disable capability support */
+ gf_boolean_t capability;
+
+ /* Enable or disable event history */
+ gf_boolean_t event_history;
+
+ /* whether to run the unmount daemon */
+ gf_boolean_t auto_unmount;
+
+ /* Load the thin volfile, and connect to gfproxyd*/
+ gf_boolean_t thin_client;
+ gf_boolean_t mount_finished;
+ gf_boolean_t handle_graph_switch;
+ pthread_cond_t migrate_cond;
+
+ /* Writeback cache support */
+ gf_boolean_t kernel_writeback_cache;
+ int attr_times_granularity;
};
typedef struct fuse_private fuse_private_t;
-#define INVAL_BUF_SIZE (sizeof (struct fuse_out_header) + \
- max (sizeof (struct fuse_notify_inval_inode_out), \
- sizeof (struct fuse_notify_inval_entry_out) + \
- NAME_MAX + 1))
-
+#define INVAL_BUF_SIZE \
+ (sizeof(struct fuse_out_header) + \
+ max(sizeof(struct fuse_notify_inval_inode_out), \
+ sizeof(struct fuse_notify_inval_entry_out) + NAME_MAX + 1))
struct fuse_invalidate_node {
- char inval_buf[INVAL_BUF_SIZE];
- struct list_head next;
+ char inval_buf[INVAL_BUF_SIZE];
+ struct list_head next;
};
typedef struct fuse_invalidate_node fuse_invalidate_node_t;
struct fuse_graph_switch_args {
- xlator_t *this;
- xlator_t *old_subvol;
- xlator_t *new_subvol;
+ xlator_t *this;
+ xlator_t *old_subvol;
+ xlator_t *new_subvol;
};
typedef struct fuse_graph_switch_args fuse_graph_switch_args_t;
@@ -177,270 +176,284 @@ typedef struct fuse_graph_switch_args fuse_graph_switch_args_t;
#define _FH_TO_FD(fh) ((fd_t *)(uintptr_t)(fh))
-#define FH_TO_FD(fh) ((_FH_TO_FD (fh))?(fd_ref (_FH_TO_FD (fh))):((fd_t *) 0))
+#define FH_TO_FD(fh) ((_FH_TO_FD(fh)) ? (fd_ref(_FH_TO_FD(fh))) : ((fd_t *)0))
/* Use the same logic as the Linux NFS-client */
-#define GF_FUSE_SQUASH_INO(ino) (((uint32_t) ino) ^ (ino >> 32))
-
-#define FUSE_FOP(state, ret, op_num, fop, args ...) \
- do { \
- xlator_t *xl = NULL; \
- call_frame_t *frame = NULL; \
- \
- xl = state->active_subvol; \
- if (!xl) { \
- gf_log_callingfn (state->this->name, GF_LOG_ERROR, \
- "No active subvolume"); \
- send_fuse_err (state->this, state->finh, ENOENT); \
- free_fuse_state (state); \
- break; \
- } \
- \
- frame = get_call_frame_for_req (state); \
- if (!frame) { \
- /* This is not completely clean, as some \
- * earlier allocations might remain unfreed \
- * if we return at this point, but still \
- * better than trying to go on with a NULL \
- * frame ... \
- */ \
- send_fuse_err (state->this, state->finh, ENOMEM); \
- free_fuse_state (state); \
- /* ideally, need to 'return', but let the */ \
- /* calling function take care of it */ \
- break; \
- } \
- \
- frame->root->state = state; \
- frame->root->op = op_num; \
- frame->op = op_num; \
- \
- if (state->this->history) \
- gf_log_eh ("%"PRIu64", %s, path: (%s), gfid: " \
- "(%s)", frame->root->unique, \
- gf_fop_list[frame->root->op], \
- state->loc.path, \
- (state->fd == NULL)? \
- uuid_utoa (state->loc.gfid): \
- uuid_utoa (state->fd->inode->gfid)); \
- STACK_WIND (frame, ret, xl, xl->fops->fop, args); \
- } while (0)
-
-#define GF_SELECT_LOG_LEVEL(_errno) \
+#define GF_FUSE_SQUASH_INO(ino) (((uint32_t)ino) ^ (ino >> 32))
+
+#define FUSE_FOP(state, ret, op_num, fop, args...) \
+ do { \
+ xlator_t *xl = NULL; \
+ call_frame_t *frame = NULL; \
+ \
+ xl = state->active_subvol; \
+ if (!xl) { \
+ gf_log_callingfn(state->this->name, GF_LOG_ERROR, \
+ "No active subvolume"); \
+ send_fuse_err(state->this, state->finh, ENOENT); \
+ free_fuse_state(state); \
+ break; \
+ } \
+ \
+ frame = get_call_frame_for_req(state); \
+ if (!frame) { \
+ /* This is not completely clean, as some \
+ * earlier allocations might remain unfreed \
+ * if we return at this point, but still \
+ * better than trying to go on with a NULL \
+ * frame ... \
+ */ \
+ send_fuse_err(state->this, state->finh, ENOMEM); \
+ free_fuse_state(state); \
+ /* ideally, need to 'return', but let the */ \
+ /* calling function take care of it */ \
+ break; \
+ } \
+ \
+ frame->root->state = state; \
+ frame->root->op = op_num; \
+ frame->op = op_num; \
+ \
+ if (state->this->history) \
+ gf_log_eh("%" PRIu64 \
+ ", %s, path: (%s), gfid: " \
+ "(%s)", \
+ frame->root->unique, gf_fop_list[frame->root->op], \
+ state->loc.path, \
+ (state->fd == NULL) \
+ ? uuid_utoa(state->loc.gfid) \
+ : uuid_utoa(state->fd->inode->gfid)); \
+ STACK_WIND(frame, ret, xl, xl->fops->fop, args); \
+ } while (0)
+
+#define GF_SELECT_LOG_LEVEL(_errno) \
(((_errno == ENOENT) || (_errno == ESTALE))? \
GF_LOG_DEBUG)
-#define GET_STATE(this, finh, state) \
- do { \
- state = get_fuse_state (this, finh); \
- if (!state) { \
- gf_log ("glusterfs-fuse", \
- GF_LOG_ERROR, \
- "FUSE message unique %"PRIu64" opcode %d:" \
- " state allocation failed", \
- finh->unique, finh->opcode); \
- \
- send_fuse_err (this, finh, ENOMEM); \
- GF_FREE (finh); \
- \
- return; \
- } \
- } while (0)
-
-#define FUSE_ENTRY_CREATE(this, priv, finh, state, fci, op) \
- do { \
- if (priv->proto_minor >= 12) \
- state->mode &= ~fci->umask; \
- if (priv->proto_minor >= 12 && priv->acl) { \
- state->xdata = dict_new (); \
- if (!state->xdata) { \
- gf_log ("glusterfs-fuse", \
- GF_LOG_WARNING, \
- "%s failed to allocate " \
- "a param dictionary", op); \
- send_fuse_err (this, finh, ENOMEM); \
- free_fuse_state (state); \
- return; \
- } \
- state->umask = fci->umask; \
- \
-/* TODO: remove this after 3.4.0 release. keeping it for the \
- sake of backward compatibility with old (3.3.[01]) \
- releases till then. */ \
- ret = dict_set_int16 (state->xdata, "umask", \
- fci->umask); \
- if (ret < 0) { \
- gf_log ("glusterfs-fuse", \
- GF_LOG_WARNING, \
- "%s Failed adding umask"\
- " to request", op); \
- send_fuse_err (this, finh, ENOMEM); \
- free_fuse_state (state); \
- return; \
- } \
- ret = dict_set_int16 (state->xdata, "mode", \
- fci->mode); \
- if (ret < 0) { \
- gf_log ("glusterfs-fuse", \
- GF_LOG_WARNING, \
- "%s Failed adding mode " \
- "to request", op); \
- send_fuse_err (this, finh, ENOMEM); \
- free_fuse_state (state); \
- return; \
- } \
- } \
- } while (0)
-
-#define fuse_log_eh_fop(this, state, frame, op_ret, op_errno) \
- do { \
- fuse_private_t *priv = this->private; \
- if (this->history && priv->event_history) { \
- if (state->fd) \
- gf_log_eh ("op_ret: %d, op_errno: %d, " \
- "%"PRIu64", %s () => %p, gfid: %s", \
- op_ret, op_errno, \
- frame->root->unique, \
- gf_fop_list[frame->root->op], \
- state->fd, \
- uuid_utoa (state->fd->inode->gfid)); \
- else \
- gf_log_eh ("op_ret: %d, op_errno: %d, " \
- "%"PRIu64", %s () => %s, gfid: %s", \
- op_ret, op_errno, \
- frame->root->unique, \
- gf_fop_list[frame->root->op], \
- state->loc.path, \
- uuid_utoa (state->loc.gfid)); \
- } \
- } while(0)
-
-#define fuse_log_eh(this, args...) \
- do { \
- fuse_private_t *priv = this->private; \
- if (this->history && priv->event_history) \
- gf_log_eh(args); \
- } while (0)
+#define GET_STATE(this, finh, state) \
+ do { \
+ state = get_fuse_state(this, finh); \
+ if (!state) { \
+ gf_log("glusterfs-fuse", GF_LOG_ERROR, \
+ "FUSE message unique %" PRIu64 \
+ " opcode %d:" \
+ " state allocation failed", \
+ finh->unique, finh->opcode); \
+ \
+ send_fuse_err(this, finh, ENOMEM); \
+ GF_FREE(finh); \
+ \
+ return; \
+ } \
+ } while (0)
+
+#define FUSE_ENTRY_CREATE(this, priv, finh, state, fci, op) \
+ do { \
+ if (priv->proto_minor >= 12) \
+ state->mode &= ~fci->umask; \
+ if (priv->proto_minor >= 12 && priv->acl) { \
+ state->xdata = dict_new(); \
+ if (!state->xdata) { \
+ gf_log("glusterfs-fuse", GF_LOG_WARNING, \
+ "%s failed to allocate " \
+ "a param dictionary", \
+ op); \
+ send_fuse_err(this, finh, ENOMEM); \
+ free_fuse_state(state); \
+ return; \
+ } \
+ state->umask = fci->umask; \
+ \
+ /* TODO: remove this after 3.4.0 release. keeping it for the \
+ sake of backward compatibility with old (3.3.[01]) \
+ releases till then. */ \
+ ret = dict_set_int16(state->xdata, "umask", fci->umask); \
+ if (ret < 0) { \
+ gf_log("glusterfs-fuse", GF_LOG_WARNING, \
+ "%s Failed adding umask" \
+ " to request", \
+ op); \
+ send_fuse_err(this, finh, ENOMEM); \
+ free_fuse_state(state); \
+ return; \
+ } \
+ ret = dict_set_int16(state->xdata, "mode", fci->mode); \
+ if (ret < 0) { \
+ gf_log("glusterfs-fuse", GF_LOG_WARNING, \
+ "%s Failed adding mode " \
+ "to request", \
+ op); \
+ send_fuse_err(this, finh, ENOMEM); \
+ free_fuse_state(state); \
+ return; \
+ } \
+ } \
+ } while (0)
+
+#define fuse_log_eh_fop(this, state, frame, op_ret, op_errno) \
+ do { \
+ fuse_private_t *priv = this->private; \
+ if (this->history && priv->event_history) { \
+ if (state->fd) \
+ gf_log_eh( \
+ "op_ret: %d, op_errno: %d, " \
+ "%" PRIu64 ", %s () => %p, gfid: %s", \
+ op_ret, op_errno, frame->root->unique, \
+ gf_fop_list[frame->root->op], state->fd, \
+ uuid_utoa(state->fd->inode->gfid)); \
+ else \
+ gf_log_eh( \
+ "op_ret: %d, op_errno: %d, " \
+ "%" PRIu64 ", %s () => %s, gfid: %s", \
+ op_ret, op_errno, frame->root->unique, \
+ gf_fop_list[frame->root->op], state->loc.path, \
+ uuid_utoa(state->loc.gfid)); \
+ } \
+ } while (0)
+
+#define fuse_log_eh(this, args...) \
+ do { \
+ fuse_private_t *priv = this->private; \
+ if (this->history && priv->event_history) \
+ gf_log_eh(args); \
+ } while (0)
static inline xlator_t *
-fuse_active_subvol (xlator_t *fuse)
+fuse_active_subvol(xlator_t *fuse)
{
- fuse_private_t *priv = NULL;
+ fuse_private_t *priv = NULL;
- priv = fuse->private;
+ priv = fuse->private;
- return priv->active_subvol;
+ return priv->active_subvol;
}
-
typedef enum {
- RESOLVE_MUST = 1,
- RESOLVE_NOT,
- RESOLVE_MAY,
- RESOLVE_DONTCARE,
- RESOLVE_EXACT
+ RESOLVE_MUST = 1,
+ RESOLVE_NOT,
+ RESOLVE_MAY,
+ RESOLVE_DONTCARE,
+ RESOLVE_EXACT
} fuse_resolve_type_t;
-
typedef struct {
- fuse_resolve_type_t type;
- fd_t *fd;
- char *path;
- char *bname;
- u_char gfid[16];
- inode_t *hint;
- u_char pargfid[16];
- inode_t *parhint;
- int op_ret;
- int op_errno;
- loc_t resolve_loc;
+ fuse_resolve_type_t type;
+ fd_t *fd;
+ char *path;
+ char *bname;
+ u_char gfid[16];
+ inode_t *hint;
+ u_char pargfid[16];
+ inode_t *parhint;
+ int op_ret;
+ int op_errno;
+ loc_t resolve_loc;
} fuse_resolve_t;
-
typedef struct {
- void *pool;
- xlator_t *this;
- xlator_t *active_subvol;
- inode_table_t *itable;
- loc_t loc;
- loc_t loc2;
- fuse_in_header_t *finh;
- int32_t flags;
- off_t off;
- size_t size;
- unsigned long nlookup;
- fd_t *fd;
- dict_t *xattr;
- dict_t *xdata;
- char *name;
- char is_revalidate;
- gf_boolean_t truncate_needed;
- gf_lock_t lock;
- uint64_t lk_owner;
-
- /* used within resolve_and_resume */
- /* */
- fuse_resolve_t resolve;
- fuse_resolve_t resolve2;
-
- loc_t *loc_now;
- fuse_resolve_t *resolve_now;
-
- void *resume_fn;
-
- int valid;
- int mask;
- dev_t rdev;
- mode_t mode;
- mode_t umask;
- struct iatt attr;
- struct gf_flock lk_lock;
- struct iovec vector;
-
- uuid_t gfid;
- uint32_t io_flags;
- int32_t fd_no;
-
- gf_seek_what_t whence;
- struct iobuf *iobuf;
+ void *pool;
+ xlator_t *this;
+ xlator_t *active_subvol;
+ inode_table_t *itable;
+ loc_t loc;
+ loc_t loc2;
+ fuse_in_header_t *finh;
+ int32_t flags;
+ off_t off;
+ size_t size;
+ unsigned long nlookup;
+ fd_t *fd;
+ dict_t *xattr;
+ dict_t *xdata;
+ char *name;
+ char is_revalidate;
+ gf_boolean_t truncate_needed;
+ gf_lock_t lock;
+ uint64_t lk_owner;
+
+ /* used within resolve_and_resume */
+ /* */
+ fuse_resolve_t resolve;
+ fuse_resolve_t resolve2;
+
+ loc_t *loc_now;
+ fuse_resolve_t *resolve_now;
+
+ void *resume_fn;
+
+ int valid;
+ int mask;
+ dev_t rdev;
+ mode_t mode;
+ mode_t umask;
+ struct iatt attr;
+ struct gf_flock lk_lock;
+ struct iovec vector;
+
+ uuid_t gfid;
+ uint32_t io_flags;
+ int32_t fd_no;
+
+ gf_seek_what_t whence;
+ struct iobuf *iobuf;
} fuse_state_t;
typedef struct {
- uint32_t open_flags;
- char migration_failed;
- fd_t *activefd;
+ uint32_t open_flags;
+ char migration_failed;
+ fd_t *activefd;
} fuse_fd_ctx_t;
-typedef void (*fuse_resume_fn_t) (fuse_state_t *state);
+typedef void (*fuse_resume_fn_t)(fuse_state_t *state);
GF_MUST_CHECK int32_t
-fuse_loc_fill (loc_t *loc, fuse_state_t *state, ino_t ino,
- ino_t par, const char *name);
-call_frame_t *get_call_frame_for_req (fuse_state_t *state);
-fuse_state_t *get_fuse_state (xlator_t *this, fuse_in_header_t *finh);
-void free_fuse_state (fuse_state_t *state);
-void gf_fuse_stat2attr (struct iatt *st, struct fuse_attr *fa,
- gf_boolean_t enable_ino32);
-void gf_fuse_fill_dirent (gf_dirent_t *entry, struct fuse_dirent *fde,
- gf_boolean_t enable_ino32);
-uint64_t inode_to_fuse_nodeid (inode_t *inode);
-xlator_t *fuse_active_subvol (xlator_t *fuse);
-inode_t *fuse_ino_to_inode (uint64_t ino, xlator_t *fuse);
-int send_fuse_err (xlator_t *this, fuse_in_header_t *finh, int error);
-int fuse_gfid_set (fuse_state_t *state);
-int fuse_flip_xattr_ns (struct fuse_private *priv, char *okey, char **nkey);
-fuse_fd_ctx_t * __fuse_fd_ctx_check_n_create (xlator_t *this, fd_t *fd);
-fuse_fd_ctx_t * fuse_fd_ctx_check_n_create (xlator_t *this, fd_t *fd);
-
-int fuse_resolve_and_resume (fuse_state_t *state, fuse_resume_fn_t fn);
-int fuse_resolve_inode_init (fuse_state_t *state, fuse_resolve_t *resolve,
- ino_t ino);
-int fuse_resolve_entry_init (fuse_state_t *state, fuse_resolve_t *resolve,
- ino_t par, char *name);
-int fuse_resolve_fd_init (fuse_state_t *state, fuse_resolve_t *resolve,
- fd_t *fd);
-int fuse_ignore_xattr_set (fuse_private_t *priv, char *key);
-void fuse_fop_resume (fuse_state_t *state);
-int dump_history_fuse (circular_buffer_t *cb, void *data);
-int fuse_check_selinux_cap_xattr (fuse_private_t *priv, char *name);
+fuse_loc_fill(loc_t *loc, fuse_state_t *state, ino_t ino, ino_t par,
+ const char *name);
+call_frame_t *
+get_call_frame_for_req(fuse_state_t *state);
+fuse_state_t *
+get_fuse_state(xlator_t *this, fuse_in_header_t *finh);
+void
+free_fuse_state(fuse_state_t *state);
+void
+gf_fuse_stat2attr(struct iatt *st, struct fuse_attr *fa,
+ gf_boolean_t enable_ino32);
+void
+gf_fuse_fill_dirent(gf_dirent_t *entry, struct fuse_dirent *fde,
+ gf_boolean_t enable_ino32);
+uint64_t
+inode_to_fuse_nodeid(inode_t *inode);
+xlator_t *
+fuse_active_subvol(xlator_t *fuse);
+inode_t *
+fuse_ino_to_inode(uint64_t ino, xlator_t *fuse);
+int
+send_fuse_err(xlator_t *this, fuse_in_header_t *finh, int error);
+int
+fuse_gfid_set(fuse_state_t *state);
+int
+fuse_flip_xattr_ns(struct fuse_private *priv, char *okey, char **nkey);
+fuse_fd_ctx_t *
+__fuse_fd_ctx_check_n_create(xlator_t *this, fd_t *fd);
+fuse_fd_ctx_t *
+fuse_fd_ctx_check_n_create(xlator_t *this, fd_t *fd);
+
+int
+fuse_resolve_and_resume(fuse_state_t *state, fuse_resume_fn_t fn);
+int
+fuse_resolve_inode_init(fuse_state_t *state, fuse_resolve_t *resolve,
+ ino_t ino);
+int
+fuse_resolve_entry_init(fuse_state_t *state, fuse_resolve_t *resolve, ino_t par,
+ char *name);
+int
+fuse_resolve_fd_init(fuse_state_t *state, fuse_resolve_t *resolve, fd_t *fd);
+int
+fuse_ignore_xattr_set(fuse_private_t *priv, char *key);
+void
+fuse_fop_resume(fuse_state_t *state);
+int
+dump_history_fuse(circular_buffer_t *cb, void *data);
+int
+fuse_check_selinux_cap_xattr(fuse_private_t *priv, char *name);
#endif /* _GF_FUSE_BRIDGE_H_ */
diff --git a/xlators/mount/fuse/src/fuse-mem-types.h b/xlators/mount/fuse/src/fuse-mem-types.h
index 721b9a347cf..5e6ab9308e0 100644
--- a/xlators/mount/fuse/src/fuse-mem-types.h
+++ b/xlators/mount/fuse/src/fuse-mem-types.h
@@ -14,17 +14,16 @@
#include "mem-types.h"
enum gf_fuse_mem_types_ {
- gf_fuse_mt_iovec = gf_common_mt_end + 1,
- gf_fuse_mt_fuse_private_t,
- gf_fuse_mt_char,
- gf_fuse_mt_iov_base,
- gf_fuse_mt_fuse_state_t,
- gf_fuse_mt_fd_ctx_t,
- gf_fuse_mt_graph_switch_args_t,
- gf_fuse_mt_gids_t,
- gf_fuse_mt_invalidate_node_t,
- gf_fuse_mt_pthread_t,
- gf_fuse_mt_end
+ gf_fuse_mt_iovec = gf_common_mt_end + 1,
+ gf_fuse_mt_fuse_private_t,
+ gf_fuse_mt_char,
+ gf_fuse_mt_iov_base,
+ gf_fuse_mt_fuse_state_t,
+ gf_fuse_mt_fd_ctx_t,
+ gf_fuse_mt_graph_switch_args_t,
+ gf_fuse_mt_gids_t,
+ gf_fuse_mt_invalidate_node_t,
+ gf_fuse_mt_pthread_t,
+ gf_fuse_mt_end
};
#endif
-
diff --git a/xlators/nfs/server/src/acl3.h b/xlators/nfs/server/src/acl3.h
index 3ccc587bd59..500d2ef6ae5 100644
--- a/xlators/nfs/server/src/acl3.h
+++ b/xlators/nfs/server/src/acl3.h
@@ -18,23 +18,23 @@
#define ACL3_SETACL 2
#define ACL3_PROC_COUNT 3
-#define GF_ACL3_PORT 38469
-#define GF_ACL GF_NFS"-ACL"
+#define GF_ACL3_PORT 38469
+#define GF_ACL GF_NFS "-ACL"
/* Flags for the getacl/setacl mode */
-#define NFS_ACL 0x0001
-#define NFS_ACLCNT 0x0002
-#define NFS_DFACL 0x0004
-#define NFS_DFACLCNT 0x0008
+#define NFS_ACL 0x0001
+#define NFS_ACLCNT 0x0002
+#define NFS_DFACL 0x0004
+#define NFS_DFACLCNT 0x0008
/*
* NFSv3, identifies the default ACL by NFS_ACL_DEFAULT. Gluster
* NFS needs to mask it OFF before sending it up to POSIX layer
* or File system layer.
*/
-#define NFS_ACL_DEFAULT 0x1000
+#define NFS_ACL_DEFAULT 0x1000
-#define NFS_ACL_MAX_ENTRIES 1024
+#define NFS_ACL_MAX_ENTRIES 1024
rpcsvc_program_t *
acl3svc_init(xlator_t *nfsx);
diff --git a/xlators/nfs/server/src/auth-cache.h b/xlators/nfs/server/src/auth-cache.h
index fa0b5d89676..d48c6f64e43 100644
--- a/xlators/nfs/server/src/auth-cache.h
+++ b/xlators/nfs/server/src/auth-cache.h
@@ -21,33 +21,32 @@
#include "nfs3.h"
struct auth_cache {
- gf_lock_t lock; /* locking for the dict (and entries) */
- dict_t *cache_dict; /* Dict holding fh -> authcache_entry */
- time_t ttl_sec; /* TTL of the auth cache in seconds */
+ gf_lock_t lock; /* locking for the dict (and entries) */
+ dict_t *cache_dict; /* Dict holding fh -> authcache_entry */
+ time_t ttl_sec; /* TTL of the auth cache in seconds */
};
-
/* Initializes the cache */
struct auth_cache *
-auth_cache_init (time_t ttl_sec);
+auth_cache_init(time_t ttl_sec);
/* Inserts FH into cache */
int
-cache_nfs_fh (struct auth_cache *cache, struct nfs3_fh *fh,
- const char *host_addr, struct export_item *export_item);
+cache_nfs_fh(struct auth_cache *cache, struct nfs3_fh *fh,
+ const char *host_addr, struct export_item *export_item);
/* Checks if the filehandle cached & writable */
gf_boolean_t
-is_nfs_fh_cached_and_writeable (struct auth_cache *cache, struct nfs3_fh *fh,
- const char *host_addr);
+is_nfs_fh_cached_and_writeable(struct auth_cache *cache, struct nfs3_fh *fh,
+ const char *host_addr);
/* Checks if the filehandle is cached */
gf_boolean_t
-is_nfs_fh_cached (struct auth_cache *cache, struct nfs3_fh *fh,
- const char *host_addr);
+is_nfs_fh_cached(struct auth_cache *cache, struct nfs3_fh *fh,
+ const char *host_addr);
/* Purge the cache */
void
-auth_cache_purge (struct auth_cache *cache);
+auth_cache_purge(struct auth_cache *cache);
#endif /* _AUTH_CACHE_H_ */
diff --git a/xlators/nfs/server/src/exports.h b/xlators/nfs/server/src/exports.h
index 87795dadaee..d44e32e3f74 100644
--- a/xlators/nfs/server/src/exports.h
+++ b/xlators/nfs/server/src/exports.h
@@ -19,19 +19,19 @@
#include "dict.h"
#include "nfs.h"
-#define GF_EXP GF_NFS"-exports"
+#define GF_EXP GF_NFS "-exports"
-#define NETGROUP_REGEX_PATTERN "(@([a-zA-Z0-9\\(=, .])+)())"
-#define HOSTNAME_REGEX_PATTERN "[[:space:]]([a-zA-Z0-9.\\(=,*/:)-]+)"
-#define OPTIONS_REGEX_PATTERN "([a-zA-Z0-9=\\.]+)"
+#define NETGROUP_REGEX_PATTERN "(@([a-zA-Z0-9\\(=, .])+)())"
+#define HOSTNAME_REGEX_PATTERN "[[:space:]]([a-zA-Z0-9.\\(=,*/:)-]+)"
+#define OPTIONS_REGEX_PATTERN "([a-zA-Z0-9=\\.]+)"
-#define NETGROUP_MAX_LEN 128
-#define FQDN_MAX_LEN 256
+#define NETGROUP_MAX_LEN 128
+#define FQDN_MAX_LEN 256
-#define SEC_OPTION_MAX 10
-#define UID_MAX_LEN 6
+#define SEC_OPTION_MAX 10
+#define UID_MAX_LEN 6
-#define DIR_MAX_LEN 1024
+#define DIR_MAX_LEN 1024
/* The following 2 definitions are in mount3.h
* but we don't want to include it because mount3.h
@@ -41,53 +41,53 @@
struct mount3_state;
extern struct mnt3_export *
-mnt3_mntpath_to_export (struct mount3_state *ms, const char *dirpath,
- gf_boolean_t export_parsing_match);
+mnt3_mntpath_to_export(struct mount3_state *ms, const char *dirpath,
+ gf_boolean_t export_parsing_match);
struct export_options {
- gf_boolean_t rw; /* Read-write option */
- gf_boolean_t nosuid; /* nosuid option */
- gf_boolean_t root; /* root option */
- char *anon_uid; /* anonuid option */
- char *sec_type; /* X, for sec=X */
+ gf_boolean_t rw; /* Read-write option */
+ gf_boolean_t nosuid; /* nosuid option */
+ gf_boolean_t root; /* root option */
+ char *anon_uid; /* anonuid option */
+ char *sec_type; /* X, for sec=X */
};
struct export_item {
- char *name; /* Name of the export item */
- struct export_options *opts; /* NFS Options */
- GF_REF_DECL;
+ char *name; /* Name of the export item */
+ struct export_options *opts; /* NFS Options */
+ GF_REF_DECL;
};
struct export_dir {
- char *dir_name; /* Directory */
- dict_t *netgroups; /* Dict of netgroups */
- dict_t *hosts; /* Dict of hosts */
+ char *dir_name; /* Directory */
+ dict_t *netgroups; /* Dict of netgroups */
+ dict_t *hosts; /* Dict of hosts */
};
struct exports_file {
- char *filename; /* Filename */
- dict_t *exports_dict; /* Dict of export_dir_t */
- dict_t *exports_map; /* Map of SuperFastHash(<export>) -> expdir */
+ char *filename; /* Filename */
+ dict_t *exports_dict; /* Dict of export_dir_t */
+ dict_t *exports_map; /* Map of SuperFastHash(<export>) -> expdir */
};
void
-exp_file_deinit (struct exports_file *expfile);
+exp_file_deinit(struct exports_file *expfile);
int
-exp_file_parse (const char *filepath, struct exports_file **expfile,
- struct mount3_state *ms);
+exp_file_parse(const char *filepath, struct exports_file **expfile,
+ struct mount3_state *ms);
struct export_dir *
-exp_file_get_dir (const struct exports_file *file, const char *dir);
+exp_file_get_dir(const struct exports_file *file, const char *dir);
struct export_item *
-exp_dir_get_host (const struct export_dir *expdir, const char *host);
+exp_dir_get_host(const struct export_dir *expdir, const char *host);
struct export_item *
-exp_dir_get_netgroup (const struct export_dir *expdir, const char *netgroup);
+exp_dir_get_netgroup(const struct export_dir *expdir, const char *netgroup);
struct export_dir *
-exp_file_dir_from_uuid (const struct exports_file *file,
- const uuid_t export_uuid);
+exp_file_dir_from_uuid(const struct exports_file *file,
+ const uuid_t export_uuid);
-#endif /* _EXPORTS_H_ */
+#endif /* _EXPORTS_H_ */
diff --git a/xlators/nfs/server/src/mount3-auth.h b/xlators/nfs/server/src/mount3-auth.h
index b25d4724fac..e50af5847d3 100644
--- a/xlators/nfs/server/src/mount3-auth.h
+++ b/xlators/nfs/server/src/mount3-auth.h
@@ -21,39 +21,39 @@
#include "mount3.h"
#include "nfs.h"
-#define GF_MNT_AUTH GF_NFS"-mount3-auth"
+#define GF_MNT_AUTH GF_NFS "-mount3-auth"
struct mnt3_auth_params {
- struct netgroups_file *ngfile; /* The netgroup file to auth against */
- struct exports_file *expfile; /* The export file to auth against */
- struct mount3_state *ms; /* The mount state that owns this */
+ struct netgroups_file *ngfile; /* The netgroup file to auth against */
+ struct exports_file *expfile; /* The export file to auth against */
+ struct mount3_state *ms; /* The mount state that owns this */
};
/* Initialize auth params struct */
struct mnt3_auth_params *
-mnt3_auth_params_init (struct mount3_state *ms);
+mnt3_auth_params_init(struct mount3_state *ms);
/* Set the netgroups file to use in the auth */
int
-mnt3_auth_set_netgroups_auth (struct mnt3_auth_params *aps,
- const char *filename);
+mnt3_auth_set_netgroups_auth(struct mnt3_auth_params *aps,
+ const char *filename);
/* Set the exports file to use in the auth */
int
-mnt3_auth_set_exports_auth (struct mnt3_auth_params *aps, const char *filename);
+mnt3_auth_set_exports_auth(struct mnt3_auth_params *aps, const char *filename);
/* Check if a host is authorized to perform a mount / nfs-fop */
int
-mnt3_auth_host (const struct mnt3_auth_params *aps, const char *host,
- struct nfs3_fh *fh, const char *dir, gf_boolean_t is_write_op,
- struct export_item **save_item);
+mnt3_auth_host(const struct mnt3_auth_params *aps, const char *host,
+ struct nfs3_fh *fh, const char *dir, gf_boolean_t is_write_op,
+ struct export_item **save_item);
/* Free resources used by the auth params struct */
void
-mnt3_auth_params_deinit (struct mnt3_auth_params *aps);
+mnt3_auth_params_deinit(struct mnt3_auth_params *aps);
int
-mnt3_auth_fop_options_verify (const struct mnt3_auth_params *auth_params,
- const char *host, const char *dir);
+mnt3_auth_fop_options_verify(const struct mnt3_auth_params *auth_params,
+ const char *host, const char *dir);
#endif /* _MOUNT3_AUTH */
diff --git a/xlators/nfs/server/src/mount3.h b/xlators/nfs/server/src/mount3.h
index 8868aec787a..9b0f73e3af7 100644
--- a/xlators/nfs/server/src/mount3.h
+++ b/xlators/nfs/server/src/mount3.h
@@ -26,163 +26,163 @@
#include "auth-cache.h"
/* Registered with portmap */
-#define GF_MOUNTV3_PORT 38465
-#define GF_MOUNTV3_IOB (2 * GF_UNIT_KB)
-#define GF_MOUNTV3_IOBPOOL (GF_MOUNTV3_IOB * 50)
+#define GF_MOUNTV3_PORT 38465
+#define GF_MOUNTV3_IOB (2 * GF_UNIT_KB)
+#define GF_MOUNTV3_IOBPOOL (GF_MOUNTV3_IOB * 50)
-#define GF_MOUNTV1_PORT 38466
-#define GF_MNT GF_NFS"-mount"
+#define GF_MOUNTV1_PORT 38466
+#define GF_MNT GF_NFS "-mount"
extern rpcsvc_program_t *
-mnt3svc_init (xlator_t *nfsx);
+mnt3svc_init(xlator_t *nfsx);
extern rpcsvc_program_t *
-mnt1svc_init (xlator_t *nfsx);
+mnt1svc_init(xlator_t *nfsx);
extern void
-mnt3svc_deinit (xlator_t *nfsx);
+mnt3svc_deinit(xlator_t *nfsx);
extern int
-mount_init_state (xlator_t *nfsx);
+mount_init_state(xlator_t *nfsx);
extern int
-mount_reconfigure_state (xlator_t *nfsx, dict_t *options);
+mount_reconfigure_state(xlator_t *nfsx, dict_t *options);
void
-mount_rewrite_rmtab (struct mount3_state *ms, char *new_rmtab);
+mount_rewrite_rmtab(struct mount3_state *ms, char *new_rmtab);
struct mnt3_export *
-mnt3_mntpath_to_export (struct mount3_state *ms, const char *dirpath,
- gf_boolean_t export_parsing_match);
+mnt3_mntpath_to_export(struct mount3_state *ms, const char *dirpath,
+ gf_boolean_t export_parsing_match);
extern int
-mnt3svc_update_mountlist (struct mount3_state *ms, rpcsvc_request_t *req,
- const char *expname, const char *fullpath);
+mnt3svc_update_mountlist(struct mount3_state *ms, rpcsvc_request_t *req,
+ const char *expname, const char *fullpath);
int
-mnt3_authenticate_request (struct mount3_state *ms, rpcsvc_request_t *req,
- struct nfs3_fh *fh, const char *volname,
- const char *path, char **authorized_path,
- char **authorized_host, gf_boolean_t is_write_op);
+mnt3_authenticate_request(struct mount3_state *ms, rpcsvc_request_t *req,
+ struct nfs3_fh *fh, const char *volname,
+ const char *path, char **authorized_path,
+ char **authorized_host, gf_boolean_t is_write_op);
/* Data structure used to store the list of mounts points currently
* in use by NFS clients.
*/
struct mountentry {
- /* Links to mount3_state->mountlist. */
- struct list_head mlist;
+ /* Links to mount3_state->mountlist. */
+ struct list_head mlist;
- /* The export name */
- char exname[MNTPATHLEN];
- char hostname[MNTPATHLEN];
- char fullpath[MNTPATHLEN];
+ /* The export name */
+ char exname[MNTPATHLEN];
+ char hostname[MNTPATHLEN];
+ char fullpath[MNTPATHLEN];
- gf_boolean_t has_full_path;
+ gf_boolean_t has_full_path;
- /* Since this is stored in a dict, we want to be able
- * to find easily get the key we used to store
- * the struct in our dict
- */
- char hashkey[MNTPATHLEN*2+2];
+ /* Since this is stored in a dict, we want to be able
+ * to find easily get the key we used to store
+ * the struct in our dict
+ */
+ char hashkey[MNTPATHLEN * 2 + 2];
};
-#define MNT3_EXPTYPE_VOLUME 1
-#define MNT3_EXPTYPE_DIR 2
+#define MNT3_EXPTYPE_VOLUME 1
+#define MNT3_EXPTYPE_DIR 2
/* Structure to hold export-dir AUTH parameter */
struct host_auth_spec {
- char *host_addr; /* Allowed IP or host name */
- uint32_t netmask; /* Network mask (Big-Endian) */
- struct host_auth_spec *next; /* Pointer to next AUTH struct */
+ char *host_addr; /* Allowed IP or host name */
+ uint32_t netmask; /* Network mask (Big-Endian) */
+ struct host_auth_spec *next; /* Pointer to next AUTH struct */
};
struct mnt3_export {
- struct list_head explist;
-
- /* The string that may contain either the volume name if the full volume
- * is exported or the subdirectory in the volume.
- */
- char *expname;
- /*
- * IP address, hostname or subnets who are allowed to connect to expname
- * subvolume or subdirectory
- */
- struct host_auth_spec* hostspec;
- xlator_t *vol;
- int exptype;
-
- /* This holds the full path that the client requested including
- * the volume name AND the subdirectory in the volume.
- */
- char *fullpath;
-
- /* Extracted from nfs volume options if nfs.dynamicvolumes is on.
- */
- uuid_t volumeid;
- uuid_t mountid;
+ struct list_head explist;
+
+ /* The string that may contain either the volume name if the full volume
+ * is exported or the subdirectory in the volume.
+ */
+ char *expname;
+ /*
+ * IP address, hostname or subnets who are allowed to connect to expname
+ * subvolume or subdirectory
+ */
+ struct host_auth_spec *hostspec;
+ xlator_t *vol;
+ int exptype;
+
+ /* This holds the full path that the client requested including
+ * the volume name AND the subdirectory in the volume.
+ */
+ char *fullpath;
+
+ /* Extracted from nfs volume options if nfs.dynamicvolumes is on.
+ */
+ uuid_t volumeid;
+ uuid_t mountid;
};
struct mount3_state {
- xlator_t *nfsx;
+ xlator_t *nfsx;
- /* The NFS state that this belongs to */
- struct nfs_state *nfs;
+ /* The NFS state that this belongs to */
+ struct nfs_state *nfs;
- /* The buffers for all network IO are got from this pool. */
- struct iobuf_pool *iobpool;
+ /* The buffers for all network IO are got from this pool. */
+ struct iobuf_pool *iobpool;
- /* List of exports, can be volumes or directories in those volumes. */
- struct list_head exportlist;
+ /* List of exports, can be volumes or directories in those volumes. */
+ struct list_head exportlist;
- /* List of current mount points over all the exports from this
- * server.
- */
- struct list_head mountlist;
+ /* List of current mount points over all the exports from this
+ * server.
+ */
+ struct list_head mountlist;
- /* Dict of current mount points over all the exports from this
- * server. Mirrors the mountlist above, but can be used for
- * faster lookup in the event that there are several mounts.
- * Currently, each NFSOP is validated against this dict: each
- * op is checked to see if the host that operates on the path
- * does in fact have an entry in the mount dict.
- */
- dict_t *mountdict;
+ /* Dict of current mount points over all the exports from this
+ * server. Mirrors the mountlist above, but can be used for
+ * faster lookup in the event that there are several mounts.
+ * Currently, each NFSOP is validated against this dict: each
+ * op is checked to see if the host that operates on the path
+ * does in fact have an entry in the mount dict.
+ */
+ dict_t *mountdict;
- /* Used to protect the mountlist & the mount dict */
- gf_lock_t mountlock;
+ /* Used to protect the mountlist & the mount dict */
+ gf_lock_t mountlock;
- /* Used to insert additional authentication parameters */
- struct mnt3_auth_params *auth_params;
+ /* Used to insert additional authentication parameters */
+ struct mnt3_auth_params *auth_params;
- /* Set to 0 if exporting full volumes is disabled. On by default. */
- gf_boolean_t export_volumes;
- gf_boolean_t export_dirs;
+ /* Set to 0 if exporting full volumes is disabled. On by default. */
+ gf_boolean_t export_volumes;
+ gf_boolean_t export_dirs;
- pthread_t auth_refresh_thread;
- gf_boolean_t stop_refresh;
+ pthread_t auth_refresh_thread;
+ gf_boolean_t stop_refresh;
- struct auth_cache *authcache;
+ struct auth_cache *authcache;
};
-#define gf_mnt3_export_dirs(mst) ((mst)->export_dirs)
+#define gf_mnt3_export_dirs(mst) ((mst)->export_dirs)
struct mount3_resolve_state {
- struct mnt3_export *exp;
- struct mount3_state *mstate;
- rpcsvc_request_t *req;
+ struct mnt3_export *exp;
+ struct mount3_state *mstate;
+ rpcsvc_request_t *req;
- char remainingdir[MNTPATHLEN];
- loc_t resolveloc;
- struct nfs3_fh parentfh;
+ char remainingdir[MNTPATHLEN];
+ loc_t resolveloc;
+ struct nfs3_fh parentfh;
};
typedef struct mount3_resolve_state mnt3_resolve_t;
int
-mnt3_parse_dir_exports (rpcsvc_request_t *req, struct mount3_state *ms,
- char *subdir, gf_boolean_t send_reply);
+mnt3_parse_dir_exports(rpcsvc_request_t *req, struct mount3_state *ms,
+ char *subdir, gf_boolean_t send_reply);
-char*
-mnt3_get_volume_subdir (char *path, char **volname);
+char *
+mnt3_get_volume_subdir(char *path, char **volname);
#endif
diff --git a/xlators/nfs/server/src/netgroups.h b/xlators/nfs/server/src/netgroups.h
index 6044abfabb3..1bb666b9596 100644
--- a/xlators/nfs/server/src/netgroups.h
+++ b/xlators/nfs/server/src/netgroups.h
@@ -19,36 +19,35 @@
#include "dict.h"
#include "nfs.h"
-#define GF_NG GF_NFS"-netgroup"
+#define GF_NG GF_NFS "-netgroup"
#define NG_FILE_PARSE_REGEX "([a-zA-Z0-9.(,)-]+)"
#define NG_HOST_PARSE_REGEX "([a-zA-Z0-9.-]+)"
struct netgroup_host {
- char *hostname; /* Hostname of entry */
- char *user; /* User field in the entry */
- char *domain; /* Domain field in the entry */
+ char *hostname; /* Hostname of entry */
+ char *user; /* User field in the entry */
+ char *domain; /* Domain field in the entry */
};
struct netgroup_entry {
- char *netgroup_name; /* Name of the netgroup */
- dict_t *netgroup_ngs; /* Dict of netgroups in this netgroup */
- dict_t *netgroup_hosts; /* Dict of hosts in this netgroup. */
+ char *netgroup_name; /* Name of the netgroup */
+ dict_t *netgroup_ngs; /* Dict of netgroups in this netgroup */
+ dict_t *netgroup_hosts; /* Dict of hosts in this netgroup. */
};
struct netgroups_file {
- char *filename; /* Filename on disk */
- dict_t *ng_file_dict; /* Dict of netgroup entries */
+ char *filename; /* Filename on disk */
+ dict_t *ng_file_dict; /* Dict of netgroup entries */
};
struct netgroups_file *
-ng_file_parse (const char *filepath);
+ng_file_parse(const char *filepath);
struct netgroup_entry *
-ng_file_get_netgroup (const struct netgroups_file *ngfile,
- const char *netgroup);
+ng_file_get_netgroup(const struct netgroups_file *ngfile, const char *netgroup);
void
-ng_file_deinit (struct netgroups_file *ngfile);
+ng_file_deinit(struct netgroups_file *ngfile);
#endif /* _NETGROUPS_H */
diff --git a/xlators/nfs/server/src/nfs-common.h b/xlators/nfs/server/src/nfs-common.h
index 8c9a1e33457..46147757ef5 100644
--- a/xlators/nfs/server/src/nfs-common.h
+++ b/xlators/nfs/server/src/nfs-common.h
@@ -18,57 +18,56 @@
#include "iatt.h"
#include "compat-uuid.h"
-//NFS_PATH_MAX hard-coded to 4096 as a work around for bug 2476.
-//nfs server crashes when path received is longer than PATH_MAX
-#define NFS_PATH_MAX 4096
-#define NFS_NAME_MAX NAME_MAX
+// NFS_PATH_MAX hard-coded to 4096 as a work around for bug 2476.
+// nfs server crashes when path received is longer than PATH_MAX
+#define NFS_PATH_MAX 4096
+#define NFS_NAME_MAX NAME_MAX
#define NFS_DEFAULT_CREATE_MODE 0600
extern xlator_t *
-nfs_xlid_to_xlator (xlator_list_t *cl, uint8_t xlid);
+nfs_xlid_to_xlator(xlator_list_t *cl, uint8_t xlid);
extern uint16_t
-nfs_xlator_to_xlid (xlator_list_t *cl, xlator_t *xl);
+nfs_xlator_to_xlid(xlator_list_t *cl, xlator_t *xl);
extern xlator_t *
-nfs_path_to_xlator (xlator_list_t *cl, char *path);
+nfs_path_to_xlator(xlator_list_t *cl, char *path);
extern xlator_t *
-nfs_mntpath_to_xlator (xlator_list_t *cl, char *path);
+nfs_mntpath_to_xlator(xlator_list_t *cl, char *path);
extern void
-nfs_loc_wipe (loc_t *loc);
+nfs_loc_wipe(loc_t *loc);
extern int
-nfs_loc_copy (loc_t *dst, loc_t *src);
+nfs_loc_copy(loc_t *dst, loc_t *src);
extern int
-nfs_loc_fill (loc_t *loc, inode_t *inode, inode_t *parent, char *path);
+nfs_loc_fill(loc_t *loc, inode_t *inode, inode_t *parent, char *path);
-#define NFS_RESOLVE_EXIST 1
-#define NFS_RESOLVE_CREATE 2
+#define NFS_RESOLVE_EXIST 1
+#define NFS_RESOLVE_CREATE 2
extern int
-nfs_inode_loc_fill (inode_t *inode, loc_t *loc, int how);
+nfs_inode_loc_fill(inode_t *inode, loc_t *loc, int how);
extern int
-nfs_ino_loc_fill (inode_table_t *itable, uuid_t gfid, loc_t *l);
+nfs_ino_loc_fill(inode_table_t *itable, uuid_t gfid, loc_t *l);
extern int
-nfs_entry_loc_fill (xlator_t *this, inode_table_t *itable, uuid_t pargfid,
- char *entry, loc_t *loc, int how,
- gf_boolean_t *freshlookup);
+nfs_entry_loc_fill(xlator_t *this, inode_table_t *itable, uuid_t pargfid,
+ char *entry, loc_t *loc, int how, gf_boolean_t *freshlookup);
extern int
-nfs_root_loc_fill (inode_table_t *itable, loc_t *loc);
+nfs_root_loc_fill(inode_table_t *itable, loc_t *loc);
extern uint32_t
-nfs_hash_gfid (uuid_t gfid);
+nfs_hash_gfid(uuid_t gfid);
extern int
-nfs_gfid_loc_fill (inode_table_t *itable, uuid_t gfid, loc_t *loc, int how);
+nfs_gfid_loc_fill(inode_table_t *itable, uuid_t gfid, loc_t *loc, int how);
void
-nfs_fix_generation (xlator_t *this, inode_t *inode);
+nfs_fix_generation(xlator_t *this, inode_t *inode);
#endif
diff --git a/xlators/nfs/server/src/nfs-fops.h b/xlators/nfs/server/src/nfs-fops.h
index acf81e2ce12..1f7c3b2d1f9 100644
--- a/xlators/nfs/server/src/nfs-fops.h
+++ b/xlators/nfs/server/src/nfs-fops.h
@@ -38,207 +38,205 @@
* That is initiated in nfs_init_subvolumes in nfs.c.
*/
struct nfs_fop_local {
- /* The local sent along by the user of the fop. */
- void *proglocal;
-
- /* The address of the callback supplied by the user. After our
- * callback is executed this one is called.
- * The exact cast destination of this pointer will depend on the
- * fop that is being called.
- */
- void *progcbk;
-
- /* Used only for write requests. */
- struct iobref *iobref;
-
- inode_t *parent;
- inode_t *newparent;
- inode_t *inode;
-
- /* Set to 1 by nfs-inodes layer, which uses this to decide whether to
- * link the newly allocated inode into the itable, in case the fop was
- * successful.
- */
- int newinode;
-
- /* Used by nfs-fops layer in order to determine whether to funge the
- * ino in a dir's stbuf. This funging of root ino is needed to ensure
- * that the root ino remains 1 even when the NFS server has been
- * restarted. Note that in distribute, a fresh lookup and a revalidate
- * on the root inode returns two different inode numbers and this we
- * need to handle by ourself.
- */
- int rootinode;
-
- /* This member is used to determine whether the new parent of a file
- * being renamed is the root directory. If yes, the ino is funged.
- */
- int newrootinode;
- int newrootparentinode;
-
- /* Determines whether to funge the ino in the post and pre parent
- * stbufs for a file/dir where the parent directory could be the root
- * dir. Needed here because of the same reason as above.
- */
- int rootparentinode;
-
- char path[NFS_NAME_MAX + 1];
- char newpath[NFS_NAME_MAX + 1];
- xlator_t *nfsx;
- dict_t *dictgfid;
-
- fd_t *fd;
- int cmd;
- struct gf_flock flock;
+ /* The local sent along by the user of the fop. */
+ void *proglocal;
+
+ /* The address of the callback supplied by the user. After our
+ * callback is executed this one is called.
+ * The exact cast destination of this pointer will depend on the
+ * fop that is being called.
+ */
+ void *progcbk;
+
+ /* Used only for write requests. */
+ struct iobref *iobref;
+
+ inode_t *parent;
+ inode_t *newparent;
+ inode_t *inode;
+
+ /* Set to 1 by nfs-inodes layer, which uses this to decide whether to
+ * link the newly allocated inode into the itable, in case the fop was
+ * successful.
+ */
+ int newinode;
+
+ /* Used by nfs-fops layer in order to determine whether to funge the
+ * ino in a dir's stbuf. This funging of root ino is needed to ensure
+ * that the root ino remains 1 even when the NFS server has been
+ * restarted. Note that in distribute, a fresh lookup and a revalidate
+ * on the root inode returns two different inode numbers and this we
+ * need to handle by ourself.
+ */
+ int rootinode;
+
+ /* This member is used to determine whether the new parent of a file
+ * being renamed is the root directory. If yes, the ino is funged.
+ */
+ int newrootinode;
+ int newrootparentinode;
+
+ /* Determines whether to funge the ino in the post and pre parent
+ * stbufs for a file/dir where the parent directory could be the root
+ * dir. Needed here because of the same reason as above.
+ */
+ int rootparentinode;
+
+ char path[NFS_NAME_MAX + 1];
+ char newpath[NFS_NAME_MAX + 1];
+ xlator_t *nfsx;
+ dict_t *dictgfid;
+
+ fd_t *fd;
+ int cmd;
+ struct gf_flock flock;
};
extern struct nfs_fop_local *
-nfs_fop_local_init (xlator_t *xl);
+nfs_fop_local_init(xlator_t *xl);
extern void
-nfs_fop_local_wipe (xlator_t *xl, struct nfs_fop_local *l);
-
-#define nfs_state(nfsxl) (nfsxl)->private
-#define nfs_fop_mempool(nfxl) (((struct nfs_state *)nfs_state(nfxl))->foppool)
-
-#define prog_data_to_nfl(nf,nflocal, fram, pcbk, plocal) \
- do { \
- nflocal = nfs_fop_local_init (nf); \
- if (nflocal) { \
- nflocal->proglocal = plocal; \
- nflocal->progcbk = *VOID(&pcbk); \
- nflocal->nfsx = nf; \
- if (fram) \
- ((call_frame_t *)fram)->local = nflocal;\
- } \
- } while (0) \
-
-
-
-#define nfl_to_prog_data(nflocal, pcbk, fram) \
- do { \
- nflocal = fram->local; \
- fram->local = nflocal->proglocal; \
- pcbk = nflocal->progcbk; \
- } while (0) \
-
-#define nfs_fop_handle_local_init(fram,nfx, nfloc, cbck,prgloc,retval,lab) \
- do { \
- prog_data_to_nfl (nfx, nfloc, fram, cbck, prgloc); \
- if (!nfloc) { \
- gf_msg (GF_NFS, GF_LOG_ERROR, ENOMEM, \
- NFS_MSG_NO_MEMORY, "Failed to init local"); \
- retval = -ENOMEM; \
- goto lab; \
- } \
- } while (0) \
-
-extern int
-nfs_fop_fstat (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, fd_t *fd,
- fop_stat_cbk_t cbk, void *local);
+nfs_fop_local_wipe(xlator_t *xl, struct nfs_fop_local *l);
+
+#define nfs_state(nfsxl) (nfsxl)->private
+#define nfs_fop_mempool(nfxl) (((struct nfs_state *)nfs_state(nfxl))->foppool)
+
+#define prog_data_to_nfl(nf, nflocal, fram, pcbk, plocal) \
+ do { \
+ nflocal = nfs_fop_local_init(nf); \
+ if (nflocal) { \
+ nflocal->proglocal = plocal; \
+ nflocal->progcbk = *VOID(&pcbk); \
+ nflocal->nfsx = nf; \
+ if (fram) \
+ ((call_frame_t *)fram)->local = nflocal; \
+ } \
+ } while (0)
+
+#define nfl_to_prog_data(nflocal, pcbk, fram) \
+ do { \
+ nflocal = fram->local; \
+ fram->local = nflocal->proglocal; \
+ pcbk = nflocal->progcbk; \
+ } while (0)
+
+#define nfs_fop_handle_local_init(fram, nfx, nfloc, cbck, prgloc, retval, lab) \
+ do { \
+ prog_data_to_nfl(nfx, nfloc, fram, cbck, prgloc); \
+ if (!nfloc) { \
+ gf_msg(GF_NFS, GF_LOG_ERROR, ENOMEM, NFS_MSG_NO_MEMORY, \
+ "Failed to init local"); \
+ retval = -ENOMEM; \
+ goto lab; \
+ } \
+ } while (0)
+
+extern int
+nfs_fop_fstat(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, fd_t *fd,
+ fop_stat_cbk_t cbk, void *local);
extern int
-nfs_fop_readdirp (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, fd_t *dirfd,
- size_t bufsize, off_t offset, fop_readdir_cbk_t cbk,
- void *local);
+nfs_fop_readdirp(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, fd_t *dirfd,
+ size_t bufsize, off_t offset, fop_readdir_cbk_t cbk,
+ void *local);
extern int
-nfs_fop_lookup (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *loc,
- fop_lookup_cbk_t cbk, void *local);
+nfs_fop_lookup(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *loc,
+ fop_lookup_cbk_t cbk, void *local);
extern int
-nfs_fop_create (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
- int flags, mode_t mode, fd_t *fd, fop_create_cbk_t cbk,
- void *local);
+nfs_fop_create(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
+ int flags, mode_t mode, fd_t *fd, fop_create_cbk_t cbk,
+ void *local);
extern int
-nfs_fop_flush (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, fd_t *fd,
- fop_flush_cbk_t cbk, void *local);
+nfs_fop_flush(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, fd_t *fd,
+ fop_flush_cbk_t cbk, void *local);
extern int
-nfs_fop_mkdir (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
- mode_t mode, fop_mkdir_cbk_t cbk, void *local);
+nfs_fop_mkdir(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
+ mode_t mode, fop_mkdir_cbk_t cbk, void *local);
extern int
-nfs_fop_truncate (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *loc,
- off_t offset, fop_truncate_cbk_t cbk, void *local);
+nfs_fop_truncate(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *loc,
+ off_t offset, fop_truncate_cbk_t cbk, void *local);
extern int
-nfs_fop_read (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, fd_t *fd,
- size_t size, off_t offset, fop_readv_cbk_t cbk, void *local);
+nfs_fop_read(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, fd_t *fd,
+ size_t size, off_t offset, fop_readv_cbk_t cbk, void *local);
extern int
-nfs_fop_fsync (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, fd_t *fd,
- int32_t datasync, fop_fsync_cbk_t cbk, void *local);
+nfs_fop_fsync(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, fd_t *fd,
+ int32_t datasync, fop_fsync_cbk_t cbk, void *local);
extern int
-nfs_fop_write (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, fd_t *fd,
- struct iobref *srciobref, struct iovec *vector, int32_t count,
- off_t offset, fop_writev_cbk_t cbk, void *local);
+nfs_fop_write(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, fd_t *fd,
+ struct iobref *srciobref, struct iovec *vector, int32_t count,
+ off_t offset, fop_writev_cbk_t cbk, void *local);
extern int
-nfs_fop_open (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *loc,
- int32_t flags, fd_t *fd, fop_open_cbk_t cbk,
- void *local);
+nfs_fop_open(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *loc,
+ int32_t flags, fd_t *fd, fop_open_cbk_t cbk, void *local);
extern int
-nfs_fop_rename (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *oldloc,
- loc_t *newloc, fop_rename_cbk_t cbk, void *local);
+nfs_fop_rename(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *oldloc,
+ loc_t *newloc, fop_rename_cbk_t cbk, void *local);
extern int
-nfs_fop_link (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *oldloc,
- loc_t *newloc, fop_link_cbk_t cbk, void *local);
+nfs_fop_link(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *oldloc,
+ loc_t *newloc, fop_link_cbk_t cbk, void *local);
extern int
-nfs_fop_unlink (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
- fop_unlink_cbk_t cbk, void *local);
+nfs_fop_unlink(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
+ fop_unlink_cbk_t cbk, void *local);
extern int
-nfs_fop_rmdir (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
- fop_rmdir_cbk_t cbk, void *local);
+nfs_fop_rmdir(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
+ fop_rmdir_cbk_t cbk, void *local);
extern int
-nfs_fop_mknod (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
- mode_t mode, dev_t dev, fop_mknod_cbk_t cbk, void *local);
+nfs_fop_mknod(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
+ mode_t mode, dev_t dev, fop_mknod_cbk_t cbk, void *local);
extern int
-nfs_fop_readlink (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
- size_t size, fop_readlink_cbk_t cbk, void *local);
+nfs_fop_readlink(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
+ size_t size, fop_readlink_cbk_t cbk, void *local);
extern int
-nfs_fop_symlink (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, char *target,
- loc_t *pathloc, fop_symlink_cbk_t cbk, void *local);
+nfs_fop_symlink(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, char *target,
+ loc_t *pathloc, fop_symlink_cbk_t cbk, void *local);
extern int
-nfs_fop_setattr (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
- struct iatt *buf, int32_t valid, fop_setattr_cbk_t cbk,
- void *local);
+nfs_fop_setattr(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
+ struct iatt *buf, int32_t valid, fop_setattr_cbk_t cbk,
+ void *local);
extern int
-nfs_fop_statfs (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
- fop_statfs_cbk_t cbk, void *local);
+nfs_fop_statfs(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
+ fop_statfs_cbk_t cbk, void *local);
extern int
-nfs_fop_opendir (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
- fd_t *dirfd, fop_opendir_cbk_t cbk, void *local);
+nfs_fop_opendir(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
+ fd_t *dirfd, fop_opendir_cbk_t cbk, void *local);
extern int
-nfs_fop_stat (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *loc,
- fop_stat_cbk_t cbk, void *local);
+nfs_fop_stat(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *loc,
+ fop_stat_cbk_t cbk, void *local);
extern int
-nfs_fop_access (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *loc,
- int32_t accesstest, fop_access_cbk_t cbk, void *local);
+nfs_fop_access(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *loc,
+ int32_t accesstest, fop_access_cbk_t cbk, void *local);
extern int
-nfs_fop_lk (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, fd_t *fd,
- int cmd, struct gf_flock *flock, fop_lk_cbk_t cbk, void *local);
+nfs_fop_lk(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, fd_t *fd, int cmd,
+ struct gf_flock *flock, fop_lk_cbk_t cbk, void *local);
extern int
-nfs_fop_getxattr (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *loc,
- char *name, dict_t *xdata, fop_getxattr_cbk_t cbk, void *local);
+nfs_fop_getxattr(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *loc,
+ char *name, dict_t *xdata, fop_getxattr_cbk_t cbk,
+ void *local);
extern int
-nfs_fop_setxattr (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu,
- loc_t *loc, dict_t *dict, int32_t flags, dict_t *xdata,
- fop_setxattr_cbk_t cbk, void *local);
+nfs_fop_setxattr(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *loc,
+ dict_t *dict, int32_t flags, dict_t *xdata,
+ fop_setxattr_cbk_t cbk, void *local);
#endif
diff --git a/xlators/nfs/server/src/nfs-generics.h b/xlators/nfs/server/src/nfs-generics.h
index c3fb4fca339..f71b45a513d 100644
--- a/xlators/nfs/server/src/nfs-generics.h
+++ b/xlators/nfs/server/src/nfs-generics.h
@@ -17,12 +17,12 @@
#include "nfs-inodes.h"
struct nfs_direntcache {
- gf_dirent_t entries; /* Head of list of cached dirents. */
- gf_dirent_t *next; /* Pointer to the next entry that
- * should be sent by readdir */
- uint64_t prev_off; /* Offset where the next read will
- * happen.
- */
+ gf_dirent_t entries; /* Head of list of cached dirents. */
+ gf_dirent_t *next; /* Pointer to the next entry that
+ * should be sent by readdir */
+ uint64_t prev_off; /* Offset where the next read will
+ * happen.
+ */
};
/* WE're trying to abstract the fops interface from the NFS xlator so that
@@ -32,132 +32,130 @@ struct nfs_direntcache {
* state is requires in the fd. E.g. the dirent cache for a directory fd_t.
*/
typedef struct nfs_fop_fdcontext {
- pthread_mutex_t lock;
- size_t dirent_bufsize;
- off_t offset;
- struct nfs_direntcache *dcache;
- xlator_t *dirvol;
+ pthread_mutex_t lock;
+ size_t dirent_bufsize;
+ off_t offset;
+ struct nfs_direntcache *dcache;
+ xlator_t *dirvol;
} nfs_fdctx_t;
extern int
-nfs_fstat (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, fd_t *fd,
- fop_stat_cbk_t cbk, void *local);
+nfs_fstat(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, fd_t *fd,
+ fop_stat_cbk_t cbk, void *local);
extern int
-nfs_readdirp (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, fd_t *dirfd,
- size_t bufsize, off_t offset, fop_readdir_cbk_t cbk, void *local);
-
+nfs_readdirp(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, fd_t *dirfd,
+ size_t bufsize, off_t offset, fop_readdir_cbk_t cbk, void *local);
extern int
-nfs_lookup (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
- fop_lookup_cbk_t cbk, void *local);
+nfs_lookup(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
+ fop_lookup_cbk_t cbk, void *local);
extern int
-nfs_create (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
- int flags, mode_t mode, fop_create_cbk_t cbk, void *local);
+nfs_create(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
+ int flags, mode_t mode, fop_create_cbk_t cbk, void *local);
extern int
-nfs_flush (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, fd_t *fd,
- fop_flush_cbk_t cbk, void *local);
+nfs_flush(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, fd_t *fd,
+ fop_flush_cbk_t cbk, void *local);
extern int
-nfs_mkdir (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
- mode_t mode, fop_mkdir_cbk_t cbk, void *local);
+nfs_mkdir(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
+ mode_t mode, fop_mkdir_cbk_t cbk, void *local);
extern int
-nfs_truncate (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
- off_t offset, fop_truncate_cbk_t cbk, void *local);
+nfs_truncate(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
+ off_t offset, fop_truncate_cbk_t cbk, void *local);
extern int
-nfs_read (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, fd_t *fd, size_t size,
- off_t offset, fop_readv_cbk_t cbk, void *local);
+nfs_read(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, fd_t *fd, size_t size,
+ off_t offset, fop_readv_cbk_t cbk, void *local);
extern int
-nfs_fsync (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, fd_t *fd,
- int32_t datasync, fop_fsync_cbk_t cbk, void *local);
+nfs_fsync(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, fd_t *fd,
+ int32_t datasync, fop_fsync_cbk_t cbk, void *local);
extern int
-nfs_write (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, fd_t *fd,
- struct iobref *srciobref, struct iovec *vector, int32_t count,
- off_t offset, fop_writev_cbk_t cbk, void *local);
+nfs_write(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, fd_t *fd,
+ struct iobref *srciobref, struct iovec *vector, int32_t count,
+ off_t offset, fop_writev_cbk_t cbk, void *local);
extern int
-nfs_open (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
- int32_t flags, fop_open_cbk_t cbk, void *local);
+nfs_open(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
+ int32_t flags, fop_open_cbk_t cbk, void *local);
extern int
-nfs_rename (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *oldloc,
- loc_t *newloc, fop_rename_cbk_t cbk, void *local);
+nfs_rename(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *oldloc,
+ loc_t *newloc, fop_rename_cbk_t cbk, void *local);
extern int
-nfs_link (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *oldloc,
- loc_t *newloc, fop_link_cbk_t cbk, void *local);
+nfs_link(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *oldloc,
+ loc_t *newloc, fop_link_cbk_t cbk, void *local);
extern int
-nfs_unlink (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
- fop_unlink_cbk_t cbk, void *local);
+nfs_unlink(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
+ fop_unlink_cbk_t cbk, void *local);
extern int
-nfs_rmdir (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
- fop_rmdir_cbk_t cbk, void *local);
+nfs_rmdir(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
+ fop_rmdir_cbk_t cbk, void *local);
extern int
-nfs_mknod (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
- mode_t mode, dev_t dev, fop_mknod_cbk_t cbk, void *local);
+nfs_mknod(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
+ mode_t mode, dev_t dev, fop_mknod_cbk_t cbk, void *local);
extern int
-nfs_readlink (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *linkloc,
- fop_readlink_cbk_t cbk, void *local);
+nfs_readlink(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *linkloc,
+ fop_readlink_cbk_t cbk, void *local);
extern int
-nfs_setattr (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
- struct iatt *buf, int32_t valid, fop_setattr_cbk_t cbk,
- void *local);
+nfs_setattr(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
+ struct iatt *buf, int32_t valid, fop_setattr_cbk_t cbk,
+ void *local);
extern int
-nfs_statfs (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
- fop_statfs_cbk_t cbk, void *local);
+nfs_statfs(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
+ fop_statfs_cbk_t cbk, void *local);
extern int
-nfs_stat (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
- fop_stat_cbk_t cbk, void *local);
+nfs_stat(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
+ fop_stat_cbk_t cbk, void *local);
extern int
-nfs_symlink (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, char *target,
- loc_t *linkloc, fop_symlink_cbk_t cbk, void *local);
+nfs_symlink(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, char *target,
+ loc_t *linkloc, fop_symlink_cbk_t cbk, void *local);
/* Synchronous equivalents */
extern call_stub_t *
-nfs_open_sync (xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
- int32_t flags);
+nfs_open_sync(xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc, int32_t flags);
extern call_stub_t *
-nfs_write_sync (xlator_t *xl, nfs_user_t *nfu, fd_t *fd, struct iobuf *srciob,
- struct iovec *vec, int count, off_t offset);
+nfs_write_sync(xlator_t *xl, nfs_user_t *nfu, fd_t *fd, struct iobuf *srciob,
+ struct iovec *vec, int count, off_t offset);
extern call_stub_t *
-nfs_read_sync (xlator_t *xl, nfs_user_t *nfu, fd_t *fd, size_t size,
- off_t offset);
+nfs_read_sync(xlator_t *xl, nfs_user_t *nfu, fd_t *fd, size_t size,
+ off_t offset);
extern int
-nfs_opendir (xlator_t *nfsx, xlator_t *fopxl, nfs_user_t *nfu, loc_t *pathloc,
- fop_opendir_cbk_t cbk, void *local);
+nfs_opendir(xlator_t *nfsx, xlator_t *fopxl, nfs_user_t *nfu, loc_t *pathloc,
+ fop_opendir_cbk_t cbk, void *local);
extern int
-nfs_access (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
- int32_t accesstest, fop_access_cbk_t cbk, void *local);
+nfs_access(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
+ int32_t accesstest, fop_access_cbk_t cbk, void *local);
extern int
-nfs_lk (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, fd_t *fd,
- int cmd, struct gf_flock *flock, fop_lk_cbk_t cbk, void *local);
+nfs_lk(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, fd_t *fd, int cmd,
+ struct gf_flock *flock, fop_lk_cbk_t cbk, void *local);
extern int
-nfs_getxattr (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *loc,
- char *name, dict_t *xdata, fop_getxattr_cbk_t cbk, void *local);
+nfs_getxattr(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *loc,
+ char *name, dict_t *xdata, fop_getxattr_cbk_t cbk, void *local);
extern int
-nfs_setxattr (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu,
- loc_t *loc, dict_t *dict, int32_t flags, dict_t *xdata,
- fop_setxattr_cbk_t cbk, void *local);
+nfs_setxattr(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *loc,
+ dict_t *dict, int32_t flags, dict_t *xdata, fop_setxattr_cbk_t cbk,
+ void *local);
#endif
diff --git a/xlators/nfs/server/src/nfs-inodes.h b/xlators/nfs/server/src/nfs-inodes.h
index 40037fbcbb2..7a874c8a4ce 100644
--- a/xlators/nfs/server/src/nfs-inodes.h
+++ b/xlators/nfs/server/src/nfs-inodes.h
@@ -17,54 +17,51 @@
#include "call-stub.h"
#include "nfs-fops.h"
-
extern int
-nfs_link_inode (inode_t *newi, inode_t *parent, char *name,
- struct iatt *newstat);
+nfs_link_inode(inode_t *newi, inode_t *parent, char *name,
+ struct iatt *newstat);
extern int
-nfs_inode_create (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu,
- loc_t *pathloc, int flags, int mode, fop_create_cbk_t cbk,
- void *local);
+nfs_inode_create(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
+ int flags, int mode, fop_create_cbk_t cbk, void *local);
extern int
-nfs_inode_mkdir (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
- int mode, fop_mkdir_cbk_t cbk, void *local);
+nfs_inode_mkdir(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
+ int mode, fop_mkdir_cbk_t cbk, void *local);
extern int
-nfs_inode_open (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *loc,
- int32_t flags, fop_open_cbk_t cbk,
- void *local);
+nfs_inode_open(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *loc,
+ int32_t flags, fop_open_cbk_t cbk, void *local);
extern int
-nfs_inode_rename (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *oldloc,
- loc_t *newloc, fop_rename_cbk_t cbk, void *local);
+nfs_inode_rename(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *oldloc,
+ loc_t *newloc, fop_rename_cbk_t cbk, void *local);
extern int
-nfs_inode_link (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *oldloc,
- loc_t *newloc, fop_link_cbk_t cbk, void *local);
+nfs_inode_link(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *oldloc,
+ loc_t *newloc, fop_link_cbk_t cbk, void *local);
extern int
-nfs_inode_unlink (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
- fop_unlink_cbk_t cbk, void *local);
+nfs_inode_unlink(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
+ fop_unlink_cbk_t cbk, void *local);
extern int
-nfs_inode_rmdir (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
- fop_rmdir_cbk_t cbk, void *local);
+nfs_inode_rmdir(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
+ fop_rmdir_cbk_t cbk, void *local);
extern int
-nfs_inode_symlink (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, char *target,
- loc_t *pathloc, fop_symlink_cbk_t cbk, void *local);
+nfs_inode_symlink(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, char *target,
+ loc_t *pathloc, fop_symlink_cbk_t cbk, void *local);
extern int
-nfs_inode_opendir (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *loc,
- fop_opendir_cbk_t cbk, void *local);
+nfs_inode_opendir(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *loc,
+ fop_opendir_cbk_t cbk, void *local);
extern int
-nfs_inode_mknod (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
- mode_t mode, dev_t dev, fop_mknod_cbk_t cbk, void *local);
+nfs_inode_mknod(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
+ mode_t mode, dev_t dev, fop_mknod_cbk_t cbk, void *local);
extern int
-nfs_inode_lookup (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
- fop_lookup_cbk_t cbk, void *local);
+nfs_inode_lookup(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc,
+ fop_lookup_cbk_t cbk, void *local);
#endif
diff --git a/xlators/nfs/server/src/nfs-mem-types.h b/xlators/nfs/server/src/nfs-mem-types.h
index 5cac0eb4978..5737aae6a09 100644
--- a/xlators/nfs/server/src/nfs-mem-types.h
+++ b/xlators/nfs/server/src/nfs-mem-types.h
@@ -8,50 +8,48 @@
cases as published by the Free Software Foundation.
*/
-
#ifndef __NFS_MEM_TYPES_H__
#define __NFS_MEM_TYPES_H__
#include "mem-types.h"
enum gf_nfs_mem_types_ {
- gf_nfs_mt_mountentry = gf_common_mt_end + 1,
- gf_nfs_mt_mountbody,
- gf_nfs_mt_nfs_state,
- gf_nfs_mt_char,
- gf_nfs_mt_exportnode,
- gf_nfs_mt_groupnode,
- gf_nfs_mt_mount3_state,
- gf_nfs_mt_write3args,
- gf_nfs_mt_nfs3_export,
- gf_nfs_mt_nfs3_state,
- gf_nfs_mt_entry3,
- gf_nfs_mt_entryp3,
- gf_nfs_mt_nfs3_fd_entry,
- gf_nfs_mt_nfs3_fh,
- gf_nfs_mt_nfs_initer_list,
- gf_nfs_mt_xlator_t,
- gf_nfs_mt_list_head,
- gf_nfs_mt_mnt3_resolve,
- gf_nfs_mt_mnt3_export,
- gf_nfs_mt_mnt3_auth_params,
- gf_nfs_mt_int,
- gf_nfs_mt_mountres3,
- gf_nfs_mt_mountstat3,
- gf_nfs_mt_inode_q,
- gf_nfs_mt_nlm4_state,
- gf_nfs_mt_nlm4_cm,
- gf_nfs_mt_nlm4_fde,
- gf_nfs_mt_nlm4_nlmclnt,
- gf_nfs_mt_nlm4_share,
- gf_nfs_mt_aux_gids,
- gf_nfs_mt_inode_ctx,
- gf_nfs_mt_auth_spec,
- gf_nfs_mt_arr,
- gf_nfs_mt_auth_cache,
- gf_nfs_mt_auth_cache_entry,
- gf_nfs_mt_nlm4_notify,
- gf_nfs_mt_end
+ gf_nfs_mt_mountentry = gf_common_mt_end + 1,
+ gf_nfs_mt_mountbody,
+ gf_nfs_mt_nfs_state,
+ gf_nfs_mt_char,
+ gf_nfs_mt_exportnode,
+ gf_nfs_mt_groupnode,
+ gf_nfs_mt_mount3_state,
+ gf_nfs_mt_write3args,
+ gf_nfs_mt_nfs3_export,
+ gf_nfs_mt_nfs3_state,
+ gf_nfs_mt_entry3,
+ gf_nfs_mt_entryp3,
+ gf_nfs_mt_nfs3_fd_entry,
+ gf_nfs_mt_nfs3_fh,
+ gf_nfs_mt_nfs_initer_list,
+ gf_nfs_mt_xlator_t,
+ gf_nfs_mt_list_head,
+ gf_nfs_mt_mnt3_resolve,
+ gf_nfs_mt_mnt3_export,
+ gf_nfs_mt_mnt3_auth_params,
+ gf_nfs_mt_int,
+ gf_nfs_mt_mountres3,
+ gf_nfs_mt_mountstat3,
+ gf_nfs_mt_inode_q,
+ gf_nfs_mt_nlm4_state,
+ gf_nfs_mt_nlm4_cm,
+ gf_nfs_mt_nlm4_fde,
+ gf_nfs_mt_nlm4_nlmclnt,
+ gf_nfs_mt_nlm4_share,
+ gf_nfs_mt_aux_gids,
+ gf_nfs_mt_inode_ctx,
+ gf_nfs_mt_auth_spec,
+ gf_nfs_mt_arr,
+ gf_nfs_mt_auth_cache,
+ gf_nfs_mt_auth_cache_entry,
+ gf_nfs_mt_nlm4_notify,
+ gf_nfs_mt_end
};
#endif
-
diff --git a/xlators/nfs/server/src/nfs-messages.h b/xlators/nfs/server/src/nfs-messages.h
index 919fb5eb1d1..b8fe99e45d3 100644
--- a/xlators/nfs/server/src/nfs-messages.h
+++ b/xlators/nfs/server/src/nfs-messages.h
@@ -22,210 +22,81 @@
* glfs-message-id.h.
*/
-GLFS_MSGID(NFS,
- NFS_MSG_UNUSED_1,
- NFS_MSG_UNUSED_2,
- NFS_MSG_INVALID_ENTRY,
- NFS_MSG_INODE_LOC_FILL_ERROR,
- NFS_MSG_HARD_RESOLVE_FAIL,
- NFS_MSG_ARGS_DECODE_ERROR,
- NFS_MSG_LOOKUP_PROC_FAIL,
- NFS_MSG_UNUSED_8,
- NFS_MSG_UNUSED_9,
- NFS_MSG_READLINK_PROC_FAIL,
- NFS_MSG_UNUSED_11,
- NFS_MSG_ANONYMOUS_FD_FAIL,
- NFS_MSG_READ_FAIL,
- NFS_MSG_UNUSED_14,
- NFS_MSG_UNUSED_15,
- NFS_MSG_STATE_WRONG,
- NFS_MSG_WRITE_FAIL,
- NFS_MSG_UNUSED_18,
- NFS_MSG_UNUSED_19,
- NFS_MSG_UNUSED_20,
- NFS_MSG_CREATE_FAIL,
- NFS_MSG_UNUSED_22,
- NFS_MSG_UNUSED_23,
- NFS_MSG_DIR_OP_FAIL,
- NFS_MSG_UNUSED_25,
- NFS_MSG_SYMLINK_FAIL,
- NFS_MSG_UNUSED_27,
- NFS_MSG_MKNOD_FAIL,
- NFS_MSG_OPT_INIT_FAIL,
- NFS_MSG_UNUSED_30,
- NFS_MSG_REMOVE_FAIL,
- NFS_MSG_RMDIR_CBK,
- NFS_MSG_UNUSED_33,
- NFS_MSG_RENAME_FAIL,
- NFS_MSG_UNUSED_35,
- NFS_MSG_LINK_FAIL,
- NFS_MSG_UNUSED_37,
- NFS_MSG_UNUSED_38,
- NFS_MSG_READDIR_FAIL,
- NFS_MSG_READDIRP_FAIL,
- NFS_MSG_UNUSED_41,
- NFS_MSG_UNUSED_42,
- NFS_MSG_FSTAT_FAIL,
- NFS_MSG_UNUSED_44,
- NFS_MSG_FSINFO_FAIL,
- NFS_MSG_UNUSED_46,
- NFS_MSG_PATHCONF_FAIL,
- NFS_MSG_UNUSED_48,
- NFS_MSG_COMMIT_FAIL,
- NFS_MSG_PROT_INIT_ADD_FAIL,
- NFS_MSG_FORMAT_FAIL,
- NFS_MSG_SNPRINTF_FAIL,
- NFS_MSG_VOLID_MISSING,
- NFS_MSG_PARSE_VOL_UUID_FAIL,
- NFS_MSG_STR2BOOL_FAIL,
- NFS_MSG_SUBVOL_INIT_FAIL,
- NFS_MSG_NO_MEMORY,
- NFS_MSG_LISTENERS_CREATE_FAIL,
- NFS_MSG_STATE_INIT_FAIL,
- NFS_MSG_RECONF_FAIL,
- NFS_MSG_RECONF_SUBVOL_FAIL,
- NFS_MSG_STR_TOO_LONG,
- NFS_MSG_STATE_MISSING,
- NFS_MSG_INDEX_NOT_FOUND,
- NFS_MSG_EXPORT_ID_FAIL,
- NFS_MSG_NO_RW_ACCESS,
- NFS_MSG_BAD_HANDLE,
- NFS_MSG_RESOLVE_FH_FAIL,
- NFS_MSG_RESOLVE_STAT,
- NFS_MSG_VOL_DISABLE,
- NFS_MSG_INIT_CALL_STAT_FAIL,
- NFS_MSG_ENCODE_FAIL,
- NFS_MSG_SERIALIZE_REPLY_FAIL,
- NFS_MSG_SUBMIT_REPLY_FAIL,
- NFS_MSG_UNUSED_75,
- NFS_MSG_UNUSED_76,
- NFS_MSG_STAT_FOP_FAIL,
- NFS_MSG_GETATTR_FAIL,
- NFS_MSG_UNUSED_79,
- NFS_MSG_UNUSED_80,
- NFS_MSG_TIMESTAMP_NO_SYNC,
- NFS_MSG_SETATTR_INVALID,
- NFS_MSG_SETATTR_FAIL,
- NFS_MSG_UNUSED_84,
- NFS_MSG_ACCESS_PROC_FAIL,
- NFS_MSG_PGM_NOT_FOUND,
- NFS_MSG_PGM_INIT_FAIL,
- NFS_MSG_PGM_REG_FAIL,
- NFS_MSG_LOOKUP_ROOT_FAIL,
- NFS_MSG_ROOT_LOC_INIT_FAIL,
- NFS_MSG_STARTUP_FAIL,
- NFS_MSG_XLATOR_INIT_FAIL,
- NFS_MSG_NFS_MAN_DISABLE,
- NFS_MSG_DICT_GET_FAILED,
- NFS_MSG_PARSE_FAIL,
- NFS_MSG_NLM_MAN_DISABLE,
- NFS_MSG_ACL_MAN_DISABLE,
- NFS_MSG_DICT_SET_FAILED,
- NFS_MSG_INIT_GRP_CACHE_FAIL,
- NFS_MSG_NO_PERM,
- NFS_MSG_REG_FILE_ERROR,
- NFS_MSG_RPC_INIT_FAIL,
- NFS_MSG_RPC_CONFIG_FAIL,
- NFS_MSG_RECONFIG_PATH,
- NFS_MSG_RECONFIG_VALUE,
- NFS_MSG_RECONFIG_VOL,
- NFS_MSG_NLM_INFO,
- NFS_MSG_ACL_INFO,
- NFS_MSG_INIT_FAIL,
- NFS_MSG_STARTED,
- NFS_MSG_VOL_NOT_FOUND,
- NFS_MSG_RECONFIG_ENABLE,
- NFS_MSG_RECONFIG_FAIL,
- NFS_MSG_MNT_STATE_NOT_FOUND,
- NFS_MSG_ENCODE_MSG_FAIL,
- NFS_MSG_REP_SUBMIT_FAIL,
- NFS_MSG_READ_LOCKED,
- NFS_MSG_MODIFY_LOCKED,
- NFS_MSG_RWTAB_OVERWRITE_FAIL,
- NFS_MSG_UPDATE_FAIL,
- NFS_MSG_OPEN_FAIL,
- NFS_MSG_LOCK_FAIL,
- NFS_MSG_REWRITE_ERROR,
- NFS_MSG_HASH_PATH_FAIL,
- NFS_MSG_LOOKUP_MNT_ERROR,
- NFS_MSG_GET_ROOT_INODE_FAIL,
- NFS_MSG_RESOLVE_INODE_FAIL,
- NFS_MSG_RESOLVE_SUBDIR_FAIL,
- NFS_MSG_RESOLVE_SYMLINK_ERROR,
- NFS_MSG_RESOLVE_ERROR,
- NFS_MSG_UNSUPPORTED_VERSION,
- NFS_MSG_AUTH_VERIFY_FAILED,
- NFS_MSG_PEER_NOT_ALLOWED,
- NFS_MSG_GET_PEER_ADDR_FAIL,
- NFS_MSG_BAD_PEER,
- NFS_MSG_PEER_TOO_LONG,
- NFS_MSG_CALLER_NOT_FOUND,
- NFS_MSG_GET_REMOTE_NAME_FAIL,
- NFS_MSG_UNKNOWN_MNT_TYPE,
- NFS_MSG_PARSE_HOSTSPEC_FAIL,
- NFS_MSG_PARSE_AUTH_PARAM_FAIL,
- NFS_MSG_SET_EXP_FAIL,
- NFS_MSG_INIT_DIR_EXP_FAIL,
- NFS_MSG_DIR_EXP_SETUP_FAIL,
- NFS_MSG_VOL_INIT_FAIL,
- NFS_MSG_AUTH_ERROR,
- NFS_MSG_UPDATING_EXP,
- NFS_MSG_SET_EXP_AUTH_PARAM_FAIL,
- NFS_MSG_UPDATING_NET_GRP,
- NFS_MSG_SET_NET_GRP_FAIL,
- NFS_MSG_PURGING_AUTH_CACHE,
- NFS_MSG_MNT_STATE_INIT_FAIL,
- NFS_MSG_EXP_AUTH_DISABLED,
- NFS_MSG_FH_TO_VOL_FAIL,
- NFS_MSG_INODE_SHARES_NOT_FOUND,
- NFS_MSG_VOLUME_ERROR,
- NFS_MSG_GET_USER_ACL_FAIL,
- NFS_MSG_GET_DEF_ACL_FAIL,
- NFS_MSG_SET_USER_ACL_FAIL,
- NFS_MSG_SET_DEF_ACL_FAIL,
- NFS_MSG_ACL_INIT_FAIL,
- NFS_MSG_LOAD_PARSE_ERROR,
- NFS_MSG_CLNT_CALL_ERROR,
- NFS_MSG_CLNT_CREATE_ERROR,
- NFS_MSG_NLM_GRACE_PERIOD,
- NFS_MSG_RPC_CLNT_ERROR,
- NFS_MSG_GET_PORT_ERROR,
- NFS_MSG_NLMCLNT_NOT_FOUND,
- NFS_MSG_FD_LOOKUP_NULL,
- NFS_MSG_SM_NOTIFY,
- NFS_MSG_NLM_INIT_FAIL,
- NFS_MSG_START_ERROR,
- NFS_MSG_UNLINK_ERROR,
- NFS_MSG_SHARE_LIST_STORE_FAIL,
- NFS_MSG_CLIENT_NOT_FOUND,
- NFS_MSG_SHARE_CALL_FAIL,
- NFS_MSG_UNSHARE_CALL_FAIL,
- NFS_MSG_GET_PID_FAIL,
- NFS_MSG_ARG_FREE_FAIL,
- NFS_MSG_PMAP_UNSET_FAIL,
- NFS_MSG_UDP_SERV_FAIL,
- NFS_MSG_REG_NLMCBK_FAIL,
- NFS_MSG_TCP_SERV_FAIL,
- NFS_MSG_SVC_RUN_RETURNED,
- NFS_MSG_XLATOR_SET_FAIL,
- NFS_MSG_SVC_ERROR,
- NFS_MSG_GET_FH_FAIL,
- NFS_MSG_FIND_FIRST_MATCH_FAIL,
- NFS_MSG_NETGRP_NOT_FOUND,
- NFS_MSG_FILE_OP_FAILED,
- NFS_MSG_PATH_RESOLVE_FAIL,
- NFS_MSG_LOC_FILL_RESOLVE_FAIL,
- NFS_MSG_INODE_NOT_FOUND,
- NFS_MSG_INODE_CTX_STORE_FAIL,
- NFS_MSG_GETPWUID_FAIL,
- NFS_MSG_MAP_GRP_LIST_FAIL,
- NFS_MSG_PARSE_DIR_FAIL,
- NFS_MSG_LOOKUP_FAIL,
- NFS_MSG_STAT_ERROR,
- NFS_MSG_GFID_DICT_CREATE_FAIL,
- NFS_MSG_HASH_XLATOR_FAIL,
- NFS_MSG_ENABLE_THROTTLE_FAIL
-);
+GLFS_MSGID(
+ NFS, NFS_MSG_UNUSED_1, NFS_MSG_UNUSED_2, NFS_MSG_INVALID_ENTRY,
+ NFS_MSG_INODE_LOC_FILL_ERROR, NFS_MSG_HARD_RESOLVE_FAIL,
+ NFS_MSG_ARGS_DECODE_ERROR, NFS_MSG_LOOKUP_PROC_FAIL, NFS_MSG_UNUSED_8,
+ NFS_MSG_UNUSED_9, NFS_MSG_READLINK_PROC_FAIL, NFS_MSG_UNUSED_11,
+ NFS_MSG_ANONYMOUS_FD_FAIL, NFS_MSG_READ_FAIL, NFS_MSG_UNUSED_14,
+ NFS_MSG_UNUSED_15, NFS_MSG_STATE_WRONG, NFS_MSG_WRITE_FAIL,
+ NFS_MSG_UNUSED_18, NFS_MSG_UNUSED_19, NFS_MSG_UNUSED_20,
+ NFS_MSG_CREATE_FAIL, NFS_MSG_UNUSED_22, NFS_MSG_UNUSED_23,
+ NFS_MSG_DIR_OP_FAIL, NFS_MSG_UNUSED_25, NFS_MSG_SYMLINK_FAIL,
+ NFS_MSG_UNUSED_27, NFS_MSG_MKNOD_FAIL, NFS_MSG_OPT_INIT_FAIL,
+ NFS_MSG_UNUSED_30, NFS_MSG_REMOVE_FAIL, NFS_MSG_RMDIR_CBK,
+ NFS_MSG_UNUSED_33, NFS_MSG_RENAME_FAIL, NFS_MSG_UNUSED_35,
+ NFS_MSG_LINK_FAIL, NFS_MSG_UNUSED_37, NFS_MSG_UNUSED_38,
+ NFS_MSG_READDIR_FAIL, NFS_MSG_READDIRP_FAIL, NFS_MSG_UNUSED_41,
+ NFS_MSG_UNUSED_42, NFS_MSG_FSTAT_FAIL, NFS_MSG_UNUSED_44,
+ NFS_MSG_FSINFO_FAIL, NFS_MSG_UNUSED_46, NFS_MSG_PATHCONF_FAIL,
+ NFS_MSG_UNUSED_48, NFS_MSG_COMMIT_FAIL, NFS_MSG_PROT_INIT_ADD_FAIL,
+ NFS_MSG_FORMAT_FAIL, NFS_MSG_SNPRINTF_FAIL, NFS_MSG_VOLID_MISSING,
+ NFS_MSG_PARSE_VOL_UUID_FAIL, NFS_MSG_STR2BOOL_FAIL,
+ NFS_MSG_SUBVOL_INIT_FAIL, NFS_MSG_NO_MEMORY, NFS_MSG_LISTENERS_CREATE_FAIL,
+ NFS_MSG_STATE_INIT_FAIL, NFS_MSG_RECONF_FAIL, NFS_MSG_RECONF_SUBVOL_FAIL,
+ NFS_MSG_STR_TOO_LONG, NFS_MSG_STATE_MISSING, NFS_MSG_INDEX_NOT_FOUND,
+ NFS_MSG_EXPORT_ID_FAIL, NFS_MSG_NO_RW_ACCESS, NFS_MSG_BAD_HANDLE,
+ NFS_MSG_RESOLVE_FH_FAIL, NFS_MSG_RESOLVE_STAT, NFS_MSG_VOL_DISABLE,
+ NFS_MSG_INIT_CALL_STAT_FAIL, NFS_MSG_ENCODE_FAIL,
+ NFS_MSG_SERIALIZE_REPLY_FAIL, NFS_MSG_SUBMIT_REPLY_FAIL, NFS_MSG_UNUSED_75,
+ NFS_MSG_UNUSED_76, NFS_MSG_STAT_FOP_FAIL, NFS_MSG_GETATTR_FAIL,
+ NFS_MSG_UNUSED_79, NFS_MSG_UNUSED_80, NFS_MSG_TIMESTAMP_NO_SYNC,
+ NFS_MSG_SETATTR_INVALID, NFS_MSG_SETATTR_FAIL, NFS_MSG_UNUSED_84,
+ NFS_MSG_ACCESS_PROC_FAIL, NFS_MSG_PGM_NOT_FOUND, NFS_MSG_PGM_INIT_FAIL,
+ NFS_MSG_PGM_REG_FAIL, NFS_MSG_LOOKUP_ROOT_FAIL, NFS_MSG_ROOT_LOC_INIT_FAIL,
+ NFS_MSG_STARTUP_FAIL, NFS_MSG_XLATOR_INIT_FAIL, NFS_MSG_NFS_MAN_DISABLE,
+ NFS_MSG_DICT_GET_FAILED, NFS_MSG_PARSE_FAIL, NFS_MSG_NLM_MAN_DISABLE,
+ NFS_MSG_ACL_MAN_DISABLE, NFS_MSG_DICT_SET_FAILED,
+ NFS_MSG_INIT_GRP_CACHE_FAIL, NFS_MSG_NO_PERM, NFS_MSG_REG_FILE_ERROR,
+ NFS_MSG_RPC_INIT_FAIL, NFS_MSG_RPC_CONFIG_FAIL, NFS_MSG_RECONFIG_PATH,
+ NFS_MSG_RECONFIG_VALUE, NFS_MSG_RECONFIG_VOL, NFS_MSG_NLM_INFO,
+ NFS_MSG_ACL_INFO, NFS_MSG_INIT_FAIL, NFS_MSG_STARTED, NFS_MSG_VOL_NOT_FOUND,
+ NFS_MSG_RECONFIG_ENABLE, NFS_MSG_RECONFIG_FAIL, NFS_MSG_MNT_STATE_NOT_FOUND,
+ NFS_MSG_ENCODE_MSG_FAIL, NFS_MSG_REP_SUBMIT_FAIL, NFS_MSG_READ_LOCKED,
+ NFS_MSG_MODIFY_LOCKED, NFS_MSG_RWTAB_OVERWRITE_FAIL, NFS_MSG_UPDATE_FAIL,
+ NFS_MSG_OPEN_FAIL, NFS_MSG_LOCK_FAIL, NFS_MSG_REWRITE_ERROR,
+ NFS_MSG_HASH_PATH_FAIL, NFS_MSG_LOOKUP_MNT_ERROR,
+ NFS_MSG_GET_ROOT_INODE_FAIL, NFS_MSG_RESOLVE_INODE_FAIL,
+ NFS_MSG_RESOLVE_SUBDIR_FAIL, NFS_MSG_RESOLVE_SYMLINK_ERROR,
+ NFS_MSG_RESOLVE_ERROR, NFS_MSG_UNSUPPORTED_VERSION,
+ NFS_MSG_AUTH_VERIFY_FAILED, NFS_MSG_PEER_NOT_ALLOWED,
+ NFS_MSG_GET_PEER_ADDR_FAIL, NFS_MSG_BAD_PEER, NFS_MSG_PEER_TOO_LONG,
+ NFS_MSG_CALLER_NOT_FOUND, NFS_MSG_GET_REMOTE_NAME_FAIL,
+ NFS_MSG_UNKNOWN_MNT_TYPE, NFS_MSG_PARSE_HOSTSPEC_FAIL,
+ NFS_MSG_PARSE_AUTH_PARAM_FAIL, NFS_MSG_SET_EXP_FAIL,
+ NFS_MSG_INIT_DIR_EXP_FAIL, NFS_MSG_DIR_EXP_SETUP_FAIL,
+ NFS_MSG_VOL_INIT_FAIL, NFS_MSG_AUTH_ERROR, NFS_MSG_UPDATING_EXP,
+ NFS_MSG_SET_EXP_AUTH_PARAM_FAIL, NFS_MSG_UPDATING_NET_GRP,
+ NFS_MSG_SET_NET_GRP_FAIL, NFS_MSG_PURGING_AUTH_CACHE,
+ NFS_MSG_MNT_STATE_INIT_FAIL, NFS_MSG_EXP_AUTH_DISABLED,
+ NFS_MSG_FH_TO_VOL_FAIL, NFS_MSG_INODE_SHARES_NOT_FOUND,
+ NFS_MSG_VOLUME_ERROR, NFS_MSG_GET_USER_ACL_FAIL, NFS_MSG_GET_DEF_ACL_FAIL,
+ NFS_MSG_SET_USER_ACL_FAIL, NFS_MSG_SET_DEF_ACL_FAIL, NFS_MSG_ACL_INIT_FAIL,
+ NFS_MSG_LOAD_PARSE_ERROR, NFS_MSG_CLNT_CALL_ERROR,
+ NFS_MSG_CLNT_CREATE_ERROR, NFS_MSG_NLM_GRACE_PERIOD, NFS_MSG_RPC_CLNT_ERROR,
+ NFS_MSG_GET_PORT_ERROR, NFS_MSG_NLMCLNT_NOT_FOUND, NFS_MSG_FD_LOOKUP_NULL,
+ NFS_MSG_SM_NOTIFY, NFS_MSG_NLM_INIT_FAIL, NFS_MSG_START_ERROR,
+ NFS_MSG_UNLINK_ERROR, NFS_MSG_SHARE_LIST_STORE_FAIL,
+ NFS_MSG_CLIENT_NOT_FOUND, NFS_MSG_SHARE_CALL_FAIL,
+ NFS_MSG_UNSHARE_CALL_FAIL, NFS_MSG_GET_PID_FAIL, NFS_MSG_ARG_FREE_FAIL,
+ NFS_MSG_PMAP_UNSET_FAIL, NFS_MSG_UDP_SERV_FAIL, NFS_MSG_REG_NLMCBK_FAIL,
+ NFS_MSG_TCP_SERV_FAIL, NFS_MSG_SVC_RUN_RETURNED, NFS_MSG_XLATOR_SET_FAIL,
+ NFS_MSG_SVC_ERROR, NFS_MSG_GET_FH_FAIL, NFS_MSG_FIND_FIRST_MATCH_FAIL,
+ NFS_MSG_NETGRP_NOT_FOUND, NFS_MSG_FILE_OP_FAILED, NFS_MSG_PATH_RESOLVE_FAIL,
+ NFS_MSG_LOC_FILL_RESOLVE_FAIL, NFS_MSG_INODE_NOT_FOUND,
+ NFS_MSG_INODE_CTX_STORE_FAIL, NFS_MSG_GETPWUID_FAIL,
+ NFS_MSG_MAP_GRP_LIST_FAIL, NFS_MSG_PARSE_DIR_FAIL, NFS_MSG_LOOKUP_FAIL,
+ NFS_MSG_STAT_ERROR, NFS_MSG_GFID_DICT_CREATE_FAIL, NFS_MSG_HASH_XLATOR_FAIL,
+ NFS_MSG_ENABLE_THROTTLE_FAIL);
#endif /* _NFS_MESSAGES_H_ */
-
diff --git a/xlators/nfs/server/src/nfs.h b/xlators/nfs/server/src/nfs.h
index 33ba419a573..531a269071c 100644
--- a/xlators/nfs/server/src/nfs.h
+++ b/xlators/nfs/server/src/nfs.h
@@ -17,135 +17,138 @@
#include "lkowner.h"
#include "gidcache.h"
-#define GF_NFS "nfs"
+#define GF_NFS "nfs"
-#define GF_NFS_CONCURRENT_OPS_MULT 15
+#define GF_NFS_CONCURRENT_OPS_MULT 15
-#define GF_NFS_INODE_LRU_MULT 6000
+#define GF_NFS_INODE_LRU_MULT 6000
-#define GF_RPC_MIN_THREADS 1
-#define GF_RPC_MAX_THREADS 16
+#define GF_RPC_MIN_THREADS 1
+#define GF_RPC_MAX_THREADS 16
-#define GF_NFS_DEFAULT_MEMFACTOR 15
-#define GF_NFS_MIN_MEMFACTOR 1
-#define GF_NFS_MAX_MEMFACTOR 30
+#define GF_NFS_DEFAULT_MEMFACTOR 15
+#define GF_NFS_MIN_MEMFACTOR 1
+#define GF_NFS_MAX_MEMFACTOR 30
-#define GF_NFS_DVM_ON 1
-#define GF_NFS_DVM_OFF 0
+#define GF_NFS_DVM_ON 1
+#define GF_NFS_DVM_OFF 0
/* Disable using the exports file by default */
-#define GF_NFS_DEFAULT_EXPORT_AUTH 0
+#define GF_NFS_DEFAULT_EXPORT_AUTH 0
-#define GF_NFS_DEFAULT_AUTH_REFRESH_INTERVAL_SEC 2
-#define GF_NFS_DEFAULT_AUTH_CACHE_TTL_SEC 300 /* 5 min */
+#define GF_NFS_DEFAULT_AUTH_REFRESH_INTERVAL_SEC 2
+#define GF_NFS_DEFAULT_AUTH_CACHE_TTL_SEC 300 /* 5 min */
/* This corresponds to the max 16 number of group IDs that are sent through an
* RPC request. Since NFS is the only one going to set this, we can be safe
* in keeping this size hardcoded.
*/
-#define GF_REQUEST_MAXGROUPS 16
+#define GF_REQUEST_MAXGROUPS 16
/* Callback into a version-specific NFS protocol.
* The return type is used by the nfs.c code to register the protocol.
* with the RPC service.
*/
-typedef rpcsvc_program_t *(*nfs_version_initer_t) (xlator_t *nfsx);
+typedef rpcsvc_program_t *(*nfs_version_initer_t)(xlator_t *nfsx);
/* List of version-specific protocol initiators */
struct nfs_initer_list {
- struct list_head list;
- nfs_version_initer_t init;
- rpcsvc_program_t *program;
- gf_boolean_t required;
+ struct list_head list;
+ nfs_version_initer_t init;
+ rpcsvc_program_t *program;
+ gf_boolean_t required;
};
struct nfs_state {
- rpcsvc_t *rpcsvc;
- struct list_head versions;
- struct mount3_state *mstate;
- struct nfs3_state *nfs3state;
- struct nlm4_state *nlm4state;
- struct mem_pool *foppool;
- unsigned int memfactor;
- xlator_list_t *subvols;
-
- gf_lock_t svinitlock;
- int allsubvols;
- int upsubvols;
- xlator_t **initedxl;
- int subvols_started;
- int dynamicvolumes;
- int enable_ino32;
- unsigned int override_portnum;
- int allow_insecure;
- int enable_nlm;
- int enable_acl;
- int mount_udp;
-
- /* Enable exports auth model */
- int exports_auth;
- /* Refresh auth params from disk periodically */
- int refresh_auth;
-
- unsigned int auth_refresh_time_secs;
- unsigned int auth_cache_ttl_sec;
-
- char *rmtab;
- struct rpc_clnt *rpc_clnt;
- gf_boolean_t server_aux_gids;
- uint32_t server_aux_gids_max_age;
- gid_cache_t gid_cache;
- uint32_t generation;
- gf_boolean_t register_portmap;
- char *rpc_statd;
- char *rpc_statd_pid_file;
- gf_boolean_t rdirplus;
- uint32_t event_threads;
+ rpcsvc_t *rpcsvc;
+ struct list_head versions;
+ struct mount3_state *mstate;
+ struct nfs3_state *nfs3state;
+ struct nlm4_state *nlm4state;
+ struct mem_pool *foppool;
+ unsigned int memfactor;
+ xlator_list_t *subvols;
+
+ gf_lock_t svinitlock;
+ int allsubvols;
+ int upsubvols;
+ xlator_t **initedxl;
+ int subvols_started;
+ int dynamicvolumes;
+ int enable_ino32;
+ unsigned int override_portnum;
+ int allow_insecure;
+ int enable_nlm;
+ int enable_acl;
+ int mount_udp;
+
+ /* Enable exports auth model */
+ int exports_auth;
+ /* Refresh auth params from disk periodically */
+ int refresh_auth;
+
+ unsigned int auth_refresh_time_secs;
+ unsigned int auth_cache_ttl_sec;
+
+ char *rmtab;
+ struct rpc_clnt *rpc_clnt;
+ gf_boolean_t server_aux_gids;
+ uint32_t server_aux_gids_max_age;
+ gid_cache_t gid_cache;
+ uint32_t generation;
+ gf_boolean_t register_portmap;
+ char *rpc_statd;
+ char *rpc_statd_pid_file;
+ gf_boolean_t rdirplus;
+ uint32_t event_threads;
};
struct nfs_inode_ctx {
- struct list_head shares;
- uint32_t generation;
+ struct list_head shares;
+ uint32_t generation;
};
-#define gf_nfs_dvm_on(nfsstt) (((struct nfs_state *)nfsstt)->dynamicvolumes == GF_NFS_DVM_ON)
-#define gf_nfs_dvm_off(nfsstt) (((struct nfs_state *)nfsstt)->dynamicvolumes == GF_NFS_DVM_OFF)
-#define __gf_nfs_enable_ino32(nfsstt) (((struct nfs_state *)nfsstt)->enable_ino32)
-#define gf_nfs_this_private ((struct nfs_state *)((xlator_t *)THIS)->private)
-#define gf_nfs_enable_ino32() (__gf_nfs_enable_ino32(gf_nfs_this_private))
+#define gf_nfs_dvm_on(nfsstt) \
+ (((struct nfs_state *)nfsstt)->dynamicvolumes == GF_NFS_DVM_ON)
+#define gf_nfs_dvm_off(nfsstt) \
+ (((struct nfs_state *)nfsstt)->dynamicvolumes == GF_NFS_DVM_OFF)
+#define __gf_nfs_enable_ino32(nfsstt) \
+ (((struct nfs_state *)nfsstt)->enable_ino32)
+#define gf_nfs_this_private ((struct nfs_state *)((xlator_t *)THIS)->private)
+#define gf_nfs_enable_ino32() (__gf_nfs_enable_ino32(gf_nfs_this_private))
/* We have one gid more than the glusterfs maximum since we pass the primary
* gid as the first element of the array.
*/
-#define NFS_NGROUPS (GF_REQUEST_MAXGROUPS + 1)
+#define NFS_NGROUPS (GF_REQUEST_MAXGROUPS + 1)
/* Index of the primary gid */
-#define NFS_PRIMGID_IDX 0
+#define NFS_PRIMGID_IDX 0
typedef struct nfs_user_info {
- uid_t uid;
- gid_t gids[NFS_NGROUPS];
- int ngrps;
- gf_lkowner_t lk_owner;
- char identifier[UNIX_PATH_MAX]; /* ip of user */
+ uid_t uid;
+ gid_t gids[NFS_NGROUPS];
+ int ngrps;
+ gf_lkowner_t lk_owner;
+ char identifier[UNIX_PATH_MAX]; /* ip of user */
} nfs_user_t;
extern int
-nfs_user_root_create (nfs_user_t *newnfu);
+nfs_user_root_create(nfs_user_t *newnfu);
extern int
-nfs_user_create (nfs_user_t *newnfu, uid_t uid, gid_t gid,
- rpc_transport_t *trans, gid_t *auxgids, int auxcount);
+nfs_user_create(nfs_user_t *newnfu, uid_t uid, gid_t gid,
+ rpc_transport_t *trans, gid_t *auxgids, int auxcount);
extern void
-nfs_request_user_init (nfs_user_t *nfu, rpcsvc_request_t *req);
+nfs_request_user_init(nfs_user_t *nfu, rpcsvc_request_t *req);
extern void
-nfs_request_primary_user_init (nfs_user_t *nfu, rpcsvc_request_t *req,
- uid_t uid, gid_t gid);
+nfs_request_primary_user_init(nfs_user_t *nfu, rpcsvc_request_t *req, uid_t uid,
+ gid_t gid);
extern int
-nfs_subvolume_started (struct nfs_state *nfs, xlator_t *xl);
+nfs_subvolume_started(struct nfs_state *nfs, xlator_t *xl);
extern void
-nfs_fix_groups (xlator_t *this, call_stack_t *root);
+nfs_fix_groups(xlator_t *this, call_stack_t *root);
#endif
diff --git a/xlators/nfs/server/src/nfs3-fh.h b/xlators/nfs/server/src/nfs3-fh.h
index 3af36cc98b0..442f6feeb25 100644
--- a/xlators/nfs/server/src/nfs3-fh.h
+++ b/xlators/nfs/server/src/nfs3-fh.h
@@ -19,82 +19,83 @@
/* BIG FAT WARNING: The file handle code is tightly coupled to NFSv3 file
* handles for now. This will change if and when we need v4. */
-#define GF_NFSFH_IDENT0 ':'
-#define GF_NFSFH_IDENT1 'O'
-#define GF_NFSFH_IDENT2 'G'
-#define GF_NFSFH_IDENT3 'L'
-#define GF_NFSFH_IDENT_SIZE (sizeof(char) * 4)
-#define GF_NFSFH_STATIC_SIZE (GF_NFSFH_IDENT_SIZE + (3*sizeof (uuid_t)))
-
-#define nfs3_fh_exportid_to_index(exprtid) ((uint16_t)exprtid[15])
+#define GF_NFSFH_IDENT0 ':'
+#define GF_NFSFH_IDENT1 'O'
+#define GF_NFSFH_IDENT2 'G'
+#define GF_NFSFH_IDENT3 'L'
+#define GF_NFSFH_IDENT_SIZE (sizeof(char) * 4)
+#define GF_NFSFH_STATIC_SIZE (GF_NFSFH_IDENT_SIZE + (3 * sizeof(uuid_t)))
+
+#define nfs3_fh_exportid_to_index(exprtid) ((uint16_t)exprtid[15])
/* ATTENTION: Change in size of the structure below should be reflected in the
* GF_NFSFH_STATIC_SIZE.
*/
struct nfs3_fh {
-
- /* Used to ensure that a bunch of bytes are actually a GlusterFS NFS
- * file handle. Should contain ":OGL"
- */
- char ident[4];
-
- /* UUID that identifies an export. The value stored in exportid
- * depends on the usage of gluster nfs. If the DVM is enabled using
- * the nfs.dynamic-volumes option then exportid will contain the UUID
- * of the volume so that gnfs is able to identify volumes uniquely
- * through volume additions,deletions,migrations, etc.
- *
- * When not using dvm, exportid contains the index of the volume
- * based on the position of the volume in the list of subvolumes
- * for gnfs.
- */
- uuid_t exportid;
-
- /* File/dir gfid. */
- uuid_t gfid;
- uuid_t mountid;
- /* This structure must be exactly NFS3_FHSIZE (64) bytes long.
- Having the structure shorter results in buffer overflows
- during XDR decoding.
- */
- unsigned char padding[NFS3_FHSIZE - GF_NFSFH_STATIC_SIZE];
+ /* Used to ensure that a bunch of bytes are actually a GlusterFS NFS
+ * file handle. Should contain ":OGL"
+ */
+ char ident[4];
+
+ /* UUID that identifies an export. The value stored in exportid
+ * depends on the usage of gluster nfs. If the DVM is enabled using
+ * the nfs.dynamic-volumes option then exportid will contain the UUID
+ * of the volume so that gnfs is able to identify volumes uniquely
+ * through volume additions,deletions,migrations, etc.
+ *
+ * When not using dvm, exportid contains the index of the volume
+ * based on the position of the volume in the list of subvolumes
+ * for gnfs.
+ */
+ uuid_t exportid;
+
+ /* File/dir gfid. */
+ uuid_t gfid;
+ uuid_t mountid;
+ /* This structure must be exactly NFS3_FHSIZE (64) bytes long.
+ Having the structure shorter results in buffer overflows
+ during XDR decoding.
+ */
+ unsigned char padding[NFS3_FHSIZE - GF_NFSFH_STATIC_SIZE];
} __attribute__((__packed__));
-#define GF_NFS3FH_STATIC_INITIALIZER {{0},}
+#define GF_NFS3FH_STATIC_INITIALIZER \
+ { \
+ {0}, \
+ }
extern uint32_t
-nfs3_fh_compute_size ();
+nfs3_fh_compute_size();
extern uint16_t
-nfs3_fh_hash_entry (uuid_t gfid);
+nfs3_fh_hash_entry(uuid_t gfid);
extern int
-nfs3_fh_validate (struct nfs3_fh *fh);
+nfs3_fh_validate(struct nfs3_fh *fh);
extern struct nfs3_fh
-nfs3_fh_build_indexed_root_fh (xlator_list_t *cl, xlator_t *xl);
+nfs3_fh_build_indexed_root_fh(xlator_list_t *cl, xlator_t *xl);
extern int
-nfs3_fh_is_root_fh (struct nfs3_fh *fh);
+nfs3_fh_is_root_fh(struct nfs3_fh *fh);
extern int
-nfs3_fh_build_child_fh (struct nfs3_fh *parent, struct iatt *newstat,
- struct nfs3_fh *newfh);
+nfs3_fh_build_child_fh(struct nfs3_fh *parent, struct iatt *newstat,
+ struct nfs3_fh *newfh);
extern void
-nfs3_log_fh (struct nfs3_fh *fh);
+nfs3_log_fh(struct nfs3_fh *fh);
extern void
-nfs3_fh_to_str (struct nfs3_fh *fh, char *str, size_t len);
+nfs3_fh_to_str(struct nfs3_fh *fh, char *str, size_t len);
extern int
-nfs3_fh_build_parent_fh (struct nfs3_fh *child, struct iatt *newstat,
- struct nfs3_fh *newfh);
+nfs3_fh_build_parent_fh(struct nfs3_fh *child, struct iatt *newstat,
+ struct nfs3_fh *newfh);
extern struct nfs3_fh
-nfs3_fh_build_uuid_root_fh (uuid_t volumeid, uuid_t mountid);
+nfs3_fh_build_uuid_root_fh(uuid_t volumeid, uuid_t mountid);
extern int
-nfs3_build_fh (inode_t *inode, uuid_t exportid,
- struct nfs3_fh *newfh);
+nfs3_build_fh(inode_t *inode, uuid_t exportid, struct nfs3_fh *newfh);
#endif
diff --git a/xlators/nfs/server/src/nfs3-helpers.h b/xlators/nfs/server/src/nfs3-helpers.h
index 213639e3806..7c70c20b787 100644
--- a/xlators/nfs/server/src/nfs3-helpers.h
+++ b/xlators/nfs/server/src/nfs3-helpers.h
@@ -19,41 +19,40 @@
#include <sys/statvfs.h>
-#define GF_NFS3_FD_CACHED 0xcaced
+#define GF_NFS3_FD_CACHED 0xcaced
extern struct nfs3_fh
-nfs3_extract_lookup_fh (lookup3args *args);
+nfs3_extract_lookup_fh(lookup3args *args);
extern char *
-nfs3_extract_lookup_name (lookup3args *args);
+nfs3_extract_lookup_name(lookup3args *args);
extern nfsstat3
-nfs3_errno_to_nfsstat3 (int errnum);
+nfs3_errno_to_nfsstat3(int errnum);
-extern nfsstat3
-nfs3_cbk_errno_status (int32_t, int32_t);
+extern nfsstat3 nfs3_cbk_errno_status(int32_t, int32_t);
extern void
-nfs3_fill_lookup3res (lookup3res *res, nfsstat3 stat, struct nfs3_fh *newfh,
- struct iatt *stbuf, struct iatt *postparent,
- uint64_t deviceid);
+nfs3_fill_lookup3res(lookup3res *res, nfsstat3 stat, struct nfs3_fh *newfh,
+ struct iatt *stbuf, struct iatt *postparent,
+ uint64_t deviceid);
extern post_op_attr
-nfs3_stat_to_post_op_attr (struct iatt *buf);
+nfs3_stat_to_post_op_attr(struct iatt *buf);
extern struct nfs3_fh
-nfs3_extract_getattr_fh (getattr3args *args);
+nfs3_extract_getattr_fh(getattr3args *args);
extern void
-nfs3_fill_getattr3res (getattr3res *res, nfsstat3 stat, struct iatt *buf,
- uint64_t deviceid);
+nfs3_fill_getattr3res(getattr3res *res, nfsstat3 stat, struct iatt *buf,
+ uint64_t deviceid);
extern struct nfs3_fh
-nfs3_extract_fsinfo_fh (fsinfo3args *args);
+nfs3_extract_fsinfo_fh(fsinfo3args *args);
extern void
-nfs3_fill_fsinfo3res (struct nfs3_state *nfs3, fsinfo3res *res,
- nfsstat3 status, struct iatt *fsroot,uint64_t deviceid);
+nfs3_fill_fsinfo3res(struct nfs3_state *nfs3, fsinfo3res *res, nfsstat3 status,
+ struct iatt *fsroot, uint64_t deviceid);
/* Functions containing _prep_ are used specifically to work around
* the memory allocations that happen inside Sun RPC library.
@@ -73,271 +72,268 @@ nfs3_fill_fsinfo3res (struct nfs3_state *nfs3, fsinfo3res *res,
* looking through the glibc/sunrpc sources.
*/
extern void
-nfs3_prep_lookup3args (lookup3args *args, struct nfs3_fh *fh, char *name);
+nfs3_prep_lookup3args(lookup3args *args, struct nfs3_fh *fh, char *name);
extern void
-nfs3_prep_getattr3args (getattr3args *args, struct nfs3_fh *fh);
+nfs3_prep_getattr3args(getattr3args *args, struct nfs3_fh *fh);
extern void
-nfs3_prep_fsinfo3args (fsinfo3args *args, struct nfs3_fh *root);
+nfs3_prep_fsinfo3args(fsinfo3args *args, struct nfs3_fh *root);
extern char *
nfsstat3_strerror(int stat);
extern void
-nfs3_prep_access3args (access3args *args, struct nfs3_fh *fh);
+nfs3_prep_access3args(access3args *args, struct nfs3_fh *fh);
extern void
-nfs3_fill_access3res (access3res *res, nfsstat3 status, int32_t accbits,
- int32_t reqaccbits);
+nfs3_fill_access3res(access3res *res, nfsstat3 status, int32_t accbits,
+ int32_t reqaccbits);
extern char *
-nfs3_fhcache_getpath (struct nfs3_state *nfs3, struct nfs3_fh *fh);
+nfs3_fhcache_getpath(struct nfs3_state *nfs3, struct nfs3_fh *fh);
extern int
-nfs3_fhcache_putpath (struct nfs3_state *nfs3, struct nfs3_fh *fh, char *path);
+nfs3_fhcache_putpath(struct nfs3_state *nfs3, struct nfs3_fh *fh, char *path);
extern void
-nfs3_prep_readdir3args (readdir3args *ra, struct nfs3_fh *fh);
+nfs3_prep_readdir3args(readdir3args *ra, struct nfs3_fh *fh);
extern void
-nfs3_fill_readdir3res (readdir3res *res, nfsstat3 stat, struct nfs3_fh *dfh,
- uint64_t cverf, struct iatt *dirstat,
- gf_dirent_t *entries, count3 count, int is_eof,
- uint64_t deviceid);
+nfs3_fill_readdir3res(readdir3res *res, nfsstat3 stat, struct nfs3_fh *dfh,
+ uint64_t cverf, struct iatt *dirstat,
+ gf_dirent_t *entries, count3 count, int is_eof,
+ uint64_t deviceid);
extern void
-nfs3_prep_readdirp3args (readdirp3args *ra, struct nfs3_fh *fh);
+nfs3_prep_readdirp3args(readdirp3args *ra, struct nfs3_fh *fh);
extern void
-nfs3_fill_readdirp3res (readdirp3res *res, nfsstat3 stat,
- struct nfs3_fh *dirfh, uint64_t cverf,
- struct iatt *dirstat, gf_dirent_t *entries,
- count3 dircount, count3 maxcount, int is_eof,
- uint64_t deviceid);
+nfs3_fill_readdirp3res(readdirp3res *res, nfsstat3 stat, struct nfs3_fh *dirfh,
+ uint64_t cverf, struct iatt *dirstat,
+ gf_dirent_t *entries, count3 dircount, count3 maxcount,
+ int is_eof, uint64_t deviceid);
extern void
-nfs3_free_readdirp3res (readdirp3res *res);
+nfs3_free_readdirp3res(readdirp3res *res);
extern void
-nfs3_free_readdir3res (readdir3res *res);
+nfs3_free_readdir3res(readdir3res *res);
extern void
-nfs3_prep_fsstat3args (fsstat3args *args, struct nfs3_fh *fh);
+nfs3_prep_fsstat3args(fsstat3args *args, struct nfs3_fh *fh);
extern void
-nfs3_fill_fsstat3res (fsstat3res *res, nfsstat3 stat, struct statvfs *fsbuf,
- struct iatt *postbuf, uint64_t deviceid);
+nfs3_fill_fsstat3res(fsstat3res *res, nfsstat3 stat, struct statvfs *fsbuf,
+ struct iatt *postbuf, uint64_t deviceid);
extern int32_t
-nfs3_sattr3_to_setattr_valid (sattr3 *sattr, struct iatt *buf, mode_t *omode);
+nfs3_sattr3_to_setattr_valid(sattr3 *sattr, struct iatt *buf, mode_t *omode);
extern void
-nfs3_fill_create3res (create3res *res, nfsstat3 stat, struct nfs3_fh *newfh,
- struct iatt *newbuf, struct iatt *preparent,
- struct iatt *postparent, uint64_t deviceid);
+nfs3_fill_create3res(create3res *res, nfsstat3 stat, struct nfs3_fh *newfh,
+ struct iatt *newbuf, struct iatt *preparent,
+ struct iatt *postparent, uint64_t deviceid);
extern void
-nfs3_prep_create3args (create3args *args, struct nfs3_fh *fh, char *name);
+nfs3_prep_create3args(create3args *args, struct nfs3_fh *fh, char *name);
extern void
-nfs3_prep_setattr3args (setattr3args *args, struct nfs3_fh *fh);
+nfs3_prep_setattr3args(setattr3args *args, struct nfs3_fh *fh);
extern void
-nfs3_fill_setattr3res (setattr3res *res, nfsstat3 stat, struct iatt *preop,
- struct iatt *postop, uint64_t deviceid);
+nfs3_fill_setattr3res(setattr3res *res, nfsstat3 stat, struct iatt *preop,
+ struct iatt *postop, uint64_t deviceid);
extern void
-nfs3_prep_mkdir3args (mkdir3args *args, struct nfs3_fh *dirfh, char *name);
+nfs3_prep_mkdir3args(mkdir3args *args, struct nfs3_fh *dirfh, char *name);
extern void
-nfs3_fill_mkdir3res (mkdir3res *res, nfsstat3 stat, struct nfs3_fh *fh,
- struct iatt *buf, struct iatt *preparent,
- struct iatt *postparent, uint64_t deviceid);
+nfs3_fill_mkdir3res(mkdir3res *res, nfsstat3 stat, struct nfs3_fh *fh,
+ struct iatt *buf, struct iatt *preparent,
+ struct iatt *postparent, uint64_t deviceid);
extern void
-nfs3_prep_symlink3args (symlink3args *args, struct nfs3_fh *dirfh, char *name,
- char *target);
+nfs3_prep_symlink3args(symlink3args *args, struct nfs3_fh *dirfh, char *name,
+ char *target);
extern void
-nfs3_fill_symlink3res (symlink3res *res, nfsstat3 stat, struct nfs3_fh *fh,
- struct iatt *buf, struct iatt *preparent,
- struct iatt *postparent, uint64_t deviceid);
+nfs3_fill_symlink3res(symlink3res *res, nfsstat3 stat, struct nfs3_fh *fh,
+ struct iatt *buf, struct iatt *preparent,
+ struct iatt *postparent, uint64_t deviceid);
extern void
-nfs3_prep_readlink3args (readlink3args *args, struct nfs3_fh *fh);
+nfs3_prep_readlink3args(readlink3args *args, struct nfs3_fh *fh);
extern void
-nfs3_fill_readlink3res (readlink3res *res, nfsstat3 stat, char *path,
- struct iatt *buf, uint64_t deviceid);
+nfs3_fill_readlink3res(readlink3res *res, nfsstat3 stat, char *path,
+ struct iatt *buf, uint64_t deviceid);
extern void
-nfs3_prep_mknod3args (mknod3args *args, struct nfs3_fh *fh, char *name);
+nfs3_prep_mknod3args(mknod3args *args, struct nfs3_fh *fh, char *name);
extern void
-nfs3_fill_mknod3res (mknod3res *res, nfsstat3 stat, struct nfs3_fh *fh,
- struct iatt *buf, struct iatt *preparent,
- struct iatt *postparent, uint64_t deviceid);
+nfs3_fill_mknod3res(mknod3res *res, nfsstat3 stat, struct nfs3_fh *fh,
+ struct iatt *buf, struct iatt *preparent,
+ struct iatt *postparent, uint64_t deviceid);
extern void
-nfs3_fill_remove3res (remove3res *res, nfsstat3 stat, struct iatt *preparent,
- struct iatt *postparent, uint64_t deviceid);
+nfs3_fill_remove3res(remove3res *res, nfsstat3 stat, struct iatt *preparent,
+ struct iatt *postparent, uint64_t deviceid);
extern void
-nfs3_prep_remove3args (remove3args *args, struct nfs3_fh *fh, char *name);
+nfs3_prep_remove3args(remove3args *args, struct nfs3_fh *fh, char *name);
extern void
-nfs3_fill_rmdir3res (rmdir3res *res, nfsstat3 stat, struct iatt *preparent,
- struct iatt *postparent, uint64_t deviceid);
+nfs3_fill_rmdir3res(rmdir3res *res, nfsstat3 stat, struct iatt *preparent,
+ struct iatt *postparent, uint64_t deviceid);
extern void
-nfs3_prep_rmdir3args (rmdir3args *args, struct nfs3_fh *fh, char *name);
+nfs3_prep_rmdir3args(rmdir3args *args, struct nfs3_fh *fh, char *name);
extern void
-nfs3_fill_link3res (link3res *res, nfsstat3 stat, struct iatt *buf,
- struct iatt *preparent, struct iatt *postparent,
- uint64_t deviceid);
+nfs3_fill_link3res(link3res *res, nfsstat3 stat, struct iatt *buf,
+ struct iatt *preparent, struct iatt *postparent,
+ uint64_t deviceid);
extern void
-nfs3_prep_link3args (link3args *args, struct nfs3_fh *target,
- struct nfs3_fh * dirfh, char *name);
+nfs3_prep_link3args(link3args *args, struct nfs3_fh *target,
+ struct nfs3_fh *dirfh, char *name);
extern void
-nfs3_prep_rename3args (rename3args *args, struct nfs3_fh *olddirfh,
- char *oldname, struct nfs3_fh *newdirfh,
- char *newname);
+nfs3_prep_rename3args(rename3args *args, struct nfs3_fh *olddirfh,
+ char *oldname, struct nfs3_fh *newdirfh, char *newname);
extern void
-nfs3_fill_rename3res (rename3res *res, nfsstat3 stat, struct iatt *buf,
- struct iatt *preoldparent, struct iatt *postoldparent,
- struct iatt *prenewparent, struct iatt *postnewparent,
- uint64_t deviceid);
+nfs3_fill_rename3res(rename3res *res, nfsstat3 stat, struct iatt *buf,
+ struct iatt *preoldparent, struct iatt *postoldparent,
+ struct iatt *prenewparent, struct iatt *postnewparent,
+ uint64_t deviceid);
extern void
-nfs3_prep_write3args (write3args *args, struct nfs3_fh *fh);
+nfs3_prep_write3args(write3args *args, struct nfs3_fh *fh);
extern void
-nfs3_fill_write3res (write3res *res, nfsstat3 stat, count3 count,
- stable_how stable, uint64_t wverf, struct iatt *prestat,
- struct iatt *poststat, uint64_t deviceid);
+nfs3_fill_write3res(write3res *res, nfsstat3 stat, count3 count,
+ stable_how stable, uint64_t wverf, struct iatt *prestat,
+ struct iatt *poststat, uint64_t deviceid);
extern void
-nfs3_prep_commit3args (commit3args *args, struct nfs3_fh *fh);
+nfs3_prep_commit3args(commit3args *args, struct nfs3_fh *fh);
extern void
-nfs3_fill_commit3res (commit3res *res, nfsstat3 stat, uint64_t wverf,
- struct iatt *prestat, struct iatt *poststat,
- uint64_t deviceid);
+nfs3_fill_commit3res(commit3res *res, nfsstat3 stat, uint64_t wverf,
+ struct iatt *prestat, struct iatt *poststat,
+ uint64_t deviceid);
extern void
-nfs3_fill_read3res (read3res *res, nfsstat3 stat, count3 count,
- struct iatt *poststat, int is_eof, uint64_t deviceid);
+nfs3_fill_read3res(read3res *res, nfsstat3 stat, count3 count,
+ struct iatt *poststat, int is_eof, uint64_t deviceid);
extern void
-nfs3_prep_read3args (read3args *args, struct nfs3_fh *fh);
+nfs3_prep_read3args(read3args *args, struct nfs3_fh *fh);
extern void
-nfs3_prep_pathconf3args (pathconf3args *args, struct nfs3_fh *fh);
+nfs3_prep_pathconf3args(pathconf3args *args, struct nfs3_fh *fh);
extern void
-nfs3_fill_pathconf3res (pathconf3res *res, nfsstat3 stat, struct iatt *buf,
- uint64_t deviceid);
+nfs3_fill_pathconf3res(pathconf3res *res, nfsstat3 stat, struct iatt *buf,
+ uint64_t deviceid);
extern int
-nfs3_cached_inode_opened (xlator_t *nfsxl, inode_t *inode);
+nfs3_cached_inode_opened(xlator_t *nfsxl, inode_t *inode);
extern void
-nfs3_log_common_res (uint32_t xid, int op, nfsstat3 stat, int pstat,
- const char *path);
+nfs3_log_common_res(uint32_t xid, int op, nfsstat3 stat, int pstat,
+ const char *path);
extern void
-nfs3_log_readlink_res (uint32_t xid, nfsstat3 stat, int pstat,
- char *linkpath, const char *path);
+nfs3_log_readlink_res(uint32_t xid, nfsstat3 stat, int pstat, char *linkpath,
+ const char *path);
extern void
-nfs3_log_read_res (uint32_t xid, nfsstat3 stat, int pstat,
- count3 count, int is_eof, struct iovec *vec,
- int32_t vcount, const char *path);
+nfs3_log_read_res(uint32_t xid, nfsstat3 stat, int pstat, count3 count,
+ int is_eof, struct iovec *vec, int32_t vcount,
+ const char *path);
extern void
-nfs3_log_write_res (uint32_t xid, nfsstat3 stat, int pstat, count3 count,
- int stable, uint64_t wverf, const char *path);
+nfs3_log_write_res(uint32_t xid, nfsstat3 stat, int pstat, count3 count,
+ int stable, uint64_t wverf, const char *path);
extern void
-nfs3_log_newfh_res (uint32_t xid, int op, nfsstat3 stat, int pstat,
- struct nfs3_fh *newfh, const char *path);
+nfs3_log_newfh_res(uint32_t xid, int op, nfsstat3 stat, int pstat,
+ struct nfs3_fh *newfh, const char *path);
extern void
-nfs3_log_readdir_res (uint32_t xid, nfsstat3 stat, int pstat, uint64_t cverf,
- count3 count, int is_eof, const char *path);
+nfs3_log_readdir_res(uint32_t xid, nfsstat3 stat, int pstat, uint64_t cverf,
+ count3 count, int is_eof, const char *path);
extern void
-nfs3_log_readdirp_res (uint32_t xid, nfsstat3 stat, int pstat, uint64_t cverf,
- count3 dircount, count3 maxcount, int is_eof,
- const char *path);
+nfs3_log_readdirp_res(uint32_t xid, nfsstat3 stat, int pstat, uint64_t cverf,
+ count3 dircount, count3 maxcount, int is_eof,
+ const char *path);
extern void
-nfs3_log_commit_res (uint32_t xid, nfsstat3 stat, int pstat, uint64_t wverf,
- const char *path);
+nfs3_log_commit_res(uint32_t xid, nfsstat3 stat, int pstat, uint64_t wverf,
+ const char *path);
extern void
-nfs3_log_common_call (uint32_t xid, char *op, struct nfs3_fh *fh);
+nfs3_log_common_call(uint32_t xid, char *op, struct nfs3_fh *fh);
extern void
-nfs3_log_fh_entry_call (uint32_t xid, char *op, struct nfs3_fh *fh,
- char *name);
+nfs3_log_fh_entry_call(uint32_t xid, char *op, struct nfs3_fh *fh, char *name);
extern void
-nfs3_log_rw_call (uint32_t xid, char *op, struct nfs3_fh *fh, offset3 offt,
- count3 count, int stablewrite);
+nfs3_log_rw_call(uint32_t xid, char *op, struct nfs3_fh *fh, offset3 offt,
+ count3 count, int stablewrite);
extern void
-nfs3_log_create_call (uint32_t xid, struct nfs3_fh *fh, char *name,
- createmode3 mode);
+nfs3_log_create_call(uint32_t xid, struct nfs3_fh *fh, char *name,
+ createmode3 mode);
extern void
-nfs3_log_symlink_call (uint32_t xid, struct nfs3_fh *fh, char *name, char *tgt);
+nfs3_log_symlink_call(uint32_t xid, struct nfs3_fh *fh, char *name, char *tgt);
extern void
-nfs3_log_mknod_call (uint32_t xid, struct nfs3_fh *fh, char *name, int type);
+nfs3_log_mknod_call(uint32_t xid, struct nfs3_fh *fh, char *name, int type);
extern void
-nfs3_log_rename_call (uint32_t xid, struct nfs3_fh *src, char *sname,
- struct nfs3_fh *dst, char *dname);
+nfs3_log_rename_call(uint32_t xid, struct nfs3_fh *src, char *sname,
+ struct nfs3_fh *dst, char *dname);
extern void
-nfs3_log_link_call (uint32_t xid, struct nfs3_fh *fh, char *name,
- struct nfs3_fh *tgt);
+nfs3_log_link_call(uint32_t xid, struct nfs3_fh *fh, char *name,
+ struct nfs3_fh *tgt);
extern void
-nfs3_log_readdir_call (uint32_t xid, struct nfs3_fh *fh, count3 dircount,
- count3 maxcount);
+nfs3_log_readdir_call(uint32_t xid, struct nfs3_fh *fh, count3 dircount,
+ count3 maxcount);
extern int
-nfs3_fh_resolve_entry_hard (nfs3_call_state_t *cs);
+nfs3_fh_resolve_entry_hard(nfs3_call_state_t *cs);
extern int
-nfs3_fh_resolve_inode (nfs3_call_state_t *cs);
+nfs3_fh_resolve_inode(nfs3_call_state_t *cs);
extern int
-nfs3_fh_resolve_entry (nfs3_call_state_t *cs);
+nfs3_fh_resolve_entry(nfs3_call_state_t *cs);
extern int
-nfs3_fh_resolve_and_resume (nfs3_call_state_t *cs, struct nfs3_fh *fh,
- char *entry, nfs3_resume_fn_t resum_fn);
+nfs3_fh_resolve_and_resume(nfs3_call_state_t *cs, struct nfs3_fh *fh,
+ char *entry, nfs3_resume_fn_t resum_fn);
extern int
-nfs3_verify_dircookie (struct nfs3_state *nfs3, fd_t *dirfd, cookie3 cookie,
- uint64_t cverf, nfsstat3 *stat);
+nfs3_verify_dircookie(struct nfs3_state *nfs3, fd_t *dirfd, cookie3 cookie,
+ uint64_t cverf, nfsstat3 *stat);
extern int
-nfs3_is_parentdir_entry (char *entry);
+nfs3_is_parentdir_entry(char *entry);
uint32_t
-nfs3_request_to_accessbits (int32_t accbits);
+nfs3_request_to_accessbits(int32_t accbits);
extern int
-nfs3_fh_auth_nfsop (nfs3_call_state_t *cs, gf_boolean_t is_write_op);
+nfs3_fh_auth_nfsop(nfs3_call_state_t *cs, gf_boolean_t is_write_op);
void
-nfs3_map_deviceid_to_statdev (struct iatt *ia, uint64_t deviceid);
+nfs3_map_deviceid_to_statdev(struct iatt *ia, uint64_t deviceid);
#endif
diff --git a/xlators/nfs/server/src/nfs3.h b/xlators/nfs/server/src/nfs3.h
index 187fb7e1912..f6d98d9f308 100644
--- a/xlators/nfs/server/src/nfs3.h
+++ b/xlators/nfs/server/src/nfs3.h
@@ -26,13 +26,12 @@
#include "refcount.h"
#include <sys/statvfs.h>
-#define GF_NFS3 GF_NFS"-nfsv3"
-
-#define GF_NFS3_DEFAULT_MEMFACTOR 15
-#define GF_NFS3_IOBPOOL_MULT GF_NFS_CONCURRENT_OPS_MULT
-#define GF_NFS3_CLTABLE_BUCKETS_MULT 2
-#define GF_NFS3_FDTABLE_BUCKETS_MULT 2
+#define GF_NFS3 GF_NFS "-nfsv3"
+#define GF_NFS3_DEFAULT_MEMFACTOR 15
+#define GF_NFS3_IOBPOOL_MULT GF_NFS_CONCURRENT_OPS_MULT
+#define GF_NFS3_CLTABLE_BUCKETS_MULT 2
+#define GF_NFS3_FDTABLE_BUCKETS_MULT 2
/* Static values used for FSINFO
* To change the maximum rsize and wsize supported by the NFS client, adjust
@@ -43,136 +42,143 @@
*
* NB: For Kernel-NFS, NFS_MAX_FILE_IO_SIZE is 1048576U (1MB).
*/
-#define GF_NFS3_FILE_IO_SIZE_MAX (1 * GF_UNIT_MB) /* 1048576 */
-#define GF_NFS3_FILE_IO_SIZE_MIN (4 * GF_UNIT_KB) /* 4096 */
+#define GF_NFS3_FILE_IO_SIZE_MAX (1 * GF_UNIT_MB) /* 1048576 */
+#define GF_NFS3_FILE_IO_SIZE_MIN (4 * GF_UNIT_KB) /* 4096 */
-#define GF_NFS3_FILE_IO_SIZE_DEF GF_NFS3_FILE_IO_SIZE_MAX
+#define GF_NFS3_FILE_IO_SIZE_DEF GF_NFS3_FILE_IO_SIZE_MAX
-#define GF_NFS3_RTMAX GF_NFS3_FILE_IO_SIZE_MAX
-#define GF_NFS3_RTMIN GF_NFS3_FILE_IO_SIZE_MIN
-#define GF_NFS3_RTPREF GF_NFS3_FILE_IO_SIZE_DEF
-#define GF_NFS3_RTMULT GF_NFS3_FILE_IO_SIZE_MIN
+#define GF_NFS3_RTMAX GF_NFS3_FILE_IO_SIZE_MAX
+#define GF_NFS3_RTMIN GF_NFS3_FILE_IO_SIZE_MIN
+#define GF_NFS3_RTPREF GF_NFS3_FILE_IO_SIZE_DEF
+#define GF_NFS3_RTMULT GF_NFS3_FILE_IO_SIZE_MIN
-#define GF_NFS3_WTMAX GF_NFS3_FILE_IO_SIZE_MAX
-#define GF_NFS3_WTMIN GF_NFS3_FILE_IO_SIZE_MIN
-#define GF_NFS3_WTPREF GF_NFS3_FILE_IO_SIZE_DEF
-#define GF_NFS3_WTMULT GF_NFS3_FILE_IO_SIZE_MIN
+#define GF_NFS3_WTMAX GF_NFS3_FILE_IO_SIZE_MAX
+#define GF_NFS3_WTMIN GF_NFS3_FILE_IO_SIZE_MIN
+#define GF_NFS3_WTPREF GF_NFS3_FILE_IO_SIZE_DEF
+#define GF_NFS3_WTMULT GF_NFS3_FILE_IO_SIZE_MIN
/* This can be tuned through nfs.readdir-size */
-#define GF_NFS3_DTMAX GF_NFS3_FILE_IO_SIZE_MAX
-#define GF_NFS3_DTMIN GF_NFS3_FILE_IO_SIZE_MIN
-#define GF_NFS3_DTPREF GF_NFS3_FILE_IO_SIZE_DEF
+#define GF_NFS3_DTMAX GF_NFS3_FILE_IO_SIZE_MAX
+#define GF_NFS3_DTMIN GF_NFS3_FILE_IO_SIZE_MIN
+#define GF_NFS3_DTPREF GF_NFS3_FILE_IO_SIZE_DEF
-#define GF_NFS3_MAXFILESIZE (1 * GF_UNIT_PB)
+#define GF_NFS3_MAXFILESIZE (1 * GF_UNIT_PB)
-#define GF_NFS3_IO_SIZE 4096 /* 4-KB */
-#define GF_NFS3_IO_SHIFT 12 /* 2^12 = 4KB */
+#define GF_NFS3_IO_SIZE 4096 /* 4-KB */
+#define GF_NFS3_IO_SHIFT 12 /* 2^12 = 4KB */
/* FIXME: Handle time resolutions */
-#define GF_NFS3_TIMEDELTA_SECS {1,0}
-#define GF_NFS3_TIMEDELTA_NSECS {0,1}
-#define GF_NFS3_TIMEDELTA_MSECS {0,1000000}
-
-#define GF_NFS3_FS_PROP (FSF3_LINK | FSF3_SYMLINK | FSF3_HOMOGENEOUS | FSF3_CANSETTIME)
-
-#define GF_NFS3_DIRFD_VALID 1
-#define GF_NFS3_DIRFD_INVALID 0
-
-#define GF_NFS3_VOLACCESS_RW 1
-#define GF_NFS3_VOLACCESS_RO 2
-
-
-#define GF_NFS3_FDCACHE_SIZE 512
+#define GF_NFS3_TIMEDELTA_SECS \
+ { \
+ 1, 0 \
+ }
+#define GF_NFS3_TIMEDELTA_NSECS \
+ { \
+ 0, 1 \
+ }
+#define GF_NFS3_TIMEDELTA_MSECS \
+ { \
+ 0, 1000000 \
+ }
+
+#define GF_NFS3_FS_PROP \
+ (FSF3_LINK | FSF3_SYMLINK | FSF3_HOMOGENEOUS | FSF3_CANSETTIME)
+
+#define GF_NFS3_DIRFD_VALID 1
+#define GF_NFS3_DIRFD_INVALID 0
+
+#define GF_NFS3_VOLACCESS_RW 1
+#define GF_NFS3_VOLACCESS_RO 2
+
+#define GF_NFS3_FDCACHE_SIZE 512
/* This should probably be moved to a more generic layer so that if needed
* different versions of NFS protocol can use the same thing.
*/
struct nfs3_fd_entry {
- fd_t *cachedfd;
- struct list_head list;
+ fd_t *cachedfd;
+ struct list_head list;
};
/* Per subvolume nfs3 specific state */
struct nfs3_export {
- struct list_head explist;
- xlator_t *subvol;
- uuid_t volumeid;
- int access;
- int trusted_sync;
- int trusted_write;
- int rootlookedup;
+ struct list_head explist;
+ xlator_t *subvol;
+ uuid_t volumeid;
+ int access;
+ int trusted_sync;
+ int trusted_write;
+ int rootlookedup;
};
-#define GF_NFS3_DEFAULT_VOLACCESS (GF_NFS3_VOLACCESS_RW)
+#define GF_NFS3_DEFAULT_VOLACCESS (GF_NFS3_VOLACCESS_RW)
/* The NFSv3 protocol state */
typedef struct nfs3_state {
-
- /* The NFS xlator pointer. The NFS xlator can be running
- * multiple versions of the NFS protocol.
- */
- xlator_t *nfsx;
-
- /* The iob pool from which memory allocations are made for receiving
- * and sending network messages.
- */
- struct iobuf_pool *iobpool;
-
- /* List of child subvolumes for the NFSv3 protocol.
- * Right now, is simply referring to the list of children in nfsx above.
- */
- xlator_list_t *exportslist;
-
- struct list_head exports;
- /* Mempool for allocations of struct nfs3_local */
- struct mem_pool *localpool;
-
- /* Server start-up timestamp, currently used for write verifier. */
- uint64_t serverstart;
-
- /* NFSv3 Protocol configurables */
- uint64_t readsize;
- uint64_t writesize;
- uint64_t readdirsize;
-
- /* Size of the iobufs used, depends on the sizes of the three params
- * above.
- */
- uint64_t iobsize;
-
- struct list_head fdlru;
- gf_lock_t fdlrulock;
- int fdcount;
- uint32_t occ_logger;
+ /* The NFS xlator pointer. The NFS xlator can be running
+ * multiple versions of the NFS protocol.
+ */
+ xlator_t *nfsx;
+
+ /* The iob pool from which memory allocations are made for receiving
+ * and sending network messages.
+ */
+ struct iobuf_pool *iobpool;
+
+ /* List of child subvolumes for the NFSv3 protocol.
+ * Right now, is simply referring to the list of children in nfsx above.
+ */
+ xlator_list_t *exportslist;
+
+ struct list_head exports;
+ /* Mempool for allocations of struct nfs3_local */
+ struct mem_pool *localpool;
+
+ /* Server start-up timestamp, currently used for write verifier. */
+ uint64_t serverstart;
+
+ /* NFSv3 Protocol configurables */
+ uint64_t readsize;
+ uint64_t writesize;
+ uint64_t readdirsize;
+
+ /* Size of the iobufs used, depends on the sizes of the three params
+ * above.
+ */
+ uint64_t iobsize;
+
+ struct list_head fdlru;
+ gf_lock_t fdlrulock;
+ int fdcount;
+ uint32_t occ_logger;
} nfs3_state_t;
typedef enum nfs3_lookup_type {
- GF_NFS3_REVALIDATE = 1,
- GF_NFS3_FRESH,
+ GF_NFS3_REVALIDATE = 1,
+ GF_NFS3_FRESH,
} nfs3_lookup_type_t;
typedef union args_ {
- nlm4_stat nlm4_stat;
- nlm4_holder nlm4_holder;
- nlm4_lock nlm4_lock;
- nlm4_share nlm4_share;
- nlm4_testrply nlm4_testrply;
- nlm4_testres nlm4_testres;
- nlm4_testargs nlm4_testargs;
- nlm4_res nlm4_res;
- nlm4_lockargs nlm4_lockargs;
- nlm4_cancargs nlm4_cancargs;
- nlm4_unlockargs nlm4_unlockargs;
- nlm4_shareargs nlm4_shareargs;
- nlm4_shareres nlm4_shareres;
- nlm4_freeallargs nlm4_freeallargs;
- getaclargs getaclargs;
- setaclargs setaclargs;
- getaclreply getaclreply;
- setaclreply setaclreply;
+ nlm4_stat nlm4_stat;
+ nlm4_holder nlm4_holder;
+ nlm4_lock nlm4_lock;
+ nlm4_share nlm4_share;
+ nlm4_testrply nlm4_testrply;
+ nlm4_testres nlm4_testres;
+ nlm4_testargs nlm4_testargs;
+ nlm4_res nlm4_res;
+ nlm4_lockargs nlm4_lockargs;
+ nlm4_cancargs nlm4_cancargs;
+ nlm4_unlockargs nlm4_unlockargs;
+ nlm4_shareargs nlm4_shareargs;
+ nlm4_shareres nlm4_shareres;
+ nlm4_freeallargs nlm4_freeallargs;
+ getaclargs getaclargs;
+ setaclargs setaclargs;
+ getaclreply getaclreply;
+ setaclreply setaclreply;
} args;
-
-typedef int (*nfs3_resume_fn_t) (void *cs);
+typedef int (*nfs3_resume_fn_t)(void *cs);
/* Structure used to communicate state between a fop and its callback.
* Not all members are used at all times. Usage is fop and NFS request
* dependent.
@@ -185,80 +191,80 @@ typedef int (*nfs3_resume_fn_t) (void *cs);
* Imagine the chaos if we need a mem-pool for each one of those sub-structures.
*/
struct nfs3_local {
- GF_REF_DECL;
-
- rpcsvc_request_t *req;
- xlator_t *vol;
- nfs3_resume_fn_t resume_fn;
- xlator_t *nfsx;
- struct nfs3_state *nfs3state;
-
- /* The list hook to attach this call state to the inode's queue till
- * the opening of the fd on the inode completes.
- */
- struct list_head openwait_q;
-
- /* Per-NFSv3 Op state */
- struct nfs3_fh parent;
- struct nfs3_fh fh;
- fd_t *fd;
- uint32_t accessbits;
- int operrno;
- count3 dircount;
- count3 maxcount;
- struct statvfs fsstat;
- gf_dirent_t entries;
- struct iatt stbuf;
- struct iatt preparent;
- struct iatt postparent;
- int32_t setattr_valid;
- nfstime3 timestamp;
- loc_t oploc;
- int writetype;
- count3 datacount;
- offset3 dataoffset;
- struct iobuf *iob;
- struct iobref *iobref;
- createmode3 createmode;
- uint64_t cookieverf;
- int sattrguardcheck;
- char *pathname;
- ftype3 mknodtype;
- specdata3 devnums;
- cookie3 cookie;
- struct iovec datavec;
- mode_t mode;
- struct iatt attr_in;
-
- /* NFSv3 FH resolver state */
- int hardresolved;
- struct nfs3_fh resolvefh;
- loc_t resolvedloc;
- int resolve_ret;
- int resolve_errno;
- int hashidx;
- fd_t *resolve_dir_fd;
- char *resolventry;
- nfs3_lookup_type_t lookuptype;
- gf_dirent_t *hashmatch;
- gf_dirent_t *entrymatch;
- off_t lastentryoffset;
- struct flock flock;
- args args;
- nlm4_lkowner_t lkowner;
- char cookiebytes[1024];
- struct nfs3_fh lockfh;
- int monitor;
- rpc_transport_t *trans;
- call_frame_t *frame;
-
- /* ACL */
- aclentry aclentry[NFS_ACL_MAX_ENTRIES];
- aclentry daclentry[NFS_ACL_MAX_ENTRIES];
- int aclcount;
- char aclxattr[NFS_ACL_MAX_ENTRIES*8 + 4];
- int daclcount;
- char daclxattr[NFS_ACL_MAX_ENTRIES*8 + 4];
+ GF_REF_DECL;
+
+ rpcsvc_request_t *req;
+ xlator_t *vol;
+ nfs3_resume_fn_t resume_fn;
+ xlator_t *nfsx;
+ struct nfs3_state *nfs3state;
+
+ /* The list hook to attach this call state to the inode's queue till
+ * the opening of the fd on the inode completes.
+ */
+ struct list_head openwait_q;
+
+ /* Per-NFSv3 Op state */
+ struct nfs3_fh parent;
+ struct nfs3_fh fh;
+ fd_t *fd;
+ uint32_t accessbits;
+ int operrno;
+ count3 dircount;
+ count3 maxcount;
+ struct statvfs fsstat;
+ gf_dirent_t entries;
+ struct iatt stbuf;
+ struct iatt preparent;
+ struct iatt postparent;
+ int32_t setattr_valid;
+ nfstime3 timestamp;
+ loc_t oploc;
+ int writetype;
+ count3 datacount;
+ offset3 dataoffset;
+ struct iobuf *iob;
+ struct iobref *iobref;
+ createmode3 createmode;
+ uint64_t cookieverf;
+ int sattrguardcheck;
+ char *pathname;
+ ftype3 mknodtype;
+ specdata3 devnums;
+ cookie3 cookie;
+ struct iovec datavec;
+ mode_t mode;
+ struct iatt attr_in;
+
+ /* NFSv3 FH resolver state */
+ int hardresolved;
+ struct nfs3_fh resolvefh;
+ loc_t resolvedloc;
+ int resolve_ret;
+ int resolve_errno;
+ int hashidx;
+ fd_t *resolve_dir_fd;
+ char *resolventry;
+ nfs3_lookup_type_t lookuptype;
+ gf_dirent_t *hashmatch;
+ gf_dirent_t *entrymatch;
+ off_t lastentryoffset;
+ struct flock flock;
+ args args;
+ nlm4_lkowner_t lkowner;
+ char cookiebytes[1024];
+ struct nfs3_fh lockfh;
+ int monitor;
+ rpc_transport_t *trans;
+ call_frame_t *frame;
+
+ /* ACL */
+ aclentry aclentry[NFS_ACL_MAX_ENTRIES];
+ aclentry daclentry[NFS_ACL_MAX_ENTRIES];
+ int aclcount;
+ char aclxattr[NFS_ACL_MAX_ENTRIES * 8 + 4];
+ int daclcount;
+ char daclxattr[NFS_ACL_MAX_ENTRIES * 8 + 4];
};
#define nfs3_is_revalidate_lookup(cst) ((cst)->lookuptype == GF_NFS3_REVALIDATE)
@@ -270,17 +276,17 @@ typedef struct nfs3_local nfs3_call_state_t;
/* Queue of ops waiting for open fop to return. */
struct inode_op_queue {
- struct list_head opq;
- pthread_mutex_t qlock;
+ struct list_head opq;
+ pthread_mutex_t qlock;
};
extern rpcsvc_program_t *
-nfs3svc_init (xlator_t *nfsx);
+nfs3svc_init(xlator_t *nfsx);
extern int
-nfs3_reconfigure_state (xlator_t *nfsx, dict_t *options);
+nfs3_reconfigure_state(xlator_t *nfsx, dict_t *options);
extern uint64_t
-nfs3_request_xlator_deviceid (rpcsvc_request_t *req);
+nfs3_request_xlator_deviceid(rpcsvc_request_t *req);
#endif
diff --git a/xlators/nfs/server/src/nlm4.h b/xlators/nfs/server/src/nlm4.h
index f9d254e2a37..4755c83f3dc 100644
--- a/xlators/nfs/server/src/nlm4.h
+++ b/xlators/nfs/server/src/nlm4.h
@@ -26,86 +26,86 @@
#include "nlm4-xdr.h"
#include "lkowner.h"
-#define NLM4_NULL 0
-#define NLM4_TEST 1
-#define NLM4_LOCK 2
-#define NLM4_CANCEL 3
-#define NLM4_UNLOCK 4
-#define NLM4_GRANTED 5
-#define NLM4_TEST_MSG 6
-#define NLM4_LOCK_MSG 7
-#define NLM4_CANCEL_MSG 8
-#define NLM4_UNLOCK_MSG 9
-#define NLM4_GRANTED_MSG 10
-#define NLM4_TEST_RES 11
-#define NLM4_LOCK_RES 12
-#define NLM4_CANCEL_RES 13
-#define NLM4_UNLOCK_RES 14
-#define NLM4_GRANTED_RES 15
-#define NLM4_SM_NOTIFY 16
-#define NLM4_SEVENTEEN 17
-#define NLM4_EIGHTEEN 18
-#define NLM4_NINETEEN 19
-#define NLM4_SHARE 20
-#define NLM4_UNSHARE 21
-#define NLM4_NM_LOCK 22
-#define NLM4_FREE_ALL 23
-#define NLM4_PROC_COUNT 24
+#define NLM4_NULL 0
+#define NLM4_TEST 1
+#define NLM4_LOCK 2
+#define NLM4_CANCEL 3
+#define NLM4_UNLOCK 4
+#define NLM4_GRANTED 5
+#define NLM4_TEST_MSG 6
+#define NLM4_LOCK_MSG 7
+#define NLM4_CANCEL_MSG 8
+#define NLM4_UNLOCK_MSG 9
+#define NLM4_GRANTED_MSG 10
+#define NLM4_TEST_RES 11
+#define NLM4_LOCK_RES 12
+#define NLM4_CANCEL_RES 13
+#define NLM4_UNLOCK_RES 14
+#define NLM4_GRANTED_RES 15
+#define NLM4_SM_NOTIFY 16
+#define NLM4_SEVENTEEN 17
+#define NLM4_EIGHTEEN 18
+#define NLM4_NINETEEN 19
+#define NLM4_SHARE 20
+#define NLM4_UNSHARE 21
+#define NLM4_NM_LOCK 22
+#define NLM4_FREE_ALL 23
+#define NLM4_PROC_COUNT 24
/* Registered with portmap */
-#define GF_NLM4_PORT 38468
-#define GF_NLM GF_NFS"-NLM"
+#define GF_NLM4_PORT 38468
+#define GF_NLM GF_NFS "-NLM"
#if defined(GF_DARWIN_HOST_OS)
-#define GF_RPC_STATD_PROG "/usr/sbin/rpc.statd"
-#define GF_RPC_STATD_PIDFILE "/var/run/statd.pid"
-#define GF_SM_NOTIFY_PIDFILE "/var/run/statd.notify.pid"
+#define GF_RPC_STATD_PROG "/usr/sbin/rpc.statd"
+#define GF_RPC_STATD_PIDFILE "/var/run/statd.pid"
+#define GF_SM_NOTIFY_PIDFILE "/var/run/statd.notify.pid"
#elif defined(__NetBSD__)
-#define GF_RPC_STATD_PROG "/usr/sbin/rpc.statd"
-#define GF_RPC_STATD_PIDFILE "/var/run/rpc.statd.pid"
-#define GF_SM_NOTIFY_PIDFILE "/var/run/inexistent.pid"
+#define GF_RPC_STATD_PROG "/usr/sbin/rpc.statd"
+#define GF_RPC_STATD_PIDFILE "/var/run/rpc.statd.pid"
+#define GF_SM_NOTIFY_PIDFILE "/var/run/inexistent.pid"
#else
-#define GF_RPC_STATD_PROG "/sbin/rpc.statd"
-#define GF_RPC_STATD_PIDFILE "/var/run/rpc.statd.pid"
-#define GF_SM_NOTIFY_PIDFILE "/var/run/sm-notify.pid"
+#define GF_RPC_STATD_PROG "/sbin/rpc.statd"
+#define GF_RPC_STATD_PIDFILE "/var/run/rpc.statd.pid"
+#define GF_SM_NOTIFY_PIDFILE "/var/run/sm-notify.pid"
#endif
extern rpcsvc_program_t *
-nlm4svc_init (xlator_t *nfsx);
+nlm4svc_init(xlator_t *nfsx);
extern int
-nlm4_init_state (xlator_t *nfsx);
+nlm4_init_state(xlator_t *nfsx);
#define NLM_PROGRAM 100021
#define NLM_V4 4
typedef struct nlm4_lwowner {
- char temp[1024];
+ char temp[1024];
} nlm4_lkowner_t;
typedef struct nlm_client {
- struct sockaddr_storage sa;
- pid_t uniq;
- struct list_head nlm_clients;
- struct list_head fdes;
- struct list_head shares;
- struct rpc_clnt *rpc_clnt;
- char *caller_name;
- int nsm_monitor;
+ struct sockaddr_storage sa;
+ pid_t uniq;
+ struct list_head nlm_clients;
+ struct list_head fdes;
+ struct list_head shares;
+ struct rpc_clnt *rpc_clnt;
+ char *caller_name;
+ int nsm_monitor;
} nlm_client_t;
typedef struct nlm_share {
- struct list_head client_list;
- struct list_head inode_list;
- gf_lkowner_t lkowner;
- inode_t *inode;
- fsh_mode mode;
- fsh_access access;
+ struct list_head client_list;
+ struct list_head inode_list;
+ gf_lkowner_t lkowner;
+ inode_t *inode;
+ fsh_mode mode;
+ fsh_access access;
} nlm_share_t;
typedef struct nlm_fde {
- struct list_head fde_list;
- fd_t *fd;
- int transit_cnt;
+ struct list_head fde_list;
+ fd_t *fd;
+ int transit_cnt;
} nlm_fde_t;
#endif
diff --git a/xlators/performance/decompounder/src/decompounder-mem-types.h b/xlators/performance/decompounder/src/decompounder-mem-types.h
index 5c211c1a907..8b3049ffb18 100644
--- a/xlators/performance/decompounder/src/decompounder-mem-types.h
+++ b/xlators/performance/decompounder/src/decompounder-mem-types.h
@@ -13,8 +13,5 @@
#include "mem-types.h"
-enum gf_dc_mem_types_ {
- gf_dc_mt_rsp_t = gf_common_mt_end + 1,
- gf_dc_mt_end
-};
+enum gf_dc_mem_types_ { gf_dc_mt_rsp_t = gf_common_mt_end + 1, gf_dc_mt_end };
#endif
diff --git a/xlators/performance/decompounder/src/decompounder-messages.h b/xlators/performance/decompounder/src/decompounder-messages.h
index 5f0aab4d92f..60674f32e78 100644
--- a/xlators/performance/decompounder/src/decompounder-messages.h
+++ b/xlators/performance/decompounder/src/decompounder-messages.h
@@ -23,9 +23,6 @@
* glfs-message-id.h.
*/
-GLFS_MSGID(DC,
- DC_MSG_VOL_MISCONFIGURED,
- DC_MSG_ERROR_RECEIVED
-);
+GLFS_MSGID(DC, DC_MSG_VOL_MISCONFIGURED, DC_MSG_ERROR_RECEIVED);
#endif /* !_DC_MESSAGES_H_ */
diff --git a/xlators/performance/decompounder/src/decompounder.h b/xlators/performance/decompounder/src/decompounder.h
index 59fb908ed06..486d0caf369 100644
--- a/xlators/performance/decompounder/src/decompounder.h
+++ b/xlators/performance/decompounder/src/decompounder.h
@@ -18,58 +18,61 @@
#include "decompounder-messages.h"
typedef struct {
- compound_args_t *compound_req;
- compound_args_cbk_t *compound_rsp;
- int counter;
- int length;
+ compound_args_t *compound_req;
+ compound_args_cbk_t *compound_rsp;
+ int counter;
+ int length;
} dc_local_t;
-#define DC_STACK_UNWIND(frame, op_ret, op_errno, rsp, xdata) do {\
- dc_local_t *__local = NULL; \
- \
- if (frame) { \
- __local = frame->local; \
- frame->local = NULL; \
- } \
- STACK_UNWIND_STRICT (compound, frame, op_ret, op_errno, \
- (void *)rsp, xdata); \
- if (__local) { \
- dc_local_cleanup (__local); \
- mem_put (__local); \
- } \
- } while (0)
+#define DC_STACK_UNWIND(frame, op_ret, op_errno, rsp, xdata) \
+ do { \
+ dc_local_t *__local = NULL; \
+ \
+ if (frame) { \
+ __local = frame->local; \
+ frame->local = NULL; \
+ } \
+ STACK_UNWIND_STRICT(compound, frame, op_ret, op_errno, (void *)rsp, \
+ xdata); \
+ if (__local) { \
+ dc_local_cleanup(__local); \
+ mem_put(__local); \
+ } \
+ } while (0)
int32_t
-dc_compound_fop_wind (call_frame_t *frame, xlator_t *this);
+dc_compound_fop_wind(call_frame_t *frame, xlator_t *this);
void
-dc_local_cleanup (dc_local_t *local);
+dc_local_cleanup(dc_local_t *local);
-#define DC_FOP_RESPONSE_STORE_AND_WIND_NEXT(fop, frame, op_ret, op_errno, params ...) do { \
- dc_local_t *__local = frame->local; \
- xlator_t *__this = frame->this; \
- int __ret = 0; \
- int __counter = __local->counter; \
- compound_args_cbk_t *__compound_rsp = __local->compound_rsp; \
- default_args_cbk_t *__fop_rsp = &__local->compound_rsp->rsp_list[__counter]; \
- \
- if (op_ret < 0) { \
- gf_msg (__this->name, GF_LOG_ERROR, op_errno, DC_MSG_ERROR_RECEIVED, \
- "fop number %d failed. Unwinding.", __counter+1); \
- args_##fop##_cbk_store (__fop_rsp, \
- op_ret, op_errno, params); \
- /*TODO : Fill the rest of the responses to -1 or NULL*/ \
- DC_STACK_UNWIND (frame, op_ret, op_errno, \
- (void *)__compound_rsp, NULL); \
- } else { \
- args_##fop##_cbk_store (__fop_rsp, \
- op_ret, op_errno, params); \
- __local->counter++; \
- __ret = dc_compound_fop_wind (frame, __this); \
- if (__ret < 0) { \
- DC_STACK_UNWIND (frame, -1, -__ret, \
- (void *)__compound_rsp, NULL); \
- } \
- } \
- } while (0)
+#define DC_FOP_RESPONSE_STORE_AND_WIND_NEXT(fop, frame, op_ret, op_errno, \
+ params...) \
+ do { \
+ dc_local_t *__local = frame->local; \
+ xlator_t *__this = frame->this; \
+ int __ret = 0; \
+ int __counter = __local->counter; \
+ compound_args_cbk_t *__compound_rsp = __local->compound_rsp; \
+ default_args_cbk_t *__fop_rsp = &__local->compound_rsp \
+ ->rsp_list[__counter]; \
+ \
+ if (op_ret < 0) { \
+ gf_msg(__this->name, GF_LOG_ERROR, op_errno, \
+ DC_MSG_ERROR_RECEIVED, "fop number %d failed. Unwinding.", \
+ __counter + 1); \
+ args_##fop##_cbk_store(__fop_rsp, op_ret, op_errno, params); \
+ /*TODO : Fill the rest of the responses to -1 or NULL*/ \
+ DC_STACK_UNWIND(frame, op_ret, op_errno, (void *)__compound_rsp, \
+ NULL); \
+ } else { \
+ args_##fop##_cbk_store(__fop_rsp, op_ret, op_errno, params); \
+ __local->counter++; \
+ __ret = dc_compound_fop_wind(frame, __this); \
+ if (__ret < 0) { \
+ DC_STACK_UNWIND(frame, -1, -__ret, (void *)__compound_rsp, \
+ NULL); \
+ } \
+ } \
+ } while (0)
#endif /* DC_H__ */
diff --git a/xlators/performance/io-cache/src/io-cache-messages.h b/xlators/performance/io-cache/src/io-cache-messages.h
index f49a977554b..09c5439ca71 100644
--- a/xlators/performance/io-cache/src/io-cache-messages.h
+++ b/xlators/performance/io-cache/src/io-cache-messages.h
@@ -22,16 +22,11 @@
* glfs-message-id.h.
*/
-GLFS_MSGID(IO_CACHE,
- IO_CACHE_MSG_ENFORCEMENT_FAILED,
- IO_CACHE_MSG_INVALID_ARGUMENT,
- IO_CACHE_MSG_XLATOR_CHILD_MISCONFIGURED,
- IO_CACHE_MSG_NO_MEMORY,
- IO_CACHE_MSG_VOL_MISCONFIGURED,
- IO_CACHE_MSG_INODE_NULL,
- IO_CACHE_MSG_PAGE_WAIT_VALIDATE,
- IO_CACHE_MSG_STR_COVERSION_FAILED,
- IO_CACHE_MSG_WASTED_COPY
-);
+GLFS_MSGID(IO_CACHE, IO_CACHE_MSG_ENFORCEMENT_FAILED,
+ IO_CACHE_MSG_INVALID_ARGUMENT,
+ IO_CACHE_MSG_XLATOR_CHILD_MISCONFIGURED, IO_CACHE_MSG_NO_MEMORY,
+ IO_CACHE_MSG_VOL_MISCONFIGURED, IO_CACHE_MSG_INODE_NULL,
+ IO_CACHE_MSG_PAGE_WAIT_VALIDATE, IO_CACHE_MSG_STR_COVERSION_FAILED,
+ IO_CACHE_MSG_WASTED_COPY);
#endif /* _IO_CACHE_MESSAGES_H_ */
diff --git a/xlators/performance/io-cache/src/io-cache.h b/xlators/performance/io-cache/src/io-cache.h
index 50008ef7004..cc66fcea714 100644
--- a/xlators/performance/io-cache/src/io-cache.h
+++ b/xlators/performance/io-cache/src/io-cache.h
@@ -26,8 +26,8 @@
#include <fnmatch.h>
#include "io-cache-messages.h"
-#define IOC_PAGE_SIZE (1024 * 128) /* 128KB */
-#define IOC_CACHE_SIZE (32 * 1024 * 1024)
+#define IOC_PAGE_SIZE (1024 * 128) /* 128KB */
+#define IOC_CACHE_SIZE (32 * 1024 * 1024)
#define IOC_PAGE_TABLE_BUCKET_COUNT 1
struct ioc_table;
@@ -36,9 +36,9 @@ struct ioc_page;
struct ioc_inode;
struct ioc_priority {
- struct list_head list;
- char *pattern;
- uint32_t priority;
+ struct list_head list;
+ char *pattern;
+ uint32_t priority;
};
/*
@@ -49,10 +49,10 @@ struct ioc_priority {
* @data: pointer to the frame which is waiting
*/
struct ioc_waitq {
- struct ioc_waitq *next;
- void *data;
- off_t pending_offset;
- size_t pending_size;
+ struct ioc_waitq *next;
+ void *data;
+ off_t pending_offset;
+ size_t pending_size;
};
/*
@@ -60,39 +60,39 @@ struct ioc_waitq {
*
*/
struct ioc_fill {
- struct list_head list; /* list of ioc_fill structures of a frame */
- off_t offset;
- size_t size;
- struct iovec *vector;
- int32_t count;
- struct iobref *iobref;
+ struct list_head list; /* list of ioc_fill structures of a frame */
+ off_t offset;
+ size_t size;
+ struct iovec *vector;
+ int32_t count;
+ struct iobref *iobref;
};
struct ioc_local {
- mode_t mode;
- int32_t flags;
- loc_t file_loc;
- off_t offset;
- size_t size;
- int32_t op_ret;
- int32_t op_errno;
- struct list_head fill_list; /* list of ioc_fill structures */
- off_t pending_offset; /*
- * offset from this frame should
- * continue
- */
- size_t pending_size; /*
- * size of data this frame is waiting
- * on
- */
- struct ioc_inode *inode;
- int32_t wait_count;
- pthread_mutex_t local_lock;
- struct ioc_waitq *waitq;
- void *stub;
- fd_t *fd;
- int32_t need_xattr;
- dict_t *xattr_req;
+ mode_t mode;
+ int32_t flags;
+ loc_t file_loc;
+ off_t offset;
+ size_t size;
+ int32_t op_ret;
+ int32_t op_errno;
+ struct list_head fill_list; /* list of ioc_fill structures */
+ off_t pending_offset; /*
+ * offset from this frame should
+ * continue
+ */
+ size_t pending_size; /*
+ * size of data this frame is waiting
+ * on
+ */
+ struct ioc_inode *inode;
+ int32_t wait_count;
+ pthread_mutex_t local_lock;
+ struct ioc_waitq *waitq;
+ void *stub;
+ fd_t *fd;
+ int32_t need_xattr;
+ dict_t *xattr_req;
};
/*
@@ -100,71 +100,71 @@ struct ioc_local {
*
*/
struct ioc_page {
- struct list_head page_lru;
- struct ioc_inode *inode; /* inode this page belongs to */
- struct ioc_priority *priority;
- char dirty;
- char ready;
- struct iovec *vector;
- int32_t count;
- off_t offset;
- size_t size;
- struct ioc_waitq *waitq;
- struct iobref *iobref;
- pthread_mutex_t page_lock;
- int32_t op_errno;
- char stale;
+ struct list_head page_lru;
+ struct ioc_inode *inode; /* inode this page belongs to */
+ struct ioc_priority *priority;
+ char dirty;
+ char ready;
+ struct iovec *vector;
+ int32_t count;
+ off_t offset;
+ size_t size;
+ struct ioc_waitq *waitq;
+ struct iobref *iobref;
+ pthread_mutex_t page_lock;
+ int32_t op_errno;
+ char stale;
};
struct ioc_cache {
- rbthash_table_t *page_table;
- struct list_head page_lru;
- time_t mtime; /*
- * seconds component of file mtime
- */
- time_t mtime_nsec; /*
- * nanosecond component of file mtime
- */
- struct timeval tv; /*
- * time-stamp at last re-validate
- */
+ rbthash_table_t *page_table;
+ struct list_head page_lru;
+ time_t mtime; /*
+ * seconds component of file mtime
+ */
+ time_t mtime_nsec; /*
+ * nanosecond component of file mtime
+ */
+ struct timeval tv; /*
+ * time-stamp at last re-validate
+ */
};
struct ioc_inode {
- struct ioc_table *table;
- off_t ia_size;
- struct ioc_cache cache;
- struct list_head inode_list; /*
- * list of inodes, maintained by
- * io-cache translator
- */
- struct list_head inode_lru;
- struct ioc_waitq *waitq;
- pthread_mutex_t inode_lock;
- uint32_t weight; /*
- * weight of the inode, increases
- * on each read
- */
- inode_t *inode;
+ struct ioc_table *table;
+ off_t ia_size;
+ struct ioc_cache cache;
+ struct list_head inode_list; /*
+ * list of inodes, maintained by
+ * io-cache translator
+ */
+ struct list_head inode_lru;
+ struct ioc_waitq *waitq;
+ pthread_mutex_t inode_lock;
+ uint32_t weight; /*
+ * weight of the inode, increases
+ * on each read
+ */
+ inode_t *inode;
};
struct ioc_table {
- uint64_t page_size;
- uint64_t cache_size;
- uint64_t cache_used;
- uint64_t min_file_size;
- uint64_t max_file_size;
- struct list_head inodes; /* list of inodes cached */
- struct list_head active;
- struct list_head *inode_lru;
- struct list_head priority_list;
- int32_t readv_count;
- pthread_mutex_t table_lock;
- xlator_t *xl;
- uint32_t inode_count;
- int32_t cache_timeout;
- int32_t max_pri;
- struct mem_pool *mem_pool;
+ uint64_t page_size;
+ uint64_t cache_size;
+ uint64_t cache_used;
+ uint64_t min_file_size;
+ uint64_t max_file_size;
+ struct list_head inodes; /* list of inodes cached */
+ struct list_head active;
+ struct list_head *inode_lru;
+ struct list_head priority_list;
+ int32_t readv_count;
+ pthread_mutex_t table_lock;
+ xlator_t *xl;
+ uint32_t inode_count;
+ int32_t cache_timeout;
+ int32_t max_pri;
+ struct mem_pool *mem_pool;
};
typedef struct ioc_table ioc_table_t;
@@ -175,158 +175,147 @@ typedef struct ioc_waitq ioc_waitq_t;
typedef struct ioc_fill ioc_fill_t;
void *
-str_to_ptr (char *string);
+str_to_ptr(char *string);
char *
-ptr_to_str (void *ptr);
+ptr_to_str(void *ptr);
int32_t
-ioc_readv_disabled_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct iovec *vector,
- int32_t count, struct iatt *stbuf,
- struct iobref *iobref, dict_t *xdata);
+ioc_readv_disabled_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, struct iovec *vector,
+ int32_t count, struct iatt *stbuf, struct iobref *iobref,
+ dict_t *xdata);
ioc_page_t *
-__ioc_page_get (ioc_inode_t *ioc_inode, off_t offset);
+__ioc_page_get(ioc_inode_t *ioc_inode, off_t offset);
ioc_page_t *
-__ioc_page_create (ioc_inode_t *ioc_inode, off_t offset);
+__ioc_page_create(ioc_inode_t *ioc_inode, off_t offset);
void
-ioc_page_fault (ioc_inode_t *ioc_inode, call_frame_t *frame, fd_t *fd,
- off_t offset);
+ioc_page_fault(ioc_inode_t *ioc_inode, call_frame_t *frame, fd_t *fd,
+ off_t offset);
void
-__ioc_wait_on_page (ioc_page_t *page, call_frame_t *frame, off_t offset,
- size_t size);
+__ioc_wait_on_page(ioc_page_t *page, call_frame_t *frame, off_t offset,
+ size_t size);
ioc_waitq_t *
-__ioc_page_wakeup (ioc_page_t *page, int32_t op_errno);
+__ioc_page_wakeup(ioc_page_t *page, int32_t op_errno);
void
-ioc_page_flush (ioc_page_t *page);
+ioc_page_flush(ioc_page_t *page);
ioc_waitq_t *
-__ioc_page_error (ioc_page_t *page, int32_t op_ret, int32_t op_errno);
+__ioc_page_error(ioc_page_t *page, int32_t op_ret, int32_t op_errno);
void
-ioc_frame_return (call_frame_t *frame);
+ioc_frame_return(call_frame_t *frame);
void
-ioc_waitq_return (ioc_waitq_t *waitq);
+ioc_waitq_return(ioc_waitq_t *waitq);
int32_t
-ioc_frame_fill (ioc_page_t *page, call_frame_t *frame, off_t offset,
- size_t size, int32_t op_errno);
-
-#define ioc_inode_lock(ioc_inode) \
- do { \
- gf_msg_trace (ioc_inode->table->xl->name, 0, \
- "locked inode(%p)", ioc_inode); \
- pthread_mutex_lock (&ioc_inode->inode_lock); \
- } while (0)
-
-
-#define ioc_inode_unlock(ioc_inode) \
- do { \
- gf_msg_trace (ioc_inode->table->xl->name, 0, \
- "unlocked inode(%p)", ioc_inode); \
- pthread_mutex_unlock (&ioc_inode->inode_lock); \
- } while (0)
-
-
-#define ioc_table_lock(table) \
- do { \
- gf_msg_trace (table->xl->name, 0, \
- "locked table(%p)", table); \
- pthread_mutex_lock (&table->table_lock); \
- } while (0)
-
-
-#define ioc_table_unlock(table) \
- do { \
- gf_msg_trace (table->xl->name, 0, \
- "unlocked table(%p)", table); \
- pthread_mutex_unlock (&table->table_lock); \
- } while (0)
-
-
-#define ioc_local_lock(local) \
- do { \
- gf_msg_trace (local->inode->table->xl->name, 0, \
- "locked local(%p)", local); \
- pthread_mutex_lock (&local->local_lock); \
- } while (0)
-
-
-#define ioc_local_unlock(local) \
- do { \
- gf_msg_trace (local->inode->table->xl->name, 0, \
- "unlocked local(%p)", local); \
- pthread_mutex_unlock (&local->local_lock); \
- } while (0)
-
-
-#define ioc_page_lock(page) \
- do { \
- gf_msg_trace (page->inode->table->xl->name, 0, \
- "locked page(%p)", page); \
- pthread_mutex_lock (&page->page_lock); \
- } while (0)
-
-
-#define ioc_page_unlock(page) \
- do { \
- gf_msg_trace (page->inode->table->xl->name, 0, \
- "unlocked page(%p)", page); \
- pthread_mutex_unlock (&page->page_lock); \
- } while (0)
-
+ioc_frame_fill(ioc_page_t *page, call_frame_t *frame, off_t offset, size_t size,
+ int32_t op_errno);
+
+#define ioc_inode_lock(ioc_inode) \
+ do { \
+ gf_msg_trace(ioc_inode->table->xl->name, 0, "locked inode(%p)", \
+ ioc_inode); \
+ pthread_mutex_lock(&ioc_inode->inode_lock); \
+ } while (0)
+
+#define ioc_inode_unlock(ioc_inode) \
+ do { \
+ gf_msg_trace(ioc_inode->table->xl->name, 0, "unlocked inode(%p)", \
+ ioc_inode); \
+ pthread_mutex_unlock(&ioc_inode->inode_lock); \
+ } while (0)
+
+#define ioc_table_lock(table) \
+ do { \
+ gf_msg_trace(table->xl->name, 0, "locked table(%p)", table); \
+ pthread_mutex_lock(&table->table_lock); \
+ } while (0)
+
+#define ioc_table_unlock(table) \
+ do { \
+ gf_msg_trace(table->xl->name, 0, "unlocked table(%p)", table); \
+ pthread_mutex_unlock(&table->table_lock); \
+ } while (0)
+
+#define ioc_local_lock(local) \
+ do { \
+ gf_msg_trace(local->inode->table->xl->name, 0, "locked local(%p)", \
+ local); \
+ pthread_mutex_lock(&local->local_lock); \
+ } while (0)
+
+#define ioc_local_unlock(local) \
+ do { \
+ gf_msg_trace(local->inode->table->xl->name, 0, "unlocked local(%p)", \
+ local); \
+ pthread_mutex_unlock(&local->local_lock); \
+ } while (0)
+
+#define ioc_page_lock(page) \
+ do { \
+ gf_msg_trace(page->inode->table->xl->name, 0, "locked page(%p)", \
+ page); \
+ pthread_mutex_lock(&page->page_lock); \
+ } while (0)
+
+#define ioc_page_unlock(page) \
+ do { \
+ gf_msg_trace(page->inode->table->xl->name, 0, "unlocked page(%p)", \
+ page); \
+ pthread_mutex_unlock(&page->page_lock); \
+ } while (0)
static inline uint64_t
-time_elapsed (struct timeval *now,
- struct timeval *then)
+time_elapsed(struct timeval *now, struct timeval *then)
{
- uint64_t sec = now->tv_sec - then->tv_sec;
+ uint64_t sec = now->tv_sec - then->tv_sec;
- if (sec)
- return sec;
+ if (sec)
+ return sec;
- return 0;
+ return 0;
}
ioc_inode_t *
-ioc_inode_search (ioc_table_t *table, inode_t *inode);
+ioc_inode_search(ioc_table_t *table, inode_t *inode);
void
-ioc_inode_destroy (ioc_inode_t *ioc_inode);
+ioc_inode_destroy(ioc_inode_t *ioc_inode);
int32_t
-ioc_inode_update (xlator_t *this, inode_t *inode, char *path,
- struct iatt *iabuf);
+ioc_inode_update(xlator_t *this, inode_t *inode, char *path,
+ struct iatt *iabuf);
ioc_inode_t *
-ioc_inode_create (ioc_table_t *table, inode_t *inode, uint32_t weight);
+ioc_inode_create(ioc_table_t *table, inode_t *inode, uint32_t weight);
int64_t
-__ioc_page_destroy (ioc_page_t *page);
+__ioc_page_destroy(ioc_page_t *page);
int64_t
-__ioc_inode_flush (ioc_inode_t *ioc_inode);
+__ioc_inode_flush(ioc_inode_t *ioc_inode);
void
-ioc_inode_flush (ioc_inode_t *ioc_inode);
+ioc_inode_flush(ioc_inode_t *ioc_inode);
void
-ioc_inode_wakeup (call_frame_t *frame, ioc_inode_t *ioc_inode,
- struct iatt *stbuf);
+ioc_inode_wakeup(call_frame_t *frame, ioc_inode_t *ioc_inode,
+ struct iatt *stbuf);
int8_t
-ioc_cache_still_valid (ioc_inode_t *ioc_inode, struct iatt *stbuf);
+ioc_cache_still_valid(ioc_inode_t *ioc_inode, struct iatt *stbuf);
int32_t
-ioc_prune (ioc_table_t *table);
+ioc_prune(ioc_table_t *table);
int32_t
-ioc_need_prune (ioc_table_t *table);
+ioc_need_prune(ioc_table_t *table);
#endif /* __IO_CACHE_H */
diff --git a/xlators/performance/io-cache/src/ioc-mem-types.h b/xlators/performance/io-cache/src/ioc-mem-types.h
index 9b68f9fce5f..3271840bb43 100644
--- a/xlators/performance/io-cache/src/ioc-mem-types.h
+++ b/xlators/performance/io-cache/src/ioc-mem-types.h
@@ -14,16 +14,16 @@
#include "mem-types.h"
enum gf_ioc_mem_types_ {
- gf_ioc_mt_iovec = gf_common_mt_end + 1,
- gf_ioc_mt_ioc_table_t,
- gf_ioc_mt_char,
- gf_ioc_mt_ioc_waitq_t,
- gf_ioc_mt_ioc_priority,
- gf_ioc_mt_list_head,
- gf_ioc_mt_call_pool_t,
- gf_ioc_mt_ioc_inode_t,
- gf_ioc_mt_ioc_fill_t,
- gf_ioc_mt_ioc_newpage_t,
- gf_ioc_mt_end
+ gf_ioc_mt_iovec = gf_common_mt_end + 1,
+ gf_ioc_mt_ioc_table_t,
+ gf_ioc_mt_char,
+ gf_ioc_mt_ioc_waitq_t,
+ gf_ioc_mt_ioc_priority,
+ gf_ioc_mt_list_head,
+ gf_ioc_mt_call_pool_t,
+ gf_ioc_mt_ioc_inode_t,
+ gf_ioc_mt_ioc_fill_t,
+ gf_ioc_mt_ioc_newpage_t,
+ gf_ioc_mt_end
};
#endif
diff --git a/xlators/performance/io-threads/src/io-threads-messages.h b/xlators/performance/io-threads/src/io-threads-messages.h
index 0f3fe707a36..25e08f4b687 100644
--- a/xlators/performance/io-threads/src/io-threads-messages.h
+++ b/xlators/performance/io-threads/src/io-threads-messages.h
@@ -22,12 +22,8 @@
* glfs-message-id.h.
*/
-GLFS_MSGID(IO_THREADS,
- IO_THREADS_MSG_INIT_FAILED,
- IO_THREADS_MSG_XLATOR_CHILD_MISCONFIGURED,
- IO_THREADS_MSG_NO_MEMORY,
- IO_THREADS_MSG_VOL_MISCONFIGURED,
- IO_THREADS_MSG_SIZE_NOT_SET
-);
+GLFS_MSGID(IO_THREADS, IO_THREADS_MSG_INIT_FAILED,
+ IO_THREADS_MSG_XLATOR_CHILD_MISCONFIGURED, IO_THREADS_MSG_NO_MEMORY,
+ IO_THREADS_MSG_VOL_MISCONFIGURED, IO_THREADS_MSG_SIZE_NOT_SET);
#endif /* _IO_THREADS_MESSAGES_H_ */
diff --git a/xlators/performance/io-threads/src/io-threads.h b/xlators/performance/io-threads/src/io-threads.h
index 7124169b795..949d1d1b1e0 100644
--- a/xlators/performance/io-threads/src/io-threads.h
+++ b/xlators/performance/io-threads/src/io-threads.h
@@ -11,7 +11,6 @@
#ifndef __IOT_H
#define __IOT_H
-
#include "compat-errno.h"
#include "glusterfs.h"
#include "logging.h"
@@ -25,61 +24,60 @@
#include <semaphore.h>
#include "statedump.h"
-
struct iot_conf;
-#define MAX_IDLE_SKEW 4 /* In secs */
-#define skew_sec_idle_time(sec) ((sec) + (random () % MAX_IDLE_SKEW))
-#define IOT_DEFAULT_IDLE 120 /* In secs. */
+#define MAX_IDLE_SKEW 4 /* In secs */
+#define skew_sec_idle_time(sec) ((sec) + (random() % MAX_IDLE_SKEW))
+#define IOT_DEFAULT_IDLE 120 /* In secs. */
-#define IOT_MIN_THREADS 1
-#define IOT_DEFAULT_THREADS 16
-#define IOT_MAX_THREADS 64
+#define IOT_MIN_THREADS 1
+#define IOT_DEFAULT_THREADS 16
+#define IOT_MAX_THREADS 64
-#define IOT_THREAD_STACK_SIZE ((size_t)(256*1024))
+#define IOT_THREAD_STACK_SIZE ((size_t)(256 * 1024))
typedef struct {
- struct list_head clients;
- struct list_head reqs;
+ struct list_head clients;
+ struct list_head reqs;
} iot_client_ctx_t;
struct iot_conf {
- pthread_mutex_t mutex;
- pthread_cond_t cond;
-
- int32_t max_count; /* configured maximum */
- int32_t curr_count; /* actual number of threads running */
- int32_t sleep_count;
-
- int32_t idle_time; /* in seconds */
-
- struct list_head clients[GF_FOP_PRI_MAX];
- /*
- * It turns out that there are several ways a frame can get to us
- * without having an associated client (server_first_lookup was the
- * first one I hit). Instead of trying to update all such callers,
- * we use this to queue them.
- */
- iot_client_ctx_t no_client[GF_FOP_PRI_MAX];
-
- int32_t ac_iot_limit[GF_FOP_PRI_MAX];
- int32_t ac_iot_count[GF_FOP_PRI_MAX];
- int queue_sizes[GF_FOP_PRI_MAX];
- int queue_size;
- pthread_attr_t w_attr;
- gf_boolean_t least_priority; /*Enable/Disable least-priority */
-
- xlator_t *this;
- size_t stack_size;
- gf_boolean_t down; /*PARENT_DOWN event is notified*/
- gf_boolean_t mutex_inited;
- gf_boolean_t cond_inited;
-
- int32_t watchdog_secs;
- gf_boolean_t watchdog_running;
- pthread_t watchdog_thread;
- gf_boolean_t queue_marked[GF_FOP_PRI_MAX];
- gf_boolean_t cleanup_disconnected_reqs;
+ pthread_mutex_t mutex;
+ pthread_cond_t cond;
+
+ int32_t max_count; /* configured maximum */
+ int32_t curr_count; /* actual number of threads running */
+ int32_t sleep_count;
+
+ int32_t idle_time; /* in seconds */
+
+ struct list_head clients[GF_FOP_PRI_MAX];
+ /*
+ * It turns out that there are several ways a frame can get to us
+ * without having an associated client (server_first_lookup was the
+ * first one I hit). Instead of trying to update all such callers,
+ * we use this to queue them.
+ */
+ iot_client_ctx_t no_client[GF_FOP_PRI_MAX];
+
+ int32_t ac_iot_limit[GF_FOP_PRI_MAX];
+ int32_t ac_iot_count[GF_FOP_PRI_MAX];
+ int queue_sizes[GF_FOP_PRI_MAX];
+ int queue_size;
+ pthread_attr_t w_attr;
+ gf_boolean_t least_priority; /*Enable/Disable least-priority */
+
+ xlator_t *this;
+ size_t stack_size;
+ gf_boolean_t down; /*PARENT_DOWN event is notified*/
+ gf_boolean_t mutex_inited;
+ gf_boolean_t cond_inited;
+
+ int32_t watchdog_secs;
+ gf_boolean_t watchdog_running;
+ pthread_t watchdog_thread;
+ gf_boolean_t queue_marked[GF_FOP_PRI_MAX];
+ gf_boolean_t cleanup_disconnected_reqs;
};
typedef struct iot_conf iot_conf_t;
diff --git a/xlators/performance/io-threads/src/iot-mem-types.h b/xlators/performance/io-threads/src/iot-mem-types.h
index fbf9188f9cd..d6b5e7b6899 100644
--- a/xlators/performance/io-threads/src/iot-mem-types.h
+++ b/xlators/performance/io-threads/src/iot-mem-types.h
@@ -8,16 +8,14 @@
cases as published by the Free Software Foundation.
*/
-
#ifndef __IOT_MEM_TYPES_H__
#define __IOT_MEM_TYPES_H__
#include "mem-types.h"
enum gf_iot_mem_types_ {
- gf_iot_mt_iot_conf_t = gf_common_mt_end + 1,
- gf_iot_mt_client_ctx_t,
- gf_iot_mt_end
+ gf_iot_mt_iot_conf_t = gf_common_mt_end + 1,
+ gf_iot_mt_client_ctx_t,
+ gf_iot_mt_end
};
#endif
-
diff --git a/xlators/performance/md-cache/src/md-cache-mem-types.h b/xlators/performance/md-cache/src/md-cache-mem-types.h
index 5cfc68e13c1..e6658577731 100644
--- a/xlators/performance/md-cache/src/md-cache-mem-types.h
+++ b/xlators/performance/md-cache/src/md-cache-mem-types.h
@@ -8,18 +8,16 @@
cases as published by the Free Software Foundation.
*/
-
#ifndef __MDC_MEM_TYPES_H__
#define __MDC_MEM_TYPES_H__
#include "mem-types.h"
enum gf_mdc_mem_types_ {
- gf_mdc_mt_mdc_local_t = gf_common_mt_end + 1,
- gf_mdc_mt_md_cache_t,
- gf_mdc_mt_mdc_conf_t,
- gf_mdc_mt_mdc_ipc,
- gf_mdc_mt_end
+ gf_mdc_mt_mdc_local_t = gf_common_mt_end + 1,
+ gf_mdc_mt_md_cache_t,
+ gf_mdc_mt_mdc_conf_t,
+ gf_mdc_mt_mdc_ipc,
+ gf_mdc_mt_end
};
#endif
-
diff --git a/xlators/performance/md-cache/src/md-cache-messages.h b/xlators/performance/md-cache/src/md-cache-messages.h
index 7aa6fc27824..dfc321372ce 100644
--- a/xlators/performance/md-cache/src/md-cache-messages.h
+++ b/xlators/performance/md-cache/src/md-cache-messages.h
@@ -22,12 +22,8 @@
* glfs-message-id.h.
*/
-GLFS_MSGID(MD_CACHE,
- MD_CACHE_MSG_NO_MEMORY,
- MD_CACHE_MSG_DISCARD_UPDATE,
- MD_CACHE_MSG_CACHE_UPDATE,
- MD_CACHE_MSG_IPC_UPCALL_FAILED,
- MD_CACHE_MSG_NO_XATTR_CACHE
-);
+GLFS_MSGID(MD_CACHE, MD_CACHE_MSG_NO_MEMORY, MD_CACHE_MSG_DISCARD_UPDATE,
+ MD_CACHE_MSG_CACHE_UPDATE, MD_CACHE_MSG_IPC_UPCALL_FAILED,
+ MD_CACHE_MSG_NO_XATTR_CACHE);
#endif /* _MD_CACHE_MESSAGES_H_ */
diff --git a/xlators/performance/nl-cache/src/nl-cache-mem-types.h b/xlators/performance/nl-cache/src/nl-cache-mem-types.h
index 5952402737a..bc61eeca9da 100644
--- a/xlators/performance/nl-cache/src/nl-cache-mem-types.h
+++ b/xlators/performance/nl-cache/src/nl-cache-mem-types.h
@@ -8,22 +8,21 @@
* cases as published by the Free Software Foundation.
*/
-
#ifndef __NL_CACHE_MEM_TYPES_H__
#define __NL_CACHE_MEM_TYPES_H__
#include "mem-types.h"
enum gf_nlc_mem_types_ {
- gf_nlc_mt_conf_t = gf_common_mt_end + 1,
- gf_nlc_mt_nlc_conf_t,
- gf_nlc_mt_nlc_ctx_t,
- gf_nlc_mt_nlc_local_t,
- gf_nlc_mt_nlc_pe_t,
- gf_nlc_mt_nlc_ne_t,
- gf_nlc_mt_nlc_timer_data_t,
- gf_nlc_mt_nlc_lru_node,
- gf_nlc_mt_end
+ gf_nlc_mt_conf_t = gf_common_mt_end + 1,
+ gf_nlc_mt_nlc_conf_t,
+ gf_nlc_mt_nlc_ctx_t,
+ gf_nlc_mt_nlc_local_t,
+ gf_nlc_mt_nlc_pe_t,
+ gf_nlc_mt_nlc_ne_t,
+ gf_nlc_mt_nlc_timer_data_t,
+ gf_nlc_mt_nlc_lru_node,
+ gf_nlc_mt_end
};
#endif /* __NL_CACHE_MEM_TYPES_H__ */
diff --git a/xlators/performance/nl-cache/src/nl-cache-messages.h b/xlators/performance/nl-cache/src/nl-cache-messages.h
index 6afa98f691e..17fd96de17c 100644
--- a/xlators/performance/nl-cache/src/nl-cache-messages.h
+++ b/xlators/performance/nl-cache/src/nl-cache-messages.h
@@ -23,11 +23,7 @@
* glfs-message-id.h.
*/
-GLFS_MSGID(NLC,
- NLC_MSG_NO_MEMORY,
- NLC_MSG_EINVAL,
- NLC_MSG_NO_TIMER_WHEEL,
- NLC_MSG_DICT_FAILURE
-);
+GLFS_MSGID(NLC, NLC_MSG_NO_MEMORY, NLC_MSG_EINVAL, NLC_MSG_NO_TIMER_WHEEL,
+ NLC_MSG_DICT_FAILURE);
#endif /* __NL_CACHE_MESSAGES_H__ */
diff --git a/xlators/performance/nl-cache/src/nl-cache.h b/xlators/performance/nl-cache/src/nl-cache.h
index afc3bec4a7f..9c9682f6396 100644
--- a/xlators/performance/nl-cache/src/nl-cache.h
+++ b/xlators/performance/nl-cache/src/nl-cache.h
@@ -23,153 +23,153 @@
#define NLC_PE_PARTIAL 0x0002
#define NLC_NE_VALID 0x0004
-#define IS_PE_VALID(state) ((state != NLC_INVALID) && \
- (state & (NLC_PE_FULL | NLC_PE_PARTIAL)))
+#define IS_PE_VALID(state) \
+ ((state != NLC_INVALID) && (state & (NLC_PE_FULL | NLC_PE_PARTIAL)))
#define IS_NE_VALID(state) ((state != NLC_INVALID) && (state & NLC_NE_VALID))
#define IS_PEC_ENABLED(conf) (conf->positive_entry_cache)
#define IS_CACHE_ENABLED(conf) ((!conf->cache_disabled))
-#define NLC_STACK_UNWIND(fop, frame, params ...) do { \
- nlc_local_t *__local = NULL; \
- xlator_t *__xl = NULL; \
- if (frame) { \
- __xl = frame->this; \
- __local = frame->local; \
- frame->local = NULL; \
- } \
- STACK_UNWIND_STRICT (fop, frame, params); \
- nlc_local_wipe (__xl, __local); \
-} while (0)
+#define NLC_STACK_UNWIND(fop, frame, params...) \
+ do { \
+ nlc_local_t *__local = NULL; \
+ xlator_t *__xl = NULL; \
+ if (frame) { \
+ __xl = frame->this; \
+ __local = frame->local; \
+ frame->local = NULL; \
+ } \
+ STACK_UNWIND_STRICT(fop, frame, params); \
+ nlc_local_wipe(__xl, __local); \
+ } while (0)
enum nlc_cache_clear_reason {
- NLC_NONE = 0,
- NLC_LRU_PRUNE,
+ NLC_NONE = 0,
+ NLC_LRU_PRUNE,
};
struct nlc_ne {
- struct list_head list;
- char *name;
+ struct list_head list;
+ char *name;
};
typedef struct nlc_ne nlc_ne_t;
struct nlc_pe {
- struct list_head list;
- inode_t *inode;
- char *name;
+ struct list_head list;
+ inode_t *inode;
+ char *name;
};
typedef struct nlc_pe nlc_pe_t;
struct nlc_timer_data {
- inode_t *inode;
- xlator_t *this;
+ inode_t *inode;
+ xlator_t *this;
};
typedef struct nlc_timer_data nlc_timer_data_t;
struct nlc_lru_node {
- inode_t *inode;
- struct list_head list;
+ inode_t *inode;
+ struct list_head list;
};
typedef struct nlc_lru_node nlc_lru_node_t;
struct nlc_ctx {
- struct list_head pe; /* list of positive entries */
- struct list_head ne; /* list of negative entries */
- uint64_t state;
- time_t cache_time;
- struct gf_tw_timer_list *timer;
- nlc_timer_data_t *timer_data;
- size_t cache_size;
- uint64_t refd_inodes;
- gf_lock_t lock;
+ struct list_head pe; /* list of positive entries */
+ struct list_head ne; /* list of negative entries */
+ uint64_t state;
+ time_t cache_time;
+ struct gf_tw_timer_list *timer;
+ nlc_timer_data_t *timer_data;
+ size_t cache_size;
+ uint64_t refd_inodes;
+ gf_lock_t lock;
};
typedef struct nlc_ctx nlc_ctx_t;
struct nlc_local {
- loc_t loc;
- loc_t loc2;
- inode_t *inode;
- inode_t *parent;
- fd_t *fd;
- char *linkname;
- glusterfs_fop_t fop;
+ loc_t loc;
+ loc_t loc2;
+ inode_t *inode;
+ inode_t *parent;
+ fd_t *fd;
+ char *linkname;
+ glusterfs_fop_t fop;
};
typedef struct nlc_local nlc_local_t;
struct nlc_statistics {
- gf_atomic_t nlc_hit; /* No. of times lookup/stat was served from this xl */
- gf_atomic_t nlc_miss; /* No. of times negative lookups were sent to disk */
- /* More granular counters */
- gf_atomic_t nameless_lookup;
- gf_atomic_t getrealfilename_hit;
- gf_atomic_t getrealfilename_miss;
- gf_atomic_t pe_inode_cnt;
- gf_atomic_t ne_inode_cnt;
- gf_atomic_t nlc_invals; /* No. of invalidates received from upcall*/
+ gf_atomic_t nlc_hit; /* No. of times lookup/stat was served from this xl */
+ gf_atomic_t nlc_miss; /* No. of times negative lookups were sent to disk */
+ /* More granular counters */
+ gf_atomic_t nameless_lookup;
+ gf_atomic_t getrealfilename_hit;
+ gf_atomic_t getrealfilename_miss;
+ gf_atomic_t pe_inode_cnt;
+ gf_atomic_t ne_inode_cnt;
+ gf_atomic_t nlc_invals; /* No. of invalidates received from upcall*/
};
struct nlc_conf {
- int32_t cache_timeout;
- gf_boolean_t positive_entry_cache;
- gf_boolean_t negative_entry_cache;
- gf_boolean_t disable_cache;
- uint64_t cache_size;
- gf_atomic_t current_cache_size;
- uint64_t inode_limit;
- gf_atomic_t refd_inodes;
- struct tvec_base *timer_wheel;
- time_t last_child_down;
- struct list_head lru;
- gf_lock_t lock;
- struct nlc_statistics nlc_counter;
+ int32_t cache_timeout;
+ gf_boolean_t positive_entry_cache;
+ gf_boolean_t negative_entry_cache;
+ gf_boolean_t disable_cache;
+ uint64_t cache_size;
+ gf_atomic_t current_cache_size;
+ uint64_t inode_limit;
+ gf_atomic_t refd_inodes;
+ struct tvec_base *timer_wheel;
+ time_t last_child_down;
+ struct list_head lru;
+ gf_lock_t lock;
+ struct nlc_statistics nlc_counter;
};
typedef struct nlc_conf nlc_conf_t;
gf_boolean_t
-nlc_get_real_file_name (xlator_t *this, loc_t *loc, const char *fname,
- int32_t *op_ret, int32_t *op_errno, dict_t *dict);
+nlc_get_real_file_name(xlator_t *this, loc_t *loc, const char *fname,
+ int32_t *op_ret, int32_t *op_errno, dict_t *dict);
gf_boolean_t
-nlc_is_negative_lookup (xlator_t *this, loc_t *loc);
+nlc_is_negative_lookup(xlator_t *this, loc_t *loc);
void
-nlc_set_dir_state (xlator_t *this, inode_t *inode, uint64_t state);
+nlc_set_dir_state(xlator_t *this, inode_t *inode, uint64_t state);
void
-nlc_dir_add_pe (xlator_t *this, inode_t *inode, inode_t *entry_ino,
- const char *name);
+nlc_dir_add_pe(xlator_t *this, inode_t *inode, inode_t *entry_ino,
+ const char *name);
void
-nlc_dir_remove_pe (xlator_t *this, inode_t *inode, inode_t *entry_ino,
- const char *name, gf_boolean_t multilink);
+nlc_dir_remove_pe(xlator_t *this, inode_t *inode, inode_t *entry_ino,
+ const char *name, gf_boolean_t multilink);
void
-nlc_dir_add_ne (xlator_t *this, inode_t *inode, const char *name);
+nlc_dir_add_ne(xlator_t *this, inode_t *inode, const char *name);
void
-nlc_local_wipe (xlator_t *this, nlc_local_t *local);
+nlc_local_wipe(xlator_t *this, nlc_local_t *local);
nlc_local_t *
-nlc_local_init (call_frame_t *frame, xlator_t *this, glusterfs_fop_t fop,
- loc_t *loc, loc_t *loc2);
+nlc_local_init(call_frame_t *frame, xlator_t *this, glusterfs_fop_t fop,
+ loc_t *loc, loc_t *loc2);
void
-nlc_update_child_down_time (xlator_t *this, time_t *now);
+nlc_update_child_down_time(xlator_t *this, time_t *now);
void
-nlc_inode_clear_cache (xlator_t *this, inode_t *inode,
- int reason);
+nlc_inode_clear_cache(xlator_t *this, inode_t *inode, int reason);
void
-nlc_dump_inodectx (xlator_t *this, inode_t *inode);
+nlc_dump_inodectx(xlator_t *this, inode_t *inode);
void
-nlc_clear_all_cache (xlator_t *this);
+nlc_clear_all_cache(xlator_t *this);
void
-nlc_disable_cache (xlator_t *this);
+nlc_disable_cache(xlator_t *this);
void
-nlc_lru_prune (xlator_t *this, inode_t *inode);
+nlc_lru_prune(xlator_t *this, inode_t *inode);
#endif /* __NL_CACHE_H__ */
diff --git a/xlators/performance/open-behind/src/open-behind-mem-types.h b/xlators/performance/open-behind/src/open-behind-mem-types.h
index 8ddd061a835..b16a678cbf4 100644
--- a/xlators/performance/open-behind/src/open-behind-mem-types.h
+++ b/xlators/performance/open-behind/src/open-behind-mem-types.h
@@ -14,9 +14,9 @@
#include "mem-types.h"
enum gf_ob_mem_types_ {
- gf_ob_mt_fd_t = gf_common_mt_end + 1,
- gf_ob_mt_conf_t,
- gf_ob_mt_inode_t,
- gf_ob_mt_end
+ gf_ob_mt_fd_t = gf_common_mt_end + 1,
+ gf_ob_mt_conf_t,
+ gf_ob_mt_inode_t,
+ gf_ob_mt_end
};
#endif
diff --git a/xlators/performance/open-behind/src/open-behind-messages.h b/xlators/performance/open-behind/src/open-behind-messages.h
index 9cb4cd5228f..09b4e8f0c28 100644
--- a/xlators/performance/open-behind/src/open-behind-messages.h
+++ b/xlators/performance/open-behind/src/open-behind-messages.h
@@ -22,10 +22,7 @@
* glfs-message-id.h.
*/
-GLFS_MSGID(OPEN_BEHIND,
- OPEN_BEHIND_MSG_XLATOR_CHILD_MISCONFIGURED,
- OPEN_BEHIND_MSG_VOL_MISCONFIGURED,
- OPEN_BEHIND_MSG_NO_MEMORY
-);
+GLFS_MSGID(OPEN_BEHIND, OPEN_BEHIND_MSG_XLATOR_CHILD_MISCONFIGURED,
+ OPEN_BEHIND_MSG_VOL_MISCONFIGURED, OPEN_BEHIND_MSG_NO_MEMORY);
#endif /* _OPEN_BEHIND_MESSAGES_H_ */
diff --git a/xlators/performance/quick-read/src/quick-read-mem-types.h b/xlators/performance/quick-read/src/quick-read-mem-types.h
index 78547f64116..0ebd7e81c3a 100644
--- a/xlators/performance/quick-read/src/quick-read-mem-types.h
+++ b/xlators/performance/quick-read/src/quick-read-mem-types.h
@@ -14,14 +14,14 @@
#include "mem-types.h"
enum gf_qr_mem_types_ {
- gf_qr_mt_qr_inode_t = gf_common_mt_end + 1,
- gf_qr_mt_content_t,
- gf_qr_mt_qr_fd_ctx_t,
- gf_qr_mt_iovec,
- gf_qr_mt_qr_conf_t,
- gf_qr_mt_qr_priority_t,
- gf_qr_mt_qr_private_t,
- gf_qr_mt_qr_unlink_ctx_t,
- gf_qr_mt_end
+ gf_qr_mt_qr_inode_t = gf_common_mt_end + 1,
+ gf_qr_mt_content_t,
+ gf_qr_mt_qr_fd_ctx_t,
+ gf_qr_mt_iovec,
+ gf_qr_mt_qr_conf_t,
+ gf_qr_mt_qr_priority_t,
+ gf_qr_mt_qr_private_t,
+ gf_qr_mt_qr_unlink_ctx_t,
+ gf_qr_mt_end
};
#endif
diff --git a/xlators/performance/quick-read/src/quick-read-messages.h b/xlators/performance/quick-read/src/quick-read-messages.h
index 5f55658a82d..745eabbc664 100644
--- a/xlators/performance/quick-read/src/quick-read-messages.h
+++ b/xlators/performance/quick-read/src/quick-read-messages.h
@@ -22,15 +22,10 @@
* glfs-message-id.h.
*/
-GLFS_MSGID(QUICK_READ,
- QUICK_READ_MSG_ENFORCEMENT_FAILED,
- QUICK_READ_MSG_INVALID_ARGUMENT,
- QUICK_READ_MSG_XLATOR_CHILD_MISCONFIGURED,
- QUICK_READ_MSG_NO_MEMORY,
- QUICK_READ_MSG_VOL_MISCONFIGURED,
- QUICK_READ_MSG_DICT_SET_FAILED,
- QUICK_READ_MSG_INVALID_CONFIG,
- QUICK_READ_MSG_LRU_NOT_EMPTY
-);
+GLFS_MSGID(QUICK_READ, QUICK_READ_MSG_ENFORCEMENT_FAILED,
+ QUICK_READ_MSG_INVALID_ARGUMENT,
+ QUICK_READ_MSG_XLATOR_CHILD_MISCONFIGURED, QUICK_READ_MSG_NO_MEMORY,
+ QUICK_READ_MSG_VOL_MISCONFIGURED, QUICK_READ_MSG_DICT_SET_FAILED,
+ QUICK_READ_MSG_INVALID_CONFIG, QUICK_READ_MSG_LRU_NOT_EMPTY);
#endif /* _QUICK_READ_MESSAGES_H_ */
diff --git a/xlators/performance/quick-read/src/quick-read.h b/xlators/performance/quick-read/src/quick-read.h
index 0f816cd8431..ae99863b426 100644
--- a/xlators/performance/quick-read/src/quick-read.h
+++ b/xlators/performance/quick-read/src/quick-read.h
@@ -29,66 +29,63 @@
#include <fnmatch.h>
#include "quick-read-mem-types.h"
-
struct qr_inode {
- void *data;
- size_t size;
- int priority;
- uint32_t ia_mtime;
- uint32_t ia_mtime_nsec;
- uint32_t ia_ctime;
- uint32_t ia_ctime_nsec;
- uint32_t gen_rollover;
- struct iatt buf;
- struct timeval last_refresh;
- struct list_head lru;
- uint64_t gen;
- uint64_t invalidation_time;
+ void *data;
+ size_t size;
+ int priority;
+ uint32_t ia_mtime;
+ uint32_t ia_mtime_nsec;
+ uint32_t ia_ctime;
+ uint32_t ia_ctime_nsec;
+ uint32_t gen_rollover;
+ struct iatt buf;
+ struct timeval last_refresh;
+ struct list_head lru;
+ uint64_t gen;
+ uint64_t invalidation_time;
};
typedef struct qr_inode qr_inode_t;
-
struct qr_priority {
- char *pattern;
- int32_t priority;
- struct list_head list;
+ char *pattern;
+ int32_t priority;
+ struct list_head list;
};
typedef struct qr_priority qr_priority_t;
struct qr_conf {
- uint64_t max_file_size;
- int32_t cache_timeout;
- uint64_t cache_size;
- int max_pri;
- gf_boolean_t qr_invalidation;
- gf_boolean_t ctime_invalidation;
- struct list_head priority_list;
+ uint64_t max_file_size;
+ int32_t cache_timeout;
+ uint64_t cache_size;
+ int max_pri;
+ gf_boolean_t qr_invalidation;
+ gf_boolean_t ctime_invalidation;
+ struct list_head priority_list;
};
typedef struct qr_conf qr_conf_t;
struct qr_inode_table {
- uint64_t cache_used;
- struct list_head *lru;
- gf_lock_t lock;
+ uint64_t cache_used;
+ struct list_head *lru;
+ gf_lock_t lock;
};
typedef struct qr_inode_table qr_inode_table_t;
struct qr_statistics {
- gf_atomic_t cache_hit;
- gf_atomic_t cache_miss;
- gf_atomic_t file_data_invals; /* No. of invalidates received from upcall */
- gf_atomic_t files_cached;
+ gf_atomic_t cache_hit;
+ gf_atomic_t cache_miss;
+ gf_atomic_t file_data_invals; /* No. of invalidates received from upcall */
+ gf_atomic_t files_cached;
};
struct qr_private {
- qr_conf_t conf;
- qr_inode_table_t table;
- time_t last_child_down;
- gf_lock_t lock;
- struct qr_statistics qr_counter;
- gf_atomic_int32_t generation;
+ qr_conf_t conf;
+ qr_inode_table_t table;
+ time_t last_child_down;
+ gf_lock_t lock;
+ struct qr_statistics qr_counter;
+ gf_atomic_int32_t generation;
};
typedef struct qr_private qr_private_t;
-
#endif /* #ifndef __QUICK_READ_H */
diff --git a/xlators/performance/read-ahead/src/read-ahead-mem-types.h b/xlators/performance/read-ahead/src/read-ahead-mem-types.h
index 219e2928919..239e574506a 100644
--- a/xlators/performance/read-ahead/src/read-ahead-mem-types.h
+++ b/xlators/performance/read-ahead/src/read-ahead-mem-types.h
@@ -8,19 +8,18 @@
cases as published by the Free Software Foundation.
*/
-
#ifndef __RA_MEM_TYPES_H__
#define __RA_MEM_TYPES_H__
#include "mem-types.h"
enum gf_ra_mem_types_ {
- gf_ra_mt_ra_file_t = gf_common_mt_end + 1,
- gf_ra_mt_ra_conf_t,
- gf_ra_mt_ra_page_t,
- gf_ra_mt_ra_waitq_t,
- gf_ra_mt_ra_fill_t,
- gf_ra_mt_iovec,
- gf_ra_mt_end
+ gf_ra_mt_ra_file_t = gf_common_mt_end + 1,
+ gf_ra_mt_ra_conf_t,
+ gf_ra_mt_ra_page_t,
+ gf_ra_mt_ra_waitq_t,
+ gf_ra_mt_ra_fill_t,
+ gf_ra_mt_iovec,
+ gf_ra_mt_end
};
#endif
diff --git a/xlators/performance/read-ahead/src/read-ahead-messages.h b/xlators/performance/read-ahead/src/read-ahead-messages.h
index b2e6a1bced7..500d3246946 100644
--- a/xlators/performance/read-ahead/src/read-ahead-messages.h
+++ b/xlators/performance/read-ahead/src/read-ahead-messages.h
@@ -22,13 +22,10 @@
* glfs-message-id.h.
*/
-GLFS_MSGID(READ_AHEAD,
- READ_AHEAD_MSG_XLATOR_CHILD_MISCONFIGURED,
- READ_AHEAD_MSG_VOL_MISCONFIGURED,
- READ_AHEAD_MSG_NO_MEMORY,
- READ_AHEAD_MSG_FD_CONTEXT_NOT_SET,
- READ_AHEAD_MSG_UNDESTROYED_FILE_FOUND,
- READ_AHEAD_MSG_XLATOR_CONF_NULL
-);
+GLFS_MSGID(READ_AHEAD, READ_AHEAD_MSG_XLATOR_CHILD_MISCONFIGURED,
+ READ_AHEAD_MSG_VOL_MISCONFIGURED, READ_AHEAD_MSG_NO_MEMORY,
+ READ_AHEAD_MSG_FD_CONTEXT_NOT_SET,
+ READ_AHEAD_MSG_UNDESTROYED_FILE_FOUND,
+ READ_AHEAD_MSG_XLATOR_CONF_NULL);
#endif /* _READ_AHEAD_MESSAGES_H_ */
diff --git a/xlators/performance/read-ahead/src/read-ahead.h b/xlators/performance/read-ahead/src/read-ahead.h
index debcd8fdeb4..4e99853cc32 100644
--- a/xlators/performance/read-ahead/src/read-ahead.h
+++ b/xlators/performance/read-ahead/src/read-ahead.h
@@ -11,7 +11,6 @@
#ifndef __READ_AHEAD_H
#define __READ_AHEAD_H
-
#include "glusterfs.h"
#include "logging.h"
#include "dict.h"
@@ -25,84 +24,77 @@ struct ra_page;
struct ra_file;
struct ra_waitq;
-
struct ra_waitq {
- struct ra_waitq *next;
- void *data;
+ struct ra_waitq *next;
+ void *data;
};
-
struct ra_fill {
- struct ra_fill *next;
- struct ra_fill *prev;
- off_t offset;
- size_t size;
- struct iovec *vector;
- int32_t count;
- struct iobref *iobref;
+ struct ra_fill *next;
+ struct ra_fill *prev;
+ off_t offset;
+ size_t size;
+ struct iovec *vector;
+ int32_t count;
+ struct iobref *iobref;
};
-
struct ra_local {
- mode_t mode;
- struct ra_fill fill;
- off_t offset;
- size_t size;
- int32_t op_ret;
- int32_t op_errno;
- off_t pending_offset;
- size_t pending_size;
- fd_t *fd;
- int32_t wait_count;
- pthread_mutex_t local_lock;
+ mode_t mode;
+ struct ra_fill fill;
+ off_t offset;
+ size_t size;
+ int32_t op_ret;
+ int32_t op_errno;
+ off_t pending_offset;
+ size_t pending_size;
+ fd_t *fd;
+ int32_t wait_count;
+ pthread_mutex_t local_lock;
};
-
struct ra_page {
- struct ra_page *next;
- struct ra_page *prev;
- struct ra_file *file;
- char dirty; /* Internal request, not from user. */
- char poisoned; /* Pending read invalidated by write. */
- char ready;
- struct iovec *vector;
- int32_t count;
- off_t offset;
- size_t size;
- struct ra_waitq *waitq;
- struct iobref *iobref;
- char stale;
+ struct ra_page *next;
+ struct ra_page *prev;
+ struct ra_file *file;
+ char dirty; /* Internal request, not from user. */
+ char poisoned; /* Pending read invalidated by write. */
+ char ready;
+ struct iovec *vector;
+ int32_t count;
+ off_t offset;
+ size_t size;
+ struct ra_waitq *waitq;
+ struct iobref *iobref;
+ char stale;
};
-
struct ra_file {
- struct ra_file *next;
- struct ra_file *prev;
- struct ra_conf *conf;
- fd_t *fd;
- int disabled;
- size_t expected;
- struct ra_page pages;
- off_t offset;
- size_t size;
- int32_t refcount;
- pthread_mutex_t file_lock;
- struct iatt stbuf;
- uint64_t page_size;
- uint32_t page_count;
+ struct ra_file *next;
+ struct ra_file *prev;
+ struct ra_conf *conf;
+ fd_t *fd;
+ int disabled;
+ size_t expected;
+ struct ra_page pages;
+ off_t offset;
+ size_t size;
+ int32_t refcount;
+ pthread_mutex_t file_lock;
+ struct iatt stbuf;
+ uint64_t page_size;
+ uint32_t page_count;
};
-
struct ra_conf {
- uint64_t page_size;
- uint32_t page_count;
- void *cache_block;
- struct ra_file files;
- gf_boolean_t force_atime_update;
- pthread_mutex_t conf_lock;
+ uint64_t page_size;
+ uint32_t page_count;
+ void *cache_block;
+ struct ra_file files;
+ gf_boolean_t force_atime_update;
+ pthread_mutex_t conf_lock;
};
-
typedef struct ra_conf ra_conf_t;
typedef struct ra_local ra_local_t;
typedef struct ra_page ra_page_t;
@@ -111,77 +103,69 @@ typedef struct ra_waitq ra_waitq_t;
typedef struct ra_fill ra_fill_t;
ra_page_t *
-ra_page_get (ra_file_t *file,
- off_t offset);
+ra_page_get(ra_file_t *file, off_t offset);
ra_page_t *
-ra_page_create (ra_file_t *file,
- off_t offset);
+ra_page_create(ra_file_t *file, off_t offset);
void
-ra_page_fault (ra_file_t *file,
- call_frame_t *frame,
- off_t offset);
+ra_page_fault(ra_file_t *file, call_frame_t *frame, off_t offset);
void
-ra_wait_on_page (ra_page_t *page,
- call_frame_t *frame);
+ra_wait_on_page(ra_page_t *page, call_frame_t *frame);
ra_waitq_t *
-ra_page_wakeup (ra_page_t *page);
+ra_page_wakeup(ra_page_t *page);
void
-ra_page_flush (ra_page_t *page);
+ra_page_flush(ra_page_t *page);
ra_waitq_t *
-ra_page_error (ra_page_t *page,
- int32_t op_ret,
- int32_t op_errno);
+ra_page_error(ra_page_t *page, int32_t op_ret, int32_t op_errno);
void
-ra_page_purge (ra_page_t *page);
+ra_page_purge(ra_page_t *page);
void
-ra_frame_return (call_frame_t *frame);
+ra_frame_return(call_frame_t *frame);
void
-ra_frame_fill (ra_page_t *page,
- call_frame_t *frame);
+ra_frame_fill(ra_page_t *page, call_frame_t *frame);
void
-ra_file_destroy (ra_file_t *file);
+ra_file_destroy(ra_file_t *file);
static inline void
-ra_file_lock (ra_file_t *file)
+ra_file_lock(ra_file_t *file)
{
- pthread_mutex_lock (&file->file_lock);
+ pthread_mutex_lock(&file->file_lock);
}
static inline void
-ra_file_unlock (ra_file_t *file)
+ra_file_unlock(ra_file_t *file)
{
- pthread_mutex_unlock (&file->file_lock);
+ pthread_mutex_unlock(&file->file_lock);
}
static inline void
-ra_conf_lock (ra_conf_t *conf)
+ra_conf_lock(ra_conf_t *conf)
{
- pthread_mutex_lock (&conf->conf_lock);
+ pthread_mutex_lock(&conf->conf_lock);
}
static inline void
-ra_conf_unlock (ra_conf_t *conf)
+ra_conf_unlock(ra_conf_t *conf)
{
- pthread_mutex_unlock (&conf->conf_lock);
+ pthread_mutex_unlock(&conf->conf_lock);
}
static inline void
-ra_local_lock (ra_local_t *local)
+ra_local_lock(ra_local_t *local)
{
- pthread_mutex_lock (&local->local_lock);
+ pthread_mutex_lock(&local->local_lock);
}
static inline void
-ra_local_unlock (ra_local_t *local)
+ra_local_unlock(ra_local_t *local)
{
- pthread_mutex_unlock (&local->local_lock);
+ pthread_mutex_unlock(&local->local_lock);
}
#endif /* __READ_AHEAD_H */
diff --git a/xlators/performance/readdir-ahead/src/readdir-ahead-mem-types.h b/xlators/performance/readdir-ahead/src/readdir-ahead-mem-types.h
index ae533840c7e..e2462b48833 100644
--- a/xlators/performance/readdir-ahead/src/readdir-ahead-mem-types.h
+++ b/xlators/performance/readdir-ahead/src/readdir-ahead-mem-types.h
@@ -8,18 +8,17 @@
cases as published by the Free Software Foundation.
*/
-
#ifndef __RDA_MEM_TYPES_H__
#define __RDA_MEM_TYPES_H__
#include "mem-types.h"
enum gf_rda_mem_types_ {
- gf_rda_mt_rda_local = gf_common_mt_end + 1,
- gf_rda_mt_rda_fd_ctx,
- gf_rda_mt_rda_priv,
- gf_rda_mt_inode_ctx_t,
- gf_rda_mt_end
+ gf_rda_mt_rda_local = gf_common_mt_end + 1,
+ gf_rda_mt_rda_fd_ctx,
+ gf_rda_mt_rda_priv,
+ gf_rda_mt_inode_ctx_t,
+ gf_rda_mt_end
};
#endif
diff --git a/xlators/performance/readdir-ahead/src/readdir-ahead-messages.h b/xlators/performance/readdir-ahead/src/readdir-ahead-messages.h
index fdcebe21f69..c9ce16307e6 100644
--- a/xlators/performance/readdir-ahead/src/readdir-ahead-messages.h
+++ b/xlators/performance/readdir-ahead/src/readdir-ahead-messages.h
@@ -22,13 +22,9 @@
* glfs-message-id.h.
*/
-GLFS_MSGID(READDIR_AHEAD,
- READDIR_AHEAD_MSG_XLATOR_CHILD_MISCONFIGURED,
- READDIR_AHEAD_MSG_VOL_MISCONFIGURED,
- READDIR_AHEAD_MSG_NO_MEMORY,
- READDIR_AHEAD_MSG_DIR_RELEASE_PENDING_STUB,
- READDIR_AHEAD_MSG_OUT_OF_SEQUENCE,
- READDIR_AHEAD_MSG_DICT_OP_FAILED
-);
+GLFS_MSGID(READDIR_AHEAD, READDIR_AHEAD_MSG_XLATOR_CHILD_MISCONFIGURED,
+ READDIR_AHEAD_MSG_VOL_MISCONFIGURED, READDIR_AHEAD_MSG_NO_MEMORY,
+ READDIR_AHEAD_MSG_DIR_RELEASE_PENDING_STUB,
+ READDIR_AHEAD_MSG_OUT_OF_SEQUENCE, READDIR_AHEAD_MSG_DICT_OP_FAILED);
#endif /* _READDIR_AHEAD_MESSAGES_H_ */
diff --git a/xlators/performance/readdir-ahead/src/readdir-ahead.h b/xlators/performance/readdir-ahead/src/readdir-ahead.h
index 7dbed4c60ed..b5e13800826 100644
--- a/xlators/performance/readdir-ahead/src/readdir-ahead.h
+++ b/xlators/performance/readdir-ahead/src/readdir-ahead.h
@@ -12,86 +12,85 @@
#define __READDIR_AHEAD_H
/* state flags */
-#define RDA_FD_NEW (1 << 0)
-#define RDA_FD_RUNNING (1 << 1)
-#define RDA_FD_EOD (1 << 2)
-#define RDA_FD_ERROR (1 << 3)
-#define RDA_FD_BYPASS (1 << 4)
-#define RDA_FD_PLUGGED (1 << 5)
+#define RDA_FD_NEW (1 << 0)
+#define RDA_FD_RUNNING (1 << 1)
+#define RDA_FD_EOD (1 << 2)
+#define RDA_FD_ERROR (1 << 3)
+#define RDA_FD_BYPASS (1 << 4)
+#define RDA_FD_PLUGGED (1 << 5)
-
-#define RDA_COMMON_MODIFICATION_FOP(name, frame, this, __inode, __xdata, args ...)\
- do { \
- struct rda_local *__local = NULL; \
- rda_inode_ctx_t *ctx_p = NULL; \
+#define RDA_COMMON_MODIFICATION_FOP(name, frame, this, __inode, __xdata, \
+ args...) \
+ do { \
+ struct rda_local *__local = NULL; \
+ rda_inode_ctx_t *ctx_p = NULL; \
\
- __local = mem_get0 (this->local_pool); \
- __local->inode = inode_ref (__inode); \
- LOCK (&__inode->lock); \
- { \
- ctx_p = __rda_inode_ctx_get (__inode, this); \
- } \
- UNLOCK (&__inode->lock); \
- __local->generation = GF_ATOMIC_GET (ctx_p->generation); \
+ __local = mem_get0(this->local_pool); \
+ __local->inode = inode_ref(__inode); \
+ LOCK(&__inode->lock); \
+ { \
+ ctx_p = __rda_inode_ctx_get(__inode, this); \
+ } \
+ UNLOCK(&__inode->lock); \
+ __local->generation = GF_ATOMIC_GET(ctx_p->generation); \
\
- frame->local = __local; \
- if (__xdata) \
- __local->xattrs = dict_ref (__xdata); \
+ frame->local = __local; \
+ if (__xdata) \
+ __local->xattrs = dict_ref(__xdata); \
\
- STACK_WIND (frame, rda_##name##_cbk, FIRST_CHILD(this), \
- FIRST_CHILD(this)->fops->name, args, __xdata); \
- } while (0)
-
-
-#define RDA_STACK_UNWIND(fop, frame, params ...) do { \
- struct rda_local *__local = NULL; \
- if (frame) { \
- __local = frame->local; \
- frame->local = NULL; \
- } \
- STACK_UNWIND_STRICT (fop, frame, params); \
- if (__local) { \
- rda_local_wipe (__local); \
- mem_put (__local); \
- } \
-} while (0)
+ STACK_WIND(frame, rda_##name##_cbk, FIRST_CHILD(this), \
+ FIRST_CHILD(this)->fops->name, args, __xdata); \
+ } while (0)
+#define RDA_STACK_UNWIND(fop, frame, params...) \
+ do { \
+ struct rda_local *__local = NULL; \
+ if (frame) { \
+ __local = frame->local; \
+ frame->local = NULL; \
+ } \
+ STACK_UNWIND_STRICT(fop, frame, params); \
+ if (__local) { \
+ rda_local_wipe(__local); \
+ mem_put(__local); \
+ } \
+ } while (0)
struct rda_fd_ctx {
- off_t cur_offset; /* current head of the ctx */
- size_t cur_size; /* current size of the preload */
- off_t next_offset; /* tail of the ctx */
- uint32_t state;
- gf_lock_t lock;
- gf_dirent_t entries;
- call_frame_t *fill_frame;
- call_stub_t *stub;
- int op_errno;
- dict_t *xattrs; /* md-cache keys to be sent in readdirp() */
+ off_t cur_offset; /* current head of the ctx */
+ size_t cur_size; /* current size of the preload */
+ off_t next_offset; /* tail of the ctx */
+ uint32_t state;
+ gf_lock_t lock;
+ gf_dirent_t entries;
+ call_frame_t *fill_frame;
+ call_stub_t *stub;
+ int op_errno;
+ dict_t *xattrs; /* md-cache keys to be sent in readdirp() */
};
struct rda_local {
- struct rda_fd_ctx *ctx;
- fd_t *fd;
- dict_t *xattrs; /* md-cache keys to be sent in readdirp() */
- inode_t *inode;
- off_t offset;
- uint64_t generation;
- int32_t skip_dir;
+ struct rda_fd_ctx *ctx;
+ fd_t *fd;
+ dict_t *xattrs; /* md-cache keys to be sent in readdirp() */
+ inode_t *inode;
+ off_t offset;
+ uint64_t generation;
+ int32_t skip_dir;
};
struct rda_priv {
- uint64_t rda_req_size;
- uint64_t rda_low_wmark;
- uint64_t rda_high_wmark;
- uint64_t rda_cache_limit;
- gf_atomic_t rda_cache_size;
- gf_boolean_t parallel_readdir;
+ uint64_t rda_req_size;
+ uint64_t rda_low_wmark;
+ uint64_t rda_high_wmark;
+ uint64_t rda_cache_limit;
+ gf_atomic_t rda_cache_size;
+ gf_boolean_t parallel_readdir;
};
typedef struct rda_inode_ctx {
- struct iatt statbuf;
- gf_atomic_t generation;
+ struct iatt statbuf;
+ gf_atomic_t generation;
} rda_inode_ctx_t;
#endif /* __READDIR_AHEAD_H */
diff --git a/xlators/performance/symlink-cache/src/symlink-cache-messages.h b/xlators/performance/symlink-cache/src/symlink-cache-messages.h
index 46685b7695d..c1ef1a67f9b 100644
--- a/xlators/performance/symlink-cache/src/symlink-cache-messages.h
+++ b/xlators/performance/symlink-cache/src/symlink-cache-messages.h
@@ -22,12 +22,9 @@
* glfs-message-id.h.
*/
-GLFS_MSGID(SYMLINK_CACHE,
- SYMLINK_CACHE_MSG_XLATOR_CHILD_MISCONFIGURED,
- SYMLINK_CACHE_MSG_VOL_MISCONFIGURED,
- SYMLINK_CACHE_MSG_NO_MEMORY,
- SYMLINK_CACHE_MSG_DICT_GET_FAILED,
- SYMLINK_CACHE_MSG_DICT_SET_FAILED
-);
+GLFS_MSGID(SYMLINK_CACHE, SYMLINK_CACHE_MSG_XLATOR_CHILD_MISCONFIGURED,
+ SYMLINK_CACHE_MSG_VOL_MISCONFIGURED, SYMLINK_CACHE_MSG_NO_MEMORY,
+ SYMLINK_CACHE_MSG_DICT_GET_FAILED,
+ SYMLINK_CACHE_MSG_DICT_SET_FAILED);
#endif /* _SYMLINK_CACHE_MESSAGES_H_ */
diff --git a/xlators/performance/write-behind/src/write-behind-mem-types.h b/xlators/performance/write-behind/src/write-behind-mem-types.h
index f64f429ce22..c92a7d4c1f4 100644
--- a/xlators/performance/write-behind/src/write-behind-mem-types.h
+++ b/xlators/performance/write-behind/src/write-behind-mem-types.h
@@ -8,19 +8,17 @@
cases as published by the Free Software Foundation.
*/
-
#ifndef __WB_MEM_TYPES_H__
#define __WB_MEM_TYPES_H__
#include "mem-types.h"
enum gf_wb_mem_types_ {
- gf_wb_mt_wb_file_t = gf_common_mt_end + 1,
- gf_wb_mt_wb_request_t,
- gf_wb_mt_iovec,
- gf_wb_mt_wb_conf_t,
- gf_wb_mt_wb_inode_t,
- gf_wb_mt_end
+ gf_wb_mt_wb_file_t = gf_common_mt_end + 1,
+ gf_wb_mt_wb_request_t,
+ gf_wb_mt_iovec,
+ gf_wb_mt_wb_conf_t,
+ gf_wb_mt_wb_inode_t,
+ gf_wb_mt_end
};
#endif
-
diff --git a/xlators/performance/write-behind/src/write-behind-messages.h b/xlators/performance/write-behind/src/write-behind-messages.h
index cf16b0afc6e..914fc63dda6 100644
--- a/xlators/performance/write-behind/src/write-behind-messages.h
+++ b/xlators/performance/write-behind/src/write-behind-messages.h
@@ -22,14 +22,10 @@
* glfs-message-id.h.
*/
-GLFS_MSGID(WRITE_BEHIND,
- WRITE_BEHIND_MSG_EXCEEDED_MAX_SIZE,
- WRITE_BEHIND_MSG_INIT_FAILED,
- WRITE_BEHIND_MSG_INVALID_ARGUMENT,
- WRITE_BEHIND_MSG_NO_MEMORY,
- WRITE_BEHIND_MSG_SIZE_NOT_SET,
- WRITE_BEHIND_MSG_VOL_MISCONFIGURED,
- WRITE_BEHIND_MSG_RES_UNAVAILABLE
-);
+GLFS_MSGID(WRITE_BEHIND, WRITE_BEHIND_MSG_EXCEEDED_MAX_SIZE,
+ WRITE_BEHIND_MSG_INIT_FAILED, WRITE_BEHIND_MSG_INVALID_ARGUMENT,
+ WRITE_BEHIND_MSG_NO_MEMORY, WRITE_BEHIND_MSG_SIZE_NOT_SET,
+ WRITE_BEHIND_MSG_VOL_MISCONFIGURED,
+ WRITE_BEHIND_MSG_RES_UNAVAILABLE);
#endif /* _WRITE_BEHIND_MESSAGES_H_ */
diff --git a/xlators/playground/template/src/template.h b/xlators/playground/template/src/template.h
index e384c0181f7..0abe2245296 100644
--- a/xlators/playground/template/src/template.h
+++ b/xlators/playground/template/src/template.h
@@ -17,8 +17,8 @@
#include "defaults.h"
struct template_private {
- /* Add all the relevant fields you need here */
- int32_t dummy;
+ /* Add all the relevant fields you need here */
+ int32_t dummy;
};
typedef struct template_private template_private_t;
@@ -27,8 +27,8 @@ typedef struct template_private template_private_t;
#include "mem-types.h"
enum gf_template_mem_types_ {
- gf_template_mt_private_t = gf_common_mt_end + 1,
- gf_template_mt_end,
+ gf_template_mt_private_t = gf_common_mt_end + 1,
+ gf_template_mt_end,
};
/* This normally goes to another file 'template-messages.h",
@@ -38,9 +38,6 @@ enum gf_template_mem_types_ {
*/
#include "glfs-message-id.h"
-GLFS_MSGID(TEMPLATE,
- TEMPLATE_MSG_NO_MEMORY,
- TEMPLATE_MSG_NO_GRAPH
- );
+GLFS_MSGID(TEMPLATE, TEMPLATE_MSG_NO_MEMORY, TEMPLATE_MSG_NO_GRAPH);
#endif /* __TEMPLATE_H__ */
diff --git a/xlators/protocol/client/src/client-common.h b/xlators/protocol/client/src/client-common.h
index b0690aa75d8..21d416d9f27 100644
--- a/xlators/protocol/client/src/client-common.h
+++ b/xlators/protocol/client/src/client-common.h
@@ -20,629 +20,605 @@
#include "client.h"
int
-client_pre_stat (xlator_t *this, gfs3_stat_req *req, loc_t *loc,
- dict_t *xdata);
+client_pre_stat(xlator_t *this, gfs3_stat_req *req, loc_t *loc, dict_t *xdata);
int
-client_pre_readlink (xlator_t *this, gfs3_readlink_req *req, loc_t *loc,
- size_t size, dict_t *xdata);
+client_pre_readlink(xlator_t *this, gfs3_readlink_req *req, loc_t *loc,
+ size_t size, dict_t *xdata);
int
-client_pre_mknod (xlator_t *this, gfs3_mknod_req *req, loc_t *loc,
- mode_t mode, dev_t rdev, mode_t umask, dict_t *xdata);
+client_pre_mknod(xlator_t *this, gfs3_mknod_req *req, loc_t *loc, mode_t mode,
+ dev_t rdev, mode_t umask, dict_t *xdata);
int
-client_pre_mkdir (xlator_t *this, gfs3_mkdir_req *req, loc_t *loc,
- mode_t mode, mode_t umask, dict_t *xdata);
+client_pre_mkdir(xlator_t *this, gfs3_mkdir_req *req, loc_t *loc, mode_t mode,
+ mode_t umask, dict_t *xdata);
int
-client_pre_unlink (xlator_t *this, gfs3_unlink_req *req, loc_t *loc,
- int32_t flags, dict_t *xdata);
+client_pre_unlink(xlator_t *this, gfs3_unlink_req *req, loc_t *loc,
+ int32_t flags, dict_t *xdata);
int
-client_pre_rmdir (xlator_t *this, gfs3_rmdir_req *req, loc_t *loc,
- int32_t flags, dict_t *xdata);
+client_pre_rmdir(xlator_t *this, gfs3_rmdir_req *req, loc_t *loc, int32_t flags,
+ dict_t *xdata);
int
-client_pre_symlink (xlator_t *this, gfs3_symlink_req *req, loc_t *loc,
- const char *linkname, mode_t umask, dict_t *xdata);
+client_pre_symlink(xlator_t *this, gfs3_symlink_req *req, loc_t *loc,
+ const char *linkname, mode_t umask, dict_t *xdata);
int
-client_pre_rename (xlator_t *this, gfs3_rename_req *req, loc_t *oldloc,
- loc_t *newloc, dict_t *xdata);
+client_pre_rename(xlator_t *this, gfs3_rename_req *req, loc_t *oldloc,
+ loc_t *newloc, dict_t *xdata);
int
-client_pre_link (xlator_t *this,
- gfs3_link_req *req, loc_t *oldloc, loc_t *newloc,
- dict_t *xdata);
+client_pre_link(xlator_t *this, gfs3_link_req *req, loc_t *oldloc,
+ loc_t *newloc, dict_t *xdata);
int
-client_pre_truncate (xlator_t *this, gfs3_truncate_req *req,
- loc_t *loc, off_t offset, dict_t *xdata);
+client_pre_truncate(xlator_t *this, gfs3_truncate_req *req, loc_t *loc,
+ off_t offset, dict_t *xdata);
int
-client_pre_open (xlator_t *this, gfs3_open_req *req, loc_t *loc, fd_t *fd,
- int32_t flags, dict_t *xdata);
+client_pre_open(xlator_t *this, gfs3_open_req *req, loc_t *loc, fd_t *fd,
+ int32_t flags, dict_t *xdata);
int
-client_pre_readv (xlator_t *this, gfs3_read_req *req, fd_t *fd, size_t size,
- off_t offset, int32_t flags, dict_t *xdata);
+client_pre_readv(xlator_t *this, gfs3_read_req *req, fd_t *fd, size_t size,
+ off_t offset, int32_t flags, dict_t *xdata);
int
-client_pre_writev (xlator_t *this, gfs3_write_req *req,
- fd_t *fd, size_t size, off_t offset, int32_t flags,
- dict_t **xdata);
+client_pre_writev(xlator_t *this, gfs3_write_req *req, fd_t *fd, size_t size,
+ off_t offset, int32_t flags, dict_t **xdata);
int
-client_pre_statfs (xlator_t *this, gfs3_statfs_req *req, loc_t *loc,
- dict_t *xdata);
+client_pre_statfs(xlator_t *this, gfs3_statfs_req *req, loc_t *loc,
+ dict_t *xdata);
int
-client_pre_flush (xlator_t *this, gfs3_flush_req *req, fd_t *fd, dict_t *xdata);
+client_pre_flush(xlator_t *this, gfs3_flush_req *req, fd_t *fd, dict_t *xdata);
int
-client_pre_fsync (xlator_t *this, gfs3_fsync_req *req, fd_t *fd,
- int32_t flags, dict_t *xdata);
+client_pre_fsync(xlator_t *this, gfs3_fsync_req *req, fd_t *fd, int32_t flags,
+ dict_t *xdata);
int
-client_pre_setxattr (xlator_t *this, gfs3_setxattr_req *req, loc_t *loc,
- dict_t *xattr, int32_t flags, dict_t *xdata);
+client_pre_setxattr(xlator_t *this, gfs3_setxattr_req *req, loc_t *loc,
+ dict_t *xattr, int32_t flags, dict_t *xdata);
int
-client_pre_getxattr (xlator_t *this, gfs3_getxattr_req *req, loc_t *loc,
- const char *name, dict_t *xdata);
+client_pre_getxattr(xlator_t *this, gfs3_getxattr_req *req, loc_t *loc,
+ const char *name, dict_t *xdata);
int
-client_pre_removexattr (xlator_t *this, gfs3_removexattr_req *req,
- loc_t *loc, const char *name, dict_t *xdata);
+client_pre_removexattr(xlator_t *this, gfs3_removexattr_req *req, loc_t *loc,
+ const char *name, dict_t *xdata);
int
-client_pre_opendir (xlator_t *this,
- gfs3_opendir_req *req, loc_t *loc,
- fd_t *fd, dict_t *xdata);
+client_pre_opendir(xlator_t *this, gfs3_opendir_req *req, loc_t *loc, fd_t *fd,
+ dict_t *xdata);
int
-client_pre_fsyncdir (xlator_t *this, gfs3_fsyncdir_req *req, fd_t *fd,
- int32_t flags, dict_t *xdata);
+client_pre_fsyncdir(xlator_t *this, gfs3_fsyncdir_req *req, fd_t *fd,
+ int32_t flags, dict_t *xdata);
int
-client_pre_access (xlator_t *this, gfs3_access_req *req, loc_t *loc,
- int32_t mask, dict_t *xdata);
+client_pre_access(xlator_t *this, gfs3_access_req *req, loc_t *loc,
+ int32_t mask, dict_t *xdata);
int
-client_pre_create (xlator_t *this, gfs3_create_req *req,
- loc_t *loc, fd_t *fd, mode_t mode,
- int32_t flags, mode_t umask, dict_t *xdata);
+client_pre_create(xlator_t *this, gfs3_create_req *req, loc_t *loc, fd_t *fd,
+ mode_t mode, int32_t flags, mode_t umask, dict_t *xdata);
int
-client_pre_ftruncate (xlator_t *this, gfs3_ftruncate_req *req, fd_t *fd,
- off_t offset, dict_t *xdata);
+client_pre_ftruncate(xlator_t *this, gfs3_ftruncate_req *req, fd_t *fd,
+ off_t offset, dict_t *xdata);
int
-client_pre_fstat (xlator_t *this, gfs3_fstat_req *req, fd_t *fd,
- dict_t *xdata);
+client_pre_fstat(xlator_t *this, gfs3_fstat_req *req, fd_t *fd, dict_t *xdata);
int
-client_pre_lk (xlator_t *this, gfs3_lk_req *req,
- int32_t cmd, struct gf_flock *flock, fd_t *fd, dict_t *xdata);
+client_pre_lk(xlator_t *this, gfs3_lk_req *req, int32_t cmd,
+ struct gf_flock *flock, fd_t *fd, dict_t *xdata);
int
-client_pre_lookup (xlator_t *this, gfs3_lookup_req *req, loc_t *loc,
- dict_t *xdata);
+client_pre_lookup(xlator_t *this, gfs3_lookup_req *req, loc_t *loc,
+ dict_t *xdata);
int
-client_pre_readdir (xlator_t *this, gfs3_readdir_req *req, fd_t *fd,
- size_t size, off_t offset, dict_t *xdata);
+client_pre_readdir(xlator_t *this, gfs3_readdir_req *req, fd_t *fd, size_t size,
+ off_t offset, dict_t *xdata);
int
-client_pre_inodelk (xlator_t *this, gfs3_inodelk_req *req, loc_t *loc,
- int cmd, struct gf_flock *flock, const char *volume,
- dict_t *xdata);
+client_pre_inodelk(xlator_t *this, gfs3_inodelk_req *req, loc_t *loc, int cmd,
+ struct gf_flock *flock, const char *volume, dict_t *xdata);
int
-client_pre_finodelk (xlator_t *this, gfs3_finodelk_req *req, fd_t *fd,
- int cmd, struct gf_flock *flock, const char *volume,
- dict_t *xdata);
+client_pre_finodelk(xlator_t *this, gfs3_finodelk_req *req, fd_t *fd, int cmd,
+ struct gf_flock *flock, const char *volume, dict_t *xdata);
int
-client_pre_entrylk (xlator_t *this, gfs3_entrylk_req *req, loc_t *loc,
- entrylk_cmd cmd_entrylk, entrylk_type type,
- const char *volume, const char *basename, dict_t *xdata);
+client_pre_entrylk(xlator_t *this, gfs3_entrylk_req *req, loc_t *loc,
+ entrylk_cmd cmd_entrylk, entrylk_type type,
+ const char *volume, const char *basename, dict_t *xdata);
int
-client_pre_fentrylk (xlator_t *this, gfs3_fentrylk_req *req, fd_t *fd,
- entrylk_cmd cmd_entrylk, entrylk_type type,
- const char *volume, const char *basename, dict_t *xdata);
+client_pre_fentrylk(xlator_t *this, gfs3_fentrylk_req *req, fd_t *fd,
+ entrylk_cmd cmd_entrylk, entrylk_type type,
+ const char *volume, const char *basename, dict_t *xdata);
int
-client_pre_xattrop (xlator_t *this, gfs3_xattrop_req *req, loc_t *loc,
- dict_t *xattr, int32_t flags, dict_t *xdata);
+client_pre_xattrop(xlator_t *this, gfs3_xattrop_req *req, loc_t *loc,
+ dict_t *xattr, int32_t flags, dict_t *xdata);
int
-client_pre_fxattrop (xlator_t *this, gfs3_fxattrop_req *req, fd_t *fd,
+client_pre_fxattrop(xlator_t *this, gfs3_fxattrop_req *req, fd_t *fd,
dict_t *xattr, int32_t flags, dict_t *xdata);
int
-client_pre_fgetxattr (xlator_t *this, gfs3_fgetxattr_req *req, fd_t *fd,
- const char *name, dict_t *xdata);
+client_pre_fgetxattr(xlator_t *this, gfs3_fgetxattr_req *req, fd_t *fd,
+ const char *name, dict_t *xdata);
int
-client_pre_fsetxattr (xlator_t *this, gfs3_fsetxattr_req *req, fd_t *fd,
- int32_t flags, dict_t *xattr, dict_t *xdata);
+client_pre_fsetxattr(xlator_t *this, gfs3_fsetxattr_req *req, fd_t *fd,
+ int32_t flags, dict_t *xattr, dict_t *xdata);
int
-client_pre_seek (xlator_t *this, gfs3_seek_req *req, fd_t *fd,
- off_t offset, gf_seek_what_t what, dict_t *xdata);
+client_pre_seek(xlator_t *this, gfs3_seek_req *req, fd_t *fd, off_t offset,
+ gf_seek_what_t what, dict_t *xdata);
int
-client_pre_rchecksum (xlator_t *this, gfs3_rchecksum_req *req, fd_t *fd,
- int32_t len, off_t offset, dict_t *xdata);
+client_pre_rchecksum(xlator_t *this, gfs3_rchecksum_req *req, fd_t *fd,
+ int32_t len, off_t offset, dict_t *xdata);
int
-client_pre_setattr (xlator_t *this, gfs3_setattr_req *req, loc_t *loc,
- int32_t valid, struct iatt *stbuf, dict_t *xdata);
+client_pre_setattr(xlator_t *this, gfs3_setattr_req *req, loc_t *loc,
+ int32_t valid, struct iatt *stbuf, dict_t *xdata);
int
-client_pre_fsetattr (xlator_t *this, gfs3_fsetattr_req *req, fd_t *fd,
- int32_t valid, struct iatt *stbuf, dict_t *xdata);
+client_pre_fsetattr(xlator_t *this, gfs3_fsetattr_req *req, fd_t *fd,
+ int32_t valid, struct iatt *stbuf, dict_t *xdata);
int
-client_pre_readdirp (xlator_t *this, gfs3_readdirp_req *req, fd_t *fd,
- size_t size, off_t offset, dict_t *xdata);
+client_pre_readdirp(xlator_t *this, gfs3_readdirp_req *req, fd_t *fd,
+ size_t size, off_t offset, dict_t *xdata);
int
-client_pre_fremovexattr (xlator_t *this, gfs3_fremovexattr_req *req, fd_t *fd,
- const char *name, dict_t *xdata);
+client_pre_fremovexattr(xlator_t *this, gfs3_fremovexattr_req *req, fd_t *fd,
+ const char *name, dict_t *xdata);
int
-client_pre_fallocate (xlator_t *this, gfs3_fallocate_req *req, fd_t *fd,
- int32_t flags, off_t offset, size_t size, dict_t *xdata);
+client_pre_fallocate(xlator_t *this, gfs3_fallocate_req *req, fd_t *fd,
+ int32_t flags, off_t offset, size_t size, dict_t *xdata);
int
-client_pre_discard (xlator_t *this, gfs3_discard_req *req, fd_t *fd,
- off_t offset, size_t size, dict_t *xdata);
+client_pre_discard(xlator_t *this, gfs3_discard_req *req, fd_t *fd,
+ off_t offset, size_t size, dict_t *xdata);
int
-client_pre_zerofill (xlator_t *this, gfs3_zerofill_req *req, fd_t *fd,
- off_t offset, size_t size, dict_t *xdata);
+client_pre_zerofill(xlator_t *this, gfs3_zerofill_req *req, fd_t *fd,
+ off_t offset, size_t size, dict_t *xdata);
int
-client_pre_ipc (xlator_t *this, gfs3_ipc_req *req, int32_t cmd,
- dict_t *xdata);
+client_pre_ipc(xlator_t *this, gfs3_ipc_req *req, int32_t cmd, dict_t *xdata);
int
-client_pre_lease (xlator_t *this, gfs3_lease_req *req, loc_t *loc,
- struct gf_lease *lease, dict_t *xdata);
+client_pre_lease(xlator_t *this, gfs3_lease_req *req, loc_t *loc,
+ struct gf_lease *lease, dict_t *xdata);
int
-client_post_stat (xlator_t *this, gfs3_stat_rsp *rsp, struct iatt *iatt,
- dict_t **xdata);
+client_post_stat(xlator_t *this, gfs3_stat_rsp *rsp, struct iatt *iatt,
+ dict_t **xdata);
int
-client_post_readlink (xlator_t *this, gfs3_readlink_rsp *rsp,
- struct iatt *iatt, dict_t **xdata);
+client_post_readlink(xlator_t *this, gfs3_readlink_rsp *rsp, struct iatt *iatt,
+ dict_t **xdata);
int
-client_post_mknod (xlator_t *this, gfs3_mknod_rsp *rsp, struct iatt *stbuf,
- struct iatt *preparent, struct iatt *postparent,
- dict_t **xdata);
+client_post_mknod(xlator_t *this, gfs3_mknod_rsp *rsp, struct iatt *stbuf,
+ struct iatt *preparent, struct iatt *postparent,
+ dict_t **xdata);
int
-client_post_mkdir (xlator_t *this, gfs3_mkdir_rsp *rsp, struct iatt *stbuf,
- struct iatt *preparent, struct iatt *postparent,
- dict_t **xdata);
+client_post_mkdir(xlator_t *this, gfs3_mkdir_rsp *rsp, struct iatt *stbuf,
+ struct iatt *preparent, struct iatt *postparent,
+ dict_t **xdata);
int
-client_post_unlink (xlator_t *this, gfs3_unlink_rsp *rsp,
- struct iatt *preparent, struct iatt *postparent,
- dict_t **xdata);
+client_post_unlink(xlator_t *this, gfs3_unlink_rsp *rsp, struct iatt *preparent,
+ struct iatt *postparent, dict_t **xdata);
int
-client_post_rmdir (xlator_t *this, gfs3_rmdir_rsp *rsp,
- struct iatt *preparent, struct iatt *postparent,
- dict_t **xdata);
+client_post_rmdir(xlator_t *this, gfs3_rmdir_rsp *rsp, struct iatt *preparent,
+ struct iatt *postparent, dict_t **xdata);
int
-client_post_symlink (xlator_t *this, gfs3_symlink_rsp *rsp, struct iatt *stbuf,
- struct iatt *preparent, struct iatt *postparent,
- dict_t **xdata);
+client_post_symlink(xlator_t *this, gfs3_symlink_rsp *rsp, struct iatt *stbuf,
+ struct iatt *preparent, struct iatt *postparent,
+ dict_t **xdata);
int
-client_post_rename (xlator_t *this, gfs3_rename_rsp *rsp, struct iatt *stbuf,
+client_post_rename(xlator_t *this, gfs3_rename_rsp *rsp, struct iatt *stbuf,
struct iatt *preoldparent, struct iatt *postoldparent,
struct iatt *prenewparent, struct iatt *postnewparent,
dict_t **xdata);
int
-client_post_link (xlator_t *this, gfs3_link_rsp *rsp, struct iatt *stbuf,
- struct iatt *preparent, struct iatt *postparent,
- dict_t **xdata);
+client_post_link(xlator_t *this, gfs3_link_rsp *rsp, struct iatt *stbuf,
+ struct iatt *preparent, struct iatt *postparent,
+ dict_t **xdata);
int
-client_post_truncate (xlator_t *this, gfs3_truncate_rsp *rsp,
- struct iatt *prestat, struct iatt *poststat,
- dict_t **xdata);
+client_post_truncate(xlator_t *this, gfs3_truncate_rsp *rsp,
+ struct iatt *prestat, struct iatt *poststat,
+ dict_t **xdata);
int
-client_post_open (xlator_t *this, gfs3_open_rsp *rsp, dict_t **xdata);
+client_post_open(xlator_t *this, gfs3_open_rsp *rsp, dict_t **xdata);
int
-client_post_readv (xlator_t *this, gfs3_read_rsp *rsp, struct iobref **iobref,
- struct iobref *rsp_iobref, struct iatt *stat,
- struct iovec *vector, struct iovec *rsp_vector,
- int *rspcount, dict_t **xdata);
+client_post_readv(xlator_t *this, gfs3_read_rsp *rsp, struct iobref **iobref,
+ struct iobref *rsp_iobref, struct iatt *stat,
+ struct iovec *vector, struct iovec *rsp_vector, int *rspcount,
+ dict_t **xdata);
int
-client_post_writev (xlator_t *this, gfs3_write_rsp *rsp, struct iatt *prestat,
- struct iatt *poststat, dict_t **xdata);
+client_post_writev(xlator_t *this, gfs3_write_rsp *rsp, struct iatt *prestat,
+ struct iatt *poststat, dict_t **xdata);
int
-client_post_statfs (xlator_t *this, gfs3_statfs_rsp *rsp,
- struct statvfs *statfs, dict_t **xdata);
+client_post_statfs(xlator_t *this, gfs3_statfs_rsp *rsp, struct statvfs *statfs,
+ dict_t **xdata);
int
-client_post_flush (xlator_t *this, gf_common_rsp *rsp, dict_t **xdata);
+client_post_flush(xlator_t *this, gf_common_rsp *rsp, dict_t **xdata);
int
-client_post_fsync (xlator_t *this, gfs3_fsync_rsp *rsp,
- struct iatt *prestat, struct iatt *poststat,
- dict_t **xdata);
+client_post_fsync(xlator_t *this, gfs3_fsync_rsp *rsp, struct iatt *prestat,
+ struct iatt *poststat, dict_t **xdata);
int
-client_post_setxattr (xlator_t *this, gf_common_rsp *rsp, dict_t **xdata);
+client_post_setxattr(xlator_t *this, gf_common_rsp *rsp, dict_t **xdata);
int
-client_post_getxattr (xlator_t *this, gfs3_getxattr_rsp *rsp, dict_t **dict,
- dict_t **xdata);
+client_post_getxattr(xlator_t *this, gfs3_getxattr_rsp *rsp, dict_t **dict,
+ dict_t **xdata);
int
-client_post_removexattr (xlator_t *this, gf_common_rsp *rsp,
- dict_t **xdata);
+client_post_removexattr(xlator_t *this, gf_common_rsp *rsp, dict_t **xdata);
int
-client_post_opendir (xlator_t *this, gfs3_opendir_rsp *rsp, dict_t **xdata);
+client_post_opendir(xlator_t *this, gfs3_opendir_rsp *rsp, dict_t **xdata);
int
-client_post_fsyncdir (xlator_t *this, gf_common_rsp *rsp, dict_t **xdata);
+client_post_fsyncdir(xlator_t *this, gf_common_rsp *rsp, dict_t **xdata);
int
-client_post_access (xlator_t *this, gf_common_rsp *rsp, dict_t **xdata);
+client_post_access(xlator_t *this, gf_common_rsp *rsp, dict_t **xdata);
int
-client_post_create (xlator_t *this, gfs3_create_rsp *rsp,
- struct iatt *stbuf, struct iatt *preparent,
- struct iatt *postparent,
- clnt_local_t *local, dict_t **xdata);
+client_post_create(xlator_t *this, gfs3_create_rsp *rsp, struct iatt *stbuf,
+ struct iatt *preparent, struct iatt *postparent,
+ clnt_local_t *local, dict_t **xdata);
int
-client_post_ftruncate (xlator_t *this, gfs3_ftruncate_rsp *rsp,
- struct iatt *prestat, struct iatt *poststat,
- dict_t **xdata);
+client_post_ftruncate(xlator_t *this, gfs3_ftruncate_rsp *rsp,
+ struct iatt *prestat, struct iatt *poststat,
+ dict_t **xdata);
int
-client_post_fstat (xlator_t *this, gfs3_fstat_rsp *rsp, struct iatt *stat,
- dict_t **xdata);
+client_post_fstat(xlator_t *this, gfs3_fstat_rsp *rsp, struct iatt *stat,
+ dict_t **xdata);
int
-client_post_lk (xlator_t *this, gfs3_lk_rsp *rsp, struct gf_flock *lock,
- dict_t **xdata);
+client_post_lk(xlator_t *this, gfs3_lk_rsp *rsp, struct gf_flock *lock,
+ dict_t **xdata);
int
-client_post_lookup (xlator_t *this, gfs3_lookup_rsp *rsp, struct iatt *stbuf,
- struct iatt *postparent, dict_t **xdata);
+client_post_lookup(xlator_t *this, gfs3_lookup_rsp *rsp, struct iatt *stbuf,
+ struct iatt *postparent, dict_t **xdata);
int
-client_post_readdir (xlator_t *this, gfs3_readdir_rsp *rsp,
- gf_dirent_t *entries, dict_t **xdata);
+client_post_readdir(xlator_t *this, gfs3_readdir_rsp *rsp, gf_dirent_t *entries,
+ dict_t **xdata);
int
-client_post_inodelk (xlator_t *this, gf_common_rsp *rsp, dict_t **xdata);
+client_post_inodelk(xlator_t *this, gf_common_rsp *rsp, dict_t **xdata);
int
-client_post_finodelk (xlator_t *this, gf_common_rsp *rsp, dict_t **xdata);
+client_post_finodelk(xlator_t *this, gf_common_rsp *rsp, dict_t **xdata);
int
-client_post_entrylk (xlator_t *this, gf_common_rsp *rsp, dict_t **xdata);
+client_post_entrylk(xlator_t *this, gf_common_rsp *rsp, dict_t **xdata);
int
-client_post_fentrylk (xlator_t *this, gf_common_rsp *rsp, dict_t **xdata);
+client_post_fentrylk(xlator_t *this, gf_common_rsp *rsp, dict_t **xdata);
int
-client_post_xattrop (xlator_t *this, gfs3_xattrop_rsp *rsp, dict_t **dict,
- dict_t **xdata);
+client_post_xattrop(xlator_t *this, gfs3_xattrop_rsp *rsp, dict_t **dict,
+ dict_t **xdata);
int
-client_post_fxattrop (xlator_t *this, gfs3_fxattrop_rsp *rsp, dict_t **dict,
- dict_t **xdata);
+client_post_fxattrop(xlator_t *this, gfs3_fxattrop_rsp *rsp, dict_t **dict,
+ dict_t **xdata);
int
-client_post_fgetxattr (xlator_t *this, gfs3_fgetxattr_rsp *rsp, dict_t **dict,
+client_post_fgetxattr(xlator_t *this, gfs3_fgetxattr_rsp *rsp, dict_t **dict,
dict_t **xdata);
int
-client_post_fsetxattr (xlator_t *this, gf_common_rsp *rsp, dict_t **xdata);
+client_post_fsetxattr(xlator_t *this, gf_common_rsp *rsp, dict_t **xdata);
int
-client_post_rchecksum (xlator_t *this, gfs3_rchecksum_rsp *rsp, dict_t **xdata);
+client_post_rchecksum(xlator_t *this, gfs3_rchecksum_rsp *rsp, dict_t **xdata);
int
-client_post_setattr (xlator_t *this, gfs3_setattr_rsp *rsp,
- struct iatt *prestat, struct iatt *poststat,
- dict_t **xdata);
+client_post_setattr(xlator_t *this, gfs3_setattr_rsp *rsp, struct iatt *prestat,
+ struct iatt *poststat, dict_t **xdata);
int
-client_post_fsetattr (xlator_t *this, gfs3_fsetattr_rsp *rsp,
- struct iatt *prestat, struct iatt *poststat,
- dict_t **xdata);
+client_post_fsetattr(xlator_t *this, gfs3_fsetattr_rsp *rsp,
+ struct iatt *prestat, struct iatt *poststat,
+ dict_t **xdata);
int
-client_post_readdirp (xlator_t *this, gfs3_readdirp_rsp *rsp,
- fd_t *fd, gf_dirent_t *entries,
- dict_t **xdata);
+client_post_readdirp(xlator_t *this, gfs3_readdirp_rsp *rsp, fd_t *fd,
+ gf_dirent_t *entries, dict_t **xdata);
int
-client_post_fremovexattr (xlator_t *this, gf_common_rsp *rsp,
- dict_t **xdata);
+client_post_fremovexattr(xlator_t *this, gf_common_rsp *rsp, dict_t **xdata);
int
-client_post_fallocate (xlator_t *this, gfs3_fallocate_rsp *rsp,
- struct iatt *prestat, struct iatt *poststat,
- dict_t **xdata);
+client_post_fallocate(xlator_t *this, gfs3_fallocate_rsp *rsp,
+ struct iatt *prestat, struct iatt *poststat,
+ dict_t **xdata);
int
-client_post_discard (xlator_t *this, gfs3_discard_rsp *rsp,
- struct iatt *prestat,
- struct iatt *poststat, dict_t **xdata);
+client_post_discard(xlator_t *this, gfs3_discard_rsp *rsp, struct iatt *prestat,
+ struct iatt *poststat, dict_t **xdata);
int
-client_post_zerofill (xlator_t *this, gfs3_zerofill_rsp *rsp,
+client_post_zerofill(xlator_t *this, gfs3_zerofill_rsp *rsp,
struct iatt *prestat, struct iatt *poststat,
dict_t **xdata);
int
-client_post_ipc (xlator_t *this, gfs3_ipc_rsp *rsp, dict_t **xdata);
+client_post_ipc(xlator_t *this, gfs3_ipc_rsp *rsp, dict_t **xdata);
int
-client_post_seek (xlator_t *this, gfs3_seek_rsp *rsp, dict_t **xdata);
+client_post_seek(xlator_t *this, gfs3_seek_rsp *rsp, dict_t **xdata);
int
-client_post_lease (xlator_t *this, gfs3_lease_rsp *rsp, struct gf_lease *lease,
- dict_t **xdata);
+client_post_lease(xlator_t *this, gfs3_lease_rsp *rsp, struct gf_lease *lease,
+ dict_t **xdata);
/* New functions for version 4 */
int
-client_post_common_dict (xlator_t *this, gfx_common_dict_rsp *rsp, dict_t **dict,
- dict_t **xdata);
+client_post_common_dict(xlator_t *this, gfx_common_dict_rsp *rsp, dict_t **dict,
+ dict_t **xdata);
int
-client_post_common_3iatt (xlator_t *this, gfx_common_3iatt_rsp *rsp, struct iatt *iatt,
- struct iatt *iatt2, struct iatt *iatt3, dict_t **xdata);
+client_post_common_3iatt(xlator_t *this, gfx_common_3iatt_rsp *rsp,
+ struct iatt *iatt, struct iatt *iatt2,
+ struct iatt *iatt3, dict_t **xdata);
int
-client_post_common_2iatt (xlator_t *this, gfx_common_2iatt_rsp *rsp, struct iatt *iatt,
- struct iatt *iatt2, dict_t **xdata);
+client_post_common_2iatt(xlator_t *this, gfx_common_2iatt_rsp *rsp,
+ struct iatt *iatt, struct iatt *iatt2, dict_t **xdata);
int
-client_post_common_iatt (xlator_t *this, gfx_common_iatt_rsp *rsp, struct iatt *iatt,
- dict_t **xdata);
+client_post_common_iatt(xlator_t *this, gfx_common_iatt_rsp *rsp,
+ struct iatt *iatt, dict_t **xdata);
int
-client_post_common_rsp (xlator_t *this, gfx_common_rsp *rsp, dict_t **xdata);
+client_post_common_rsp(xlator_t *this, gfx_common_rsp *rsp, dict_t **xdata);
+int
+client_pre_stat_v2(xlator_t *this, gfx_stat_req *req, loc_t *loc,
+ dict_t *xdata);
int
-client_pre_stat_v2 (xlator_t *this, gfx_stat_req *req, loc_t *loc,
- dict_t *xdata);
+client_pre_readlink_v2(xlator_t *this, gfx_readlink_req *req, loc_t *loc,
+ size_t size, dict_t *xdata);
int
-client_pre_readlink_v2 (xlator_t *this, gfx_readlink_req *req, loc_t *loc,
- size_t size, dict_t *xdata);
+client_pre_mknod_v2(xlator_t *this, gfx_mknod_req *req, loc_t *loc, mode_t mode,
+ dev_t rdev, mode_t umask, dict_t *xdata);
int
-client_pre_mknod_v2 (xlator_t *this, gfx_mknod_req *req, loc_t *loc,
- mode_t mode, dev_t rdev, mode_t umask, dict_t *xdata);
+client_pre_mkdir_v2(xlator_t *this, gfx_mkdir_req *req, loc_t *loc, mode_t mode,
+ mode_t umask, dict_t *xdata);
int
-client_pre_mkdir_v2 (xlator_t *this, gfx_mkdir_req *req, loc_t *loc,
- mode_t mode, mode_t umask, dict_t *xdata);
+client_pre_unlink_v2(xlator_t *this, gfx_unlink_req *req, loc_t *loc,
+ int32_t flags, dict_t *xdata);
int
-client_pre_unlink_v2 (xlator_t *this, gfx_unlink_req *req, loc_t *loc,
+client_pre_rmdir_v2(xlator_t *this, gfx_rmdir_req *req, loc_t *loc,
int32_t flags, dict_t *xdata);
int
-client_pre_rmdir_v2 (xlator_t *this, gfx_rmdir_req *req, loc_t *loc,
- int32_t flags, dict_t *xdata);
+client_pre_symlink_v2(xlator_t *this, gfx_symlink_req *req, loc_t *loc,
+ const char *linkname, mode_t umask, dict_t *xdata);
int
-client_pre_symlink_v2 (xlator_t *this, gfx_symlink_req *req, loc_t *loc,
- const char *linkname, mode_t umask, dict_t *xdata);
+client_pre_rename_v2(xlator_t *this, gfx_rename_req *req, loc_t *oldloc,
+ loc_t *newloc, dict_t *xdata);
int
-client_pre_rename_v2 (xlator_t *this, gfx_rename_req *req, loc_t *oldloc,
+client_pre_link_v2(xlator_t *this, gfx_link_req *req, loc_t *oldloc,
loc_t *newloc, dict_t *xdata);
int
-client_pre_link_v2 (xlator_t *this,
- gfx_link_req *req, loc_t *oldloc, loc_t *newloc,
- dict_t *xdata);
-
-int
-client_pre_truncate_v2 (xlator_t *this, gfx_truncate_req *req,
- loc_t *loc, off_t offset, dict_t *xdata);
-
-int
-client_pre_open_v2 (xlator_t *this, gfx_open_req *req, loc_t *loc, fd_t *fd,
- int32_t flags, dict_t *xdata);
+client_pre_truncate_v2(xlator_t *this, gfx_truncate_req *req, loc_t *loc,
+ off_t offset, dict_t *xdata);
int
-client_pre_readv_v2 (xlator_t *this, gfx_read_req *req, fd_t *fd, size_t size,
- off_t offset, int32_t flags, dict_t *xdata);
+client_pre_open_v2(xlator_t *this, gfx_open_req *req, loc_t *loc, fd_t *fd,
+ int32_t flags, dict_t *xdata);
int
-client_pre_writev_v2 (xlator_t *this, gfx_write_req *req,
- fd_t *fd, size_t size, off_t offset, int32_t flags,
- dict_t **xdata);
+client_pre_readv_v2(xlator_t *this, gfx_read_req *req, fd_t *fd, size_t size,
+ off_t offset, int32_t flags, dict_t *xdata);
int
-client_pre_statfs_v2 (xlator_t *this, gfx_statfs_req *req, loc_t *loc,
- dict_t *xdata);
+client_pre_writev_v2(xlator_t *this, gfx_write_req *req, fd_t *fd, size_t size,
+ off_t offset, int32_t flags, dict_t **xdata);
int
-client_pre_flush_v2 (xlator_t *this, gfx_flush_req *req, fd_t *fd, dict_t *xdata);
+client_pre_statfs_v2(xlator_t *this, gfx_statfs_req *req, loc_t *loc,
+ dict_t *xdata);
int
-client_pre_fsync_v2 (xlator_t *this, gfx_fsync_req *req, fd_t *fd,
- int32_t flags, dict_t *xdata);
+client_pre_flush_v2(xlator_t *this, gfx_flush_req *req, fd_t *fd,
+ dict_t *xdata);
int
-client_pre_setxattr_v2 (xlator_t *this, gfx_setxattr_req *req, loc_t *loc,
- dict_t *xattr, int32_t flags, dict_t *xdata);
+client_pre_fsync_v2(xlator_t *this, gfx_fsync_req *req, fd_t *fd, int32_t flags,
+ dict_t *xdata);
int
-client_pre_getxattr_v2 (xlator_t *this, gfx_getxattr_req *req, loc_t *loc,
- const char *name, dict_t *xdata);
+client_pre_setxattr_v2(xlator_t *this, gfx_setxattr_req *req, loc_t *loc,
+ dict_t *xattr, int32_t flags, dict_t *xdata);
int
-client_pre_removexattr_v2 (xlator_t *this, gfx_removexattr_req *req,
- loc_t *loc, const char *name, dict_t *xdata);
+client_pre_getxattr_v2(xlator_t *this, gfx_getxattr_req *req, loc_t *loc,
+ const char *name, dict_t *xdata);
int
-client_pre_opendir_v2 (xlator_t *this,
- gfx_opendir_req *req, loc_t *loc,
- fd_t *fd, dict_t *xdata);
+client_pre_removexattr_v2(xlator_t *this, gfx_removexattr_req *req, loc_t *loc,
+ const char *name, dict_t *xdata);
int
-client_pre_fsyncdir_v2 (xlator_t *this, gfx_fsyncdir_req *req, fd_t *fd,
- int32_t flags, dict_t *xdata);
+client_pre_opendir_v2(xlator_t *this, gfx_opendir_req *req, loc_t *loc,
+ fd_t *fd, dict_t *xdata);
int
-client_pre_access_v2 (xlator_t *this, gfx_access_req *req, loc_t *loc,
- int32_t mask, dict_t *xdata);
+client_pre_fsyncdir_v2(xlator_t *this, gfx_fsyncdir_req *req, fd_t *fd,
+ int32_t flags, dict_t *xdata);
int
-client_pre_create_v2 (xlator_t *this, gfx_create_req *req,
- loc_t *loc, fd_t *fd, mode_t mode,
- int32_t flags, mode_t umask, dict_t *xdata);
+client_pre_access_v2(xlator_t *this, gfx_access_req *req, loc_t *loc,
+ int32_t mask, dict_t *xdata);
int
-client_pre_ftruncate_v2 (xlator_t *this, gfx_ftruncate_req *req, fd_t *fd,
- off_t offset, dict_t *xdata);
+client_pre_create_v2(xlator_t *this, gfx_create_req *req, loc_t *loc, fd_t *fd,
+ mode_t mode, int32_t flags, mode_t umask, dict_t *xdata);
int
-client_pre_fstat_v2 (xlator_t *this, gfx_fstat_req *req, fd_t *fd,
- dict_t *xdata);
+client_pre_ftruncate_v2(xlator_t *this, gfx_ftruncate_req *req, fd_t *fd,
+ off_t offset, dict_t *xdata);
int
-client_pre_lk_v2 (xlator_t *this, gfx_lk_req *req,
- int32_t cmd, struct gf_flock *flock, fd_t *fd, dict_t *xdata);
+client_pre_fstat_v2(xlator_t *this, gfx_fstat_req *req, fd_t *fd,
+ dict_t *xdata);
int
-client_pre_lookup_v2 (xlator_t *this, gfx_lookup_req *req, loc_t *loc,
- dict_t *xdata);
+client_pre_lk_v2(xlator_t *this, gfx_lk_req *req, int32_t cmd,
+ struct gf_flock *flock, fd_t *fd, dict_t *xdata);
int
-client_pre_readdir_v2 (xlator_t *this, gfx_readdir_req *req, fd_t *fd,
- size_t size, off_t offset, dict_t *xdata);
+client_pre_lookup_v2(xlator_t *this, gfx_lookup_req *req, loc_t *loc,
+ dict_t *xdata);
int
-client_pre_inodelk_v2 (xlator_t *this, gfx_inodelk_req *req, loc_t *loc,
- int cmd, struct gf_flock *flock, const char *volume,
- dict_t *xdata);
+client_pre_readdir_v2(xlator_t *this, gfx_readdir_req *req, fd_t *fd,
+ size_t size, off_t offset, dict_t *xdata);
int
-client_pre_finodelk_v2 (xlator_t *this, gfx_finodelk_req *req, fd_t *fd,
- int cmd, struct gf_flock *flock, const char *volume,
- dict_t *xdata);
+client_pre_inodelk_v2(xlator_t *this, gfx_inodelk_req *req, loc_t *loc, int cmd,
+ struct gf_flock *flock, const char *volume,
+ dict_t *xdata);
int
-client_pre_entrylk_v2 (xlator_t *this, gfx_entrylk_req *req, loc_t *loc,
- entrylk_cmd cmd_entrylk, entrylk_type type,
- const char *volume, const char *basename, dict_t *xdata);
+client_pre_finodelk_v2(xlator_t *this, gfx_finodelk_req *req, fd_t *fd, int cmd,
+ struct gf_flock *flock, const char *volume,
+ dict_t *xdata);
int
-client_pre_fentrylk_v2 (xlator_t *this, gfx_fentrylk_req *req, fd_t *fd,
+client_pre_entrylk_v2(xlator_t *this, gfx_entrylk_req *req, loc_t *loc,
entrylk_cmd cmd_entrylk, entrylk_type type,
const char *volume, const char *basename, dict_t *xdata);
int
-client_pre_xattrop_v2 (xlator_t *this, gfx_xattrop_req *req, loc_t *loc,
- dict_t *xattr, int32_t flags, dict_t *xdata);
+client_pre_fentrylk_v2(xlator_t *this, gfx_fentrylk_req *req, fd_t *fd,
+ entrylk_cmd cmd_entrylk, entrylk_type type,
+ const char *volume, const char *basename, dict_t *xdata);
int
-client_pre_fxattrop_v2 (xlator_t *this, gfx_fxattrop_req *req, fd_t *fd,
- dict_t *xattr, int32_t flags, dict_t *xdata);
+client_pre_xattrop_v2(xlator_t *this, gfx_xattrop_req *req, loc_t *loc,
+ dict_t *xattr, int32_t flags, dict_t *xdata);
+
+int
+client_pre_fxattrop_v2(xlator_t *this, gfx_fxattrop_req *req, fd_t *fd,
+ dict_t *xattr, int32_t flags, dict_t *xdata);
int
-client_pre_fgetxattr_v2 (xlator_t *this, gfx_fgetxattr_req *req, fd_t *fd,
- const char *name, dict_t *xdata);
+client_pre_fgetxattr_v2(xlator_t *this, gfx_fgetxattr_req *req, fd_t *fd,
+ const char *name, dict_t *xdata);
int
-client_pre_fsetxattr_v2 (xlator_t *this, gfx_fsetxattr_req *req, fd_t *fd,
- int32_t flags, dict_t *xattr, dict_t *xdata);
+client_pre_fsetxattr_v2(xlator_t *this, gfx_fsetxattr_req *req, fd_t *fd,
+ int32_t flags, dict_t *xattr, dict_t *xdata);
int
-client_pre_seek_v2 (xlator_t *this, gfx_seek_req *req, fd_t *fd,
- off_t offset, gf_seek_what_t what, dict_t *xdata);
+client_pre_seek_v2(xlator_t *this, gfx_seek_req *req, fd_t *fd, off_t offset,
+ gf_seek_what_t what, dict_t *xdata);
int
-client_pre_rchecksum_v2 (xlator_t *this, gfx_rchecksum_req *req, fd_t *fd,
- int32_t len, off_t offset, dict_t *xdata);
+client_pre_rchecksum_v2(xlator_t *this, gfx_rchecksum_req *req, fd_t *fd,
+ int32_t len, off_t offset, dict_t *xdata);
int
-client_pre_setattr_v2 (xlator_t *this, gfx_setattr_req *req, loc_t *loc,
- int32_t valid, struct iatt *stbuf, dict_t *xdata);
+client_pre_setattr_v2(xlator_t *this, gfx_setattr_req *req, loc_t *loc,
+ int32_t valid, struct iatt *stbuf, dict_t *xdata);
int
-client_pre_fsetattr_v2 (xlator_t *this, gfx_fsetattr_req *req, fd_t *fd,
- int32_t valid, struct iatt *stbuf, dict_t *xdata);
+client_pre_fsetattr_v2(xlator_t *this, gfx_fsetattr_req *req, fd_t *fd,
+ int32_t valid, struct iatt *stbuf, dict_t *xdata);
int
-client_pre_readdirp_v2 (xlator_t *this, gfx_readdirp_req *req, fd_t *fd,
- size_t size, off_t offset, dict_t *xdata);
+client_pre_readdirp_v2(xlator_t *this, gfx_readdirp_req *req, fd_t *fd,
+ size_t size, off_t offset, dict_t *xdata);
int
-client_pre_fremovexattr_v2 (xlator_t *this, gfx_fremovexattr_req *req, fd_t *fd,
- const char *name, dict_t *xdata);
+client_pre_fremovexattr_v2(xlator_t *this, gfx_fremovexattr_req *req, fd_t *fd,
+ const char *name, dict_t *xdata);
int
-client_pre_fallocate_v2 (xlator_t *this, gfx_fallocate_req *req, fd_t *fd,
- int32_t flags, off_t offset, size_t size, dict_t *xdata);
+client_pre_fallocate_v2(xlator_t *this, gfx_fallocate_req *req, fd_t *fd,
+ int32_t flags, off_t offset, size_t size,
+ dict_t *xdata);
int
-client_pre_discard_v2 (xlator_t *this, gfx_discard_req *req, fd_t *fd,
- off_t offset, size_t size, dict_t *xdata);
+client_pre_discard_v2(xlator_t *this, gfx_discard_req *req, fd_t *fd,
+ off_t offset, size_t size, dict_t *xdata);
int
-client_pre_zerofill_v2 (xlator_t *this, gfx_zerofill_req *req, fd_t *fd,
- off_t offset, size_t size, dict_t *xdata);
+client_pre_zerofill_v2(xlator_t *this, gfx_zerofill_req *req, fd_t *fd,
+ off_t offset, size_t size, dict_t *xdata);
int
-client_pre_ipc_v2 (xlator_t *this, gfx_ipc_req *req, int32_t cmd,
- dict_t *xdata);
+client_pre_ipc_v2(xlator_t *this, gfx_ipc_req *req, int32_t cmd, dict_t *xdata);
int
-client_pre_lease_v2 (xlator_t *this, gfx_lease_req *req, loc_t *loc,
- struct gf_lease *lease, dict_t *xdata);
+client_pre_lease_v2(xlator_t *this, gfx_lease_req *req, loc_t *loc,
+ struct gf_lease *lease, dict_t *xdata);
int
-client_pre_put_v2 (xlator_t *this, gfx_put_req *req, loc_t *loc, mode_t mode,
- mode_t umask, int32_t flags, size_t size, off_t offset,
- dict_t *xattr, dict_t *xdata);
+client_pre_put_v2(xlator_t *this, gfx_put_req *req, loc_t *loc, mode_t mode,
+ mode_t umask, int32_t flags, size_t size, off_t offset,
+ dict_t *xattr, dict_t *xdata);
int
-client_post_readv_v2 (xlator_t *this, gfx_read_rsp *rsp, struct iobref **iobref,
- struct iobref *rsp_iobref, struct iatt *stat,
- struct iovec *vector, struct iovec *rsp_vector,
- int *rspcount, dict_t **xdata);
-
+client_post_readv_v2(xlator_t *this, gfx_read_rsp *rsp, struct iobref **iobref,
+ struct iobref *rsp_iobref, struct iatt *stat,
+ struct iovec *vector, struct iovec *rsp_vector,
+ int *rspcount, dict_t **xdata);
int
-client_post_create_v2 (xlator_t *this, gfx_create_rsp *rsp,
- struct iatt *stbuf, struct iatt *preparent,
- struct iatt *postparent,
- clnt_local_t *local, dict_t **xdata);
+client_post_create_v2(xlator_t *this, gfx_create_rsp *rsp, struct iatt *stbuf,
+ struct iatt *preparent, struct iatt *postparent,
+ clnt_local_t *local, dict_t **xdata);
int
-client_post_lease_v2 (xlator_t *this, gfx_lease_rsp *rsp, struct gf_lease *lease,
- dict_t **xdata);
+client_post_lease_v2(xlator_t *this, gfx_lease_rsp *rsp, struct gf_lease *lease,
+ dict_t **xdata);
int
-client_post_lk_v2 (xlator_t *this, gfx_lk_rsp *rsp, struct gf_flock *lock,
- dict_t **xdata);
+client_post_lk_v2(xlator_t *this, gfx_lk_rsp *rsp, struct gf_flock *lock,
+ dict_t **xdata);
int
-client_post_readdir_v2 (xlator_t *this, gfx_readdir_rsp *rsp,
- gf_dirent_t *entries, dict_t **xdata);
+client_post_readdir_v2(xlator_t *this, gfx_readdir_rsp *rsp,
+ gf_dirent_t *entries, dict_t **xdata);
int
-client_post_readdirp_v2 (xlator_t *this, gfx_readdirp_rsp *rsp,
- fd_t *fd, gf_dirent_t *entries,
- dict_t **xdata);
+client_post_readdirp_v2(xlator_t *this, gfx_readdirp_rsp *rsp, fd_t *fd,
+ gf_dirent_t *entries, dict_t **xdata);
int
-client_post_rename_v2 (xlator_t *this, gfx_rename_rsp *rsp, struct iatt *stbuf,
- struct iatt *preoldparent, struct iatt *postoldparent,
- struct iatt *prenewparent, struct iatt *postnewparent,
- dict_t **xdata);
+client_post_rename_v2(xlator_t *this, gfx_rename_rsp *rsp, struct iatt *stbuf,
+ struct iatt *preoldparent, struct iatt *postoldparent,
+ struct iatt *prenewparent, struct iatt *postnewparent,
+ dict_t **xdata);
#endif /* __CLIENT_COMMON_H__ */
diff --git a/xlators/protocol/client/src/client-mem-types.h b/xlators/protocol/client/src/client-mem-types.h
index 1e995414ed8..bf01a90abb9 100644
--- a/xlators/protocol/client/src/client-mem-types.h
+++ b/xlators/protocol/client/src/client-mem-types.h
@@ -8,21 +8,20 @@
cases as published by the Free Software Foundation.
*/
-
#ifndef __CLIENT_MEM_TYPES_H__
#define __CLIENT_MEM_TYPES_H__
#include "mem-types.h"
enum gf_client_mem_types_ {
- gf_client_mt_clnt_conf_t = gf_common_mt_end + 1,
- gf_client_mt_clnt_req_buf_t,
- gf_client_mt_clnt_fdctx_t,
- gf_client_mt_clnt_lock_t,
- gf_client_mt_clnt_fd_lk_local_t,
- gf_client_mt_clnt_args_t,
- gf_client_mt_compound_req_t,
- gf_client_mt_clnt_lock_request_t,
- gf_client_mt_end,
+ gf_client_mt_clnt_conf_t = gf_common_mt_end + 1,
+ gf_client_mt_clnt_req_buf_t,
+ gf_client_mt_clnt_fdctx_t,
+ gf_client_mt_clnt_lock_t,
+ gf_client_mt_clnt_fd_lk_local_t,
+ gf_client_mt_clnt_args_t,
+ gf_client_mt_compound_req_t,
+ gf_client_mt_clnt_lock_request_t,
+ gf_client_mt_end,
};
#endif /* __CLIENT_MEM_TYPES_H__ */
diff --git a/xlators/protocol/client/src/client-messages.h b/xlators/protocol/client/src/client-messages.h
index 5f146c67efe..879d53741d1 100644
--- a/xlators/protocol/client/src/client-messages.h
+++ b/xlators/protocol/client/src/client-messages.h
@@ -23,75 +23,31 @@
* glfs-message-id.h.
*/
-GLFS_MSGID(PC,
- PC_MSG_TIMER_EXPIRED,
- PC_MSG_DIR_OP_FAILED,
- PC_MSG_FILE_OP_FAILED,
- PC_MSG_TIMER_REG,
- PC_MSG_GRACE_TIMER_CANCELLED,
- PC_MSG_DICT_SET_FAILED,
- PC_MSG_DICT_GET_FAILED,
- PC_MSG_NO_MEMORY,
- PC_MSG_RPC_CBK_FAILED,
- PC_MSG_FUNCTION_CALL_ERROR,
- PC_MSG_RPC_INITED_ALREADY,
- PC_MSG_RPC_INIT,
- PC_MSG_RPC_DESTROY,
- PC_MSG_RPC_INVALID_CALL,
- PC_MSG_INVALID_ENTRY,
- PC_MSG_HANDSHAKE_RETURN,
- PC_MSG_CHILD_UP_NOTIFY_FAILED,
- PC_MSG_CLIENT_DISCONNECTED,
- PC_MSG_CHILD_DOWN_NOTIFY_FAILED,
- PC_MSG_PARENT_UP,
- PC_MSG_PARENT_DOWN,
- PC_MSG_RPC_INIT_FAILED,
- PC_MSG_RPC_NOTIFY_FAILED,
- PC_MSG_FD_DUPLICATE_TRY,
- PC_MSG_FD_SET_FAIL,
- PC_MSG_DICT_UNSERIALIZE_FAIL,
- PC_MSG_FD_GET_FAIL,
- PC_MSG_FD_CTX_INVALID,
- PC_MSG_FOP_SEND_FAILED,
- PC_MSG_XDR_DECODING_FAILED,
- PC_MSG_REMOTE_OP_FAILED,
- PC_MSG_RPC_STATUS_ERROR,
- PC_MSG_VOL_FILE_NOT_FOUND,
- PC_MSG_SEND_REQ_FAIL,
- PC_MSG_LOCK_VERSION_SERVER,
- PC_MSG_SET_LK_VERSION_ERROR,
- PC_MSG_LOCK_REQ_FAIL,
- PC_MSG_CLIENT_REQ_FAIL,
- PC_MSG_LOCK_ERROR,
- PC_MSG_LOCK_REACQUIRE,
- PC_MSG_CHILD_UP_NOTIFY,
- PC_MSG_CHILD_UP_NOTIFY_DELAY,
- PC_MSG_VOL_SET_FAIL,
- PC_MSG_SETVOLUME_FAIL,
- PC_MSG_VOLFILE_NOTIFY_FAILED,
- PC_MSG_REMOTE_VOL_CONNECTED,
- PC_MSG_LOCK_MISMATCH,
- PC_MSG_LOCK_MATCH,
- PC_MSG_AUTH_FAILED,
- PC_MSG_AUTH_FAILED_NOTIFY_FAILED,
- PC_MSG_CHILD_CONNECTING_EVENT,
- PC_MSG_CHILD_CONNECTING_NOTIFY_FAILED,
- PC_MSG_PROCESS_UUID_SET_FAIL,
- PC_MSG_DICT_ERROR,
- PC_MSG_DICT_SERIALIZE_FAIL,
- PC_MSG_PGM_NOT_FOUND,
- PC_MSG_VERSION_INFO,
- PC_MSG_PORT_NUM_ERROR,
- PC_MSG_VERSION_ERROR,
- PC_MSG_DIR_OP_SUCCESS,
- PC_MSG_BAD_FD,
- PC_MSG_CLIENT_LOCK_INFO,
- PC_MSG_CACHE_INVALIDATION_FAIL,
- PC_MSG_CHILD_STATUS,
- PC_MSG_GFID_NULL,
- PC_MSG_RECALL_LEASE_FAIL,
- PC_MSG_INODELK_CONTENTION_FAIL,
- PC_MSG_ENTRYLK_CONTENTION_FAIL
-);
+GLFS_MSGID(
+ PC, PC_MSG_TIMER_EXPIRED, PC_MSG_DIR_OP_FAILED, PC_MSG_FILE_OP_FAILED,
+ PC_MSG_TIMER_REG, PC_MSG_GRACE_TIMER_CANCELLED, PC_MSG_DICT_SET_FAILED,
+ PC_MSG_DICT_GET_FAILED, PC_MSG_NO_MEMORY, PC_MSG_RPC_CBK_FAILED,
+ PC_MSG_FUNCTION_CALL_ERROR, PC_MSG_RPC_INITED_ALREADY, PC_MSG_RPC_INIT,
+ PC_MSG_RPC_DESTROY, PC_MSG_RPC_INVALID_CALL, PC_MSG_INVALID_ENTRY,
+ PC_MSG_HANDSHAKE_RETURN, PC_MSG_CHILD_UP_NOTIFY_FAILED,
+ PC_MSG_CLIENT_DISCONNECTED, PC_MSG_CHILD_DOWN_NOTIFY_FAILED,
+ PC_MSG_PARENT_UP, PC_MSG_PARENT_DOWN, PC_MSG_RPC_INIT_FAILED,
+ PC_MSG_RPC_NOTIFY_FAILED, PC_MSG_FD_DUPLICATE_TRY, PC_MSG_FD_SET_FAIL,
+ PC_MSG_DICT_UNSERIALIZE_FAIL, PC_MSG_FD_GET_FAIL, PC_MSG_FD_CTX_INVALID,
+ PC_MSG_FOP_SEND_FAILED, PC_MSG_XDR_DECODING_FAILED, PC_MSG_REMOTE_OP_FAILED,
+ PC_MSG_RPC_STATUS_ERROR, PC_MSG_VOL_FILE_NOT_FOUND, PC_MSG_SEND_REQ_FAIL,
+ PC_MSG_LOCK_VERSION_SERVER, PC_MSG_SET_LK_VERSION_ERROR,
+ PC_MSG_LOCK_REQ_FAIL, PC_MSG_CLIENT_REQ_FAIL, PC_MSG_LOCK_ERROR,
+ PC_MSG_LOCK_REACQUIRE, PC_MSG_CHILD_UP_NOTIFY, PC_MSG_CHILD_UP_NOTIFY_DELAY,
+ PC_MSG_VOL_SET_FAIL, PC_MSG_SETVOLUME_FAIL, PC_MSG_VOLFILE_NOTIFY_FAILED,
+ PC_MSG_REMOTE_VOL_CONNECTED, PC_MSG_LOCK_MISMATCH, PC_MSG_LOCK_MATCH,
+ PC_MSG_AUTH_FAILED, PC_MSG_AUTH_FAILED_NOTIFY_FAILED,
+ PC_MSG_CHILD_CONNECTING_EVENT, PC_MSG_CHILD_CONNECTING_NOTIFY_FAILED,
+ PC_MSG_PROCESS_UUID_SET_FAIL, PC_MSG_DICT_ERROR, PC_MSG_DICT_SERIALIZE_FAIL,
+ PC_MSG_PGM_NOT_FOUND, PC_MSG_VERSION_INFO, PC_MSG_PORT_NUM_ERROR,
+ PC_MSG_VERSION_ERROR, PC_MSG_DIR_OP_SUCCESS, PC_MSG_BAD_FD,
+ PC_MSG_CLIENT_LOCK_INFO, PC_MSG_CACHE_INVALIDATION_FAIL,
+ PC_MSG_CHILD_STATUS, PC_MSG_GFID_NULL, PC_MSG_RECALL_LEASE_FAIL,
+ PC_MSG_INODELK_CONTENTION_FAIL, PC_MSG_ENTRYLK_CONTENTION_FAIL);
#endif /* !_PC_MESSAGES_H__ */
diff --git a/xlators/protocol/client/src/client.h b/xlators/protocol/client/src/client.h
index b72404f5639..c63e3a290d6 100644
--- a/xlators/protocol/client/src/client.h
+++ b/xlators/protocol/client/src/client.h
@@ -27,447 +27,460 @@
#include "client-messages.h"
/* FIXME: Needs to be defined in a common file */
-#define CLIENT_DUMP_LOCKS "trusted.glusterfs.clientlk-dump"
-#define GF_MAX_SOCKET_WINDOW_SIZE (1 * GF_UNIT_MB)
-#define GF_MIN_SOCKET_WINDOW_SIZE (0)
+#define CLIENT_DUMP_LOCKS "trusted.glusterfs.clientlk-dump"
+#define GF_MAX_SOCKET_WINDOW_SIZE (1 * GF_UNIT_MB)
+#define GF_MIN_SOCKET_WINDOW_SIZE (0)
typedef enum {
- DEFAULT_REMOTE_FD = 0,
- FALLBACK_TO_ANON_FD = 1
+ DEFAULT_REMOTE_FD = 0,
+ FALLBACK_TO_ANON_FD = 1
} clnt_remote_fd_flags_t;
-#define CPD_REQ_FIELD(v,f) (v)->compound_req_u.compound_##f##_req
-#define CPD_RSP_FIELD(v,f) (v)->compound_rsp_u.compound_##f##_rsp
-
-#define CLIENT_POST_FOP(fop, this_rsp_u, this_args_cbk, params ...) \
- do { \
- gf_common_rsp *_this_rsp = &CPD_RSP_FIELD(this_rsp_u,fop); \
- int _op_ret = 0; \
- int _op_errno = 0; \
- \
- _op_ret = _this_rsp->op_ret; \
- _op_errno = gf_error_to_errno (_this_rsp->op_errno); \
- args_##fop##_cbk_store (this_args_cbk, _op_ret, _op_errno, \
- params); \
- } while (0)
-
-#define CLIENT_POST_FOP_TYPE(fop, this_rsp_u, this_args_cbk, params ...) \
- do { \
- gfs3_##fop##_rsp *_this_rsp = &CPD_RSP_FIELD(this_rsp_u,fop);\
- int _op_ret = 0; \
- int _op_errno = 0; \
- \
- _op_ret = _this_rsp->op_ret; \
- _op_errno = gf_error_to_errno (_this_rsp->op_errno); \
- args_##fop##_cbk_store (this_args_cbk, _op_ret, _op_errno, \
- params); \
- } while (0)
-
-#define CLIENT_PRE_FOP(fop, xl, compound_req, op_errno, label, params ...) \
- do { \
- gfs3_##fop##_req *_req = (gfs3_##fop##_req *) compound_req; \
- int _ret = 0; \
- \
- _ret = client_pre_##fop (xl, _req, params); \
- if (_ret < 0) { \
- op_errno = -ret; \
- goto label; \
- } \
- } while (0)
-
-#define CLIENT_COMPOUND_FOP_CLEANUP(curr_req, fop) \
- do { \
- gfs3_##fop##_req *_req = &CPD_REQ_FIELD(curr_req,fop); \
- \
- GF_FREE (_req->xdata.xdata_val); \
- } while (0)
-
-#define CLIENT_COMMON_RSP_CLEANUP(rsp, fop, i) \
- do { \
- compound_rsp *this_rsp = NULL; \
- this_rsp = &rsp->compound_rsp_array.compound_rsp_array_val[i];\
- gf_common_rsp *_this_rsp = &CPD_RSP_FIELD (this_rsp, fop); \
- \
- free (_this_rsp->xdata.xdata_val); \
- } while (0)
-
-#define CLIENT_FOP_RSP_CLEANUP(rsp, fop, i) \
- do { \
- compound_rsp *this_rsp = NULL; \
- this_rsp = &rsp->compound_rsp_array.compound_rsp_array_val[i];\
- gfs3_##fop##_rsp *_this_rsp = &CPD_RSP_FIELD (this_rsp, fop); \
- \
- free (_this_rsp->xdata.xdata_val); \
- } while (0)
-
-#define CLIENT_GET_REMOTE_FD(xl, fd, flags, remote_fd, op_errno, label) \
- do { \
- int _ret = 0; \
- _ret = client_get_remote_fd (xl, fd, flags, &remote_fd);\
- if (_ret < 0) { \
- op_errno = errno; \
- goto label; \
- } \
- if (remote_fd == -1) { \
- gf_msg (xl->name, GF_LOG_WARNING, EBADFD, \
- PC_MSG_BAD_FD, " (%s) " \
- "remote_fd is -1. EBADFD", \
- uuid_utoa (fd->inode->gfid)); \
- op_errno = EBADFD; \
- goto label; \
- } \
- } while (0)
-
-#define CLIENT_STACK_UNWIND(op, frame, params ...) do { \
- if (!frame) \
- break; \
- clnt_local_t *__local = frame->local; \
- frame->local = NULL; \
- STACK_UNWIND_STRICT (op, frame, params); \
- client_local_wipe (__local); \
- } while (0)
+#define CPD_REQ_FIELD(v, f) (v)->compound_req_u.compound_##f##_req
+#define CPD_RSP_FIELD(v, f) (v)->compound_rsp_u.compound_##f##_rsp
+
+#define CLIENT_POST_FOP(fop, this_rsp_u, this_args_cbk, params...) \
+ do { \
+ gf_common_rsp *_this_rsp = &CPD_RSP_FIELD(this_rsp_u, fop); \
+ int _op_ret = 0; \
+ int _op_errno = 0; \
+ \
+ _op_ret = _this_rsp->op_ret; \
+ _op_errno = gf_error_to_errno(_this_rsp->op_errno); \
+ args_##fop##_cbk_store(this_args_cbk, _op_ret, _op_errno, params); \
+ } while (0)
+
+#define CLIENT_POST_FOP_TYPE(fop, this_rsp_u, this_args_cbk, params...) \
+ do { \
+ gfs3_##fop##_rsp *_this_rsp = &CPD_RSP_FIELD(this_rsp_u, fop); \
+ int _op_ret = 0; \
+ int _op_errno = 0; \
+ \
+ _op_ret = _this_rsp->op_ret; \
+ _op_errno = gf_error_to_errno(_this_rsp->op_errno); \
+ args_##fop##_cbk_store(this_args_cbk, _op_ret, _op_errno, params); \
+ } while (0)
+
+#define CLIENT_PRE_FOP(fop, xl, compound_req, op_errno, label, params...) \
+ do { \
+ gfs3_##fop##_req *_req = (gfs3_##fop##_req *)compound_req; \
+ int _ret = 0; \
+ \
+ _ret = client_pre_##fop(xl, _req, params); \
+ if (_ret < 0) { \
+ op_errno = -ret; \
+ goto label; \
+ } \
+ } while (0)
+
+#define CLIENT_COMPOUND_FOP_CLEANUP(curr_req, fop) \
+ do { \
+ gfs3_##fop##_req *_req = &CPD_REQ_FIELD(curr_req, fop); \
+ \
+ GF_FREE(_req->xdata.xdata_val); \
+ } while (0)
+
+#define CLIENT_COMMON_RSP_CLEANUP(rsp, fop, i) \
+ do { \
+ compound_rsp *this_rsp = NULL; \
+ this_rsp = &rsp->compound_rsp_array.compound_rsp_array_val[i]; \
+ gf_common_rsp *_this_rsp = &CPD_RSP_FIELD(this_rsp, fop); \
+ \
+ free(_this_rsp->xdata.xdata_val); \
+ } while (0)
+
+#define CLIENT_FOP_RSP_CLEANUP(rsp, fop, i) \
+ do { \
+ compound_rsp *this_rsp = NULL; \
+ this_rsp = &rsp->compound_rsp_array.compound_rsp_array_val[i]; \
+ gfs3_##fop##_rsp *_this_rsp = &CPD_RSP_FIELD(this_rsp, fop); \
+ \
+ free(_this_rsp->xdata.xdata_val); \
+ } while (0)
+
+#define CLIENT_GET_REMOTE_FD(xl, fd, flags, remote_fd, op_errno, label) \
+ do { \
+ int _ret = 0; \
+ _ret = client_get_remote_fd(xl, fd, flags, &remote_fd); \
+ if (_ret < 0) { \
+ op_errno = errno; \
+ goto label; \
+ } \
+ if (remote_fd == -1) { \
+ gf_msg(xl->name, GF_LOG_WARNING, EBADFD, PC_MSG_BAD_FD, \
+ " (%s) " \
+ "remote_fd is -1. EBADFD", \
+ uuid_utoa(fd->inode->gfid)); \
+ op_errno = EBADFD; \
+ goto label; \
+ } \
+ } while (0)
+
+#define CLIENT_STACK_UNWIND(op, frame, params...) \
+ do { \
+ if (!frame) \
+ break; \
+ clnt_local_t *__local = frame->local; \
+ frame->local = NULL; \
+ STACK_UNWIND_STRICT(op, frame, params); \
+ client_local_wipe(__local); \
+ } while (0)
/* compound v2 */
-#define CPD4_REQ_FIELD(v, f) ((v)->compound_req_v2_u.compound_##f##_req)
-#define CPD4_RSP_FIELD(v, f) ((v)->compound_rsp_v2_u.compound_##f##_rsp)
-
-#define CLIENT4_POST_FOP(fop, this_rsp_u, this_args_cbk, params ...) \
- do { \
- gfx_common_rsp *_this_rsp = &CPD4_RSP_FIELD(this_rsp_u, fop); \
- int _op_ret = 0; \
- int _op_errno = 0; \
- \
- _op_ret = _this_rsp->op_ret; \
- _op_errno = gf_error_to_errno (_this_rsp->op_errno); \
- args_##fop##_cbk_store (this_args_cbk, _op_ret, _op_errno, \
- params); \
- } while (0)
-
-#define CLIENT4_POST_FOP_TYPE(fop, rsp_type, this_rsp_u, this_args_cbk, params ...) \
- do { \
- gfx_##rsp_type##_rsp *_this_rsp = &CPD4_RSP_FIELD(this_rsp_u, fop); \
- int _op_ret = 0; \
- int _op_errno = 0; \
- \
- _op_ret = _this_rsp->op_ret; \
- _op_errno = gf_error_to_errno (_this_rsp->op_errno); \
- args_##fop##_cbk_store (this_args_cbk, _op_ret, _op_errno, \
- params); \
- } while (0)
-
-#define CLIENT4_PRE_FOP(fop, xl, compound_req, op_errno, label, params ...) \
- do { \
- gfx_##fop##_req *_req = (gfx_##fop##_req *)compound_req; \
- int _ret = 0; \
- \
- _ret = client_pre_##fop##_v2 (xl, _req, params); \
- if (_ret < 0) { \
- op_errno = -ret; \
- goto label; \
- } \
- } while (0)
-
-#define CLIENT4_COMPOUND_FOP_CLEANUP(curr_req, fop) \
- do { \
- gfx_##fop##_req *_req = &CPD4_REQ_FIELD(curr_req, fop); \
- \
- GF_FREE (_req->xdata.pairs.pairs_val); \
- } while (0)
-
-
+#define CPD4_REQ_FIELD(v, f) ((v)->compound_req_v2_u.compound_##f##_req)
+#define CPD4_RSP_FIELD(v, f) ((v)->compound_rsp_v2_u.compound_##f##_rsp)
+
+#define CLIENT4_POST_FOP(fop, this_rsp_u, this_args_cbk, params...) \
+ do { \
+ gfx_common_rsp *_this_rsp = &CPD4_RSP_FIELD(this_rsp_u, fop); \
+ int _op_ret = 0; \
+ int _op_errno = 0; \
+ \
+ _op_ret = _this_rsp->op_ret; \
+ _op_errno = gf_error_to_errno(_this_rsp->op_errno); \
+ args_##fop##_cbk_store(this_args_cbk, _op_ret, _op_errno, params); \
+ } while (0)
+
+#define CLIENT4_POST_FOP_TYPE(fop, rsp_type, this_rsp_u, this_args_cbk, \
+ params...) \
+ do { \
+ gfx_##rsp_type##_rsp *_this_rsp = &CPD4_RSP_FIELD(this_rsp_u, fop); \
+ int _op_ret = 0; \
+ int _op_errno = 0; \
+ \
+ _op_ret = _this_rsp->op_ret; \
+ _op_errno = gf_error_to_errno(_this_rsp->op_errno); \
+ args_##fop##_cbk_store(this_args_cbk, _op_ret, _op_errno, params); \
+ } while (0)
+
+#define CLIENT4_PRE_FOP(fop, xl, compound_req, op_errno, label, params...) \
+ do { \
+ gfx_##fop##_req *_req = (gfx_##fop##_req *)compound_req; \
+ int _ret = 0; \
+ \
+ _ret = client_pre_##fop##_v2(xl, _req, params); \
+ if (_ret < 0) { \
+ op_errno = -ret; \
+ goto label; \
+ } \
+ } while (0)
+
+#define CLIENT4_COMPOUND_FOP_CLEANUP(curr_req, fop) \
+ do { \
+ gfx_##fop##_req *_req = &CPD4_REQ_FIELD(curr_req, fop); \
+ \
+ GF_FREE(_req->xdata.pairs.pairs_val); \
+ } while (0)
struct clnt_options {
- char *remote_subvolume;
- int ping_timeout;
+ char *remote_subvolume;
+ int ping_timeout;
};
typedef struct clnt_conf {
- struct rpc_clnt *rpc;
- struct clnt_options opt;
- struct rpc_clnt_config rpc_conf;
- struct list_head saved_fds;
- pthread_spinlock_t fd_lock; /* protects saved_fds list
- * and all fdctx */
- pthread_mutex_t lock;
- int connected;
-
- rpc_clnt_prog_t *fops;
- rpc_clnt_prog_t *mgmt;
- rpc_clnt_prog_t *handshake;
- rpc_clnt_prog_t *dump;
-
- int client_id;
- uint64_t reopen_fd_count; /* Count of fds reopened after a
- connection is established */
- gf_lock_t rec_lock;
- int skip_notify;
-
- int last_sent_event; /* Flag used to make sure we are
- not repeating the same event
- which was sent earlier */
- char portmap_err_logged; /* flag used to prevent
- excessive logging */
- char disconnect_err_logged; /* flag used to prevent
- excessive disconnect
- logging */
- char parent_down;
- gf_boolean_t quick_reconnect; /* When reconnecting after
- portmap query, do not let
- the reconnection happen after
- the usual 3-second wait
- */
- gf_boolean_t filter_o_direct; /* if set, filter O_DIRECT from
- the flags list of open() */
- /* set volume is the op which results in creating/re-using
- * the conn-id and is called once per connection, this remembers
- * how manytimes set_volume is called
- */
- uint64_t setvol_count;
-
- gf_boolean_t send_gids; /* let the server resolve gids */
-
- int event_threads; /* # of event threads
- * configured */
-
- gf_boolean_t destroy; /* if enabled implies fini was called
- * on @this xlator instance */
-
- gf_boolean_t child_up; /* Set to true, when child is up, and
- * false, when child is down */
-
- gf_boolean_t can_log_disconnect; /* socket level connection is
- * up, disconnects can be
- * logged
- */
+ struct rpc_clnt *rpc;
+ struct clnt_options opt;
+ struct rpc_clnt_config rpc_conf;
+ struct list_head saved_fds;
+ pthread_spinlock_t fd_lock; /* protects saved_fds list
+ * and all fdctx */
+ pthread_mutex_t lock;
+ int connected;
+
+ rpc_clnt_prog_t *fops;
+ rpc_clnt_prog_t *mgmt;
+ rpc_clnt_prog_t *handshake;
+ rpc_clnt_prog_t *dump;
+
+ int client_id;
+ uint64_t reopen_fd_count; /* Count of fds reopened after a
+ connection is established */
+ gf_lock_t rec_lock;
+ int skip_notify;
+
+ int last_sent_event; /* Flag used to make sure we are
+ not repeating the same event
+ which was sent earlier */
+ char portmap_err_logged; /* flag used to prevent
+ excessive logging */
+ char disconnect_err_logged; /* flag used to prevent
+ excessive disconnect
+ logging */
+ char parent_down;
+ gf_boolean_t quick_reconnect; /* When reconnecting after
+ portmap query, do not let
+ the reconnection happen after
+ the usual 3-second wait
+ */
+ gf_boolean_t filter_o_direct; /* if set, filter O_DIRECT from
+ the flags list of open() */
+ /* set volume is the op which results in creating/re-using
+ * the conn-id and is called once per connection, this remembers
+ * how manytimes set_volume is called
+ */
+ uint64_t setvol_count;
+
+ gf_boolean_t send_gids; /* let the server resolve gids */
+
+ int event_threads; /* # of event threads
+ * configured */
+
+ gf_boolean_t destroy; /* if enabled implies fini was called
+ * on @this xlator instance */
+
+ gf_boolean_t child_up; /* Set to true, when child is up, and
+ * false, when child is down */
+
+ gf_boolean_t can_log_disconnect; /* socket level connection is
+ * up, disconnects can be
+ * logged
+ */
} clnt_conf_t;
typedef struct _client_fd_ctx {
- struct list_head sfd_pos; /* Stores the reference to this
- fd's position in the saved_fds list.
- */
- int64_t remote_fd;
- char is_dir;
- char released;
- int32_t flags;
- fd_lk_ctx_t *lk_ctx;
- uuid_t gfid;
- void (*reopen_done)(struct _client_fd_ctx*, int64_t rfd, xlator_t *);
- struct list_head lock_list; /* List of all granted locks on this fd */
- int32_t reopen_attempts;
+ struct list_head sfd_pos; /* Stores the reference to this
+ fd's position in the saved_fds list.
+ */
+ int64_t remote_fd;
+ char is_dir;
+ char released;
+ int32_t flags;
+ fd_lk_ctx_t *lk_ctx;
+ uuid_t gfid;
+ void (*reopen_done)(struct _client_fd_ctx *, int64_t rfd, xlator_t *);
+ struct list_head lock_list; /* List of all granted locks on this fd */
+ int32_t reopen_attempts;
} clnt_fd_ctx_t;
typedef struct _client_posix_lock {
- fd_t *fd; /* The fd on which the lk operation was made */
-
- struct gf_flock user_flock; /* the flock supplied by the user */
- off_t fl_start;
- off_t fl_end;
- short fl_type;
- int32_t cmd; /* the cmd for the lock call */
- gf_lkowner_t owner; /* lock owner from fuse */
- struct list_head list; /* reference used to add to the fdctx list of locks */
+ fd_t *fd; /* The fd on which the lk operation was made */
+
+ struct gf_flock user_flock; /* the flock supplied by the user */
+ off_t fl_start;
+ off_t fl_end;
+ short fl_type;
+ int32_t cmd; /* the cmd for the lock call */
+ gf_lkowner_t owner; /* lock owner from fuse */
+ struct list_head
+ list; /* reference used to add to the fdctx list of locks */
} client_posix_lock_t;
typedef struct client_local {
- loc_t loc;
- loc_t loc2;
- fd_t *fd;
- clnt_fd_ctx_t *fdctx;
- uint32_t flags;
- struct iobref *iobref;
-
- client_posix_lock_t *client_lock;
- gf_lkowner_t owner;
- int32_t cmd;
- struct list_head lock_list;
- pthread_mutex_t mutex;
- char *name;
- gf_boolean_t attempt_reopen;
- /* required for compound fops */
- compound_args_t *compound_args;
- unsigned int length; /* length of a compound fop */
- unsigned int read_length; /* defines the last processed length for a compound read */
+ loc_t loc;
+ loc_t loc2;
+ fd_t *fd;
+ clnt_fd_ctx_t *fdctx;
+ uint32_t flags;
+ struct iobref *iobref;
+
+ client_posix_lock_t *client_lock;
+ gf_lkowner_t owner;
+ int32_t cmd;
+ struct list_head lock_list;
+ pthread_mutex_t mutex;
+ char *name;
+ gf_boolean_t attempt_reopen;
+ /* required for compound fops */
+ compound_args_t *compound_args;
+ unsigned int length; /* length of a compound fop */
+ unsigned int
+ read_length; /* defines the last processed length for a compound read */
} clnt_local_t;
typedef struct client_args {
- loc_t *loc;
- fd_t *fd;
- const char *linkname;
- struct iobref *iobref;
- struct iovec *vector;
- dict_t *xattr;
- struct iatt *stbuf;
- loc_t *oldloc;
- loc_t *newloc;
- const char *name;
- struct gf_flock *flock;
- const char *volume;
- const char *basename;
- off_t offset;
- int32_t mask;
- int32_t cmd;
- size_t size;
- mode_t mode;
- dev_t rdev;
- int32_t flags;
- int32_t count;
- int32_t datasync;
- entrylk_cmd cmd_entrylk;
- entrylk_type type;
- gf_xattrop_flags_t optype;
- int32_t valid;
- int32_t len;
- gf_seek_what_t what;
- struct gf_lease *lease;
-
- mode_t umask;
- dict_t *xdata;
- lock_migration_info_t *locklist;
+ loc_t *loc;
+ fd_t *fd;
+ const char *linkname;
+ struct iobref *iobref;
+ struct iovec *vector;
+ dict_t *xattr;
+ struct iatt *stbuf;
+ loc_t *oldloc;
+ loc_t *newloc;
+ const char *name;
+ struct gf_flock *flock;
+ const char *volume;
+ const char *basename;
+ off_t offset;
+ int32_t mask;
+ int32_t cmd;
+ size_t size;
+ mode_t mode;
+ dev_t rdev;
+ int32_t flags;
+ int32_t count;
+ int32_t datasync;
+ entrylk_cmd cmd_entrylk;
+ entrylk_type type;
+ gf_xattrop_flags_t optype;
+ int32_t valid;
+ int32_t len;
+ gf_seek_what_t what;
+ struct gf_lease *lease;
+
+ mode_t umask;
+ dict_t *xdata;
+ lock_migration_info_t *locklist;
} clnt_args_t;
-typedef ssize_t (*gfs_serialize_t) (struct iovec outmsg, void *args);
+typedef ssize_t (*gfs_serialize_t)(struct iovec outmsg, void *args);
+
+clnt_fd_ctx_t *
+this_fd_get_ctx(fd_t *file, xlator_t *this);
+clnt_fd_ctx_t *
+this_fd_del_ctx(fd_t *file, xlator_t *this);
+void
+this_fd_set_ctx(fd_t *file, xlator_t *this, loc_t *loc, clnt_fd_ctx_t *ctx);
-clnt_fd_ctx_t *this_fd_get_ctx (fd_t *file, xlator_t *this);
-clnt_fd_ctx_t *this_fd_del_ctx (fd_t *file, xlator_t *this);
-void this_fd_set_ctx (fd_t *file, xlator_t *this, loc_t *loc,
- clnt_fd_ctx_t *ctx);
+int
+client_local_wipe(clnt_local_t *local);
+int
+client_submit_request(xlator_t *this, void *req, call_frame_t *frame,
+ rpc_clnt_prog_t *prog, int procnum, fop_cbk_fn_t cbk,
+ struct iobref *iobref, struct iovec *rsphdr,
+ int rsphdr_count, struct iovec *rsp_payload,
+ int rsp_count, struct iobref *rsp_iobref,
+ xdrproc_t xdrproc);
-int client_local_wipe (clnt_local_t *local);
-int client_submit_request (xlator_t *this, void *req,
- call_frame_t *frame, rpc_clnt_prog_t *prog,
- int procnum, fop_cbk_fn_t cbk,
- struct iobref *iobref,
- struct iovec *rsphdr, int rsphdr_count,
- struct iovec *rsp_payload, int rsp_count,
- struct iobref *rsp_iobref, xdrproc_t xdrproc);
+int
+client_submit_compound_request(xlator_t *this, void *req, call_frame_t *frame,
+ rpc_clnt_prog_t *prog, int procnum,
+ fop_cbk_fn_t cbkfn, struct iovec *req_vector,
+ int req_count, struct iobref *iobref,
+ struct iovec *rsphdr, int rsphdr_count,
+ struct iovec *rsp_payload, int rsp_payload_count,
+ struct iobref *rsp_iobref, xdrproc_t xdrproc);
int
-client_submit_compound_request (xlator_t *this, void *req, call_frame_t *frame,
- rpc_clnt_prog_t *prog, int procnum, fop_cbk_fn_t cbkfn,
- struct iovec *req_vector, int req_count,
- struct iobref *iobref, struct iovec *rsphdr,
- int rsphdr_count, struct iovec *rsp_payload,
- int rsp_payload_count, struct iobref *rsp_iobref,
- xdrproc_t xdrproc);
-
-int unserialize_rsp_dirent (xlator_t *this, struct gfs3_readdir_rsp *rsp,
- gf_dirent_t *entries);
-int unserialize_rsp_direntp (xlator_t *this, fd_t *fd,
- struct gfs3_readdirp_rsp *rsp, gf_dirent_t *entries);
-
-int clnt_readdir_rsp_cleanup (gfs3_readdir_rsp *rsp);
-int clnt_readdirp_rsp_cleanup (gfs3_readdirp_rsp *rsp);
-int client_attempt_lock_recovery (xlator_t *this, clnt_fd_ctx_t *fdctx);
-int32_t delete_granted_locks_owner (fd_t *fd, gf_lkowner_t *owner);
-int32_t delete_granted_locks_fd (clnt_fd_ctx_t *fdctx);
-int32_t client_cmd_to_gf_cmd (int32_t cmd, int32_t *gf_cmd);
-void client_save_number_fds (clnt_conf_t *conf, int count);
-int dump_client_locks (inode_t *inode);
-int client_notify_parents_child_up (xlator_t *this);
-int32_t is_client_dump_locks_cmd (char *name);
-int32_t client_dump_locks (char *name, inode_t *inode,
- dict_t *dict);
-int client_fdctx_destroy (xlator_t *this, clnt_fd_ctx_t *fdctx);
-
-int32_t client_type_to_gf_type (short l_type);
-
-int client_mark_fd_bad (xlator_t *this);
-
-int client_fd_lk_list_empty (fd_lk_ctx_t *lk_ctx, gf_boolean_t use_try_lock);
-void client_default_reopen_done (clnt_fd_ctx_t *fdctx, int64_t rfd,
- xlator_t *this);
-void client_attempt_reopen (fd_t *fd, xlator_t *this);
-int client_get_remote_fd (xlator_t *this, fd_t *fd, int flags,
- int64_t *remote_fd);
-int client_fd_fop_prepare_local (call_frame_t *frame, fd_t *fd,
- int64_t remote_fd);
+unserialize_rsp_dirent(xlator_t *this, struct gfs3_readdir_rsp *rsp,
+ gf_dirent_t *entries);
+int
+unserialize_rsp_direntp(xlator_t *this, fd_t *fd, struct gfs3_readdirp_rsp *rsp,
+ gf_dirent_t *entries);
+
+int
+clnt_readdir_rsp_cleanup(gfs3_readdir_rsp *rsp);
+int
+clnt_readdirp_rsp_cleanup(gfs3_readdirp_rsp *rsp);
+int
+client_attempt_lock_recovery(xlator_t *this, clnt_fd_ctx_t *fdctx);
+int32_t
+delete_granted_locks_owner(fd_t *fd, gf_lkowner_t *owner);
+int32_t
+delete_granted_locks_fd(clnt_fd_ctx_t *fdctx);
+int32_t
+client_cmd_to_gf_cmd(int32_t cmd, int32_t *gf_cmd);
+void
+client_save_number_fds(clnt_conf_t *conf, int count);
+int
+dump_client_locks(inode_t *inode);
+int
+client_notify_parents_child_up(xlator_t *this);
+int32_t
+is_client_dump_locks_cmd(char *name);
+int32_t
+client_dump_locks(char *name, inode_t *inode, dict_t *dict);
+int
+client_fdctx_destroy(xlator_t *this, clnt_fd_ctx_t *fdctx);
+
+int32_t
+client_type_to_gf_type(short l_type);
+
+int
+client_mark_fd_bad(xlator_t *this);
+
+int
+client_fd_lk_list_empty(fd_lk_ctx_t *lk_ctx, gf_boolean_t use_try_lock);
+void
+client_default_reopen_done(clnt_fd_ctx_t *fdctx, int64_t rfd, xlator_t *this);
+void
+client_attempt_reopen(fd_t *fd, xlator_t *this);
+int
+client_get_remote_fd(xlator_t *this, fd_t *fd, int flags, int64_t *remote_fd);
+int
+client_fd_fop_prepare_local(call_frame_t *frame, fd_t *fd, int64_t remote_fd);
gf_boolean_t
-__is_fd_reopen_in_progress (clnt_fd_ctx_t *fdctx);
+__is_fd_reopen_in_progress(clnt_fd_ctx_t *fdctx);
int
-client_notify_dispatch (xlator_t *this, int32_t event, void *data, ...);
+client_notify_dispatch(xlator_t *this, int32_t event, void *data, ...);
int
-client_notify_dispatch_uniq (xlator_t *this, int32_t event, void *data, ...);
+client_notify_dispatch_uniq(xlator_t *this, int32_t event, void *data, ...);
gf_boolean_t
-client_is_reopen_needed (fd_t *fd, xlator_t *this, int64_t remote_fd);
+client_is_reopen_needed(fd_t *fd, xlator_t *this, int64_t remote_fd);
int
-client_add_fd_to_saved_fds (xlator_t *this, fd_t *fd, loc_t *loc, int32_t flags,
- int64_t remote_fd, int is_dir);
+client_add_fd_to_saved_fds(xlator_t *this, fd_t *fd, loc_t *loc, int32_t flags,
+ int64_t remote_fd, int is_dir);
int
-client_handle_fop_requirements (xlator_t *this, call_frame_t *frame,
- gfs3_compound_req *req,
- clnt_local_t *local,
- struct iobref **req_iobref,
- struct iobref **rsp_iobref,
- struct iovec *req_vector,
- struct iovec *rsp_vector, int *req_count,
- int *rsp_count, default_args_t *args,
- int fop_enum, int index);
+client_handle_fop_requirements(
+ xlator_t *this, call_frame_t *frame, gfs3_compound_req *req,
+ clnt_local_t *local, struct iobref **req_iobref, struct iobref **rsp_iobref,
+ struct iovec *req_vector, struct iovec *rsp_vector, int *req_count,
+ int *rsp_count, default_args_t *args, int fop_enum, int index);
int
-client_process_response (call_frame_t *frame, xlator_t *this,
- struct rpc_req *req,
- gfs3_compound_rsp *rsp, compound_args_cbk_t *args_cbk,
- int index);
+client_process_response(call_frame_t *frame, xlator_t *this,
+ struct rpc_req *req, gfs3_compound_rsp *rsp,
+ compound_args_cbk_t *args_cbk, int index);
void
-compound_request_cleanup (gfs3_compound_req *req);
+compound_request_cleanup(gfs3_compound_req *req);
int
-clnt_unserialize_rsp_locklist (xlator_t *this, struct gfs3_getactivelk_rsp *rsp,
- lock_migration_info_t *lmi);
+clnt_unserialize_rsp_locklist(xlator_t *this, struct gfs3_getactivelk_rsp *rsp,
+ lock_migration_info_t *lmi);
void
-clnt_getactivelk_rsp_cleanup (gfs3_getactivelk_rsp *rsp);
+clnt_getactivelk_rsp_cleanup(gfs3_getactivelk_rsp *rsp);
void
-clnt_setactivelk_req_cleanup (gfs3_setactivelk_req *req);
+clnt_setactivelk_req_cleanup(gfs3_setactivelk_req *req);
int
-serialize_req_locklist (lock_migration_info_t *locklist,
- gfs3_setactivelk_req *req);
+serialize_req_locklist(lock_migration_info_t *locklist,
+ gfs3_setactivelk_req *req);
void
-client_compound_rsp_cleanup (gfs3_compound_rsp *rsp, int len);
+client_compound_rsp_cleanup(gfs3_compound_rsp *rsp, int len);
void
-clnt_getactivelk_rsp_cleanup_v2 (gfx_getactivelk_rsp *rsp);
+clnt_getactivelk_rsp_cleanup_v2(gfx_getactivelk_rsp *rsp);
void
-clnt_setactivelk_req_cleanup_v2 (gfx_setactivelk_req *req);
+clnt_setactivelk_req_cleanup_v2(gfx_setactivelk_req *req);
int
-serialize_req_locklist_v2 (lock_migration_info_t *locklist,
- gfx_setactivelk_req *req);
+serialize_req_locklist_v2(lock_migration_info_t *locklist,
+ gfx_setactivelk_req *req);
int
-clnt_unserialize_rsp_locklist_v2 (xlator_t *this, struct gfx_getactivelk_rsp *rsp,
- lock_migration_info_t *lmi);
+clnt_unserialize_rsp_locklist_v2(xlator_t *this,
+ struct gfx_getactivelk_rsp *rsp,
+ lock_migration_info_t *lmi);
-int unserialize_rsp_dirent_v2 (xlator_t *this, struct gfx_readdir_rsp *rsp,
- gf_dirent_t *entries);
-int unserialize_rsp_direntp_v2 (xlator_t *this, fd_t *fd,
- struct gfx_readdirp_rsp *rsp, gf_dirent_t *entries);
+int
+unserialize_rsp_dirent_v2(xlator_t *this, struct gfx_readdir_rsp *rsp,
+ gf_dirent_t *entries);
+int
+unserialize_rsp_direntp_v2(xlator_t *this, fd_t *fd,
+ struct gfx_readdirp_rsp *rsp, gf_dirent_t *entries);
-int clnt_readdir_rsp_cleanup_v2 (gfx_readdir_rsp *rsp);
-int clnt_readdirp_rsp_cleanup_v2 (gfx_readdirp_rsp *rsp);
+int
+clnt_readdir_rsp_cleanup_v2(gfx_readdir_rsp *rsp);
+int
+clnt_readdirp_rsp_cleanup_v2(gfx_readdirp_rsp *rsp);
int
-client_handle_fop_requirements_v2 (xlator_t *this, call_frame_t *frame,
- gfx_compound_req *req,
- clnt_local_t *local,
- struct iobref **req_iobref,
- struct iobref **rsp_iobref,
- struct iovec *req_vector,
- struct iovec *rsp_vector, int *req_count,
- int *rsp_count, default_args_t *args,
- int fop_enum, int index);
+client_handle_fop_requirements_v2(
+ xlator_t *this, call_frame_t *frame, gfx_compound_req *req,
+ clnt_local_t *local, struct iobref **req_iobref, struct iobref **rsp_iobref,
+ struct iovec *req_vector, struct iovec *rsp_vector, int *req_count,
+ int *rsp_count, default_args_t *args, int fop_enum, int index);
int
-client_process_response_v2 (call_frame_t *frame, xlator_t *this,
- struct rpc_req *req,
- gfx_compound_rsp *rsp, compound_args_cbk_t *args_cbk,
- int index);
+client_process_response_v2(call_frame_t *frame, xlator_t *this,
+ struct rpc_req *req, gfx_compound_rsp *rsp,
+ compound_args_cbk_t *args_cbk, int index);
void
-compound_request_cleanup_v2 (gfx_compound_req *req);
+compound_request_cleanup_v2(gfx_compound_req *req);
void
-client_compound_rsp_cleanup_v2 (gfx_compound_rsp *rsp, int len);
+client_compound_rsp_cleanup_v2(gfx_compound_rsp *rsp, int len);
#endif /* !_CLIENT_H */
diff --git a/xlators/protocol/server/src/authenticate.h b/xlators/protocol/server/src/authenticate.h
index 5f92183fb12..6fc53933343 100644
--- a/xlators/protocol/server/src/authenticate.h
+++ b/xlators/protocol/server/src/authenticate.h
@@ -22,23 +22,21 @@
#include "list.h"
#include "xlator.h"
-typedef enum {
- AUTH_ACCEPT,
- AUTH_REJECT,
- AUTH_DONT_CARE
-} auth_result_t;
+typedef enum { AUTH_ACCEPT, AUTH_REJECT, AUTH_DONT_CARE } auth_result_t;
-typedef auth_result_t (*auth_fn_t) (dict_t *input_params,
- dict_t *config_params);
+typedef auth_result_t (*auth_fn_t)(dict_t *input_params, dict_t *config_params);
typedef struct {
- void *handle;
- auth_fn_t authenticate;
- volume_opt_list_t *vol_opt;
+ void *handle;
+ auth_fn_t authenticate;
+ volume_opt_list_t *vol_opt;
} auth_handle_t;
-int32_t gf_auth_init (xlator_t *xl, dict_t *auth_modules);
-void gf_auth_fini (dict_t *auth_modules);
-auth_result_t gf_authenticate (dict_t *, dict_t *, dict_t *);
+int32_t
+gf_auth_init(xlator_t *xl, dict_t *auth_modules);
+void
+gf_auth_fini(dict_t *auth_modules);
+auth_result_t
+gf_authenticate(dict_t *, dict_t *, dict_t *);
#endif /* _AUTHENTICATE_H */
diff --git a/xlators/protocol/server/src/server-common.h b/xlators/protocol/server/src/server-common.h
index e272235a192..53e46afdc69 100644
--- a/xlators/protocol/server/src/server-common.h
+++ b/xlators/protocol/server/src/server-common.h
@@ -9,200 +9,186 @@
#include "xdr-nfs3.h"
void
-server_post_stat (server_state_t *state,
- gfs3_stat_rsp *rsp, struct iatt *stbuf);
+server_post_stat(server_state_t *state, gfs3_stat_rsp *rsp, struct iatt *stbuf);
void
-server_post_readlink (gfs3_readlink_rsp *rsp, struct iatt *stbuf,
- const char *buf);
+server_post_readlink(gfs3_readlink_rsp *rsp, struct iatt *stbuf,
+ const char *buf);
void
-server_post_mknod (server_state_t *state, gfs3_mknod_rsp *rsp,
- struct iatt *stbuf, struct iatt *preparent,
- struct iatt *postparent, inode_t *inode);
+server_post_mknod(server_state_t *state, gfs3_mknod_rsp *rsp,
+ struct iatt *stbuf, struct iatt *preparent,
+ struct iatt *postparent, inode_t *inode);
void
-server_post_mkdir (server_state_t *state, gfs3_mkdir_rsp *rsp,
- inode_t *inode,
- struct iatt *stbuf, struct iatt *preparent,
- struct iatt *postparent, dict_t *xdata);
+server_post_mkdir(server_state_t *state, gfs3_mkdir_rsp *rsp, inode_t *inode,
+ struct iatt *stbuf, struct iatt *preparent,
+ struct iatt *postparent, dict_t *xdata);
void
-server_post_unlink (server_state_t *state, gfs3_unlink_rsp *rsp,
- struct iatt *preparent, struct iatt *postparent);
+server_post_unlink(server_state_t *state, gfs3_unlink_rsp *rsp,
+ struct iatt *preparent, struct iatt *postparent);
void
-server_post_rmdir (server_state_t *state, gfs3_rmdir_rsp *rsp,
- struct iatt *preparent, struct iatt *postparent);
+server_post_rmdir(server_state_t *state, gfs3_rmdir_rsp *rsp,
+ struct iatt *preparent, struct iatt *postparent);
void
-server_post_symlink (server_state_t *state, gfs3_symlink_rsp *rsp,
- inode_t *inode,
- struct iatt *stbuf, struct iatt *preparent,
- struct iatt *postparent, dict_t *xdata);
+server_post_symlink(server_state_t *state, gfs3_symlink_rsp *rsp,
+ inode_t *inode, struct iatt *stbuf, struct iatt *preparent,
+ struct iatt *postparent, dict_t *xdata);
void
-server_post_link (server_state_t *state, gfs3_link_rsp *rsp,
- inode_t *inode,
- struct iatt *stbuf, struct iatt *preparent,
- struct iatt *postparent, dict_t *xdata);
+server_post_link(server_state_t *state, gfs3_link_rsp *rsp, inode_t *inode,
+ struct iatt *stbuf, struct iatt *preparent,
+ struct iatt *postparent, dict_t *xdata);
void
-server_post_truncate (gfs3_truncate_rsp *rsp, struct iatt *prebuf,
- struct iatt *postbuf);
+server_post_truncate(gfs3_truncate_rsp *rsp, struct iatt *prebuf,
+ struct iatt *postbuf);
void
-server_post_writev (gfs3_write_rsp *rsp, struct iatt *prebuf,
- struct iatt *postbuf);
+server_post_writev(gfs3_write_rsp *rsp, struct iatt *prebuf,
+ struct iatt *postbuf);
void
-server_post_statfs (gfs3_statfs_rsp *rsp, struct statvfs *stbuf);
+server_post_statfs(gfs3_statfs_rsp *rsp, struct statvfs *stbuf);
void
-server_post_fsync (gfs3_fsync_rsp *rsp, struct iatt *prebuf,
- struct iatt *postbuf);
+server_post_fsync(gfs3_fsync_rsp *rsp, struct iatt *prebuf,
+ struct iatt *postbuf);
void
-server_post_ftruncate (gfs3_ftruncate_rsp *rsp, struct iatt *prebuf,
+server_post_ftruncate(gfs3_ftruncate_rsp *rsp, struct iatt *prebuf,
struct iatt *postbuf);
void
-server_post_fstat (server_state_t *state,
- gfs3_fstat_rsp *rsp, struct iatt *stbuf);
+server_post_fstat(server_state_t *state, gfs3_fstat_rsp *rsp,
+ struct iatt *stbuf);
void
-server_post_lk (xlator_t *this, gfs3_lk_rsp *rsp, struct gf_flock *lock);
+server_post_lk(xlator_t *this, gfs3_lk_rsp *rsp, struct gf_flock *lock);
int
-server_post_readdir (gfs3_readdir_rsp *rsp, gf_dirent_t *entries);
+server_post_readdir(gfs3_readdir_rsp *rsp, gf_dirent_t *entries);
void
-server_post_zerofill (gfs3_zerofill_rsp *rsp, struct iatt *statpre,
- struct iatt *statpost);
+server_post_zerofill(gfs3_zerofill_rsp *rsp, struct iatt *statpre,
+ struct iatt *statpost);
void
-server_post_discard (gfs3_discard_rsp *rsp, struct iatt *statpre,
- struct iatt *statpost);
+server_post_discard(gfs3_discard_rsp *rsp, struct iatt *statpre,
+ struct iatt *statpost);
void
-server_post_fallocate (gfs3_fallocate_rsp *rsp, struct iatt *statpre,
- struct iatt *statpost);
+server_post_fallocate(gfs3_fallocate_rsp *rsp, struct iatt *statpre,
+ struct iatt *statpost);
void
-server_post_seek (gfs3_seek_rsp *rsp, off_t offset);
+server_post_seek(gfs3_seek_rsp *rsp, off_t offset);
int
-server_post_readdirp (gfs3_readdirp_rsp *rsp, gf_dirent_t *entries);
+server_post_readdirp(gfs3_readdirp_rsp *rsp, gf_dirent_t *entries);
void
-server_post_fsetattr (gfs3_fsetattr_rsp *rsp, struct iatt *statpre,
- struct iatt *statpost);
+server_post_fsetattr(gfs3_fsetattr_rsp *rsp, struct iatt *statpre,
+ struct iatt *statpost);
void
-server_post_setattr (gfs3_setattr_rsp *rsp, struct iatt *statpre,
- struct iatt *statpost);
+server_post_setattr(gfs3_setattr_rsp *rsp, struct iatt *statpre,
+ struct iatt *statpost);
void
-server_post_rchecksum (gfs3_rchecksum_rsp *rsp, uint32_t weak_checksum,
- uint8_t *strong_checksum);
+server_post_rchecksum(gfs3_rchecksum_rsp *rsp, uint32_t weak_checksum,
+ uint8_t *strong_checksum);
void
-server_post_rename (call_frame_t *frame, server_state_t *state,
- gfs3_rename_rsp *rsp,
- struct iatt *stbuf,
- struct iatt *preoldparent,
- struct iatt *postoldparent,
- struct iatt *prenewparent,
- struct iatt *postnewparent);
+server_post_rename(call_frame_t *frame, server_state_t *state,
+ gfs3_rename_rsp *rsp, struct iatt *stbuf,
+ struct iatt *preoldparent, struct iatt *postoldparent,
+ struct iatt *prenewparent, struct iatt *postnewparent);
int
-server_post_open (call_frame_t *frame, xlator_t *this,
- gfs3_open_rsp *rsp, fd_t *fd);
+server_post_open(call_frame_t *frame, xlator_t *this, gfs3_open_rsp *rsp,
+ fd_t *fd);
void
-server_post_readv (gfs3_read_rsp *rsp, struct iatt *stbuf, int op_ret);
+server_post_readv(gfs3_read_rsp *rsp, struct iatt *stbuf, int op_ret);
int
-server_post_opendir (call_frame_t *frame, xlator_t *this,
- gfs3_opendir_rsp *rsp, fd_t *fd);
+server_post_opendir(call_frame_t *frame, xlator_t *this, gfs3_opendir_rsp *rsp,
+ fd_t *fd);
int
-server_post_create (call_frame_t *frame, gfs3_create_rsp *rsp,
- server_state_t *state,
- xlator_t *this, fd_t *fd, inode_t *inode,
- struct iatt *stbuf, struct iatt *preparent,
- struct iatt *postparent);
+server_post_create(call_frame_t *frame, gfs3_create_rsp *rsp,
+ server_state_t *state, xlator_t *this, fd_t *fd,
+ inode_t *inode, struct iatt *stbuf, struct iatt *preparent,
+ struct iatt *postparent);
void
-server_post_lookup (gfs3_lookup_rsp *rsp, call_frame_t *frame,
- server_state_t *state,
- inode_t *inode, struct iatt *stbuf,
- struct iatt *postparent);
+server_post_lookup(gfs3_lookup_rsp *rsp, call_frame_t *frame,
+ server_state_t *state, inode_t *inode, struct iatt *stbuf,
+ struct iatt *postparent);
void
-server_post_lease (gfs3_lease_rsp *rsp, struct gf_lease *lease);
+server_post_lease(gfs3_lease_rsp *rsp, struct gf_lease *lease);
void
-server4_post_readlink (gfx_readlink_rsp *rsp, struct iatt *stbuf,
+server4_post_readlink(gfx_readlink_rsp *rsp, struct iatt *stbuf,
const char *buf);
void
-server4_post_statfs (gfx_statfs_rsp *rsp, struct statvfs *stbuf);
+server4_post_statfs(gfx_statfs_rsp *rsp, struct statvfs *stbuf);
void
-server4_post_lk (xlator_t *this, gfx_lk_rsp *rsp, struct gf_flock *lock);
+server4_post_lk(xlator_t *this, gfx_lk_rsp *rsp, struct gf_flock *lock);
int
-server4_post_readdir (gfx_readdir_rsp *rsp, gf_dirent_t *entries);
+server4_post_readdir(gfx_readdir_rsp *rsp, gf_dirent_t *entries);
void
-server4_post_seek (gfx_seek_rsp *rsp, off_t offset);
+server4_post_seek(gfx_seek_rsp *rsp, off_t offset);
int
-server4_post_readdirp (gfx_readdirp_rsp *rsp, gf_dirent_t *entries);
+server4_post_readdirp(gfx_readdirp_rsp *rsp, gf_dirent_t *entries);
void
-server4_post_rchecksum (gfx_rchecksum_rsp *rsp, uint32_t weak_checksum,
+server4_post_rchecksum(gfx_rchecksum_rsp *rsp, uint32_t weak_checksum,
uint8_t *strong_checksum);
void
-server4_post_rename (call_frame_t *frame, server_state_t *state,
- gfx_rename_rsp *rsp,
- struct iatt *stbuf,
- struct iatt *preoldparent,
- struct iatt *postoldparent,
- struct iatt *prenewparent,
- struct iatt *postnewparent);
+server4_post_rename(call_frame_t *frame, server_state_t *state,
+ gfx_rename_rsp *rsp, struct iatt *stbuf,
+ struct iatt *preoldparent, struct iatt *postoldparent,
+ struct iatt *prenewparent, struct iatt *postnewparent);
int
-server4_post_open (call_frame_t *frame, xlator_t *this,
- gfx_open_rsp *rsp, fd_t *fd);
+server4_post_open(call_frame_t *frame, xlator_t *this, gfx_open_rsp *rsp,
+ fd_t *fd);
void
-server4_post_readv (gfx_read_rsp *rsp, struct iatt *stbuf, int op_ret);
+server4_post_readv(gfx_read_rsp *rsp, struct iatt *stbuf, int op_ret);
int
-server4_post_create (call_frame_t *frame, gfx_create_rsp *rsp,
- server_state_t *state,
- xlator_t *this, fd_t *fd, inode_t *inode,
- struct iatt *stbuf, struct iatt *preparent,
+server4_post_create(call_frame_t *frame, gfx_create_rsp *rsp,
+ server_state_t *state, xlator_t *this, fd_t *fd,
+ inode_t *inode, struct iatt *stbuf, struct iatt *preparent,
struct iatt *postparent);
void
-server4_post_common_2iatt (gfx_common_2iatt_rsp *rsp,
- struct iatt *stbuf1, struct iatt *stbuf2);
+server4_post_common_2iatt(gfx_common_2iatt_rsp *rsp, struct iatt *stbuf1,
+ struct iatt *stbuf2);
void
-server4_post_entry_remove (server_state_t *state, gfx_common_2iatt_rsp *rsp,
- struct iatt *stbuf1, struct iatt *stbuf2);
+server4_post_entry_remove(server_state_t *state, gfx_common_2iatt_rsp *rsp,
+ struct iatt *stbuf1, struct iatt *stbuf2);
void
-server4_post_common_3iatt (server_state_t *state, gfx_common_3iatt_rsp *rsp,
- inode_t *inode, struct iatt *stbuf, struct iatt *pre,
- struct iatt *post);
+server4_post_common_3iatt(server_state_t *state, gfx_common_3iatt_rsp *rsp,
+ inode_t *inode, struct iatt *stbuf, struct iatt *pre,
+ struct iatt *post);
void
-server4_post_common_iatt (server_state_t *state, gfx_common_iatt_rsp *rsp,
- struct iatt *stbuf);
+server4_post_common_iatt(server_state_t *state, gfx_common_iatt_rsp *rsp,
+ struct iatt *stbuf);
void
-server4_post_lease (gfx_lease_rsp *rsp, struct gf_lease *lease);
+server4_post_lease(gfx_lease_rsp *rsp, struct gf_lease *lease);
void
-server4_post_lookup (gfx_common_2iatt_rsp *rsp, call_frame_t *frame,
- server_state_t *state,
- inode_t *inode, struct iatt *stbuf);
+server4_post_lookup(gfx_common_2iatt_rsp *rsp, call_frame_t *frame,
+ server_state_t *state, inode_t *inode, struct iatt *stbuf);
void
-server4_post_link (server_state_t *state, gfx_common_3iatt_rsp *rsp,
- inode_t *inode, struct iatt *stbuf, struct iatt *pre,
- struct iatt *post);
+server4_post_link(server_state_t *state, gfx_common_3iatt_rsp *rsp,
+ inode_t *inode, struct iatt *stbuf, struct iatt *pre,
+ struct iatt *post);
diff --git a/xlators/protocol/server/src/server-helpers.h b/xlators/protocol/server/src/server-helpers.h
index b89105a355f..20b8d901bd2 100644
--- a/xlators/protocol/server/src/server-helpers.h
+++ b/xlators/protocol/server/src/server-helpers.h
@@ -14,119 +14,127 @@
#include "server.h"
#include "defaults.h"
-#define CALL_STATE(frame) ((server_state_t *)frame->root->state)
+#define CALL_STATE(frame) ((server_state_t *)frame->root->state)
-#define XPRT_FROM_FRAME(frame) ((rpc_transport_t *) CALL_STATE(frame)->xprt)
+#define XPRT_FROM_FRAME(frame) ((rpc_transport_t *)CALL_STATE(frame)->xprt)
-#define SERVER_CONF(frame) \
- ((server_conf_t *)XPRT_FROM_FRAME(frame)->this->private)
+#define SERVER_CONF(frame) \
+ ((server_conf_t *)XPRT_FROM_FRAME(frame)->this->private)
#define XPRT_FROM_XLATOR(this) ((((server_conf_t *)this->private))->listen)
-#define INODE_LRU_LIMIT(this) \
- (((server_conf_t *)(this->private))->config.inode_lru_limit)
+#define INODE_LRU_LIMIT(this) \
+ (((server_conf_t *)(this->private))->config.inode_lru_limit)
#define IS_ROOT_INODE(inode) (inode == inode->table->root)
-#define IS_NOT_ROOT(pathlen) ((pathlen > 2)? 1 : 0)
+#define IS_NOT_ROOT(pathlen) ((pathlen > 2) ? 1 : 0)
-void free_state (server_state_t *state);
+void
+free_state(server_state_t *state);
-void server_loc_wipe (loc_t *loc);
+void
+server_loc_wipe(loc_t *loc);
void
-server_print_request (call_frame_t *frame);
+server_print_request(call_frame_t *frame);
call_frame_t *
-get_frame_from_request (rpcsvc_request_t *req);
+get_frame_from_request(rpcsvc_request_t *req);
int
-server_connection_cleanup (xlator_t *this, struct _client *client,
- int32_t flags);
+server_connection_cleanup(xlator_t *this, struct _client *client,
+ int32_t flags);
int
-server_build_config (xlator_t *this, server_conf_t *conf);
+server_build_config(xlator_t *this, server_conf_t *conf);
-int serialize_rsp_dirent (gf_dirent_t *entries, gfs3_readdir_rsp *rsp);
-int serialize_rsp_direntp (gf_dirent_t *entries, gfs3_readdirp_rsp *rsp);
-int readdirp_rsp_cleanup (gfs3_readdirp_rsp *rsp);
-int readdir_rsp_cleanup (gfs3_readdir_rsp *rsp);
-int readdirp_rsp_cleanup_v2 (gfx_readdirp_rsp *rsp);
-int readdir_rsp_cleanup_v2 (gfx_readdir_rsp *rsp);
-int auth_set_username_passwd (dict_t *input_params, dict_t *config_params,
- struct _client *client);
+int
+serialize_rsp_dirent(gf_dirent_t *entries, gfs3_readdir_rsp *rsp);
+int
+serialize_rsp_direntp(gf_dirent_t *entries, gfs3_readdirp_rsp *rsp);
+int
+readdirp_rsp_cleanup(gfs3_readdirp_rsp *rsp);
+int
+readdir_rsp_cleanup(gfs3_readdir_rsp *rsp);
+int
+readdirp_rsp_cleanup_v2(gfx_readdirp_rsp *rsp);
+int
+readdir_rsp_cleanup_v2(gfx_readdir_rsp *rsp);
+int
+auth_set_username_passwd(dict_t *input_params, dict_t *config_params,
+ struct _client *client);
-server_ctx_t *server_ctx_get (client_t *client, xlator_t *xlator);
-int server_process_event_upcall (xlator_t *this, void *data);
+server_ctx_t *
+server_ctx_get(client_t *client, xlator_t *xlator);
+int
+server_process_event_upcall(xlator_t *this, void *data);
inode_t *
-server_inode_new (inode_table_t *itable, uuid_t gfid);
+server_inode_new(inode_table_t *itable, uuid_t gfid);
int
-serialize_rsp_locklist (lock_migration_info_t *locklist,
- gfs3_getactivelk_rsp *rsp);
+serialize_rsp_locklist(lock_migration_info_t *locklist,
+ gfs3_getactivelk_rsp *rsp);
int
-serialize_rsp_locklist_v2 (lock_migration_info_t *locklist,
- gfx_getactivelk_rsp *rsp);
+serialize_rsp_locklist_v2(lock_migration_info_t *locklist,
+ gfx_getactivelk_rsp *rsp);
int
-getactivelkinfo_rsp_cleanup (gfs3_getactivelk_rsp *rsp);
+getactivelkinfo_rsp_cleanup(gfs3_getactivelk_rsp *rsp);
int
-getactivelkinfo_rsp_cleanup_v2 (gfx_getactivelk_rsp *rsp);
+getactivelkinfo_rsp_cleanup_v2(gfx_getactivelk_rsp *rsp);
int
-server_populate_compound_response (xlator_t *this, gfs3_compound_rsp *rsp,
- call_frame_t *frame,
- compound_args_cbk_t *args_cbk, int index);
+server_populate_compound_response(xlator_t *this, gfs3_compound_rsp *rsp,
+ call_frame_t *frame,
+ compound_args_cbk_t *args_cbk, int index);
int
-server_get_compound_resolve (server_state_t *state, gfs3_compound_req *req);
+server_get_compound_resolve(server_state_t *state, gfs3_compound_req *req);
int
-server_populate_compound_request (gfs3_compound_req *req, call_frame_t *frame,
- default_args_t *this_args,
- int index);
+server_populate_compound_request(gfs3_compound_req *req, call_frame_t *frame,
+ default_args_t *this_args, int index);
void
-server_compound_rsp_cleanup (gfs3_compound_rsp *rsp, compound_args_cbk_t *args);
+server_compound_rsp_cleanup(gfs3_compound_rsp *rsp, compound_args_cbk_t *args);
void
-server_compound_req_cleanup (gfs3_compound_req *req, int len);
+server_compound_req_cleanup(gfs3_compound_req *req, int len);
int
-unserialize_req_locklist (gfs3_setactivelk_req *req,
- lock_migration_info_t *lmi);
+unserialize_req_locklist(gfs3_setactivelk_req *req, lock_migration_info_t *lmi);
int
-unserialize_req_locklist_v2 (gfx_setactivelk_req *req,
- lock_migration_info_t *lmi);
+unserialize_req_locklist_v2(gfx_setactivelk_req *req,
+ lock_migration_info_t *lmi);
int
-serialize_rsp_dirent (gf_dirent_t *entries, gfs3_readdir_rsp *rsp);
+serialize_rsp_dirent(gf_dirent_t *entries, gfs3_readdir_rsp *rsp);
int
-serialize_rsp_direntp (gf_dirent_t *entries, gfs3_readdirp_rsp *rsp);
+serialize_rsp_direntp(gf_dirent_t *entries, gfs3_readdirp_rsp *rsp);
int
-serialize_rsp_dirent_v2 (gf_dirent_t *entries, gfx_readdir_rsp *rsp);
+serialize_rsp_dirent_v2(gf_dirent_t *entries, gfx_readdir_rsp *rsp);
int
-serialize_rsp_direntp_v2 (gf_dirent_t *entries, gfx_readdirp_rsp *rsp);
+serialize_rsp_direntp_v2(gf_dirent_t *entries, gfx_readdirp_rsp *rsp);
int
-server_populate_compound_response_v2 (xlator_t *this, gfx_compound_rsp *rsp,
- call_frame_t *frame,
- compound_args_cbk_t *args_cbk, int index);
+server_populate_compound_response_v2(xlator_t *this, gfx_compound_rsp *rsp,
+ call_frame_t *frame,
+ compound_args_cbk_t *args_cbk, int index);
int
-server_get_compound_resolve_v2 (server_state_t *state, gfx_compound_req *req);
+server_get_compound_resolve_v2(server_state_t *state, gfx_compound_req *req);
int
-server_populate_compound_request_v2 (gfx_compound_req *req, call_frame_t *frame,
- default_args_t *this_args,
- int index);
+server_populate_compound_request_v2(gfx_compound_req *req, call_frame_t *frame,
+ default_args_t *this_args, int index);
void
-server_compound_rsp_cleanup_v2 (gfx_compound_rsp *rsp, compound_args_cbk_t *args);
+server_compound_rsp_cleanup_v2(gfx_compound_rsp *rsp,
+ compound_args_cbk_t *args);
void
-server_compound_req_cleanup_v2 (gfx_compound_req *req, int len);
-
+server_compound_req_cleanup_v2(gfx_compound_req *req, int len);
#endif /* !_SERVER_HELPERS_H */
diff --git a/xlators/protocol/server/src/server-mem-types.h b/xlators/protocol/server/src/server-mem-types.h
index 76a78ac3ede..4b341e53845 100644
--- a/xlators/protocol/server/src/server-mem-types.h
+++ b/xlators/protocol/server/src/server-mem-types.h
@@ -8,27 +8,26 @@
cases as published by the Free Software Foundation.
*/
-
#ifndef __SERVER_MEM_TYPES_H__
#define __SERVER_MEM_TYPES_H__
#include "mem-types.h"
enum gf_server_mem_types_ {
- gf_server_mt_server_conf_t = gf_common_mt_end + 1,
- gf_server_mt_resolv_comp_t,
- gf_server_mt_state_t,
- gf_server_mt_locker_t,
- gf_server_mt_lock_table_t,
- gf_server_mt_conn_t,
- gf_server_mt_dirent_rsp_t,
- gf_server_mt_rsp_buf_t,
- gf_server_mt_volfile_ctx_t,
- gf_server_mt_timer_data_t,
- gf_server_mt_setvolume_rsp_t,
- gf_server_mt_lock_mig_t,
- gf_server_mt_compound_rsp_t,
- gf_server_mt_child_status,
- gf_server_mt_end,
+ gf_server_mt_server_conf_t = gf_common_mt_end + 1,
+ gf_server_mt_resolv_comp_t,
+ gf_server_mt_state_t,
+ gf_server_mt_locker_t,
+ gf_server_mt_lock_table_t,
+ gf_server_mt_conn_t,
+ gf_server_mt_dirent_rsp_t,
+ gf_server_mt_rsp_buf_t,
+ gf_server_mt_volfile_ctx_t,
+ gf_server_mt_timer_data_t,
+ gf_server_mt_setvolume_rsp_t,
+ gf_server_mt_lock_mig_t,
+ gf_server_mt_compound_rsp_t,
+ gf_server_mt_child_status,
+ gf_server_mt_end,
};
#endif /* __SERVER_MEM_TYPES_H__ */
diff --git a/xlators/protocol/server/src/server-messages.h b/xlators/protocol/server/src/server-messages.h
index f7698806e3c..bc7431b9d86 100644
--- a/xlators/protocol/server/src/server-messages.h
+++ b/xlators/protocol/server/src/server-messages.h
@@ -23,101 +23,43 @@
* glfs-message-id.h.
*/
-GLFS_MSGID(PS,
- PS_MSG_AUTHENTICATE_ERROR,
- PS_MSG_VOL_VALIDATE_FAILED,
- PS_MSG_AUTH_INIT_FAILED,
- PS_MSG_REMOTE_CLIENT_REFUSED,
- PS_MSG_GFID_RESOLVE_FAILED,
- PS_MSG_ANONYMOUS_FD_CREATE_FAILED,
- PS_MSG_NO_MEMORY,
- PS_MSG_FD_NOT_FOUND,
- PS_MSG_INVALID_ENTRY,
- PS_MSG_GET_UID_FAILED,
- PS_MSG_UID_NOT_FOUND,
- PS_MSG_MAPPING_ERROR,
- PS_MSG_FD_CLEANUP,
- PS_MSG_SERVER_CTX_GET_FAILED,
- PS_MSG_FDENTRY_NULL,
- PS_MSG_DIR_NOT_FOUND,
- PS_MSG_SERVER_MSG,
- PS_MSG_DICT_SERIALIZE_FAIL,
- PS_MSG_RW_STAT,
- PS_MSG_DICT_GET_FAILED,
- PS_MSG_LOGIN_ERROR,
- PS_MSG_REMOUNT_CLIENT_REQD,
- PS_MSG_DEFAULTING_FILE,
- PS_MSG_VOL_FILE_OPEN_FAILED,
- PS_MSG_STAT_ERROR,
- PS_MSG_SSL_NAME_SET_FAILED,
- PS_MSG_ASPRINTF_FAILED,
- PS_MSG_CLIENT_VERSION_NOT_SET,
- PS_MSG_CLIENT_ACCEPTED,
- PS_MSG_CLIENT_LK_VERSION_ERROR,
- PS_MSG_GRACE_TIMER_EXPD,
- PS_MSG_SERIALIZE_REPLY_FAILED,
- PS_MSG_AUTH_IP_ERROR,
- PS_MSG_SKIP_FORMAT_CHK,
- PS_MSG_INTERNET_ADDR_ERROR,
- PS_MSG_CLIENT_DISCONNECTING,
- PS_MSG_GRACE_TIMER_START,
- PS_MSG_STATEDUMP_PATH_ERROR,
- PS_MSG_GRP_CACHE_ERROR,
- PS_MSG_RPC_CONF_ERROR,
- PS_MSG_TRANSPORT_ERROR,
- PS_MSG_SUBVOL_NULL,
- PS_MSG_PARENT_VOL_ERROR,
- PS_MSG_RPCSVC_CREATE_FAILED,
- PS_MSG_RPCSVC_LISTENER_CREATE_FAILED,
- PS_MSG_RPCSVC_NOTIFY,
- PS_MSG_PGM_REG_FAILED,
- PS_MSG_ULIMIT_SET_FAILED,
- PS_MSG_STATFS,
- PS_MSG_LOOKUP_INFO,
- PS_MSG_LK_INFO,
- PS_MSG_LOCK_ERROR,
- PS_MSG_INODELK_INFO,
- PS_MSG_ENTRYLK_INFO,
- PS_MSG_ACCESS_INFO,
- PS_MSG_DIR_INFO,
- PS_MSG_MKNOD_INFO,
- PS_MSG_REMOVEXATTR_INFO,
- PS_MSG_GETXATTR_INFO,
- PS_MSG_SETXATTR_INFO,
- PS_MSG_RENAME_INFO,
- PS_MSG_LINK_INFO,
- PS_MSG_TRUNCATE_INFO,
- PS_MSG_FSTAT_INFO,
- PS_MSG_FLUSH_INFO,
- PS_MSG_SYNC_INFO,
- PS_MSG_WRITE_INFO,
- PS_MSG_READ_INFO,
- PS_MSG_CHKSUM_INFO,
- PS_MSG_OPEN_INFO,
- PS_MSG_CREATE_INFO,
- PS_MSG_SETATTR_INFO,
- PS_MSG_XATTROP_INFO,
- PS_MSG_ALLOC_INFO,
- PS_MSG_DISCARD_INFO,
- PS_MSG_ZEROFILL_INFO,
- PS_MSG_FD_CREATE_FAILED,
- PS_MSG_WRONG_STATE,
- PS_MSG_CONF_DIR_INVALID,
- PS_MSG_MOUNT_PT_FAIL,
- PS_MSG_STAT_INFO,
- PS_MSG_FILE_OP_FAILED,
- PS_MSG_GRACE_TIMER_CANCELLED,
- PS_MSG_ENCODE_MSG_FAILED,
- PS_MSG_REPLY_SUBMIT_FAILED,
- PS_MSG_RPC_NOTIFY_ERROR,
- PS_MSG_SERVER_EVENT_UPCALL_FAILED,
- PS_MSG_SERVER_IPC_INFO,
- PS_MSG_SEEK_INFO,
- PS_MSG_COMPOUND_INFO,
- PS_MSG_CLIENT_OPVERSION_GET_FAILED,
- PS_MSG_CHILD_STATUS_FAILED,
- PS_MSG_PUT_INFO
-);
+GLFS_MSGID(PS, PS_MSG_AUTHENTICATE_ERROR, PS_MSG_VOL_VALIDATE_FAILED,
+ PS_MSG_AUTH_INIT_FAILED, PS_MSG_REMOTE_CLIENT_REFUSED,
+ PS_MSG_GFID_RESOLVE_FAILED, PS_MSG_ANONYMOUS_FD_CREATE_FAILED,
+ PS_MSG_NO_MEMORY, PS_MSG_FD_NOT_FOUND, PS_MSG_INVALID_ENTRY,
+ PS_MSG_GET_UID_FAILED, PS_MSG_UID_NOT_FOUND, PS_MSG_MAPPING_ERROR,
+ PS_MSG_FD_CLEANUP, PS_MSG_SERVER_CTX_GET_FAILED, PS_MSG_FDENTRY_NULL,
+ PS_MSG_DIR_NOT_FOUND, PS_MSG_SERVER_MSG, PS_MSG_DICT_SERIALIZE_FAIL,
+ PS_MSG_RW_STAT, PS_MSG_DICT_GET_FAILED, PS_MSG_LOGIN_ERROR,
+ PS_MSG_REMOUNT_CLIENT_REQD, PS_MSG_DEFAULTING_FILE,
+ PS_MSG_VOL_FILE_OPEN_FAILED, PS_MSG_STAT_ERROR,
+ PS_MSG_SSL_NAME_SET_FAILED, PS_MSG_ASPRINTF_FAILED,
+ PS_MSG_CLIENT_VERSION_NOT_SET, PS_MSG_CLIENT_ACCEPTED,
+ PS_MSG_CLIENT_LK_VERSION_ERROR, PS_MSG_GRACE_TIMER_EXPD,
+ PS_MSG_SERIALIZE_REPLY_FAILED, PS_MSG_AUTH_IP_ERROR,
+ PS_MSG_SKIP_FORMAT_CHK, PS_MSG_INTERNET_ADDR_ERROR,
+ PS_MSG_CLIENT_DISCONNECTING, PS_MSG_GRACE_TIMER_START,
+ PS_MSG_STATEDUMP_PATH_ERROR, PS_MSG_GRP_CACHE_ERROR,
+ PS_MSG_RPC_CONF_ERROR, PS_MSG_TRANSPORT_ERROR, PS_MSG_SUBVOL_NULL,
+ PS_MSG_PARENT_VOL_ERROR, PS_MSG_RPCSVC_CREATE_FAILED,
+ PS_MSG_RPCSVC_LISTENER_CREATE_FAILED, PS_MSG_RPCSVC_NOTIFY,
+ PS_MSG_PGM_REG_FAILED, PS_MSG_ULIMIT_SET_FAILED, PS_MSG_STATFS,
+ PS_MSG_LOOKUP_INFO, PS_MSG_LK_INFO, PS_MSG_LOCK_ERROR,
+ PS_MSG_INODELK_INFO, PS_MSG_ENTRYLK_INFO, PS_MSG_ACCESS_INFO,
+ PS_MSG_DIR_INFO, PS_MSG_MKNOD_INFO, PS_MSG_REMOVEXATTR_INFO,
+ PS_MSG_GETXATTR_INFO, PS_MSG_SETXATTR_INFO, PS_MSG_RENAME_INFO,
+ PS_MSG_LINK_INFO, PS_MSG_TRUNCATE_INFO, PS_MSG_FSTAT_INFO,
+ PS_MSG_FLUSH_INFO, PS_MSG_SYNC_INFO, PS_MSG_WRITE_INFO,
+ PS_MSG_READ_INFO, PS_MSG_CHKSUM_INFO, PS_MSG_OPEN_INFO,
+ PS_MSG_CREATE_INFO, PS_MSG_SETATTR_INFO, PS_MSG_XATTROP_INFO,
+ PS_MSG_ALLOC_INFO, PS_MSG_DISCARD_INFO, PS_MSG_ZEROFILL_INFO,
+ PS_MSG_FD_CREATE_FAILED, PS_MSG_WRONG_STATE, PS_MSG_CONF_DIR_INVALID,
+ PS_MSG_MOUNT_PT_FAIL, PS_MSG_STAT_INFO, PS_MSG_FILE_OP_FAILED,
+ PS_MSG_GRACE_TIMER_CANCELLED, PS_MSG_ENCODE_MSG_FAILED,
+ PS_MSG_REPLY_SUBMIT_FAILED, PS_MSG_RPC_NOTIFY_ERROR,
+ PS_MSG_SERVER_EVENT_UPCALL_FAILED, PS_MSG_SERVER_IPC_INFO,
+ PS_MSG_SEEK_INFO, PS_MSG_COMPOUND_INFO,
+ PS_MSG_CLIENT_OPVERSION_GET_FAILED, PS_MSG_CHILD_STATUS_FAILED,
+ PS_MSG_PUT_INFO);
#endif /* !_PS_MESSAGES_H__ */
-
diff --git a/xlators/protocol/server/src/server.h b/xlators/protocol/server/src/server.h
index 88aaa263018..e6064af076e 100644
--- a/xlators/protocol/server/src/server.h
+++ b/xlators/protocol/server/src/server.h
@@ -26,237 +26,234 @@
#include "defaults.h"
#include "authenticate.h"
-#define DEFAULT_BLOCK_SIZE 4194304 /* 4MB */
-#define DEFAULT_VOLUME_FILE_PATH CONFDIR "/glusterfs.vol"
-#define GF_MAX_SOCKET_WINDOW_SIZE (1 * GF_UNIT_MB)
-#define GF_MIN_SOCKET_WINDOW_SIZE (0)
-
-#define CPD_REQ_FIELD(v, f) ((v)->compound_req_u.compound_##f##_req)
-#define CPD_RSP_FIELD(v, f) ((v)->compound_rsp_u.compound_##f##_rsp)
-
-#define SERVER_COMMON_RSP_CLEANUP(rsp, fop, i) \
- do { \
- compound_rsp *this_rsp = NULL; \
- this_rsp = &rsp->compound_rsp_array.compound_rsp_array_val[i];\
- gf_common_rsp *_this_rsp = &CPD_RSP_FIELD(this_rsp, fop); \
- \
- GF_FREE (_this_rsp->xdata.xdata_val); \
- } while (0)
-
-#define SERVER_FOP_RSP_CLEANUP(rsp, fop, i) \
- do { \
- compound_rsp *this_rsp = NULL; \
- this_rsp = &rsp->compound_rsp_array.compound_rsp_array_val[i];\
- gfs3_##fop##_rsp *_this_rsp = &CPD_RSP_FIELD(this_rsp, fop); \
- \
- GF_FREE (_this_rsp->xdata.xdata_val); \
- } while (0)
-
-#define SERVER_COMPOUND_FOP_CLEANUP(curr_req, fop) \
- do { \
- gfs3_##fop##_req *_req = &CPD_REQ_FIELD(curr_req, fop); \
- \
- free (_req->xdata.xdata_val); \
- } while (0)
-
-#define CPD4_REQ_FIELD(v, f) ((v)->compound_req_v2_u.compound_##f##_req)
-#define CPD4_RSP_FIELD(v, f) ((v)->compound_rsp_v2_u.compound_##f##_rsp)
-
-#define SERVER4_COMMON_RSP_CLEANUP(rsp, fop, i) \
- do { \
- compound_rsp_v2 *this_rsp = NULL; \
- this_rsp = &rsp->compound_rsp_array.compound_rsp_array_val[i]; \
- gfx_common_rsp *_this_rsp = &CPD4_RSP_FIELD(this_rsp, fop); \
- \
- GF_FREE (_this_rsp->xdata.pairs.pairs_val); \
- } while (0)
-
-#define SERVER4_FOP_RSP_CLEANUP(rsp, fop, i, rsp_type) \
- do { \
- compound_rsp_v2 *this_rsp = NULL; \
- this_rsp = &rsp->compound_rsp_array.compound_rsp_array_val[i]; \
- gfx_##rsp_type##_rsp *_this_rsp = &CPD4_RSP_FIELD(this_rsp, fop); \
- \
- GF_FREE (_this_rsp->xdata.pairs.pairs_val); \
- } while (0)
-
+#define DEFAULT_BLOCK_SIZE 4194304 /* 4MB */
+#define DEFAULT_VOLUME_FILE_PATH CONFDIR "/glusterfs.vol"
+#define GF_MAX_SOCKET_WINDOW_SIZE (1 * GF_UNIT_MB)
+#define GF_MIN_SOCKET_WINDOW_SIZE (0)
+
+#define CPD_REQ_FIELD(v, f) ((v)->compound_req_u.compound_##f##_req)
+#define CPD_RSP_FIELD(v, f) ((v)->compound_rsp_u.compound_##f##_rsp)
+
+#define SERVER_COMMON_RSP_CLEANUP(rsp, fop, i) \
+ do { \
+ compound_rsp *this_rsp = NULL; \
+ this_rsp = &rsp->compound_rsp_array.compound_rsp_array_val[i]; \
+ gf_common_rsp *_this_rsp = &CPD_RSP_FIELD(this_rsp, fop); \
+ \
+ GF_FREE(_this_rsp->xdata.xdata_val); \
+ } while (0)
+
+#define SERVER_FOP_RSP_CLEANUP(rsp, fop, i) \
+ do { \
+ compound_rsp *this_rsp = NULL; \
+ this_rsp = &rsp->compound_rsp_array.compound_rsp_array_val[i]; \
+ gfs3_##fop##_rsp *_this_rsp = &CPD_RSP_FIELD(this_rsp, fop); \
+ \
+ GF_FREE(_this_rsp->xdata.xdata_val); \
+ } while (0)
+
+#define SERVER_COMPOUND_FOP_CLEANUP(curr_req, fop) \
+ do { \
+ gfs3_##fop##_req *_req = &CPD_REQ_FIELD(curr_req, fop); \
+ \
+ free(_req->xdata.xdata_val); \
+ } while (0)
+
+#define CPD4_REQ_FIELD(v, f) ((v)->compound_req_v2_u.compound_##f##_req)
+#define CPD4_RSP_FIELD(v, f) ((v)->compound_rsp_v2_u.compound_##f##_rsp)
+
+#define SERVER4_COMMON_RSP_CLEANUP(rsp, fop, i) \
+ do { \
+ compound_rsp_v2 *this_rsp = NULL; \
+ this_rsp = &rsp->compound_rsp_array.compound_rsp_array_val[i]; \
+ gfx_common_rsp *_this_rsp = &CPD4_RSP_FIELD(this_rsp, fop); \
+ \
+ GF_FREE(_this_rsp->xdata.pairs.pairs_val); \
+ } while (0)
+
+#define SERVER4_FOP_RSP_CLEANUP(rsp, fop, i, rsp_type) \
+ do { \
+ compound_rsp_v2 *this_rsp = NULL; \
+ this_rsp = &rsp->compound_rsp_array.compound_rsp_array_val[i]; \
+ gfx_##rsp_type##_rsp *_this_rsp = &CPD4_RSP_FIELD(this_rsp, fop); \
+ \
+ GF_FREE(_this_rsp->xdata.pairs.pairs_val); \
+ } while (0)
typedef enum {
- INTERNAL_LOCKS = 1,
- POSIX_LOCKS = 2,
+ INTERNAL_LOCKS = 1,
+ POSIX_LOCKS = 2,
} server_lock_flags_t;
typedef struct _server_state server_state_t;
-int server_null (rpcsvc_request_t *req);
+int
+server_null(rpcsvc_request_t *req);
struct _volfile_ctx {
- struct _volfile_ctx *next;
- char *key;
- uint32_t checksum;
+ struct _volfile_ctx *next;
+ char *key;
+ uint32_t checksum;
};
struct _child_status {
- struct list_head status_list;
- char *name;
- gf_boolean_t child_up;
- gf_atomic_t xprtrefcnt;
+ struct list_head status_list;
+ char *name;
+ gf_boolean_t child_up;
+ gf_atomic_t xprtrefcnt;
};
struct server_conf {
- rpcsvc_t *rpc;
- struct rpcsvc_config rpc_conf;
- int inode_lru_limit;
- gf_boolean_t verify_volfile;
- gf_boolean_t trace;
- char *conf_dir;
- struct _volfile_ctx *volfile;
- dict_t *auth_modules;
- pthread_mutex_t mutex;
- struct list_head xprt_list;
- pthread_t barrier_th;
-
- gf_boolean_t server_manage_gids; /* resolve gids on brick */
- gid_cache_t gid_cache;
- int32_t gid_cache_timeout;
-
- int event_threads; /* # of event threads
- * configured */
-
- gf_boolean_t parent_up;
- gf_boolean_t dync_auth; /* if set authenticate dynamically,
- * in case if volume set options
- * (say *.allow | *.reject) are
- * tweeked */
- struct _child_status *child_status;
- gf_lock_t itable_lock;
- gf_boolean_t strict_auth_enabled;
+ rpcsvc_t *rpc;
+ struct rpcsvc_config rpc_conf;
+ int inode_lru_limit;
+ gf_boolean_t verify_volfile;
+ gf_boolean_t trace;
+ char *conf_dir;
+ struct _volfile_ctx *volfile;
+ dict_t *auth_modules;
+ pthread_mutex_t mutex;
+ struct list_head xprt_list;
+ pthread_t barrier_th;
+
+ gf_boolean_t server_manage_gids; /* resolve gids on brick */
+ gid_cache_t gid_cache;
+ int32_t gid_cache_timeout;
+
+ int event_threads; /* # of event threads
+ * configured */
+
+ gf_boolean_t parent_up;
+ gf_boolean_t dync_auth; /* if set authenticate dynamically,
+ * in case if volume set options
+ * (say *.allow | *.reject) are
+ * tweeked */
+ struct _child_status *child_status;
+ gf_lock_t itable_lock;
+ gf_boolean_t strict_auth_enabled;
};
typedef struct server_conf server_conf_t;
-
typedef enum {
- RESOLVE_MUST = 1,
- RESOLVE_NOT,
- RESOLVE_MAY,
- RESOLVE_DONTCARE,
- RESOLVE_EXACT
+ RESOLVE_MUST = 1,
+ RESOLVE_NOT,
+ RESOLVE_MAY,
+ RESOLVE_DONTCARE,
+ RESOLVE_EXACT
} server_resolve_type_t;
-
struct resolve_comp {
- char *basename;
- inode_t *inode;
+ char *basename;
+ inode_t *inode;
};
typedef struct {
- server_resolve_type_t type;
- int64_t fd_no;
- u_char gfid[16];
- u_char pargfid[16];
- char *path;
- char *bname;
- int op_ret;
- int op_errno;
- loc_t resolve_loc;
+ server_resolve_type_t type;
+ int64_t fd_no;
+ u_char gfid[16];
+ u_char pargfid[16];
+ char *path;
+ char *bname;
+ int op_ret;
+ int op_errno;
+ loc_t resolve_loc;
} server_resolve_t;
-
-typedef int (*server_resume_fn_t) (call_frame_t *frame, xlator_t *bound_xl);
+typedef int (*server_resume_fn_t)(call_frame_t *frame, xlator_t *bound_xl);
int
-resolve_and_resume (call_frame_t *frame, server_resume_fn_t fn);
+resolve_and_resume(call_frame_t *frame, server_resume_fn_t fn);
struct _server_state {
- rpc_transport_t *xprt;
- inode_table_t *itable;
-
- server_resume_fn_t resume_fn;
-
- loc_t loc;
- loc_t loc2;
- server_resolve_t resolve;
- server_resolve_t resolve2;
-
- /* used within resolve_and_resume */
- loc_t *loc_now;
- server_resolve_t *resolve_now;
-
- struct iatt stbuf;
- int valid;
-
- fd_t *fd;
- dict_t *params;
- int32_t flags;
- int wbflags;
- struct iovec payload_vector[MAX_IOVEC];
- int payload_count;
- struct iobuf *iobuf;
- struct iobref *iobref;
-
- size_t size;
- off_t offset;
- mode_t mode;
- dev_t dev;
- size_t nr_count;
- int cmd;
- int type;
- char *name;
- int name_len;
-
- int mask;
- char is_revalidate;
- dict_t *dict;
- struct gf_flock flock;
- const char *volume;
- dir_entry_t *entry;
- gf_seek_what_t what;
-
- dict_t *xdata;
- mode_t umask;
- struct gf_lease lease;
- lock_migration_info_t locklist;
- /* required for compound fops */
- gfs3_compound_req req;
- /* TODO: having xdr definition here
- is not a good idea, but not taking
- up the functionality right now */
- gfx_compound_req req_v2;
-
- /* last length till which iovec for compound
- * writes was processed */
- int write_length;
- struct iovec rsp_vector[MAX_IOVEC];
- int rsp_count;
- struct iobuf *rsp_iobuf;
- struct iobref *rsp_iobref;
- compound_args_t *args;
-
- /* subdir mount */
- client_t *client;
+ rpc_transport_t *xprt;
+ inode_table_t *itable;
+
+ server_resume_fn_t resume_fn;
+
+ loc_t loc;
+ loc_t loc2;
+ server_resolve_t resolve;
+ server_resolve_t resolve2;
+
+ /* used within resolve_and_resume */
+ loc_t *loc_now;
+ server_resolve_t *resolve_now;
+
+ struct iatt stbuf;
+ int valid;
+
+ fd_t *fd;
+ dict_t *params;
+ int32_t flags;
+ int wbflags;
+ struct iovec payload_vector[MAX_IOVEC];
+ int payload_count;
+ struct iobuf *iobuf;
+ struct iobref *iobref;
+
+ size_t size;
+ off_t offset;
+ mode_t mode;
+ dev_t dev;
+ size_t nr_count;
+ int cmd;
+ int type;
+ char *name;
+ int name_len;
+
+ int mask;
+ char is_revalidate;
+ dict_t *dict;
+ struct gf_flock flock;
+ const char *volume;
+ dir_entry_t *entry;
+ gf_seek_what_t what;
+
+ dict_t *xdata;
+ mode_t umask;
+ struct gf_lease lease;
+ lock_migration_info_t locklist;
+ /* required for compound fops */
+ gfs3_compound_req req;
+ /* TODO: having xdr definition here
+ is not a good idea, but not taking
+ up the functionality right now */
+ gfx_compound_req req_v2;
+
+ /* last length till which iovec for compound
+ * writes was processed */
+ int write_length;
+ struct iovec rsp_vector[MAX_IOVEC];
+ int rsp_count;
+ struct iobuf *rsp_iobuf;
+ struct iobref *rsp_iobref;
+ compound_args_t *args;
+
+ /* subdir mount */
+ client_t *client;
};
-
extern struct rpcsvc_program gluster_handshake_prog;
extern struct rpcsvc_program glusterfs3_3_fop_prog;
extern struct rpcsvc_program glusterfs4_0_fop_prog;
typedef struct _server_ctx {
- gf_lock_t fdtable_lock;
- fdtable_t *fdtable;
+ gf_lock_t fdtable_lock;
+ fdtable_t *fdtable;
} server_ctx_t;
-
int
-server_submit_reply (call_frame_t *frame, rpcsvc_request_t *req, void *arg,
- struct iovec *payload, int payloadcount,
- struct iobref *iobref, xdrproc_t xdrproc);
+server_submit_reply(call_frame_t *frame, rpcsvc_request_t *req, void *arg,
+ struct iovec *payload, int payloadcount,
+ struct iobref *iobref, xdrproc_t xdrproc);
-int gf_server_check_setxattr_cmd (call_frame_t *frame, dict_t *dict);
-int gf_server_check_getxattr_cmd (call_frame_t *frame, const char *name);
+int
+gf_server_check_setxattr_cmd(call_frame_t *frame, dict_t *dict);
+int
+gf_server_check_getxattr_cmd(call_frame_t *frame, const char *name);
void
-forget_inode_if_no_dentry (inode_t *inode);
+forget_inode_if_no_dentry(inode_t *inode);
-server_ctx_t*
-server_ctx_get (client_t *client, xlator_t *xlator);
+server_ctx_t *
+server_ctx_get(client_t *client, xlator_t *xlator);
#endif /* !_SERVER_H */
diff --git a/xlators/storage/bd/src/bd-aio.h b/xlators/storage/bd/src/bd-aio.h
index 82386e0b072..1332622050d 100644
--- a/xlators/storage/bd/src/bd-aio.h
+++ b/xlators/storage/bd/src/bd-aio.h
@@ -23,14 +23,18 @@
/* Maximum number of completed IO operations to reap per getevents syscall */
#define BD_AIO_MAX_NR_GETEVENTS 16
-int bd_aio_on (xlator_t *this);
-int bd_aio_off (xlator_t *this);
-
-int bd_readv (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
- off_t offset, uint32_t flags, dict_t *xdata);
-
-int bd_writev (call_frame_t *frame, xlator_t *this, fd_t *fd,
- struct iovec *vector, int32_t count, off_t offset,
- uint32_t flags, struct iobref *iobref, dict_t *xdata);
+int
+bd_aio_on(xlator_t *this);
+int
+bd_aio_off(xlator_t *this);
+
+int
+bd_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
+ off_t offset, uint32_t flags, dict_t *xdata);
+
+int
+bd_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector,
+ int32_t count, off_t offset, uint32_t flags, struct iobref *iobref,
+ dict_t *xdata);
#endif /* !_BD_AIO_H */
diff --git a/xlators/storage/bd/src/bd-mem-types.h b/xlators/storage/bd/src/bd-mem-types.h
index 58b44834247..a63df819754 100644
--- a/xlators/storage/bd/src/bd-mem-types.h
+++ b/xlators/storage/bd/src/bd-mem-types.h
@@ -8,20 +8,19 @@
cases as published by the Free Software Foundation.
*/
-
#ifndef __BD_MEM_TYPES_H__
#define __BD_MEM_TYPES_H__
#include "mem-types.h"
enum gf_bd_mem_types_ {
- gf_bd_private = gf_common_mt_end + 1,
- gf_bd_attr,
- gf_bd_fd,
- gf_bd_loc_t,
- gf_bd_int32_t,
- gf_bd_aio_cb,
- gf_bd_mt_end
+ gf_bd_private = gf_common_mt_end + 1,
+ gf_bd_attr,
+ gf_bd_fd,
+ gf_bd_loc_t,
+ gf_bd_int32_t,
+ gf_bd_aio_cb,
+ gf_bd_mt_end
};
#endif
diff --git a/xlators/storage/bd/src/bd.h b/xlators/storage/bd/src/bd.h
index bdaf6f032d9..769affbb70c 100644
--- a/xlators/storage/bd/src/bd.h
+++ b/xlators/storage/bd/src/bd.h
@@ -38,18 +38,18 @@
#define ALIGN_SIZE 4096
-#define BD_CAPS_BD 0x01
-#define BD_CAPS_THIN 0x02
-#define BD_CAPS_OFFLOAD_COPY 0x04
+#define BD_CAPS_BD 0x01
+#define BD_CAPS_THIN 0x02
+#define BD_CAPS_OFFLOAD_COPY 0x04
#define BD_CAPS_OFFLOAD_SNAPSHOT 0x08
-#define BD_CAPS_OFFLOAD_ZERO 0x20
+#define BD_CAPS_OFFLOAD_ZERO 0x20
#define BD_CLONE "clone"
#define BD_SNAPSHOT "snapshot"
#define BD_MERGE "merge"
#define BD_ORIGIN "list-origin"
-#define IOV_NR 4
+#define IOV_NR 4
#define IOV_SIZE (64 * 1024)
#define ALIGN_SIZE 4096
@@ -57,29 +57,29 @@
#define MAX_NO_VECT 1024
-
-#define BD_VALIDATE_MEM_ALLOC(buff, op_errno, label) \
- if (!buff) { \
- op_errno = ENOMEM; \
- gf_log (this->name, GF_LOG_ERROR, "out of memory"); \
- goto label; \
- }
-
-#define BD_VALIDATE_LOCAL_OR_GOTO(local, op_errno, label) \
- if (!local) { \
- op_errno = EINVAL; \
- goto label; \
- }
-
-#define BD_STACK_UNWIND(typ, frame, args ...) do { \
- bd_local_t *__local = frame->local; \
- xlator_t *__this = frame->this; \
- \
- frame->local = NULL; \
- STACK_UNWIND_STRICT (typ, frame, args); \
- if (__local) \
- bd_local_free (__this, __local); \
- } while (0)
+#define BD_VALIDATE_MEM_ALLOC(buff, op_errno, label) \
+ if (!buff) { \
+ op_errno = ENOMEM; \
+ gf_log(this->name, GF_LOG_ERROR, "out of memory"); \
+ goto label; \
+ }
+
+#define BD_VALIDATE_LOCAL_OR_GOTO(local, op_errno, label) \
+ if (!local) { \
+ op_errno = EINVAL; \
+ goto label; \
+ }
+
+#define BD_STACK_UNWIND(typ, frame, args...) \
+ do { \
+ bd_local_t *__local = frame->local; \
+ xlator_t *__this = frame->this; \
+ \
+ frame->local = NULL; \
+ STACK_UNWIND_STRICT(typ, frame, args); \
+ if (__local) \
+ bd_local_free(__this, __local); \
+ } while (0)
typedef char bd_gfid_t[GF_UUID_BUF_SIZE];
@@ -87,82 +87,103 @@ typedef char bd_gfid_t[GF_UUID_BUF_SIZE];
* bd_fd - internal structure
*/
typedef struct bd_fd {
- int fd;
- int32_t flag;
- int odirect;
+ int fd;
+ int32_t flag;
+ int odirect;
} bd_fd_t;
typedef struct bd_priv {
- lvm_t handle;
- char *vg;
- char *pool;
- int caps;
- gf_boolean_t aio_init_done;
- gf_boolean_t aio_capable;
- gf_boolean_t aio_configured;
+ lvm_t handle;
+ char *vg;
+ char *pool;
+ int caps;
+ gf_boolean_t aio_init_done;
+ gf_boolean_t aio_capable;
+ gf_boolean_t aio_configured;
#ifdef HAVE_LIBAIO
- io_context_t ctxp;
- pthread_t aiothread;
+ io_context_t ctxp;
+ pthread_t aiothread;
#endif
} bd_priv_t;
-
typedef enum bd_type {
- BD_TYPE_NONE,
- BD_TYPE_LV,
+ BD_TYPE_NONE,
+ BD_TYPE_LV,
} bd_type_t;
typedef struct {
- struct iatt iatt;
- char *type;
+ struct iatt iatt;
+ char *type;
} bd_attr_t;
typedef enum {
- BD_OF_NONE,
- BD_OF_CLONE,
- BD_OF_SNAPSHOT,
- BD_OF_MERGE,
+ BD_OF_NONE,
+ BD_OF_CLONE,
+ BD_OF_SNAPSHOT,
+ BD_OF_MERGE,
} bd_offload_t;
typedef struct {
- dict_t *dict;
- bd_attr_t *bdatt;
- inode_t *inode;
- loc_t loc;
- fd_t *fd;
- data_t *data; /* for setxattr */
- bd_offload_t offload;
- uint64_t size;
- loc_t *dloc;
+ dict_t *dict;
+ bd_attr_t *bdatt;
+ inode_t *inode;
+ loc_t loc;
+ fd_t *fd;
+ data_t *data; /* for setxattr */
+ bd_offload_t offload;
+ uint64_t size;
+ loc_t *dloc;
} bd_local_t;
/* Prototypes */
-int bd_inode_ctx_set (inode_t *inode, xlator_t *this, bd_attr_t *ctx);
-int bd_inode_ctx_get (inode_t *inode, xlator_t *this, bd_attr_t **ctx);
-int bd_scan_vg (xlator_t *this, bd_priv_t *priv);
-bd_local_t *bd_local_init (call_frame_t *frame, xlator_t *this);
-void bd_local_free (xlator_t *this, bd_local_t *local);
-int bd_fd_ctx_get (xlator_t *this, fd_t *fd, bd_fd_t **bdfd);
-char *page_aligned_alloc (size_t size, char **aligned_buf);
-int bd_validate_bd_xattr (xlator_t *this, char *bd, char **type,
- uint64_t *lv_size, uuid_t uuid);
-uint64_t bd_get_default_extent (bd_priv_t *priv);
-uint64_t bd_adjust_size (bd_priv_t *priv, size_t size);
-int bd_create (uuid_t uuid, uint64_t size, char *type, bd_priv_t *priv);
-int bd_resize (bd_priv_t *priv, uuid_t uuid, size_t size);
-int bd_delete_lv (bd_priv_t *priv, const char *lv_name, int *op_errno);
-int bd_snapshot_create (bd_local_t *local, bd_priv_t *priv);
-int bd_clone (bd_local_t *local, bd_priv_t *priv);
-
-int bd_merge (bd_priv_t *priv, uuid_t gfid);
-int bd_get_origin (bd_priv_t *priv, loc_t *loc, fd_t *fd, dict_t *dict);
-void bd_update_amtime(struct iatt *iatt, int flag);
-int bd_snapshot_create (bd_local_t *local, bd_priv_t *priv);
-int bd_clone (bd_local_t *local, bd_priv_t *priv);
-int bd_merge (bd_priv_t *priv, uuid_t gfid);
-int bd_get_origin (bd_priv_t *priv, loc_t *loc, fd_t *fd, dict_t *dict);
-int bd_do_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd,
- off_t offset, size_t len, struct iatt *prebuf,
- struct iatt *postbuf);
+int
+bd_inode_ctx_set(inode_t *inode, xlator_t *this, bd_attr_t *ctx);
+int
+bd_inode_ctx_get(inode_t *inode, xlator_t *this, bd_attr_t **ctx);
+int
+bd_scan_vg(xlator_t *this, bd_priv_t *priv);
+bd_local_t *
+bd_local_init(call_frame_t *frame, xlator_t *this);
+void
+bd_local_free(xlator_t *this, bd_local_t *local);
+int
+bd_fd_ctx_get(xlator_t *this, fd_t *fd, bd_fd_t **bdfd);
+char *
+page_aligned_alloc(size_t size, char **aligned_buf);
+int
+bd_validate_bd_xattr(xlator_t *this, char *bd, char **type, uint64_t *lv_size,
+ uuid_t uuid);
+uint64_t
+bd_get_default_extent(bd_priv_t *priv);
+uint64_t
+bd_adjust_size(bd_priv_t *priv, size_t size);
+int
+bd_create(uuid_t uuid, uint64_t size, char *type, bd_priv_t *priv);
+int
+bd_resize(bd_priv_t *priv, uuid_t uuid, size_t size);
+int
+bd_delete_lv(bd_priv_t *priv, const char *lv_name, int *op_errno);
+int
+bd_snapshot_create(bd_local_t *local, bd_priv_t *priv);
+int
+bd_clone(bd_local_t *local, bd_priv_t *priv);
+
+int
+bd_merge(bd_priv_t *priv, uuid_t gfid);
+int
+bd_get_origin(bd_priv_t *priv, loc_t *loc, fd_t *fd, dict_t *dict);
+void
+bd_update_amtime(struct iatt *iatt, int flag);
+int
+bd_snapshot_create(bd_local_t *local, bd_priv_t *priv);
+int
+bd_clone(bd_local_t *local, bd_priv_t *priv);
+int
+bd_merge(bd_priv_t *priv, uuid_t gfid);
+int
+bd_get_origin(bd_priv_t *priv, loc_t *loc, fd_t *fd, dict_t *dict);
+int
+bd_do_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
+ size_t len, struct iatt *prebuf, struct iatt *postbuf);
#endif
diff --git a/xlators/storage/posix/src/posix-aio.h b/xlators/storage/posix/src/posix-aio.h
index e9dd6467e5e..9b4a7078ecf 100644
--- a/xlators/storage/posix/src/posix-aio.h
+++ b/xlators/storage/posix/src/posix-aio.h
@@ -20,15 +20,18 @@
// Maximum number of completed IO operations to reap per getevents syscall
#define POSIX_AIO_MAX_NR_GETEVENTS 16
-
-int posix_aio_on (xlator_t *this);
-int posix_aio_off (xlator_t *this);
-
-int posix_readv (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
- off_t offset, uint32_t flags, dict_t *xdata);
-
-int posix_writev (call_frame_t *frame, xlator_t *this, fd_t *fd,
- struct iovec *vector, int32_t count, off_t offset,
- uint32_t flags, struct iobref *iobref, dict_t *xdata);
+int
+posix_aio_on(xlator_t *this);
+int
+posix_aio_off(xlator_t *this);
+
+int
+posix_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
+ off_t offset, uint32_t flags, dict_t *xdata);
+
+int
+posix_writev(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ struct iovec *vector, int32_t count, off_t offset, uint32_t flags,
+ struct iobref *iobref, dict_t *xdata);
#endif /* !_POSIX_AIO_H */
diff --git a/xlators/storage/posix/src/posix-gfid-path.h b/xlators/storage/posix/src/posix-gfid-path.h
index 59799125bbb..21f849dd276 100644
--- a/xlators/storage/posix/src/posix-gfid-path.h
+++ b/xlators/storage/posix/src/posix-gfid-path.h
@@ -18,14 +18,12 @@
#define MAX_GFID2PATH_LINK_SUP 500
int32_t
-posix_set_gfid2path_xattr (xlator_t *, const char *, uuid_t,
- const char *);
+posix_set_gfid2path_xattr(xlator_t *, const char *, uuid_t, const char *);
int32_t
-posix_remove_gfid2path_xattr (xlator_t *, const char *, uuid_t,
- const char *);
+posix_remove_gfid2path_xattr(xlator_t *, const char *, uuid_t, const char *);
gf_boolean_t
-posix_is_gfid2path_xattr (const char *name);
+posix_is_gfid2path_xattr(const char *name);
int32_t
-posix_get_gfid2path (xlator_t *this, inode_t *inode, const char *real_path,
- int *op_errno, dict_t *dict);
+posix_get_gfid2path(xlator_t *this, inode_t *inode, const char *real_path,
+ int *op_errno, dict_t *dict);
#endif /* _POSIX_GFID_PATH_H */
diff --git a/xlators/storage/posix/src/posix-handle.h b/xlators/storage/posix/src/posix-handle.h
index 621f8f4d450..7c79b569128 100644
--- a/xlators/storage/posix/src/posix-handle.h
+++ b/xlators/storage/posix/src/posix-handle.h
@@ -12,192 +12,199 @@
#include "posix-inode-handle.h"
-#define HANDLE_ABSPATH_LEN(this) (POSIX_BASE_PATH_LEN(this) + \
- SLEN("/" GF_HIDDEN_PATH "/00/00/" \
- UUID0_STR) + 1)
-
-#define MAKE_PGFID_XATTR_KEY(var, prefix, pgfid) do { \
- var = alloca (strlen (prefix) + UUID_CANONICAL_FORM_LEN + 1); \
- strcpy (var, prefix); \
- strcat (var, uuid_utoa (pgfid)); \
- } while (0)
-
-#define SET_PGFID_XATTR(path, key, value, flags, op_ret, this, label) do { \
- value = hton32 (value); \
- op_ret = sys_lsetxattr (path, key, &value, sizeof (value), \
- flags); \
- if (op_ret == -1) { \
- op_errno = errno; \
- gf_msg (this->name, GF_LOG_WARNING, errno, P_MSG_PGFID_OP, \
- "setting xattr failed on %s: key = %s ", \
- path, key); \
- goto label; \
- } \
- } while (0)
-
-#define SET_PGFID_XATTR_IF_ABSENT(path, key, value, flags, op_ret, this, label)\
- do { \
- op_ret = sys_lgetxattr (path, key, &value, sizeof (value)); \
- if (op_ret == -1) { \
- op_errno = errno; \
- if (op_errno == ENOATTR) { \
- value = 1; \
- SET_PGFID_XATTR (path, key, value, flags, \
- op_ret, this, label); \
- } else { \
- gf_msg (this->name, GF_LOG_WARNING, op_errno, \
- P_MSG_PGFID_OP, "getting xattr " \
- "failed on %s: key = %s ", \
- path, key); \
- } \
- } \
- } while (0)
-
-#define REMOVE_PGFID_XATTR(path, key, op_ret, this, label) do { \
- op_ret = sys_lremovexattr (path, key); \
- if (op_ret == -1) { \
- op_errno = errno; \
- gf_msg (this->name, GF_LOG_WARNING, op_errno, \
- P_MSG_PGFID_OP, \
- "removing xattr failed" \
- "on %s: key = %s", path, key); \
- goto label; \
- } \
- } while (0)
+#define HANDLE_ABSPATH_LEN(this) \
+ (POSIX_BASE_PATH_LEN(this) + \
+ SLEN("/" GF_HIDDEN_PATH "/00/00/" UUID0_STR) + 1)
+
+#define MAKE_PGFID_XATTR_KEY(var, prefix, pgfid) \
+ do { \
+ var = alloca(strlen(prefix) + UUID_CANONICAL_FORM_LEN + 1); \
+ strcpy(var, prefix); \
+ strcat(var, uuid_utoa(pgfid)); \
+ } while (0)
+
+#define SET_PGFID_XATTR(path, key, value, flags, op_ret, this, label) \
+ do { \
+ value = hton32(value); \
+ op_ret = sys_lsetxattr(path, key, &value, sizeof(value), flags); \
+ if (op_ret == -1) { \
+ op_errno = errno; \
+ gf_msg(this->name, GF_LOG_WARNING, errno, P_MSG_PGFID_OP, \
+ "setting xattr failed on %s: key = %s ", path, key); \
+ goto label; \
+ } \
+ } while (0)
+
+#define SET_PGFID_XATTR_IF_ABSENT(path, key, value, flags, op_ret, this, \
+ label) \
+ do { \
+ op_ret = sys_lgetxattr(path, key, &value, sizeof(value)); \
+ if (op_ret == -1) { \
+ op_errno = errno; \
+ if (op_errno == ENOATTR) { \
+ value = 1; \
+ SET_PGFID_XATTR(path, key, value, flags, op_ret, this, label); \
+ } else { \
+ gf_msg(this->name, GF_LOG_WARNING, op_errno, P_MSG_PGFID_OP, \
+ "getting xattr " \
+ "failed on %s: key = %s ", \
+ path, key); \
+ } \
+ } \
+ } while (0)
+
+#define REMOVE_PGFID_XATTR(path, key, op_ret, this, label) \
+ do { \
+ op_ret = sys_lremovexattr(path, key); \
+ if (op_ret == -1) { \
+ op_errno = errno; \
+ gf_msg(this->name, GF_LOG_WARNING, op_errno, P_MSG_PGFID_OP, \
+ "removing xattr failed" \
+ "on %s: key = %s", \
+ path, key); \
+ goto label; \
+ } \
+ } while (0)
/* should be invoked holding a lock */
-#define LINK_MODIFY_PGFID_XATTR(path, key, value, flags, op_ret, this, label) do { \
- op_ret = sys_lgetxattr (path, key, &value, sizeof (value)); \
- if (op_ret == -1) { \
- op_errno = errno; \
- if (op_errno == ENOATTR || op_errno == ENODATA) { \
- value = 1; \
- } else { \
- gf_msg (this->name, GF_LOG_WARNING, errno, \
- P_MSG_PGFID_OP, "getting xattr " \
- "failed on %s: key = %s ", path, key); \
- goto label; \
- } \
- } else { \
- value = ntoh32 (value); \
- value++; \
- } \
- SET_PGFID_XATTR (path, key, value, flags, op_ret, this, label); \
- } while (0)
+#define LINK_MODIFY_PGFID_XATTR(path, key, value, flags, op_ret, this, label) \
+ do { \
+ op_ret = sys_lgetxattr(path, key, &value, sizeof(value)); \
+ if (op_ret == -1) { \
+ op_errno = errno; \
+ if (op_errno == ENOATTR || op_errno == ENODATA) { \
+ value = 1; \
+ } else { \
+ gf_msg(this->name, GF_LOG_WARNING, errno, P_MSG_PGFID_OP, \
+ "getting xattr " \
+ "failed on %s: key = %s ", \
+ path, key); \
+ goto label; \
+ } \
+ } else { \
+ value = ntoh32(value); \
+ value++; \
+ } \
+ SET_PGFID_XATTR(path, key, value, flags, op_ret, this, label); \
+ } while (0)
/* should be invoked holding a lock */
-#define UNLINK_MODIFY_PGFID_XATTR(path, key, value, flags, op_ret, this, label) do { \
- op_ret = sys_lgetxattr (path, key, &value, sizeof (value)); \
- if (op_ret == -1) { \
- op_errno = errno; \
- gf_msg (this->name, GF_LOG_WARNING, errno, \
- P_MSG_PGFID_OP, "getting xattr failed on " \
- "%s: key = %s ", path, key); \
- goto label; \
- } else { \
- value = ntoh32 (value); \
- value--; \
- if (value > 0) { \
- SET_PGFID_XATTR (path, key, value, flags, op_ret, \
- this, label); \
- } else { \
- REMOVE_PGFID_XATTR (path, key, op_ret, this, label); \
- } \
- } \
+#define UNLINK_MODIFY_PGFID_XATTR(path, key, value, flags, op_ret, this, \
+ label) \
+ do { \
+ op_ret = sys_lgetxattr(path, key, &value, sizeof(value)); \
+ if (op_ret == -1) { \
+ op_errno = errno; \
+ gf_msg(this->name, GF_LOG_WARNING, errno, P_MSG_PGFID_OP, \
+ "getting xattr failed on " \
+ "%s: key = %s ", \
+ path, key); \
+ goto label; \
+ } else { \
+ value = ntoh32(value); \
+ value--; \
+ if (value > 0) { \
+ SET_PGFID_XATTR(path, key, value, flags, op_ret, this, label); \
+ } else { \
+ REMOVE_PGFID_XATTR(path, key, op_ret, this, label); \
+ } \
+ } \
} while (0)
-#define MAKE_HANDLE_GFID_PATH(var, this, gfid, base) do { \
- int __len = 0; \
- __len = posix_handle_gfid_path (this, gfid, base, NULL, 0); \
- if (__len <= 0) \
- break; \
- var = alloca (__len); \
- __len = posix_handle_gfid_path (this, gfid, base, var, __len); \
- } while (0)
-
-
-#define MAKE_HANDLE_RELPATH(var, this, gfid, base) do { \
- int __len; \
- __len = posix_handle_relpath (this, gfid, base, NULL, 0); \
- if (__len <= 0) \
- break; \
- var = alloca (__len); \
- __len = posix_handle_relpath (this, gfid, base, var, __len); \
- } while (0)
-
-#define MAKE_HANDLE_ABSPATH(var, this, gfid) do { \
- struct posix_private * __priv = this->private; \
- int __len = HANDLE_ABSPATH_LEN(this); \
- var = alloca(__len); \
- snprintf(var, __len, "%s/" GF_HIDDEN_PATH "/%02x/%02x/%s", \
- __priv->base_path, gfid[0], gfid[1], uuid_utoa(gfid)); \
- } while (0)
-
-#define MAKE_ENTRY_HANDLE(entp, parp, this, loc, ent_p) do { \
- char *__parp; \
- \
- if (gf_uuid_is_null (loc->pargfid) || !loc->name) { \
- gf_msg (this->name, GF_LOG_ERROR, 0, P_MSG_ENTRY_HANDLE_CREATE,\
- "null pargfid/name for path %s", loc->path); \
- break; \
- } \
- \
- if (strstr (loc->name, "../")) { \
- gf_msg (this->name, GF_LOG_ERROR, 0, P_MSG_ENTRY_HANDLE_CREATE, \
- "'../' in name not allowed: (%s)", loc->name); \
- op_ret = -1; \
- break; \
- } \
- if (LOC_HAS_ABSPATH (loc)) { \
- MAKE_REAL_PATH (entp, this, loc->path); \
- __parp = strdupa (entp); \
- parp = dirname (__parp); \
- op_ret = posix_pstat (this, loc->inode, NULL, entp, ent_p, \
- _gf_false); \
- break; \
- } \
- errno = 0; \
- op_ret = posix_istat (this, loc->inode, loc->pargfid, \
- loc->name, ent_p); \
- if (errno != ELOOP) { \
- MAKE_HANDLE_PATH (parp, this, loc->pargfid, NULL); \
- MAKE_HANDLE_PATH (entp, this, loc->pargfid, loc->name); \
- if (!parp || !entp) { \
- gf_msg (this->name, GF_LOG_ERROR, errno, \
- P_MSG_ENTRY_HANDLE_CREATE, \
- "Failed to create entry handle " \
- "for path %s", loc->path); \
- } \
- break; \
- } \
- /* __ret == -1 && errno == ELOOP */ \
- /* expand ELOOP */ \
- } while (0)
+#define MAKE_HANDLE_GFID_PATH(var, this, gfid, base) \
+ do { \
+ int __len = 0; \
+ __len = posix_handle_gfid_path(this, gfid, base, NULL, 0); \
+ if (__len <= 0) \
+ break; \
+ var = alloca(__len); \
+ __len = posix_handle_gfid_path(this, gfid, base, var, __len); \
+ } while (0)
-int
-posix_handle_gfid_path (xlator_t *this, uuid_t gfid, const char *basename,
- char *buf, size_t len);
+#define MAKE_HANDLE_RELPATH(var, this, gfid, base) \
+ do { \
+ int __len; \
+ __len = posix_handle_relpath(this, gfid, base, NULL, 0); \
+ if (__len <= 0) \
+ break; \
+ var = alloca(__len); \
+ __len = posix_handle_relpath(this, gfid, base, var, __len); \
+ } while (0)
+
+#define MAKE_HANDLE_ABSPATH(var, this, gfid) \
+ do { \
+ struct posix_private *__priv = this->private; \
+ int __len = HANDLE_ABSPATH_LEN(this); \
+ var = alloca(__len); \
+ snprintf(var, __len, "%s/" GF_HIDDEN_PATH "/%02x/%02x/%s", \
+ __priv->base_path, gfid[0], gfid[1], uuid_utoa(gfid)); \
+ } while (0)
+
+#define MAKE_ENTRY_HANDLE(entp, parp, this, loc, ent_p) \
+ do { \
+ char *__parp; \
+ \
+ if (gf_uuid_is_null(loc->pargfid) || !loc->name) { \
+ gf_msg(this->name, GF_LOG_ERROR, 0, P_MSG_ENTRY_HANDLE_CREATE, \
+ "null pargfid/name for path %s", loc->path); \
+ break; \
+ } \
+ \
+ if (strstr(loc->name, "../")) { \
+ gf_msg(this->name, GF_LOG_ERROR, 0, P_MSG_ENTRY_HANDLE_CREATE, \
+ "'../' in name not allowed: (%s)", loc->name); \
+ op_ret = -1; \
+ break; \
+ } \
+ if (LOC_HAS_ABSPATH(loc)) { \
+ MAKE_REAL_PATH(entp, this, loc->path); \
+ __parp = strdupa(entp); \
+ parp = dirname(__parp); \
+ op_ret = posix_pstat(this, loc->inode, NULL, entp, ent_p, \
+ _gf_false); \
+ break; \
+ } \
+ errno = 0; \
+ op_ret = posix_istat(this, loc->inode, loc->pargfid, loc->name, \
+ ent_p); \
+ if (errno != ELOOP) { \
+ MAKE_HANDLE_PATH(parp, this, loc->pargfid, NULL); \
+ MAKE_HANDLE_PATH(entp, this, loc->pargfid, loc->name); \
+ if (!parp || !entp) { \
+ gf_msg(this->name, GF_LOG_ERROR, errno, \
+ P_MSG_ENTRY_HANDLE_CREATE, \
+ "Failed to create entry handle " \
+ "for path %s", \
+ loc->path); \
+ } \
+ break; \
+ } \
+ /* __ret == -1 && errno == ELOOP */ \
+ /* expand ELOOP */ \
+ } while (0)
int
-posix_handle_hard (xlator_t *this, const char *path, uuid_t gfid,
- struct stat *buf);
+posix_handle_gfid_path(xlator_t *this, uuid_t gfid, const char *basename,
+ char *buf, size_t len);
+int
+posix_handle_hard(xlator_t *this, const char *path, uuid_t gfid,
+ struct stat *buf);
int
-posix_handle_soft (xlator_t *this, const char *real_path, loc_t *loc,
- uuid_t gfid, struct stat *buf);
+posix_handle_soft(xlator_t *this, const char *real_path, loc_t *loc,
+ uuid_t gfid, struct stat *buf);
int
-posix_handle_unset (xlator_t *this, uuid_t gfid, const char *basename);
+posix_handle_unset(xlator_t *this, uuid_t gfid, const char *basename);
int
-posix_create_link_if_gfid_exists (xlator_t *this, uuid_t gfid,
- char *real_path, inode_table_t *itable);
+posix_create_link_if_gfid_exists(xlator_t *this, uuid_t gfid, char *real_path,
+ inode_table_t *itable);
int
-posix_check_internal_writes (xlator_t *this, fd_t *fd, int sysfd,
- dict_t *xdata);
+posix_check_internal_writes(xlator_t *this, fd_t *fd, int sysfd, dict_t *xdata);
void
-posix_disk_space_check (xlator_t *this);
+posix_disk_space_check(xlator_t *this);
#endif /* !_POSIX_HANDLE_H */
diff --git a/xlators/storage/posix/src/posix-inode-handle.h b/xlators/storage/posix/src/posix-inode-handle.h
index cb315424dd0..f225d94912b 100644
--- a/xlators/storage/posix/src/posix-inode-handle.h
+++ b/xlators/storage/posix/src/posix-inode-handle.h
@@ -27,91 +27,92 @@
#define SLEN(str) (sizeof(str) - 1)
#define LOC_HAS_ABSPATH(loc) (loc && (loc->path) && (loc->path[0] == '/'))
-#define LOC_IS_DIR(loc) (loc && (loc->inode) && \
- (loc->inode->ia_type == IA_IFDIR))
-#define MAKE_REAL_PATH(var, this, path) do { \
- size_t path_len = strlen(path); \
- size_t var_len = path_len + POSIX_BASE_PATH_LEN(this) + 1; \
- if (POSIX_PATH_MAX(this) != -1 && \
- var_len >= POSIX_PATH_MAX(this)) { \
- var = alloca (path_len + 1); \
- strcpy (var, (path[0] == '/') ? path + 1 : path); \
- } else { \
- var = alloca (var_len); \
- strcpy (var, POSIX_BASE_PATH(this)); \
- strcpy (&var[POSIX_BASE_PATH_LEN(this)], path); \
- } \
+#define LOC_IS_DIR(loc) \
+ (loc && (loc->inode) && (loc->inode->ia_type == IA_IFDIR))
+#define MAKE_REAL_PATH(var, this, path) \
+ do { \
+ size_t path_len = strlen(path); \
+ size_t var_len = path_len + POSIX_BASE_PATH_LEN(this) + 1; \
+ if (POSIX_PATH_MAX(this) != -1 && var_len >= POSIX_PATH_MAX(this)) { \
+ var = alloca(path_len + 1); \
+ strcpy(var, (path[0] == '/') ? path + 1 : path); \
+ } else { \
+ var = alloca(var_len); \
+ strcpy(var, POSIX_BASE_PATH(this)); \
+ strcpy(&var[POSIX_BASE_PATH_LEN(this)], path); \
+ } \
} while (0)
-#define MAKE_HANDLE_PATH(var, this, gfid, base) do { \
- int __len; \
- __len = posix_handle_path (this, gfid, base, NULL, 0); \
- if (__len <= 0) \
- break; \
- var = alloca (__len); \
- __len = posix_handle_path (this, gfid, base, var, __len); \
- if (__len <= 0) \
- var = NULL; \
- } while (0)
+#define MAKE_HANDLE_PATH(var, this, gfid, base) \
+ do { \
+ int __len; \
+ __len = posix_handle_path(this, gfid, base, NULL, 0); \
+ if (__len <= 0) \
+ break; \
+ var = alloca(__len); \
+ __len = posix_handle_path(this, gfid, base, var, __len); \
+ if (__len <= 0) \
+ var = NULL; \
+ } while (0)
/* TODO: it is not a good idea to change a variable which
is not passed to the macro.. Fix it later */
-#define MAKE_INODE_HANDLE(rpath, this, loc, iatt_p) do { \
- if (!this->private) { \
- op_ret = -1; \
- gf_msg ("make_inode_handle", GF_LOG_ERROR, 0, \
- P_MSG_INODE_HANDLE_CREATE, \
- "private is NULL, fini is already called"); \
- break; \
- } \
- if (gf_uuid_is_null (loc->gfid)) { \
- op_ret = -1; \
- gf_msg (this->name, GF_LOG_ERROR, 0, \
- P_MSG_INODE_HANDLE_CREATE, \
- "null gfid for path %s", (loc)->path); \
- break; \
- } \
- if (LOC_IS_DIR (loc) && LOC_HAS_ABSPATH (loc)) { \
- MAKE_REAL_PATH (rpath, this, (loc)->path); \
- op_ret = posix_pstat (this, (loc)->inode, (loc)->gfid, \
- rpath, iatt_p, _gf_false); \
- break; \
- } \
- errno = 0; \
- op_ret = posix_istat (this, loc->inode, loc->gfid, NULL, iatt_p); \
- if (errno != ELOOP) { \
- MAKE_HANDLE_PATH (rpath, this, (loc)->gfid, NULL); \
- if (!rpath) { \
- op_ret = -1; \
- gf_msg (this->name, GF_LOG_ERROR, errno, \
- P_MSG_INODE_HANDLE_CREATE, \
- "Failed to create inode handle " \
- "for path %s", (loc)->path); \
- } \
- break; \
- } \
- /* __ret == -1 && errno == ELOOP */ \
- } while (0)
+#define MAKE_INODE_HANDLE(rpath, this, loc, iatt_p) \
+ do { \
+ if (!this->private) { \
+ op_ret = -1; \
+ gf_msg("make_inode_handle", GF_LOG_ERROR, 0, \
+ P_MSG_INODE_HANDLE_CREATE, \
+ "private is NULL, fini is already called"); \
+ break; \
+ } \
+ if (gf_uuid_is_null(loc->gfid)) { \
+ op_ret = -1; \
+ gf_msg(this->name, GF_LOG_ERROR, 0, P_MSG_INODE_HANDLE_CREATE, \
+ "null gfid for path %s", (loc)->path); \
+ break; \
+ } \
+ if (LOC_IS_DIR(loc) && LOC_HAS_ABSPATH(loc)) { \
+ MAKE_REAL_PATH(rpath, this, (loc)->path); \
+ op_ret = posix_pstat(this, (loc)->inode, (loc)->gfid, rpath, \
+ iatt_p, _gf_false); \
+ break; \
+ } \
+ errno = 0; \
+ op_ret = posix_istat(this, loc->inode, loc->gfid, NULL, iatt_p); \
+ if (errno != ELOOP) { \
+ MAKE_HANDLE_PATH(rpath, this, (loc)->gfid, NULL); \
+ if (!rpath) { \
+ op_ret = -1; \
+ gf_msg(this->name, GF_LOG_ERROR, errno, \
+ P_MSG_INODE_HANDLE_CREATE, \
+ "Failed to create inode handle " \
+ "for path %s", \
+ (loc)->path); \
+ } \
+ break; \
+ } \
+ /* __ret == -1 && errno == ELOOP */ \
+ } while (0)
#define POSIX_ANCESTRY_PATH (1 << 0)
#define POSIX_ANCESTRY_DENTRY (1 << 1)
int
-posix_handle_path (xlator_t *this, uuid_t gfid, const char *basename, char *buf,
- size_t len);
+posix_handle_path(xlator_t *this, uuid_t gfid, const char *basename, char *buf,
+ size_t len);
int
-posix_make_ancestryfromgfid (xlator_t *this, char *path, int pathsize,
- gf_dirent_t *head, int type, uuid_t gfid,
- const size_t handle_size,
- const char *priv_base_path,
- inode_table_t *table, inode_t **parent,
- dict_t *xdata, int32_t *op_errno);
+posix_make_ancestryfromgfid(xlator_t *this, char *path, int pathsize,
+ gf_dirent_t *head, int type, uuid_t gfid,
+ const size_t handle_size,
+ const char *priv_base_path, inode_table_t *table,
+ inode_t **parent, dict_t *xdata, int32_t *op_errno);
int
-posix_handle_init (xlator_t *this);
+posix_handle_init(xlator_t *this);
int
-posix_handle_trash_init (xlator_t *this);
+posix_handle_trash_init(xlator_t *this);
#endif /* !_POSIX_INODE_HANDLE_H */
diff --git a/xlators/storage/posix/src/posix-mem-types.h b/xlators/storage/posix/src/posix-mem-types.h
index 0180900ee8e..b9bd79ba3b8 100644
--- a/xlators/storage/posix/src/posix-mem-types.h
+++ b/xlators/storage/posix/src/posix-mem-types.h
@@ -13,17 +13,16 @@
#include "mem-types.h"
enum gf_posix_mem_types_ {
- gf_posix_mt_dir_entry_t = gf_common_mt_end + 1,
- gf_posix_mt_posix_fd,
- gf_posix_mt_char,
- gf_posix_mt_posix_private,
- gf_posix_mt_int32_t,
- gf_posix_mt_posix_dev_t,
- gf_posix_mt_trash_path,
- gf_posix_mt_paiocb,
- gf_posix_mt_inode_ctx_t,
- gf_posix_mt_mdata_attr,
- gf_posix_mt_end
+ gf_posix_mt_dir_entry_t = gf_common_mt_end + 1,
+ gf_posix_mt_posix_fd,
+ gf_posix_mt_char,
+ gf_posix_mt_posix_private,
+ gf_posix_mt_int32_t,
+ gf_posix_mt_posix_dev_t,
+ gf_posix_mt_trash_path,
+ gf_posix_mt_paiocb,
+ gf_posix_mt_inode_ctx_t,
+ gf_posix_mt_mdata_attr,
+ gf_posix_mt_end
};
#endif
-
diff --git a/xlators/storage/posix/src/posix-messages.h b/xlators/storage/posix/src/posix-messages.h
index 38e6d3113d3..14167a5f829 100644
--- a/xlators/storage/posix/src/posix-messages.h
+++ b/xlators/storage/posix/src/posix-messages.h
@@ -23,125 +23,50 @@
* glfs-message-id.h.
*/
-GLFS_MSGID(POSIX,
- P_MSG_XATTR_FAILED,
- P_MSG_NULL_GFID,
- P_MSG_FCNTL_FAILED,
- P_MSG_READV_FAILED,
- P_MSG_FSTAT_FAILED,
- P_MSG_PFD_NULL,
- P_MSG_INVALID_ARGUMENT,
- P_MSG_IO_SUBMIT_FAILED,
- P_MSG_WRITEV_FAILED,
- P_MSG_IO_GETEVENTS_FAILED,
- P_MSG_UNKNOWN_OP,
- P_MSG_AIO_UNAVAILABLE,
- P_MSG_IO_SETUP_FAILED,
- P_MSG_ZEROFILL_FAILED,
- P_MSG_OPENDIR_FAILED,
- P_MSG_DIRFD_FAILED,
- P_MSG_FD_PATH_SETTING_FAILED,
- P_MSG_LSTAT_FAILED,
- P_MSG_READYLINK_FAILED,
- P_MSG_GFID_FAILED,
- P_MSG_CREATE_FAILED,
- P_MSG_MKNOD_FAILED,
- P_MSG_LCHOWN_FAILED,
- P_MSG_ACL_FAILED,
- P_MSG_MKDIR_NOT_PERMITTED,
- P_MSG_DIR_OF_SAME_ID,
- P_MSG_MKDIR_FAILED,
- P_MSG_CHOWN_FAILED,
- P_MSG_UNLINK_FAILED,
- P_MSG_KEY_STATUS_INFO,
- P_MSG_XATTR_STATUS,
- P_MSG_RMDIR_NOT_PERMITTED,
- P_MSG_RMDIR_FAILED,
- P_MSG_DIR_OPERATION_FAILED,
- P_MSG_SYMLINK_FAILED,
- P_MSG_DIR_FOUND,
- P_MSG_LINK_FAILED,
- P_MSG_TRUNCATE_FAILED,
- P_MSG_FILE_OP_FAILED,
- P_MSG_READ_FAILED,
- P_MSG_DICT_SET_FAILED,
- P_MSG_STATVFS_FAILED,
- P_MSG_DIR_NOT_NULL,
- P_MSG_FSYNC_FAILED,
- P_MSG_CLOSE_FAILED,
- P_MSG_GETTING_FILENAME_FAILED,
- P_MSG_INODE_PATH_GET_FAILED,
- P_MSG_GET_KEY_VALUE_FAILED,
- P_MSG_CHMOD_FAILED,
- P_MSG_FCHMOD_FAILED,
- P_MSG_FCHOWN_FAILED,
- P_MSG_UTIMES_FAILED,
- P_MSG_FUTIMES_FAILED,
- P_MSG_XATTR_NOT_REMOVED,
- P_MSG_PFD_GET_FAILED,
- P_MSG_ACCESS_FAILED,
- P_MSG_PREAD_FAILED,
- P_MSG_UUID_NULL,
- P_MSG_EXPORT_DIR_MISSING,
- P_MSG_SUBVOLUME_ERROR,
- P_MSG_VOLUME_DANGLING,
- P_MSG_INVALID_OPTION,
- P_MSG_INVALID_VOLUME_ID,
- P_MSG_VOLUME_ID_ABSENT,
- P_MSG_HOSTNAME_MISSING,
- P_MSG_SET_ULIMIT_FAILED,
- P_MSG_SET_FILE_MAX_FAILED,
- P_MSG_MAX_FILE_OPEN,
- P_MSG_OPEN_FAILED,
- P_MSG_LOOKUP_NOT_PERMITTED,
- P_MSG_RENAME_FAILED,
- P_MSG_WRITE_FAILED,
- P_MSG_FILE_FAILED,
- P_MSG_THREAD_FAILED,
- P_MSG_HEALTHCHECK_FAILED,
- P_MSG_GET_FDCTX_FAILED,
- P_MSG_HANDLEPATH_FAILED,
- P_MSG_IPC_NOT_HANDLE,
- P_MSG_SET_XDATA_FAIL,
- P_MSG_DURABILITY_REQ_NOT_SATISFIED,
- P_MSG_XATTR_NOTSUP,
- P_MSG_GFID_SET_FAILED,
- P_MSG_ACL_NOTSUP,
- P_MSG_BASEPATH_CHDIR_FAILED,
- P_MSG_INVALID_OPTION_VAL,
- P_MSG_INVALID_NODE_UUID,
- P_MSG_FSYNCER_THREAD_CREATE_FAILED,
- P_MSG_GF_DIRENT_CREATE_FAILED,
- P_MSG_VOLUME_ID_FETCH_FAILED,
- P_MSG_UNKNOWN_ARGUMENT,
- P_MSG_INODE_HANDLE_CREATE,
- P_MSG_ENTRY_HANDLE_CREATE,
- P_MSG_PGFID_OP,
- P_MSG_POSIX_AIO,
- P_MSG_HANDLE_CREATE_TRASH,
- P_MSG_HANDLE_CREATE,
- P_MSG_HANDLE_PATH_CREATE,
- P_MSG_SET_FILE_CONTENTS,
- P_MSG_XDATA_GETXATTR,
- P_MSG_STALE_HANDLE_REMOVE_FAILED,
- P_MSG_HANDLE_PATH_CREATE_FAILED,
- P_MSG_HANDLE_TRASH_CREATE,
- P_MSG_HANDLE_DELETE,
- P_MSG_READLINK_FAILED,
- P_MSG_BUFFER_OVERFLOW,
- P_MSG_SEEK_UNKOWN,
- P_MSG_SEEK_FAILED,
- P_MSG_INODE_RESOLVE_FAILED,
- P_MSG_PREOP_CHECK_FAILED,
- P_MSG_LEASE_DISABLED,
- P_MSG_ANCESTORY_FAILED,
- P_MSG_DISK_SPACE_CHECK_FAILED,
- P_MSG_FALLOCATE_FAILED,
- P_MSG_STOREMDATA_FAILED,
- P_MSG_FETCHMDATA_FAILED,
- P_MSG_GETMDATA_FAILED,
- P_MSG_SETMDATA_FAILED,
- P_MSG_FRESHFILE
-);
+GLFS_MSGID(POSIX, P_MSG_XATTR_FAILED, P_MSG_NULL_GFID, P_MSG_FCNTL_FAILED,
+ P_MSG_READV_FAILED, P_MSG_FSTAT_FAILED, P_MSG_PFD_NULL,
+ P_MSG_INVALID_ARGUMENT, P_MSG_IO_SUBMIT_FAILED, P_MSG_WRITEV_FAILED,
+ P_MSG_IO_GETEVENTS_FAILED, P_MSG_UNKNOWN_OP, P_MSG_AIO_UNAVAILABLE,
+ P_MSG_IO_SETUP_FAILED, P_MSG_ZEROFILL_FAILED, P_MSG_OPENDIR_FAILED,
+ P_MSG_DIRFD_FAILED, P_MSG_FD_PATH_SETTING_FAILED, P_MSG_LSTAT_FAILED,
+ P_MSG_READYLINK_FAILED, P_MSG_GFID_FAILED, P_MSG_CREATE_FAILED,
+ P_MSG_MKNOD_FAILED, P_MSG_LCHOWN_FAILED, P_MSG_ACL_FAILED,
+ P_MSG_MKDIR_NOT_PERMITTED, P_MSG_DIR_OF_SAME_ID, P_MSG_MKDIR_FAILED,
+ P_MSG_CHOWN_FAILED, P_MSG_UNLINK_FAILED, P_MSG_KEY_STATUS_INFO,
+ P_MSG_XATTR_STATUS, P_MSG_RMDIR_NOT_PERMITTED, P_MSG_RMDIR_FAILED,
+ P_MSG_DIR_OPERATION_FAILED, P_MSG_SYMLINK_FAILED, P_MSG_DIR_FOUND,
+ P_MSG_LINK_FAILED, P_MSG_TRUNCATE_FAILED, P_MSG_FILE_OP_FAILED,
+ P_MSG_READ_FAILED, P_MSG_DICT_SET_FAILED, P_MSG_STATVFS_FAILED,
+ P_MSG_DIR_NOT_NULL, P_MSG_FSYNC_FAILED, P_MSG_CLOSE_FAILED,
+ P_MSG_GETTING_FILENAME_FAILED, P_MSG_INODE_PATH_GET_FAILED,
+ P_MSG_GET_KEY_VALUE_FAILED, P_MSG_CHMOD_FAILED, P_MSG_FCHMOD_FAILED,
+ P_MSG_FCHOWN_FAILED, P_MSG_UTIMES_FAILED, P_MSG_FUTIMES_FAILED,
+ P_MSG_XATTR_NOT_REMOVED, P_MSG_PFD_GET_FAILED, P_MSG_ACCESS_FAILED,
+ P_MSG_PREAD_FAILED, P_MSG_UUID_NULL, P_MSG_EXPORT_DIR_MISSING,
+ P_MSG_SUBVOLUME_ERROR, P_MSG_VOLUME_DANGLING, P_MSG_INVALID_OPTION,
+ P_MSG_INVALID_VOLUME_ID, P_MSG_VOLUME_ID_ABSENT,
+ P_MSG_HOSTNAME_MISSING, P_MSG_SET_ULIMIT_FAILED,
+ P_MSG_SET_FILE_MAX_FAILED, P_MSG_MAX_FILE_OPEN, P_MSG_OPEN_FAILED,
+ P_MSG_LOOKUP_NOT_PERMITTED, P_MSG_RENAME_FAILED, P_MSG_WRITE_FAILED,
+ P_MSG_FILE_FAILED, P_MSG_THREAD_FAILED, P_MSG_HEALTHCHECK_FAILED,
+ P_MSG_GET_FDCTX_FAILED, P_MSG_HANDLEPATH_FAILED,
+ P_MSG_IPC_NOT_HANDLE, P_MSG_SET_XDATA_FAIL,
+ P_MSG_DURABILITY_REQ_NOT_SATISFIED, P_MSG_XATTR_NOTSUP,
+ P_MSG_GFID_SET_FAILED, P_MSG_ACL_NOTSUP, P_MSG_BASEPATH_CHDIR_FAILED,
+ P_MSG_INVALID_OPTION_VAL, P_MSG_INVALID_NODE_UUID,
+ P_MSG_FSYNCER_THREAD_CREATE_FAILED, P_MSG_GF_DIRENT_CREATE_FAILED,
+ P_MSG_VOLUME_ID_FETCH_FAILED, P_MSG_UNKNOWN_ARGUMENT,
+ P_MSG_INODE_HANDLE_CREATE, P_MSG_ENTRY_HANDLE_CREATE, P_MSG_PGFID_OP,
+ P_MSG_POSIX_AIO, P_MSG_HANDLE_CREATE_TRASH, P_MSG_HANDLE_CREATE,
+ P_MSG_HANDLE_PATH_CREATE, P_MSG_SET_FILE_CONTENTS,
+ P_MSG_XDATA_GETXATTR, P_MSG_STALE_HANDLE_REMOVE_FAILED,
+ P_MSG_HANDLE_PATH_CREATE_FAILED, P_MSG_HANDLE_TRASH_CREATE,
+ P_MSG_HANDLE_DELETE, P_MSG_READLINK_FAILED, P_MSG_BUFFER_OVERFLOW,
+ P_MSG_SEEK_UNKOWN, P_MSG_SEEK_FAILED, P_MSG_INODE_RESOLVE_FAILED,
+ P_MSG_PREOP_CHECK_FAILED, P_MSG_LEASE_DISABLED,
+ P_MSG_ANCESTORY_FAILED, P_MSG_DISK_SPACE_CHECK_FAILED,
+ P_MSG_FALLOCATE_FAILED, P_MSG_STOREMDATA_FAILED,
+ P_MSG_FETCHMDATA_FAILED, P_MSG_GETMDATA_FAILED,
+ P_MSG_SETMDATA_FAILED, P_MSG_FRESHFILE);
#endif /* !_GLUSTERD_MESSAGES_H_ */
diff --git a/xlators/storage/posix/src/posix-metadata-disk.h b/xlators/storage/posix/src/posix-metadata-disk.h
index b25ad04a633..8833fbb5428 100644
--- a/xlators/storage/posix/src/posix-metadata-disk.h
+++ b/xlators/storage/posix/src/posix-metadata-disk.h
@@ -12,20 +12,20 @@
#define _POSIX_METADATA_DISK_H
typedef struct gf_timespec_disk {
- uint64_t tv_sec;
- uint64_t tv_nsec;
+ uint64_t tv_sec;
+ uint64_t tv_nsec;
} gf_timespec_disk_t;
/* posix_mdata_t on disk structure */
-typedef struct __attribute__ ((__packed__)) posix_mdata_disk {
- /* version of structure, bumped up if any new member is added */
- uint8_t version;
- /* flags indicates valid fields in the structure */
- uint64_t flags;
- gf_timespec_disk_t ctime;
- gf_timespec_disk_t mtime;
- gf_timespec_disk_t atime;
+typedef struct __attribute__((__packed__)) posix_mdata_disk {
+ /* version of structure, bumped up if any new member is added */
+ uint8_t version;
+ /* flags indicates valid fields in the structure */
+ uint64_t flags;
+ gf_timespec_disk_t ctime;
+ gf_timespec_disk_t mtime;
+ gf_timespec_disk_t atime;
} posix_mdata_disk_t;
#endif /* _POSIX_METADATA_DISK_H */
diff --git a/xlators/storage/posix/src/posix-metadata.h b/xlators/storage/posix/src/posix-metadata.h
index fbd79f6a4b7..e1b549d55a1 100644
--- a/xlators/storage/posix/src/posix-metadata.h
+++ b/xlators/storage/posix/src/posix-metadata.h
@@ -15,38 +15,38 @@
/* In memory representation posix metadata xattr */
typedef struct {
- /* version of structure, bumped up if any new member is added */
- uint8_t version;
- /* flags indicates valid fields in the structure */
- uint64_t flags;
- struct timespec ctime;
- struct timespec mtime;
- struct timespec atime;
+ /* version of structure, bumped up if any new member is added */
+ uint8_t version;
+ /* flags indicates valid fields in the structure */
+ uint64_t flags;
+ struct timespec ctime;
+ struct timespec mtime;
+ struct timespec atime;
} posix_mdata_t;
typedef struct {
- unsigned short ctime : 1;
- unsigned short mtime : 1;
- unsigned short atime : 1;
+ unsigned short ctime : 1;
+ unsigned short mtime : 1;
+ unsigned short atime : 1;
} posix_mdata_flag_t;
/* With inode lock*/
int
-posix_get_mdata_xattr (xlator_t *this, const char *real_path, int _fd,
- inode_t *inode, struct iatt *stbuf);
+posix_get_mdata_xattr(xlator_t *this, const char *real_path, int _fd,
+ inode_t *inode, struct iatt *stbuf);
/* With out inode lock*/
int
-__posix_get_mdata_xattr (xlator_t *this, const char *real_path, int _fd,
- inode_t *inode, struct iatt *stbuf);
+__posix_get_mdata_xattr(xlator_t *this, const char *real_path, int _fd,
+ inode_t *inode, struct iatt *stbuf);
void
-posix_update_utime_in_mdata (xlator_t *this, const char *real_path, int fd,
- inode_t *inode, struct iatt *stbuf, int valid);
+posix_update_utime_in_mdata(xlator_t *this, const char *real_path, int fd,
+ inode_t *inode, struct iatt *stbuf, int valid);
void
-posix_set_ctime (call_frame_t *frame, xlator_t *this, const char* real_path,
- int fd, inode_t *inode, struct iatt *stbuf);
+posix_set_ctime(call_frame_t *frame, xlator_t *this, const char *real_path,
+ int fd, inode_t *inode, struct iatt *stbuf);
void
-posix_set_parent_ctime (call_frame_t *frame, xlator_t *this,
- const char* real_path, int fd, inode_t *inode,
- struct iatt *stbuf);
+posix_set_parent_ctime(call_frame_t *frame, xlator_t *this,
+ const char *real_path, int fd, inode_t *inode,
+ struct iatt *stbuf);
#endif /* _POSIX_METADATA_H */
diff --git a/xlators/storage/posix/src/posix.h b/xlators/storage/posix/src/posix.h
index 7f588495099..4c32509cf04 100644
--- a/xlators/storage/posix/src/posix.h
+++ b/xlators/storage/posix/src/posix.h
@@ -58,24 +58,25 @@
*/
#define TIER_LINKTO "trusted.tier.tier-dht.linkto"
-#define POSIX_GFID_HANDLE_SIZE(base_path_len) (base_path_len + SLEN("/") \
- + SLEN(GF_HIDDEN_PATH) + SLEN("/") \
- + SLEN("00/") \
- + SLEN("00/") + SLEN(UUID0_STR) + 1) /* '\0' */;
+#define POSIX_GFID_HANDLE_SIZE(base_path_len) \
+ (base_path_len + SLEN("/") + SLEN(GF_HIDDEN_PATH) + SLEN("/") + \
+ SLEN("00/") + SLEN("00/") + SLEN(UUID0_STR) + 1) /* '\0' */;
#define GF_UNLINK_TRUE 0x0000000000000001
#define GF_UNLINK_FALSE 0x0000000000000000
-#define DISK_SPACE_CHECK_AND_GOTO(frame, priv, xdata, op_ret, op_errno, out) do { \
- if (frame->root->pid >= 0 && priv->disk_space_full && \
- !dict_get (xdata, GLUSTERFS_INTERNAL_FOP_KEY)) { \
- op_ret = -1; \
- op_errno = ENOSPC; \
- gf_msg_debug ("posix", ENOSPC, \
- "disk space utilization reached limits" \
- " for path %s ", priv->base_path); \
- goto out; \
- } \
- } while (0)
+#define DISK_SPACE_CHECK_AND_GOTO(frame, priv, xdata, op_ret, op_errno, out) \
+ do { \
+ if (frame->root->pid >= 0 && priv->disk_space_full && \
+ !dict_get(xdata, GLUSTERFS_INTERNAL_FOP_KEY)) { \
+ op_ret = -1; \
+ op_errno = ENOSPC; \
+ gf_msg_debug("posix", ENOSPC, \
+ "disk space utilization reached limits" \
+ " for path %s ", \
+ priv->base_path); \
+ goto out; \
+ } \
+ } while (0)
/* Setting microseconds or nanoseconds depending on what's supported:
The passed in `tv` can be
@@ -84,393 +85,398 @@
struct timeval
otherwise. */
#if HAVE_UTIMENSAT
-#define SET_TIMESPEC_NSEC_OR_TIMEVAL_USEC(tv, nanosecs) \
- tv.tv_nsec = nanosecs
-#define PATH_SET_TIMESPEC_OR_TIMEVAL(path, tv) \
- (sys_utimensat (AT_FDCWD, path, tv, AT_SYMLINK_NOFOLLOW))
+#define SET_TIMESPEC_NSEC_OR_TIMEVAL_USEC(tv, nanosecs) tv.tv_nsec = nanosecs
+#define PATH_SET_TIMESPEC_OR_TIMEVAL(path, tv) \
+ (sys_utimensat(AT_FDCWD, path, tv, AT_SYMLINK_NOFOLLOW))
#else
-#define SET_TIMESPEC_NSEC_OR_TIMEVAL_USEC(tv, nanosecs) \
- tv.tv_usec = nanosecs / 1000
-#define PATH_SET_TIMESPEC_OR_TIMEVAL(path, tv) \
- (lutimes (path, tv))
+#define SET_TIMESPEC_NSEC_OR_TIMEVAL_USEC(tv, nanosecs) \
+ tv.tv_usec = nanosecs / 1000
+#define PATH_SET_TIMESPEC_OR_TIMEVAL(path, tv) (lutimes(path, tv))
#endif
-#define GFID_NULL_CHECK_AND_GOTO(frame, this, loc, xattr_req, op_ret, \
- op_errno, out) \
- do { \
- uuid_t _uuid_req; \
- int _ret = 0; \
- /* TODO: Remove pid check once trash implements client side \
- * logic to assign gfid for entry creations inside .trashcan \
- */ \
- if (frame->root->pid == GF_SERVER_PID_TRASH) \
- break; \
- _ret = dict_get_gfuuid (xattr_req, "gfid-req", &_uuid_req); \
- if (_ret) { \
- gf_msg (this->name, GF_LOG_ERROR, EINVAL, \
- P_MSG_NULL_GFID, "failed to get the gfid from" \
- " dict for %s", loc->path); \
- op_ret = -1; \
- op_errno = EINVAL; \
- goto out; \
- } \
- if (gf_uuid_is_null (_uuid_req)) { \
- gf_msg (this->name, GF_LOG_ERROR, EINVAL, \
- P_MSG_NULL_GFID, "gfid is null for %s", \
- loc->path); \
- op_ret = -1; \
- op_errno = EINVAL; \
- goto out; \
- } \
- } while (0)
-
+#define GFID_NULL_CHECK_AND_GOTO(frame, this, loc, xattr_req, op_ret, \
+ op_errno, out) \
+ do { \
+ uuid_t _uuid_req; \
+ int _ret = 0; \
+ /* TODO: Remove pid check once trash implements client side \
+ * logic to assign gfid for entry creations inside .trashcan \
+ */ \
+ if (frame->root->pid == GF_SERVER_PID_TRASH) \
+ break; \
+ _ret = dict_get_gfuuid(xattr_req, "gfid-req", &_uuid_req); \
+ if (_ret) { \
+ gf_msg(this->name, GF_LOG_ERROR, EINVAL, P_MSG_NULL_GFID, \
+ "failed to get the gfid from" \
+ " dict for %s", \
+ loc->path); \
+ op_ret = -1; \
+ op_errno = EINVAL; \
+ goto out; \
+ } \
+ if (gf_uuid_is_null(_uuid_req)) { \
+ gf_msg(this->name, GF_LOG_ERROR, EINVAL, P_MSG_NULL_GFID, \
+ "gfid is null for %s", loc->path); \
+ op_ret = -1; \
+ op_errno = EINVAL; \
+ goto out; \
+ } \
+ } while (0)
/**
* posix_fd - internal structure common to file and directory fd's
*/
struct posix_fd {
- int fd; /* fd returned by the kernel */
- int32_t flags; /* flags for open/creat */
- DIR * dir; /* handle returned by the kernel */
- off_t dir_eof; /* offset at dir EOF */
- int odirect;
- struct list_head list; /* to add to the janitor list */
+ int fd; /* fd returned by the kernel */
+ int32_t flags; /* flags for open/creat */
+ DIR *dir; /* handle returned by the kernel */
+ off_t dir_eof; /* offset at dir EOF */
+ int odirect;
+ struct list_head list; /* to add to the janitor list */
};
-
struct posix_private {
- char *base_path;
- int32_t base_path_length;
- int32_t path_max;
-
- gf_lock_t lock;
-
- char *hostname;
- /* Statistics, provides activity of the server */
-
- struct timeval prev_fetch_time;
- struct timeval init_time;
-
- time_t last_landfill_check;
- int32_t janitor_sleep_duration;
- struct list_head janitor_fds;
- pthread_cond_t janitor_cond;
- pthread_mutex_t janitor_lock;
-
- int64_t read_value; /* Total read, from init */
- int64_t write_value; /* Total write, from init */
- int64_t nr_files;
-/*
- In some cases, two exported volumes may reside on the same
- partition on the server. Sending statvfs info for both
- the volumes will lead to erroneous df output at the client,
- since free space on the partition will be counted twice.
-
- In such cases, user can disable exporting statvfs info
- on one of the volumes by setting this option.
-*/
- gf_boolean_t export_statfs;
-
- gf_boolean_t o_direct; /* always open files in O_DIRECT mode */
-
-
-/*
- decide whether posix_unlink does open (file), unlink (file), close (fd)
- instead of just unlink (file). with the former approach there is no lockout
- of access to parent directory during removal of very large files for the
- entire duration of freeing of data blocks.
-*/
- gf_boolean_t background_unlink;
-
-/* janitor thread which cleans up /.trash (created by replicate) */
- pthread_t janitor;
- gf_boolean_t janitor_present;
- char * trash_path;
-/* lock for brick dir */
- DIR *mount_lock;
-
- struct stat handledir;
-
-/* uuid of glusterd that swapned the brick process */
- uuid_t glusterd_uuid;
-
- gf_boolean_t aio_configured;
- gf_boolean_t aio_init_done;
- gf_boolean_t aio_capable;
+ char *base_path;
+ int32_t base_path_length;
+ int32_t path_max;
+
+ gf_lock_t lock;
+
+ char *hostname;
+ /* Statistics, provides activity of the server */
+
+ struct timeval prev_fetch_time;
+ struct timeval init_time;
+
+ time_t last_landfill_check;
+ int32_t janitor_sleep_duration;
+ struct list_head janitor_fds;
+ pthread_cond_t janitor_cond;
+ pthread_mutex_t janitor_lock;
+
+ int64_t read_value; /* Total read, from init */
+ int64_t write_value; /* Total write, from init */
+ int64_t nr_files;
+ /*
+ In some cases, two exported volumes may reside on the same
+ partition on the server. Sending statvfs info for both
+ the volumes will lead to erroneous df output at the client,
+ since free space on the partition will be counted twice.
+
+ In such cases, user can disable exporting statvfs info
+ on one of the volumes by setting this option.
+ */
+ gf_boolean_t export_statfs;
+
+ gf_boolean_t o_direct; /* always open files in O_DIRECT mode */
+
+ /*
+ decide whether posix_unlink does open (file), unlink (file), close (fd)
+ instead of just unlink (file). with the former approach there is no
+ lockout of access to parent directory during removal of very large files
+ for the entire duration of freeing of data blocks.
+ */
+ gf_boolean_t background_unlink;
+
+ /* janitor thread which cleans up /.trash (created by replicate) */
+ pthread_t janitor;
+ gf_boolean_t janitor_present;
+ char *trash_path;
+ /* lock for brick dir */
+ DIR *mount_lock;
+
+ struct stat handledir;
+
+ /* uuid of glusterd that swapned the brick process */
+ uuid_t glusterd_uuid;
+
+ gf_boolean_t aio_configured;
+ gf_boolean_t aio_init_done;
+ gf_boolean_t aio_capable;
#ifdef HAVE_LIBAIO
- io_context_t ctxp;
- pthread_t aiothread;
+ io_context_t ctxp;
+ pthread_t aiothread;
#endif
- /* node-uuid in pathinfo xattr */
- gf_boolean_t node_uuid_pathinfo;
-
- pthread_t fsyncer;
- struct list_head fsyncs;
- pthread_mutex_t fsync_mutex;
- pthread_cond_t fsync_cond;
- int fsync_queue_count;
-
- enum {
- BATCH_NONE = 0,
- BATCH_SYNCFS,
- BATCH_SYNCFS_SINGLE_FSYNC,
- BATCH_REVERSE_FSYNC,
- BATCH_SYNCFS_REVERSE_FSYNC
- } batch_fsync_mode;
-
- uint32_t batch_fsync_delay_usec;
- gf_boolean_t update_pgfid_nlinks;
- gf_boolean_t gfid2path;
- char gfid2path_sep[8];
-
- /* seconds to sleep between health checks */
- uint32_t health_check_interval;
- /* seconds to sleep to wait for aio write finish for health checks */
- uint32_t health_check_timeout;
- pthread_t health_check;
- gf_boolean_t health_check_active;
-
- uint32_t disk_reserve;
- uint32_t disk_space_full;
- pthread_t disk_space_check;
- gf_boolean_t disk_space_check_active;
+ /* node-uuid in pathinfo xattr */
+ gf_boolean_t node_uuid_pathinfo;
+
+ pthread_t fsyncer;
+ struct list_head fsyncs;
+ pthread_mutex_t fsync_mutex;
+ pthread_cond_t fsync_cond;
+ int fsync_queue_count;
+
+ enum {
+ BATCH_NONE = 0,
+ BATCH_SYNCFS,
+ BATCH_SYNCFS_SINGLE_FSYNC,
+ BATCH_REVERSE_FSYNC,
+ BATCH_SYNCFS_REVERSE_FSYNC
+ } batch_fsync_mode;
+
+ uint32_t batch_fsync_delay_usec;
+ gf_boolean_t update_pgfid_nlinks;
+ gf_boolean_t gfid2path;
+ char gfid2path_sep[8];
+
+ /* seconds to sleep between health checks */
+ uint32_t health_check_interval;
+ /* seconds to sleep to wait for aio write finish for health checks */
+ uint32_t health_check_timeout;
+ pthread_t health_check;
+ gf_boolean_t health_check_active;
+
+ uint32_t disk_reserve;
+ uint32_t disk_space_full;
+ pthread_t disk_space_check;
+ gf_boolean_t disk_space_check_active;
#ifdef GF_DARWIN_HOST_OS
- enum {
- XATTR_NONE = 0,
- XATTR_STRIP,
- XATTR_APPEND,
- XATTR_BOTH,
- } xattr_user_namespace;
+ enum {
+ XATTR_NONE = 0,
+ XATTR_STRIP,
+ XATTR_APPEND,
+ XATTR_BOTH,
+ } xattr_user_namespace;
#endif
- /* Option to handle the cases of multiple bricks exported from
- same backend. Very much usable in brick-splitting feature. */
- int32_t shared_brick_count;
+ /* Option to handle the cases of multiple bricks exported from
+ same backend. Very much usable in brick-splitting feature. */
+ int32_t shared_brick_count;
- /* This option is used for either to call a landfill_purge or not */
- gf_boolean_t disable_landfill_purge;
+ /* This option is used for either to call a landfill_purge or not */
+ gf_boolean_t disable_landfill_purge;
- /*Option to set mode bit permission that will always be set on
- file/directory. */
- mode_t force_create_mode;
- mode_t force_directory_mode;
- mode_t create_mask;
- mode_t create_directory_mask;
- uint32_t max_hardlinks;
+ /*Option to set mode bit permission that will always be set on
+ file/directory. */
+ mode_t force_create_mode;
+ mode_t force_directory_mode;
+ mode_t create_mask;
+ mode_t create_directory_mask;
+ uint32_t max_hardlinks;
- gf_boolean_t fips_mode_rchecksum;
- gf_boolean_t ctime;
+ gf_boolean_t fips_mode_rchecksum;
+ gf_boolean_t ctime;
};
typedef struct {
- call_frame_t *frame;
- xlator_t *this;
- const char *real_path;
- dict_t *xattr;
- struct iatt *stbuf;
- loc_t *loc;
- inode_t *inode; /* for all do_xattrop() key handling */
- fd_t *fd;
- int fdnum;
- int flags;
- int32_t op_errno;
- char *list;
- size_t list_size;
+ call_frame_t *frame;
+ xlator_t *this;
+ const char *real_path;
+ dict_t *xattr;
+ struct iatt *stbuf;
+ loc_t *loc;
+ inode_t *inode; /* for all do_xattrop() key handling */
+ fd_t *fd;
+ int fdnum;
+ int flags;
+ int32_t op_errno;
+ char *list;
+ size_t list_size;
} posix_xattr_filler_t;
typedef struct {
- uint64_t unlink_flag;
- pthread_mutex_t xattrop_lock;
- pthread_mutex_t write_atomic_lock;
- pthread_mutex_t pgfid_lock;
+ uint64_t unlink_flag;
+ pthread_mutex_t xattrop_lock;
+ pthread_mutex_t write_atomic_lock;
+ pthread_mutex_t pgfid_lock;
} posix_inode_ctx_t;
-#define POSIX_BASE_PATH(this) (((struct posix_private *)this->private)->base_path)
+#define POSIX_BASE_PATH(this) \
+ (((struct posix_private *)this->private)->base_path)
-#define POSIX_BASE_PATH_LEN(this) (((struct posix_private *)this->private)->base_path_length)
+#define POSIX_BASE_PATH_LEN(this) \
+ (((struct posix_private *)this->private)->base_path_length)
#define POSIX_PATH_MAX(this) (((struct posix_private *)this->private)->path_max)
-#define POSIX_GET_FILE_UNLINK_PATH(base_path, gfid, unlink_path) \
- do { \
- int path_len = 0; \
- char gfid_str[64] = {0}; \
- uuid_utoa_r (gfid, gfid_str); \
- path_len = strlen (base_path) + 1 + \
- SLEN (GF_UNLINK_PATH) + 1 + \
- strlen (gfid_str) + 1; \
- unlink_path = alloca (path_len); \
- if (!unlink_path) { \
- gf_msg ("posix", GF_LOG_ERROR, ENOMEM, \
- P_MSG_UNLINK_FAILED, \
- "Failed to get unlink_path"); \
- break; \
- } \
- sprintf (unlink_path, "%s/%s/%s", \
- base_path, GF_UNLINK_PATH, gfid_str); \
- } while (0)
-
+#define POSIX_GET_FILE_UNLINK_PATH(base_path, gfid, unlink_path) \
+ do { \
+ int path_len = 0; \
+ char gfid_str[64] = {0}; \
+ uuid_utoa_r(gfid, gfid_str); \
+ path_len = strlen(base_path) + 1 + SLEN(GF_UNLINK_PATH) + 1 + \
+ strlen(gfid_str) + 1; \
+ unlink_path = alloca(path_len); \
+ if (!unlink_path) { \
+ gf_msg("posix", GF_LOG_ERROR, ENOMEM, P_MSG_UNLINK_FAILED, \
+ "Failed to get unlink_path"); \
+ break; \
+ } \
+ sprintf(unlink_path, "%s/%s/%s", base_path, GF_UNLINK_PATH, gfid_str); \
+ } while (0)
/* Helper functions */
-int posix_inode_ctx_set_unlink_flag (inode_t *inode, xlator_t *this,
- uint64_t ctx);
-
-int posix_inode_ctx_get_all (inode_t *inode, xlator_t *this,
- posix_inode_ctx_t **ctx);
-
-int __posix_inode_ctx_set_unlink_flag (inode_t *inode, xlator_t *this,
- uint64_t ctx);
-
-int __posix_inode_ctx_get_all (inode_t *inode, xlator_t *this,
- posix_inode_ctx_t **ctx);
-
-int posix_gfid_set (xlator_t *this, const char *path, loc_t *loc,
- dict_t *xattr_req, pid_t pid, int *op_errno);
-int posix_fdstat (xlator_t *this, inode_t *inode, int fd, struct iatt *stbuf_p);
-int posix_istat (xlator_t *this, inode_t *inode, uuid_t gfid,
- const char *basename, struct iatt *iatt);
-int posix_pstat (xlator_t *this, inode_t *inode, uuid_t gfid,
- const char *real_path, struct iatt *iatt,
- gf_boolean_t inode_locked);
-dict_t *posix_xattr_fill (xlator_t *this, const char *path, loc_t *loc,
- fd_t *fd, int fdnum, dict_t *xattr, struct iatt *buf);
-int posix_handle_pair (xlator_t *this, const char *real_path, char *key,
- data_t *value, int flags, struct iatt *stbuf);
-int posix_fhandle_pair (call_frame_t *frame, xlator_t *this, int fd, char *key,
- data_t *value, int flags, struct iatt *stbuf,
- fd_t *_fd);
-void posix_spawn_janitor_thread (xlator_t *this);
-int posix_acl_xattr_set (xlator_t *this, const char *path, dict_t *xattr_req);
-int posix_gfid_heal (xlator_t *this, const char *path, loc_t *loc, dict_t *xattr_req);
-int posix_entry_create_xattr_set (xlator_t *this, const char *path,
- dict_t *dict);
-
-int posix_fd_ctx_get (fd_t *fd, xlator_t *this, struct posix_fd **pfd,
- int *op_errno);
-void posix_fill_ino_from_gfid (xlator_t *this, struct iatt *buf);
-
-gf_boolean_t posix_special_xattr (char **pattern, char *key);
+int
+posix_inode_ctx_set_unlink_flag(inode_t *inode, xlator_t *this, uint64_t ctx);
+
+int
+posix_inode_ctx_get_all(inode_t *inode, xlator_t *this,
+ posix_inode_ctx_t **ctx);
+
+int
+__posix_inode_ctx_set_unlink_flag(inode_t *inode, xlator_t *this, uint64_t ctx);
+int
+__posix_inode_ctx_get_all(inode_t *inode, xlator_t *this,
+ posix_inode_ctx_t **ctx);
+
+int
+posix_gfid_set(xlator_t *this, const char *path, loc_t *loc, dict_t *xattr_req,
+ pid_t pid, int *op_errno);
+int
+posix_fdstat(xlator_t *this, inode_t *inode, int fd, struct iatt *stbuf_p);
+int
+posix_istat(xlator_t *this, inode_t *inode, uuid_t gfid, const char *basename,
+ struct iatt *iatt);
+int
+posix_pstat(xlator_t *this, inode_t *inode, uuid_t gfid, const char *real_path,
+ struct iatt *iatt, gf_boolean_t inode_locked);
+dict_t *
+posix_xattr_fill(xlator_t *this, const char *path, loc_t *loc, fd_t *fd,
+ int fdnum, dict_t *xattr, struct iatt *buf);
+int
+posix_handle_pair(xlator_t *this, const char *real_path, char *key,
+ data_t *value, int flags, struct iatt *stbuf);
+int
+posix_fhandle_pair(call_frame_t *frame, xlator_t *this, int fd, char *key,
+ data_t *value, int flags, struct iatt *stbuf, fd_t *_fd);
void
-__posix_fd_set_odirect (fd_t *fd, struct posix_fd *pfd, int opflags,
- off_t offset, size_t size);
-void posix_spawn_health_check_thread (xlator_t *this);
+posix_spawn_janitor_thread(xlator_t *this);
+int
+posix_acl_xattr_set(xlator_t *this, const char *path, dict_t *xattr_req);
+int
+posix_gfid_heal(xlator_t *this, const char *path, loc_t *loc,
+ dict_t *xattr_req);
+int
+posix_entry_create_xattr_set(xlator_t *this, const char *path, dict_t *dict);
-void posix_spawn_disk_space_check_thread (xlator_t *this);
+int
+posix_fd_ctx_get(fd_t *fd, xlator_t *this, struct posix_fd **pfd,
+ int *op_errno);
+void
+posix_fill_ino_from_gfid(xlator_t *this, struct iatt *buf);
-void *posix_fsyncer (void *);
+gf_boolean_t
+posix_special_xattr(char **pattern, char *key);
+
+void
+__posix_fd_set_odirect(fd_t *fd, struct posix_fd *pfd, int opflags,
+ off_t offset, size_t size);
+void
+posix_spawn_health_check_thread(xlator_t *this);
+
+void
+posix_spawn_disk_space_check_thread(xlator_t *this);
+
+void *
+posix_fsyncer(void *);
int
-posix_get_ancestry (xlator_t *this, inode_t *leaf_inode,
- gf_dirent_t *head, char **path, int type, int32_t *op_errno,
- dict_t *xdata);
+posix_get_ancestry(xlator_t *this, inode_t *leaf_inode, gf_dirent_t *head,
+ char **path, int type, int32_t *op_errno, dict_t *xdata);
int
-posix_handle_mdata_xattr (call_frame_t *frame, const char *name, int *op_errno);
+posix_handle_mdata_xattr(call_frame_t *frame, const char *name, int *op_errno);
int
-posix_handle_georep_xattrs (call_frame_t *, const char *, int *, gf_boolean_t);
+posix_handle_georep_xattrs(call_frame_t *, const char *, int *, gf_boolean_t);
int32_t
-posix_resolve_dirgfid_to_path (const uuid_t dirgfid, const char *brick_path,
- const char *bname, char **path);
+posix_resolve_dirgfid_to_path(const uuid_t dirgfid, const char *brick_path,
+ const char *bname, char **path);
void
-posix_gfid_unset (xlator_t *this, dict_t *xdata);
+posix_gfid_unset(xlator_t *this, dict_t *xdata);
int
-posix_pacl_set (const char *path, const char *key, const char *acl_s);
+posix_pacl_set(const char *path, const char *key, const char *acl_s);
int
-posix_pacl_get (const char *path, const char *key, char **acl_s);
+posix_pacl_get(const char *path, const char *key, char **acl_s);
int32_t
-posix_get_objectsignature (char *, dict_t *);
+posix_get_objectsignature(char *, dict_t *);
int32_t
-posix_fdget_objectsignature (int, dict_t *);
+posix_fdget_objectsignature(int, dict_t *);
gf_boolean_t
-posix_is_bulk_removexattr (char *name, dict_t *dict);
+posix_is_bulk_removexattr(char *name, dict_t *dict);
int32_t
-posix_set_iatt_in_dict (dict_t *, struct iatt *, struct iatt *);
+posix_set_iatt_in_dict(dict_t *, struct iatt *, struct iatt *);
-mode_t
-posix_override_umask (mode_t , mode_t);
+mode_t posix_override_umask(mode_t, mode_t);
int32_t
-posix_priv (xlator_t *this);
+posix_priv(xlator_t *this);
int32_t
-posix_inode (xlator_t *this);
+posix_inode(xlator_t *this);
void
-posix_fini (xlator_t *this);
+posix_fini(xlator_t *this);
int
-posix_init (xlator_t *this);
+posix_init(xlator_t *this);
int
-posix_reconfigure (xlator_t *this, dict_t *options);
+posix_reconfigure(xlator_t *this, dict_t *options);
int32_t
-posix_notify (xlator_t *this, int32_t event, void *data, ...);
+posix_notify(xlator_t *this, int32_t event, void *data, ...);
/* posix-entry-ops.c FOP signatures */
int32_t
-posix_lookup (call_frame_t *frame, xlator_t *this,
- loc_t *loc, dict_t *xdata);
+posix_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata);
int
-posix_create (call_frame_t *frame, xlator_t *this,
- loc_t *loc, int32_t flags, mode_t mode,
- mode_t umask, fd_t *fd, dict_t *xdata);
+posix_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags,
+ mode_t mode, mode_t umask, fd_t *fd, dict_t *xdata);
int
-posix_symlink (call_frame_t *frame, xlator_t *this,
- const char *linkname, loc_t *loc, mode_t umask, dict_t *xdata);
+posix_symlink(call_frame_t *frame, xlator_t *this, const char *linkname,
+ loc_t *loc, mode_t umask, dict_t *xdata);
int
-posix_rename (call_frame_t *frame, xlator_t *this,
- loc_t *oldloc, loc_t *newloc, dict_t *xdata);
+posix_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc,
+ dict_t *xdata);
int
-posix_link (call_frame_t *frame, xlator_t *this,
- loc_t *oldloc, loc_t *newloc, dict_t *xdata);
+posix_link(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc,
+ dict_t *xdata);
int
-posix_mknod (call_frame_t *frame, xlator_t *this,
- loc_t *loc, mode_t mode, dev_t dev, mode_t umask, dict_t *xdata);
+posix_mknod(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode,
+ dev_t dev, mode_t umask, dict_t *xdata);
int
-posix_mkdir (call_frame_t *frame, xlator_t *this,
- loc_t *loc, mode_t mode, mode_t umask, dict_t *xdata);
+posix_mkdir(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode,
+ mode_t umask, dict_t *xdata);
int32_t
-posix_unlink (call_frame_t *frame, xlator_t *this,
- loc_t *loc, int xflag, dict_t *xdata);
+posix_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag,
+ dict_t *xdata);
int
-posix_rmdir (call_frame_t *frame, xlator_t *this,
- loc_t *loc, int flags, dict_t *xdata);
+posix_rmdir(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags,
+ dict_t *xdata);
/* posix-inode-fs-ops.c FOP signatures */
int
-posix_forget (xlator_t *this, inode_t *inode);
+posix_forget(xlator_t *this, inode_t *inode);
int32_t
-posix_discover (call_frame_t *frame, xlator_t *this,
- loc_t *loc, dict_t *xdata);
+posix_discover(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata);
int32_t
-posix_stat (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata);
+posix_stat(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata);
int
-posix_setattr (call_frame_t *frame, xlator_t *this,
- loc_t *loc, struct iatt *stbuf, int32_t valid, dict_t *xdata);
+posix_setattr(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ struct iatt *stbuf, int32_t valid, dict_t *xdata);
int
-posix_fsetattr (call_frame_t *frame, xlator_t *this,
- fd_t *fd, struct iatt *stbuf, int32_t valid, dict_t *xdata);
+posix_fsetattr(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ struct iatt *stbuf, int32_t valid, dict_t *xdata);
int32_t
posix_discard(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
@@ -482,181 +488,173 @@ posix_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
int32_t
posix_glfallocate(call_frame_t *frame, xlator_t *this, fd_t *fd,
- int32_t keep_size, off_t offset, size_t len, dict_t *xdata);
+ int32_t keep_size, off_t offset, size_t len, dict_t *xdata);
int32_t
-posix_ipc (call_frame_t *frame, xlator_t *this, int32_t op, dict_t *xdata);
+posix_ipc(call_frame_t *frame, xlator_t *this, int32_t op, dict_t *xdata);
int32_t
-posix_seek (call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
- gf_seek_what_t what, dict_t *xdata);
+posix_seek(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
+ gf_seek_what_t what, dict_t *xdata);
int32_t
-posix_opendir (call_frame_t *frame, xlator_t *this,
- loc_t *loc, fd_t *fd, dict_t *xdata);
+posix_opendir(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd,
+ dict_t *xdata);
int32_t
-posix_releasedir (xlator_t *this,
- fd_t *fd);
+posix_releasedir(xlator_t *this, fd_t *fd);
int32_t
-posix_readlink (call_frame_t *frame, xlator_t *this,
- loc_t *loc, size_t size, dict_t *xdata);
+posix_readlink(call_frame_t *frame, xlator_t *this, loc_t *loc, size_t size,
+ dict_t *xdata);
int32_t
-posix_truncate (call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset,
- dict_t *xdata);
+posix_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset,
+ dict_t *xdata);
int32_t
-posix_open (call_frame_t *frame, xlator_t *this,
- loc_t *loc, int32_t flags, fd_t *fd, dict_t *xdata);
+posix_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags,
+ fd_t *fd, dict_t *xdata);
int
-posix_readv (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
- off_t offset, uint32_t flags, dict_t *xdata);
+posix_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
+ off_t offset, uint32_t flags, dict_t *xdata);
int32_t
-posix_writev (call_frame_t *frame, xlator_t *this, fd_t *fd,
- struct iovec *vector, int32_t count, off_t offset,
- uint32_t flags, struct iobref *iobref, dict_t *xdata);
+posix_writev(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ struct iovec *vector, int32_t count, off_t offset, uint32_t flags,
+ struct iobref *iobref, dict_t *xdata);
int32_t
-posix_statfs (call_frame_t *frame, xlator_t *this,
- loc_t *loc, dict_t *xdata);
+posix_statfs(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata);
int32_t
-posix_flush (call_frame_t *frame, xlator_t *this,
- fd_t *fd, dict_t *xdata);
+posix_flush(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata);
int32_t
-posix_release (xlator_t *this, fd_t *fd);
+posix_release(xlator_t *this, fd_t *fd);
int32_t
-posix_fsync (call_frame_t *frame, xlator_t *this,
- fd_t *fd, int32_t datasync, dict_t *xdata);
+posix_fsync(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t datasync,
+ dict_t *xdata);
int32_t
-posix_setxattr (call_frame_t *frame, xlator_t *this,
- loc_t *loc, dict_t *dict, int flags, dict_t *xdata);
+posix_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict,
+ int flags, dict_t *xdata);
int
-posix_get_ancestry_non_directory (xlator_t *this, inode_t *leaf_inode,
- gf_dirent_t *head, char **path, int type,
- int32_t *op_errno, dict_t *xdata);
+posix_get_ancestry_non_directory(xlator_t *this, inode_t *leaf_inode,
+ gf_dirent_t *head, char **path, int type,
+ int32_t *op_errno, dict_t *xdata);
int
-posix_get_ancestry (xlator_t *this, inode_t *leaf_inode,
- gf_dirent_t *head, char **path, int type, int32_t *op_errno,
- dict_t *xdata);
+posix_get_ancestry(xlator_t *this, inode_t *leaf_inode, gf_dirent_t *head,
+ char **path, int type, int32_t *op_errno, dict_t *xdata);
int32_t
-posix_getxattr (call_frame_t *frame, xlator_t *this,
- loc_t *loc, const char *name, dict_t *xdata);
+posix_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ const char *name, dict_t *xdata);
int32_t
-posix_fgetxattr (call_frame_t *frame, xlator_t *this,
- fd_t *fd, const char *name, dict_t *xdata);
+posix_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name,
+ dict_t *xdata);
int32_t
-posix_fsetxattr (call_frame_t *frame, xlator_t *this,
- fd_t *fd, dict_t *dict, int flags, dict_t *xdata);
+posix_fsetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict,
+ int flags, dict_t *xdata);
int32_t
-posix_removexattr (call_frame_t *frame, xlator_t *this,
- loc_t *loc, const char *name, dict_t *xdata);
+posix_removexattr(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ const char *name, dict_t *xdata);
int32_t
-posix_fremovexattr (call_frame_t *frame, xlator_t *this,
- fd_t *fd, const char *name, dict_t *xdata);
+posix_fremovexattr(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ const char *name, dict_t *xdata);
int32_t
-posix_fsyncdir (call_frame_t *frame, xlator_t *this,
- fd_t *fd, int datasync, dict_t *xdata);
+posix_fsyncdir(call_frame_t *frame, xlator_t *this, fd_t *fd, int datasync,
+ dict_t *xdata);
int
-posix_xattrop (call_frame_t *frame, xlator_t *this, loc_t *loc,
- gf_xattrop_flags_t optype, dict_t *xattr, dict_t *xdata);
+posix_xattrop(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ gf_xattrop_flags_t optype, dict_t *xattr, dict_t *xdata);
int
-posix_fxattrop (call_frame_t *frame, xlator_t *this, fd_t *fd,
- gf_xattrop_flags_t optype, dict_t *xattr, dict_t *xdata);
+posix_fxattrop(call_frame_t *frame, xlator_t *this, fd_t *fd,
+ gf_xattrop_flags_t optype, dict_t *xattr, dict_t *xdata);
int
-posix_access (call_frame_t *frame, xlator_t *this,
- loc_t *loc, int32_t mask, dict_t *xdata);
+posix_access(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t mask,
+ dict_t *xdata);
int32_t
-posix_ftruncate (call_frame_t *frame, xlator_t *this,
- fd_t *fd, off_t offset, dict_t *xdata);
+posix_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
+ dict_t *xdata);
int32_t
-posix_fstat (call_frame_t *frame, xlator_t *this,
- fd_t *fd, dict_t *xdata);
+posix_fstat(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata);
int32_t
-posix_lease (call_frame_t *frame, xlator_t *this,
- loc_t *loc, struct gf_lease *lease, dict_t *xdata);
+posix_lease(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ struct gf_lease *lease, dict_t *xdata);
int32_t
-posix_lk (call_frame_t *frame, xlator_t *this,
- fd_t *fd, int32_t cmd, struct gf_flock *lock, dict_t *xdata);
+posix_lk(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd,
+ struct gf_flock *lock, dict_t *xdata);
int32_t
-posix_inodelk (call_frame_t *frame, xlator_t *this,
- const char *volume, loc_t *loc, int32_t cmd,
- struct gf_flock *lock, dict_t *xdata);
+posix_inodelk(call_frame_t *frame, xlator_t *this, const char *volume,
+ loc_t *loc, int32_t cmd, struct gf_flock *lock, dict_t *xdata);
int32_t
-posix_finodelk (call_frame_t *frame, xlator_t *this,
- const char *volume, fd_t *fd, int32_t cmd,
- struct gf_flock *lock, dict_t *xdata);
+posix_finodelk(call_frame_t *frame, xlator_t *this, const char *volume,
+ fd_t *fd, int32_t cmd, struct gf_flock *lock, dict_t *xdata);
int32_t
-posix_entrylk (call_frame_t *frame, xlator_t *this,
- const char *volume, loc_t *loc, const char *basename,
- entrylk_cmd cmd, entrylk_type type, dict_t *xdata);
+posix_entrylk(call_frame_t *frame, xlator_t *this, const char *volume,
+ loc_t *loc, const char *basename, entrylk_cmd cmd,
+ entrylk_type type, dict_t *xdata);
int32_t
-posix_fentrylk (call_frame_t *frame, xlator_t *this,
- const char *volume, fd_t *fd, const char *basename,
- entrylk_cmd cmd, entrylk_type type, dict_t *xdata);
+posix_fentrylk(call_frame_t *frame, xlator_t *this, const char *volume,
+ fd_t *fd, const char *basename, entrylk_cmd cmd,
+ entrylk_type type, dict_t *xdata);
int32_t
-posix_readdir (call_frame_t *frame, xlator_t *this,
- fd_t *fd, size_t size, off_t off, dict_t *xdata);
+posix_readdir(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
+ off_t off, dict_t *xdata);
int32_t
-posix_readdirp (call_frame_t *frame, xlator_t *this,
- fd_t *fd, size_t size, off_t off, dict_t *dict);
+posix_readdirp(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
+ off_t off, dict_t *dict);
int32_t
-posix_rchecksum (call_frame_t *frame, xlator_t *this,
- fd_t *fd, off_t offset, int32_t len, dict_t *xdata);
+posix_rchecksum(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
+ int32_t len, dict_t *xdata);
int32_t
-posix_put (call_frame_t *frame, xlator_t *this, loc_t *loc,
- mode_t mode, mode_t umask, uint32_t flags,
- struct iovec *vector, int32_t count, off_t offset,
- struct iobref *iobref, dict_t *xattr, dict_t *xdata);
+posix_put(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode,
+ mode_t umask, uint32_t flags, struct iovec *vector, int32_t count,
+ off_t offset, struct iobref *iobref, dict_t *xattr, dict_t *xdata);
int32_t
-posix_set_mode_in_dict (dict_t *in_dict, dict_t *out_dict,
- struct iatt *in_stbuf);
+posix_set_mode_in_dict(dict_t *in_dict, dict_t *out_dict,
+ struct iatt *in_stbuf);
gf_cs_obj_state
-posix_cs_check_status (xlator_t *this, const char *realpath, int *fd,
- struct iatt *buf);
+posix_cs_check_status(xlator_t *this, const char *realpath, int *fd,
+ struct iatt *buf);
int
-posix_cs_set_state (xlator_t *this, dict_t **rsp, gf_cs_obj_state state,
- char const *path, int *fd);
+posix_cs_set_state(xlator_t *this, dict_t **rsp, gf_cs_obj_state state,
+ char const *path, int *fd);
gf_cs_obj_state
-posix_cs_heal_state (xlator_t *this, const char *path, int *fd,
- struct iatt *stbuf);
+posix_cs_heal_state(xlator_t *this, const char *path, int *fd,
+ struct iatt *stbuf);
int
-posix_cs_maintenance (xlator_t *this, fd_t *fd, loc_t *loc, int *pfd,
- struct iatt *buf, const char *realpath, dict_t *xattr_req,
- dict_t **xattr_rsp, gf_boolean_t ignore_failure);
+posix_cs_maintenance(xlator_t *this, fd_t *fd, loc_t *loc, int *pfd,
+ struct iatt *buf, const char *realpath, dict_t *xattr_req,
+ dict_t **xattr_rsp, gf_boolean_t ignore_failure);
#endif /* _POSIX_H */
diff --git a/xlators/system/posix-acl/src/posix-acl-mem-types.h b/xlators/system/posix-acl/src/posix-acl-mem-types.h
index 7eed2ebb539..19b6e9a2df7 100644
--- a/xlators/system/posix-acl/src/posix-acl-mem-types.h
+++ b/xlators/system/posix-acl/src/posix-acl-mem-types.h
@@ -14,11 +14,10 @@
#include "mem-types.h"
typedef enum gf_posix_acl_mem_types_ {
- gf_posix_acl_mt_ctx_t = gf_common_mt_end + 1,
- gf_posix_acl_mt_posix_ace_t,
- gf_posix_acl_mt_char,
- gf_posix_acl_mt_conf_t,
- gf_posix_acl_mt_end
+ gf_posix_acl_mt_ctx_t = gf_common_mt_end + 1,
+ gf_posix_acl_mt_posix_ace_t,
+ gf_posix_acl_mt_char,
+ gf_posix_acl_mt_conf_t,
+ gf_posix_acl_mt_end
} gf_posix_acl_mem_types_t;
#endif
-
diff --git a/xlators/system/posix-acl/src/posix-acl-messages.h b/xlators/system/posix-acl/src/posix-acl-messages.h
index 782750e99a5..f4f47ffbc1c 100644
--- a/xlators/system/posix-acl/src/posix-acl-messages.h
+++ b/xlators/system/posix-acl/src/posix-acl-messages.h
@@ -23,8 +23,6 @@
* glfs-message-id.h.
*/
-GLFS_MSGID(POSIX_ACL,
- POSIX_ACL_MSG_EACCES
-);
+GLFS_MSGID(POSIX_ACL, POSIX_ACL_MSG_EACCES);
#endif /* !_POSIX_ACL_MESSAGES_H_ */
diff --git a/xlators/system/posix-acl/src/posix-acl-xattr.h b/xlators/system/posix-acl/src/posix-acl-xattr.h
index 2933c205725..bb63a10f8fb 100644
--- a/xlators/system/posix-acl/src/posix-acl-xattr.h
+++ b/xlators/system/posix-acl/src/posix-acl-xattr.h
@@ -16,11 +16,14 @@
#include "glusterfs.h"
#include "glusterfs-acl.h"
-struct posix_acl *posix_acl_from_xattr (xlator_t *this, const char *buf, int size);
+struct posix_acl *
+posix_acl_from_xattr(xlator_t *this, const char *buf, int size);
-int posix_acl_to_xattr (xlator_t *this, struct posix_acl *acl, char *buf, int size);
-
-int posix_acl_matches_xattr (xlator_t *this, struct posix_acl *acl, const char *buf, int size);
+int
+posix_acl_to_xattr(xlator_t *this, struct posix_acl *acl, char *buf, int size);
+int
+posix_acl_matches_xattr(xlator_t *this, struct posix_acl *acl, const char *buf,
+ int size);
#endif /* !_POSIX_ACL_XATTR_H */
diff --git a/xlators/system/posix-acl/src/posix-acl.h b/xlators/system/posix-acl/src/posix-acl.h
index c5e01967a11..e25fbb54941 100644
--- a/xlators/system/posix-acl/src/posix-acl.h
+++ b/xlators/system/posix-acl/src/posix-acl.h
@@ -16,15 +16,21 @@
#include "byte-order.h"
#include "glusterfs-acl.h"
-struct posix_acl *posix_acl_new (xlator_t *this, int entry_count);
-struct posix_acl *posix_acl_ref (xlator_t *this, struct posix_acl *acl);
-void posix_acl_unref (xlator_t *this, struct posix_acl *acl);
-void posix_acl_destroy (xlator_t *this, struct posix_acl *acl);
-struct posix_acl_ctx *posix_acl_ctx_get (inode_t *inode, xlator_t *this);
-int posix_acl_get (inode_t *inode, xlator_t *this,
- struct posix_acl **acl_access_p,
- struct posix_acl **acl_default_p);
-int posix_acl_set (inode_t *inode, xlator_t *this, struct posix_acl *acl_access,
- struct posix_acl *acl_default);
+struct posix_acl *
+posix_acl_new(xlator_t *this, int entry_count);
+struct posix_acl *
+posix_acl_ref(xlator_t *this, struct posix_acl *acl);
+void
+posix_acl_unref(xlator_t *this, struct posix_acl *acl);
+void
+posix_acl_destroy(xlator_t *this, struct posix_acl *acl);
+struct posix_acl_ctx *
+posix_acl_ctx_get(inode_t *inode, xlator_t *this);
+int
+posix_acl_get(inode_t *inode, xlator_t *this, struct posix_acl **acl_access_p,
+ struct posix_acl **acl_default_p);
+int
+posix_acl_set(inode_t *inode, xlator_t *this, struct posix_acl *acl_access,
+ struct posix_acl *acl_default);
#endif /* !_POSIX_ACL_H */