SUNRPC: rpc_create() default hostname should support AF_INET6 addresses
[powerpc.git] / net / sunrpc / cache.c
index ebe344f..73f053d 100644 (file)
@@ -1127,6 +1127,7 @@ struct handle {
 };
 
 static void *c_start(struct seq_file *m, loff_t *pos)
+       __acquires(cd->hash_lock)
 {
        loff_t n = *pos;
        unsigned hash, entry;
@@ -1183,6 +1184,7 @@ static void *c_next(struct seq_file *m, void *p, loff_t *pos)
 }
 
 static void c_stop(struct seq_file *m, void *p)
+       __releases(cd->hash_lock)
 {
        struct cache_detail *cd = ((struct handle*)m->private)->cd;
        read_unlock(&cd->hash_lock);
@@ -1218,23 +1220,15 @@ static const struct seq_operations cache_content_op = {
 
 static int content_open(struct inode *inode, struct file *file)
 {
-       int res;
        struct handle *han;
        struct cache_detail *cd = PDE(inode)->data;
 
-       han = kmalloc(sizeof(*han), GFP_KERNEL);
+       han = __seq_open_private(file, &cache_content_op, sizeof(*han));
        if (han == NULL)
                return -ENOMEM;
 
        han->cd = cd;
-
-       res = seq_open(file, &cache_content_op);
-       if (res)
-               kfree(han);
-       else
-               ((struct seq_file *)file->private_data)->private = han;
-
-       return res;
+       return 0;
 }
 
 static const struct file_operations content_file_operations = {