blob: 5a2f6bdf8ef529a34c9f977b9963caa83bda4346 (
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
|
#!/bin/sh
# $NetBSD: xattr-init.sh,v 1.2 2011/04/26 16:06:32 manu Exp $
GLUSTERFS_XATTR="
trusted.distribute.linkinfo
trusted.distribute.fix.layout
trusted.glusterfs.pathinfo
trusted.glusterfs.test
trusted.glusterfs.volume-mark
trusted.glusterfs.test
trusted.posix1.gen
trusted.gfid
trusted.afr
"
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
|