2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-09-02 15:25:21 +00:00

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: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Pavel Emelyanov
2013-12-27 21:14:09 +04:00
parent eeec1b40a7
commit 52dec20a17
2 changed files with 8 additions and 0 deletions

View File

@@ -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) struct fd_opts *opts, struct fd_parms *p)
{ {
int ret; int ret;
struct statfs fsbuf;
if (fstat(lfd, &p->stat) < 0) { if (fstat(lfd, &p->stat) < 0) {
pr_perror("Can't stat fd %d", lfd); pr_perror("Can't stat fd %d", lfd);
return -1; 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->ctl = ctl;
p->fd = fd; p->fd = fd;
p->pos = lseek(lfd, 0, SEEK_CUR); p->pos = lseek(lfd, 0, SEEK_CUR);

View File

@@ -44,6 +44,7 @@ struct fd_parms {
pid_t pid; pid_t pid;
FownEntry fown; FownEntry fown;
struct fd_link *link; struct fd_link *link;
long fs_type;
struct parasite_ctl *ctl; struct parasite_ctl *ctl;
}; };