Merge branch 'cleanups'
authorTrond Myklebust <trond.myklebust@primarydata.com>
Wed, 18 Feb 2015 15:28:37 +0000 (07:28 -0800)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Wed, 18 Feb 2015 15:28:37 +0000 (07:28 -0800)
Merge cleanups requested by Linus.

* cleanups: (3 commits)
  pnfs: Refactor the *_layout_mark_request_commit to use pnfs_layout_mark_request_commit
  nfs: Can call nfs_clear_page_commit() instead
  nfs: Provide and use helper functions for marking a page as unstable

1  2 
fs/nfs/delegation.c
fs/nfs/inode.c

diff --combined fs/nfs/delegation.c
index 4464eb06b0b6b6facfdcb95f2d8f060708775dd5,da5433230bb1960bc78bafc17ced89f3bca76b65..a1f0685b42ff7d2e42eed249e178ecdbbee7befc
@@@ -85,25 -85,30 +85,30 @@@ static int nfs_delegation_claim_locks(s
  {
        struct inode *inode = state->inode;
        struct file_lock *fl;
+       struct file_lock_context *flctx = inode->i_flctx;
+       struct list_head *list;
        int status = 0;
  
-       if (inode->i_flock == NULL)
+       if (flctx == NULL)
                goto out;
  
-       /* Protect inode->i_flock using the i_lock */
-       spin_lock(&inode->i_lock);
-       for (fl = inode->i_flock; fl != NULL; fl = fl->fl_next) {
-               if (!(fl->fl_flags & (FL_POSIX|FL_FLOCK)))
-                       continue;
+       list = &flctx->flc_posix;
+       spin_lock(&flctx->flc_lock);
+ restart:
+       list_for_each_entry(fl, list, fl_list) {
                if (nfs_file_open_context(fl->fl_file) != ctx)
                        continue;
-               spin_unlock(&inode->i_lock);
+               spin_unlock(&flctx->flc_lock);
                status = nfs4_lock_delegation_recall(fl, state, stateid);
                if (status < 0)
                        goto out;
-               spin_lock(&inode->i_lock);
+               spin_lock(&flctx->flc_lock);
+       }
+       if (list == &flctx->flc_posix) {
+               list = &flctx->flc_flock;
+               goto restart;
        }
-       spin_unlock(&inode->i_lock);
+       spin_unlock(&flctx->flc_lock);
  out:
        return status;
  }
@@@ -175,6 -180,7 +180,6 @@@ void nfs_inode_reclaim_delegation(struc
                        delegation->cred = get_rpccred(cred);
                        clear_bit(NFS_DELEGATION_NEED_RECLAIM,
                                  &delegation->flags);
 -                      NFS_I(inode)->delegation_state = delegation->type;
                        spin_unlock(&delegation->lock);
                        put_rpccred(oldcred);
                        rcu_read_unlock();
@@@ -269,6 -275,7 +274,6 @@@ nfs_detach_delegation_locked(struct nfs
        set_bit(NFS_DELEGATION_RETURNING, &delegation->flags);
        list_del_rcu(&delegation->super_list);
        delegation->inode = NULL;
 -      nfsi->delegation_state = 0;
        rcu_assign_pointer(nfsi->delegation, NULL);
        spin_unlock(&delegation->lock);
        return delegation;
@@@ -348,6 -355,7 +353,6 @@@ int nfs_inode_set_delegation(struct ino
                                        &delegation->stateid)) {
                        nfs_update_inplace_delegation(old_delegation,
                                        delegation);
 -                      nfsi->delegation_state = old_delegation->type;
                        goto out;
                }
                /*
                        goto out;
        }
        list_add_rcu(&delegation->super_list, &server->delegations);
 -      nfsi->delegation_state = delegation->type;
        rcu_assign_pointer(nfsi->delegation, delegation);
        delegation = NULL;
  
diff --combined fs/nfs/inode.c
index e211f975a69aebd0576ac8dd57b9ef5c36e156a9,e4f0dcef8f5455e60676bf70d9d0489107ad7c79..83107be3dd0109ab54c5f2b0c72fa59c64dd8d57
@@@ -388,7 -388,6 +388,6 @@@ nfs_fhget(struct super_block *sb, struc
                if (S_ISREG(inode->i_mode)) {
                        inode->i_fop = NFS_SB(sb)->nfs_client->rpc_ops->file_ops;
                        inode->i_data.a_ops = &nfs_file_aops;
-                       inode->i_data.backing_dev_info = &NFS_SB(sb)->backing_dev_info;
                } else if (S_ISDIR(inode->i_mode)) {
                        inode->i_op = NFS_SB(sb)->nfs_client->rpc_ops->dir_inode_ops;
                        inode->i_fop = &nfs_dir_operations;
@@@ -1776,6 -1775,7 +1775,6 @@@ static inline void nfs4_init_once(struc
  #if IS_ENABLED(CONFIG_NFS_V4)
        INIT_LIST_HEAD(&nfsi->open_states);
        nfsi->delegation = NULL;
 -      nfsi->delegation_state = 0;
        init_rwsem(&nfsi->rwsem);
        nfsi->layout = NULL;
  #endif