mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-02 07:15:31 +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:
7
files.c
7
files.c
@@ -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);
|
||||||
|
@@ -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;
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user