]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'devel' into next
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 15 Jul 2008 22:34:16 +0000 (18:34 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 15 Jul 2008 22:34:16 +0000 (18:34 -0400)
Conflicts:

fs/nfs/file.c

Fix up the conflict with Jon Corbet's bkl-removal tree

1  2 
fs/Kconfig
fs/nfs/file.c

diff --combined fs/Kconfig
index 313b2e06ded5dd525dcb9c9c422800564aacbe5b,0ce72dcd6b96c5e35efb47e6d44a12f17a35cfc0..84ab76a206a0ce9186c123c7b249dac2b5fc653b
@@@ -930,7 -930,7 +930,7 @@@ config PROC_KCOR
  
  config PROC_VMCORE
          bool "/proc/vmcore support (EXPERIMENTAL)"
 -        depends on PROC_FS && EXPERIMENTAL && CRASH_DUMP
 +        depends on PROC_FS && CRASH_DUMP
        default y
          help
          Exports the dump image of crashed kernel in ELF format.
@@@ -1544,10 -1544,6 +1544,6 @@@ config UFS_F
            The recently released UFS2 variant (used in FreeBSD 5.x) is
            READ-ONLY supported.
  
-         If you only intend to mount files from some other Unix over the
-         network using NFS, you don't need the UFS file system support (but
-         you need NFS file system support obviously).
          Note that this option is generally not needed for floppies, since a
          good portable way to transport files and directories between unixes
          (and even other operating systems) is given by the tar program ("man
@@@ -1587,6 -1583,7 +1583,7 @@@ menuconfig NETWORK_FILESYSTEM
          Say Y here to get to see options for network filesystems and
          filesystem-related networking code, such as NFS daemon and
          RPCSEC security modules.
          This option alone does not add any kernel code.
  
          If you say N, all options in this submenu will be skipped and
  if NETWORK_FILESYSTEMS
  
  config NFS_FS
-       tristate "NFS file system support"
+       tristate "NFS client support"
        depends on INET
        select LOCKD
        select SUNRPC
        select NFS_ACL_SUPPORT if NFS_V3_ACL
        help
-         If you are connected to some other (usually local) Unix computer
-         (using SLIP, PLIP, PPP or Ethernet) and want to mount files residing
-         on that computer (the NFS server) using the Network File Sharing
-         protocol, say Y. "Mounting files" means that the client can access
-         the files with usual UNIX commands as if they were sitting on the
-         client's hard disk. For this to work, the server must run the
-         programs nfsd and mountd (but does not need to have NFS file system
-         support enabled in its kernel). NFS is explained in the Network
-         Administrator's Guide, available from
-         <http://www.tldp.org/docs.html#guide>, on its man page: "man
-         nfs", and in the NFS-HOWTO.
-         A superior but less widely used alternative to NFS is provided by
-         the Coda file system; see "Coda file system support" below.
+         Choose Y here if you want to access files residing on other
+         computers using Sun's Network File System protocol.  To compile
+         this file system support as a module, choose M here: the module
+         will be called nfs.
  
-         If you say Y here, you should have said Y to TCP/IP networking also.
-         This option would enlarge your kernel by about 27 KB.
+         To mount file systems exported by NFS servers, you also need to
+         install the user space mount.nfs command which can be found in
+         the Linux nfs-utils package, available from http://linux-nfs.org/.
+         Information about using the mount command is available in the
+         mount(8) man page.  More detail about the Linux NFS client
+         implementation is available via the nfs(5) man page.
  
-         To compile this file system support as a module, choose M here: the
-         module will be called nfs.
+         Below you can choose which versions of the NFS protocol are
+         available in the kernel to mount NFS servers.  Support for NFS
+         version 2 (RFC 1094) is always available when NFS_FS is selected.
  
-         If you are configuring a diskless machine which will mount its root
-         file system over NFS at boot time, say Y here and to "Kernel
-         level IP autoconfiguration" above and to "Root file system on NFS"
-         below. You cannot compile this driver as a module in this case.
-         There are two packages designed for booting diskless machines over
-         the net: netboot, available from
-         <http://ftp1.sourceforge.net/netboot/>, and Etherboot,
-         available from <http://ftp1.sourceforge.net/etherboot/>.
+         To configure a system which mounts its root file system via NFS
+         at boot time, say Y here, select "Kernel level IP
+         autoconfiguration" in the NETWORK menu, and select "Root file
+         system on NFS" below.  You cannot compile this file system as a
+         module in this case.
  
-         If you don't know what all this is about, say N.
+         If unsure, say N.
  
  config NFS_V3
-       bool "Provide NFSv3 client support"
+       bool "NFS client support for NFS version 3"
        depends on NFS_FS
        help
-         Say Y here if you want your NFS client to be able to speak version
-         3 of the NFS protocol.
+         This option enables support for version 3 of the NFS protocol
+         (RFC 1813) in the kernel's NFS client.
  
          If unsure, say Y.
  
  config NFS_V3_ACL
-       bool "Provide client support for the NFSv3 ACL protocol extension"
+       bool "NFS client support for the NFSv3 ACL protocol extension"
        depends on NFS_V3
        help
-         Implement the NFSv3 ACL protocol extension for manipulating POSIX
-         Access Control Lists.  The server should also be compiled with
-         the NFSv3 ACL protocol extension; see the CONFIG_NFSD_V3_ACL option.
+         Some NFS servers support an auxiliary NFSv3 ACL protocol that
+         Sun added to Solaris but never became an official part of the
+         NFS version 3 protocol.  This protocol extension allows
+         applications on NFS clients to manipulate POSIX Access Control
+         Lists on files residing on NFS servers.  NFS servers enforce
+         ACLs on local files whether this protocol is available or not.
+         Choose Y here if your NFS server supports the Solaris NFSv3 ACL
+         protocol extension and you want your NFS client to allow
+         applications to access and modify ACLs on files on the server.
+         Most NFS servers don't support the Solaris NFSv3 ACL protocol
+         extension.  You can choose N here or specify the "noacl" mount
+         option to prevent your NFS client from trying to use the NFSv3
+         ACL protocol.
  
          If unsure, say N.
  
  config NFS_V4
-       bool "Provide NFSv4 client support (EXPERIMENTAL)"
+       bool "NFS client support for NFS version 4 (EXPERIMENTAL)"
        depends on NFS_FS && EXPERIMENTAL
        select RPCSEC_GSS_KRB5
        help
-         Say Y here if you want your NFS client to be able to speak the newer
-         version 4 of the NFS protocol.
+         This option enables support for version 4 of the NFS protocol
+         (RFC 3530) in the kernel's NFS client.
  
-         Note: Requires auxiliary userspace daemons which may be found on
-               http://www.citi.umich.edu/projects/nfsv4/
+         To mount NFS servers using NFSv4, you also need to install user
+         space programs which can be found in the Linux nfs-utils package,
+         available from http://linux-nfs.org/.
  
          If unsure, say N.
  
+ config ROOT_NFS
+       bool "Root file system on NFS"
+       depends on NFS_FS=y && IP_PNP
+       help
+         If you want your system to mount its root file system via NFS,
+         choose Y here.  This is common practice for managing systems
+         without local permanent storage.  For details, read
+         <file:Documentation/filesystems/nfsroot.txt>.
+         Most people say N here.
  config NFSD
        tristate "NFS server support"
        depends on INET
@@@ -1746,20 -1759,6 +1759,6 @@@ config NFSD_V
  
          If unsure, say N.
  
- config ROOT_NFS
-       bool "Root file system on NFS"
-       depends on NFS_FS=y && IP_PNP
-       help
-         If you want your Linux box to mount its whole root file system (the
-         one containing the directory /) from some other computer over the
-         net via NFS (presumably because your box doesn't have a hard disk),
-         say Y. Read <file:Documentation/filesystems/nfsroot.txt> for
-         details. It is likely that in this case, you also want to say Y to
-         "Kernel level IP autoconfiguration" so that your box can discover
-         its network address at boot time.
-         Most people say N here.
  config LOCKD
        tristate
  
@@@ -1800,27 -1799,6 +1799,6 @@@ config SUNRPC_XPRT_RDM
  
          If unsure, say N.
  
- config SUNRPC_BIND34
-       bool "Support for rpcbind versions 3 & 4 (EXPERIMENTAL)"
-       depends on SUNRPC && EXPERIMENTAL
-       default n
-       help
-         RPC requests over IPv6 networks require support for larger
-         addresses when performing an RPC bind.  Sun added support for
-         IPv6 addressing by creating two new versions of the rpcbind
-         protocol (RFC 1833).
-         This option enables support in the kernel RPC client for
-         querying rpcbind servers via versions 3 and 4 of the rpcbind
-         protocol.  The kernel automatically falls back to version 2
-         if a remote rpcbind service does not support versions 3 or 4.
-         By themselves, these new versions do not provide support for
-         RPC over IPv6, but the new protocol versions are necessary to
-         support it.
-         If unsure, say N to get traditional behavior (version 2 rpcbind
-         requests only).
  config RPCSEC_GSS_KRB5
        tristate "Secure RPC: Kerberos V mechanism (EXPERIMENTAL)"
        depends on SUNRPC && EXPERIMENTAL
diff --combined fs/nfs/file.c
index 4e98a56a17776cc1ea484db0c5d24f9e2a7490a0,509dcb58959e25dc928b56c3029ed2308bfa332b..43164fe86069617004c7ccc139588d9d450c7547
@@@ -50,7 -50,7 +50,7 @@@ static ssize_t nfs_file_read(struct kio
  static ssize_t nfs_file_write(struct kiocb *, const struct iovec *iov,
                                unsigned long nr_segs, loff_t pos);
  static int  nfs_file_flush(struct file *, fl_owner_t id);
- static int  nfs_fsync(struct file *, struct dentry *dentry, int datasync);
+ static int  nfs_file_fsync(struct file *, struct dentry *dentry, int datasync);
  static int nfs_check_flags(int flags);
  static int nfs_lock(struct file *filp, int cmd, struct file_lock *fl);
  static int nfs_flock(struct file *filp, int cmd, struct file_lock *fl);
@@@ -72,7 -72,7 +72,7 @@@ const struct file_operations nfs_file_o
        .open           = nfs_file_open,
        .flush          = nfs_file_flush,
        .release        = nfs_file_release,
-       .fsync          = nfs_fsync,
+       .fsync          = nfs_file_fsync,
        .lock           = nfs_lock,
        .flock          = nfs_flock,
        .splice_read    = nfs_file_splice_read,
@@@ -119,13 -119,17 +119,17 @@@ nfs_file_open(struct inode *inode, stru
  {
        int res;
  
+       dprintk("NFS: open file(%s/%s)\n",
+                       filp->f_path.dentry->d_parent->d_name.name,
+                       filp->f_path.dentry->d_name.name);
        res = nfs_check_flags(filp->f_flags);
        if (res)
                return res;
  
        nfs_inc_stats(inode, NFSIOS_VFSOPEN);
        lock_kernel();
-       res = NFS_PROTO(inode)->file_open(inode, filp);
+       res = nfs_open(inode, filp);
        unlock_kernel();
        return res;
  }
  static int
  nfs_file_release(struct inode *inode, struct file *filp)
  {
+       struct dentry *dentry = filp->f_path.dentry;
+       dprintk("NFS: release(%s/%s)\n",
+                       dentry->d_parent->d_name.name,
+                       dentry->d_name.name);
        /* Ensure that dirty pages are flushed out with the right creds */
        if (filp->f_mode & FMODE_WRITE)
-               nfs_wb_all(filp->f_path.dentry->d_inode);
+               nfs_wb_all(dentry->d_inode);
        nfs_inc_stats(inode, NFSIOS_VFSRELEASE);
-       return NFS_PROTO(inode)->file_release(inode, filp);
+       return nfs_release(inode, filp);
  }
  
  /**
@@@ -170,7 -180,11 +180,13 @@@ force_reval
  
  static loff_t nfs_file_llseek(struct file *filp, loff_t offset, int origin)
  {
 +      loff_t loff;
++
+       dprintk("NFS: llseek file(%s/%s, %lld, %d)\n",
+                       filp->f_path.dentry->d_parent->d_name.name,
+                       filp->f_path.dentry->d_name.name,
+                       offset, origin);
        /* origin == SEEK_END => we must revalidate the cached file length */
        if (origin == SEEK_END) {
                struct inode *inode = filp->f_mapping->host;
                if (retval < 0)
                        return (loff_t)retval;
        }
 -      return remote_llseek(filp, offset, origin);
 +      lock_kernel();  /* BKL needed? */
 +      loff = generic_file_llseek_unlocked(filp, offset, origin);
 +      unlock_kernel();
 +      return loff;
  }
  
  /*
-  * Helper for nfs_file_flush() and nfs_fsync()
+  * Helper for nfs_file_flush() and nfs_file_fsync()
   *
   * Notice that it clears the NFS_CONTEXT_ERROR_WRITE before synching to
   * disk, but it retrieves and clears ctx->error after synching, despite
@@@ -211,16 -222,18 +227,18 @@@ static int nfs_do_fsync(struct nfs_open
  
  /*
   * Flush all dirty pages, and check for write errors.
-  *
   */
  static int
  nfs_file_flush(struct file *file, fl_owner_t id)
  {
        struct nfs_open_context *ctx = nfs_file_open_context(file);
-       struct inode    *inode = file->f_path.dentry->d_inode;
+       struct dentry   *dentry = file->f_path.dentry;
+       struct inode    *inode = dentry->d_inode;
        int             status;
  
-       dfprintk(VFS, "nfs: flush(%s/%ld)\n", inode->i_sb->s_id, inode->i_ino);
+       dprintk("NFS: flush(%s/%s)\n",
+                       dentry->d_parent->d_name.name,
+                       dentry->d_name.name);
  
        if ((file->f_mode & FMODE_WRITE) == 0)
                return 0;
@@@ -245,7 -258,7 +263,7 @@@ nfs_file_read(struct kiocb *iocb, cons
        if (iocb->ki_filp->f_flags & O_DIRECT)
                return nfs_file_direct_read(iocb, iov, nr_segs, pos);
  
-       dfprintk(VFS, "nfs: read(%s/%s, %lu@%lu)\n",
+       dprintk("NFS: read(%s/%s, %lu@%lu)\n",
                dentry->d_parent->d_name.name, dentry->d_name.name,
                (unsigned long) count, (unsigned long) pos);
  
@@@ -265,7 -278,7 +283,7 @@@ nfs_file_splice_read(struct file *filp
        struct inode *inode = dentry->d_inode;
        ssize_t res;
  
-       dfprintk(VFS, "nfs: splice_read(%s/%s, %lu@%Lu)\n",
+       dprintk("NFS: splice_read(%s/%s, %lu@%Lu)\n",
                dentry->d_parent->d_name.name, dentry->d_name.name,
                (unsigned long) count, (unsigned long long) *ppos);
  
@@@ -282,7 -295,7 +300,7 @@@ nfs_file_mmap(struct file * file, struc
        struct inode *inode = dentry->d_inode;
        int     status;
  
-       dfprintk(VFS, "nfs: mmap(%s/%s)\n",
+       dprintk("NFS: mmap(%s/%s)\n",
                dentry->d_parent->d_name.name, dentry->d_name.name);
  
        status = nfs_revalidate_mapping(inode, file->f_mapping);
   * whether any write errors occurred for this process.
   */
  static int
- nfs_fsync(struct file *file, struct dentry *dentry, int datasync)
+ nfs_file_fsync(struct file *file, struct dentry *dentry, int datasync)
  {
        struct nfs_open_context *ctx = nfs_file_open_context(file);
        struct inode *inode = dentry->d_inode;
  
-       dfprintk(VFS, "nfs: fsync(%s/%ld)\n", inode->i_sb->s_id, inode->i_ino);
+       dprintk("NFS: fsync file(%s/%s) datasync %d\n",
+                       dentry->d_parent->d_name.name, dentry->d_name.name,
+                       datasync);
  
        nfs_inc_stats(inode, NFSIOS_VFSFSYNC);
        return nfs_do_fsync(ctx, inode);
@@@ -328,6 -343,11 +348,11 @@@ static int nfs_write_begin(struct file 
        struct page *page;
        index = pos >> PAGE_CACHE_SHIFT;
  
+       dfprintk(PAGECACHE, "NFS: write_begin(%s/%s(%ld), %u@%lld)\n",
+               file->f_path.dentry->d_parent->d_name.name,
+               file->f_path.dentry->d_name.name,
+               mapping->host->i_ino, len, (long long) pos);
        page = __grab_cache_page(mapping, index);
        if (!page)
                return -ENOMEM;
@@@ -348,6 -368,31 +373,31 @@@ static int nfs_write_end(struct file *f
        unsigned offset = pos & (PAGE_CACHE_SIZE - 1);
        int status;
  
+       dfprintk(PAGECACHE, "NFS: write_end(%s/%s(%ld), %u@%lld)\n",
+               file->f_path.dentry->d_parent->d_name.name,
+               file->f_path.dentry->d_name.name,
+               mapping->host->i_ino, len, (long long) pos);
+       /*
+        * Zero any uninitialised parts of the page, and then mark the page
+        * as up to date if it turns out that we're extending the file.
+        */
+       if (!PageUptodate(page)) {
+               unsigned pglen = nfs_page_length(page);
+               unsigned end = offset + len;
+               if (pglen == 0) {
+                       zero_user_segments(page, 0, offset,
+                                       end, PAGE_CACHE_SIZE);
+                       SetPageUptodate(page);
+               } else if (end >= pglen) {
+                       zero_user_segment(page, end, PAGE_CACHE_SIZE);
+                       if (offset == 0)
+                               SetPageUptodate(page);
+               } else
+                       zero_user_segment(page, pglen, PAGE_CACHE_SIZE);
+       }
        lock_kernel();
        status = nfs_updatepage(file, page, offset, copied);
        unlock_kernel();
  
  static void nfs_invalidate_page(struct page *page, unsigned long offset)
  {
+       dfprintk(PAGECACHE, "NFS: invalidate_page(%p, %lu)\n", page, offset);
        if (offset != 0)
                return;
        /* Cancel any unstarted writes on this page */
  
  static int nfs_release_page(struct page *page, gfp_t gfp)
  {
+       dfprintk(PAGECACHE, "NFS: release_page(%p)\n", page);
        /* If PagePrivate() is set, then the page is not freeable */
        return 0;
  }
  
  static int nfs_launder_page(struct page *page)
  {
-       return nfs_wb_page(page->mapping->host, page);
+       struct inode *inode = page->mapping->host;
+       dfprintk(PAGECACHE, "NFS: launder_page(%ld, %llu)\n",
+               inode->i_ino, (long long)page_offset(page));
+       return nfs_wb_page(inode, page);
  }
  
  const struct address_space_operations nfs_file_aops = {
  static int nfs_vm_page_mkwrite(struct vm_area_struct *vma, struct page *page)
  {
        struct file *filp = vma->vm_file;
+       struct dentry *dentry = filp->f_path.dentry;
        unsigned pagelen;
        int ret = -EINVAL;
        struct address_space *mapping;
  
+       dfprintk(PAGECACHE, "NFS: vm_page_mkwrite(%s/%s(%ld), offset %lld)\n",
+               dentry->d_parent->d_name.name, dentry->d_name.name,
+               filp->f_mapping->host->i_ino,
+               (long long)page_offset(page));
        lock_page(page);
        mapping = page->mapping;
-       if (mapping != vma->vm_file->f_path.dentry->d_inode->i_mapping)
+       if (mapping != dentry->d_inode->i_mapping)
                goto out_unlock;
  
        ret = 0;
@@@ -450,9 -510,9 +515,9 @@@ static ssize_t nfs_file_write(struct ki
        if (iocb->ki_filp->f_flags & O_DIRECT)
                return nfs_file_direct_write(iocb, iov, nr_segs, pos);
  
-       dfprintk(VFS, "nfs: write(%s/%s(%ld), %lu@%Ld)\n",
+       dprintk("NFS: write(%s/%s, %lu@%Ld)\n",
                dentry->d_parent->d_name.name, dentry->d_name.name,
-               inode->i_ino, (unsigned long) count, (long long) pos);
+               (unsigned long) count, (long long) pos);
  
        result = -EBUSY;
        if (IS_SWAPFILE(inode))
@@@ -586,7 -646,8 +651,8 @@@ static int do_setlk(struct file *filp, 
         * This makes locking act as a cache coherency point.
         */
        nfs_sync_mapping(filp->f_mapping);
-       nfs_zap_caches(inode);
+       if (!nfs_have_delegation(inode, FMODE_READ))
+               nfs_zap_caches(inode);
  out:
        return status;
  }
   */
  static int nfs_lock(struct file *filp, int cmd, struct file_lock *fl)
  {
-       struct inode * inode = filp->f_mapping->host;
+       struct inode *inode = filp->f_mapping->host;
+       int ret = -ENOLCK;
  
-       dprintk("NFS: nfs_lock(f=%s/%ld, t=%x, fl=%x, r=%Ld:%Ld)\n",
-                       inode->i_sb->s_id, inode->i_ino,
+       dprintk("NFS: lock(%s/%s, t=%x, fl=%x, r=%lld:%lld)\n",
+                       filp->f_path.dentry->d_parent->d_name.name,
+                       filp->f_path.dentry->d_name.name,
                        fl->fl_type, fl->fl_flags,
                        (long long)fl->fl_start, (long long)fl->fl_end);
        nfs_inc_stats(inode, NFSIOS_VFSLOCK);
  
        /* No mandatory locks over NFS */
        if (__mandatory_lock(inode) && fl->fl_type != F_UNLCK)
-               return -ENOLCK;
+               goto out_err;
+       if (NFS_PROTO(inode)->lock_check_bounds != NULL) {
+               ret = NFS_PROTO(inode)->lock_check_bounds(fl);
+               if (ret < 0)
+                       goto out_err;
+       }
  
        if (IS_GETLK(cmd))
-               return do_getlk(filp, cmd, fl);
-       if (fl->fl_type == F_UNLCK)
-               return do_unlk(filp, cmd, fl);
-       return do_setlk(filp, cmd, fl);
+               ret = do_getlk(filp, cmd, fl);
+       else if (fl->fl_type == F_UNLCK)
+               ret = do_unlk(filp, cmd, fl);
+       else
+               ret = do_setlk(filp, cmd, fl);
+ out_err:
+       return ret;
  }
  
  /*
   */
  static int nfs_flock(struct file *filp, int cmd, struct file_lock *fl)
  {
-       dprintk("NFS: nfs_flock(f=%s/%ld, t=%x, fl=%x)\n",
-                       filp->f_path.dentry->d_inode->i_sb->s_id,
-                       filp->f_path.dentry->d_inode->i_ino,
+       dprintk("NFS: flock(%s/%s, t=%x, fl=%x)\n",
+                       filp->f_path.dentry->d_parent->d_name.name,
+                       filp->f_path.dentry->d_name.name,
                        fl->fl_type, fl->fl_flags);
  
        /*
        return do_setlk(filp, cmd, fl);
  }
  
+ /*
+  * There is no protocol support for leases, so we have no way to implement
+  * them correctly in the face of opens by other clients.
+  */
  static int nfs_setlease(struct file *file, long arg, struct file_lock **fl)
  {
-       /*
-        * There is no protocol support for leases, so we have no way
-        * to implement them correctly in the face of opens by other
-        * clients.
-        */
+       dprintk("NFS: setlease(%s/%s, arg=%ld)\n",
+                       file->f_path.dentry->d_parent->d_name.name,
+                       file->f_path.dentry->d_name.name, arg);
        return -EINVAL;
  }