Re: struct_cpy() and kAFS (was: Re: Linux 2.6.8-rc1)

Andrew Morton
2004-07-12T18:12:47Z

Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>
> On Sun, 11 Jul 2004, Linus Torvalds wrote:
> > David Howells:
> > o kAFS automount support
>
> After this change, all archs need to provide struct_cpy() to make AFS compile,
> while currently only ia32 and amd64 provide it.

Seems a strange thing to do. Why not rely on the type system?

diff -puN fs/afs/mntpt.c~kafs-struct_cpy fs/afs/mntpt.c
--- 25/fs/afs/mntpt.c~kafs-struct_cpy 2004-07-12 11:08:39.125941824 -0700
+++ 25-akpm/fs/afs/mntpt.c 2004-07-12 11:08:55.972380776 -0700
@@ -250,7 +250,7 @@ static int afs_mntpt_follow_link(struct
if (IS_ERR(newmnt))
return PTR_ERR(newmnt);

- struct_cpy(&newnd, nd);
+ newnd = *nd;
newnd.dentry = dentry;
err = do_add_mount(newmnt, &newnd, 0, &afs_vfsmounts);

diff -puN fs/afs/vlocation.c~kafs-struct_cpy fs/afs/vlocation.c
--- 25/fs/afs/vlocation.c~kafs-struct_cpy 2004-07-12 11:08:39.141939392 -0700
+++ 25-akpm/fs/afs/vlocation.c 2004-07-12 11:09:31.815931728 -0700
@@ -906,7 +906,7 @@ static cachefs_match_val_t afs_vlocation
if (!vlocation->valid ||
vlocation->vldb.rtime == vldb->rtime
) {
- struct_cpy(&vlocation->vldb, vldb);
+ vlocation->vldb = *vldb;
vlocation->valid = 1;
_leave(" = SUCCESS [c->m]");
return CACHEFS_MATCH_SUCCESS;
@@ -947,7 +947,7 @@ static void afs_vlocation_cache_update(v

_enter("");

- struct_cpy(vldb,&vlocation->vldb);
+ *vldb = vlocation->vldb;

} /* end afs_vlocation_cache_update() */
#endif
_