diff options
author | Pavel Shilovsky <pshilovsky@samba.org> | 2012-09-18 19:20:26 -0400 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2012-09-24 22:46:26 -0400 |
commit | 4ad6504453644f57f7b6cf9c7bfc9d1372c5ad15 (patch) | |
tree | 21618335408bfeda325e151f3d3d1733cb38761c | |
parent | f0df737ee820ec62055baf2b28e24db4fb1ad71d (diff) |
CIFS: Move guery file info code to ops struct
and make cifs_get_file_info(_unix) calls static.
Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org>
Signed-off-by: Steve French <smfrench@gmail.com>
-rw-r--r-- | fs/cifs/cifsglob.h | 3 | ||||
-rw-r--r-- | fs/cifs/cifsproto.h | 2 | ||||
-rw-r--r-- | fs/cifs/inode.c | 12 | ||||
-rw-r--r-- | fs/cifs/smb1ops.c | 8 |
4 files changed, 20 insertions, 5 deletions
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index 8a69dae81d3a..500ecb921b85 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h | |||
@@ -236,6 +236,9 @@ struct smb_version_operations { | |||
236 | int (*query_path_info)(const unsigned int, struct cifs_tcon *, | 236 | int (*query_path_info)(const unsigned int, struct cifs_tcon *, |
237 | struct cifs_sb_info *, const char *, | 237 | struct cifs_sb_info *, const char *, |
238 | FILE_ALL_INFO *, bool *); | 238 | FILE_ALL_INFO *, bool *); |
239 | /* query file data from the server */ | ||
240 | int (*query_file_info)(const unsigned int, struct cifs_tcon *, | ||
241 | struct cifs_fid *, FILE_ALL_INFO *); | ||
239 | /* get server index number */ | 242 | /* get server index number */ |
240 | int (*get_srv_inum)(const unsigned int, struct cifs_tcon *, | 243 | int (*get_srv_inum)(const unsigned int, struct cifs_tcon *, |
241 | struct cifs_sb_info *, const char *, | 244 | struct cifs_sb_info *, const char *, |
diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h index b67f7758f422..2c6ad78a16cc 100644 --- a/fs/cifs/cifsproto.h +++ b/fs/cifs/cifsproto.h | |||
@@ -137,11 +137,9 @@ extern void cifs_fattr_to_inode(struct inode *inode, struct cifs_fattr *fattr); | |||
137 | extern struct inode *cifs_iget(struct super_block *sb, | 137 | extern struct inode *cifs_iget(struct super_block *sb, |
138 | struct cifs_fattr *fattr); | 138 | struct cifs_fattr *fattr); |
139 | 139 | ||
140 | extern int cifs_get_file_info(struct file *filp); | ||
141 | extern int cifs_get_inode_info(struct inode **inode, const char *full_path, | 140 | extern int cifs_get_inode_info(struct inode **inode, const char *full_path, |
142 | FILE_ALL_INFO *data, struct super_block *sb, | 141 | FILE_ALL_INFO *data, struct super_block *sb, |
143 | int xid, const __u16 *fid); | 142 | int xid, const __u16 *fid); |
144 | extern int cifs_get_file_info_unix(struct file *filp); | ||
145 | extern int cifs_get_inode_info_unix(struct inode **pinode, | 143 | extern int cifs_get_inode_info_unix(struct inode **pinode, |
146 | const unsigned char *search_path, | 144 | const unsigned char *search_path, |
147 | struct super_block *sb, unsigned int xid); | 145 | struct super_block *sb, unsigned int xid); |
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index ea7428a82a31..c6f6b02cf3b5 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c | |||
@@ -282,7 +282,8 @@ cifs_create_dfs_fattr(struct cifs_fattr *fattr, struct super_block *sb) | |||
282 | fattr->cf_flags |= CIFS_FATTR_DFS_REFERRAL; | 282 | fattr->cf_flags |= CIFS_FATTR_DFS_REFERRAL; |
283 | } | 283 | } |
284 | 284 | ||
285 | int cifs_get_file_info_unix(struct file *filp) | 285 | static int |
286 | cifs_get_file_info_unix(struct file *filp) | ||
286 | { | 287 | { |
287 | int rc; | 288 | int rc; |
288 | unsigned int xid; | 289 | unsigned int xid; |
@@ -550,7 +551,8 @@ cifs_all_info_to_fattr(struct cifs_fattr *fattr, FILE_ALL_INFO *info, | |||
550 | fattr->cf_gid = cifs_sb->mnt_gid; | 551 | fattr->cf_gid = cifs_sb->mnt_gid; |
551 | } | 552 | } |
552 | 553 | ||
553 | int cifs_get_file_info(struct file *filp) | 554 | static int |
555 | cifs_get_file_info(struct file *filp) | ||
554 | { | 556 | { |
555 | int rc; | 557 | int rc; |
556 | unsigned int xid; | 558 | unsigned int xid; |
@@ -560,9 +562,13 @@ int cifs_get_file_info(struct file *filp) | |||
560 | struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); | 562 | struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); |
561 | struct cifsFileInfo *cfile = filp->private_data; | 563 | struct cifsFileInfo *cfile = filp->private_data; |
562 | struct cifs_tcon *tcon = tlink_tcon(cfile->tlink); | 564 | struct cifs_tcon *tcon = tlink_tcon(cfile->tlink); |
565 | struct TCP_Server_Info *server = tcon->ses->server; | ||
566 | |||
567 | if (!server->ops->query_file_info) | ||
568 | return -ENOSYS; | ||
563 | 569 | ||
564 | xid = get_xid(); | 570 | xid = get_xid(); |
565 | rc = CIFSSMBQFileInfo(xid, tcon, cfile->fid.netfid, &find_data); | 571 | rc = server->ops->query_file_info(xid, tcon, &cfile->fid, &find_data); |
566 | switch (rc) { | 572 | switch (rc) { |
567 | case 0: | 573 | case 0: |
568 | cifs_all_info_to_fattr(&fattr, &find_data, cifs_sb, false); | 574 | cifs_all_info_to_fattr(&fattr, &find_data, cifs_sb, false); |
diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c index bb758476e139..cbbc122a501a 100644 --- a/fs/cifs/smb1ops.c +++ b/fs/cifs/smb1ops.c | |||
@@ -489,6 +489,13 @@ cifs_get_srv_inum(const unsigned int xid, struct cifs_tcon *tcon, | |||
489 | CIFS_MOUNT_MAP_SPECIAL_CHR); | 489 | CIFS_MOUNT_MAP_SPECIAL_CHR); |
490 | } | 490 | } |
491 | 491 | ||
492 | static int | ||
493 | cifs_query_file_info(const unsigned int xid, struct cifs_tcon *tcon, | ||
494 | struct cifs_fid *fid, FILE_ALL_INFO *data) | ||
495 | { | ||
496 | return CIFSSMBQFileInfo(xid, tcon, fid->netfid, data); | ||
497 | } | ||
498 | |||
492 | static char * | 499 | static char * |
493 | cifs_build_path_to_root(struct smb_vol *vol, struct cifs_sb_info *cifs_sb, | 500 | cifs_build_path_to_root(struct smb_vol *vol, struct cifs_sb_info *cifs_sb, |
494 | struct cifs_tcon *tcon) | 501 | struct cifs_tcon *tcon) |
@@ -672,6 +679,7 @@ struct smb_version_operations smb1_operations = { | |||
672 | .qfs_tcon = cifs_qfs_tcon, | 679 | .qfs_tcon = cifs_qfs_tcon, |
673 | .is_path_accessible = cifs_is_path_accessible, | 680 | .is_path_accessible = cifs_is_path_accessible, |
674 | .query_path_info = cifs_query_path_info, | 681 | .query_path_info = cifs_query_path_info, |
682 | .query_file_info = cifs_query_file_info, | ||
675 | .get_srv_inum = cifs_get_srv_inum, | 683 | .get_srv_inum = cifs_get_srv_inum, |
676 | .build_path_to_root = cifs_build_path_to_root, | 684 | .build_path_to_root = cifs_build_path_to_root, |
677 | .echo = CIFSSMBEcho, | 685 | .echo = CIFSSMBEcho, |