Merge branch 'for-linus' of git://git.kernel.dk/linux-block
[deliverable/linux.git] / fs / nilfs2 / cpfile.c
index b6596cab9e99e4a2e680b54750b9da09e8946c86..8a3d3b65af3f4cee510486f33556ed8bf950d134 100644 (file)
  * 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
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- *
- * Written by Koji Sato <koji@osrg.net>.
+ * Written by Koji Sato.
  */
 
 #include <linux/kernel.h>
@@ -41,6 +37,7 @@ static unsigned long
 nilfs_cpfile_get_blkoff(const struct inode *cpfile, __u64 cno)
 {
        __u64 tcno = cno + NILFS_MDT(cpfile)->mi_first_entry_offset - 1;
+
        do_div(tcno, nilfs_cpfile_checkpoints_per_block(cpfile));
        return (unsigned long)tcno;
 }
@@ -50,6 +47,7 @@ static unsigned long
 nilfs_cpfile_get_offset(const struct inode *cpfile, __u64 cno)
 {
        __u64 tcno = cno + NILFS_MDT(cpfile)->mi_first_entry_offset - 1;
+
        return do_div(tcno, nilfs_cpfile_checkpoints_per_block(cpfile));
 }
 
@@ -433,7 +431,8 @@ static void nilfs_cpfile_checkpoint_to_cpinfo(struct inode *cpfile,
 }
 
 static ssize_t nilfs_cpfile_do_get_cpinfo(struct inode *cpfile, __u64 *cnop,
-                                         void *buf, unsigned cisz, size_t nci)
+                                         void *buf, unsigned int cisz,
+                                         size_t nci)
 {
        struct nilfs_checkpoint *cp;
        struct nilfs_cpinfo *ci = buf;
@@ -484,7 +483,8 @@ static ssize_t nilfs_cpfile_do_get_cpinfo(struct inode *cpfile, __u64 *cnop,
 }
 
 static ssize_t nilfs_cpfile_do_get_ssinfo(struct inode *cpfile, __u64 *cnop,
-                                         void *buf, unsigned cisz, size_t nci)
+                                         void *buf, unsigned int cisz,
+                                         size_t nci)
 {
        struct buffer_head *bh;
        struct nilfs_cpfile_header *header;
@@ -570,7 +570,7 @@ static ssize_t nilfs_cpfile_do_get_ssinfo(struct inode *cpfile, __u64 *cnop,
  */
 
 ssize_t nilfs_cpfile_get_cpinfo(struct inode *cpfile, __u64 *cnop, int mode,
-                               void *buf, unsigned cisz, size_t nci)
+                               void *buf, unsigned int cisz, size_t nci)
 {
        switch (mode) {
        case NILFS_CHECKPOINT:
@@ -870,8 +870,10 @@ int nilfs_cpfile_is_snapshot(struct inode *cpfile, __u64 cno)
        void *kaddr;
        int ret;
 
-       /* CP number is invalid if it's zero or larger than the
-       largest exist one.*/
+       /*
+        * CP number is invalid if it's zero or larger than the
+        * largest existing one.
+        */
        if (cno == 0 || cno >= nilfs_mdt_cno(cpfile))
                return -ENOENT;
        down_read(&NILFS_MDT(cpfile)->mi_sem);
This page took 0.05752 seconds and 5 git commands to generate.