Commit 52dec20a authored by Pavel Emelyanov's avatar Pavel Emelyanov

files: Save fstype on fd_parms

We will need to special-care NFS silly-rename files, thus
we need to know which FS a file belongs to.
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent eeec1b40
......@@ -202,12 +202,19 @@ static int fill_fd_params(struct parasite_ctl *ctl, int fd, int lfd,
struct fd_opts *opts, struct fd_parms *p)
{
int ret;
struct statfs fsbuf;
if (fstat(lfd, &p->stat) < 0) {
pr_perror("Can't stat fd %d", lfd);
return -1;
}
if (fstatfs(lfd, &fsbuf) < 0) {
pr_perror("Can't statfs fd %d", lfd);
return -1;
}
p->fs_type = fsbuf.f_type;
p->ctl = ctl;
p->fd = fd;
p->pos = lseek(lfd, 0, SEEK_CUR);
......
......@@ -44,6 +44,7 @@ struct fd_parms {
pid_t pid;
FownEntry fown;
struct fd_link *link;
long fs_type;
struct parasite_ctl *ctl;
};
......
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