Commit Graph

7 Commits

Author SHA1 Message Date
Changpeng Liu
ad8bd8e313 util: add a new file operation API
The new added API can load file content into a data buffer, which
can be used to read configuration file as well as JSON file, and
we can add WRITE API in future which can be used to implement the
persistent reservation feature.

Change-Id: I9aaca7571648e1ab6dbfdd7cfd6ca34083cbeec2
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453498
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-05-15 18:54:27 +00:00
Jim Harris
edbed73064 Rename and move fd related helper functions to fd.c.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ieccdd778348e8709ca4ef6cdf4f58f40021638db
2016-09-14 10:51:25 -07:00
Daniel Verkamp
aae6ee8c80 file: add spdk_ prefix to public APIs
file_get_size() -> spdk_file_get_size()
dev_get_blocklen() -> spdk_dev_get_blocklen()

Change-Id: Iba1eb4a22ba331887e2c5c3a16e1c0f9e695d83e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-02-08 13:44:34 -07:00
Daniel Verkamp
c02b179490 Remove year from copyright headers.
Also add a space between Copyright and (c).

The copyright year can be determined using git metadata.

Also remove the duplicated "All rights reserved." - every instance of
this line already has a corresponding "All rights reserved" immediately
below it, except for examples/ioat/kperf/kmod/dma_perf.c, where I have
added it manually.

Performed using this command:

git ls-files | xargs sed -i -e 's/Copyright(c) \(.*\) Intel Corporation. All rights reserved./Copyright (c) Intel Corporation./'

Change-Id: I3779f404966800709024eb1eb66a50068af2716c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-01-28 08:54:18 -07:00
Daniel Verkamp
8307eb5f55 build: enable missing function declaration warning
This helps weed out functions that should be static, functions that are
not declared in public header files, and .c files that don't include
their .h interface headers.

Change-Id: Ie39f83ad4b320847e4a938bd1d4d0b4fa21c2ffa
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-11-02 14:40:23 -07:00
Daniel Verkamp
ae80d88bcb util: fix return code checks in dev_get_blocklen
The ioctl() calls in dev_get_blocklen() were checking for != 0 instead
of == 0, so the default path (512) was always being taken.

Change-Id: Ib0b016b1d453fb94d408063417b7485ff24ed220
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-11-02 08:48:58 -07:00
Daniel Verkamp
aaf0555e03 util: add file size and block size functions
Change-Id: I0d3269805470768ce75e81955db601c48ae0e737
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-10-26 11:16:56 -07:00