Whamcloud - gitweb
revert fix from bug 16417
[fs/lustre-release.git] / lustre / llite / lloop.c
index 13d89c5..05026f1 100644 (file)
@@ -1,24 +1,37 @@
 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
  * vim:expandtab:shiftwidth=8:tabstop=8:
  *
- * Lustre virtual block device emulator.
+ * GPL HEADER START
  *
- *  Copyright (c) 2001-2003 Cluster File Systems, Inc.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
- *   This file is part of Lustre, http://www.lustre.org.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 only,
+ * as published by the Free Software Foundation.
  *
- *   Lustre is free software; you can redistribute it and/or
- *   modify it under the terms of version 2 of the GNU General Public
- *   License as published by the Free Software Foundation.
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License version 2 for more details (a copy is included
+ * in the LICENSE file that accompanied this code).
  *
- *   Lustre is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
+ * You should have received a copy of the GNU General Public License
+ * version 2 along with this program; If not, see
+ * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
  *
- *   You should have received a copy of the GNU General Public License
- *   along with Lustre; if not, write to the Free Software
- *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ *
+ * GPL HEADER END
+ */
+/*
+ * Copyright  2008 Sun Microsystems, Inc. All rights reserved
+ * Use is subject to license terms.
+ */
+/*
+ * This file is part of Lustre, http://www.lustre.org/
+ * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 /*
@@ -121,8 +134,8 @@ struct lloop_device {
         loff_t             lo_offset;
         loff_t             lo_sizelimit;
         int                lo_flags;
-        int                (*ioctl)(struct lloop_device *, int cmd, 
-                                 unsigned long arg); 
+        int                (*ioctl)(struct lloop_device *, int cmd,
+                                 unsigned long arg);
 
         struct file *      lo_backing_file;
         struct block_device *lo_device;
@@ -228,8 +241,8 @@ static int do_bio_filebacked(struct lloop_device *lo, struct bio *bio)
         oinfo.oi_md = lsm;
         opc = cmd & OBD_BRW_WRITE ? CAPA_OPC_OSS_WRITE : CAPA_OPC_OSS_RW;
         oinfo.oi_capa = ll_osscapa_get(inode, opc);
-        ret = obd_brw(cmd, ll_i2dtexp(inode), &oinfo, 
-                      (obd_count)(i - bio->bi_idx), 
+        ret = obd_brw(cmd, ll_i2dtexp(inode), &oinfo,
+                      (obd_count)(i - bio->bi_idx),
                       lo->lo_requests[0].lrd_pages, NULL);
         capa_put(oinfo.oi_capa);
         if (ret == 0)
@@ -457,7 +470,7 @@ static int loop_set_fd(struct lloop_device *lo, struct file *unused,
         return error;
 }
 
-static int loop_clr_fd(struct lloop_device *lo, struct block_device *bdev, 
+static int loop_clr_fd(struct lloop_device *lo, struct block_device *bdev,
                        int count)
 {
         struct file *filp = lo->lo_backing_file;
@@ -519,7 +532,7 @@ static int lo_release(struct inode *inode, struct file *file)
 }
 
 /* lloop device node's ioctl function. */
-static int lo_ioctl(struct inode *inode, struct file *unused, 
+static int lo_ioctl(struct inode *inode, struct file *unused,
         unsigned int cmd, unsigned long arg)
 {
         struct lloop_device *lo = inode->i_bdev->bd_disk->private_data;
@@ -543,7 +556,7 @@ static int lo_ioctl(struct inode *inode, struct file *unused,
 
                 if (put_user(ino, (__u64 *)arg))
                         err = -EFAULT;
-                break; 
+                break;
         }
 
         default:
@@ -562,13 +575,13 @@ static struct block_device_operations lo_fops = {
         .ioctl =        lo_ioctl,
 };
 
-/* dynamic iocontrol callback. 
- * This callback is registered in lloop_init and will be called by 
- * ll_iocontrol_call. 
- * This is a llite regular file ioctl function. It takes the responsibility 
- * of attaching a file, and detaching a file by a lloop's device numner. 
+/* dynamic iocontrol callback.
+ * This callback is registered in lloop_init and will be called by
+ * ll_iocontrol_call.
+ * This is a llite regular file ioctl function. It takes the responsibility
+ * of attaching a file, and detaching a file by a lloop's device numner.
  */
-static enum llioc_iter lloop_ioctl(struct inode *unused, struct file *file, 
+static enum llioc_iter lloop_ioctl(struct inode *unused, struct file *file,
                 unsigned int cmd, unsigned long arg,
                 void *magic, int *rcp)
 {
@@ -598,7 +611,7 @@ static enum llioc_iter lloop_ioctl(struct inode *unused, struct file *file,
                                         lo_free = lo;
                                 continue;
                         }
-                        if (lo->lo_backing_file->f_dentry->d_inode == 
+                        if (lo->lo_backing_file->f_dentry->d_inode ==
                             file->f_dentry->d_inode)
                                 break;
                 }
@@ -628,7 +641,7 @@ static enum llioc_iter lloop_ioctl(struct inode *unused, struct file *file,
 
         case LL_IOC_LLOOP_DETACH_BYDEV: {
                 int minor;
-                
+
                 dev = old_decode_dev(arg);
                 if (MAJOR(dev) != lloop_major)
                         GOTO(out, err = -EINVAL);
@@ -766,6 +779,6 @@ module_init(lloop_init);
 module_exit(lloop_exit);
 
 CFS_MODULE_PARM(max_loop, "i", int, 0444, "maximum of lloop_device");
-MODULE_AUTHOR("Cluster File Systems, Inc. <info@clusterfs.com>");
+MODULE_AUTHOR("Sun Microsystems, Inc. <http://www.lustre.org/>");
 MODULE_DESCRIPTION("Lustre virtual block device");
 MODULE_LICENSE("GPL");