Commit graph

19 commits

Author SHA1 Message Date
Yu Watanabe db9ecf0501 license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
Lennart Poettering e8467cd31c blockdev-util: add correct API for detecting if block device has partition scanning enabled
Instead of checking the loopback ioctls, let's check sysfs, so that we
catch all kinds of block devices, not just loopback block devices.
2020-08-11 10:29:43 +02:00
Lennart Poettering ac83e5aeca blockdev: add helper for locking whole block device 2020-05-18 18:41:56 +02:00
Lennart Poettering 6cba41ab0d blockdev: propagate one more unexpected error 2020-05-18 18:41:56 +02:00
Lennart Poettering db8728a60c blockdev-util: rework get_block_device()
Let's open the specified path once, and use the same fd for all lookups.
Also, don't check for btrfs twice.

The behaviour remains unmodified.
2019-12-13 18:38:35 +09:00
Yu Watanabe e30e8b5073 tree-wide: drop stat.h or statfs.h when stat-util.h is included 2019-11-04 00:30:32 +09:00
Yu Watanabe f5947a5e92 tree-wide: drop missing.h 2019-10-31 17:57:03 +09:00
Lennart Poettering a0ea1dee7b blockdev-util: let us know if block_get_whole_disk() did anything 2019-07-04 00:01:09 +02:00
Lennart Poettering 51f14fa111 blockdev: filter out invalid block devices early 2019-07-04 00:00:54 +02:00
Lennart Poettering d18b300933 blockdev-util: propagate actual error 2019-07-04 00:00:44 +02:00
Yu Watanabe 657ee2d82b tree-wide: replace strjoin() with path_join() 2019-06-21 03:26:16 +09:00
Ben Boeckel 5238e95759 codespell: fix spelling errors 2019-04-29 16:47:18 +02:00
Lennart Poettering 3a47c40d97 tree-wide: port various parts of the code to use parse_dev() 2018-11-29 20:03:56 +01:00
Lennart Poettering 0c69794138 tree-wide: remove Lennart's copyright lines
These lines are generally out-of-date, incomplete and unnecessary. With
SPDX and git repository much more accurate and fine grained information
about licensing and authorship is available, hence let's drop the
per-file copyright notice. Of course, removing copyright lines of others
is problematic, hence this commit only removes my own lines and leaves
all others untouched. It might be nicer if sooner or later those could
go away too, making git the only and accurate source of authorship
information.
2018-06-14 10:20:20 +02:00
Lennart Poettering 818bf54632 tree-wide: drop 'This file is part of systemd' blurb
This part of the copyright blurb stems from the GPL use recommendations:

https://www.gnu.org/licenses/gpl-howto.en.html

The concept appears to originate in times where version control was per
file, instead of per tree, and was a way to glue the files together.
Ultimately, we nowadays don't live in that world anymore, and this
information is entirely useless anyway, as people are very welcome to
copy these files into any projects they like, and they shouldn't have to
change bits that are part of our copyright header for that.

hence, let's just get rid of this old cruft, and shorten our codebase a
bit.
2018-06-14 10:20:20 +02:00
Lennart Poettering 880f09bd91 blockdev: split out actual DM sysfs code of get_block_device_harder() into function of its own
That way we can use it in code that already acquired a dev_t from some
source.
2018-06-11 18:01:06 +02:00
Lennart Poettering 66ae5130a0 blockdev-util: let's initialize return parameter on success
We document the rule that return values >= 0 of functions are supposed
to indicate success, and that in case of success all return parameters
should be initialized. Let's actually do so.

Just a tiny coding style fix-up.
2018-06-11 17:55:17 +02:00
Zbigniew Jędrzejewski-Szmek 11a1589223 tree-wide: drop license boilerplate
Files which are installed as-is (any .service and other unit files, .conf
files, .policy files, etc), are left as is. My assumption is that SPDX
identifiers are not yet that well known, so it's better to retain the
extended header to avoid any doubt.

I also kept any copyright lines. We can probably remove them, but it'd nice to
obtain explicit acks from all involved authors before doing that.
2018-04-06 18:58:55 +02:00
Lennart Poettering 18c528e99f basic: split out blockdev-util.[ch] from util.h
With three functions it makes sense to split this out now.
2017-12-25 11:48:21 +01:00