Re: [RFC] why define "static int btrfs_csum_sizes[]" in a header file (ctree.h) ?

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

 



On Thu, Aug 12, 2010 at 08:46:54AM +0800, Cheng Renquan wrote:
> commit 607d432d referred a static int array defined in a header file,
> and a static inline function (btrfs_super_csum_size) using this array,
> the obvious result is every c file using that function would have
> a local copy of that int array, multiple c files referred multiple copies
> of that array:
> 
> $ nm fs/btrfs/btrfs.ko | grep btrfs_csum_sizes
> 0000010c r btrfs_csum_sizes
> 00000114 r btrfs_csum_sizes
> 000001c0 r btrfs_csum_sizes
> 000005a0 r btrfs_csum_sizes
> 
> the original commit has 4 c files called this static inline function, so
> till now there are still those 4 c files calling it, so there are 4 copies
> of btrfs_csum_sizes; but future code may call it in more c files;

Wow thats not my best work.  Change whatever you like, I think I'd rather just
not use a static array, but nothing better comes to mind atm, maybe a big switch
statement.  Thanks,

Josef
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux