RE: [PATCH] fs.h: introduce functions to get/set file->private_data

H Hartley Sweeten
2010-08-16T23:36:22Z

On Monday, August 16, 2010 4:18 PM, Christoph Hellwig wrote:
> On Mon, Aug 16, 2010 at 11:37:52AM -0700, H Hartley Sweeten wrote:
>> The symbol 'private_data' is commonly used and makes grep'ing for
>> specific uses difficult. Introduce the wrapper functions file_get_privdata
>> and file_set_privdata to help with the struct file uses.
>
> This just obsfucates the code, NAK.

Not a problem.

It's just a pain trying to figure out where the file 'private_data' is being
used.

$ git grep private_data | wc -w
37272
$ git grep private_data include | wc -w
1068

The following struct's all have a 'void *private_data' symbol in include/linux:

struct ac97_codec
struct c2port_device
struct file
struct gendisk
struct ata_host
struct ata_queued_cmd
struct ata_device
struct ata_port
struct ata_port_info
struct parport
struct rchan
struct rtc_task
struct plat_serial8250_port
struct uart_port

include/rdma and include/sound also have a number.

Thanks for the reply.

Regards,
Hartley