debug.c (6f10f7d1b02b1bbc305f88d7696445dd38b13881) | debug.c (1fae7cf05293d3a2c9e59c1bc59372322386467c) |
---|---|
1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Assorted bcache debug code 4 * 5 * Copyright 2010, 2011 Kent Overstreet <kent.overstreet@gmail.com> 6 * Copyright 2012 Google, Inc. 7 */ 8 --- 163 unchanged lines hidden (view full) --- 172{ 173 struct dump_iterator *i = file->private_data; 174 ssize_t ret = 0; 175 char kbuf[80]; 176 177 while (size) { 178 struct keybuf_key *w; 179 unsigned int bytes = min(i->bytes, size); | 1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Assorted bcache debug code 4 * 5 * Copyright 2010, 2011 Kent Overstreet <kent.overstreet@gmail.com> 6 * Copyright 2012 Google, Inc. 7 */ 8 --- 163 unchanged lines hidden (view full) --- 172{ 173 struct dump_iterator *i = file->private_data; 174 ssize_t ret = 0; 175 char kbuf[80]; 176 177 while (size) { 178 struct keybuf_key *w; 179 unsigned int bytes = min(i->bytes, size); |
180 | |
181 int err = copy_to_user(buf, i->buf, bytes); | 180 int err = copy_to_user(buf, i->buf, bytes); |
181 |
|
182 if (err) 183 return err; 184 185 ret += bytes; 186 buf += bytes; 187 size -= bytes; 188 i->bytes -= bytes; 189 memmove(i->buf, i->buf + bytes, i->bytes); --- 42 unchanged lines hidden (view full) --- 232 .read = bch_dump_read, 233 .release = bch_dump_release 234}; 235 236void bch_debug_init_cache_set(struct cache_set *c) 237{ 238 if (!IS_ERR_OR_NULL(bcache_debug)) { 239 char name[50]; | 182 if (err) 183 return err; 184 185 ret += bytes; 186 buf += bytes; 187 size -= bytes; 188 i->bytes -= bytes; 189 memmove(i->buf, i->buf + bytes, i->bytes); --- 42 unchanged lines hidden (view full) --- 232 .read = bch_dump_read, 233 .release = bch_dump_release 234}; 235 236void bch_debug_init_cache_set(struct cache_set *c) 237{ 238 if (!IS_ERR_OR_NULL(bcache_debug)) { 239 char name[50]; |
240 snprintf(name, 50, "bcache-%pU", c->sb.set_uuid); | |
241 | 240 |
241 snprintf(name, 50, "bcache-%pU", c->sb.set_uuid); |
|
242 c->debug = debugfs_create_file(name, 0400, bcache_debug, c, 243 &cache_set_debug_ops); 244 } 245} 246 247#endif 248 249void bch_debug_exit(void) --- 14 unchanged lines hidden --- | 242 c->debug = debugfs_create_file(name, 0400, bcache_debug, c, 243 &cache_set_debug_ops); 244 } 245} 246 247#endif 248 249void bch_debug_exit(void) --- 14 unchanged lines hidden --- |