Displaying 3 results from an estimated 3 matches for "s_mask".
Did you mean:
sa_mask
2020 Sep 11
0
[libnbd PATCH v2 1/5] api: Add xxx_MASK constant for each Flags type
...fun (flag, i) ->
let flag = sprintf "LIBNBD_%s_%s" flag_prefix flag in
- pr "#define %-40s %d\n" flag i
+ pr "#define %-40s 0x%02x\n" flag i;
+ mask := !mask lor i
) flags;
+ let flag = sprintf "LIBNBD_%s_MASK" flag_prefix in
+ pr "#define %-40s 0x%02x\n" flag !mask;
pr "\n"
) all_flags;
List.iter (
@@ -490,13 +494,12 @@ let generate_lib_api_c () =
);
(* Check parameters are valid. *)
- let print_flags_check n { flag_prefix; flags } =
+ let prin...
2020 Sep 11
10
[libnbd PATCH v2 0/5] Add knobs for client- vs. server-side validation
In v2:
- now based on my proposal to add LIBNBD_SHUTDOWN_IMMEDIATE
- four flags instead of two: STRICT_FLAGS is new (patch 4),
and STRICT_BOUNDS is separate from STRICT_ZERO_SIZE (patch 5)
- various refactorings for more shared code and less duplication
Eric Blake (5):
api: Add xxx_MASK constant for each Flags type
generator: Refactor filtering of accepted OFlags
api: Add
2020 Sep 11
0
[libnbd PATCH v2 2/5] generator: Refactor filtering of accepted OFlags
...Check parameters are valid. *)
- let print_flags_check n { flag_prefix } =
+ let print_flags_check n { flag_prefix; flags } subset =
let value = match errcode with
| Some value -> value
| None -> assert false in
- pr " if (unlikely ((%s & ~LIBNBD_%s_MASK) != 0)) {\n" n flag_prefix;
+ let mask = match subset with
+ | Some [] -> "0"
+ | Some subset ->
+ let v = ref 0 in
+ List.iter (
+ fun (flag, i) ->
+ if List.mem flag subset then v := !v lor i
+ ) fl...