Commit Graph

6 Commits

Author SHA1 Message Date
Xavier Deguillard
a29d465ee8 fs: fix license header
Summary:
With Facebook having been renamed Meta Platforms, we need to change the license
headers.

Reviewed By: fanzeyi

Differential Revision: D33407812

fbshipit-source-id: b11bfbbf13a48873f0cea75f212cc7b07a68fb2e
2022-01-04 15:00:07 -08:00
Xavier Deguillard
235ccac7f3 nfs: ifdef it on Windows
Summary:
MSVC is broken as it doesn't understand the various macros used to generate
XdrTrait for specific types, and I can't figure out a way to make that work.
Even if I provide dummy version of these, the buck build breaks due to glog
trying to redefine the ERROR symbol that some Microsoft headers contain. For
now, let's just ifdef it out since it's unlikely that we're going to be using
NFS on Windows anytime soon.

Reviewed By: singhsrb

Differential Revision: D26293519

fbshipit-source-id: bbaf325c7d1f1688327708360244797a6d48179e
2021-02-05 21:22:56 -08:00
Xavier Deguillard
fc4b26c0ae nfs: make it compile with getdeps builds
Summary:
As the NFS bits are integrated into the rest of EdenFS, we need to make sure
the code compiles properly. The only major change was the removal of the
//common dependencies as these aren't available to OSS builds.

Reviewed By: genevievehelsel

Differential Revision: D26181750

fbshipit-source-id: 44f8ff335e543ab282f40fa7f8d28fc19cf4581c
2021-02-03 17:54:54 -08:00
Xavier Deguillard
86114ab338 nfs: switch to the rpcbind protocol
Summary:
The portmap protocol is limited to IPv4, while the rpcbind not only does
support IPv4 and IPv6, but also unix sockets. While we still bind only to an
ipv4, this should allow us to support IPv6 in the future.

Reviewed By: kmancini

Differential Revision: D26114218

fbshipit-source-id: 46e4dfe60a9c1ddbccbb586bf4e3d24012fd26ee
2021-02-03 16:45:37 -08:00
Xavier Deguillard
c39674f372 nfs: use an XdrTrait instead of overloaded functions
Summary:
As I'm going through the various NFS specs, it becomes clear that variant are
widely used, and the macros to generate them is awkward and making working with
them harder than it should be. Instead writing their deserialization would be
more flexible.

While doing this, I also revamped how serialization/deserialization is done by
using a trait that contains 2 static function: serialize and deserialize, new
types are expected to specialize the XdrTrait with their own
serialization/deserialization.

Reviewed By: kmancini

Differential Revision: D26160026

fbshipit-source-id: 951bdd20620cc5715e780e99b64e15397688570d
2021-02-03 16:45:37 -08:00
Xavier Deguillard
1b0d345774 nfs: add a portmap client
Summary:
The portmap protocol allows for service discovery and registration against the
per-host rpcbind daemon. An NFS server will need to register against it to be
mountable.

The portmap_util binary is here for testing purposes and will not be used in
EdenFS.

This code was written by wez.

Reviewed By: kmancini

Differential Revision: D25986694

fbshipit-source-id: 1eee7238fdf70c8c4937e685da91ad08d46befe4
2021-02-01 09:28:40 -08:00