NFSD: Finish refactoring __write_ports()