Re: Update of file offset on write() etc. is non-atomic with I/O

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>  struct fd {
>  	struct file *file;
> -	int need_put;
> +	unsigned need_put:1, need_pos_unlock:1;
>  };

Since we're rounding up to 2*sizeof(struct file *) anyway, is this a case
where wasting space on a couple of char (or bool) flags would generate
better code than a bitfield?

In particular, the code to set need_pos_unlock (which will be executed
each read/write for most files) is messy in the bitfield case.
A byte store is much cleaner.

(If you want to use bits, why not use the two lsbits of the file pointer
for the purpose?  That would save a lot of space.)
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux