blob: 38b6b3baa9235dd32297bd44faa42e59a0d5d4b9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
#!/bin/sh
# $NetBSD: xattr-init.sh,v 1.4 2011/06/06 15:53:14 manu Exp $
GLUSTERFS_XATTR="
trusted.distribute.linkinfo
trusted.distribute.fix.layout
trusted.glusterfs.pathinfo
trusted.glusterfs.volume-mark
trusted.glusterfs.test
trusted.posix1.gen
trusted.gfid
trusted.afr
glusterfs.open-fd-count
glusterfs.inodelk-count
glusterfs.entrylk-count
glusterfs.posixlk-count
"
test $# -ne 1 && {
echo "usage: $0 /export/volume/path"
exit 1
}
VOLUME=$1
test -d ${VOLUME} || {
echo "$0: ${VOLUME} is not a directory"
exit 1
}
extattrctl start ${VOLUME} || {
echo "$0: cannot start extended attributes on ${VOLUME}"
exit 1
}
mkdir -p ${VOLUME}/.attribute/user || {
echo "$0: cannot create ${VOLUME}/.attribute/user"
exit 1
}
for attr in ${GLUSTERFS_XATTR} ; do
attrfile=${VOLUME}/.attribute/user/${attr}
test -e ${attrfile} && {
echo "$0: ${attrfile} exists."
exit 1
}
extattrctl initattr 1024 ${attrfile} || {
echo "$0: cannot initialize ${attrfile}"
exit 1
}
extattrctl enable ${VOLUME} user ${attr} ${attrfile} || {
echo "$0: cannot enable ${attr} backed by ${attrfile}"
exit 1
}
done
|