diff for duplicates of <200804080435.54012.arnd@arndb.de> diff --git a/a/1.txt b/N1/1.txt index d2a21ca..1441081 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -1,3 +1,32 @@ -On Saturday 05 April 2008, Rusty Russell wrote:> +asmlinkage long sys_vringfd(void __user *addr,> + unsigned num_descs,> + u16 __user *last_used)> +{> + int fd, err;> + struct file *filp;> + struct vring_info *vr;> +> + /* Must be a power of two, and representable by u16 */> + if (!num_descs || (num_descs & (num_descs-1)) || num_descs > 65536) {> + err = -EINVAL;> + goto out;> + }> +> + fd = get_unused_fd();> + if (fd < 0) {> + err = fd;> + goto out;> + }> +> + filp = alloc_file(vring_mnt, dget(vring_mnt->mnt_root), FMODE_WRITE,> + &vring_fops);> + if (!filp) {> + err = -ENFILE;> + goto put_fd;> + } -This looks like a candidate for anon_inode_getfd(), which would let youget rid of the code for registering your own file system. - Arnd <><ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥ +On Saturday 05 April 2008, Rusty Russell wrote: +> +asmlinkage long sys_vringfd(void __user *addr, +> + unsigned num_descs, +> + u16 __user *last_used) +> +{ +> + int fd, err; +> + struct file *filp; +> + struct vring_info *vr; +> + +> + /* Must be a power of two, and representable by u16 */ +> + if (!num_descs || (num_descs & (num_descs-1)) || num_descs > 65536) { +> + err = -EINVAL; +> + goto out; +> + } +> + +> + fd = get_unused_fd(); +> + if (fd < 0) { +> + err = fd; +> + goto out; +> + } +> + +> + filp = alloc_file(vring_mnt, dget(vring_mnt->mnt_root), FMODE_WRITE, +> + &vring_fops); +> + if (!filp) { +> + err = -ENFILE; +> + goto put_fd; +> + } + +This looks like a candidate for anon_inode_getfd(), which would let you +get rid of the code for registering your own file system. + + Arnd <>< diff --git a/a/content_digest b/N1/content_digest index a07242f..d3e30bb 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -9,8 +9,37 @@ " Max Krasnyansky <maxk@qualcomm.com>\0" "\00:1\0" "b\0" - "On Saturday 05 April 2008, Rusty Russell wrote:> +asmlinkage long sys_vringfd(void __user *addr,> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240 \302\240 \302\240unsigned num_descs,> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240 \302\240 \302\240u16 __user *last_used)> +{> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240int fd, err;> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240struct file *filp;> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240struct vring_info *vr;> +> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240/* Must be a power of two, and representable by u16 */> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240if (!num_descs || (num_descs & (num_descs-1)) || num_descs > 65536) {> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240err = -EINVAL;> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240goto out;> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240}> +> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240fd = get_unused_fd();> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240if (fd < 0) {> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240err = fd;> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240goto out;> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240}> +> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240filp = alloc_file(vring_mnt, dget(vring_mnt->mnt_root), FMODE_WRITE,> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240 \302\240&vring_fops);> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240if (!filp) {> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240err = -ENFILE;> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240goto put_fd;> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240}\n" - "This looks like a candidate for anon_inode_getfd(), which would let youget rid of the code for registering your own file system.\n" - "\tArnd <><\303\277\303\264\303\250\302\272{.n\303\207+\302\211\302\267\302\237\302\256\302\211\302\255\302\206+%\302\212\303\213\303\277\302\261\303\251\303\235\302\266\027\302\245\302\212w\303\277\302\272{.n\303\207+\302\211\302\267\302\245\302\212{\302\261\303\276G\302\253\302\235\303\251\303\277\302\212{ay\302\272\035\303\212\302\207\303\232\302\231\303\253,j\a\302\255\302\242f\302\243\302\242\302\267h\302\232\302\217\303\257\302\201\303\252\303\277\302\221\303\252\303\247z_\303\250\302\256\003(\302\255\303\251\302\232\302\216\302\212\303\235\302\242j\"\302\235\303\272\032\302\266\033m\302\247\303\277\303\277\302\276\a\302\253\303\276G\302\253\302\235\303\251\303\277\302\242\302\270?\302\231\302\250\303\250\302\255\303\232&\302\243\303\270\302\247~\302\217\303\241\302\266iO\302\225\303\246\302\254z\302\267\302\232v\303\230^\024\004\032\302\266\033m\302\247\303\277\303\277\303\203\f\303\277\302\266\303\254\303\277\302\242\302\270?\302\226I\302\245" + "On Saturday 05 April 2008, Rusty Russell wrote:\n" + "> +asmlinkage long sys_vringfd(void __user *addr,\n" + "> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240 \302\240 \302\240unsigned num_descs,\n" + "> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240 \302\240 \302\240u16 __user *last_used)\n" + "> +{\n" + "> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240int fd, err;\n" + "> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240struct file *filp;\n" + "> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240struct vring_info *vr;\n" + "> +\n" + "> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240/* Must be a power of two, and representable by u16 */\n" + "> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240if (!num_descs || (num_descs & (num_descs-1)) || num_descs > 65536) {\n" + "> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240err = -EINVAL;\n" + "> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240goto out;\n" + "> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240}\n" + "> +\n" + "> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240fd = get_unused_fd();\n" + "> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240if (fd < 0) {\n" + "> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240err = fd;\n" + "> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240goto out;\n" + "> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240}\n" + "> +\n" + "> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240filp = alloc_file(vring_mnt, dget(vring_mnt->mnt_root), FMODE_WRITE,\n" + "> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240 \302\240&vring_fops);\n" + "> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240if (!filp) {\n" + "> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240err = -ENFILE;\n" + "> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240goto put_fd;\n" + "> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240}\n" + "\n" + "This looks like a candidate for anon_inode_getfd(), which would let you\n" + "get rid of the code for registering your own file system.\n" + "\n" + "\tArnd <><" -e8eacc14d73a03be2eda78c34d7825a1872120e838533f879912b032555940ba +c8e248753bbfa11b27fbde2b9c8702d8877525b81b9aa5c53af84f6fdee82ada
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.