Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etersoft-admin-essentials
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
etersoft-admin-essentials
Commits
e7725e98
Commit
e7725e98
authored
Feb 25, 2015
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
grf: add gfid mismatch support
parent
806bc822
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
6 deletions
+30
-6
grf
gluster/grf
+30
-6
No files found.
gluster/grf
View file @
e7725e98
...
...
@@ -120,10 +120,37 @@ fi
# check and fix path
if
[
-n
"
$sfile
"
]
;
then
if
[
-d
"
$sfile
"
]
;
then
sfile
=
"
$sfile
/*"
# select via param?
#if [ -d "$sfile" ] ; then
# sfile="$sfile/*"
#fi
mkdir
-p
$MOUNTDIR
mount_g
# FIXME: do not work with list
if
echo
"
$sfile
"
|
grep
"<"
;
then
echo
"Work with GFID
$sfile
path"
# Перебираем брики и находим первый попавшийся .glusterfs/AA/BB/AABBCCDDEE, преобразуем в путь и используем"
rfile
=
for
brick
in
$LISTBRICKS
;
do
set_host_path
"
$brick
"
#echo "$host - $path"
# hack: translate to a path on volume
file
=
"
$(
echo
"
$sfile
"
|
sed
-e
"s|
$FTPROOT
/||g"
)
"
rfile
=
$(
echo
$file
|
sed
-e
"s|[<>]||g"
)
rfile
=
.glusterfs/
$(
echo
$rfile
|
cut
-b1-2
)
/
$(
echo
$rfile
|
cut
-b3-4
)
/
$rfile
rpath
=
$path
rfile
=
$(
opbrick
"realpath"
"
$rfile
"
)
&&
break
done
if
[
-n
"
$rfile
"
]
;
then
sfile
=
$(
echo
$rfile
|
sed
-e
"s|.*
$rpath
|
$FTPROOT
|g"
)
else
echo
"Can't resolve this gfid"
umount_g
exit
fi
if
echo
"
$sfile
"
|
grep
"
\*
"
;
then
el
if
echo
"
$sfile
"
|
grep
"
\*
"
;
then
sdir
=
"
$(
dirname
"
$sfile
"
)
"
if
[
-d
"
$sdir
"
]
;
then
echo
"Work with dir
$sdir
"
...
...
@@ -139,9 +166,6 @@ else
fi
mkdir
-p
$MOUNTDIR
mount_g
test_file
()
{
local
sfile
=
"
$1
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment