Whamcloud - gitweb
LU-3318 llite: Always build 64bit ino internally
[fs/lustre-release.git] / lustre / llite / llite_lib.c
index a96f878..01ddfd2 100644 (file)
@@ -27,7 +27,7 @@
  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2011, 2012, Intel Corporation.
+ * Copyright (c) 2011, 2013, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -528,7 +528,9 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
        }
 
         LASSERT(fid_is_sane(&sbi->ll_root_fid));
-        root = ll_iget(sb, cl_fid_build_ino(&sbi->ll_root_fid, 0), &lmd);
+       root = ll_iget(sb, cl_fid_build_ino(&sbi->ll_root_fid,
+                                           sbi->ll_flags & LL_SBI_32BIT_API),
+                      &lmd);
         md_free_lustre_md(sbi->ll_md_exp, &lmd);
         ptlrpc_req_finished(request);
 
@@ -731,9 +733,11 @@ void ll_kill_super(struct super_block *sb)
         /* we need restore s_dev from changed for clustred NFS before put_super
          * because new kernels have cached s_dev and change sb->s_dev in
          * put_super not affected real removing devices */
-        if (sbi)
-                sb->s_dev = sbi->ll_sdev_orig;
-        EXIT;
+       if (sbi) {
+               sb->s_dev = sbi->ll_sdev_orig;
+               sbi->ll_umounting = 1;
+       }
+       EXIT;
 }
 
 char *ll_read_opt(const char *opt, char *data)
@@ -1490,6 +1494,7 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr)
 
        /* If we are changing file size, file content is modified, flag it. */
        if (attr->ia_valid & ATTR_SIZE) {
+               attr->ia_valid |= MDS_OPEN_OWNEROVERRIDE;
                spin_lock(&lli->lli_lock);
                lli->lli_flags |= LLIF_DATA_MODIFIED;
                spin_unlock(&lli->lli_lock);
@@ -1734,7 +1739,8 @@ void ll_update_inode(struct inode *inode, struct lustre_md *md)
                spin_unlock(&lli->lli_lock);
        }
 #endif
-        inode->i_ino = cl_fid_build_ino(&body->fid1, 0);
+       inode->i_ino = cl_fid_build_ino(&body->fid1,
+                                       sbi->ll_flags & LL_SBI_32BIT_API);
         inode->i_generation = cl_fid_build_gen(&body->fid1);
 
         if (body->valid & OBD_MD_FLATIME) {
@@ -1900,7 +1906,8 @@ void ll_delete_inode(struct inode *inode)
        if (S_ISREG(inode->i_mode) && lli->lli_clob != NULL)
                /* discard all dirty pages before truncating them, required by
                 * osc_extent implementation at LU-1030. */
-               cl_sync_file_range(inode, 0, OBD_OBJECT_EOF, CL_FSYNC_DISCARD);
+               cl_sync_file_range(inode, 0, OBD_OBJECT_EOF,
+                                  CL_FSYNC_DISCARD, 1);
 
         truncate_inode_pages(&inode->i_data, 0);
 
@@ -2074,16 +2081,15 @@ void ll_umount_begin(struct super_block *sb)
         obd->obd_force = 1;
 
         OBD_ALLOC_PTR(ioc_data);
-        if (ioc_data) {
-                obd_iocontrol(IOC_OSC_SET_ACTIVE, sbi->ll_md_exp,
-                              sizeof ioc_data, ioc_data, NULL);
+       if (ioc_data) {
+               obd_iocontrol(IOC_OSC_SET_ACTIVE, sbi->ll_md_exp,
+                             sizeof *ioc_data, ioc_data, NULL);
 
-                obd_iocontrol(IOC_OSC_SET_ACTIVE, sbi->ll_dt_exp,
-                              sizeof ioc_data, ioc_data, NULL);
-
-                OBD_FREE_PTR(ioc_data);
-        }
+               obd_iocontrol(IOC_OSC_SET_ACTIVE, sbi->ll_dt_exp,
+                             sizeof *ioc_data, ioc_data, NULL);
 
+               OBD_FREE_PTR(ioc_data);
+       }
 
         /* Really, we'd like to wait until there are no requests outstanding,
          * and then continue.  For now, we just invalidate the requests,
@@ -2162,7 +2168,9 @@ int ll_prep_inode(struct inode **inode, struct ptlrpc_request *req,
                  */
                 LASSERT(fid_is_sane(&md.body->fid1));
 
-                *inode = ll_iget(sb, cl_fid_build_ino(&md.body->fid1, 0), &md);
+               *inode = ll_iget(sb, cl_fid_build_ino(&md.body->fid1,
+                                            sbi->ll_flags & LL_SBI_32BIT_API),
+                                &md);
                 if (*inode == NULL || IS_ERR(*inode)) {
 #ifdef CONFIG_FS_POSIX_ACL
                         if (md.posix_acl) {