# run me from the root of a _linux_ git tree, and pass ceph tree root.
cephtree=$1
echo ceph tree at $cephtree.
+target=$2
+echo target is $target
test -d .git || exit 0
test -e include/linux/mm.h || exit 0
test -e $cephtree/src/kernel/super.h || exit 0
# copy into the tree
-mkdir fs/ceph
-mkdir fs/ceph/crush
-cp $cephtree/src/kernel/Makefile fs/ceph
-cp $cephtree/src/kernel/Kconfig fs/ceph
-cp $cephtree/src/kernel/*.[ch] fs/ceph
-cp $cephtree/src/kernel/crush/*.[ch] fs/ceph/crush
+mkdir $target/ceph
+mkdir $target/ceph/crush
+cp $cephtree/src/kernel/Makefile $target/ceph
+cp $cephtree/src/kernel/Kconfig $target/ceph
+cp $cephtree/src/kernel/*.[ch] $target/ceph
+cp $cephtree/src/kernel/crush/*.[ch] $target/ceph/crush
cp $cephtree/src/kernel/ceph.txt Documentation/filesystems
# build the patch sequence
EOF
-git add fs/ceph/ceph_fs.h
-git add fs/ceph/msgr.h
-git add fs/ceph/rados.h
+git add $target/ceph/ceph_fs.h
+git add $target/ceph/msgr.h
+git add $target/ceph/rados.h
git commit -F - <<EOF
ceph: on-wire types
EOF
-git add fs/ceph/types.h
-git add fs/ceph/super.h
-git add fs/ceph/ceph_ver.h
+git add $target/ceph/types.h
+git add $target/ceph/super.h
+git add $target/ceph/ceph_ver.h
git commit -F - <<EOF
ceph: client types
EOF
-git add fs/ceph/super.c
+git add $target/ceph/super.c
git commit -F - <<EOF
ceph: super.c
EOF
-git add fs/ceph/inode.c
+git add $target/ceph/inode.c
git commit -F - <<EOF
ceph: inode operations
EOF
-git add fs/ceph/dir.c
+git add $target/ceph/dir.c
git commit -F - <<EOF
ceph: directory operations
EOF
-git add fs/ceph/file.c
+git add $target/ceph/file.c
git commit -F - <<EOF
ceph: file operations
EOF
-git add fs/ceph/addr.c
+git add $target/ceph/addr.c
git commit -F - <<EOF
ceph: address space operations
EOF
-git add fs/ceph/mds_client.h
-git add fs/ceph/mds_client.c
-git add fs/ceph/mdsmap.h
-git add fs/ceph/mdsmap.c
+git add $target/ceph/mds_client.h
+git add $target/ceph/mds_client.c
+git add $target/ceph/mdsmap.h
+git add $target/ceph/mdsmap.c
git commit -F - <<EOF
ceph: MDS client
EOF
-git add fs/ceph/osd_client.h
-git add fs/ceph/osd_client.c
-git add fs/ceph/osdmap.h
-git add fs/ceph/osdmap.c
+git add $target/ceph/osd_client.h
+git add $target/ceph/osd_client.c
+git add $target/ceph/osdmap.h
+git add $target/ceph/osdmap.c
git commit -F - <<EOF
ceph: OSD client
EOF
-git add fs/ceph/crush/crush.h
-git add fs/ceph/crush/crush.c
-git add fs/ceph/crush/mapper.h
-git add fs/ceph/crush/mapper.c
-git add fs/ceph/crush/hash.h
+git add $target/ceph/crush/crush.h
+git add $target/ceph/crush/crush.c
+git add $target/ceph/crush/mapper.h
+git add $target/ceph/crush/mapper.c
+git add $target/ceph/crush/hash.h
git commit -F - <<EOF
ceph: CRUSH mapping algorithm
EOF
-git add fs/ceph/mon_client.h
-git add fs/ceph/mon_client.c
+git add $target/ceph/mon_client.h
+git add $target/ceph/mon_client.c
git commit -F - <<EOF
ceph: monitor client
EOF
-git add fs/ceph/caps.c
+git add $target/ceph/caps.c
git commit -F - <<EOF
ceph: capability management
EOF
-git add fs/ceph/snap.c
+git add $target/ceph/snap.c
git commit -F - <<EOF
ceph: snapshot management
EOF
-git add fs/ceph/decode.h
-git add fs/ceph/messenger.h
-git add fs/ceph/messenger.c
+git add $target/ceph/decode.h
+git add $target/ceph/messenger.h
+git add $target/ceph/messenger.c
git commit -F - <<EOF
ceph: messenger library
EOF
-git add fs/ceph/export.c
+git add $target/ceph/export.c
git commit -F - <<EOF
ceph: nfs re-export support
EOF
-git add fs/ceph/ioctl.h
-git add fs/ceph/ioctl.c
+git add $target/ceph/ioctl.h
+git add $target/ceph/ioctl.c
git commit -F - <<EOF
ceph: ioctls
EOF
-git add fs/ceph/ceph_debug.h
+git add $target/ceph/ceph_debug.h
git commit -F - <<EOF
ceph: debugging
EOF
-git add fs/ceph/debugfs.c
+git add $target/ceph/debugfs.c
git commit -F - <<EOF
ceph: debugfs
EOF
-git apply $cephtree/src/kernel/kbuild.patch
-git add fs/ceph/Makefile
-git add fs/ceph/Kconfig
-git commit -F - <<EOF fs/Kconfig fs/ceph/Kconfig fs/Makefile fs/ceph/Makefile
+git apply $cephtree/src/kernel/kbuild.staging.patch
+git add $target/ceph/Makefile
+git add $target/ceph/Kconfig
+git commit -F - <<EOF $target/Kconfig $target/ceph/Kconfig $target/Makefile $target/ceph/Makefile
ceph: Kconfig, Makefile
Kconfig options and Makefile.
--- /dev/null
+diff --git a/fs/staging/Kconfig b/fs/staging/Kconfig
+index 605d8ae..bed45e4 100644
+--- a/fs/staging/Kconfig
++++ b/fs/staging/Kconfig
+@@ -42,5 +42,7 @@ config FSSTAGING_EXCLUDE_BUILD
+
+ if !FSSTAGING_EXCLUDE_BUILD
+
++source "fs/staging/ceph/Kconfig"
++
+ endif # !FSSTAGING_EXCLUDE_BUILD
+ endif # FSSTAGING
+diff --git a/fs/staging/Makefile b/fs/staging/Makefile
+index 0e2c0d6..5dabb66 100644
+--- a/fs/staging/Makefile
++++ b/fs/staging/Makefile
+@@ -3,3 +3,4 @@
+ # fix for build system bug...
+ obj-$(CONFIG_FSSTAGING) += fsstaging.o
+
++obj-$(CONFIG_CEPH_FS) += ceph/
+\ No newline at end of file