-
-
Notifications
You must be signed in to change notification settings - Fork 605
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fs: move nfs support out of kernel in lieu of a separate pluggable mo…
…dule This patch removes external/fs/libnfs module and makes nfs support pluggable by moving it into a module (shared library) that can be added to the image instead of being compiled into the kernel using nfs=true build option. The nfs support can be added by adding nfs module to the image. More specifically: - external/fs/libnfs is removed and equivalent modules/libnfs gets created - most fs/nfs code except for fs_null_vfsops.cc gets moved out of a kernel into new modules/nfs that is built as a shared library - vfs mount logic is able to dynamically load extra filesystem libraries from /usr/lib/fs Completes #1078 Signed-off-by: Waldemar Kozaczuk <jwkozaczuk@gmail.com>
- Loading branch information
Showing
20 changed files
with
139 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule libnfs
deleted from
dc8d86
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
upstream |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
src = $(shell readlink -f ../..) | ||
module-dir = $(src)/modules/libnfs | ||
|
||
all: module | ||
module: libnfs | ||
|
||
libnfs: upstream/libnfs/.git upstream/libnfs/lib/libnfs.so.4.0.0 | ||
|
||
.PHONY: libnfs | ||
|
||
upstream/libnfs/.git: | ||
mkdir -p $(module-dir)/upstream && cd $(module-dir)/upstream && \ | ||
git clone --depth 1 https://github.com/sahlberg/libnfs.git | ||
|
||
upstream/libnfs/lib/libnfs.so.4.0.0: | ||
cd $(module-dir)/upstream/libnfs && cmake . && make | ||
|
||
clean: | ||
cd $(module-dir) && rm -rf upstream |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# | ||
# Copyright (C) 2018 Waldemar Kozaczuk | ||
# | ||
# This work is open source software, licensed under the terms of the | ||
# BSD license as described in the LICENSE file in the top-level directory. | ||
# | ||
|
||
[manifest] | ||
/usr/lib/libnfs.so.11.0.0: ${MODULE_DIR}/upstream/libnfs/lib/libnfs.so.4.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
obj | ||
*.so | ||
usr.manifest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
INCLUDES = -I. -I../libnfs/upstream/libnfs/include -I../../include | ||
INCLUDES += -I../../arch/$(ARCH) -I../.. -I../../build/$(mode)/gen/include | ||
INCLUDES += -isystem ../../include/glibc-compat | ||
#Only for host, not external | ||
INCLUDES += $(shell $(CXX) -E -xc++ - -v </dev/null 2>&1 | awk '/^End/ {exit} /^ .*c\+\+/ {print "-isystem" $$0}') | ||
# | ||
INCLUDES += -isystem ../../include/api -isystem ../../include/api/$(ARCH) -isystem ../../build/$(mode)/gen/include | ||
INCLUDES += -isystem ../../bsd/sys -isystem ../../bsd/ -isystem ../../bsd/$(ARCH) | ||
|
||
autodepend = -MD -MT $@ -MP | ||
CXXFLAGS = -g -rdynamic -Wall -std=c++11 -fPIC $(INCLUDES) -D_KERNEL -D_GNU_SOURCE $(autodepend) | ||
|
||
# the build target executable: | ||
TARGET = nfs | ||
CPP_FILES := $(wildcard *.cc) | ||
OBJ_FILES := $(addprefix obj/,$(CPP_FILES:.cc=.o)) | ||
DEPS := $(OBJ_FILES:.o=.d) | ||
|
||
LIBS = -L../libnfs/upstream/libnfs/lib -lnfs | ||
ifndef ARCH | ||
ARCH = x64 | ||
endif | ||
ifndef mode | ||
mode = release | ||
endif | ||
|
||
quiet = $(if $V, $1, @echo " $2"; $1) | ||
very-quiet = $(if $V, $1, @$1) | ||
|
||
$(TARGET).so: $(OBJ_FILES) | ||
$(call quiet, $(CXX) $(CXXFLAGS) -shared -o $(TARGET).so $^ $(LIBS), LINK $@) | ||
|
||
obj/%.o: %.cc | ||
$(call quiet, $(CXX) $(CXXFLAGS) -c -o $@ $<, CXX $@) | ||
|
||
init: | ||
@echo " MKDIRS" | ||
$(call very-quiet, mkdir -p obj) | ||
.PHONY: init | ||
|
||
module: init $(TARGET).so | ||
echo '/usr/lib/fs/nfs.so: $${MODULE_DIR}/nfs.so' > usr.manifest | ||
|
||
clean: | ||
rm -f $(TARGET)*.so usr.manifest | ||
$(call very-quiet, $(RM) -rf obj) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from osv.modules import api | ||
|
||
api.require('libnfs') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters