Displaying 2 results from an estimated 2 matches for "record_length".
2009 Nov 07
1
Fwd: [PATCH (geoip)] use IO.pread from the io-extra lib if possible
...the GeoIP.dat file
# +options+ is an integer holding caching flags (unimplemented)
def initialize(filename, flags = 0)
- @mutex = Mutex.new
+ @mutex = IO.respond_to?(:pread) ? false : Mutex.new
@flags = flags
@databaseType = GEOIP_COUNTRY_EDITION
@record_length = STANDARD_RECORD_LENGTH
@@ -530,11 +535,9 @@ class GeoIP
private
def read_city(pos, hostname = '''', ip = '''')
- record = ""
- @mutex.synchronize {
- @file.seek(pos + (2*@record_length-1) * @databaseSegments[0])
-...
2010 Aug 20
0
[PATCH 1/2] Implement APEI ERST feature to Xen
...ST_RANGE_NVRAM) {
+ if (!spin_trylock_irqsave(&erst_lock, flags))
+ return -EBUSY;
+ rc = __erst_write_to_nvram(record);
+ spin_unlock_irqrestore(&erst_lock, flags);
+ return rc;
+ }
+
+ if (record->record_length > erst_erange.size)
+ return -EINVAL;
+
+ if (!spin_trylock_irqsave(&erst_lock, flags))
+ return -EBUSY;
+ memcpy(erst_erange.vaddr, record, record->record_length);
+ rcd_erange = erst_erange.vaddr;
+ /* signature for serialization syste...