* linux-next: manual merge of the bkl-llseek tree with the infiniband tree
@ 2010-10-13 3:32 Stephen Rothwell
0 siblings, 0 replies; 3+ messages in thread
From: Stephen Rothwell @ 2010-10-13 3:32 UTC (permalink / raw)
To: Arnd Bergmann
Cc: linux-next-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Steve Wise, Roland Dreier,
linux-rdma-u79uwXL29TY76Z2rM5mHXA
[-- Attachment #1: Type: text/plain, Size: 633 bytes --]
Hi Arnd,
Today's linux-next merge of the bkl-llseek tree got a conflict in
drivers/infiniband/hw/cxgb4/device.c between commit
8bbac892fb75d20fa274ca026e24faf00afbf9dd ("RDMA/cxgb4: Add default_llseek
to debugfs files") from the infiniband tree and commit
9711569d06e7df5f02a943fc4138fb152526e719 ("llseek: automatically
add .llseek fop") from the bkl-llseek tree.
Not really a conflict. The infiniband tree patch is a superset of the
part of the bkl-llseek commit that affects this file.
--
Cheers,
Stephen Rothwell sfr-3FnU+UHB4dNDw9hX6IcOSA@public.gmane.org
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: linux-next: manual merge of the bkl-llseek tree with the infiniband tree
2010-09-29 3:20 Stephen Rothwell
@ 2010-09-29 11:59 ` Arnd Bergmann
0 siblings, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2010-09-29 11:59 UTC (permalink / raw)
To: Stephen Rothwell
Cc: linux-next, linux-kernel, Steve Wise, Roland Dreier, linux-rdma
On Wednesday 29 September 2010, Stephen Rothwell wrote:
> Today's linux-next merge of the bkl-llseek tree got a conflict in
> drivers/infiniband/hw/cxgb4/device.c between commit
> 9e8d1fa3420f489da8a5da47c026511aa71fa50b ("RDMA/cxgb4: debugfs files for
> dumping active stags") from the infiniband tree and commit
> 9711569d06e7df5f02a943fc4138fb152526e719 ("llseek: automatically
> add .llseek fop") from the bkl-llseek tree.
>
> The former added a whole new file_operations (and changed some
> context) ... I fixed it up (see below) and can carry the fix as necessary.
Looks fine, thanks!
Steve, Roland:
Would you mind adding an appropriate .llseek method to your file operations
so I can drop the change from my tree?
The default_llseek function is used because the read function can currently
be seeked, but I do not know whether that is intentional. If you don't want
to seek, just make open() call nonseekable_open() and set .llseek to no_llseek.
Arnd
^ permalink raw reply [flat|nested] 3+ messages in thread
* linux-next: manual merge of the bkl-llseek tree with the infiniband tree
@ 2010-09-29 3:20 Stephen Rothwell
2010-09-29 11:59 ` Arnd Bergmann
0 siblings, 1 reply; 3+ messages in thread
From: Stephen Rothwell @ 2010-09-29 3:20 UTC (permalink / raw)
To: Arnd Bergmann
Cc: linux-next, linux-kernel, Steve Wise, Roland Dreier, linux-rdma
Hi Arnd,
Today's linux-next merge of the bkl-llseek tree got a conflict in
drivers/infiniband/hw/cxgb4/device.c between commit
9e8d1fa3420f489da8a5da47c026511aa71fa50b ("RDMA/cxgb4: debugfs files for
dumping active stags") from the infiniband tree and commit
9711569d06e7df5f02a943fc4138fb152526e719 ("llseek: automatically
add .llseek fop") from the bkl-llseek tree.
The former added a whole new file_operations (and changed some
context) ... I fixed it up (see below) and can carry the fix as necessary.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --cc drivers/infiniband/hw/cxgb4/device.c
index 986cfd7,a72ae12..0000000
--- a/drivers/infiniband/hw/cxgb4/device.c
+++ b/drivers/infiniband/hw/cxgb4/device.c
@@@ -177,84 -149,44 +177,86 @@@ out
return ret;
}
-static ssize_t qp_read(struct file *file, char __user *buf, size_t count,
- loff_t *ppos)
+static const struct file_operations qp_debugfs_fops = {
+ .owner = THIS_MODULE,
+ .open = qp_open,
+ .release = qp_release,
+ .read = debugfs_read,
++ .llseek = default_llseek,
+};
+
+static int dump_stag(int id, void *p, void *data)
{
- struct debugfs_qp_data *qpd = file->private_data;
- loff_t pos = *ppos;
- loff_t avail = qpd->pos;
+ struct c4iw_debugfs_data *stagd = data;
+ int space;
+ int cc;
- if (pos < 0)
- return -EINVAL;
- if (pos >= avail)
+ space = stagd->bufsize - stagd->pos - 1;
+ if (space == 0)
+ return 1;
+
+ cc = snprintf(stagd->buf + stagd->pos, space, "0x%x\n", id<<8);
+ if (cc < space)
+ stagd->pos += cc;
+ return 0;
+}
+
+static int stag_release(struct inode *inode, struct file *file)
+{
+ struct c4iw_debugfs_data *stagd = file->private_data;
+ if (!stagd) {
+ printk(KERN_INFO "%s null stagd?\n", __func__);
return 0;
- if (count > avail - pos)
- count = avail - pos;
+ }
+ kfree(stagd->buf);
+ kfree(stagd);
+ return 0;
+}
- while (count) {
- size_t len = 0;
+static int stag_open(struct inode *inode, struct file *file)
+{
+ struct c4iw_debugfs_data *stagd;
+ int ret = 0;
+ int count = 1;
- len = min((int)count, (int)qpd->pos - (int)pos);
- if (copy_to_user(buf, qpd->buf + pos, len))
- return -EFAULT;
- if (len == 0)
- return -EINVAL;
+ stagd = kmalloc(sizeof *stagd, GFP_KERNEL);
+ if (!stagd) {
+ ret = -ENOMEM;
+ goto out;
+ }
+ stagd->devp = inode->i_private;
+ stagd->pos = 0;
- buf += len;
- pos += len;
- count -= len;
+ spin_lock_irq(&stagd->devp->lock);
+ idr_for_each(&stagd->devp->mmidr, count_idrs, &count);
+ spin_unlock_irq(&stagd->devp->lock);
+
+ stagd->bufsize = count * sizeof("0x12345678\n");
+ stagd->buf = kmalloc(stagd->bufsize, GFP_KERNEL);
+ if (!stagd->buf) {
+ ret = -ENOMEM;
+ goto err1;
}
- count = pos - *ppos;
- *ppos = pos;
- return count;
+
+ spin_lock_irq(&stagd->devp->lock);
+ idr_for_each(&stagd->devp->mmidr, dump_stag, stagd);
+ spin_unlock_irq(&stagd->devp->lock);
+
+ stagd->buf[stagd->pos++] = 0;
+ file->private_data = stagd;
+ goto out;
+err1:
+ kfree(stagd);
+out:
+ return ret;
}
-static const struct file_operations qp_debugfs_fops = {
+static const struct file_operations stag_debugfs_fops = {
.owner = THIS_MODULE,
- .open = qp_open,
- .release = qp_release,
- .read = qp_read,
+ .open = stag_open,
+ .release = stag_release,
+ .read = debugfs_read,
+ .llseek = default_llseek,
};
static int setup_debugfs(struct c4iw_dev *devp)
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-10-13 3:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-13 3:32 linux-next: manual merge of the bkl-llseek tree with the infiniband tree Stephen Rothwell
-- strict thread matches above, loose matches on Subject: below --
2010-09-29 3:20 Stephen Rothwell
2010-09-29 11:59 ` Arnd Bergmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).