Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fs/fscache/object-list.c: use __seq_open_private()

Reduce boilerplate code by using __seq_open_private() instead of seq_open()
in fscache_objlist_open().

Signed-off-by: Rob Jones <rob.jones@codethink.co.uk>
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Steve Dickson <steved@redhat.com>

authored by

Rob Jones and committed by
David Howells
d5d96226 a30efe26

+2 -14
+2 -14
fs/fscache/object-list.c
··· 380 380 static int fscache_objlist_open(struct inode *inode, struct file *file) 381 381 { 382 382 struct fscache_objlist_data *data; 383 - struct seq_file *m; 384 - int ret; 385 383 386 - ret = seq_open(file, &fscache_objlist_ops); 387 - if (ret < 0) 388 - return ret; 389 - 390 - m = file->private_data; 391 - 392 - /* buffer for key extraction */ 393 - data = kmalloc(sizeof(struct fscache_objlist_data), GFP_KERNEL); 394 - if (!data) { 395 - seq_release(inode, file); 384 + data = __seq_open_private(file, &fscache_objlist_ops, sizeof(*data)); 385 + if (!data) 396 386 return -ENOMEM; 397 - } 398 387 399 388 /* get the configuration key */ 400 389 fscache_objlist_config(data); 401 390 402 - m->private = data; 403 391 return 0; 404 392 } 405 393