Re: max_fd

From: Dipankar Sarma
Date: Fri Sep 23 2005 - 11:01:31 EST


On Fri, Sep 23, 2005 at 02:37:51PM +0200, Pablo Fernandez wrote:
> Hi
>
> What happend to files_struct.max_fd? Is it safe to use
> files_fdtable(files_struct).max_fds?

No.

Just do -

struct fdtable *fdt;

rcu_read_lock();
fdt = files_fdtable(files_struct);
if (fdt->max_fds......
...
rcu_read_unlock();


If you are updating the fd table, then acuire the file_lock
instead of rcu_read_lock/unlock.

Thanks
Dipankar
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/