![]() |
|
|||
0001 /* SPDX-License-Identifier: GPL-2.0-or-later */ 0002 /* 0003 * bitmap.h - Defines for NTFS kernel bitmap handling. Part of the Linux-NTFS 0004 * project. 0005 * 0006 * Copyright (c) 2004 Anton Altaparmakov 0007 */ 0008 0009 #ifndef _LINUX_NTFS_BITMAP_H 0010 #define _LINUX_NTFS_BITMAP_H 0011 0012 #ifdef NTFS_RW 0013 0014 #include <linux/fs.h> 0015 0016 #include "types.h" 0017 0018 extern int __ntfs_bitmap_set_bits_in_run(struct inode *vi, const s64 start_bit, 0019 const s64 count, const u8 value, const bool is_rollback); 0020 0021 /** 0022 * ntfs_bitmap_set_bits_in_run - set a run of bits in a bitmap to a value 0023 * @vi: vfs inode describing the bitmap 0024 * @start_bit: first bit to set 0025 * @count: number of bits to set 0026 * @value: value to set the bits to (i.e. 0 or 1) 0027 * 0028 * Set @count bits starting at bit @start_bit in the bitmap described by the 0029 * vfs inode @vi to @value, where @value is either 0 or 1. 0030 * 0031 * Return 0 on success and -errno on error. 0032 */ 0033 static inline int ntfs_bitmap_set_bits_in_run(struct inode *vi, 0034 const s64 start_bit, const s64 count, const u8 value) 0035 { 0036 return __ntfs_bitmap_set_bits_in_run(vi, start_bit, count, value, 0037 false); 0038 } 0039 0040 /** 0041 * ntfs_bitmap_set_run - set a run of bits in a bitmap 0042 * @vi: vfs inode describing the bitmap 0043 * @start_bit: first bit to set 0044 * @count: number of bits to set 0045 * 0046 * Set @count bits starting at bit @start_bit in the bitmap described by the 0047 * vfs inode @vi. 0048 * 0049 * Return 0 on success and -errno on error. 0050 */ 0051 static inline int ntfs_bitmap_set_run(struct inode *vi, const s64 start_bit, 0052 const s64 count) 0053 { 0054 return ntfs_bitmap_set_bits_in_run(vi, start_bit, count, 1); 0055 } 0056 0057 /** 0058 * ntfs_bitmap_clear_run - clear a run of bits in a bitmap 0059 * @vi: vfs inode describing the bitmap 0060 * @start_bit: first bit to clear 0061 * @count: number of bits to clear 0062 * 0063 * Clear @count bits starting at bit @start_bit in the bitmap described by the 0064 * vfs inode @vi. 0065 * 0066 * Return 0 on success and -errno on error. 0067 */ 0068 static inline int ntfs_bitmap_clear_run(struct inode *vi, const s64 start_bit, 0069 const s64 count) 0070 { 0071 return ntfs_bitmap_set_bits_in_run(vi, start_bit, count, 0); 0072 } 0073 0074 /** 0075 * ntfs_bitmap_set_bit - set a bit in a bitmap 0076 * @vi: vfs inode describing the bitmap 0077 * @bit: bit to set 0078 * 0079 * Set bit @bit in the bitmap described by the vfs inode @vi. 0080 * 0081 * Return 0 on success and -errno on error. 0082 */ 0083 static inline int ntfs_bitmap_set_bit(struct inode *vi, const s64 bit) 0084 { 0085 return ntfs_bitmap_set_run(vi, bit, 1); 0086 } 0087 0088 /** 0089 * ntfs_bitmap_clear_bit - clear a bit in a bitmap 0090 * @vi: vfs inode describing the bitmap 0091 * @bit: bit to clear 0092 * 0093 * Clear bit @bit in the bitmap described by the vfs inode @vi. 0094 * 0095 * Return 0 on success and -errno on error. 0096 */ 0097 static inline int ntfs_bitmap_clear_bit(struct inode *vi, const s64 bit) 0098 { 0099 return ntfs_bitmap_clear_run(vi, bit, 1); 0100 } 0101 0102 #endif /* NTFS_RW */ 0103 0104 #endif /* defined _LINUX_NTFS_BITMAP_H */
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.1.0 LXR engine. The LXR team |
![]() ![]() |