Commit ccdcb3d3 authored by Pavel Emelyanov's avatar Pavel Emelyanov

fsnotify: Simplify get_mark_path code

Handle the simplest (remap) case early. This makes code
simpler and reduces one level of indent.
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 32adef6f
...@@ -184,7 +184,12 @@ static char *get_mark_path(const char *who, struct file_remap *remap, ...@@ -184,7 +184,12 @@ static char *get_mark_path(const char *who, struct file_remap *remap,
int mntfd = -1; int mntfd = -1;
fh_t handle; fh_t handle;
if (!remap) { if (remap) {
pr_debug("\t\tRestore %s watch for 0x%08x:0x%016lx (via %s)\n",
who, s_dev, i_ino, path);
return remap->path;
}
memzero(&handle, sizeof(handle)); memzero(&handle, sizeof(handle));
handle.type = f_handle->type; handle.type = f_handle->type;
...@@ -218,14 +223,6 @@ static char *get_mark_path(const char *who, struct file_remap *remap, ...@@ -218,14 +223,6 @@ static char *get_mark_path(const char *who, struct file_remap *remap,
pr_debug("\t\tRestore %s watch for 0x%08x:0x%016lx (via %s -> %s)\n", pr_debug("\t\tRestore %s watch for 0x%08x:0x%016lx (via %s -> %s)\n",
who, s_dev, i_ino, path, link); who, s_dev, i_ino, path, link);
} }
} else {
*target = -1;
path = remap->path;
pr_debug("\t\tRestore %s watch for 0x%08x:0x%016lx (via %s)\n",
who, s_dev, i_ino, path);
}
err: err:
close_safe(&mntfd); close_safe(&mntfd);
return path; return path;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment