Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
5a4a04f
Bump `DEV_NB_PHYS_SEG`
NicolasT Dec 31, 2014
9d550df
Restructure file layout and use Kbuild
NicolasT Feb 10, 2015
b776360
Add `srb-jsmn` module
NicolasT Feb 10, 2015
0285a37
Pull some functionality apart
NicolasT Feb 10, 2015
f34d45b
Remove heaps of functionality that should be performed from userspace
NicolasT Feb 10, 2015
e2d6d76
Remove `srb-jsmn`
NicolasT Feb 10, 2015
f6af713
Remove unused `srb_http_mklist`
NicolasT Feb 10, 2015
1b8aef0
Let playground server deliver valid JSON
NicolasT Feb 10, 2015
281f573
Initial import of SRB control script
NicolasT Feb 10, 2015
f19ffc2
Ignore playground data
NicolasT Feb 10, 2015
7cc5e30
Merge origin/large-max-hw-sectors-kb into restructure (using imerge)
NicolasT Feb 10, 2015
252ceda
Remove removed functionality from `README.md`
NicolasT Feb 10, 2015
011b8ec
Block devices already have a `size` attribute in sysfs
NicolasT Feb 10, 2015
03511ed
Remove unused includes
NicolasT Feb 11, 2015
0c254d7
Fixup Clang unsignedness errors
NicolasT Feb 11, 2015
8f2c292
Disable some warnings when building with Clang
NicolasT Feb 11, 2015
2d13b39
bin/srb: Implement more CDMI volume management commands
NicolasT Feb 14, 2015
865fd80
Remove SysV/SystemD stuff
NicolasT Feb 14, 2015
500672b
bin/srb: Add license header
NicolasT Feb 14, 2015
7459fff
Remove some unused macro constants
NicolasT Feb 14, 2015
06d18c6
C has enums for quite a while. Use them.
NicolasT Feb 14, 2015
88e0238
Slowly getting rid of `srb/srb.h`
NicolasT Feb 14, 2015
c4ebe79
Abstractify `srb_device` struct
NicolasT Feb 14, 2015
ba9f9a2
Further cleanup of `srb/srb.h`
NicolasT Feb 14, 2015
65553ad
Simplify `Makefile`
NicolasT Mar 26, 2015
0b56e85
Add ftrace support files
NicolasT Mar 26, 2015
f000f60
Use `atomic_t` for reference counting
NicolasT Mar 26, 2015
867ad5a
Remove unused `srb_http_mkhead`
NicolasT Mar 26, 2015
ad8a163
Remove unused `srb_http_{mkcreate|mktruncate|mkdelete}`
NicolasT Mar 26, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
Module.symvers
.tmp_versions/
modules.order
srb.mod.c
*.mod.c
linux/
linux-clones/
1 change: 1 addition & 0 deletions Kbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
obj-y := srb/
51 changes: 20 additions & 31 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,34 +1,23 @@
##
## Copyright (C) 2014 SCALITY SA - http://www.scality.com
##
## This file is part of ScalityRestBlock.
##
## ScalityRestBlock is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## (at your option) any later version.
##
## ScalityRestBlock is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with ScalityRestBlock. If not, see <http://www.gnu.org/licenses/>.
##
##
# Copyright (C) 2014, 2015 Scality SA - http://www.scality.com
#
# This file is part of ScalityRestBlock.
#
# ScalityRestBlock is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# ScalityRestBlock is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with ScalityRestBlock. If not, see <http://www.gnu.org/licenses/>.

TARGET := srb
KDIR ?= /lib/modules/$(shell uname -r)/build

srb-objs := srb_driver.o srb_sysfs.o srb_cdmi.o srb_http.o jsmn/jsmn.o
obj-m := $(TARGET).o
KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
default: modules

ccflags-y += -g3 -O2 -Wall -Wextra -Wno-unused-parameter -Werror -Warray-bounds -D_REENTRANT -DJSMN_PARENT_LINKS

all:
$(MAKE) -C $(KDIR) M=$(PWD) modules

clean:
$(MAKE) -C $(KDIR) M=$(PWD) clean
modules modules_install clean help:
$(MAKE) -C $(KDIR) M=$$PWD $@
52 changes: 0 additions & 52 deletions README.centos

This file was deleted.

89 changes: 0 additions & 89 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,6 @@ the servers:
* add\_urls: allows adding one or more server urls to the driver
* remove\_urls: allows removing one or more server urls from the driver

Then, the following management files are available:
* create: allows creating a volume file on the storage
* extend: allows extending a volume (increasing size), whether it is attached
or not
* destroy: deletes the volume file from the storage

The way those files work is described in the following sections, each dedicated
to one management (/sys) file. Please mind that each one of theses files can be
displayed (using cat on them) to show a simple usage text.
Expand Down Expand Up @@ -138,69 +132,6 @@ Note also that when unloading the module, the devices are detached
automatically before the module can actually be unloaded.


Creating a new volume
---------------------

To create a volume, just give the name of the file to create to the driver,
accompanied by a byte size, such as in the following example:

# echo "filename human\_readable\_size" > /sys/class/srb/create

The volume will be created on the storage with the requested size.
But beware:
* The human readable size formats understood by the LKM are the following:
* [integer number]: size in bytes
* [integer number]k: size in Kilobytes
* [integer number]M: size in Megabytes
* [integer number]G: size in Gigabytes
* At least one server url must exist and be valid for the volume to be
created
* Created volume are not automatically attached as a device on the system.

Before you can use the volume, you have to attach it through the attach /sys
file (see below).

Extending a volume
------------------

Sometimes, a volume might look to be provisionned too small for the actual
need. For this reason, you can actually extend it through the extend /sys
control file. This command follows the same usage as the create command, thus
using it is simple:

# echo "volumename human\_readable\_size" > /sys/class/srb/extend

Be aware that this command can only extend a volume, meaning the size you give
must be higher than the current size. Also, this is a supported operation
on an attached volume, though any file-system formatted onto the volume should
be extended to the new volume's size manually since most of the filesystems
don't support flexible partition or volume extension (unless you are using LVM
underneath).

Once the operation is complete, the new size will be properly reported to the
system without any additional administrative task. For instance, displaying the
contents of the file /proc/partitions will show you the updated size of the
volume.

Note that the human readable size format of the extend command follows the
same rules as that of the create command.

Destruction of an existing volume
---------------------------------

Destroying a volume means that it volume will no longer be accessible after
a successful operation. To destroy a volume, give the driver the name of the
file to remove from the storage as the following example shows:

# echo filename > /sys/class/srb/destroy

The volume is then removed from storage and is no longer accessible.
But beware:
* The destroyed volume must exist beforehand
* Destroying a volume used by other drivers on other machines srb
can lead to errors and unexpected behaviors; this is untested.


Attaching and Detaching devices
===============================

Expand All @@ -219,26 +150,6 @@ the three following management files are available:

They are described in detail in the following sections.

Listing the volumes
-------------------

Since you might not know from memory which volumes exist on your servers,
you might want a way to list those, to attach them easily. One of the ways
provided is to read the content of the volumes /sys file:

```
# cat /sys/class/srb/volumes
Volume1
Foo
Bar
Baz
Qux
```

This way, you can know that you have five volumes available on your servers,
and know their names, which will allow you to either attach, extend or destroy
them.

Attaching a device
------------------

Expand Down
42 changes: 0 additions & 42 deletions README.ubuntu

This file was deleted.

Loading