diff options
author | Bryan Schumaker <bjschuma@netapp.com> | 2012-07-16 16:39:10 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-07-17 13:32:55 -0400 |
commit | 597d92891b8859b4b4949fd08e25e60fc80ddaaf (patch) | |
tree | c379c890a62a36b36b443cf23f81daa1605901b0 /fs/nfs/dir.c | |
parent | 6bbb4ae8ffc4eef825c8742eff1fefae69a82e41 (diff) |
NFS: Split out NFS v2 inode operations
This patch moves the NFS v2 file and directory inode functions into
files that are only compiled whet CONFIG_NFS_V2 is enabled.
Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/dir.c')
-rw-r--r-- | fs/nfs/dir.c | 43 |
1 files changed, 9 insertions, 34 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index b7136853ca9c..9ae329d62340 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c | |||
@@ -46,16 +46,6 @@ | |||
46 | static int nfs_opendir(struct inode *, struct file *); | 46 | static int nfs_opendir(struct inode *, struct file *); |
47 | static int nfs_closedir(struct inode *, struct file *); | 47 | static int nfs_closedir(struct inode *, struct file *); |
48 | static int nfs_readdir(struct file *, void *, filldir_t); | 48 | static int nfs_readdir(struct file *, void *, filldir_t); |
49 | static struct dentry *nfs_lookup(struct inode *, struct dentry *, unsigned int); | ||
50 | static int nfs_create(struct inode *, struct dentry *, umode_t, bool); | ||
51 | static int nfs_mkdir(struct inode *, struct dentry *, umode_t); | ||
52 | static int nfs_rmdir(struct inode *, struct dentry *); | ||
53 | static int nfs_unlink(struct inode *, struct dentry *); | ||
54 | static int nfs_symlink(struct inode *, struct dentry *, const char *); | ||
55 | static int nfs_link(struct dentry *, struct inode *, struct dentry *); | ||
56 | static int nfs_mknod(struct inode *, struct dentry *, umode_t, dev_t); | ||
57 | static int nfs_rename(struct inode *, struct dentry *, | ||
58 | struct inode *, struct dentry *); | ||
59 | static int nfs_fsync_dir(struct file *, loff_t, loff_t, int); | 49 | static int nfs_fsync_dir(struct file *, loff_t, loff_t, int); |
60 | static loff_t nfs_llseek_dir(struct file *, loff_t, int); | 50 | static loff_t nfs_llseek_dir(struct file *, loff_t, int); |
61 | static void nfs_readdir_clear_array(struct page*); | 51 | static void nfs_readdir_clear_array(struct page*); |
@@ -69,21 +59,6 @@ const struct file_operations nfs_dir_operations = { | |||
69 | .fsync = nfs_fsync_dir, | 59 | .fsync = nfs_fsync_dir, |
70 | }; | 60 | }; |
71 | 61 | ||
72 | const struct inode_operations nfs_dir_inode_operations = { | ||
73 | .create = nfs_create, | ||
74 | .lookup = nfs_lookup, | ||
75 | .link = nfs_link, | ||
76 | .unlink = nfs_unlink, | ||
77 | .symlink = nfs_symlink, | ||
78 | .mkdir = nfs_mkdir, | ||
79 | .rmdir = nfs_rmdir, | ||
80 | .mknod = nfs_mknod, | ||
81 | .rename = nfs_rename, | ||
82 | .permission = nfs_permission, | ||
83 | .getattr = nfs_getattr, | ||
84 | .setattr = nfs_setattr, | ||
85 | }; | ||
86 | |||
87 | const struct address_space_operations nfs_dir_aops = { | 62 | const struct address_space_operations nfs_dir_aops = { |
88 | .freepage = nfs_readdir_clear_array, | 63 | .freepage = nfs_readdir_clear_array, |
89 | }; | 64 | }; |
@@ -1270,7 +1245,7 @@ const struct dentry_operations nfs_dentry_operations = { | |||
1270 | .d_release = nfs_d_release, | 1245 | .d_release = nfs_d_release, |
1271 | }; | 1246 | }; |
1272 | 1247 | ||
1273 | static struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, unsigned int flags) | 1248 | struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, unsigned int flags) |
1274 | { | 1249 | { |
1275 | struct dentry *res; | 1250 | struct dentry *res; |
1276 | struct dentry *parent; | 1251 | struct dentry *parent; |
@@ -1588,7 +1563,7 @@ out_error: | |||
1588 | * that the operation succeeded on the server, but an error in the | 1563 | * that the operation succeeded on the server, but an error in the |
1589 | * reply path made it appear to have failed. | 1564 | * reply path made it appear to have failed. |
1590 | */ | 1565 | */ |
1591 | static int nfs_create(struct inode *dir, struct dentry *dentry, | 1566 | int nfs_create(struct inode *dir, struct dentry *dentry, |
1592 | umode_t mode, bool excl) | 1567 | umode_t mode, bool excl) |
1593 | { | 1568 | { |
1594 | struct iattr attr; | 1569 | struct iattr attr; |
@@ -1613,7 +1588,7 @@ out_err: | |||
1613 | /* | 1588 | /* |
1614 | * See comments for nfs_proc_create regarding failed operations. | 1589 | * See comments for nfs_proc_create regarding failed operations. |
1615 | */ | 1590 | */ |
1616 | static int | 1591 | int |
1617 | nfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t rdev) | 1592 | nfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t rdev) |
1618 | { | 1593 | { |
1619 | struct iattr attr; | 1594 | struct iattr attr; |
@@ -1640,7 +1615,7 @@ out_err: | |||
1640 | /* | 1615 | /* |
1641 | * See comments for nfs_proc_create regarding failed operations. | 1616 | * See comments for nfs_proc_create regarding failed operations. |
1642 | */ | 1617 | */ |
1643 | static int nfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) | 1618 | int nfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) |
1644 | { | 1619 | { |
1645 | struct iattr attr; | 1620 | struct iattr attr; |
1646 | int error; | 1621 | int error; |
@@ -1666,7 +1641,7 @@ static void nfs_dentry_handle_enoent(struct dentry *dentry) | |||
1666 | d_delete(dentry); | 1641 | d_delete(dentry); |
1667 | } | 1642 | } |
1668 | 1643 | ||
1669 | static int nfs_rmdir(struct inode *dir, struct dentry *dentry) | 1644 | int nfs_rmdir(struct inode *dir, struct dentry *dentry) |
1670 | { | 1645 | { |
1671 | int error; | 1646 | int error; |
1672 | 1647 | ||
@@ -1725,7 +1700,7 @@ out: | |||
1725 | * | 1700 | * |
1726 | * If sillyrename() returns 0, we do nothing, otherwise we unlink. | 1701 | * If sillyrename() returns 0, we do nothing, otherwise we unlink. |
1727 | */ | 1702 | */ |
1728 | static int nfs_unlink(struct inode *dir, struct dentry *dentry) | 1703 | int nfs_unlink(struct inode *dir, struct dentry *dentry) |
1729 | { | 1704 | { |
1730 | int error; | 1705 | int error; |
1731 | int need_rehash = 0; | 1706 | int need_rehash = 0; |
@@ -1769,7 +1744,7 @@ static int nfs_unlink(struct inode *dir, struct dentry *dentry) | |||
1769 | * now have a new file handle and can instantiate an in-core NFS inode | 1744 | * now have a new file handle and can instantiate an in-core NFS inode |
1770 | * and move the raw page into its mapping. | 1745 | * and move the raw page into its mapping. |
1771 | */ | 1746 | */ |
1772 | static int nfs_symlink(struct inode *dir, struct dentry *dentry, const char *symname) | 1747 | int nfs_symlink(struct inode *dir, struct dentry *dentry, const char *symname) |
1773 | { | 1748 | { |
1774 | struct pagevec lru_pvec; | 1749 | struct pagevec lru_pvec; |
1775 | struct page *page; | 1750 | struct page *page; |
@@ -1824,7 +1799,7 @@ static int nfs_symlink(struct inode *dir, struct dentry *dentry, const char *sym | |||
1824 | return 0; | 1799 | return 0; |
1825 | } | 1800 | } |
1826 | 1801 | ||
1827 | static int | 1802 | int |
1828 | nfs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry) | 1803 | nfs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry) |
1829 | { | 1804 | { |
1830 | struct inode *inode = old_dentry->d_inode; | 1805 | struct inode *inode = old_dentry->d_inode; |
@@ -1869,7 +1844,7 @@ nfs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry) | |||
1869 | * If these conditions are met, we can drop the dentries before doing | 1844 | * If these conditions are met, we can drop the dentries before doing |
1870 | * the rename. | 1845 | * the rename. |
1871 | */ | 1846 | */ |
1872 | static int nfs_rename(struct inode *old_dir, struct dentry *old_dentry, | 1847 | int nfs_rename(struct inode *old_dir, struct dentry *old_dentry, |
1873 | struct inode *new_dir, struct dentry *new_dentry) | 1848 | struct inode *new_dir, struct dentry *new_dentry) |
1874 | { | 1849 | { |
1875 | struct inode *old_inode = old_dentry->d_inode; | 1850 | struct inode *old_inode = old_dentry->d_inode; |