search for: __x

Displaying 20 results from an estimated 159 matches for "__x".

Did you mean: __xg
2019 May 23
2
[RFC][PATCH] kernel.h: Add generic roundup_64() macro
...ude/linux/kernel.h index 74b1ee9027f5..cd0063629357 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -115,6 +115,20 @@ (((x) + (__y - 1)) / __y) * __y; \ } \ ) + +#if BITS_PER_LONG == 32 +# define roundup_64(x, y) ( \ +{ \ + typeof(y) __y = y; \ + typeof(x) __x = (x) + (__y - 1); \ + do_div(__x, __y); \ + __x * __y; \ +} \ +) +#else +# define roundup_64(x, y) roundup(x, y) +#endif + /** * rounddown - round down to next specified multiple * @x: the value to round
2019 May 23
4
[RFC][PATCH] kernel.h: Add generic roundup_64() macro
...0 AM Steven Rostedt <rostedt at goodmis.org> wrote: > > > > +# define roundup_64(x, y) ( \ > > +{ \ > > + typeof(y) __y = y; \ > > + typeof(x) __x = (x) + (__y - 1); \ > > + do_div(__x, __y); \ > > + __x * __y; \ > > +} \ > > The thing about this is that it absolutely sucks...
2020 Jun 30
2
[PATCH 18/18] arm64: lto: Strengthen READ_ONCE() to acquire when CLANG_LTO=y
...\ > +({ \ > + int atomic = 1; \ > + union { __unqual_scalar_typeof(x) __val; char __c[1]; } __u; \ > + typeof(&(x)) __x = &(x); \ > + switch (sizeof(x)) { \ ... > + atomic ? (typeof(x))__u.__val : (*(volatile typeof(x) *)__x); \ > +}) This expands (x) nine times (five in __unqual_scala_typeof()), which can l...
2020 Jun 30
2
[PATCH 18/18] arm64: lto: Strengthen READ_ONCE() to acquire when CLANG_LTO=y
...\ > +({ \ > + int atomic = 1; \ > + union { __unqual_scalar_typeof(x) __val; char __c[1]; } __u; \ > + typeof(&(x)) __x = &(x); \ > + switch (sizeof(x)) { \ ... > + atomic ? (typeof(x))__u.__val : (*(volatile typeof(x) *)__x); \ > +}) This expands (x) nine times (five in __unqual_scala_typeof()), which can l...
2010 Apr 08
1
[PATCH] Move all interaction with the config file into Sys::VirtV2V::Config
...rt-v2v config file. + +=head1 METHODS + +=over + +=item new(path) + +Create a new Sys::VirtV2V::Config object to operate on the config file at +I<path>. + +=cut + +sub new +{ + my $class = shift; + my ($path) = @_; + + my $self = {}; + bless($self, $class); + + die(user_message(__x("Config file {path} doesn't exist", + path => $path))) unless (-e $path); + + die(user_message(__x("Don't have permissions to read {path}", + path => $path))) unless (-r $path); + + eval { + $self->{do...
2020 Jun 30
0
[PATCH 02/18] compiler.h: Split {READ, WRITE}_ONCE definitions out into rwonce.h
...ad of READ_ONCE() if you do not require any + * atomicity or dependency ordering guarantees. Note that this may result + * in tears! + */ +#define __READ_ONCE(x) (*(const volatile __unqual_scalar_typeof(x) *)&(x)) + +#define __READ_ONCE_SCALAR(x) \ +({ \ + __unqual_scalar_typeof(x) __x = __READ_ONCE(x); \ + smp_read_barrier_depends(); \ + (typeof(x))__x; \ +}) + +#define READ_ONCE(x) \ +({ \ + compiletime_assert_rwonce_type(x); \ + __READ_ONCE_SCALAR(x); \ +}) + +#define __WRITE_ONCE(x, val) \ +do { \ + *(volatile typeof(x) *)&(x...
2020 Jul 10
0
[PATCH v3 19/19] arm64: lto: Strengthen READ_ONCE() to acquire when CONFIG_LTO=y
...".arch_extension rcpc\n" \ + "ldapr" #sfx "\t" #regs, \ + ARM64_HAS_LDAPR) +#else +#define __LOAD_RCPC(sfx, regs...) "ldar" #sfx "\t" #regs +#endif /* CONFIG_AS_HAS_LDAPR */ + +#define __READ_ONCE(x) \ +({ \ + typeof(&(x)) __x = &(x); \ + int atomic = 1; \ + union { __unqual_scalar_typeof(*__x) __val; char __c[1]; } __u; \ + switch (sizeof(x)) { \ + case 1: \ + asm volatile(__LOAD_RCPC(b, %w0, %1) \ + : "=r" (*(__u8 *)__u.__c) \ + : "Q" (*__x) : "memory");...
2020 Jul 10
0
[PATCH v3 02/19] compiler.h: Split {READ, WRITE}_ONCE definitions out into rwonce.h
...ad of READ_ONCE() if you do not require any + * atomicity or dependency ordering guarantees. Note that this may result + * in tears! + */ +#define __READ_ONCE(x) (*(const volatile __unqual_scalar_typeof(x) *)&(x)) + +#define __READ_ONCE_SCALAR(x) \ +({ \ + __unqual_scalar_typeof(x) __x = __READ_ONCE(x); \ + smp_read_barrier_depends(); \ + (typeof(x))__x; \ +}) + +#define READ_ONCE(x) \ +({ \ + compiletime_assert_rwonce_type(x); \ + __READ_ONCE_SCALAR(x); \ +}) + +#define __WRITE_ONCE(x, val) \ +do { \ + *(volatile typeof(x) *)&(x...
2010 Mar 31
3
[PATCH] Remove v2v-snapshot
...t user's home directory - my (undef, undef, undef, undef, undef, # name, passwd, uid, gid, quota - undef, undef, $home, undef, undef # comment, gcos, dir, shell, expire - ) = getpwuid($UID); - - unless (defined($home)) { - print STDERR user_message(__x("Unable to get home directory ". - "for current user")); - exit(1); - } - - $datadir = File::Spec->catdir($home, ".virt-v2v"); - } - - else { - $datadir = "/var/lib/virt-v2v"; -...
2013 Sep 05
1
[PATCH] virt-v2v: Add verbose message logging
...t;c|connect" => sub { # -c|--connect is the default for other virt tools. Be nice to # the user and point out that virt-v2v is different. @@ -521,6 +549,10 @@ else { # Get an appropriate Source my $source; +if (defined($verbose)) { + logmsg NOTICE, __x('Connecting to input '. + '({input})', input => $input_method) +} if ($input_method eq "libvirtxml") { my $path = shift(@ARGV) or pod2usage({ -message => __"You must specify a filename", @@ -574,6 +606,10 @@ else { #...
2010 Sep 21
1
[PREVIEW ONLY] Refactor data transfer code
...my $class = shift; - - my ($uri, $name, $target) = @_; + my ($uri) = @_; my $self = {}; - bless($self, $class); - $self->{uri} = URI->new($uri); - $self->{name} = $name; - - # Check that the guest doesn't already exist on the target - die(user_message(__x("Domain {name} already exists on the target.", - name => $name))) if ($target->guest_exists($name)); + $self->{uri} = $uri = URI->new($uri); # Parse uri authority for hostname and username - $self->{uri}->authority() =~ /^(?:([^:]*)(?...
2010 Mar 30
3
[PATCH 1/2] Refactor guest and volume creation into Sys::VirtV2V::Target::LibVirt
..._metadata($vmm, $dom, $desc, $devices, $guestcaps); - - my ($name) = $dom->findnodes('/domain/name/text()'); - $name = $name->getNodeValue(); + _convert_metadata($dom, $desc, $devices, $guestcaps); - if($guestcaps->{virtio}) { - print user_message - (__x("{name} configured with virtio drivers", name => $name)); - } else { - print user_message - (__x("{name} configured without virtio drivers", name => $name)); - } + return $guestcaps; } sub _convert_metadata { - my ($vmm, $dom, $desc, $dev...
2019 May 24
1
[RFC][PATCH] kernel.h: Add generic roundup_64() macro
On 23/05/2019 16:27, Steven Rostedt wrote: > > I haven't yet tested this, but what about something like the following: > > ...perhaps forget about the constant check, and just force > the power of two check: > > \ > if (!(__y & (__y >> 1))) { \ > __x = round_up(x, y); \ > } else { \ You probably want            if (!(__y & (__y - 1)) -- Roger
2010 Jun 10
1
[PATCH] RHEV: Warn instead of die if rmtree dies during cleanup
...diff --git a/lib/Sys/VirtV2V/Target/RHEV.pm b/lib/Sys/VirtV2V/Target/RHEV.pm index 295c19d..c9add0c 100644 --- a/lib/Sys/VirtV2V/Target/RHEV.pm +++ b/lib/Sys/VirtV2V/Target/RHEV.pm @@ -390,9 +390,18 @@ sub _cleanup return unless (defined($tmpdir)); - rmtree($tmpdir) or warn(user_message(__x("Unable to remove temporary ". - "directory {dir}", - dir => $tmpdir))); + eval { + rmtree($tmpdir) or warn(user_message(__x("Unable to remove temporary ". +...
2010 Sep 13
3
[PATCH 1/4] Check that we're not overwriting an existing Libvirt domain
...10d..51331da 100644 --- a/lib/Sys/VirtV2V/Connection/LibVirt.pm +++ b/lib/Sys/VirtV2V/Connection/LibVirt.pm @@ -79,6 +79,10 @@ sub new $self->{uri} = URI->new($uri); $self->{name} = $name; + # Check that the guest doesn't already exist on the target + die(user_message(__x("Domain {name} already exists on the target.", + name => $name))) if ($target->guest_exists($name)); + # Parse uri authority for hostname and username $self->{uri}->authority() =~ /^(?:([^:]*)(?::([^@]*))?@)?(.*)$/ or die(user_message...
2020 Jun 30
0
[PATCH 18/18] arm64: lto: Strengthen READ_ONCE() to acquire when CLANG_LTO=y
...\ + ARM64_HAS_LDAPR) +#else +#define __LOAD_RCPC(sfx, regs...) "ldar" #sfx "\t" #regs +#endif /* CONFIG_AS_HAS_LDAPR */ + +#define __READ_ONCE(x) \ +({ \ + int atomic = 1; \ + union { __unqual_scalar_typeof(x) __val; char __c[1]; } __u; \ + typeof(&(x)) __x = &(x); \ + switch (sizeof(x)) { \ + case 1: \ + asm volatile(__LOAD_RCPC(b, %w0, %1) \ + : "=r" (*(__u8 *)__u.__c) \ + : "Q" (*__x) : "memory"); \ + break; \ + case 2: \ + asm volatile(__LOAD_RCPC(h, %w0, %1) \ + : &qu...
2010 May 04
1
[PATCH] Config: Don't require all referenced software to be available
...; + my %paths; foreach my $path ($dom->findnodes('/virt-v2v/app/path/text()')) { $path = $path->getData(); @@ -118,12 +119,10 @@ sub get_transfer_iso $abs = $path; } - # Check the referenced path is accessible - die(user_message(__x("Unable to access {path} referenced in ". - "the config file", - path => $path))) unless (-r $abs); - - $path_args{"$path=$abs"} = 1; + if (-r $abs) { + $path_args{"$path=$abs&quot...
2010 May 13
1
[PATCH] Improve augeas error reporting
...aug_match("$error//*")) { + $detail_path =~ /^$error\/(.*)$/ + or die("Unexpected return from aug_match: $detail_path"); + $detail{$1} = $g->aug_get($detail_path); + } + + if (defined($detail{message})) { + $msg .= __x("augeas error for {file}: {error}", + file => $file, + error => $detail{message})."\n"; + } else { + $msg .= __x("augeas error for {file}", + file => $file)."\n"; +...
2010 Feb 09
5
[PATCH 1/6] Convert config file to XML, and translate networks/bridge for all connections
...) { - if($directive =~ /^bridge\.(.*)$/) { - $bridges{$1} = $config->{$directive}; - } - - elsif($directive =~ /^network\.(.*)$/) { - $networks{$1} = $config->{$directive}; - } - - else { - die(__x("WARNING: unknown configuration directive ". - "{directive} in {name} section.", - directive => $directive, name => 'libvirtxml')); - } - } - } - $self->_get_dom($path); # No transfer...
2011 Jan 26
1
[PATCH] Display verbose error message when guest storage isn't found
....pm index 628074c..9db9f60 100644 --- a/lib/Sys/VirtV2V/Connection/LibVirtSource.pm +++ b/lib/Sys/VirtV2V/Connection/LibVirtSource.pm @@ -130,10 +130,29 @@ sub get_volume eval { $vol = $self->{vmm}->get_storage_volume_by_path($path); }; - die(user_message(__x("Failed to retrieve storage volume {path}:". - "{error}", - path => $path, - error => $@->stringify()))) if($@); + if ($@->code == Sys::Virt::Error->ERR_NO_STORAGE_VOL) { +...