summaryrefslogtreecommitdiff
path: root/src/udev/udev-builtin-btrfs.c
Commit message (Collapse)AuthorAgeFilesLines
* udev: make udev_builtin_run() take UdevEvent*Yu Watanabe2023-05-161-1/+2
| | | | No functional change, preparation for later commits.
* tree-wide: use -EBADF for fd initializationZbigniew Jędrzejewski-Szmek2022-12-191-1/+1
| | | | | | | | | | | | | | | | -1 was used everywhere, but -EBADF or -EBADFD started being used in various places. Let's make things consistent in the new style. Note that there are two candidates: EBADF 9 Bad file descriptor EBADFD 77 File descriptor in bad state Since we're initializating the fd, we're just assigning a value that means "no fd yet", so it's just a bad file descriptor, and the first errno fits better. If instead we had a valid file descriptor that became invalid because of some operation or state change, the other errno would fit better. In some places, initialization is dropped if unnecessary.
* basic: rename util.h to logarithm.hZbigniew Jędrzejewski-Szmek2022-11-081-1/+0
| | | | | util.h is now about logarithms only, so we can rename it. Many files included util.h for no apparent reason… Those includes are dropped.
* udev: always open with O_NOCTTYYu Watanabe2022-09-101-1/+1
| | | | | All files or device nodes opened here should not be console tty. Let's open it the flags for safety.
* errno-util: add ERRNO_IS_DEVICE_ABSENT() macroLennart Poettering2022-03-241-1/+2
| | | | Inspired by: https://github.com/systemd/systemd/pull/22717#discussion_r834254495
* udev: pass rtnl to builtin commandsYu Watanabe2021-08-311-1/+1
|
* udev: when btrfs.ko is not available consider btrfs filesystems not readyLennart Poettering2021-02-261-1/+10
| | | | | | | | Let's add a special tweak to the btrfs builtin: if /dev/btrfs-control is not there, let's consider all btrfs file systems as SYSTEMD_READY=0. This is useful in initrds, where btrfs.ko might be missing. After the initrd → host transition we can then retigger the device and undo the SYSTEMD_READY=0 marking.
* license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-091-1/+1
|
* udev: modernize udev-rules.cYu Watanabe2019-06-021-1/+1
| | | | | | | | | | | This does the following: - rename enum udev_builtin_cmd -> UdevBuiltinCmd - rename struct udev_builtin -> UdevBuiltin - move type definitions to udev-rules.h - move prototypes of functions defined in udev-rules.c to udev-rules.h - drop to use strbuf - propagate critical errors in applying rules, - drop limitation for number of tokens per line.
* tree-wide: drop several missing_*.h and import relevant headers from kernel-5.0Yu Watanabe2019-04-111-1/+1
|
* udev: use SYNTHETIC_ERRNO() macro in log_device_*_errno()Yu Watanabe2019-01-131-1/+1
|
* missing: move btrfs related entries to missing_btrfs.h and missing_btrfs_tree.hYu Watanabe2018-12-041-4/+0
|
* udev-builtin-btrfs: add debug log messagesYu Watanabe2018-10-241-3/+4
|
* udev-builtin: propagate negative errnoYu Watanabe2018-10-231-8/+8
|
* udev: replace udev_device by sd_device from prototype of udev builtin commandsYu Watanabe2018-10-231-2/+2
|
* udev: make udev_builtin_add_property() take sd_device instead of udev_deviceYu Watanabe2018-10-231-1/+1
|
* udev-builtin: move definitions related to builtin commands to udev-builtin.hYu Watanabe2018-10-111-1/+3
|
* tree-wide: drop copyright headers from frequent contributorsZbigniew Jędrzejewski-Szmek2018-06-201-3/+0
| | | | | | | | Fixes #9320. for p in Shapovalov Chevalier Rozhkov Sievers Mack Herrmann Schmidt Rudenberg Sahani Landden Andersen Watanabe; do git grep -e 'Copyright.*'$p -l|xargs perl -i -0pe 's|/([*][*])?[*]\s+([*#]\s+)?Copyright[^\n]*'$p'[^\n]*\s*[*]([*][*])?/\n*|\n|gms; s|\s+([*#]\s+)?Copyright[^\n]*'$p'[^\n]*\n*|\n|gms' done
* tree-wide: beautify remaining copyright statementsLennart Poettering2018-06-141-1/+1
| | | | | | Let's unify an beautify our remaining copyright statements, with a unicode ©. This means our copyright statements are now always formatted the same way. Yay.
* tree-wide: drop 'This file is part of systemd' blurbLennart Poettering2018-06-141-2/+0
| | | | | | | | | | | | | | | | 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.
* tree-wide: drop license boilerplateZbigniew Jędrzejewski-Szmek2018-04-061-13/+0
| | | | | | | | | | 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.
* Add SPDX license identifiers to source files under the LGPLZbigniew Jędrzejewski-Szmek2017-11-191-0/+1
| | | | | This follows what the kernel is doing, c.f. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5fd54ace4721fc5ce2bb5aef6318fcf17f421460.
* build-sys: use #if Y instead of #ifdef Y everywhereZbigniew Jędrzejewski-Szmek2017-10-041-1/+1
| | | | | | | | | | | | | | | The advantage is that is the name is mispellt, cpp will warn us. $ git grep -Ee "conf.set\('(HAVE|ENABLE)_" -l|xargs sed -r -i "s/conf.set\('(HAVE|ENABLE)_/conf.set10('\1_/" $ git grep -Ee '#ifn?def (HAVE|ENABLE)' -l|xargs sed -r -i 's/#ifdef (HAVE|ENABLE)/#if \1/; s/#ifndef (HAVE|ENABLE)/#if ! \1/;' $ git grep -Ee 'if.*defined\(HAVE' -l|xargs sed -i -r 's/defined\((HAVE_[A-Z0-9_]*)\)/\1/g' $ git grep -Ee 'if.*defined\(ENABLE' -l|xargs sed -i -r 's/defined\((ENABLE_[A-Z0-9_]*)\)/\1/g' + manual changes to meson.build squash! build-sys: use #if Y instead of #ifdef Y everywhere v2: - fix incorrect setting of HAVE_LIBIDN2
* tree-wide: remove Emacs lines from all filesDaniel Mack2016-02-101-2/+0
| | | | | This should be handled fine now by .dir-locals.el, so need to carry that stuff in every file.
* udev: add emacs header lineZbigniew Jędrzejewski-Szmek2015-12-071-0/+2
| | | | | Otherwise emacs wants to use 2-space indentation and other attrocities.
* util-lib: split out fd-related operations into fd-util.[ch]Lennart Poettering2015-10-251-0/+1
| | | | | There are more than enough to deserve their own .c file, hence move them over.
* util-lib: split our string related calls from util.[ch] into its own file ↵Lennart Poettering2015-10-241-1/+2
| | | | | | | | | | | | | | string-util.[ch] There are more than enough calls doing string manipulations to deserve its own files, hence do something about it. This patch also sorts the #include blocks of all files that needed to be updated, according to the sorting suggestions from CODING_STYLE. Since pretty much every file needs our string manipulation functions this effectively means that most files have sorted #include blocks now. Also touches a few unrelated include files.
* remove unused includesThomas Hindoe Paaboel Andersen2015-02-231-4/+0
| | | | | | This patch removes includes that are not used. The removals were found with include-what-you-use which checks if any of the symbols from a header is in use.
* udev: make use of new one_zero() helper where appropriateLennart Poettering2015-01-131-1/+1
|
* udev-builtin-btrfs: properly initialize ioctl struct to zeroesLennart Poettering2014-12-121-1/+2
|
* Move BTRFS_IOC_DEVICES_READY to missing.hZbigniew Jędrzejewski-Szmek2014-08-031-2/+0
|
* util.h: include missing.h, for struct file_handleSimon McVittie2014-08-031-6/+4
| | | | | | | | This breaks udev-builtin-btrfs.c, which reinvents some of missing.h, so use missing.h there too. [zj: removed #include "config.h" and wrapped #include <linux/btrfs.h> in ifdef HAVE_LINUX_BTRFS_H as discussed on the mailing list.]
* udev: place opening { at the same line as the function declarationKay Sievers2014-07-291-2/+1
|
* everywhere: always use O_CLOEXEC where it makes senseLennart Poettering2014-02-131-3/+2
|
* udev: move string copy functions to shared/Kay Sievers2013-01-091-1/+1
|
* udev: update file headersKay Sievers2012-11-091-10/+18
|
* udev: add btrfs supportKay Sievers2012-09-171-0/+57
All "btrfs" file systems will be registered with the kernel when they show up. Incomplete multi-device volumes will set SYSTEMD_READY=0, to prevent access until the volume is complete and fully registered.