Merge tag 'locks-v4.4-1' of git://git.samba.org/jlayton/linux
[firefly-linux-kernel-4.4.55.git] / drivers / staging / lustre / lustre / llite / file.c
index 51b6bc5d4d3afe2e256578e6bba597685da0c382..02f27593013e3650e16bd22b511084755b2dc519 100644 (file)
@@ -64,7 +64,7 @@ static struct ll_file_data *ll_file_data_get(void)
 {
        struct ll_file_data *fd;
 
-       OBD_SLAB_ALLOC_PTR_GFP(fd, ll_file_data_slab, GFP_NOFS);
+       fd = kmem_cache_alloc(ll_file_data_slab, GFP_NOFS | __GFP_ZERO);
        if (fd == NULL)
                return NULL;
        fd->fd_write_failed = false;
@@ -74,7 +74,7 @@ static struct ll_file_data *ll_file_data_get(void)
 static void ll_file_data_put(struct ll_file_data *fd)
 {
        if (fd != NULL)
-               OBD_SLAB_FREE_PTR(fd, ll_file_data_slab);
+               kmem_cache_free(ll_file_data_slab, fd);
 }
 
 void ll_pack_inode2opdata(struct inode *inode, struct md_op_data *op_data,
@@ -1260,7 +1260,7 @@ static int ll_lov_recreate(struct inode *inode, struct ost_id *oi, u32 ost_idx)
        int rc = 0;
        struct lov_stripe_md *lsm = NULL, *lsm2;
 
-       OBDO_ALLOC(oa);
+       oa = kmem_cache_alloc(obdo_cachep, GFP_NOFS | __GFP_ZERO);
        if (oa == NULL)
                return -ENOMEM;
 
@@ -1295,7 +1295,7 @@ static int ll_lov_recreate(struct inode *inode, struct ost_id *oi, u32 ost_idx)
        goto out;
 out:
        ccc_inode_lsm_put(inode, lsm);
-       OBDO_FREE(oa);
+       kmem_cache_free(obdo_cachep, oa);
        return rc;
 }
 
@@ -1891,7 +1891,6 @@ int ll_hsm_release(struct inode *inode)
        __u64 data_version = 0;
        int rc;
 
-
        CDEBUG(D_INODE, "%s: Releasing file "DFID".\n",
               ll_get_fsname(inode->i_sb, NULL, 0),
               PFID(&ll_i2info(inode)->lli_fid));
@@ -1923,7 +1922,6 @@ int ll_hsm_release(struct inode *inode)
                                       &data_version);
        och = NULL;
 
-
 out:
        if (och != NULL && !IS_ERR(och)) /* close the file */
                ll_lease_close(och, inode, NULL);
@@ -2145,7 +2143,6 @@ static int ll_hsm_import(struct inode *inode, struct file *file,
        struct iattr            *attr = NULL;
        int                      rc;
 
-
        if (!S_ISREG(inode->i_mode))
                return -EINVAL;
 
@@ -2505,7 +2502,6 @@ ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
        }
 }
 
-
 static loff_t ll_file_seek(struct file *file, loff_t offset, int origin)
 {
        struct inode *inode = file_inode(file);
@@ -2754,13 +2750,9 @@ ll_file_flock(struct file *file, int cmd, struct file_lock *file_lock)
        rc = md_enqueue(sbi->ll_md_exp, &einfo, NULL,
                        op_data, &lockh, &flock, 0, NULL /* req */, flags);
 
-       if ((file_lock->fl_flags & FL_FLOCK) &&
-           (rc == 0 || file_lock->fl_type == F_UNLCK))
-               rc2  = flock_lock_file_wait(file, file_lock);
-       if ((file_lock->fl_flags & FL_POSIX) &&
-           (rc == 0 || file_lock->fl_type == F_UNLCK) &&
+       if ((rc == 0 || file_lock->fl_type == F_UNLCK) &&
            !(flags & LDLM_FL_TEST_LOCK))
-               rc2  = posix_lock_file_wait(file, file_lock);
+               rc2  = locks_lock_file_wait(file, file_lock);
 
        if (rc2 && file_lock->fl_type != F_UNLCK) {
                einfo.ei_mode = LCK_NL;
@@ -3071,7 +3063,6 @@ struct posix_acl *ll_get_acl(struct inode *inode, int type)
        return acl;
 }
 
-
 int ll_inode_permission(struct inode *inode, int mask)
 {
        int rc = 0;
@@ -3169,7 +3160,6 @@ static struct llioc_ctl_data {
        LIST_HEAD_INIT(llioc.ioc_head)
 };
 
-
 struct llioc_data {
        struct list_head              iocd_list;
        unsigned int        iocd_size;