mirror of
https://github.com/systemd/systemd
synced 2025-09-26 23:34:44 +02:00
Compare commits
2 Commits
5bb20fd3d3
...
258190a0d5
Author | SHA1 | Date | |
---|---|---|---|
![]() |
258190a0d5 | ||
![]() |
52fc66635d |
@ -1505,6 +1505,20 @@ evdev:atkbd:dmi:bvn*:bvr*:bd*:svn[sS][aA][mM][sS][uU][nN][gG]*:pn*300E[457]*:*
|
|||||||
evdev:atkbd:dmi:bvn*:bvr*:bd*:svn[sS][aA][mM][sS][uU][nN][gG]*:pn*200E[45]*:*
|
evdev:atkbd:dmi:bvn*:bvr*:bd*:svn[sS][aA][mM][sS][uU][nN][gG]*:pn*200E[45]*:*
|
||||||
KEYBOARD_KEY_ce=! # Fn+F1 launch control setting
|
KEYBOARD_KEY_ce=! # Fn+F1 launch control setting
|
||||||
|
|
||||||
|
evdev:atkbd:dmi:bvn*:bvr*:bd*:svn[sS][aA][mM][sS][uU][nN][gG]*:pn*356V[45]*:pvr*
|
||||||
|
evdev:atkbd:dmi:bvn*:bvr*:bd*:svn[sS][aA][mM][sS][uU][nN][gG]*:pn*355V[45]*:pvr*
|
||||||
|
KEYBOARD_KEY_ce=!prog1 # Fn+F1 launch control setting
|
||||||
|
KEYBOARD_KEY_89=!brightnessdown # Fn+F2 brightness down
|
||||||
|
KEYBOARD_KEY_88=!brightnessup # Fn+F3 brightness up
|
||||||
|
KEYBOARD_KEY_82=!switchvideomode # Fn+F4 display toggle
|
||||||
|
KEYBOARD_KEY_f7=!f22 # Fn+F5 touchpad on
|
||||||
|
KEYBOARD_KEY_f9=!f23 # Fn+F5 touchpad off
|
||||||
|
KEYBOARD_KEY_a0=!mute # Fn+F6 mute
|
||||||
|
KEYBOARD_KEY_ae=!volumedown # Fn+F7 volume down
|
||||||
|
KEYBOARD_KEY_b0=!volumeup # Fn+F8 volume up
|
||||||
|
KEYBOARD_KEY_b3=!prog2 # Fn+F11 toggle fan/cool mode
|
||||||
|
KEYBOARD_KEY_d5=!wlan # Fn+F12 toggle wifi
|
||||||
|
|
||||||
# Series 5
|
# Series 5
|
||||||
evdev:atkbd:dmi:bvn*:bvr*:bd*:svn[sS][aA][mM][sS][uU][nN][gG]*:pn*530U*:*
|
evdev:atkbd:dmi:bvn*:bvr*:bd*:svn[sS][aA][mM][sS][uU][nN][gG]*:pn*530U*:*
|
||||||
KEYBOARD_KEY_ce=!prog1 # Fn+F1 launch settings
|
KEYBOARD_KEY_ce=!prog1 # Fn+F1 launch settings
|
||||||
|
@ -724,8 +724,7 @@ static int journal_file_move_to(
|
|||||||
bool keep_always,
|
bool keep_always,
|
||||||
uint64_t offset,
|
uint64_t offset,
|
||||||
uint64_t size,
|
uint64_t size,
|
||||||
void **ret,
|
void **ret) {
|
||||||
size_t *ret_size) {
|
|
||||||
|
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
@ -751,7 +750,7 @@ static int journal_file_move_to(
|
|||||||
return -EADDRNOTAVAIL;
|
return -EADDRNOTAVAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return mmap_cache_get(f->mmap, f->cache_fd, type_to_context(type), keep_always, offset, size, &f->last_stat, ret, ret_size);
|
return mmap_cache_get(f->mmap, f->cache_fd, type_to_context(type), keep_always, offset, size, &f->last_stat, ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint64_t minimum_header_size(Object *o) {
|
static uint64_t minimum_header_size(Object *o) {
|
||||||
@ -923,7 +922,6 @@ static int journal_file_check_object(JournalFile *f, uint64_t offset, Object *o)
|
|||||||
int journal_file_move_to_object(JournalFile *f, ObjectType type, uint64_t offset, Object **ret) {
|
int journal_file_move_to_object(JournalFile *f, ObjectType type, uint64_t offset, Object **ret) {
|
||||||
int r;
|
int r;
|
||||||
void *t;
|
void *t;
|
||||||
size_t tsize;
|
|
||||||
Object *o;
|
Object *o;
|
||||||
uint64_t s;
|
uint64_t s;
|
||||||
|
|
||||||
@ -942,7 +940,7 @@ int journal_file_move_to_object(JournalFile *f, ObjectType type, uint64_t offset
|
|||||||
"Attempt to move to object located in file header: %" PRIu64,
|
"Attempt to move to object located in file header: %" PRIu64,
|
||||||
offset);
|
offset);
|
||||||
|
|
||||||
r = journal_file_move_to(f, type, false, offset, sizeof(ObjectHeader), &t, &tsize);
|
r = journal_file_move_to(f, type, false, offset, sizeof(ObjectHeader), &t);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
@ -973,13 +971,11 @@ int journal_file_move_to_object(JournalFile *f, ObjectType type, uint64_t offset
|
|||||||
"Attempt to move to object of unexpected type: %" PRIu64,
|
"Attempt to move to object of unexpected type: %" PRIu64,
|
||||||
offset);
|
offset);
|
||||||
|
|
||||||
if (s > tsize) {
|
r = journal_file_move_to(f, type, false, offset, s, &t);
|
||||||
r = journal_file_move_to(f, type, false, offset, s, &t, NULL);
|
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
o = (Object*) t;
|
o = (Object*) t;
|
||||||
}
|
|
||||||
|
|
||||||
r = journal_file_check_object(f, offset, o);
|
r = journal_file_check_object(f, offset, o);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
@ -1062,7 +1058,7 @@ int journal_file_append_object(
|
|||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
r = journal_file_move_to(f, type, false, p, size, &t, NULL);
|
r = journal_file_move_to(f, type, false, p, size, &t);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
@ -1165,7 +1161,7 @@ int journal_file_map_data_hash_table(JournalFile *f) {
|
|||||||
OBJECT_DATA_HASH_TABLE,
|
OBJECT_DATA_HASH_TABLE,
|
||||||
true,
|
true,
|
||||||
p, s,
|
p, s,
|
||||||
&t, NULL);
|
&t);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
@ -1191,7 +1187,7 @@ int journal_file_map_field_hash_table(JournalFile *f) {
|
|||||||
OBJECT_FIELD_HASH_TABLE,
|
OBJECT_FIELD_HASH_TABLE,
|
||||||
true,
|
true,
|
||||||
p, s,
|
p, s,
|
||||||
&t, NULL);
|
&t);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
@ -3510,7 +3506,7 @@ int journal_file_open(
|
|||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
r = mmap_cache_get(f->mmap, f->cache_fd, CONTEXT_HEADER, true, 0, PAGE_ALIGN(sizeof(Header)), &f->last_stat, &h, NULL);
|
r = mmap_cache_get(f->mmap, f->cache_fd, CONTEXT_HEADER, true, 0, PAGE_ALIGN(sizeof(Header)), &f->last_stat, &h);
|
||||||
if (r == -EINVAL) {
|
if (r == -EINVAL) {
|
||||||
/* Some file systems (jffs2 or p9fs) don't support mmap() properly (or only read-only
|
/* Some file systems (jffs2 or p9fs) don't support mmap() properly (or only read-only
|
||||||
* mmap()), and return EINVAL in that case. Let's propagate that as a more recognizable error
|
* mmap()), and return EINVAL in that case. Let's propagate that as a more recognizable error
|
||||||
|
@ -377,7 +377,7 @@ static int contains_uint64(MMapCache *m, MMapFileDescriptor *f, uint64_t n, uint
|
|||||||
|
|
||||||
c = (a + b) / 2;
|
c = (a + b) / 2;
|
||||||
|
|
||||||
r = mmap_cache_get(m, f, 0, false, c * sizeof(uint64_t), sizeof(uint64_t), NULL, (void **) &z, NULL);
|
r = mmap_cache_get(m, f, 0, false, c * sizeof(uint64_t), sizeof(uint64_t), NULL, (void **) &z);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
|
@ -306,8 +306,7 @@ static int try_context(
|
|||||||
bool keep_always,
|
bool keep_always,
|
||||||
uint64_t offset,
|
uint64_t offset,
|
||||||
size_t size,
|
size_t size,
|
||||||
void **ret,
|
void **ret) {
|
||||||
size_t *ret_size) {
|
|
||||||
|
|
||||||
Context *c;
|
Context *c;
|
||||||
|
|
||||||
@ -339,8 +338,6 @@ static int try_context(
|
|||||||
c->window->keep_always = c->window->keep_always || keep_always;
|
c->window->keep_always = c->window->keep_always || keep_always;
|
||||||
|
|
||||||
*ret = (uint8_t*) c->window->ptr + (offset - c->window->offset);
|
*ret = (uint8_t*) c->window->ptr + (offset - c->window->offset);
|
||||||
if (ret_size)
|
|
||||||
*ret_size = c->window->size - (offset - c->window->offset);
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -352,8 +349,7 @@ static int find_mmap(
|
|||||||
bool keep_always,
|
bool keep_always,
|
||||||
uint64_t offset,
|
uint64_t offset,
|
||||||
size_t size,
|
size_t size,
|
||||||
void **ret,
|
void **ret) {
|
||||||
size_t *ret_size) {
|
|
||||||
|
|
||||||
Window *w;
|
Window *w;
|
||||||
Context *c;
|
Context *c;
|
||||||
@ -381,8 +377,6 @@ static int find_mmap(
|
|||||||
w->keep_always = w->keep_always || keep_always;
|
w->keep_always = w->keep_always || keep_always;
|
||||||
|
|
||||||
*ret = (uint8_t*) w->ptr + (offset - w->offset);
|
*ret = (uint8_t*) w->ptr + (offset - w->offset);
|
||||||
if (ret_size)
|
|
||||||
*ret_size = w->size - (offset - w->offset);
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -422,8 +416,7 @@ static int add_mmap(
|
|||||||
uint64_t offset,
|
uint64_t offset,
|
||||||
size_t size,
|
size_t size,
|
||||||
struct stat *st,
|
struct stat *st,
|
||||||
void **ret,
|
void **ret) {
|
||||||
size_t *ret_size) {
|
|
||||||
|
|
||||||
uint64_t woffset, wsize;
|
uint64_t woffset, wsize;
|
||||||
Context *c;
|
Context *c;
|
||||||
@ -481,8 +474,6 @@ static int add_mmap(
|
|||||||
context_attach_window(c, w);
|
context_attach_window(c, w);
|
||||||
|
|
||||||
*ret = (uint8_t*) w->ptr + (offset - w->offset);
|
*ret = (uint8_t*) w->ptr + (offset - w->offset);
|
||||||
if (ret_size)
|
|
||||||
*ret_size = w->size - (offset - w->offset);
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
@ -499,8 +490,7 @@ int mmap_cache_get(
|
|||||||
uint64_t offset,
|
uint64_t offset,
|
||||||
size_t size,
|
size_t size,
|
||||||
struct stat *st,
|
struct stat *st,
|
||||||
void **ret,
|
void **ret) {
|
||||||
size_t *ret_size) {
|
|
||||||
|
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
@ -512,14 +502,14 @@ int mmap_cache_get(
|
|||||||
assert(context < MMAP_CACHE_MAX_CONTEXTS);
|
assert(context < MMAP_CACHE_MAX_CONTEXTS);
|
||||||
|
|
||||||
/* Check whether the current context is the right one already */
|
/* Check whether the current context is the right one already */
|
||||||
r = try_context(m, f, context, keep_always, offset, size, ret, ret_size);
|
r = try_context(m, f, context, keep_always, offset, size, ret);
|
||||||
if (r != 0) {
|
if (r != 0) {
|
||||||
m->n_context_cache_hit++;
|
m->n_context_cache_hit++;
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Search for a matching mmap */
|
/* Search for a matching mmap */
|
||||||
r = find_mmap(m, f, context, keep_always, offset, size, ret, ret_size);
|
r = find_mmap(m, f, context, keep_always, offset, size, ret);
|
||||||
if (r != 0) {
|
if (r != 0) {
|
||||||
m->n_window_list_hit++;
|
m->n_window_list_hit++;
|
||||||
return r;
|
return r;
|
||||||
@ -528,7 +518,7 @@ int mmap_cache_get(
|
|||||||
m->n_missed++;
|
m->n_missed++;
|
||||||
|
|
||||||
/* Create a new mmap */
|
/* Create a new mmap */
|
||||||
return add_mmap(m, f, context, keep_always, offset, size, st, ret, ret_size);
|
return add_mmap(m, f, context, keep_always, offset, size, st, ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
void mmap_cache_stats_log_debug(MMapCache *m) {
|
void mmap_cache_stats_log_debug(MMapCache *m) {
|
||||||
|
@ -22,8 +22,7 @@ int mmap_cache_get(
|
|||||||
uint64_t offset,
|
uint64_t offset,
|
||||||
size_t size,
|
size_t size,
|
||||||
struct stat *st,
|
struct stat *st,
|
||||||
void **ret,
|
void **ret);
|
||||||
size_t *ret_size);
|
|
||||||
MMapFileDescriptor * mmap_cache_add_fd(MMapCache *m, int fd, int prot);
|
MMapFileDescriptor * mmap_cache_add_fd(MMapCache *m, int fd, int prot);
|
||||||
void mmap_cache_free_fd(MMapCache *m, MMapFileDescriptor *f);
|
void mmap_cache_free_fd(MMapCache *m, MMapFileDescriptor *f);
|
||||||
|
|
||||||
|
@ -34,23 +34,23 @@ int main(int argc, char *argv[]) {
|
|||||||
assert_se(z >= 0);
|
assert_se(z >= 0);
|
||||||
unlink(pz);
|
unlink(pz);
|
||||||
|
|
||||||
r = mmap_cache_get(m, fx, 0, false, 1, 2, NULL, &p, NULL);
|
r = mmap_cache_get(m, fx, 0, false, 1, 2, NULL, &p);
|
||||||
assert_se(r >= 0);
|
assert_se(r >= 0);
|
||||||
|
|
||||||
r = mmap_cache_get(m, fx, 0, false, 2, 2, NULL, &q, NULL);
|
r = mmap_cache_get(m, fx, 0, false, 2, 2, NULL, &q);
|
||||||
assert_se(r >= 0);
|
assert_se(r >= 0);
|
||||||
|
|
||||||
assert_se((uint8_t*) p + 1 == (uint8_t*) q);
|
assert_se((uint8_t*) p + 1 == (uint8_t*) q);
|
||||||
|
|
||||||
r = mmap_cache_get(m, fx, 1, false, 3, 2, NULL, &q, NULL);
|
r = mmap_cache_get(m, fx, 1, false, 3, 2, NULL, &q);
|
||||||
assert_se(r >= 0);
|
assert_se(r >= 0);
|
||||||
|
|
||||||
assert_se((uint8_t*) p + 2 == (uint8_t*) q);
|
assert_se((uint8_t*) p + 2 == (uint8_t*) q);
|
||||||
|
|
||||||
r = mmap_cache_get(m, fx, 0, false, 16ULL*1024ULL*1024ULL, 2, NULL, &p, NULL);
|
r = mmap_cache_get(m, fx, 0, false, 16ULL*1024ULL*1024ULL, 2, NULL, &p);
|
||||||
assert_se(r >= 0);
|
assert_se(r >= 0);
|
||||||
|
|
||||||
r = mmap_cache_get(m, fx, 1, false, 16ULL*1024ULL*1024ULL+1, 2, NULL, &q, NULL);
|
r = mmap_cache_get(m, fx, 1, false, 16ULL*1024ULL*1024ULL+1, 2, NULL, &q);
|
||||||
assert_se(r >= 0);
|
assert_se(r >= 0);
|
||||||
|
|
||||||
assert_se((uint8_t*) p + 1 == (uint8_t*) q);
|
assert_se((uint8_t*) p + 1 == (uint8_t*) q);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user