From: Jaegeuk Kim Subject: Re: [PATCH] f2fs: add compat_ioctl to provide backward compatability Date: Tue, 05 Feb 2013 16:12:56 +0900 Message-ID: <1360048376.26950.34.camel@kjgkr> References: <1359988901-7384-1-git-send-email-linkinjeon@gmail.com> <1360046719.26950.26.camel@kjgkr> Reply-To: jaegeuk.kim@samsung.com Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-qISzmLpL4A7FDB+xA2sf" Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, Namjae Jeon , Amit Sahrawat To: Namjae Jeon Return-path: In-reply-to: Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org --=-qISzmLpL4A7FDB+xA2sf Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 2013-02-05 (=ED=99=94), 16:02 +0900, Namjae Jeon: > 2013/2/5, Jaegeuk Kim : > > Hi, > > > > 2013-02-05 (=ED=99=94), 14:28 +0900, Namjae Jeon: > >> Hi Jaegeuk. > >> > >> Oops!, I was missing include header. > >> Sorry, I will send v2 patch again. > > > > I got a build error, and simply added the following header file in your > > patch. > > > > #include > > > > Is it correct? > Yes, Right :) It should be needed. > Sorry for my mistake again. Could you add this header instead of me > ?(because I can resend the patch tonight....). No problem. I've already done it. :) Thanks, >=20 > Thanks! > > > > Thanks, > > > >> > >> Thanks. > >> > >> 2013/2/4, Namjae Jeon : > >> > From: Namjae Jeon > >> > > >> > adding compat_ioctl to provide support for backward comptability - > >> > 32bit > >> > binary > >> > execution on 64bit kernel. > >> > > >> > Signed-off-by: Namjae Jeon > >> > Signed-off-by: Amit Sahrawat > >> > --- > >> > fs/f2fs/f2fs.h | 15 +++++++++++++++ > >> > fs/f2fs/file.c | 20 ++++++++++++++++++++ > >> > 2 files changed, 35 insertions(+) > >> > > >> > diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h > >> > index 58dd608..7bf86c8 100644 > >> > --- a/fs/f2fs/f2fs.h > >> > +++ b/fs/f2fs/f2fs.h > >> > @@ -104,6 +104,20 @@ static inline int update_sits_in_cursum(struct > >> > f2fs_summary_block *rs, int i) > >> > } > >> > > >> > /* > >> > + * ioctl commands > >> > + */ > >> > +#define F2FS_IOC_GETFLAGS FS_IOC_GETFLAGS > >> > +#define F2FS_IOC_SETFLAGS FS_IOC_SETFLAGS > >> > + > >> > +#if defined(__KERNEL__) && defined(CONFIG_COMPAT) > >> > +/* > >> > + * ioctl commands in 32 bit emulation > >> > + */ > >> > +#define F2FS_IOC32_GETFLAGS FS_IOC32_GETFLAGS > >> > +#define F2FS_IOC32_SETFLAGS FS_IOC32_SETFLAGS > >> > +#endif > >> > + > >> > +/* > >> > * For INODE and NODE manager > >> > */ > >> > #define XATTR_NODE_OFFSET (-1) /* > >> > @@ -850,6 +864,7 @@ void f2fs_truncate(struct inode *); > >> > int f2fs_setattr(struct dentry *, struct iattr *); > >> > int truncate_hole(struct inode *, pgoff_t, pgoff_t); > >> > long f2fs_ioctl(struct file *, unsigned int, unsigned long); > >> > +long f2fs_compat_ioctl(struct file *, unsigned int, unsigned long); > >> > > >> > /* > >> > * inode.c > >> > diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c > >> > index 633667e..e79d26a 100644 > >> > --- a/fs/f2fs/file.c > >> > +++ b/fs/f2fs/file.c > >> > @@ -644,6 +644,23 @@ out: > >> > } > >> > } > >> > > >> > +#ifdef CONFIG_COMPAT > >> > +long f2fs_compat_ioctl(struct file *file, unsigned int cmd, unsigne= d > >> > long > >> > arg) > >> > +{ > >> > + switch (cmd) { > >> > + case F2FS_IOC32_GETFLAGS: > >> > + cmd =3D F2FS_IOC_GETFLAGS; > >> > + break; > >> > + case F2FS_IOC32_SETFLAGS: > >> > + cmd =3D F2FS_IOC_SETFLAGS; > >> > + break; > >> > + default: > >> > + return -ENOIOCTLCMD; > >> > + } > >> > + return f2fs_ioctl(file, cmd, (unsigned long) compat_ptr(arg)); > >> > +} > >> > +#endif > >> > + > >> > const struct file_operations f2fs_file_operations =3D { > >> > .llseek =3D generic_file_llseek, > >> > .read =3D do_sync_read, > >> > @@ -655,6 +672,9 @@ const struct file_operations f2fs_file_operation= s =3D > >> > { > >> > .fsync =3D f2fs_sync_file, > >> > .fallocate =3D f2fs_fallocate, > >> > .unlocked_ioctl =3D f2fs_ioctl, > >> > +#ifdef CONFIG_COMPAT > >> > + .compat_ioctl =3D f2fs_compat_ioctl, > >> > +#endif > >> > .splice_read =3D generic_file_splice_read, > >> > .splice_write =3D generic_file_splice_write, > >> > }; > >> > -- > >> > 1.7.9.5 > >> > > >> > > >> -- > >> To unsubscribe from this list: send the line "unsubscribe linux-fsdeve= l" > >> in > >> the body of a message to majordomo@vger.kernel.org > >> More majordomo info at http://vger.kernel.org/majordomo-info.html > > > > -- > > Jaegeuk Kim > > Samsung > > > -- > To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" = in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html --=20 Jaegeuk Kim Samsung --=-qISzmLpL4A7FDB+xA2sf Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAABAgAGBQJRELD4AAoJEEAUqH6CSFDSEDYP/2ea0cs+CkgJkPMrXPWBY9qH z88hg/HOKaTEOWdYfZ9ep73g5ocRrtibvzemmENzgk6XpP54pV51QBNLfI1ttbgk XYbR+Lf4vwuAT3dgzcAo4yLwQtuTIXQOBVVM9rR1m8VmSFvrPgtWvQasYwAMt5aE K/x2WhQHuJLmTh7Zueqm9NxZd4Xy6ga2yRbhHCkWMsaFk0z/xmJPnK0ZD2JWtmJe bpRcO+Mv5pYxr6xCYY+vkPAqvwgbs6XtFpfHq0SDL0xV/cy2Pj9qddLK10yYnCOr q0leYp922P7cxpwiX8HWnRslLtOU0lzYOILLYAKJ7JX7sk5ToJ266bx24Uf9V/vW 95RWctBfgElGXpshh0/KaSqG3JcFDdkZGpzBpW8c2fcuQpcsPhaKuyhsCPM7bSeh HHboAODs1SKocV6SQQz/9RNwRvXUYCF52SGYJKZNskQgm0tWhky0BZsCXWKx1xvq kJYqTynltH6lLUSMFGr+RB+3URSnbjSkXowQ6GIHrPZlOCUPLmF8eocbPGdSRhtJ a8prDnQgw2HleLeFLahcCmPPnRN1I+ASXxJ6UQIkvjfx5D+e1vSGUxnlSQWucyLr deWOFk2fDLK8arXdd/vErr7+xK/IAXmv/CTbRoctJGdhyIaEFUarwhYT8dk5aorT I36+0+6cQrIGsOVQyKGT =8d7S -----END PGP SIGNATURE----- --=-qISzmLpL4A7FDB+xA2sf--