On Thu, Jan 4, 2018 at 6:20 PM, Amir Goldstein <amir73il@xxxxxxxxx> wrote: > Encode overlay file handles as struct ovl_fh containing the file handle > encoding of the real upper inode. > > Signed-off-by: Amir Goldstein <amir73il@xxxxxxxxx> > --- > fs/overlayfs/Makefile | 3 +- > fs/overlayfs/export.c | 98 ++++++++++++++++++++++++++++++++++++++++++++++++ > fs/overlayfs/overlayfs.h | 6 +++ > 3 files changed, 106 insertions(+), 1 deletion(-) > create mode 100644 fs/overlayfs/export.c > > diff --git a/fs/overlayfs/Makefile b/fs/overlayfs/Makefile > index 99373bbc1478..30802347a020 100644 > --- a/fs/overlayfs/Makefile > +++ b/fs/overlayfs/Makefile > @@ -4,4 +4,5 @@ > > obj-$(CONFIG_OVERLAY_FS) += overlay.o > > -overlay-objs := super.o namei.o util.o inode.o dir.o readdir.o copy_up.o > +overlay-objs := super.o namei.o util.o inode.o dir.o readdir.o copy_up.o \ > + export.o > diff --git a/fs/overlayfs/export.c b/fs/overlayfs/export.c > new file mode 100644 > index 000000000000..58c4f5e8a67e > --- /dev/null > +++ b/fs/overlayfs/export.c > @@ -0,0 +1,98 @@ > +/* > + * Overlayfs NFS export support. > + * > + * Amir Goldstein <amir73il@xxxxxxxxx> > + * > + * Copyright (C) 2017 CTERA Networks. All Rights Reserved. > + * > + * This program is free software; you can redistribute it and/or modify it > + * under the terms of the GNU General Public License version 2 as published by > + * the Free Software Foundation. > + */ > + > +#include <linux/fs.h> > +#include <linux/cred.h> > +#include <linux/mount.h> > +#include <linux/namei.h> > +#include <linux/xattr.h> > +#include <linux/exportfs.h> > +#include <linux/ratelimit.h> > +#include "overlayfs.h" > + > +int ovl_d_to_fh(struct dentry *dentry, char *buf, int buflen) static ...