lkml.org 
[lkml]   [2008]   [Apr]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [2.6.26 PATCH, RESEND]: fs_stack/eCryptfs: fsstack_copy_* updates
In message <20080430101704.9cbd6384.akpm@linux-foundation.org>, Andrew Morton writes:
> On Mon, 21 Apr 2008 02:50:42 -0400
> Erez Zadok <ezk@cs.sunysb.edu> wrote:
[...]
> Can we avoid having to think?
>
> void fsstack_copy_inode_size(struct inode *dst, const struct inode *src)
> {
> blkcnt_t i_blocks;
> loff_t i_size;
>
> i_size = i_size_read(src);
> spin_lock_32bit(&src->i_lock);
> i_blocks = src->i_blocks;
> spin_unlock_32bit(&src->i_lock);
>
> i_size_write(dst, i_size);
> spin_lock_32bit(&dst->i_lock)
> dst->i_blocks = i_blocks;
> spin_unlock_32bit(&dst->i_lock)
> }

Thanks. I can't say that I'm an expert in these SMP issues. But I'll run
your rewritten function through my 32 and 64-bit SMP and non-SMP systems,
and see how it behaves.

Erez.


\
 
 \ /
  Last update: 2008-04-30 23:13    [W:0.086 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site